permdock 0.16.0 → 0.18.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 (384) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +3 -3
  3. package/dist/{adapter-context-CIQpQxbE.js → adapter-context-OHikyRqV.js} +1 -1
  4. package/dist/{adoption-scan-C2BCiUEG.js → adoption-scan-CxExBYSJ.js} +1 -1
  5. package/dist/agent/index.d.ts +2 -2
  6. package/dist/agent/index.js +1 -1
  7. package/dist/ai-sdk/index.d.ts +3 -3
  8. package/dist/ai-sdk/index.js +3 -3
  9. package/dist/approval-normalize-CUjgSsOl.js +189 -0
  10. package/dist/approval-policies-oNnckT12.d.ts +138 -0
  11. package/dist/{approval-prompt-3BqWczTt.d.ts → approval-prompt-Bg7gDSqd.d.ts} +1 -1
  12. package/dist/approvals/index.d.ts +5 -4
  13. package/dist/approvals/index.js +7 -6
  14. package/dist/{approvals-DnIBTuXE.js → approvals-DGId_hgJ.js} +3 -3
  15. package/dist/{approvers-B4r0N_Uz.js → approvers-BaNwKYgd.js} +20 -1
  16. package/dist/{arazzo-ClYz2Z0W.js → arazzo--riLuGY0.js} +4 -4
  17. package/dist/{arazzo-CHoYnQXO.js → arazzo-CEDbb-uM.js} +2 -2
  18. package/dist/{args-0FrVs5EH.js → args-iafbHiXn.js} +2 -5
  19. package/dist/astro/index.d.ts +4 -4
  20. package/dist/astro/index.js +2 -2
  21. package/dist/{audience-DTjR8xet.js → audience-B4YR9UpV.js} +1 -1
  22. package/dist/{auth--yPyZNgr.js → auth-j3Eu-j4h.js} +1 -1
  23. package/dist/authz-topic-Dbc-HDOS.js +15 -0
  24. package/dist/authzen/index.d.ts +5 -5
  25. package/dist/authzen/index.js +2 -2
  26. package/dist/{automation-C6Jg75xq.d.ts → automation-Bfa_wD1h.d.ts} +1 -1
  27. package/dist/better-auth/index.d.ts +1 -1
  28. package/dist/better-auth/index.js +10 -8
  29. package/dist/better-supabase/index.d.ts +335 -38
  30. package/dist/better-supabase/index.js +778 -117
  31. package/dist/{better-supabase-Dirf_8Ec.js → better-supabase-BJtQ-kNf.js} +26 -10
  32. package/dist/{bind-BNQA9JK9.js → bind-B4pMH9bm.js} +6 -6
  33. package/dist/{bind-YYjvfpB9.d.ts → bind-DR6ku3A9.d.ts} +7 -7
  34. package/dist/{budget-BELja5A9.js → budget-BBCPDOGP.js} +1 -1
  35. package/dist/{budget-hYsPz_yE.d.ts → budget-CNLsV2SL.d.ts} +1 -1
  36. package/dist/{build-instance-BWXqwQYU.js → build-instance-BFMFQdE_.js} +3 -2
  37. package/dist/{capability-Di9tiUvi.d.ts → capability-BZ_veK9o.d.ts} +1 -1
  38. package/dist/{capability-BqX94r07.js → capability-zN6T9fxe.js} +2 -3
  39. package/dist/{casbin-D_rVQ31U.js → casbin-DCQHkkyj.js} +2 -2
  40. package/dist/{casbin-C9EvElBb.js → casbin-bKC1FpEx.js} +2 -2
  41. package/dist/{casl-C4OINZHI.js → casl-CjBVJj8R.js} +2 -2
  42. package/dist/{casl-CHHoCldP.js → casl-CkBssiB1.js} +1 -1
  43. package/dist/catalog/index.d.ts +5 -5
  44. package/dist/catalog/index.js +7 -7
  45. package/dist/catalog-Caqhbdix.js +1 -0
  46. package/dist/{catalog-CGlSwU6j.js → catalog-D1fw8qif.js} +5 -5
  47. package/dist/{catalog-doc-DjMKzJp9.js → catalog-doc-C4DGfJCO.js} +3 -3
  48. package/dist/{catalog-operations-DeHTrJSV.js → catalog-operations-BD22drQf.js} +4 -4
  49. package/dist/{catalog-amPDr0JQ.js → catalog-zzNuR3sY.js} +3 -3
  50. package/dist/{challenge-DImNcR7B.js → challenge-B2O2OLEk.js} +2 -2
  51. package/dist/chat/index.d.ts +1 -1
  52. package/dist/chat/index.js +2 -2
  53. package/dist/chat-sdk/index.d.ts +3 -3
  54. package/dist/{checks-CGkP3Z7A.js → checks-fyDOhcz0.js} +33 -1
  55. package/dist/claude-agent/index.d.ts +3 -3
  56. package/dist/claude-agent/index.js +2 -2
  57. package/dist/clerk/index.d.ts +2 -2
  58. package/dist/clerk/index.js +10 -7
  59. package/dist/cli/bin.js +1 -1
  60. package/dist/cli/index.d.ts +5 -5
  61. package/dist/cli/index.js +3 -3
  62. package/dist/client-CH7vzSAY.d.ts +32 -0
  63. package/dist/cloud/index.d.ts +8 -8
  64. package/dist/cloud/index.js +1 -1
  65. package/dist/{cloud-DdaJ7ILM.js → cloud-C0vXBmLG.js} +4 -4
  66. package/dist/{codemod-B1USJS7a.js → codemod-C-L0w-u7.js} +3 -3
  67. package/dist/{codemod-ammy6wv4.js → codemod-eYI1FbeJ.js} +395 -8
  68. package/dist/{collect-DnXL4B8c.js → collect-CU85z6Ta.js} +4 -4
  69. package/dist/{collect-WCl8cJQV.js → collect-D878zLDP.js} +4 -4
  70. package/dist/collect-KCtOigxx.js +1 -0
  71. package/dist/compile/index.d.ts +1 -1
  72. package/dist/compile/index.js +1 -1
  73. package/dist/{compile-EzEMB-7v.js → compile-B_oJqmIg.js} +4 -4
  74. package/dist/{compile-BEklRUYo.d.ts → compile-DBm0ub4p.d.ts} +2 -2
  75. package/dist/{completion--Y4YItFZ.js → completion-Dauc6pVT.js} +3 -3
  76. package/dist/{config-CcLlvEYW.js → config-COHmivz9.js} +4 -4
  77. package/dist/{config-BQ77xMZk.js → config-DWp2PucY.js} +2 -2
  78. package/dist/{config-report-DVMOLJ7F.js → config-report-DKpFm5ID.js} +2 -2
  79. package/dist/{context-BnIzxTNE.js → context-DeammvFl.js} +2 -2
  80. package/dist/convex/index.d.ts +4 -4
  81. package/dist/convex/index.js +3 -3
  82. package/dist/{core-lxoANyai.js → core-B8sLve3z.js} +7 -7
  83. package/dist/{core-CFepFiDP.d.ts → core-D87h2kpR.d.ts} +2 -2
  84. package/dist/{create-BLPKnJKa.js → create-3A7J9KRR.js} +6 -5
  85. package/dist/{create-CDd9c22W.d.ts → create-BrQXL-Wt.d.ts} +6 -6
  86. package/dist/{create-BPUopdfL.d.ts → create-BzwjZuRS.d.ts} +7 -7
  87. package/dist/{create-Coq5fIrq.js → create-C-tm3KIF.js} +5 -5
  88. package/dist/{create-DBvUsgzK.d.ts → create-CtoT1lIQ.d.ts} +4 -4
  89. package/dist/{credential-CyyyvCsL.js → credential-B3Hj4puZ.js} +4 -3
  90. package/dist/{credentials-CdDxp7jN.js → credentials-dkycUsY3.js} +1 -1
  91. package/dist/decision-CaG5_eNJ.js +21 -0
  92. package/dist/{delegation-CDB6_keF.js → delegation-aK4T_5WU.js} +3 -3
  93. package/dist/delivery/index.d.ts +4 -4
  94. package/dist/delivery/index.js +1 -1
  95. package/dist/{denied-text-DHldhVUv.d.ts → denied-text-DlIxt8fh.d.ts} +1 -1
  96. package/dist/{describe-BbFPBSms.d.ts → describe-BKtC_8PG.d.ts} +1 -1
  97. package/dist/{describe-Bb4hGK5d.js → describe-BZAlPHxT.js} +2 -1
  98. package/dist/{diff-DfmYaIhB.js → diff-BnNHqtHj.js} +8 -8
  99. package/dist/{diff-CxtbOi2l.js → diff-CBCzOTWM.js} +2 -2
  100. package/dist/{doctor-D1Xnmy6u.js → doctor-CkYKCuX7.js} +233 -30
  101. package/dist/{doctor-CwYc2lJb.js → doctor-xUpR5rXg.js} +3 -3
  102. package/dist/drizzle/index.d.ts +3 -3
  103. package/dist/drizzle/index.js +1 -1
  104. package/dist/elysia/index.d.ts +4 -4
  105. package/dist/elysia/index.js +3 -3
  106. package/dist/{errors-Vpu6rKHl.js → errors-BhRkoNS7.js} +0 -2
  107. package/dist/{errors-BIM4MFsJ.d.ts → errors-TpzkEKgJ.d.ts} +1 -1
  108. package/dist/{evaluate-BAmf_AQd.js → evaluate-Czbj7thS.js} +18 -15
  109. package/dist/{evaluations-DOWuBpWv.d.ts → evaluations-CisTTURl.d.ts} +3 -3
  110. package/dist/{evaluations-IBceAeKT.js → evaluations-h3KoJAPa.js} +3 -22
  111. package/dist/eve/index.d.ts +4 -4
  112. package/dist/eve/index.js +3 -3
  113. package/dist/express/index.d.ts +4 -4
  114. package/dist/express/index.js +3 -3
  115. package/dist/fastify/index.d.ts +4 -4
  116. package/dist/fastify/index.js +3 -3
  117. package/dist/{fetch-adapter-BIbBAtPZ.d.ts → fetch-adapter-BdmfnbJM.d.ts} +2 -2
  118. package/dist/{fetch-adapter-dPTgJVHd.js → fetch-adapter-DH-NJPbL.js} +2 -2
  119. package/dist/{fields-DI8s3cPl.js → fields-CrjL6A49.js} +3 -3
  120. package/dist/{files-B3AA05f1.js → files-CfiRtQ-m.js} +1 -1
  121. package/dist/{fixtures-Bm4_K1ke.js → fixtures-Cemqurt8.js} +10 -4
  122. package/dist/{flags-DXjoTVbS.js → flags-BlmpmXoY.js} +2 -2
  123. package/dist/{from-snapshot-DCakWRsr.js → from-snapshot-DMlSSo9b.js} +14 -12
  124. package/dist/{gen-DwgCSC6V.js → gen-BEIN-DRM.js} +2 -2
  125. package/dist/{gen-DuAhghDw.js → gen-mf-MRwVr.js} +9 -9
  126. package/dist/{generate-CRVV5V7l.js → generate-BqkZq8Dr.js} +2 -2
  127. package/dist/{grantee-conditions-BrYPe-w0.js → grantee-conditions-DX4K_gGI.js} +1 -1
  128. package/dist/{grantee-match-7RZZvoT_.js → grantee-match-BP-k4vRJ.js} +2 -2
  129. package/dist/h3/index.d.ts +4 -4
  130. package/dist/h3/index.js +3 -3
  131. package/dist/{helpers-DJicaG6f.js → helpers-DmqGy63f.js} +85 -13
  132. package/dist/hono/index.d.ts +4 -4
  133. package/dist/hono/index.js +3 -3
  134. package/dist/{hosted-DVxlLZMe.d.ts → hosted-BFNXwcjd.d.ts} +1 -1
  135. package/dist/{hosted-D0IzESu_.js → hosted-waouw2V-.js} +12 -10
  136. package/dist/{http-DOL33cO0.js → http-DhMWeB_h.js} +1 -1
  137. package/dist/{import-CNBF96hB.js → import-C1XXpG_m.js} +4 -4
  138. package/dist/{import-Dfe2unKO.js → import-DObwEota.js} +3 -3
  139. package/dist/{index-BinlXeU-.d.ts → index-BhnOOnp9.d.ts} +2 -2
  140. package/dist/{index-ymept53A.d.ts → index-CVGio3cH.d.ts} +4 -4
  141. package/dist/{index-DJwEgYzA.d.ts → index-CdMOd-GY.d.ts} +17 -11
  142. package/dist/{index-Cay5-Kvx.d.ts → index-CdUTE6qd.d.ts} +11 -10
  143. package/dist/{index-Dj2qF9VC.d.ts → index-Dfv9Toct.d.ts} +1 -1
  144. package/dist/{index-CV-7DWeD.d.ts → index-rFp6X_QP.d.ts} +4 -4
  145. package/dist/index.d.ts +18 -16
  146. package/dist/index.js +24 -20
  147. package/dist/{init-BUo2G-FI.js → init-CNJ8lLjo.js} +5 -5
  148. package/dist/{init-C6cWP3xW.js → init-DS3PEsCG.js} +5 -5
  149. package/dist/{instance-options-CoHn-0e8.d.ts → instance-options-2sFGSdsf.d.ts} +2 -2
  150. package/dist/{instance-snapshot-DuWf1cT3.js → instance-snapshot-BWa71my8.js} +15 -12
  151. package/dist/jwt/index.d.ts +4 -4
  152. package/dist/jwt/index.js +3 -3
  153. package/dist/{kernel-BD8QuMnv.js → kernel-30Z2zM_d.js} +10 -10
  154. package/dist/kysely/index.d.ts +3 -3
  155. package/dist/kysely/index.js +1 -1
  156. package/dist/{load-DjSU5KXO.js → load-BaEamml-.js} +1 -1
  157. package/dist/load-CjnlPxpL.js +1 -0
  158. package/dist/{login-D1MHOomI.js → login-BgK5Jloo.js} +4 -4
  159. package/dist/{login-DCKE5pVy.js → login-DUVzBLh7.js} +4 -4
  160. package/dist/{manifest-BXTbHNIV.js → manifest-BdzBobNK.js} +1 -1
  161. package/dist/{manifest-schema-DQkBK2Mr.js → manifest-schema-CsFsYLF-.js} +1 -1
  162. package/dist/{manifest-Cft51TLK.js → manifest-wclLWBVH.js} +37 -37
  163. package/dist/{map-claims-C-nv08_n.js → map-claims-PQwHynxV.js} +25 -11
  164. package/dist/{map-error-pasIGqMT.js → map-error-BH16Ah8P.js} +1 -1
  165. package/dist/mcp/index.d.ts +8 -8
  166. package/dist/mcp/index.js +9 -9
  167. package/dist/{migrate-BJHxQqT5.js → migrate-BbY5-Khy.js} +4 -4
  168. package/dist/{module-values-B1EVTkHP.js → module-values-B8tNIxdd.js} +2 -2
  169. package/dist/nest/index.d.ts +4 -4
  170. package/dist/nest/index.js +3 -3
  171. package/dist/next/index.d.ts +45 -13
  172. package/dist/next/index.js +68 -30
  173. package/dist/next/plugin.d.ts +1 -1
  174. package/dist/next/plugin.js +2 -2
  175. package/dist/node/index.d.ts +4 -4
  176. package/dist/node/index.js +2 -2
  177. package/dist/openai/index.d.ts +4 -4
  178. package/dist/openai/index.js +3 -3
  179. package/dist/openapi/index.d.ts +2 -2
  180. package/dist/{openapi-BwWkHxvW.js → openapi-C4gFqeRz.js} +4 -4
  181. package/dist/{openapi-DSzQN7Zu.js → openapi-zMEB9qxn.js} +5 -5
  182. package/dist/{operation-findings-CXtFzlKJ.js → operation-findings-CVwJHEu_.js} +1 -1
  183. package/dist/operation-risks-BKOcTv8J.js +13 -0
  184. package/dist/operations-Bm9HFecz.js +89 -0
  185. package/dist/orpc/index.d.ts +5 -5
  186. package/dist/orpc/index.js +3 -3
  187. package/dist/otel/index.d.ts +3 -3
  188. package/dist/otel/index.js +1 -1
  189. package/dist/{output-DlICTjBh.js → output-BFWLER4r.js} +1 -1
  190. package/dist/output-files-BYscrQl-.js +1 -0
  191. package/dist/{output-files-BIQ_9pIs.js → output-files-CM0BnH05.js} +1 -1
  192. package/dist/{ownership-qqBuGJXr.js → ownership-D-mIt-w0.js} +6 -6
  193. package/dist/{parse-1_ZheTW5.js → parse-UTC-sDrt.js} +2 -2
  194. package/dist/{parse-local-manifest-DEiCF4ah.js → parse-local-manifest-CxcSMQgl.js} +2 -2
  195. package/dist/{parse-local-manifest-CCmbhnxP.d.ts → parse-local-manifest-DvjTQNuO.d.ts} +1 -1
  196. package/dist/{parse-request-CwCZpyjV.js → parse-request-DOBVaeiQ.js} +1 -1
  197. package/dist/pdp/index.d.ts +3 -3
  198. package/dist/pdp/index.js +3 -3
  199. package/dist/{peer-Q0fuZ6hx.js → peer-BuK9F53f.js} +1 -1
  200. package/dist/{peer-C9LvBCcb.js → peer-n-swIV4H.js} +1 -1
  201. package/dist/{permdock-BvjivVb9.js → permdock-D-_WrdKu.js} +205 -102
  202. package/dist/{permdock-CprAPN3w.d.ts → permdock-ffY4CMd9.d.ts} +101 -131
  203. package/dist/{permissions-CYcHj_w7.js → permissions-B3ggI88M.js} +2 -2
  204. package/dist/{permissions-CVXmRILq.js → permissions-BaoLxy66.js} +1 -13
  205. package/dist/{pg-DQTqRrou.js → pg-Ddxsd5ZB.js} +2 -2
  206. package/dist/{policy-BycVKnXv.d.ts → policy-BtKSApSt.d.ts} +1 -1
  207. package/dist/{policy-CLQ8__GF.js → policy-cV_wwPb8.js} +5 -4
  208. package/dist/{policy-from-catalog-CU3An8uP.js → policy-from-catalog-B68hGC0S.js} +9 -8
  209. package/dist/{policy-types-DGIO_gxq.d.ts → policy-types-D-GwfQTc.d.ts} +72 -19
  210. package/dist/{postgrest-DAxFltvO.js → postgrest-BrjrckDG.js} +74 -19
  211. package/dist/{postgrest-D5nUGm-c.d.ts → postgrest-D84p5dbA.d.ts} +12 -7
  212. package/dist/{powersync-CBhTBhG2.js → powersync-9PYOE1wt.js} +158 -21
  213. package/dist/{powersync-DAfo0EL5.js → powersync-DStC_g0B.js} +3 -3
  214. package/dist/powersync-xNRlC4jN.js +1 -0
  215. package/dist/preset/index.js +1 -1
  216. package/dist/{preset-BjLzeFpp.js → preset-pPrVyGU5.js} +74 -7
  217. package/dist/prisma/index.d.ts +2 -2
  218. package/dist/prisma/index.js +1 -1
  219. package/dist/{protected-action-QEA8arRB.js → protected-action-B40tU3yP.js} +15 -5
  220. package/dist/{protected-action-D8x73IGm.d.ts → protected-action-Ds_EUY8B.d.ts} +14 -7
  221. package/dist/{protected-action-DUYqb-Ma.js → protected-action-OpOxtTsN.js} +1 -1
  222. package/dist/{provider-C55OGXJ7.js → provider-CY4TSSJo.js} +2 -2
  223. package/dist/{provider-DfLeek9O.d.ts → provider-OtnIiFWm.d.ts} +1 -1
  224. package/dist/{provider-store-CaTv00tr.js → provider-store-BQP_pp8s.js} +2 -2
  225. package/dist/{pull-CQCGy1gv.js → pull-DLP4I1Kl.js} +7 -7
  226. package/dist/pull-UBjDnf4b.js +1 -0
  227. package/dist/{push-Dq_ca4-j.js → push-BSb8j1EW.js} +8 -8
  228. package/dist/{pushed-policy-CDuOL2de.js → pushed-policy-BecMsTtM.js} +1 -1
  229. package/dist/{pushed-policy-CryQheKq.d.ts → pushed-policy-Ck3FZcoy.d.ts} +1 -1
  230. package/dist/react/index.d.ts +8 -8
  231. package/dist/react/index.js +6 -6
  232. package/dist/react/provider-client.d.ts +1 -1
  233. package/dist/react/provider-client.js +1 -1
  234. package/dist/react-native/index.d.ts +104 -39
  235. package/dist/react-native/index.js +199 -40
  236. package/dist/refresh-on-L9UOwATg.d.ts +49 -0
  237. package/dist/{replay-Bs9Df2fQ.d.ts → replay-E5X9E1lC.d.ts} +1 -1
  238. package/dist/{request-context-Duzdf0cd.js → request-context-DM6_jY1n.js} +2 -2
  239. package/dist/{request-schema-DhX7UbfQ.js → request-schema-CMP8Cmxd.js} +5 -0
  240. package/dist/resend/index.d.ts +4 -4
  241. package/dist/{resolve-names-Y1Cb22cp.js → resolve-names-CBl4r4_r.js} +6 -6
  242. package/dist/{rls-tHu7N_Pe.js → rls-DGBL-jDY.js} +20 -20
  243. package/dist/{rls-C5ZGzR_B.js → rls-pAHGYgTb.js} +4 -4
  244. package/dist/{role-builder-BK2-T6oD.js → role-builder-CMW4wWzn.js} +3 -157
  245. package/dist/{rpc-vHIwyXCp.js → rpc-KwX_Jcxz.js} +2 -2
  246. package/dist/{run-DUq1xU4K.js → run-B7lv3NuK.js} +8 -40
  247. package/dist/run-UPbacxPg.js +1 -0
  248. package/dist/{run-ticket-DfnZCh-u.js → run-ticket-CjvXr6wj.js} +1 -1
  249. package/dist/{run-ticket-ylovhyFQ.d.ts → run-ticket-DPaD27_r.d.ts} +2 -2
  250. package/dist/{runtime-BGnrOkVH.js → runtime-rf0ZuyF3.js} +1 -1
  251. package/dist/{saas-DK4V-3Is.js → saas-B8H1MsQ3.js} +13 -10
  252. package/dist/{scan-C3HRH9Fs.js → scan-0r3OZqqK.js} +1 -1
  253. package/dist/{schema-DvXvxPhQ.js → schema-B_9tXrbG.js} +1 -1
  254. package/dist/{schema-BOJjqlWL.js → schema-CuX70xgH.js} +15 -2
  255. package/dist/scim/index.d.ts +1 -1
  256. package/dist/scim/index.js +1 -1
  257. package/dist/{scim-jJBJ7g1Z.js → scim-C30QBBoF.js} +2 -1
  258. package/dist/{scim-D8YupzX1.js → scim-CovliQUg.js} +2 -2
  259. package/dist/{scopes-0Up_UA2t.js → scopes-BSdYaGHs.js} +9 -40
  260. package/dist/server/index.d.ts +11 -11
  261. package/dist/server/index.js +8 -8
  262. package/dist/{server-3cVlTLde.js → server-D0PW6ZCw.js} +2 -2
  263. package/dist/{server-types-CyRN0-Cd.d.ts → server-types-3OnXjZ2D.d.ts} +8 -8
  264. package/dist/{shared-l0oGGetg.js → shared-BRmCJxDK.js} +2 -2
  265. package/dist/{shared-DrGLwM3s.js → shared-DyYVEjKC.js} +2 -2
  266. package/dist/{sink-B5zoUW_O.d.ts → sink-ogbVkyeo.d.ts} +2 -2
  267. package/dist/{skills-Celu2W6v.js → skills-B4MPRxQd.js} +2 -2
  268. package/dist/{skills-B2qTbaQa.js → skills-C9sTD70r.js} +2 -2
  269. package/dist/{snapshot-CXlzi69u.js → snapshot-DN_8J27z.js} +6 -2
  270. package/dist/{snapshot-cache-BjAWkchD.d.ts → snapshot-cache-B4YvlGG_.d.ts} +20 -6
  271. package/dist/{snapshot-cache-Bx_4xC_6.js → snapshot-cache-B66h7FBK.js} +25 -8
  272. package/dist/solid/index.d.ts +7 -7
  273. package/dist/solid/index.js +6 -6
  274. package/dist/solid-start/index.d.ts +4 -4
  275. package/dist/solid-start/index.js +3 -3
  276. package/dist/{sources-oB1Hg1Fm.d.ts → sources-xdQShLDU.d.ts} +1 -1
  277. package/dist/{src-C_pi2Rnh.js → src-Brzq_0in.js} +193 -128
  278. package/dist/ssf/index.d.ts +3 -3
  279. package/dist/ssf/index.js +1 -1
  280. package/dist/{standard-webhooks-DOYEuOLx.d.ts → standard-webhooks-BfPaZ6T1.d.ts} +2 -2
  281. package/dist/{types-tQB2CEnY.d.ts → store-DYeB-_U3.d.ts} +114 -113
  282. package/dist/{store-RNFvaJJv.js → store-DmVqy74I.js} +13 -7
  283. package/dist/{store-options-Dil3lraY.js → store-options--zWn48PK.js} +76 -7
  284. package/dist/{stores-DxZWDXCs.js → stores-BYFopOm1.js} +3 -3
  285. package/dist/{stores-DZJvxFIZ.d.ts → stores-EPul_8MN.d.ts} +5 -6
  286. package/dist/{stream-9y9qw51m.d.ts → stream-W2RuUYly.d.ts} +1 -1
  287. package/dist/{subject-BGoM5o8B.js → subject-C7RddW0G.js} +8 -1
  288. package/dist/supabase/client.d.ts +2 -0
  289. package/dist/supabase/client.js +21 -0
  290. package/dist/supabase/index.d.ts +37 -6
  291. package/dist/supabase/index.js +6 -5
  292. package/dist/supabase/middleware.d.ts +8 -7
  293. package/dist/supabase/middleware.js +6 -6
  294. package/dist/{supabase-CDHMsDD0.js → supabase-BiViJpQ4.js} +31 -8
  295. package/dist/{supabase-DYWnT800.js → supabase-CogTyJH2.js} +3 -3
  296. package/dist/supabase-hook-BN46IrVI.js +1 -0
  297. package/dist/{supabase-hook-HPgwYb9V.js → supabase-hook-DX38Hj8h.js} +393 -32
  298. package/dist/{supautils-SwE642N1.js → supautils-BGf6zRvM.js} +12 -12
  299. package/dist/svelte/index.d.ts +7 -7
  300. package/dist/svelte/index.js +8 -8
  301. package/dist/svelte/runtime.d.ts +3 -3
  302. package/dist/svelte/runtime.js +3 -3
  303. package/dist/svelte/source.d.ts +7 -7
  304. package/dist/svelte/source.js +5 -5
  305. package/dist/sveltekit/index.d.ts +4 -4
  306. package/dist/sveltekit/index.js +2 -2
  307. package/dist/{tables-DimBcVWY.js → tables-BfOk0ymL.js} +7 -7
  308. package/dist/tanstack-start/index.d.ts +4 -4
  309. package/dist/tanstack-start/index.js +2 -2
  310. package/dist/{tenancy-5d1zVBvK.js → tenancy-DvOHHk3-.js} +1 -1
  311. package/dist/terminal/index.d.ts +5 -5
  312. package/dist/terminal/index.js +6 -6
  313. package/dist/testing/core.d.ts +1 -1
  314. package/dist/testing/core.js +1 -1
  315. package/dist/testing/fixtures/index.d.ts +1 -1
  316. package/dist/testing/fixtures/index.js +2 -2
  317. package/dist/testing/index.d.ts +29 -22
  318. package/dist/testing/index.js +120 -48
  319. package/dist/testing/saas/index.d.ts +3 -3
  320. package/dist/testing/saas/index.js +2 -2
  321. package/dist/testing/saas/permissions.js +1 -1
  322. package/dist/token-D6pWn8Uj.d.ts +11 -0
  323. package/dist/{token-DC9EQiet.js → token-DaMnIU9O.js} +24 -8
  324. package/dist/{tool-refusal-Qpjs_W6M.js → tool-refusal-D4spOJ7I.js} +1 -1
  325. package/dist/trpc/index.d.ts +5 -5
  326. package/dist/trpc/index.js +3 -3
  327. package/dist/{type-helpers-c7Xo_2Cu.d.ts → type-helpers-i1EJ3Eb1.d.ts} +1 -1
  328. package/dist/{types-Cklw5hJo.d.ts → types-3Y8UpFkF.d.ts} +40 -1
  329. package/dist/{types-DlelvQk4.d.ts → types-B8qUkGja.d.ts} +2 -2
  330. package/dist/{types-CN0LsqbK.d.ts → types-CCEeSCMB.d.ts} +3 -3
  331. package/dist/{types-B2efzoSX.d.ts → types-CDVXR6YD.d.ts} +1 -1
  332. package/dist/{types-DsHGPtkR.d.ts → types-Ck1KOfug.d.ts} +2 -2
  333. package/dist/{types-DLvhVm1r.d.ts → types-CqcsNCaN.d.ts} +16 -7
  334. package/dist/{types-BB-zWDcR.d.ts → types-D-JO7lh8.d.ts} +5 -5
  335. package/dist/{types-CEinc15V.d.ts → types-D19MK4t-.d.ts} +3 -4
  336. package/dist/{types-B6ExllNo.d.ts → types-DGf_cpKF.d.ts} +2 -2
  337. package/dist/{types-rCRV4Ge-.d.ts → types-DmbfLu2p.d.ts} +4 -4
  338. package/dist/{types-ZzRGoViD.d.ts → types-NYoj8JBm.d.ts} +2 -2
  339. package/dist/{types-CWBsAwqn.d.ts → types-o1vu6Ks3.d.ts} +4 -4
  340. package/dist/unplugin/index.d.ts +1 -1
  341. package/dist/unplugin/index.js +2 -2
  342. package/dist/usage-Cl5eb-e1.js +1 -0
  343. package/dist/{usage-CPXeuAdT.js → usage-DC0UKe6C.js} +6 -6
  344. package/dist/{usage-CfZCQd0F.js → usage-DYtRVkcN.js} +2 -2
  345. package/dist/{validation-error-uvp-kyfO.d.ts → validation-error-Dx8PipbO.d.ts} +1 -1
  346. package/dist/{verify-DfT0QYNh.js → verify-Bpj0hauG.js} +19 -19
  347. package/dist/{version-cache-Df11C2Qp.d.ts → version-cache-DzNKWiI6.d.ts} +9 -3
  348. package/dist/{views-CD8wuL4Z.js → views-MWmJ6Y4P.js} +1 -1
  349. package/dist/vue/index.d.ts +7 -7
  350. package/dist/vue/index.js +6 -6
  351. package/dist/{waiter-CqUKX6CY.d.ts → waiter-NK_UuZbb.d.ts} +2 -2
  352. package/dist/{watch-DAkjm75Y.js → watch-CBHADqBH.js} +3 -3
  353. package/dist/watch-OYwAPCzx.js +1 -0
  354. package/dist/webmcp/index.d.ts +1 -1
  355. package/dist/webmcp/index.js +1 -1
  356. package/dist/{where-scope-DlCdCM_8.js → where-scope-BKrqUDVk.js} +5 -5
  357. package/dist/{who-can-BoDJm0Nc.js → who-can-KhVWMxtf.js} +4 -4
  358. package/dist/workflow/index.d.ts +3 -3
  359. package/dist/workflow/index.js +5 -4
  360. package/dist/workflow-sdk/index.d.ts +4 -4
  361. package/dist/{wrap-DxXB54Wu.d.ts → wrap-BHGA-SMM.d.ts} +2 -2
  362. package/dist/{wrap-B2wziJI_.js → wrap-C5PWzgkq.js} +1 -1
  363. package/package.json +8 -5
  364. package/schemas/approval-request-v1.json +5 -0
  365. package/schemas/catalog-v1.json +18 -2
  366. package/schemas/cli-result-v1.json +0 -2
  367. package/schemas/snapshot-v1.json +9 -0
  368. package/schemas/supabase-manifest-v1.json +1 -1
  369. package/skills/permdock-approvals/SKILL.md +8 -8
  370. package/skills/permdock-approvals/references/stores-and-resume.md +7 -3
  371. package/skills/permdock-audit/SKILL.md +1 -1
  372. package/skills/permdock-wire/references/adapters.md +3 -1
  373. package/dist/action-result-BcudBQOF.d.ts +0 -19
  374. package/dist/catalog-D3oS2GH3.js +0 -1
  375. package/dist/collect-D-eroIfV.js +0 -1
  376. package/dist/load-Dm0pSYH3.js +0 -1
  377. package/dist/output-files-BHOIlrfD.js +0 -1
  378. package/dist/powersync-0QVP_DuR.js +0 -1
  379. package/dist/pull-CCAChKuy.js +0 -1
  380. package/dist/renames-CGj7YwcQ.js +0 -175
  381. package/dist/run-C5P3x1EI.js +0 -1
  382. package/dist/supabase-hook-qsewAVZY.js +0 -1
  383. package/dist/usage-DmmO_xjJ.js +0 -1
  384. package/dist/watch-CuPz0D2M.js +0 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: permdock-approvals
