permdock 0.16.0 → 0.17.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 (374) 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-Ci0xiJ3T.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-4KxMRdJC.js +189 -0
  10. package/dist/approval-policies-9VagPixq.d.ts +138 -0
  11. package/dist/{approval-prompt-3BqWczTt.d.ts → approval-prompt-BSh-yxbH.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-DdFcTncq.js} +3 -3
  15. package/dist/{approvers-B4r0N_Uz.js → approvers-CNtl4Vc5.js} +22 -1
  16. package/dist/{arazzo-CHoYnQXO.js → arazzo-7kbeh1yi.js} +2 -2
  17. package/dist/{arazzo-ClYz2Z0W.js → arazzo-_zUmT8ZT.js} +4 -4
  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-jRO819i3.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-DCWuVKtd.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 +273 -38
  30. package/dist/better-supabase/index.js +493 -102
  31. package/dist/{better-supabase-Dirf_8Ec.js → better-supabase-BJtQ-kNf.js} +26 -10
  32. package/dist/{bind-BNQA9JK9.js → bind-BJFeLX1V.js} +6 -6
  33. package/dist/{bind-YYjvfpB9.d.ts → bind-DjFNX0Pq.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-lye7oEqf.js} +3 -2
  37. package/dist/{capability-Di9tiUvi.d.ts → capability-BzjWdKmP.d.ts} +1 -1
  38. package/dist/{capability-BqX94r07.js → capability-zN6T9fxe.js} +2 -3
  39. package/dist/{casbin-C9EvElBb.js → casbin-C3O_O9nu.js} +2 -2
  40. package/dist/{casbin-D_rVQ31U.js → casbin-DFzk_so3.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 +6 -6
  45. package/dist/catalog-BpnjesqX.js +1 -0
  46. package/dist/{catalog-CGlSwU6j.js → catalog-DGDd_ww1.js} +5 -5
  47. package/dist/{catalog-amPDr0JQ.js → catalog-DJJIkR9P.js} +3 -3
  48. package/dist/{catalog-doc-DjMKzJp9.js → catalog-doc-C4DGfJCO.js} +3 -3
  49. package/dist/{catalog-operations-DeHTrJSV.js → catalog-operations-DVI5QO5R.js} +3 -3
  50. package/dist/{challenge-DImNcR7B.js → challenge-M_ghKJnT.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/cloud/index.d.ts +8 -8
  63. package/dist/cloud/index.js +1 -1
  64. package/dist/{cloud-DdaJ7ILM.js → cloud-DYqzmh5i.js} +4 -4
  65. package/dist/{codemod-ammy6wv4.js → codemod-DNGMGqBS.js} +395 -8
  66. package/dist/{codemod-B1USJS7a.js → codemod-DqB9klYI.js} +3 -3
  67. package/dist/{collect-DnXL4B8c.js → collect-C44RrKCI.js} +4 -4
  68. package/dist/collect-CAibhmCi.js +1 -0
  69. package/dist/{collect-WCl8cJQV.js → collect-HfJXl8Tr.js} +4 -4
  70. package/dist/compile/index.d.ts +1 -1
  71. package/dist/compile/index.js +1 -1
  72. package/dist/{compile-EzEMB-7v.js → compile-B_oJqmIg.js} +4 -4
  73. package/dist/{compile-BEklRUYo.d.ts → compile-BxiwRotu.d.ts} +2 -2
  74. package/dist/{completion--Y4YItFZ.js → completion-pwVjJlek.js} +3 -3
  75. package/dist/{config-CcLlvEYW.js → config-COHmivz9.js} +4 -4
  76. package/dist/{config-BQ77xMZk.js → config-DnfH6_eT.js} +2 -2
  77. package/dist/{config-report-DVMOLJ7F.js → config-report-C1jl7Na-.js} +2 -2
  78. package/dist/{context-BnIzxTNE.js → context-DeammvFl.js} +2 -2
  79. package/dist/convex/index.d.ts +4 -4
  80. package/dist/convex/index.js +3 -3
  81. package/dist/{core-CFepFiDP.d.ts → core-0iYZ5HUx.d.ts} +2 -2
  82. package/dist/{core-lxoANyai.js → core-W5f4Rjt0.js} +7 -7
  83. package/dist/{create-DBvUsgzK.d.ts → create-DNN3OtsO.d.ts} +4 -4
  84. package/dist/{create-CDd9c22W.d.ts → create-DrHUmKvG.d.ts} +6 -6
  85. package/dist/{create-BPUopdfL.d.ts → create-bzQlBzG4.d.ts} +7 -7
  86. package/dist/{create-Coq5fIrq.js → create-gqtDb1nU.js} +5 -5
  87. package/dist/{create-BLPKnJKa.js → create-jCPwPWXf.js} +6 -5
  88. package/dist/{credential-CyyyvCsL.js → credential-B3Hj4puZ.js} +4 -3
  89. package/dist/{credentials-CdDxp7jN.js → credentials-dkycUsY3.js} +1 -1
  90. package/dist/decision-CaG5_eNJ.js +21 -0
  91. package/dist/{delegation-CDB6_keF.js → delegation-aK4T_5WU.js} +3 -3
  92. package/dist/delivery/index.d.ts +4 -4
  93. package/dist/delivery/index.js +1 -1
  94. package/dist/{denied-text-DHldhVUv.d.ts → denied-text-DyzWwxEB.d.ts} +1 -1
  95. package/dist/{describe-Bb4hGK5d.js → describe-CogP1loh.js} +2 -1
  96. package/dist/{describe-BbFPBSms.d.ts → describe-nalX_HHE.d.ts} +1 -1
  97. package/dist/{diff-DfmYaIhB.js → diff-BTsLiW59.js} +7 -7
  98. package/dist/{diff-CxtbOi2l.js → diff-CcxYooMu.js} +2 -2
  99. package/dist/{doctor-CwYc2lJb.js → doctor-BNRhJegR.js} +3 -3
  100. package/dist/{doctor-D1Xnmy6u.js → doctor-DS-9ApID.js} +195 -30
  101. package/dist/drizzle/index.d.ts +3 -3
  102. package/dist/drizzle/index.js +1 -1
  103. package/dist/elysia/index.d.ts +4 -4
  104. package/dist/elysia/index.js +3 -3
  105. package/dist/{errors-Vpu6rKHl.js → errors-BhRkoNS7.js} +0 -2
  106. package/dist/{errors-BIM4MFsJ.d.ts → errors-Dc9FdamT.d.ts} +1 -1
  107. package/dist/{evaluate-BAmf_AQd.js → evaluate-CsjXeLRo.js} +18 -15
  108. package/dist/{evaluations-DOWuBpWv.d.ts → evaluations-BasA9zXp.d.ts} +3 -3
  109. package/dist/{evaluations-IBceAeKT.js → evaluations-DG40eSJa.js} +3 -22
  110. package/dist/eve/index.d.ts +4 -4
  111. package/dist/eve/index.js +3 -3
  112. package/dist/express/index.d.ts +4 -4
  113. package/dist/express/index.js +3 -3
  114. package/dist/fastify/index.d.ts +4 -4
  115. package/dist/fastify/index.js +3 -3
  116. package/dist/{fetch-adapter-BIbBAtPZ.d.ts → fetch-adapter-BgqpOOpd.d.ts} +2 -2
  117. package/dist/{fetch-adapter-dPTgJVHd.js → fetch-adapter-UZOW0PRC.js} +2 -2
  118. package/dist/{fields-DI8s3cPl.js → fields-CrjL6A49.js} +3 -3
  119. package/dist/{files-B3AA05f1.js → files-CfiRtQ-m.js} +1 -1
  120. package/dist/{fixtures-Bm4_K1ke.js → fixtures-0VTW5oNq.js} +2 -2
  121. package/dist/{flags-DXjoTVbS.js → flags-BlmpmXoY.js} +2 -2
  122. package/dist/{from-snapshot-DCakWRsr.js → from-snapshot-DMlSSo9b.js} +14 -12
  123. package/dist/{gen-DwgCSC6V.js → gen-CNCzG4sB.js} +2 -2
  124. package/dist/{gen-DuAhghDw.js → gen-DnpZwQPo.js} +9 -9
  125. package/dist/{generate-CRVV5V7l.js → generate-BqkZq8Dr.js} +2 -2
  126. package/dist/{grantee-conditions-BrYPe-w0.js → grantee-conditions-DX4K_gGI.js} +1 -1
  127. package/dist/{grantee-match-7RZZvoT_.js → grantee-match-BP-k4vRJ.js} +2 -2
  128. package/dist/h3/index.d.ts +4 -4
  129. package/dist/h3/index.js +3 -3
  130. package/dist/{helpers-DJicaG6f.js → helpers-DNnZffrI.js} +76 -12
  131. package/dist/hono/index.d.ts +4 -4
  132. package/dist/hono/index.js +3 -3
  133. package/dist/{hosted-DVxlLZMe.d.ts → hosted-DxRLLiFU.d.ts} +1 -1
  134. package/dist/{hosted-D0IzESu_.js → hosted-tPZnyjQS.js} +12 -10
  135. package/dist/{http-DOL33cO0.js → http-DhMWeB_h.js} +1 -1
  136. package/dist/{import-Dfe2unKO.js → import-BYVbSKx0.js} +3 -3
  137. package/dist/{import-CNBF96hB.js → import-C1XXpG_m.js} +4 -4
  138. package/dist/{index-Cay5-Kvx.d.ts → index-Bt-UoBWu.d.ts} +11 -10
  139. package/dist/{index-DJwEgYzA.d.ts → index-CXXUFWtG.d.ts} +17 -11
  140. package/dist/{index-Dj2qF9VC.d.ts → index-CZ5mixHO.d.ts} +1 -1
  141. package/dist/{index-ymept53A.d.ts → index-DFwUOkvt.d.ts} +4 -4
  142. package/dist/{index-CV-7DWeD.d.ts → index-DtGtDzjb.d.ts} +4 -4
  143. package/dist/{index-BinlXeU-.d.ts → index-z44pfWar.d.ts} +2 -2
  144. package/dist/index.d.ts +18 -16
  145. package/dist/index.js +20 -18
  146. package/dist/{init-C6cWP3xW.js → init-Dr1qAStu.js} +5 -5
  147. package/dist/{init-BUo2G-FI.js → init-YSDySeMy.js} +5 -5
  148. package/dist/{instance-options-CoHn-0e8.d.ts → instance-options-BOCRxEFb.d.ts} +2 -2
  149. package/dist/{instance-snapshot-DuWf1cT3.js → instance-snapshot-BgOGtyCy.js} +15 -12
  150. package/dist/jwt/index.d.ts +4 -4
  151. package/dist/jwt/index.js +3 -3
  152. package/dist/{kernel-BD8QuMnv.js → kernel-CDDU93dI.js} +10 -10
  153. package/dist/kysely/index.d.ts +3 -3
  154. package/dist/kysely/index.js +1 -1
  155. package/dist/{load-DjSU5KXO.js → load-BaEamml-.js} +1 -1
  156. package/dist/load-CjnlPxpL.js +1 -0
  157. package/dist/{login-D1MHOomI.js → login-CXgEKLaW.js} +4 -4
  158. package/dist/{login-DCKE5pVy.js → login-DEVXDTX8.js} +4 -4
  159. package/dist/{manifest-Cft51TLK.js → manifest-Dij1U0hx.js} +37 -37
  160. package/dist/{map-claims-C-nv08_n.js → map-claims-PQwHynxV.js} +25 -11
  161. package/dist/{map-error-pasIGqMT.js → map-error-B_f3C5cs.js} +1 -1
  162. package/dist/mcp/index.d.ts +8 -8
  163. package/dist/mcp/index.js +9 -9
  164. package/dist/{migrate-BJHxQqT5.js → migrate-BbY5-Khy.js} +4 -4
  165. package/dist/{module-values-B1EVTkHP.js → module-values-B8tNIxdd.js} +2 -2
  166. package/dist/nest/index.d.ts +4 -4
  167. package/dist/nest/index.js +3 -3
  168. package/dist/next/index.d.ts +32 -13
  169. package/dist/next/index.js +43 -25
  170. package/dist/next/plugin.d.ts +1 -1
  171. package/dist/next/plugin.js +2 -2
  172. package/dist/node/index.d.ts +4 -4
  173. package/dist/node/index.js +2 -2
  174. package/dist/openai/index.d.ts +4 -4
  175. package/dist/openai/index.js +3 -3
  176. package/dist/openapi/index.d.ts +2 -2
  177. package/dist/{openapi-BwWkHxvW.js → openapi-D3wkvOoU.js} +4 -4
  178. package/dist/{openapi-DSzQN7Zu.js → openapi-GM-kTdkq.js} +5 -5
  179. package/dist/orpc/index.d.ts +5 -5
  180. package/dist/orpc/index.js +3 -3
  181. package/dist/otel/index.d.ts +3 -3
  182. package/dist/otel/index.js +1 -1
  183. package/dist/{output-DlICTjBh.js → output-DhTpe8v1.js} +1 -1
  184. package/dist/output-files-BYscrQl-.js +1 -0
  185. package/dist/{output-files-BIQ_9pIs.js → output-files-CM0BnH05.js} +1 -1
  186. package/dist/{ownership-qqBuGJXr.js → ownership-moSRhxl_.js} +6 -6
  187. package/dist/{parse-1_ZheTW5.js → parse-UTC-sDrt.js} +2 -2
  188. package/dist/{parse-local-manifest-CCmbhnxP.d.ts → parse-local-manifest-BgTYdR3q.d.ts} +1 -1
  189. package/dist/{parse-request-CwCZpyjV.js → parse-request-DOBVaeiQ.js} +1 -1
  190. package/dist/pdp/index.d.ts +3 -3
  191. package/dist/pdp/index.js +3 -3
  192. package/dist/{peer-Q0fuZ6hx.js → peer-BuK9F53f.js} +1 -1
  193. package/dist/{peer-C9LvBCcb.js → peer-n-swIV4H.js} +1 -1
  194. package/dist/{permdock-CprAPN3w.d.ts → permdock-DUWZEOLR.d.ts} +88 -131
  195. package/dist/{permdock-BvjivVb9.js → permdock-DdzMv5-F.js} +195 -102
  196. package/dist/{permissions-CYcHj_w7.js → permissions-CvpPtz5O.js} +1 -1
  197. package/dist/{pg-DQTqRrou.js → pg-Ddxsd5ZB.js} +2 -2
  198. package/dist/{policy-BycVKnXv.d.ts → policy-CTNl7pvN.d.ts} +1 -1
  199. package/dist/{policy-CLQ8__GF.js → policy-DxQyHKPB.js} +5 -4
  200. package/dist/{policy-from-catalog-CU3An8uP.js → policy-from-catalog-DVa1faOr.js} +8 -7
  201. package/dist/{policy-types-DGIO_gxq.d.ts → policy-types-IRJVABmm.d.ts} +63 -19
  202. package/dist/{postgrest-D5nUGm-c.d.ts → postgrest-B_cEDd4e.d.ts} +12 -7
  203. package/dist/{postgrest-DAxFltvO.js → postgrest-BrjrckDG.js} +74 -19
  204. package/dist/{powersync-DAfo0EL5.js → powersync-BZxw_v-A.js} +3 -3
  205. package/dist/{powersync-CBhTBhG2.js → powersync-C0nsyULQ.js} +15 -15
  206. package/dist/powersync-Cqzx25dI.js +1 -0
  207. package/dist/preset/index.js +1 -1
  208. package/dist/{preset-BjLzeFpp.js → preset-pPrVyGU5.js} +74 -7
  209. package/dist/prisma/index.d.ts +2 -2
  210. package/dist/prisma/index.js +1 -1
  211. package/dist/{protected-action-DUYqb-Ma.js → protected-action-B6n6w7Rl.js} +1 -1
  212. package/dist/{protected-action-D8x73IGm.d.ts → protected-action-D3S9U4nc.d.ts} +14 -7
  213. package/dist/{protected-action-QEA8arRB.js → protected-action-qowj6nxN.js} +15 -5
  214. package/dist/{provider-C55OGXJ7.js → provider-CY4TSSJo.js} +2 -2
  215. package/dist/{provider-DfLeek9O.d.ts → provider-CjAu39fJ.d.ts} +1 -1
  216. package/dist/{provider-store-CaTv00tr.js → provider-store-BQP_pp8s.js} +2 -2
  217. package/dist/pull-CUVdB04v.js +1 -0
  218. package/dist/{pull-CQCGy1gv.js → pull-DVoZ0V9_.js} +6 -6
  219. package/dist/{push-Dq_ca4-j.js → push-eJl1Tvqm.js} +7 -7
  220. package/dist/{pushed-policy-CryQheKq.d.ts → pushed-policy-CUQuvlS3.d.ts} +1 -1
  221. package/dist/{pushed-policy-CDuOL2de.js → pushed-policy-DMXAOmEW.js} +1 -1
  222. package/dist/react/index.d.ts +8 -8
  223. package/dist/react/index.js +6 -6
  224. package/dist/react/provider-client.d.ts +1 -1
  225. package/dist/react/provider-client.js +1 -1
  226. package/dist/react-native/index.d.ts +10 -10
  227. package/dist/react-native/index.js +9 -9
  228. package/dist/refresh-on-L9UOwATg.d.ts +49 -0
  229. package/dist/{replay-Bs9Df2fQ.d.ts → replay-Dc3d8LhG.d.ts} +1 -1
  230. package/dist/{request-context-Duzdf0cd.js → request-context-Ch052blg.js} +2 -2
  231. package/dist/{request-schema-DhX7UbfQ.js → request-schema-CMP8Cmxd.js} +5 -0
  232. package/dist/resend/index.d.ts +4 -4
  233. package/dist/{resolve-names-Y1Cb22cp.js → resolve-names-1nCei24V.js} +6 -6
  234. package/dist/{rls-C5ZGzR_B.js → rls-BVzoZCn3.js} +4 -4
  235. package/dist/{rls-tHu7N_Pe.js → rls-ClJRblnR.js} +19 -19
  236. package/dist/{role-builder-BK2-T6oD.js → role-builder-BrmOcXch.js} +3 -157
  237. package/dist/{rpc-vHIwyXCp.js → rpc-BOu3FD6X.js} +2 -2
  238. package/dist/{run-DUq1xU4K.js → run-CnCaTjWX.js} +8 -40
  239. package/dist/run-D9N6V5WQ.js +1 -0
  240. package/dist/{run-ticket-ylovhyFQ.d.ts → run-ticket-C6lXvHM_.d.ts} +2 -2
  241. package/dist/{run-ticket-DfnZCh-u.js → run-ticket-CjvXr6wj.js} +1 -1
  242. package/dist/{runtime-BGnrOkVH.js → runtime-CBXkOcg9.js} +1 -1
  243. package/dist/{saas-DK4V-3Is.js → saas-BqM9mJkk.js} +13 -10
  244. package/dist/{scan-C3HRH9Fs.js → scan-CepUXrFt.js} +1 -1
  245. package/dist/{schema-DvXvxPhQ.js → schema-9_NDz8fx.js} +1 -1
  246. package/dist/{schema-BOJjqlWL.js → schema-CuX70xgH.js} +15 -2
  247. package/dist/scim/index.d.ts +1 -1
  248. package/dist/scim/index.js +1 -1
  249. package/dist/{scim-jJBJ7g1Z.js → scim-C30QBBoF.js} +2 -1
  250. package/dist/{scim-D8YupzX1.js → scim-CovliQUg.js} +2 -2
  251. package/dist/{scopes-0Up_UA2t.js → scopes-BSdYaGHs.js} +9 -40
  252. package/dist/server/index.d.ts +11 -11
  253. package/dist/server/index.js +8 -8
  254. package/dist/{server-3cVlTLde.js → server-D0PW6ZCw.js} +2 -2
  255. package/dist/{server-types-CyRN0-Cd.d.ts → server-types-Bw-lWqzR.d.ts} +8 -8
  256. package/dist/{shared-l0oGGetg.js → shared-BRmCJxDK.js} +2 -2
  257. package/dist/{shared-DrGLwM3s.js → shared-DyYVEjKC.js} +2 -2
  258. package/dist/{sink-B5zoUW_O.d.ts → sink-DUzt0e4B.d.ts} +2 -2
  259. package/dist/{skills-Celu2W6v.js → skills-BUuH-QFt.js} +2 -2
  260. package/dist/{skills-B2qTbaQa.js → skills-a4N6Y2Xm.js} +2 -2
  261. package/dist/{snapshot-CXlzi69u.js → snapshot-DN_8J27z.js} +6 -2
  262. package/dist/{snapshot-cache-Bx_4xC_6.js → snapshot-cache-B66h7FBK.js} +25 -8
  263. package/dist/{snapshot-cache-BjAWkchD.d.ts → snapshot-cache-Dbk-Gnij.d.ts} +20 -6
  264. package/dist/solid/index.d.ts +7 -7
  265. package/dist/solid/index.js +6 -6
  266. package/dist/solid-start/index.d.ts +4 -4
  267. package/dist/solid-start/index.js +3 -3
  268. package/dist/{sources-oB1Hg1Fm.d.ts → sources-CXY05xtB.d.ts} +1 -1
  269. package/dist/{src-C_pi2Rnh.js → src-nYNBfmgq.js} +187 -39
  270. package/dist/ssf/index.d.ts +3 -3
  271. package/dist/ssf/index.js +1 -1
  272. package/dist/{standard-webhooks-DOYEuOLx.d.ts → standard-webhooks-BFeEpjxy.d.ts} +2 -2
  273. package/dist/{store-RNFvaJJv.js → store-XgBMbfDy.js} +13 -7
  274. package/dist/{types-tQB2CEnY.d.ts → store-g5ctUrOI.d.ts} +114 -113
  275. package/dist/{store-options-Dil3lraY.js → store-options--zWn48PK.js} +76 -7
  276. package/dist/{stores-DxZWDXCs.js → stores-53_kOwPi.js} +3 -3
  277. package/dist/{stores-DZJvxFIZ.d.ts → stores-BtdN3eDO.d.ts} +5 -6
  278. package/dist/{stream-9y9qw51m.d.ts → stream-BMJg56jU.d.ts} +1 -1
  279. package/dist/{subject-BGoM5o8B.js → subject-C7RddW0G.js} +8 -1
  280. package/dist/supabase/client.d.ts +31 -0
  281. package/dist/supabase/client.js +21 -0
  282. package/dist/supabase/index.d.ts +37 -6
  283. package/dist/supabase/index.js +5 -4
  284. package/dist/supabase/middleware.d.ts +8 -7
  285. package/dist/supabase/middleware.js +6 -6
  286. package/dist/{supabase-DYWnT800.js → supabase-C6FyUeSh.js} +3 -3
  287. package/dist/{supabase-CDHMsDD0.js → supabase-C8cNzp4i.js} +31 -8
  288. package/dist/supabase-hook-CPBX4dy5.js +1 -0
  289. package/dist/{supabase-hook-HPgwYb9V.js → supabase-hook-Cj85nccs.js} +167 -21
  290. package/dist/{supautils-SwE642N1.js → supautils-BP_5WAIc.js} +12 -12
  291. package/dist/svelte/index.d.ts +7 -7
  292. package/dist/svelte/index.js +8 -8
  293. package/dist/svelte/runtime.d.ts +3 -3
  294. package/dist/svelte/runtime.js +3 -3
  295. package/dist/svelte/source.d.ts +7 -7
  296. package/dist/svelte/source.js +5 -5
  297. package/dist/sveltekit/index.d.ts +4 -4
  298. package/dist/sveltekit/index.js +2 -2
  299. package/dist/{tables-DimBcVWY.js → tables-BsGE6HBR.js} +7 -7
  300. package/dist/tanstack-start/index.d.ts +4 -4
  301. package/dist/tanstack-start/index.js +2 -2
  302. package/dist/{tenancy-5d1zVBvK.js → tenancy-DvOHHk3-.js} +1 -1
  303. package/dist/terminal/index.d.ts +5 -5
  304. package/dist/terminal/index.js +6 -6
  305. package/dist/testing/core.d.ts +1 -1
  306. package/dist/testing/core.js +1 -1
  307. package/dist/testing/fixtures/index.d.ts +1 -1
  308. package/dist/testing/fixtures/index.js +1 -1
  309. package/dist/testing/index.d.ts +29 -22
  310. package/dist/testing/index.js +118 -46
  311. package/dist/testing/saas/index.d.ts +3 -3
  312. package/dist/testing/saas/index.js +2 -2
  313. package/dist/testing/saas/permissions.js +1 -1
  314. package/dist/token-D6pWn8Uj.d.ts +11 -0
  315. package/dist/{token-DC9EQiet.js → token-DaMnIU9O.js} +24 -8
  316. package/dist/{tool-refusal-Qpjs_W6M.js → tool-refusal-C1UlhU0V.js} +1 -1
  317. package/dist/trpc/index.d.ts +5 -5
  318. package/dist/trpc/index.js +3 -3
  319. package/dist/{type-helpers-c7Xo_2Cu.d.ts → type-helpers-C_OnZW8c.d.ts} +1 -1
  320. package/dist/{types-B2efzoSX.d.ts → types-AOP5HQku.d.ts} +1 -1
  321. package/dist/{types-DlelvQk4.d.ts → types-B3BOcI0J.d.ts} +2 -2
  322. package/dist/{types-DLvhVm1r.d.ts → types-BvBbkAu1.d.ts} +16 -7
  323. package/dist/{types-BB-zWDcR.d.ts → types-CA-A33Q5.d.ts} +5 -5
  324. package/dist/{types-Cklw5hJo.d.ts → types-CAAN7evk.d.ts} +24 -1
  325. package/dist/{types-DsHGPtkR.d.ts → types-CJC1aaoJ.d.ts} +2 -2
  326. package/dist/{types-CWBsAwqn.d.ts → types-D29K5ZNP.d.ts} +4 -4
  327. package/dist/{types-CEinc15V.d.ts → types-DVZNTkU0.d.ts} +3 -4
  328. package/dist/{types-ZzRGoViD.d.ts → types-NYoj8JBm.d.ts} +2 -2
  329. package/dist/{types-B6ExllNo.d.ts → types-Sj1U8HMm.d.ts} +2 -2
  330. package/dist/{types-CN0LsqbK.d.ts → types-UfpcY575.d.ts} +3 -3
  331. package/dist/{types-rCRV4Ge-.d.ts → types-e82uzrTn.d.ts} +4 -4
  332. package/dist/unplugin/index.d.ts +1 -1
  333. package/dist/unplugin/index.js +2 -2
  334. package/dist/{usage-CPXeuAdT.js → usage-COsGLht5.js} +6 -6
  335. package/dist/{usage-CfZCQd0F.js → usage-CqcMeQgX.js} +2 -2
  336. package/dist/usage-D1cpHO7p.js +1 -0
  337. package/dist/{validation-error-uvp-kyfO.d.ts → validation-error-DpvsBwZJ.d.ts} +1 -1
  338. package/dist/{verify-DfT0QYNh.js → verify-C8G8D5mk.js} +19 -19
  339. package/dist/{version-cache-Df11C2Qp.d.ts → version-cache-9Vq5QVFC.d.ts} +9 -3
  340. package/dist/{views-CD8wuL4Z.js → views-TrZYlDnM.js} +1 -1
  341. package/dist/vue/index.d.ts +7 -7
  342. package/dist/vue/index.js +6 -6
  343. package/dist/{waiter-CqUKX6CY.d.ts → waiter-C2cXXLFZ.d.ts} +2 -2
  344. package/dist/{watch-DAkjm75Y.js → watch-DXRDBSCu.js} +3 -3
  345. package/dist/watch-DnymTAfe.js +1 -0
  346. package/dist/webmcp/index.d.ts +1 -1
  347. package/dist/webmcp/index.js +1 -1
  348. package/dist/{where-scope-DlCdCM_8.js → where-scope-BKrqUDVk.js} +5 -5
  349. package/dist/{who-can-BoDJm0Nc.js → who-can-BY5d3HPw.js} +4 -4
  350. package/dist/workflow/index.d.ts +3 -3
  351. package/dist/workflow/index.js +5 -4
  352. package/dist/workflow-sdk/index.d.ts +4 -4
  353. package/dist/{wrap-B2wziJI_.js → wrap-C5PWzgkq.js} +1 -1
  354. package/dist/{wrap-DxXB54Wu.d.ts → wrap-DpZAbxuD.d.ts} +2 -2
  355. package/package.json +8 -5
  356. package/schemas/approval-request-v1.json +5 -0
  357. package/schemas/catalog-v1.json +18 -2
  358. package/schemas/cli-result-v1.json +0 -2
  359. package/schemas/snapshot-v1.json +9 -0
  360. package/skills/permdock-approvals/SKILL.md +8 -8
  361. package/skills/permdock-approvals/references/stores-and-resume.md +7 -3
  362. package/skills/permdock-audit/SKILL.md +1 -1
  363. package/dist/action-result-BcudBQOF.d.ts +0 -19
  364. package/dist/catalog-D3oS2GH3.js +0 -1
  365. package/dist/collect-D-eroIfV.js +0 -1
  366. package/dist/load-Dm0pSYH3.js +0 -1
  367. package/dist/output-files-BHOIlrfD.js +0 -1
  368. package/dist/powersync-0QVP_DuR.js +0 -1
  369. package/dist/pull-CCAChKuy.js +0 -1
  370. package/dist/renames-CGj7YwcQ.js +0 -175
  371. package/dist/run-C5P3x1EI.js +0 -1
  372. package/dist/supabase-hook-qsewAVZY.js +0 -1
  373. package/dist/usage-DmmO_xjJ.js +0 -1
  374. package/dist/watch-CuPz0D2M.js +0 -1
@@ -0,0 +1,15 @@
1
+ //#region src/supabase/authz-topic.ts
2
+ /**
3
+ * The server topic the generated version trigger broadcasts on without
4
+ * better-supabase; no user may join it. With better-supabase it is
5
+ * `better_supabase:authz`.
6
+ */
7
+ const AUTHZ_TOPIC = "permdock:authz";
8
+ /** The broadcast event of a version bump, as better-supabase names it. */
9
+ const AUTHZ_EVENT = "changed";
10
+ /** The private topic one user receives their own version bumps on. */
11
+ function authzUserTopic(userId) {
12
+ return `authz:${userId}`;
13
+ }
14
+ //#endregion
15
+ export { AUTHZ_TOPIC as n, authzUserTopic as r, AUTHZ_EVENT as t };
@@ -1,8 +1,8 @@
1
- import { T as Policy, lr as Delegation, pr as Principal, rr as Actor } from "../policy-types-DGIO_gxq.js";
2
- import { m as ApprovalStore } from "../types-DLvhVm1r.js";
3
- import { a as ProblemDetails } from "../errors-BIM4MFsJ.js";
4
- import { t as InstanceOptions } from "../instance-options-CoHn-0e8.js";
5
- import { a as evaluationsSemantic, n as EvaluationsSemantic, r as evaluateBatch, t as EVALUATIONS_SEMANTICS } from "../evaluations-DOWuBpWv.js";
1
+ import { E as Policy, _r as Principal, pr as Delegation, sr as Actor } from "../policy-types-IRJVABmm.js";
2
+ import { m as ApprovalStore } from "../types-BvBbkAu1.js";
3
+ import { a as ProblemDetails } from "../errors-Dc9FdamT.js";
4
+ import { t as InstanceOptions } from "../instance-options-BOCRxEFb.js";
5
+ import { a as evaluationsSemantic, n as EvaluationsSemantic, r as evaluateBatch, t as EVALUATIONS_SEMANTICS } from "../evaluations-BasA9zXp.js";
6
6
  //#region src/authzen/map.d.ts
7
7
  type AuthzenEntity = {
8
8
  readonly type?: unknown;
@@ -7,8 +7,8 @@ import { n as resourceRef } from "../resource-ref-CaS9yVPi.js";
7
7
  import { n as readBodyText, t as MAX_BODY_BYTES } from "../body-text-DQhcmqdY.js";
8
8
  import { r as hasCredentials } from "../http-DKLXrFGk.js";
9
9
  import { d as unauthenticatedProblem, l as problemResponse, o as methodNotAllowed } from "../problem-BVLHFK33.js";
10
- import { n as resolveOrNull, t as buildInstance } from "../build-instance-BWXqwQYU.js";
11
- import { a as evaluationReasons, c as withRequestId, g as wireResourceId, h as permissionLookup, i as evaluateBatch, m as itemResourceData, n as applyApprovalResume, r as authzenMetadata, s as evaluationsSemantic, t as EVALUATIONS_SEMANTICS } from "../evaluations-IBceAeKT.js";
10
+ import { n as resolveOrNull, t as buildInstance } from "../build-instance-lye7oEqf.js";
11
+ import { a as evaluationReasons, c as withRequestId, g as wireResourceId, h as permissionLookup, i as evaluateBatch, m as itemResourceData, n as applyApprovalResume, r as authzenMetadata, s as evaluationsSemantic, t as EVALUATIONS_SEMANTICS } from "../evaluations-DG40eSJa.js";
12
12
  //#region src/authzen/map.ts
13
13
  const UNKNOWN = {
14
14
  outcome: "denied",
@@ -1,4 +1,4 @@
1
- import { Ut as InstanceHandle, Wn as Denial, Wt as Instant } from "./policy-types-DGIO_gxq.js";
1
+ import { Gt as InstanceHandle, Jn as Denial, Kt as Instant } from "./policy-types-IRJVABmm.js";
2
2
  import { u as Permission } from "./permission-types-CAY-GU7e.js";
3
3
  import { t as Operation } from "./operations-Ci_rT6Uo.js";
4
4
  //#region src/core/automation.d.ts
@@ -1,4 +1,4 @@
1
- import { G as CustomRoleSource, J as DecisionSink, N as RoleBinding, hr as Subject, pr as Principal } from "../policy-types-DGIO_gxq.js";
1
+ import { K as CustomRoleSource, P as RoleBinding, Y as DecisionSink, _r as Principal, yr as Subject } from "../policy-types-IRJVABmm.js";
2
2
  import { f as PermissionTree } from "../permission-types-CAY-GU7e.js";
3
3
  import { StandardSchemaV1 } from "@standard-schema/spec";
4
4
  //#region src/better-auth/types.d.ts
@@ -1,9 +1,9 @@
1
1
  import { n as isReadonlyArray, r as isRecord, t as compact } from "../compact-CAf557ZB.js";
2
2
  import { n as freezeDeep } from "../freeze-jjan0lCv.js";
3
- import { n as role, r as allow } from "../role-builder-BK2-T6oD.js";
3
+ import { n as role, r as allow } from "../role-builder-BrmOcXch.js";
4
4
  import { c as listPermissions } from "../permission-registry-B8tYxPIt.js";
5
5
  import { r as validateRecord } from "../thenable-BNSM1U2R.js";
6
- import { t as anonymousSubject } from "../subject-BGoM5o8B.js";
6
+ import { i as rootMembershipId, t as anonymousSubject } from "../subject-C7RddW0G.js";
7
7
  import { d as membershipEvent } from "../sink-D9_vh372.js";
8
8
  //#region src/better-auth/parse.ts
9
9
  function asRoles(value) {
@@ -62,7 +62,8 @@ function parseMemberRows(value, userId, requireUserId = true) {
62
62
  const roles = asRoles(item["role"] ?? item["roles"]);
63
63
  if (tenant === void 0 || roles.length === 0) continue;
64
64
  out.push(compact({
65
- tenant,
65
+ scope: "tenant",
66
+ id: tenant,
66
67
  roles
67
68
  }));
68
69
  }
@@ -79,8 +80,9 @@ function parseTeamRows(value, userId) {
79
80
  const roles = asRoles(item["role"] ?? item["roles"]);
80
81
  if (team === void 0 || roles.length === 0) continue;
81
82
  out.push(compact({
82
- tenant,
83
- team,
83
+ within: tenant === void 0 ? void 0 : { tenant },
84
+ scope: "team",
85
+ id: team,
84
86
  roles,
85
87
  via: `team:${team}`
86
88
  }));
@@ -279,7 +281,7 @@ function memberIn(auth, userId, organizationId, tenant, headers) {
279
281
  filterValue: userId
280
282
  },
281
283
  headers
282
- }), userId).filter((item) => item.tenant === organizationId), []);
284
+ }), userId).filter((item) => rootMembershipId(item) === organizationId), []);
283
285
  }