3
- description: Requires human approval on PermDock grants, notifies approvers and resumes the approved call. Use when adding approval to a destructive or money-moving action (delete, publish, pay, refund, transfer), choosing approvers with approval by, user(), relation(), distinct, quorum, ttl, escalation or staleOn, ordering approvers with mode and stages, covering an approver with an ApprovalDelegation, loading approval rules as data with an ApprovalPolicySource, separating preparer and approver with exclusiveWith, labelling operations with risk and effects meta, mounting approvalsHandler with an ApprovalStore, sending approval emails (approvalEmail) or chat cards (approvalCard, approvalActions) from approvalPrompt, parking a background run on an ApprovalWaiter (pollingApprovalWaiter, workflowSdkWaiter), resuming with the PermDock-Approval header, mapping approval-required to an agent runtime, MCP elicitation or AG-UI interrupt, or fixing doctor PD017, PD018 or PD024.
3
+ description: Requires human approval on PermDock grants, notifies approvers and resumes the approved call. Use when adding approval to a destructive or money-moving action (delete, publish, pay, refund, transfer), choosing approvers with approval by, user(), relation(), manager(), mode confirm or authorize, quorum, ttl, escalation, staleOn or approvalFingerprint, ordering approvers with combine and stages, covering an approver with an ApprovalDelegation, loading approval rules as data with an ApprovalPolicySource, separating preparer and approver with exclusiveWith, labelling operations with risk and effects meta, mounting approvalsHandler with an ApprovalStore, sending approval emails (approvalEmail) or chat cards (approvalCard, approvalActions) from approvalPrompt, parking a background run on an ApprovalWaiter (pollingApprovalWaiter, workflowSdkWaiter), resuming with the PermDock-Approval header, mapping approval-required to an agent runtime, MCP elicitation or AG-UI interrupt, or fixing doctor PD017, PD018 or PD024.
4
4
  license: MIT
5
5
  metadata:
6
6
  author: ScaleDockHQ
@@ -25,12 +25,12 @@ metadata:
25
25
 
26
26
  ## Invariants
27
27
 
28
- 1. The requester never approves by default. The actor is always refused. The principal is refused unless the grant sets `distinct: false`, and `requireDistinctApprover` on the handler refuses it even then. A delegate is held to the same rule, and so is the delegator. One hop, and `until` is required.
28
+ 1. The requester never approves by default. The actor is always refused. The principal is refused unless the grant sets `mode: "confirm"`, and `requireDistinctApprover` on the handler refuses it even then. A delegate is held to the same rule, and so is the delegator. One hop, and `until` is required.
29
29
  2. The approver comes from authentication on the approval surface, never from the request body, a tool argument or a link.
30
30
  3. One approval resumes one call. The token binds permission, resource, subject and actor, the resume re-runs `decide`, and `consume` spends the approval once.
31
31
  4. `can` returns `false` for `approval-required`. Only `decide`, `assert` and the adapters see the third outcome.
32
32
  5. Quorum, ttl and escalation live on the grant, not in the store. A grant's `ttl` can shorten the store's window, never extend it.
33
- 6. A `relation()` approver is matched only through facts the approvals handler reads from the app's `RelationSource` at verdict time, never from a request body.
33
+ 6. A `relation()` or `manager()` approver is matched only through facts the approvals handler reads from the app's `RelationSource` at verdict time, never from a request body.
34
34
  7. Approval rules kept as data only add stages. A source that fails to load denies every call an allow would grant.