284
286
  async function loadMemberships(auth, session, user, userId, tenant, options) {
285
287
  let members = parseMemberRows(session["members"] ?? session["member"] ?? user["members"], userId, false);
@@ -295,8 +297,8 @@ async function loadMemberships(auth, session, user, userId, tenant, options) {
295
297
  const listUserTeams = auth.api?.listUserTeams;
296
298
  if (teams.length === 0 && listUserTeams !== void 0) teams = await settle(async () => parseTeamRows(await listUserTeams({ headers }), userId), []);
297
299
  if (options.memberships === "active" && tenant !== void 0) {
298
- members = members.filter((item) => item.tenant === tenant);
299
- teams = teams.filter((item) => item.tenant === tenant);
300
+ members = members.filter((item) => rootMembershipId(item) === tenant);
301
+ teams = teams.filter((item) => item.within?.["tenant"] === tenant);
300
302
  }
301
303
  return [...members, ...teams];
302
304
  }
@@ -1,21 +1,19 @@
1
- import { Cn as ApproverInput, Ot as ApiKeyPrincipal, St as SupportSession, T as Policy, U as CredentialVerifier, Wt as Instant, X as Intent, hr as Subject, nt as MembershipSource, pr as Principal, rn as AuthEvent } from "../policy-types-DGIO_gxq.js";
1
+ import { At as ApiKeyPrincipal, E as Policy, Kt as Instant, Tn as ApproverInput, W as CredentialVerifier, Z as Intent, Zn as DeniedDecision, _r as Principal, an as AuthEvent, rt as MembershipSource, wt as SupportSession, yr as Subject } from "../policy-types-IRJVABmm.js";
2
2
  import { f as PermissionTree, u as Permission } from "../permission-types-CAY-GU7e.js";
3
- import { _ as PrincipalSource, a as PermDock, h as PrincipalIdentity, o as PermDockOptions } from "../permdock-CprAPN3w.js";
4
- import { c as AccessReviewStore } from "../types-B2efzoSX.js";
5
- import { i as SupabaseRpcCaller } from "../postgrest-D5nUGm-c.js";
6
- import { a as CatalogDocument } from "../types-ZzRGoViD.js";
7
- import { A as SupabaseSubjectOptions, C as SupabasePrincipal, N as SupabaseSuspension, O as SupabaseSessionLike, s as SqlMembershipSource } from "../sources-oB1Hg1Fm.js";
8
- import { n as VersionCache } from "../version-cache-Df11C2Qp.js";
3
+ import { i as ApprovalPolicySource } from "../approval-policies-9VagPixq.js";
4
+ import { C as InstanceCache, O as PermissionCheck, _ as PrincipalSource, a as PermDock, h as PrincipalIdentity, k as PermissionState, o as PermDockOptions } from "../permdock-DUWZEOLR.js";
5
+ import { m as ApprovalStore } from "../types-BvBbkAu1.js";
6
+ import { c as AccessReviewStore } from "../types-AOP5HQku.js";
7
+ import { i as SupabaseRpcCaller } from "../postgrest-B_cEDd4e.js";
8
+ import { a as CatalogDocument } from "../types-NYoj8JBm.js";
9
+ import { A as SupabaseSubjectOptions, C as SupabasePrincipal, N as SupabaseSuspension, O as SupabaseSessionLike, s as SqlMembershipSource } from "../sources-CXY05xtB.js";
10
+ import { n as VersionCache } from "../version-cache-9Vq5QVFC.js";
9
11
  import { t as SqlQuery } from "../sql-B80DFdpG.js";
10
- import { c as LinkPolicy, o as CapabilityPrincipal, t as Capability } from "../capability-Di9tiUvi.js";
11
- import { AuthorizationProvider } from "better-supabase/config";
12
- import { AuthSession, AuthorizationHooks, AuthorizationRequest, Authorizer, SupportAuthorize, SupportAuthorizeInput } from "better-supabase/server";
12
+ import { c as LinkPolicy, o as CapabilityPrincipal, t as Capability } from "../capability-BzjWdKmP.js";
13
+ import { AccessBucketPolicy, AccessTopicPolicy, AuthorizationHooks, AuthorizationProvider, AuthorizationRequest, Authorizer, BlockTables, CredentialProvider, SupportAuthorize, SupportAuthorizeInput, ToolDecision, ToolRef } from "better-supabase/contract";
13
14
  import { EntitlementClaimOptions } from "better-supabase/blocks/entitlements";
15
+ import { AuthSession } from "better-supabase/server";
14
16
  import { ApiKey, ApiKeyClaimsOptions, ApiKeys } from "better-supabase/blocks/api-keys";
15
- import { AccessTopicPolicy } from "better-supabase/realtime";
16
- import { AccessBucketPolicy } from "better-supabase/storage";
17
- import { CredentialProvider } from "better-supabase/credentials";
18
- import { ToolDecision, ToolRef } from "better-supabase/mcp";
19
17
  import { AuthorizeHookOptions, ProtectWebHandlerOptions } from "better-supabase/workflow-sdk";
20
18
  //#region src/better-supabase/access-reviews.d.ts
21
19
  type AccessReviewApplierOptions = {
@@ -82,6 +80,111 @@ type AccessReviewApplyResult = {
82
80
  */
83
81
  export declare function accessReviewApplier(options: AccessReviewApplierOptions): (reviewId: string) => Promise<AccessReviewApplyResult>;
84
82
  //#endregion
83
+ //#region src/better-supabase/approvals-block.d.ts
84
+ /** better-supabase's `AsyncResult`: awaiting it gives `{ ok, data, error }`. */
85
+ type BlockResult<T> = PromiseLike<{
86
+ readonly ok: true;
87
+ readonly data: T;
88
+ } | {
89
+ readonly ok: false;
90
+ readonly error: unknown;
91
+ }>;
92
+ /** A `Temporal.Instant`, as far as the bridge reads it. */
93
+ type BlockInstant = {
94
+ readonly toJSON: () => string;
95
+ };
96
+ type BlockStatus = "pending" | "approved" | "rejected" | "cancelled" | "expired";
97
+ /** The approvals block's request; instants are `Temporal.Instant`. */
98
+ type BlockApprovalRecord<I extends BlockInstant> = {
99
+ readonly id: string;
100
+ readonly status: BlockStatus;
101
+ readonly payload: Readonly<Record<string, unknown>>;
102
+ readonly fingerprint?: string;
103
+ readonly expiresAt?: I;
104
+ readonly decidedAt?: I;
105
+ readonly consumedAt?: I;
106
+ readonly createdAt: I;
107
+ };
108
+ type BlockApprovalApprovers = {
109
+ readonly permission?: string;
110
+ readonly role?: string;
111
+ readonly team?: string;
112
+ readonly users?: readonly string[];
113
+ readonly manager?: boolean;
114
+ };
115
+ /** The approvals block's tenant policy (`options.tenantPolicies`). */
116
+ type BlockApprovalTenantPolicy = {
117
+ readonly organizationId: string;
118
+ readonly subjectType: string;
119
+ readonly action: string;
120
+ readonly conditions?: unknown;
121
+ readonly mode: "confirm" | "authorize";
122
+ readonly steps: readonly {
123
+ readonly approvers: BlockApprovalApprovers;
124
+ readonly required: number;
125
+ }[];
126
+ readonly selfApproval: boolean;
127
+ readonly expiresIn?: string;
128
+ readonly enabled: boolean;
129
+ };
130
+ /**
131
+ * The calls `blockApprovalStore` makes on `createApprovals(...)` from
132
+ * `better-supabase/blocks/approvals`.
133
+ */
134
+ type BlockApprovalsClient<I extends BlockInstant> = {
135
+ readonly request: (subject: {
136
+ readonly type: string;
137
+ readonly id: string;
138
+ }, input: {
139
+ readonly action: string;
140
+ readonly reason?: string;
141
+ readonly payload?: Readonly<Record<string, unknown>>;
142
+ readonly fingerprint?: string;
143
+ }) => BlockResult<BlockApprovalRecord<I>>;
144
+ readonly list: (options?: {
145
+ readonly status?: BlockStatus | null;
146
+ readonly pageSize?: number;
147
+ readonly before?: I;
148
+ }) => BlockResult<readonly BlockApprovalRecord<I>[]>;
149
+ readonly consume: (id: string, fingerprint?: string) => BlockResult<BlockApprovalRecord<I>>;
150
+ };
151
+ /** The call `blockApprovalPolicySource` makes on the approvals block. */
152
+ type BlockApprovalPoliciesClient = {
153
+ readonly listPolicies: (options?: {
154
+ readonly subjectType?: string;
155
+ readonly pageSize?: number;
156
+ }) => BlockResult<readonly BlockApprovalTenantPolicy[]>;
157
+ };
158
+ /**
159
+ * An `ApprovalStore` over better-supabase's approvals block, so a PermDock
160
+ * `approval-required` decision files a block request and is decided in the
161
+ * block's own approve and reject flow. `create` files the request on the
162
+ * resource under the permission's action, with the PermDock request in
163
+ * `payload.permdock` and its `fingerprint`. `get`, `getById` and `list` read
164
+ * the block's latest 2,000 requests in the block's tenant. `consume` calls the
165
+ * block's `consume`, which refuses a second use and another fingerprint.
166
+ * `resolve` throws: approvers decide through the block, never through
167
+ * `approvalsHandler`. `expire` answers 0, since the block expires requests
168
+ * itself.
169
+ */
170
+ export declare function blockApprovalStore<I extends BlockInstant>(approvals: BlockApprovalsClient<I>): ApprovalStore;
171
+ type BlockApprovalPolicySourceOptions = {
172
+ /** The scope a step's `role` is held in. Default `tenant`. */
173
+ readonly roleScope?: string;
174
+ };
175
+ /**
176
+ * An `ApprovalPolicySource` over the approvals block's tenant policies, so a
177
+ * PermDock decision asks for approval wherever the block would. A policy keys
178
+ * the permission `<subjectType>.<action>`; its steps become sequential stages
179
+ * whose approvers are any of the step's permission, role, users and manager;
180
+ * `confirm` with `selfApproval` lets the principal approve; `expiresIn` caps
181
+ * the request's `ttl`. `conditions` are not read, so a conditional policy
182
+ * applies to every call: stricter, never looser. A step with only a `team`
183
+ * approver, an interval it cannot read or a failed read makes the source fail,
184
+ * and every call an allow would grant denies.
185
+ */
186
+ export declare function blockApprovalPolicySource(approvals: BlockApprovalPoliciesClient, options?: BlockApprovalPolicySourceOptions): ApprovalPolicySource;
187
+ //#endregion
85
188
  //#region src/better-supabase/approvers.d.ts
86
189
  /**
87
190
  * Who may approve each better-supabase request kind: `'ai-tool'` (a tool call),
@@ -163,9 +266,9 @@ type ApiKeySessionOptions = {
163
266
  };
164
267
  /**
165
268
  * The fields of better-supabase's `SessionSnapshot` a subject reads: one
166
- * verified token, from `bsb.getRequestSession()`, that `'use cache: private'`
167
- * scopes share. Its `issuedAt` and `authzVersion` come from the `iat` and
168
- * `authz_ver` claims.
269
+ * verified token, from `bsb.getClaims()`, that `'use cache: private'` scopes
270
+ * share. Its `issuedAt` and `authzVersion` come from the `iat` and `authz_ver`
271
+ * claims.
169
272
  */
170
273
  type SessionSnapshotLike = {
171
274
  readonly accessToken: string;
@@ -234,6 +337,11 @@ type SubscriberPolicyOptions<E extends SubscriberPolicyEvent = SubscriberPolicyE
234
337
  readonly sender?: (event: E) => string | null | undefined;
235
338
  /** Sources for the sender's and subscribers' instances. */
236
339
  readonly options?: Omit<PermDockOptions, "tenant" | "actor" | "delegation" | "session" | "expiresAt" | "principals">;
340
+ /**
341
+ * The process-wide instance cache: an instance is reused while the subject's
342
+ * authorization version is unchanged.
343
+ */
344
+ readonly instances?: InstanceCache;
237
345
  };
238
346
  /**
239
347
  * The per-subscriber check for better-supabase's webhooks-out, outbox and
@@ -267,6 +375,11 @@ type SupportPolicyOptions = {
267
375
  * tenant's `supportSessions` rules.
268
376
  */
269
377
  readonly options?: Omit<PermDockOptions, "tenant" | "actor" | "delegation" | "session" | "expiresAt">;
378
+ /**
379
+ * The process-wide instance cache: an instance is reused while the subject's
380
+ * authorization version is unchanged.
381
+ */
382
+ readonly instances?: InstanceCache;
270
383
  /**
271
384
  * The session's permissions when a start asks for `readOnly: false`. Without
272
385
  * it such a start is refused; a read-only start gets every `readOnlyHint`
@@ -316,6 +429,11 @@ type AuthorizationHooksOptions = {
316
429
  * `subjectFromBetterSupabase`.
317
430
  */
318
431
  readonly subject?: Omit<BetterSupabaseSubjectOptions, "apiKeys">;
432
+ /**
433
+ * The process-wide instance cache: an instance is reused while the subject's
434
+ * authorization version is unchanged.
435
+ */
436
+ readonly instances?: InstanceCache;
319
437
  /** Sources for every instance the hooks build. */
320
438
  readonly options?: Omit<PermDockOptions, "tenant" | "actor" | "delegation" | "session" | "expiresAt">;
321
439
  /**
@@ -358,11 +476,12 @@ type AuthorizationHooksOptions = {
358
476
  * authorization })`), decided by `policy`. Every hook builds the principal's
359
477
  * instance from the claims `claims` loads now, never from the request, and
360
478
  * fails closed: a throw, an unknown key and `approval-required` refuse.
361
- * `automation` and `delegation` are always set; `identities`, `delivery`,
362
- * `approverOf`, `support` and `tickets` only with the options they read.
363
- * `delegation.permissions` maps each scope to the keys whose `.scope` it is,
364
- * was renamed from, or that a policy `oauthScopes` entry covers, and reads no
365
- * `authorization_details`.
479
+ * `automation`, `delegation` and `sessionTags` (`snapshotTag(userId)`, so
480
+ * `evictSession` and sign-out clear PermDock snapshots) are always set;
481
+ * `identities`, `delivery`, `approverOf`, `support` and `tickets` only with the
482
+ * options they read. `delegation.permissions` maps each scope to the keys whose
483
+ * `.scope` it is, was renamed from, or that a policy `oauthScopes` entry
484
+ * covers, and reads no `authorization_details`.
366
485
  */
367
486
  export declare function authorizationHooks(options: AuthorizationHooksOptions): AuthorizationHooks;
368
487
  //#endregion
@@ -494,12 +613,25 @@ type AuthorizerOptions = {
494
613
  */
495
614
  readonly versions?: VersionCache;
496
615
  /**
497
- * The intent of one check. By default a batch (`evaluations`, list and row
498
- * filtering) and an action named `read`, `list` or `view` are `read`, so
499
- * `claimsFirst` may answer from the version cache; every other check is
500
- * `write` and reads the version live.
616
+ * The intent of one check. By default better-supabase's `context.intent`;
617
+ * without it a batch (`evaluations`, list and row filtering) and an action
618
+ * named `read`, `list` or `view` are `read`, so `claimsFirst` may answer from
619
+ * the version cache, and every other check is `write` and reads the version
620
+ * live.
501
621
  */
502
622
  readonly intent?: (request: AuthorizationRequest<Permission>) => Intent;
623
+ /**
624
+ * The approval store an `approval-required` decision files its request in and
625
+ * resumes from. The approval id the client sends (better-supabase's
626
+ * `approval: { header }`) resumes one `evaluate` call; `evaluations` never
627
+ * consumes it. Without a store, `approval-required` is returned as is.
628
+ */
629
+ readonly store?: ApprovalStore;
630
+ /**
631
+ * Shares instances across requests while the caller's authorization version
632
+ * is unchanged: the `instanceCache()` the app's other adapters use.
633
+ */
634
+ readonly instances?: InstanceCache;
503
635
  /** Receives every error a check threw; the check still denies. */
504
636
  readonly onError?: BetterSupabaseOnError;
505
637
  /**
@@ -517,7 +649,7 @@ type AuthorizerOptions = {
517
649
  * throw denies. With better-supabase's runtime `memo`, the checks of one
518
650
  * request scope share an instance per claims, tenant and intent.
519
651
  */
520
- export declare function authorizer(options: AuthorizerOptions): Authorizer<Permission>;
652
+ export declare function authorizer(options: AuthorizerOptions): Authorizer<Permission, VersionCache>;
521
653
  //#endregion
522
654
  //#region src/better-supabase/block-memberships.d.ts
523
655
  /**
@@ -545,14 +677,23 @@ type BlockRoleJunction = {
545
677
  readonly id?: string;
546
678
  };
547
679
  type BlockMembershipSourceOptions = {
548
- /** The memberships block's table. Default `better_supabase.memberships`. */
680
+ /**
681
+ * `blockTables(config)` from `better-supabase/sql`: the memberships and
682
+ * `membership_roles` tables with the app's `blocks.memberships.tables` and
683
+ * `columns` renames. `table` and `columns` win over it.
684
+ */
685
+ readonly tables?: BlockTables;
686
+ /**
687
+ * The memberships block's table. Default the `tables` entry, else
688
+ * `better_supabase.memberships`.
689
+ */
549
690
  readonly table?: string;
550
691
  /** The declared scope a row is a membership of. Default `organization`. */
551
692
  readonly scope?: string;
552
693
  /**
553
694
  * Physical column names, keyed like better-supabase's
554
- * `blocks.memberships.columns.memberships`. Defaults `organization_id`,
555
- * `user_id`, `role` and `disabled_at`.
695
+ * `blocks.memberships.columns.memberships`. Defaults the `tables` entry's
696
+ * columns, else `organization_id`, `user_id`, `role` and `disabled_at`.
556
697
  */
557
698
  readonly columns?: {
558
699
  readonly tenant?: string;
@@ -566,10 +707,10 @@ type BlockMembershipSourceOptions = {
566
707
  */
567
708
  readonly roleThrough?: BlockRoleThrough;
568
709
  /**
569
- * A role junction read instead of the role column. `"many"` reads
570
- * `membership_roles` in the table's schema, the role set
571
- * `blocks.memberships.options.roles.many` keeps, keyed by the tenant and user
572
- * columns.
710
+ * A role junction read instead of the role column. `"many"` reads the
711
+ * `tables` entry for `membership_roles`, else `membership_roles` in the
712
+ * table's schema: the role set `blocks.memberships.options.roles.many` keeps,
713
+ * keyed by the tenant and user columns.
573
714
  */
574
715
  readonly roles?: BlockRoleJunction | "many";
575
716
  readonly query?: SqlQuery;
@@ -703,9 +844,10 @@ type ToolPolicy<C> = {
703
844
  * The `authorize` and `visible` hooks of better-supabase's `createMcp`, for
704
845
  * tools whose `meta` is a PermDock permission. A tool without a permission is
705
846
  * hidden and refused. `authorize` grants only a `granted` decision: an
706
- * approval-required call is refused, because `createMcp` has no approval flow.
707
- * A denial's text names the first denial reason. A throw anywhere refuses and
708
- * reaches `onError`.
847
+ * approval-required call is refused, because `authorize` has no approval
848
+ * outcome. A tool whose `permission` goes through `authorizer` with a `store`
849
+ * returns the approval id and resumes it instead. A denial's text names the
850
+ * first denial reason. A throw anywhere refuses and reaches `onError`.
709
851
  */
710
852
  export declare function toolPolicy<C>(options: ToolPolicyOptions<C>): ToolPolicy<C>;
711
853
  //#endregion
@@ -741,6 +883,67 @@ type PrincipalFromMembershipsOptions = {
741
883
  */
742
884
  export declare function principalFromMemberships(userId: string, rows: readonly BetterSupabaseMembershipRow[], options?: PrincipalFromMembershipsOptions): Principal;
743
885
  //#endregion
886
+ //#region src/better-supabase/permdock-for.d.ts
887
+ /**
888
+ * What `bsb.bootstrap()` and `bsb.getAccess()` return: a session with the
889
+ * tenant and the authorization version read in the same request.
890
+ */
891
+ type PermDockForResult = {
892
+ readonly session: SupabaseSessionLike | ApiKeySession | null;
893
+ readonly tenant: string | null;
894
+ readonly authzVersion: number | null;
895
+ /** `bsb.bootstrap()`'s `session_active()`; `false` is signed out. */
896
+ readonly sessionActive?: boolean;
897
+ };
898
+ /** Who an instance is for. */
899
+ type PermDockForInput = SupabaseSessionLike | ApiKeySession | SessionSnapshotLike | PermDockForResult | Subject | null | undefined;
900
+ type PermDockForQuery = {
901
+ /** Default the source's tenant (`bootstrap`, `getAccess`). */
902
+ readonly tenant?: string | null;
903
+ /** Default `read`. */
904
+ readonly intent?: Intent;
905
+ };
906
+ /**
907
+ * The instance for a session, a `bsb.bootstrap()` result, a `bsb.getAccess()`
908
+ * result or a subject. The second argument is a query or a tenant, so it also
909
+ * serves as an approvals handler's or access-review handler's `permdockFor`.
910
+ */
911
+ type PermDockFor = (source: PermDockForInput, query?: PermDockForQuery | string | null) => Promise<PermDock>;
912
+ type PermDockForOptions = {
913
+ readonly policy: Policy;
914
+ /** How the verified claims map to a subject. */
915
+ readonly subject?: BetterSupabaseSubjectOptions;
916
+ /**
917
+ * The membership source a stale token is re-read from, wrapped in
918
+ * `claimsFirst(source, { onStale: 'reread', versions })`.
919
+ */
920
+ readonly memberships?: MembershipSource | readonly MembershipSource[];
921
+ /** The version `claimsFirst` compares with `authz_ver`; default the source's. */
922
+ readonly version?: MembershipSource["version"];
923
+ /** The process-wide version cache (`createNext({ versions })`). */
924
+ readonly versions?: VersionCache;
925
+ /** The process-wide instance cache, shared with the app's other adapters. */
926
+ readonly instances?: InstanceCache;
927
+ /** Sources and sinks for each instance. */
928
+ readonly options?: Omit<PermDockOptions, "tenant" | "intent" | "version">;
929
+ };
930
+ /**
931
+ * One resolver for every instance of the app: `permdockFor(await
932
+ * bsb.claims())`, `permdockFor(await bsb.bootstrap(...))` or `permdockFor(await
933
+ * bsb.getAccess(...))`. A bootstrap or access result passes its `authzVersion`
934
+ * as `version.known`, so the instance reads no version, and a `sessionActive:
935
+ * false` bootstrap is anonymous. With `instances`, a subject at an unchanged
936
+ * version reuses its instance across requests.
937
+ */
938
+ export declare function permdockFor(options: PermDockForOptions): PermDockFor;
939
+ /**
940
+ * One `{ allowed, outcome, reason? }` per named check for `input`, from one
941
+ * `permdockFor` instance: frozen plain JSON an island returns from `'use cache:
942
+ * private'`. A check that throws denies its entry; an instance that cannot be
943
+ * built denies them all.
944
+ */
945
+ export declare function getPermissions<K extends string>(resolve: PermDockFor, input: PermDockForInput, checks: Readonly<Record<K, PermissionCheck>>, query?: PermDockForQuery | string | null): Promise<Readonly<Record<K, PermissionState>>>;
946
+ //#endregion
744
947
  //#region src/better-supabase/principals.d.ts
745
948
  /**
746
949
  * Where an identity link points: an app user, whose claims `principal` loads,
@@ -915,4 +1118,36 @@ export declare function hookCan(permdock: PermDock, options?: HookCanOptions): N
915
1118
  */
916
1119
  export declare function handlerCan(source: HandlerPermDockSource, options?: HandlerCanOptions): ProtectWebHandlerOptions["can"];
917
1120
  //#endregion
918
- export type { AccessPolicyOptions, AccessReviewApplierOptions, AccessReviewApplyFailure, AccessReviewApplyResult, ApiKeySession, ApiKeySessionOptions, ApiKeyVerifierOptions, AuthorizationHooksOptions, AuthorizationProviderOptions, AuthorizerOperation, AuthorizerOptions, BetterSupabaseActiveTenant, BetterSupabaseErrorContext, BetterSupabaseIdentityLink, BetterSupabaseMembershipRow, BetterSupabaseOnError, BetterSupabaseSubjectOptions, BlockMembershipSourceOptions, BlockRoleJunction, BlockRoleThrough, BucketAccess, CredentialGuardOptions, HandlerCanOptions, HandlerPermDockSource, HookCanOptions, McpToolDecision, McpToolRef, PendingSupportSession, PrincipalFromMembershipsOptions, PrincipalSourceOptions, ProviderApprovers, RoleOrderOptions, ServiceRoles, SessionSnapshotLike, ShareLinkResolver, ShareLinkRow, ShareLinkSubjectOptions, ShareLinkTarget, SubscriberPolicyEvent, SubscriberPolicyOptions, SupabasePrincipal, SupportPolicyOptions, ToolPolicy, ToolPolicyOptions, TopicAccess };
1121
+ //#region src/better-supabase/workflow-resource.d.ts
1122
+ /**
1123
+ * better-supabase's `RecordRef`: the record a workflow run belongs to, a
1124
+ * subject type from `config.subjects` and its id. Structural, so the
1125
+ * better-supabase type satisfies it without an import.
1126
+ */
1127
+ type WorkflowRecordRef = {
1128
+ readonly type: string;
1129
+ readonly id: string;
1130
+ };
1131
+ /** A subject type from `config.subjects` to the PermDock resource name it is. */
1132
+ type WorkflowSubjectTypes = Readonly<Record<string, string>>;
1133
+ type WorkflowResourceResult = {
1134
+ readonly ok: true;
1135
+ readonly resource: {
1136
+ readonly type: string;
1137
+ readonly id: string;
1138
+ };
1139
+ } | {
1140
+ readonly ok: false;
1141
+ readonly cause: "validation";
1142
+ readonly decision: DeniedDecision;
1143
+ };
1144
+ /**
1145
+ * The resource a `workflow.start` check decides on for a run started on
1146
+ * `subject`: `{ type, id }`, with the type `types` maps the subject type to. A
1147
+ * subject type `types` does not name, a missing or empty id, or an id over 256
1148
+ * characters is `{ ok: false, cause: 'validation' }` with the denial to
1149
+ * return.
1150
+ */
1151
+ export declare function workflowResource(subject: unknown, types: WorkflowSubjectTypes): WorkflowResourceResult;
1152
+ //#endregion
1153
+ export type { AccessPolicyOptions, AccessReviewApplierOptions, AccessReviewApplyFailure, AccessReviewApplyResult, ApiKeySession, ApiKeySessionOptions, ApiKeyVerifierOptions, AuthorizationHooksOptions, AuthorizationProviderOptions, AuthorizerOperation, AuthorizerOptions, BetterSupabaseActiveTenant, BetterSupabaseErrorContext, BetterSupabaseIdentityLink, BetterSupabaseMembershipRow, BetterSupabaseOnError, BetterSupabaseSubjectOptions, BlockApprovalApprovers, BlockApprovalPoliciesClient, BlockApprovalPolicySourceOptions, BlockApprovalRecord, BlockApprovalTenantPolicy, BlockApprovalsClient, BlockInstant, BlockMembershipSourceOptions, BlockRoleJunction, BlockRoleThrough, BucketAccess, CredentialGuardOptions, HandlerCanOptions, HandlerPermDockSource, HookCanOptions, McpToolDecision, McpToolRef, PendingSupportSession, PermDockFor, PermDockForInput, PermDockForOptions, PermDockForQuery, PermDockForResult, PrincipalFromMembershipsOptions, PrincipalSourceOptions, ProviderApprovers, RoleOrderOptions, ServiceRoles, SessionSnapshotLike, ShareLinkResolver, ShareLinkRow, ShareLinkSubjectOptions, ShareLinkTarget, SubscriberPolicyEvent, SubscriberPolicyOptions, SupabasePrincipal, SupportPolicyOptions, ToolPolicy, ToolPolicyOptions, TopicAccess, WorkflowRecordRef, WorkflowResourceResult, WorkflowSubjectTypes };