35
35
  8. A link never approves. An email or chat prompt carries the request id, never the token, and links to the app's approval page where the approver signs in. Chat buttons carry the request id and are applied as the platform-verified clicking user.
36
36
  9. A wake carries no verdict. `waiter.wake(token)` only ends a wait; the run decides again through `resumeApproval`, which reads the store.
@@ -51,9 +51,9 @@ metadata:
51
51
  });
52
52
  ```
53
53
 
54
- For sign-off in order, use `mode: 'sequential'` with `stages: [{ by, quorum? }]` (or `mode: 'all'` for any order); one person signs one stage. `user('u_cfo')` names one person, and `relation(permissions.expense, 'manager')` names whoever holds the relation on the row.
55
- Add `distinct: false` only where the user confirms their own agent's call and no money, deletion or access change sits behind it.
56
- ✓ `permdock doctor` reports no PD017 (sensitive verb without approval), and every PD024 (`distinct: false`) is deliberate.
54
+ For sign-off in order, use `combine: 'sequential'` with `stages: [{ by, quorum? }]` (or `combine: 'all'` for any order); one person signs one stage. `user('u_cfo')` names one person, and `relation(permissions.expense, 'manager')` names whoever holds the relation on the row.
55
+ Add `mode: "confirm"` only where the user confirms their own agent's call and no money, deletion or access change sits behind it.
56
+ ✓ `permdock doctor` reports no PD017 (sensitive verb without approval), and every PD024 (`mode: "confirm"`) is deliberate.
57
57
 
58
58
  2. **Bind content when it matters.** Declare `version: 'updatedAt'` (or a revision counter) on the `resource()` and add `staleOn: 'resource-change'` to the approval, so a changed row resumes as `stale-approval` and asks again.
59
59
  ✓ `definePolicy` accepts the grant (it throws when the resource has no `version` or the action is a collection action).
@@ -77,12 +77,12 @@ metadata:
77
77
  ## Verify before done
78
78
 
79
79
  - [ ] Every destructive or money-moving action an agent or a user can trigger has `approval`, or a `deny` on the same leaf.
80
- - [ ] Each `distinct: false` (PD024) is a deliberate self-confirmation with nothing irreversible behind it.
80
+ - [ ] Each `mode: "confirm"` (PD024) is a deliberate self-confirmation with nothing irreversible behind it.
81
81
  - [ ] Roles that must not be held together set `exclusiveWith`, and PD018 is clean.
82
82
  - [ ] The store survives the deployment: no `memoryApprovalStore` on serverless or across replicas.
83
83
  - [ ] No resume token is read from model output or tool arguments, and each resume re-runs `decide`.
84
84
  - [ ] A custom `ApprovalStore` passes `testApprovalStore` from `permdock/testing`.
85
- - [ ] Grants with `relation()` approvers have a handler with `relations`, and nothing fills `verdict.relations` from client input.
85
+ - [ ] Grants with `relation()` or `manager()` approvers have a handler with `relations`, and nothing fills `verdict.relations` from client input.
86
86
  - [ ] No email, chat message or URL carries the approval token or an approve link; `approvalUrl` is https and opens a page behind sign-in.
87
87
  - [ ] Approval recipients are decided by `deliver` from server-loaded principals, never from the request body, and the requester is not among them.
88
88
  - [ ] Chat approve and reject clicks go through `approvalActions` (or `resolveAction`), never a handler that trusts the button value alone.
@@ -15,7 +15,7 @@ export const { protect } = createPermDock(policy, { subject, store });
15
15
  // Routes for approvers: GET /pending, GET /mine, GET /:id, GET /:id/signature, POST /:id/approve, POST /:id/reject
16
16
  const handler = approvalsHandler(store, {
17
17
  subject: (request) => approverFromSession(request), // the approver, from real authentication
18
- requireDistinctApprover: false, // true refuses the principal even where a grant sets distinct: false
18
+ requireDistinctApprover: false, // true refuses the principal even where a grant sets mode: "confirm"
19
19
  relations, // RelationSource: needed when a grant uses relation() approvers
20
20
  permissions, // the permission tree, for relation approvers reached through links
21
21
  });
@@ -73,7 +73,7 @@ A gate in your own code resumes the same way with `resumeDecision` from `permdoc
73
73
 
74
74
  Over HTTP, the client retries the same request with the `PermDock-Approval: <token>` header. In React, `approvalHeaders(token)` builds that header and `useApproval(decision)` requests and polls an approval from the UI.
75
75
 
76
- A bad resume is denied with detail `approval-not-found`, `approval-pending`, `approval-rejected`, `approval-expired`, `approval-consumed` or `approval-mismatch`; a changed row is `stale-approval`. `approvalsHandler` answers `403` for an ineligible approver (`approver-not-eligible`, the actor, or the principal without `distinct: false`) and `409` for a repeated one (`approver-repeated`).
76
+ A bad resume is denied with detail `approval-not-found`, `approval-pending`, `approval-rejected`, `approval-expired`, `approval-consumed` or `approval-mismatch`; a changed row is `stale-approval`. `approvalsHandler` answers `403` for an ineligible approver (`approver-not-eligible`, the actor, or the principal without `mode: "confirm"`) and `409` for a repeated one (`approver-repeated`).
77
77
 
78
78
  ## Delegation
79
79
 
@@ -106,4 +106,8 @@ Send the prompt with `approvalPrompt` and `permdock/delivery`: `approvalEmail` f
106
106
 
107
107
  ## Approvers
108
108
 
109
- `by` takes roles, `user(id)`, `relation()`, `holder(permission)` and `anyOf(...)`. A list is all-of; use `anyOf(user(id), holder(permissions.x.approve))` for "this person or anyone who holds the permission". `holder()` needs `approvalsHandler(store, { permdockFor: (approver, request) => createPermDock(policy, approver, { customRoles }) })`, so custom roles count. Stages may carry their own `escalation`.
109
+ `by` takes roles, `user(id)`, `relation()`, `manager({ levels? })` (whoever holds `manager` on the requester's `user` record, up to `levels` steps; with better-supabase, set `rls.approvals.managers: { table, user, manager }` so SQL matches it too), `holder(permission)` and `anyOf(...)`. A list is all-of; use `anyOf(user(id), holder(permissions.x.approve))` for "this person or anyone who holds the permission". `holder()` needs `approvalsHandler(store, { permdockFor: (approver, request) => createPermDock(policy, approver, { customRoles }) })`, so custom roles count. Stages may carry their own `escalation`.
110
+
111
+ ## Operation fingerprints
112
+
113
+ Bind an approval to the exact operation with `fingerprint`: `permdock.decide(permission, row, { fingerprint: approvalFingerprint({ id, amount, to }) })`. The token and the stored request carry it, and a resume or `consumeApproval(store, token, at, { fingerprint })` under another one fails with `approval-fingerprint-mismatch`. `approvalFingerprint` returns the same hex string as better-supabase's, synchronously.
@@ -44,7 +44,7 @@ Read the app's `permissions.ts`, `policy.ts`, factory file and every adapter gua
44
44
  ✓ Every policy and custom store has its runner, or a finding.
45
45
  6. **ASI02 and ASI03.** Map the inventory onto [OWASP Agentic](https://permdock.com/docs/security/owasp-agentic); for the threat list itself, defer to the `owasp-agentic` spec skill (`npx skills add ScaleDockHQ/scaledock-skills --skill owasp-agentic`).
46
46
  - **ASI02** (tool misuse): unmapped tools, a collection permission on a row handler, a destructive tool without `approval`, capability lists that include denied tools.
47
- - **ASI03** (identity and privilege abuse): a model-supplied subject or actor, an actor used as approver, `distinct: false` on a sensitive action, a resume token not bound to permission, resource, subject and actor, API keys stored in plain text or created outside `decideCredential`, keys without expiry (PD029), and a `memberships` source applied to service-key subjects.
47
+ - **ASI03** (identity and privilege abuse): a model-supplied subject or actor, an actor used as approver, `mode: "confirm"` on a sensitive action, a resume token not bound to permission, resource, subject and actor, API keys stored in plain text or created outside `decideCredential`, keys without expiry (PD029), and a `memberships` source applied to service-key subjects.
48
48
  ✓ Each agent adapter in the app has an ASI02 line and an ASI03 line.
49
49
  7. **Pull request review**, when the scope is one PR. Review only what the diff changes:
50
50
  - Run `permdock collect --check` and `permdock usage --json` on both sides and compare. New leaves with no grant, grants for leaves nobody checks, and new `undeclared` or `outsideInclude` findings are comments.
@@ -137,6 +137,8 @@ To answer guards from synced rows, write `localSnapshotManifest(policy)` (from `
137
137
 
138
138
  For an offline app on PowerSync, set `powersync: { out: 'sync-config.yaml' }` in `permdock.config.ts` and run `permdock powersync generate`: one edition 3 Sync Stream per resource, from the `rls.tables` and `rls.memberships` the RLS generator reads. It under-syncs, never over-syncs: a resource with a deny grant gets no stream, and a grant with a global role, approval, break-glass, validity, request context or a condition without a Sync Streams form syncs nothing, each with a warning. The app reads what does not sync from the server. It also writes `permdock_*` streams for the user's own membership, global-role and custom-role rows; with `powersync.manifest` set it writes the manifest too, and `powerSyncSource(db, { manifest, queries, read })` from `permdock/react-native` builds the local snapshot from `db.watch` queries. `permdock powersync verify` fails when a stream holds a fixture row the policy denies; doctor PD058 flags a stale file or manifest. Doctor PD065 lists server-only grants read from React Native code, which the device denies offline. Docs: [`permdock powersync`](https://permdock.com/docs/cli/powersync).
139
139
 
140
+ For role and tenant changes on Supabase, pass `refreshOn={nativeRefresh({ supabase, appState: AppState, netInfo, powersync: { db, connector, manifest } })}`: on the user's private `authz:<uid>` topic it refreshes the session, reconnects PowerSync so streams that read token claims see the new ones, then refreshes the snapshot. The generated `permdock_authz_version` stream lets `powerSyncSource` set `snapshot.authzVersion`. PD084 names streams that read token claims; a fixture with `after` and `expected: "changed"` makes `permdock powersync verify` check that their rows follow the change. Docs: [role and tenant changes](https://permdock.com/docs/adapters/react-native#role-and-tenant-changes).
141
+
140
142
  ## Express — `permdock/express`
141
143
 
142
144
  ```ts
@@ -501,7 +503,7 @@ const subject = subjectFromSupabase(claims, {
501
503
 
502
504
  Write the claims with `permdock supabase hook generate`; `permdock supabase inspect --out` writes the manifest (helper names, tenant claim, budget, claims written) that `authorizationProvider` from `permdock/better-supabase` turns into better-supabase's `authorization` config. No `@supabase/supabase-js` peer. Pair with `permdock rls generate`, or keep SQL as authority and run `permdock rls verify --db-url-stdin` against `sqlFunction` twins ([database-first](https://permdock.com/docs/adapters/rls)); the generic RLS workflow is in the `permdock-data` skill.
503
505
 
504
- With better-supabase, set `auth.authorization: authorizationProvider({ manifest, catalog })` in `better-supabase.config.ts` (with `rls.customRoles` its `canAssign` and `canAssignFor` call `permdock_can_assign_any` and its `_for` form, so custom roles are assignable through better-supabase; regenerate the manifest after turning custom roles on), pass `authorizer({ policy })` to the server (`createNext`, `createHono`, `createMcp`) so every `permission` a resource, action, route guard or tool declares is decided by PermDock from the verified claims (`operations` maps tables for `permissions: true`; a missing or anonymous claim denies), build bucket and topic `access` policies with `bucketPolicy` and `topicPolicy`, and map its session with `subjectFromBetterSupabase(session)` (all from `permdock/better-supabase`): the active tenant's `features` become `principal.plans`. Pass `plans: { keys }` when better-supabase's `entitlements.claim.keys` shortens feature keys, and `apiKeys: { permissions, manifest }` so an `apiKey` session maps to the key's credential subject instead of the anonymous one. For `createMcp` tools, put the permission in `meta` and spread `toolPolicy({ permdock })` into the options: tools without one are hidden and refused, and approval-required calls are refused because `createMcp` collects no approvals. Wrap a `CredentialProvider` with `credentialGuard(provider, { permdock, use, revoke? })` so PermDock decides each token use. `authorizationProvider({ ..., approver })` lets holders of that permission approve AI tool calls, never their own. `approvers: { 'ai-tool': holder(p), 'support-session': ..., 'invoice.send': ... }` fills `isApprover` through `permdock_is_approver` (needs `rls.approvals`); only `user()`, `holder()` and `anyOf()` approvers, and a kind it does not name has no approver. `accessReviewApplier({ client, reviews, policy, demoteTo?, email?, permdockFor? })` applies a review's revoked items: `update_member_role` to the `demoteTo` role when that role lacks the permission, else `remove_member`, plus `revoke_invitation` for the member's matching invitations, then `markApplied`; pass the reviewer's client so the blocks' own checks run. better-supabase's `createAgentRuntime({ toolApproval })` takes `toolApproval` from `permdock/ai-sdk` as it is. Validate its claims with `betterSupabase.claims(supabaseClaims().extend(appSchema))` (`supabaseClaims` from `permdock/supabase`, any Standard Schema as `appSchema`) instead of a hand-written copy of the claim shape. A `supabase.hook.claims` function that needs the user's organizations calls `<schema>.member_organization_ids_for(user_id)` (generated by `rls generate`, executable by `supabase_auth_admin` only) instead of querying the membership tables itself. With a scope named `team` or `teams`, `authorizationProvider` fills better-supabase's `teamIdsOf` with `<schema>.member_team_ids_of(user)`, which answers only for the caller, so with `blocks.permissions.model: 'provider'` better-supabase's `team_ids_of()` and team-sharing policies read PermDock's memberships. A token Supabase's OAuth server issued to a third-party app (`client_id`) becomes an `oauth-client` actor limited to its `scope`; `deny(permission, { to: actor('oauth-client') })` keeps such apps out, in the app and, through `rls generate`, in Postgres. A better-supabase support session (`act.kind: 'support'`) is actor kind `support` with `sessionId` and `readOnly`, and `actingAs` (`act.kind: 'impersonation'`) is kind `impersonation`; neither has a delegation, so they reach nothing until a policy delegation names `actor('support')` or `actor('impersonation')`, and `readOnly: true` (also when `read_only` is absent) narrows that to read-only permissions. Generated RLS reads memberships, not `act`, so a support token sent to the Data API writes as the user: add a restrictive `for update` (and `insert` / `delete`) policy per writable table that requires `act ->> 'read_only' = 'false'` when `act` is a support or session level ([support access](https://permdock.com/docs/guides/support-access)). With `rls.anonymousSignIns: 'deny'`, pass `anonymousSignIns: 'deny'` to the subject mapper too (doctor PD057). Check a deployed database against the generated policies with `permdock rls verify --introspect`.
506
+ With better-supabase, set `auth.authorization: authorizationProvider({ manifest, catalog })` in `better-supabase.config.ts` (with `rls.customRoles` its `canAssign` and `canAssignFor` call `permdock_can_assign_any` and its `_for` form, so custom roles are assignable through better-supabase; regenerate the manifest after turning custom roles on), pass `authorizer({ policy })` (or `authorizer({ policy, permdockFor })` to share one instance cache with `permdockFor(...).sources(versions)` in oRPC, MCP and `permdock/next`) to the server (`createNext`, `createHono`, `createMcp`) so every `permission` a resource, action, route guard or tool declares is decided by PermDock from the verified claims (`operations` maps tables for `permissions: true`; a missing or anonymous claim denies), build bucket and topic `access` policies with `bucketPolicy` and `topicPolicy`, and map its session with `subjectFromBetterSupabase(session)` (all from `permdock/better-supabase`): the active tenant's `features` become `principal.plans`. Pass `plans: { keys }` when better-supabase's `entitlements.claim.keys` shortens feature keys, and `apiKeys: { permissions, manifest }` so an `apiKey` session maps to the key's credential subject instead of the anonymous one. For `createMcp` tools, put the permission in `meta` and spread `toolPolicy({ permdock })` into the options: tools without one are hidden and refused, and approval-required calls are refused because `createMcp` collects no approvals. Wrap a `CredentialProvider` with `credentialGuard(provider, { permdock, use, revoke? })` so PermDock decides each token use. `authorizationProvider({ ..., approver })` lets holders of that permission approve AI tool calls, never their own. `approvers: { 'ai-tool': holder(p), 'support-session': ..., 'invoice.send': ... }` fills `isApprover` through `permdock_is_approver` (needs `rls.approvals`); only `user()`, `holder()` and `anyOf()` approvers, and a kind it does not name has no approver. `requestApprovers: true` also passes better-supabase's `{approvers}` (the request's current step) to the five-argument `permdock_is_approver`, so a cover from `rls.approvals.delegations` reaches users and managers a block policy names; it needs a better-supabase release that fills `{approvers}`. `rls.approvals: { store: false, delegations: true }` writes the covers without PermDock's store. `blockApprovalStore(approvals, { tenantless })` resolves through the block's `approve` and `reject` with `decidedBy`, and `blockApprovalPolicySource(approvals, { platform, permissions, effects })` maps conditions, effects, `*` and platform policies, dropping what it cannot express so a policy only gets stricter. `accessReviewApplier({ client, reviews, policy, demoteTo?, email?, permdockFor? })` applies a review's revoked items: `update_member_role` to the `demoteTo` role when that role lacks the permission, else `remove_member`, plus `revoke_invitation` for the member's matching invitations, then `markApplied`; pass the reviewer's client so the blocks' own checks run. better-supabase's `createAgentRuntime({ toolApproval })` takes `toolApproval` from `permdock/ai-sdk` as it is. Validate its claims with `betterSupabase.claims(supabaseClaims().extend(appSchema))` (`supabaseClaims` from `permdock/supabase`, any Standard Schema as `appSchema`) instead of a hand-written copy of the claim shape. A `supabase.hook.claims` function that needs the user's organizations calls `<schema>.member_organization_ids_for(user_id)` (generated by `rls generate`, executable by `supabase_auth_admin` only) instead of querying the membership tables itself. With a scope named `team` or `teams`, `authorizationProvider` fills better-supabase's `teamIdsOf` with `<schema>.member_team_ids_of(user)`, which answers only for the caller, so with `blocks.permissions.model: 'provider'` better-supabase's `team_ids_of()` and team-sharing policies read PermDock's memberships. A token Supabase's OAuth server issued to a third-party app (`client_id`) becomes an `oauth-client` actor limited to its `scope`; `deny(permission, { to: actor('oauth-client') })` keeps such apps out, in the app and, through `rls generate`, in Postgres. A better-supabase support session (`act.kind: 'support'`) is actor kind `support` with `sessionId` and `readOnly`, and `actingAs` (`act.kind: 'impersonation'`) is kind `impersonation`; neither has a delegation, so they reach nothing until a policy delegation names `actor('support')` or `actor('impersonation')`, and `readOnly: true` (also when `read_only` is absent) narrows that to read-only permissions. Generated RLS reads memberships, not `act`, so a support token sent to the Data API writes as the user: add a restrictive `for update` (and `insert` / `delete`) policy per writable table that requires `act ->> 'read_only' = 'false'` when `act` is a support or session level ([support access](https://permdock.com/docs/guides/support-access)). With `rls.anonymousSignIns: 'deny'`, pass `anonymousSignIns: 'deny'` to the subject mapper too (doctor PD057). Check a deployed database against the generated policies with `permdock rls verify --introspect`.
505
507
 
506
508
  The other better-supabase slots, all from `permdock/better-supabase` ([better-supabase](https://permdock.com/docs/adapters/better-supabase)): `hookCan(permdock)` and `handlerCan({ getPermDock })` are the `can` options of `authorizeHook` and `protectWebHandler` in `better-supabase/workflow-sdk`; they decide with no row unless the `data` option loads one (`hookCan(permdock, { data: (tenant, key) => row })`, `handlerCan(source, { data: (request, key) => row })`), so without it a permission with a row condition denies, and `handlerCan` answers `undefined` (401) without a signed-in principal. `supportPolicy({ policy, options?, writable?, approval?, approved? })` is the `authorize` option of `supportSessions`; it decides each start with `decideSupportSession` as the admin, and an `approval-required` start passes only once `approved(input, pending)` returns `{ approvedBy }` for an approver other than the admin. `subscriberPolicy({ policy, principals, events, row?, sender? })` filters outbox, webhook or realtime subscribers to those who may read the event (exact type, then the longest `prefix.*`, then `*`; a type with no entry reaches no one). `principalSource({ claims, identities? })` is a `PrincipalSource` over the claims better-supabase mints, for `decideFor`, `subscribersFor` and delivery; only links the app created through a signed-in flow or a verified address go in `identities`. `authorizationHooks({ policy, claims, service?, principals?, events?, approvers?, support?, tickets? })` is the `authorization` option of `createServer`: it answers automation publish and run-as, delegated OAuth scopes, `approverOf`, identities, delivery audiences, support sessions and run tickets from the claims better-supabase mints now, never from the request.
507
509
 
@@ -1,19 +0,0 @@
1
- import { a as ProblemDetails } from "./errors-BIM4MFsJ.js";
2
- //#region src/core/action-result.d.ts
3
- /** What a `protectAction` action resolves to; both members cross to the client. */
4
- type ActionResult<T> = {
5
- readonly ok: true;
6
- readonly value: T;
7
- } | {
8
- readonly ok: false;
9
- readonly problem: ProblemDetails;
10
- };
11
- /**
12
- * The server action: `approval` is the token of a granted approval request,
13
- * which resumes an `approval-required` decision.
14
- */
15
- type ProtectedAction<T> = (input: unknown, options?: {
16
- readonly approval?: string;
17
- }) => Promise<ActionResult<T>>;
18
- //#endregion
19
- export { ProtectedAction as n, ActionResult as t };
@@ -1 +0,0 @@
1
- export { t as catalogFile, n as runCatalog } from "./catalog-CGlSwU6j.js";
@@ -1 +0,0 @@
1
- export { r as runCollect } from "./collect-WCl8cJQV.js";
@@ -1 +0,0 @@
1
- export { a as loadModule, s as pickNamed } from "./load-DjSU5KXO.js";
@@ -1 +0,0 @@
1
- export { t as SPLIT_PARTS } from "./output-files-BIQ_9pIs.js";
@@ -1 +0,0 @@
1
- export { n as runPowerSync } from "./powersync-CBhTBhG2.js";
@@ -1 +0,0 @@
1
- export { n as runCloudPull } from "./pull-CQCGy1gv.js";
@@ -1,175 +0,0 @@
1
- //#region src/cli/core/renames.ts
2
- const DB_COMMANDS = [
3
- "rls generate",
4
- "rls import",
5
- "rls verify",
6
- "supabase hook generate",
7
- "powersync verify"
8
- ];
9
- const FLAG_RENAMES = [
10
- {
11
- commands: DB_COMMANDS,
12
- from: "--db",
13
- to: "--db-url-stdin",
14
- hint: "--db-url-stdin or DATABASE_URL"
15
- },
16
- {
17
- commands: DB_COMMANDS,
18
- from: "--db-url",
19
- to: "--db-url-stdin",
20
- hint: "--db-url-stdin or DATABASE_URL"
21
- },
22
- {
23
- commands: ["rls generate"],
24
- from: "--force",
25
- to: "--force-rls"
26
- },
27
- {
28
- commands: ["rls verify"],
29
- from: "--format",
30
- to: "--kind"
31
- },
32
- {
33
- commands: ["rls verify"],
34
- from: "--emit",
35
- to: "--kind"
36
- },
37
- {
38
- commands: ["catalog"],
39
- from: "--format",
40
- to: "--kind",
41
- values: {
42
- json: "catalog",
43
- schema: "json-schema",
44
- markdown: "markdown"
45
- }
46
- },
47
- {
48
- commands: ["openapi emit"],
49
- from: "--format",
50
- to: "--kind"
51
- },
52
- {
53
- commands: [
54
- "rls generate",
55
- "rls verify",
56
- "rls migrate",
57
- "powersync generate",
58
- "powersync verify",
59
- "openapi emit"
60
- ],
61
- from: "--from",
62
- to: "--policy"
63
- },
64
- {
65
- commands: ["catalog", "arazzo check"],
66
- from: "--from",
67
- to: "--permissions"
68
- },
69
- {
70
- commands: ["rls import", "openapi import"],
71
- from: "--schema",
72
- to: "--validator"
73
- },
74
- {
75
- commands: [
76
- "usage",
77
- "config",
78
- "doctor"
79
- ],
80
- from: "--strict",
81
- to: "--fail-on",
82
- hint: "--fail-on warning",
83
- rewrite: "--fail-on warning"
84
- },
85
- {
86
- commands: ["login"],
87
- from: "--write",
88
- to: "--scope",
89
- hint: "--scope catalog:write",
90
- rewrite: "--scope catalog:write"
91
- },
92
- {
93
- commands: ["skills install", "skills update"],
94
- from: "--agent",
95
- to: "--for"
96
- },
97
- {
98
- commands: ["skills install", "skills update"],
99
- from: "--client",
100
- to: "--for"
101
- },
102
- {
103
- commands: ["init"],
104
- from: "--agent",
105
- to: "--integration"
106
- },
107
- {
108
- commands: ["init"],
109
- from: "--ui",
110
- to: "--integration"
111
- },
112
- {
113
- commands: ["init"],
114
- from: "--src",
115
- to: "--out-dir"
116
- },
117
- {
118
- commands: [
119
- "rls generate",
120
- "rls verify",
121
- "rls migrate"
122
- ],
123
- from: "--rbac-scaffold",
124
- to: "--rbac",
125
- hint: "--rbac supabase",
126
- rewrite: "--rbac supabase"
127
- },
128
- {
129
- commands: ["rls migrate"],
130
- from: "--write",
131
- hint: "rls migrate writes by default; --dry-run prints the plan without writing",
132
- rewrite: ""
133
- },
134
- {
135
- commands: ["cloud push"],
136
- from: "--environment",
137
- to: "--project",
138
- hint: "--project <id>: a project id is its environment"
139
- },
140
- {
141
- commands: ["scan"],
142
- from: "--legacy",
143
- hint: "permdock scan lists the checks written without PermDock; drop --legacy",
144
- rewrite: ""
145
- }
146
- ];
147
- const COMMAND_MOVES = [
148
- {
149
- from: "openapi",
150
- to: "openapi emit"
151
- },
152
- {
153
- from: "skills",
154
- to: "skills install"
155
- },
156
- {
157
- from: "arazzo",
158
- to: "arazzo check"
159
- }
160
- ];
161
- const DEFAULT_CHANGES = [{
162
- command: "rls migrate",
163
- unless: ["--write", "--retire-out"],
164
- add: "--dry-run"
165
- }];
166
- /** The rename that matches `flag` (as typed, before any `=`) on `command`. */
167
- function flagRename(command, flag) {
168
- return FLAG_RENAMES.find((rename) => rename.from === flag && rename.commands.includes(command));
169
- }
170
- function renameMessage(command, rename) {
171
- const replacement = rename.hint ?? rename.to;
172
- return replacement === void 0 ? `${command}: ${rename.from} was removed in 0.5.0.` : rename.to === void 0 ? `${command}: ${rename.from} was removed in 0.5.0: ${replacement}.` : `${command}: ${rename.from} is ${replacement} since 0.5.0.`;
173
- }
174
- //#endregion
175
- export { renameMessage as i, DEFAULT_CHANGES as n, flagRename as r, COMMAND_MOVES as t };
@@ -1 +0,0 @@
1
- export { t as run } from "./run-DUq1xU4K.js";
@@ -1 +0,0 @@
1
- export { i as runSupabase } from "./supabase-hook-HPgwYb9V.js";
@@ -1 +0,0 @@
1
- export { t as runUsage } from "./usage-CPXeuAdT.js";
@@ -1 +0,0 @@
1
- export { i as watchCollect } from "./watch-DAkjm75Y.js";