permdock 0.8.0 → 0.10.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 (277) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +3 -3
  3. package/dist/{action-result-CL-QCITA.d.ts → action-result-BcudBQOF.d.ts} +1 -1
  4. package/dist/active-tenant-DVee32-T.js +39 -0
  5. package/dist/{adoption-scan-BLs67P1l.js → adoption-scan-0oFt2RD5.js} +1 -1
  6. package/dist/agent/index.d.ts +2 -2
  7. package/dist/agent/index.js +1 -1
  8. package/dist/ai-sdk/index.d.ts +3 -3
  9. package/dist/ai-sdk/index.js +3 -3
  10. package/dist/{approval-prompt-PYagyQUj.d.ts → approval-prompt-3BqWczTt.d.ts} +1 -1
  11. package/dist/approvals/index.d.ts +3 -3
  12. package/dist/{arazzo-3RhGfkAK.js → arazzo-DA9PCXew.js} +1 -1
  13. package/dist/{arazzo-B5-ulWif.js → arazzo-DhxDfYt-.js} +2 -2
  14. package/dist/astro/index.d.ts +4 -4
  15. package/dist/astro/index.js +1 -1
  16. package/dist/{audience-BAkBDMqn.js → audience-DTjR8xet.js} +1 -1
  17. package/dist/authzen/index.d.ts +5 -5
  18. package/dist/authzen/index.js +1 -1
  19. package/dist/{automation-DqEoWHBc.d.ts → automation-C6Jg75xq.d.ts} +1 -1
  20. package/dist/better-auth/index.d.ts +1 -1
  21. package/dist/better-supabase/index.d.ts +192 -27
  22. package/dist/better-supabase/index.js +248 -64
  23. package/dist/{bind-D_sZSVA3.js → bind-BNQA9JK9.js} +7 -3
  24. package/dist/{bind-Cp2hBHzP.d.ts → bind-YYjvfpB9.d.ts} +12 -7
  25. package/dist/{build-instance-CNWaYJyr.js → build-instance-BWXqwQYU.js} +1 -1
  26. package/dist/{capability-ChuiONQU.d.ts → capability-Di9tiUvi.d.ts} +1 -1
  27. package/dist/{casbin-H0rKxBx2.js → casbin-BJu2liqU.js} +1 -1
  28. package/dist/{casbin-cbSbhT_k.js → casbin-BkhqGh2z.js} +1 -1
  29. package/dist/catalog/index.d.ts +4 -4
  30. package/dist/catalog/index.js +2 -2
  31. package/dist/{catalog-BFpz2EmT.js → catalog-CGlSwU6j.js} +2 -2
  32. package/dist/catalog-D3oS2GH3.js +1 -0
  33. package/dist/{catalog-DCspHDc8.js → catalog-amPDr0JQ.js} +1 -1
  34. package/dist/{catalog-operations-Dadrl7Z-.js → catalog-operations-DeHTrJSV.js} +1 -1
  35. package/dist/chat/index.d.ts +1 -1
  36. package/dist/chat/index.js +1 -1
  37. package/dist/chat-sdk/index.d.ts +3 -3
  38. package/dist/claude-agent/index.d.ts +3 -3
  39. package/dist/claude-agent/index.js +2 -2
  40. package/dist/clerk/index.d.ts +2 -2
  41. package/dist/cli/bin.js +1 -1
  42. package/dist/cli/index.d.ts +9 -4
  43. package/dist/cli/index.js +11 -3
  44. package/dist/cloud/index.d.ts +8 -8
  45. package/dist/{cloud-BFlGMaak.js → cloud-3RIuS4E9.js} +2 -2
  46. package/dist/{codemod-DLQ9Zpo4.js → codemod-DLcp-B6v.js} +2 -2
  47. package/dist/{codemod-DWSN2erG.js → codemod-DRl_w-bY.js} +1 -1
  48. package/dist/collect-D-eroIfV.js +1 -0
  49. package/dist/{collect-Bzv3le0A.js → collect-D9Tt0Bcx.js} +2 -2
  50. package/dist/{collect-B7ZFAJU3.js → collect-WCl8cJQV.js} +1 -1
  51. package/dist/compile/index.d.ts +1 -1
  52. package/dist/{compile-BFzysW3o.d.ts → compile-BEklRUYo.d.ts} +2 -2
  53. package/dist/{completion-saoYiRFO.js → completion-VSWvaaPO.js} +1 -1
  54. package/dist/{config-BwPBfN0t.js → config-BR23fL8m.js} +2 -2
  55. package/dist/{config-DBeXXmBF.js → config-kL36AxkE.js} +1 -1
  56. package/dist/{config-report-BipSWA6V.js → config-report-osnfUNg5.js} +3 -3
  57. package/dist/{config-shape-ykV0Vm2n.js → config-shape-tsxHx71E.js} +2 -1
  58. package/dist/convex/index.d.ts +4 -4
  59. package/dist/convex/index.js +2 -2
  60. package/dist/{core-hWIARPDz.d.ts → core-CFepFiDP.d.ts} +2 -2
  61. package/dist/{core-H-mbhpZc.js → core-DzVINFbU.js} +3 -3
  62. package/dist/{create-Cq4Uox0f.js → create-6EwRQlig.js} +3 -3
  63. package/dist/{create-_noSrY1T.js → create-BLPKnJKa.js} +23 -7
  64. package/dist/{create-BSNrVuxh.d.ts → create-BPUopdfL.d.ts} +7 -7
  65. package/dist/{create-CM1FciYG.d.ts → create-CDd9c22W.d.ts} +15 -6
  66. package/dist/{create-BVq1lNQE.d.ts → create-DBvUsgzK.d.ts} +4 -4
  67. package/dist/delivery/index.d.ts +4 -4
  68. package/dist/delivery/index.js +1 -1
  69. package/dist/{denied-text-CHNlVInN.d.ts → denied-text-DHldhVUv.d.ts} +1 -1
  70. package/dist/{describe-ByS9LgHK.d.ts → describe-BbFPBSms.d.ts} +1 -1
  71. package/dist/{diff-CN8IYhC_.js → diff-BwR1JdP2.js} +1 -1
  72. package/dist/{diff-iZWV65nC.js → diff-CQegtBAo.js} +2 -2
  73. package/dist/{doctor-D3wo-yuz.js → doctor-B9FY9H0F.js} +2 -2
  74. package/dist/{doctor-CHD1M9R5.js → doctor-DfTnMaUt.js} +144 -16
  75. package/dist/drizzle/index.d.ts +3 -3
  76. package/dist/elysia/index.d.ts +4 -4
  77. package/dist/elysia/index.js +1 -1
  78. package/dist/{errors-zi_4T-rx.d.ts → errors-BIM4MFsJ.d.ts} +1 -1
  79. package/dist/{evaluate-Dd8Ta0Ie.js → evaluate-BAmf_AQd.js} +13 -4
  80. package/dist/{evaluations-z8dQFDaN.d.ts → evaluations-DOWuBpWv.d.ts} +3 -3
  81. package/dist/eve/index.d.ts +4 -4
  82. package/dist/eve/index.js +2 -2
  83. package/dist/express/index.d.ts +4 -4
  84. package/dist/express/index.js +1 -1
  85. package/dist/fastify/index.d.ts +4 -4
  86. package/dist/fastify/index.js +1 -1
  87. package/dist/{fetch-adapter-C1DCvpqV.d.ts → fetch-adapter-BIbBAtPZ.d.ts} +2 -2
  88. package/dist/{fetch-adapter-JL43jD3E.js → fetch-adapter-dPTgJVHd.js} +1 -1
  89. package/dist/{fields-D0vUI6dq.js → fields-DI8s3cPl.js} +1 -1
  90. package/dist/{gen-DWCYcMQM.js → gen-DuAhghDw.js} +2 -2
  91. package/dist/{gen-B5kvbAoZ.js → gen-DwgCSC6V.js} +1 -1
  92. package/dist/h3/index.d.ts +4 -4
  93. package/dist/h3/index.js +2 -2
  94. package/dist/hono/index.d.ts +4 -4
  95. package/dist/hono/index.js +1 -1
  96. package/dist/{hosted-Cmtxogd0.d.ts → hosted-DVxlLZMe.d.ts} +1 -1
  97. package/dist/{import-CST57XLp.js → import-CNBF96hB.js} +2 -2
  98. package/dist/{import-_YqhhwvX.js → import-Iuk9mx8A.js} +1 -1
  99. package/dist/{index-BhxEUY9J.d.ts → index-BinlXeU-.d.ts} +2 -2
  100. package/dist/{index-B8s204GL.d.ts → index-CV-7DWeD.d.ts} +4 -4
  101. package/dist/{index-BW_0MZOS.d.ts → index-Cay5-Kvx.d.ts} +13 -8
  102. package/dist/{index-_9UiQIkt.d.ts → index-DJwEgYzA.d.ts} +4 -4
  103. package/dist/{index-BT5-1VsX.d.ts → index-Dj2qF9VC.d.ts} +1 -1
  104. package/dist/{index-Bv5iXPqU.d.ts → index-ymept53A.d.ts} +4 -4
  105. package/dist/index.d.ts +16 -15
  106. package/dist/index.js +6 -6
  107. package/dist/{init-cE3A8aXq.js → init-DeoSvkh2.js} +1 -1
  108. package/dist/{init-Dz_PsHdv.js → init-fNF_XmTa.js} +3 -3
  109. package/dist/{instance-options-B0KXqTrJ.d.ts → instance-options-CoHn-0e8.d.ts} +1 -1
  110. package/dist/{instance-snapshot--JWiTrvO.js → instance-snapshot-DuWf1cT3.js} +13 -8
  111. package/dist/jwt/index.d.ts +4 -4
  112. package/dist/jwt/index.js +1 -1
  113. package/dist/{kernel-C-fYydV2.js → kernel-qv4cr9w8.js} +4 -4
  114. package/dist/kysely/index.d.ts +3 -3
  115. package/dist/{login-DplQ0s84.js → login-CutVtcmQ.js} +1 -1
  116. package/dist/{login-D-8tMqzo.js → login-DYazeWc9.js} +3 -3
  117. package/dist/{manifest-Cgiq5oqc.js → manifest-B4ENCp2I.js} +35 -35
  118. package/dist/{manifest-CzzWtnAb.d.ts → manifest-B5yF3CIq.d.ts} +19 -0
  119. package/dist/{manifest-wg8WkkpD.js → manifest-BXTbHNIV.js} +1 -1
  120. package/dist/{manifest-schema-2r37XRhD.js → manifest-schema-DQkBK2Mr.js} +28 -1
  121. package/dist/{map-claims-BNWCJtmP.js → map-claims-C-nv08_n.js} +2 -1
  122. package/dist/mcp/index.d.ts +8 -8
  123. package/dist/mcp/index.js +4 -4
  124. package/dist/{migrate-B7oP_sQU.js → migrate-BJHxQqT5.js} +2 -2
  125. package/dist/{module-values-BJTBdo6y.js → module-values-B1EVTkHP.js} +1 -1
  126. package/dist/nest/index.d.ts +4 -4
  127. package/dist/nest/index.js +1 -1
  128. package/dist/next/index.d.ts +32 -12
  129. package/dist/next/index.js +15 -8
  130. package/dist/next/plugin.d.ts +1 -1
  131. package/dist/next/plugin.js +1 -1
  132. package/dist/node/index.d.ts +4 -4
  133. package/dist/node/index.js +1 -1
  134. package/dist/openai/index.d.ts +4 -4
  135. package/dist/openai/index.js +3 -3
  136. package/dist/openapi/index.d.ts +2 -2
  137. package/dist/{openapi-VeHHU2l9.js → openapi-C-ADypaY.js} +1 -1
  138. package/dist/{openapi-CBZUhA3l.js → openapi-DFj0cirS.js} +2 -2
  139. package/dist/orpc/index.d.ts +5 -5
  140. package/dist/orpc/index.js +2 -2
  141. package/dist/otel/index.d.ts +3 -3
  142. package/dist/{output-tkju6U7R.js → output-LsbLe41I.js} +1 -1
  143. package/dist/{ownership-B4L59T9u.js → ownership-qqBuGJXr.js} +11 -6
  144. package/dist/{parse-local-manifest-BQhTlLQS.d.ts → parse-local-manifest-CCmbhnxP.d.ts} +1 -1
  145. package/dist/pdp/index.d.ts +3 -3
  146. package/dist/pdp/index.js +1 -1
  147. package/dist/{permdock-L-_I_3zP.js → permdock-BvjivVb9.js} +143 -107
  148. package/dist/{permdock-B6Sf4T_S.d.ts → permdock-CprAPN3w.d.ts} +9 -2
  149. package/dist/{permissions-mDcTWoBs.js → permissions-CYcHj_w7.js} +1 -1
  150. package/dist/{policy-Ba4bDhaj.d.ts → policy-BycVKnXv.d.ts} +1 -1
  151. package/dist/{policy-from-catalog-CJgOm6aq.js → policy-from-catalog-CU3An8uP.js} +1 -1
  152. package/dist/{policy-types-CCiDRZBH.d.ts → policy-types-DGIO_gxq.d.ts} +54 -18
  153. package/dist/{postgrest-DicQyqm-.d.ts → postgrest-D5nUGm-c.d.ts} +4 -3
  154. package/dist/{postgrest-D4nuPXIQ.js → postgrest-DAxFltvO.js} +35 -56
  155. package/dist/{powersync-DXqGuq9A.js → powersync-B_8uwz7f.js} +2 -2
  156. package/dist/powersync-CSzDCHRu.js +1 -0
  157. package/dist/{powersync-DHNQX06W.js → powersync-DUT-UKgw.js} +190 -38
  158. package/dist/prisma/index.d.ts +2 -2
  159. package/dist/{protected-action-BE7N_Luo.d.ts → protected-action-D8x73IGm.d.ts} +6 -6
  160. package/dist/{provider-DXfq5c2d.d.ts → provider-DfLeek9O.d.ts} +1 -1
  161. package/dist/{pull-CwpGaQSi.js → pull-DQCgvJSC.js} +2 -2
  162. package/dist/pull-DYbyod1f.js +1 -0
  163. package/dist/{push-DgssgzkK.js → push-Dq_ca4-j.js} +3 -3
  164. package/dist/{pushed-policy-ITwYKvvH.js → pushed-policy-CDuOL2de.js} +1 -1
  165. package/dist/{pushed-policy-D1Eoi6NM.d.ts → pushed-policy-CryQheKq.d.ts} +1 -1
  166. package/dist/react/index.d.ts +7 -7
  167. package/dist/react/provider-client.d.ts +1 -1
  168. package/dist/react-native/index.d.ts +9 -9
  169. package/dist/{replay-DNftIb_R.d.ts → replay-Bs9Df2fQ.d.ts} +1 -1
  170. package/dist/{request-context-C25ilqiJ.js → request-context-Duzdf0cd.js} +1 -1
  171. package/dist/resend/index.d.ts +4 -4
  172. package/dist/{resolve-names-CF7xXLSG.js → resolve-names-Y1Cb22cp.js} +4 -4
  173. package/dist/{rls-CNEH2_BG.js → rls-B57mIeVq.js} +34 -20
  174. package/dist/{rls-Ca8Jz9b5.js → rls-j0YrFPpW.js} +1 -1
  175. package/dist/{rpc-fNqAIqQk.js → rpc-vHIwyXCp.js} +1 -1
  176. package/dist/run-BATawNVH.js +1 -0
  177. package/dist/{run-Bz26OTfO.js → run-CLP_fQUF.js} +3 -3
  178. package/dist/{run-ticket-Dv7aF7Dk.js → run-ticket-DfnZCh-u.js} +19 -6
  179. package/dist/{run-ticket-DbWI9f99.d.ts → run-ticket-ylovhyFQ.d.ts} +18 -3
  180. package/dist/{saas-iWnUdwCt.js → saas-DK4V-3Is.js} +2 -2
  181. package/dist/{scan-DCj1KQfn.js → scan-B7xrAvRm.js} +1 -1
  182. package/dist/{schema-Dst9I9Gs.js → schema-3PJ8wAeL.js} +1 -1
  183. package/dist/scim/index.d.ts +1 -1
  184. package/dist/server/index.d.ts +11 -11
  185. package/dist/server/index.js +2 -2
  186. package/dist/{server-types-CIlpSA2G.d.ts → server-types-CyRN0-Cd.d.ts} +15 -8
  187. package/dist/{shared-Afctg7B0.js → shared-DrGLwM3s.js} +1 -1
  188. package/dist/{sink-Dvi7YZG_.d.ts → sink-B5zoUW_O.d.ts} +2 -2
  189. package/dist/{skills-OuoMR49L.js → skills-BUI8DMqy.js} +1 -1
  190. package/dist/{skills-Bjj7BNEQ.js → skills-iwbRxavw.js} +1 -1
  191. package/dist/{snapshot-cache-BAXZ0KOp.d.ts → snapshot-cache-BjAWkchD.d.ts} +1 -1
  192. package/dist/solid/index.d.ts +6 -6
  193. package/dist/solid-start/index.d.ts +4 -4
  194. package/dist/solid-start/index.js +2 -2
  195. package/dist/{sources-CMAM-2A3.js → sources-C4vkzZJV.js} +12 -7
  196. package/dist/{types-ah9NlU6j.d.ts → sources-oB1Hg1Fm.d.ts} +316 -2
  197. package/dist/{src-DZ0l9UAg.js → src-C_pi2Rnh.js} +106 -5
  198. package/dist/ssf/index.d.ts +3 -3
  199. package/dist/{standard-webhooks-C-qX4mJW.d.ts → standard-webhooks-DOYEuOLx.d.ts} +2 -2
  200. package/dist/{stores-C0Kta5Ft.d.ts → stores-DZJvxFIZ.d.ts} +6 -6
  201. package/dist/{stream-ltuLdtTG.d.ts → stream-9y9qw51m.d.ts} +1 -1
  202. package/dist/supabase/index.d.ts +5 -6
  203. package/dist/supabase/index.js +4 -4
  204. package/dist/supabase/middleware.d.ts +5 -5
  205. package/dist/supabase/middleware.js +4 -4
  206. package/dist/{supabase-BL1qJzzY.js → supabase-B1EfuD47.js} +2 -2
  207. package/dist/{supabase-D39cuGPt.js → supabase-BaizG0n7.js} +2 -2
  208. package/dist/{supabase-hook-B-yXnzUl.js → supabase-hook-BT2P9wah.js} +110 -47
  209. package/dist/supabase-hook-CbvGAutK.js +1 -0
  210. package/dist/{supautils-BU-pAEpf.js → supautils-DBKOoyjn.js} +247 -200
  211. package/dist/svelte/index.d.ts +6 -6
  212. package/dist/svelte/runtime.d.ts +3 -3
  213. package/dist/svelte/source.d.ts +6 -6
  214. package/dist/sveltekit/index.d.ts +4 -4
  215. package/dist/sveltekit/index.js +1 -1
  216. package/dist/{tables-DeMNEy6V.js → tables-DimBcVWY.js} +3 -3
  217. package/dist/tanstack-start/index.d.ts +4 -4
  218. package/dist/tanstack-start/index.js +1 -1
  219. package/dist/terminal/index.d.ts +5 -5
  220. package/dist/terminal/index.js +2 -2
  221. package/dist/testing/core.d.ts +1 -1
  222. package/dist/testing/core.js +1 -1
  223. package/dist/testing/fixtures/index.d.ts +1 -1
  224. package/dist/testing/fixtures/index.js +26 -28
  225. package/dist/testing/index.d.ts +23 -21
  226. package/dist/testing/index.js +64 -10
  227. package/dist/testing/saas/index.d.ts +3 -3
  228. package/dist/testing/saas/index.js +2 -2
  229. package/dist/testing/saas/permissions.js +1 -1
  230. package/dist/trpc/index.d.ts +5 -5
  231. package/dist/trpc/index.js +2 -2
  232. package/dist/{type-helpers-BIPIDa6a.d.ts → type-helpers-c7Xo_2Cu.d.ts} +1 -1
  233. package/dist/{types-B2mlGuhW.d.ts → types-B2efzoSX.d.ts} +1 -1
  234. package/dist/{types-DHKPcqzr.d.ts → types-B6ExllNo.d.ts} +2 -2
  235. package/dist/{types-AMJ5qoU_.d.ts → types-BB-zWDcR.d.ts} +4 -4
  236. package/dist/{types-djVzLlIV.d.ts → types-CEinc15V.d.ts} +4 -4
  237. package/dist/{types-yUuPR5Hy.d.ts → types-CN0LsqbK.d.ts} +3 -3
  238. package/dist/{types-HzqOtvsJ.d.ts → types-CWBsAwqn.d.ts} +4 -4
  239. package/dist/{types-DC1Loeh3.d.ts → types-Cklw5hJo.d.ts} +26 -3
  240. package/dist/{types-B_tiYvk8.d.ts → types-DLvhVm1r.d.ts} +1 -1
  241. package/dist/{types-B4uqKDnp.d.ts → types-DlelvQk4.d.ts} +2 -2
  242. package/dist/{types-DjuMBNF9.d.ts → types-DsHGPtkR.d.ts} +2 -2
  243. package/dist/{types-BJk0BKRX.d.ts → types-rCRV4Ge-.d.ts} +4 -4
  244. package/dist/{types-B_d_g7T3.d.ts → types-tQB2CEnY.d.ts} +4 -4
  245. package/dist/unplugin/index.d.ts +1 -1
  246. package/dist/unplugin/index.js +1 -1
  247. package/dist/{usage-ab0PdusX.js → usage-B1ZJOUdr.js} +1 -1
  248. package/dist/{usage-CxEzS4ey.js → usage-t_nXnwCW.js} +3 -3
  249. package/dist/usage-weohzv2f.js +1 -0
  250. package/dist/{validation-error-YGg2mXyH.d.ts → validation-error-uvp-kyfO.d.ts} +1 -1
  251. package/dist/{verify-DZeqoWu5.js → verify-jHrbmn-E.js} +9 -9
  252. package/dist/version-cache-Df11C2Qp.d.ts +51 -0
  253. package/dist/vue/index.d.ts +6 -6
  254. package/dist/{waiter-Bu9zAlE0.d.ts → waiter-CqUKX6CY.d.ts} +2 -2
  255. package/dist/{watch-Cx_WciLE.js → watch-Bpci3hBY.js} +2 -2
  256. package/dist/watch-COuvly20.js +1 -0
  257. package/dist/webmcp/index.d.ts +1 -1
  258. package/dist/{who-can-rI7dCR9Q.js → who-can-BoDJm0Nc.js} +1 -1
  259. package/dist/workflow/index.d.ts +3 -3
  260. package/dist/workflow/index.js +23 -7
  261. package/dist/workflow-sdk/index.d.ts +4 -4
  262. package/dist/{wrap-DlJE3gS_.d.ts → wrap-DxXB54Wu.d.ts} +2 -2
  263. package/package.json +3 -3
  264. package/schemas/run-v1.json +16 -0
  265. package/schemas/supabase-manifest-v1.json +28 -0
  266. package/skills/permdock-agents/references/operations-automations-chat.md +1 -0
  267. package/skills/permdock-data/references/queries-and-rls.md +1 -1
  268. package/skills/permdock-wire/references/adapters.md +4 -3
  269. package/dist/catalog-mRQQQhNK.js +0 -1
  270. package/dist/collect-B5BL3klN.js +0 -1
  271. package/dist/powersync-Djf-zCpB.js +0 -1
  272. package/dist/pull-B65ndFNZ.js +0 -1
  273. package/dist/run-D-JE8QWb.js +0 -1
  274. package/dist/sources-B1Os_YUu.d.ts +0 -312
  275. package/dist/supabase-hook-H-MtE9Wd.js +0 -1
  276. package/dist/usage-CYeXek0p.js +0 -1
  277. package/dist/watch-DB42U1ib.js +0 -1
@@ -1,8 +1,8 @@
1
- import { $n as AuthorizationDetail, T as Policy, sr as Principal } from "../policy-types-CCiDRZBH.js";
1
+ import { T as Policy, ar as AuthorizationDetail, pr as Principal } from "../policy-types-DGIO_gxq.js";
2
2
  import { u as Permission } from "../permission-types-CAY-GU7e.js";
3
- import { m as ApprovalStore } from "../types-B_tiYvk8.js";
4
- import { a as ProblemDetails } from "../errors-zi_4T-rx.js";
5
- import { t as InstanceOptions } from "../instance-options-B0KXqTrJ.js";
3
+ import { m as ApprovalStore } from "../types-DLvhVm1r.js";
4
+ import { a as ProblemDetails } from "../errors-BIM4MFsJ.js";
5
+ import { t as InstanceOptions } from "../instance-options-CoHn-0e8.js";
6
6
  //#region src/a2a/types.d.ts
7
7
  type A2aAuth = {
8
8
  readonly clientId?: string;
package/dist/a2a/index.js CHANGED
@@ -5,10 +5,10 @@ import { n as PermDockDeniedError, t as PermDockApprovalRequiredError } from "..
5
5
  import { t as canonicalJson } from "../canonical-json-DwilZ1iB.js";
6
6
  import { t as bytesToBase64Url } from "../sha256-C-4WXKIu.js";
7
7
  import { n as resourceRef } from "../resource-ref-CaS9yVPi.js";
8
- import { i as challengeScope, l as withApp, o as hasScope, s as scopesReaching } from "../permdock-L-_I_3zP.js";
8
+ import { i as challengeScope, l as withApp, o as hasScope, s as scopesReaching } from "../permdock-BvjivVb9.js";
9
9
  import { p as wwwAuthenticate, r as bearerChallenge } from "../problem-BVLHFK33.js";
10
- import { r as instanceOptions } from "../build-instance-CNWaYJyr.js";
11
- import { n as createAgentKernel } from "../kernel-C-fYydV2.js";
10
+ import { r as instanceOptions } from "../build-instance-BWXqwQYU.js";
11
+ import { n as createAgentKernel } from "../kernel-qv4cr9w8.js";
12
12
  import { t as delegationFrom } from "../delegation-input-FTxMK3ji.js";
13
13
  //#region src/a2a/create.ts
14
14
  function firstScheme(options) {
@@ -1,4 +1,4 @@
1
- import { a as ProblemDetails } from "./errors-zi_4T-rx.js";
1
+ import { a as ProblemDetails } from "./errors-BIM4MFsJ.js";
2
2
  //#region src/core/action-result.d.ts
3
3
  /** What a `protectAction` action resolves to; both members cross to the client. */
4
4
  type ActionResult<T> = {
@@ -0,0 +1,39 @@
1
+ import { i as qualifySqlTable } from "./sql-0WjxIp9g.js";
2
+ //#region src/better-supabase/active-tenant.ts
3
+ function describe(from) {
4
+ return "appMetadata" in from ? `app_metadata.${from.appMetadata}` : `${from.table}.${from.column} (joined on ${from.id})`;
5
+ }
6
+ /**
7
+ * Why PermDock's token hook and better-supabase disagree on the active tenant,
8
+ * or `undefined` when they agree. `"resolver"` takes the tenant from the
9
+ * request, so any hook source agrees with it.
10
+ */
11
+ function activeTenantMismatch(from, tenantClaim, activeTenant) {
12
+ if (activeTenant === "resolver") return;
13
+ if (activeTenant === "claim") {
14
+ if ("appMetadata" in from && from.appMetadata === tenantClaim) return;
15
+ return `blocks.permissions.activeTenant is "claim", so better-supabase's switch_organization writes app_metadata.${tenantClaim}, but PermDock's token hook reads the active tenant from ${describe(from)}. Set supabase.hook.activeFrom: "app_metadata.${tenantClaim}" and run permdock supabase hook generate.`;
16
+ }
17
+ const dot = activeTenant.profileColumn.lastIndexOf(".");
18
+ if (dot <= 0) return;
19
+ const table = qualifySqlTable(activeTenant.profileColumn.slice(0, dot));
20
+ const column = activeTenant.profileColumn.slice(dot + 1);
21
+ const id = activeTenant.key ?? "id";
22
+ if ("table" in from && qualifySqlTable(from.table) === table && from.column === column && from.id === id) return;
23
+ return `blocks.permissions.activeTenant writes the active tenant to ${table}.${column} (joined on ${id}), but PermDock's token hook reads it from ${describe(from)}. Set supabase.hook.activeFrom: { table: "${table}", column: "${column}", id: "${id}" } and run permdock supabase hook generate.`;
24
+ }
25
+ /**
26
+ * Where the token hook reads the active tenant, as better-supabase names it in
27
+ * `tokenHook.activeOrganizationFrom`, or `undefined` when the hook reads an
28
+ * `app_metadata` key other than the tenant claim, which has no better-supabase
29
+ * name.
30
+ */
31
+ function activeOrganizationFrom(from, tenantClaim) {
32
+ if ("appMetadata" in from) return from.appMetadata === tenantClaim ? "claim" : void 0;
33
+ return {
34
+ profileColumn: `${qualifySqlTable(from.table)}.${from.column}`,
35
+ ...from.id === "id" ? {} : { key: from.id }
36
+ };
37
+ }
38
+ //#endregion
39
+ export { activeTenantMismatch as n, activeOrganizationFrom as t };
@@ -1,5 +1,5 @@
1
1
  import { r as listSourceFiles } from "./files-BSjrtIHw.js";
2
- import { t as DOCS_BASE } from "./manifest-Cgiq5oqc.js";
2
+ import { t as DOCS_BASE } from "./manifest-B4ENCp2I.js";
3
3
  import { readFileSync } from "node:fs";
4
4
  import { relative } from "node:path";
5
5
  //#region src/cli/adoption-scan.ts
@@ -1,3 +1,3 @@
1
- import { n as DeniedTextEvent, t as DeniedText } from "../denied-text-CHNlVInN.js";
2
- import { a as createPermDock, c as ModelMap, d as StepUp, i as OperationVerdict, l as ToolBinding, n as AgentPermDockOptions, o as AgentAdapterOptions, r as GatewayOptions, s as DecideToolOptions, t as AgentPermDock, u as ToolMap } from "../create-BSNrVuxh.js";
1
+ import { n as DeniedTextEvent, t as DeniedText } from "../denied-text-DHldhVUv.js";
2
+ import { a as createPermDock, c as ModelMap, d as StepUp, i as OperationVerdict, l as ToolBinding, n as AgentPermDockOptions, o as AgentAdapterOptions, r as GatewayOptions, s as DecideToolOptions, t as AgentPermDock, u as ToolMap } from "../create-BPUopdfL.js";
3
3
  export { type AgentAdapterOptions, type AgentPermDock, type AgentPermDockOptions, type DecideToolOptions, type DeniedText, type DeniedTextEvent, type GatewayOptions, type ModelMap, type OperationVerdict, type StepUp, type ToolBinding, type ToolMap, createPermDock };
@@ -1 +1 @@
1
- export { n as createPermDock } from "../create-Cq4Uox0f.js";
1
+ export { n as createPermDock } from "../create-6EwRQlig.js";
@@ -1,7 +1,7 @@
1
- import { T as Policy, j as PolicyVocabulary, sr as Principal } from "../policy-types-CCiDRZBH.js";
1
+ import { T as Policy, j as PolicyVocabulary, pr as Principal } from "../policy-types-DGIO_gxq.js";
2
2
  import { u as Permission } from "../permission-types-CAY-GU7e.js";
3
- import { n as DeniedTextEvent, t as DeniedText } from "../denied-text-CHNlVInN.js";
4
- import { d as StepUp, o as AgentAdapterOptions, t as AgentPermDock } from "../create-BSNrVuxh.js";
3
+ import { n as DeniedTextEvent, t as DeniedText } from "../denied-text-DHldhVUv.js";
4
+ import { d as StepUp, o as AgentAdapterOptions, t as AgentPermDock } from "../create-BPUopdfL.js";
5
5
  //#region src/ai-sdk/create.d.ts
6
6
  type AiSdkContext = {
7
7
  readonly runtimeContext?: unknown;
@@ -1,8 +1,8 @@
1
1
  import { t as compact } from "../compact-CAf557ZB.js";
2
2
  import { n as PermDockDeniedError, t as PermDockApprovalRequiredError } from "../errors-B6R_lg2a.js";
3
- import { l as withApp } from "../permdock-L-_I_3zP.js";
4
- import { r as stepUpText, t as approvalTokenOf } from "../kernel-C-fYydV2.js";
5
- import { t as agentRuntime } from "../create-Cq4Uox0f.js";
3
+ import { l as withApp } from "../permdock-BvjivVb9.js";
4
+ import { r as stepUpText, t as approvalTokenOf } from "../kernel-qv4cr9w8.js";
5
+ import { t as agentRuntime } from "../create-6EwRQlig.js";
6
6
  //#region src/ai-sdk/create.ts
7
7
  const APPROVAL_STATUSES = /* @__PURE__ */ new Set([
8
8
  "approved",
@@ -1,5 +1,5 @@
1
1
  import { s as OperationMeta, t as Operation } from "./operations-Ci_rT6Uo.js";
2
- import { u as ApprovalRequest } from "./types-B_tiYvk8.js";
2
+ import { u as ApprovalRequest } from "./types-DLvhVm1r.js";
3
3
  //#region src/delivery/approval-prompt.d.ts
4
4
  /**
5
5
  * What an email or chat prompt shows an approver, wire format v1. It carries no
@@ -1,5 +1,5 @@
1
- import { _ as DEFAULT_APPROVAL_TTL, a as ApprovalDelegationSource, b as escalationOpenAt, c as ApprovalListQuery, d as ApprovalResumeFailureCause, f as ApprovalSignature, g as ApprovalVerdict, h as ApprovalSubjectSummary, i as ApprovalDelegation, l as ApprovalPage, m as ApprovalStore, n as ApprovalApprovers, o as ApprovalInspectResult, p as ApprovalStatus, r as ApprovalCancelMeta, s as ApprovalListFilter, t as APPROVAL_HEADER, u as ApprovalRequest, v as approvalQuorum, y as approverRelationKey } from "../types-B_tiYvk8.js";
1
+ import { _ as DEFAULT_APPROVAL_TTL, a as ApprovalDelegationSource, b as escalationOpenAt, c as ApprovalListQuery, d as ApprovalResumeFailureCause, f as ApprovalSignature, g as ApprovalVerdict, h as ApprovalSubjectSummary, i as ApprovalDelegation, l as ApprovalPage, m as ApprovalStore, n as ApprovalApprovers, o as ApprovalInspectResult, p as ApprovalStatus, r as ApprovalCancelMeta, s as ApprovalListFilter, t as APPROVAL_HEADER, u as ApprovalRequest, v as approvalQuorum, y as approverRelationKey } from "../types-DLvhVm1r.js";
2
2
  import { n as ApprovalErrorCode, r as isApprovalError, t as ApprovalError } from "../errors-CHwoRRpB.js";
3
- import { a as AccessReviewItemQuery, c as AccessReviewStore, i as AccessReviewItemPage, n as AccessReviewDecision, o as AccessReviewItemStatus, r as AccessReviewItem, s as AccessReviewStatus, t as AccessReview } from "../types-B2mlGuhW.js";
4
- import { $ as AccessReviewHolder, A as SignApprovalOptions, B as IdempotentResponse, C as ApproverRelationsOptions, D as approvalView, E as approvalEntityTag, F as ApprovalsHandlerOptions, G as ApprovalDelegationMatch, H as idempotencyRecordKey, I as approvalsHandler, J as memoryApprovalDelegationSource, K as MatchDelegationOptions, L as IdempotencyRecord, M as signApproval, N as APPROVAL_REQUEST_SCHEMA, O as ApprovalSignatureClaims, P as parseApprovalRequest, Q as pageAccessReviewItems, R as IdempotencyStore, S as vouchApproval, T as ApprovalView, U as matchesIdempotencyRecord, V as idempotencyRecord, W as memoryIdempotencyStore, X as MemoryAccessReviewStore, Y as parseApprovalDelegation, Z as memoryAccessReviewStore, _ as resolveApproval, a as approverPermissions, at as isAccessReviewError, b as storedApprovalToken, c as decodeApprovalCursor, ct as decideAccessReviewItem, d as pageApprovals, et as AccessReviewOptions, f as cancelApprovals, g as requestApproval, h as readApprovalHeader, i as memoryApprovalStore, it as AccessReviewErrorCode, j as approvalSignatureClaims, k as ApprovalSignatureEntry, l as encodeApprovalCursor, lt as AccessReviewsHandlerOptions, m as inspectApproval, n as applyApprovalVerdict, nt as startAccessReview, o as ApprovalCursorPosition, ot as AccessReviewVerdict, p as consumeApproval, q as matchDelegation, r as assertApprover, rt as AccessReviewError, s as approvalPageSize, st as accessReviewerEligible, t as MemoryApprovalStore, tt as StartAccessReviewInput, u as listAllApprovals, ut as accessReviewsHandler, v as resumeDecision, w as approverRelations, x as summarizeSubject, y as resumeFromHeader, z as IdempotentCall } from "../index-_9UiQIkt.js";
3
+ import { a as AccessReviewItemQuery, c as AccessReviewStore, i as AccessReviewItemPage, n as AccessReviewDecision, o as AccessReviewItemStatus, r as AccessReviewItem, s as AccessReviewStatus, t as AccessReview } from "../types-B2efzoSX.js";
4
+ import { $ as AccessReviewHolder, A as SignApprovalOptions, B as IdempotentResponse, C as ApproverRelationsOptions, D as approvalView, E as approvalEntityTag, F as ApprovalsHandlerOptions, G as ApprovalDelegationMatch, H as idempotencyRecordKey, I as approvalsHandler, J as memoryApprovalDelegationSource, K as MatchDelegationOptions, L as IdempotencyRecord, M as signApproval, N as APPROVAL_REQUEST_SCHEMA, O as ApprovalSignatureClaims, P as parseApprovalRequest, Q as pageAccessReviewItems, R as IdempotencyStore, S as vouchApproval, T as ApprovalView, U as matchesIdempotencyRecord, V as idempotencyRecord, W as memoryIdempotencyStore, X as MemoryAccessReviewStore, Y as parseApprovalDelegation, Z as memoryAccessReviewStore, _ as resolveApproval, a as approverPermissions, at as isAccessReviewError, b as storedApprovalToken, c as decodeApprovalCursor, ct as decideAccessReviewItem, d as pageApprovals, et as AccessReviewOptions, f as cancelApprovals, g as requestApproval, h as readApprovalHeader, i as memoryApprovalStore, it as AccessReviewErrorCode, j as approvalSignatureClaims, k as ApprovalSignatureEntry, l as encodeApprovalCursor, lt as AccessReviewsHandlerOptions, m as inspectApproval, n as applyApprovalVerdict, nt as startAccessReview, o as ApprovalCursorPosition, ot as AccessReviewVerdict, p as consumeApproval, q as matchDelegation, r as assertApprover, rt as AccessReviewError, s as approvalPageSize, st as accessReviewerEligible, t as MemoryApprovalStore, tt as StartAccessReviewInput, u as listAllApprovals, ut as accessReviewsHandler, v as resumeDecision, w as approverRelations, x as summarizeSubject, y as resumeFromHeader, z as IdempotentCall } from "../index-DJwEgYzA.js";
5
5
  export { APPROVAL_HEADER, APPROVAL_REQUEST_SCHEMA, type AccessReview, type AccessReviewDecision, AccessReviewError, type AccessReviewErrorCode, type AccessReviewHolder, type AccessReviewItem, type AccessReviewItemPage, type AccessReviewItemQuery, type AccessReviewItemStatus, type AccessReviewOptions, type AccessReviewStatus, type AccessReviewStore, type AccessReviewVerdict, type AccessReviewsHandlerOptions, type ApprovalApprovers, type ApprovalCancelMeta, type ApprovalCursorPosition, type ApprovalDelegation, type ApprovalDelegationMatch, type ApprovalDelegationSource, ApprovalError, type ApprovalErrorCode, type ApprovalInspectResult, type ApprovalListFilter, type ApprovalListQuery, type ApprovalPage, type ApprovalRequest, type ApprovalResumeFailureCause, type ApprovalSignature, type ApprovalSignatureClaims, type ApprovalSignatureEntry, type ApprovalStatus, type ApprovalStore, type ApprovalSubjectSummary, type ApprovalVerdict, type ApprovalView, type ApprovalsHandlerOptions, type ApproverRelationsOptions, DEFAULT_APPROVAL_TTL, type IdempotencyRecord, type IdempotencyStore, type IdempotentCall, type IdempotentResponse, type MatchDelegationOptions, type MemoryAccessReviewStore, type MemoryApprovalStore, type SignApprovalOptions, type StartAccessReviewInput, accessReviewerEligible, accessReviewsHandler, applyApprovalVerdict, approvalEntityTag, approvalPageSize, approvalQuorum, approvalSignatureClaims, approvalView, approvalsHandler, approverPermissions, approverRelationKey, approverRelations, assertApprover, cancelApprovals, consumeApproval, decideAccessReviewItem, decodeApprovalCursor, encodeApprovalCursor, escalationOpenAt, idempotencyRecord, idempotencyRecordKey, inspectApproval, isAccessReviewError, isApprovalError, listAllApprovals, matchDelegation, matchesIdempotencyRecord, memoryAccessReviewStore, memoryApprovalDelegationSource, memoryApprovalStore, memoryIdempotencyStore, pageAccessReviewItems, pageApprovals, parseApprovalDelegation, parseApprovalRequest, readApprovalHeader, requestApproval, resolveApproval, resumeDecision, resumeFromHeader, signApproval, startAccessReview, storedApprovalToken, summarizeSubject, vouchApproval };
@@ -21,7 +21,7 @@ const check = defineLeaf({
21
21
  ...permissionsFlag
22
22
  },
23
23
  async run(ctx, { flags }) {
24
- return (await import("./arazzo-B5-ulWif.js")).runArazzo({
24
+ return (await import("./arazzo-DhxDfYt-.js")).runArazzo({
25
25
  cwd: ctx.cwd,
26
26
  config: ctx.config,
27
27
  doc: given(flags.doc),
@@ -1,9 +1,9 @@
1
- import { _ as arazzoFindings } from "./src-DZ0l9UAg.js";
1
+ import { _ as arazzoFindings } from "./src-C_pi2Rnh.js";
2
2
  import { c as missingInput } from "./errors-Vpu6rKHl.js";
3
3
  import { i as readJsonFile } from "./files-BSjrtIHw.js";
4
4
  import { t as ARAZZO_REPORT_SCHEMA } from "./version-DMQ0dnN5.js";
5
5
  import { a as loadModule, s as pickNamed, t as asPermissionTree } from "./load-DjSU5KXO.js";
6
- import { t as DOCS_BASE } from "./manifest-Cgiq5oqc.js";
6
+ import { t as DOCS_BASE } from "./manifest-B4ENCp2I.js";
7
7
  import { existsSync } from "node:fs";
8
8
  import { resolve } from "node:path";
9
9
  //#region src/cli/arazzo.ts
@@ -1,9 +1,9 @@
1
- import { Gt as Snapshot, T as Policy, j as PolicyVocabulary, sr as Principal } from "../policy-types-CCiDRZBH.js";
1
+ import { T as Policy, Zt as Snapshot, j as PolicyVocabulary, pr as Principal } from "../policy-types-DGIO_gxq.js";
2
2
  import { u as Permission } from "../permission-types-CAY-GU7e.js";
3
3
  import { a as OperationInput, t as Operation } from "../operations-Ci_rT6Uo.js";
4
- import { a as PermDock } from "../permdock-B6Sf4T_S.js";
5
- import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CIlpSA2G.js";
6
- import { a as ProtectTarget, i as PermDockHandlers, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-C1DCvpqV.js";
4
+ import { a as PermDock } from "../permdock-CprAPN3w.js";
5
+ import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CyRN0-Cd.js";
6
+ import { a as ProtectTarget, i as PermDockHandlers, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-BIbBAtPZ.js";
7
7
  import { APIContext, MiddlewareHandler } from "astro";
8
8
  //#region src/astro/create.d.ts
9
9
  type AstroPermDockOptions<TUser = unknown> = FetchAdapterOptions<APIContext, TUser>;
@@ -1,5 +1,5 @@
1
1
  import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-IBceAeKT.js";
2
- import { n as guardedRoute, r as instanceRoute, t as fetchAdapter } from "../fetch-adapter-JL43jD3E.js";
2
+ import { n as guardedRoute, r as instanceRoute, t as fetchAdapter } from "../fetch-adapter-dPTgJVHd.js";
3
3
  //#region src/astro/create.ts
4
4
  const route = {
5
5
  context: (context) => context,
@@ -1,4 +1,4 @@
1
- import { t as whoCan } from "./who-can-rI7dCR9Q.js";
1
+ import { t as whoCan } from "./who-can-BoDJm0Nc.js";
2
2
  //#region src/delivery/audience.ts
3
3
  async function granted(permdock, ids, permission, row) {
4
4
  const unique = [...new Set(ids.filter((id) => typeof id === "string" && id !== ""))];
@@ -1,8 +1,8 @@
1
- import { T as Policy, Zn as Actor, rr as Delegation, sr as Principal } from "../policy-types-CCiDRZBH.js";
2
- import { m as ApprovalStore } from "../types-B_tiYvk8.js";
3
- import { a as ProblemDetails } from "../errors-zi_4T-rx.js";
4
- import { t as InstanceOptions } from "../instance-options-B0KXqTrJ.js";
5
- import { a as evaluationsSemantic, n as EvaluationsSemantic, r as evaluateBatch, t as EVALUATIONS_SEMANTICS } from "../evaluations-z8dQFDaN.js";
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";
6
6
  //#region src/authzen/map.d.ts
7
7
  type AuthzenEntity = {
8
8
  readonly type?: unknown;
@@ -7,7 +7,7 @@ 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-CNWaYJyr.js";
10
+ import { n as resolveOrNull, t as buildInstance } from "../build-instance-BWXqwQYU.js";
11
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";
12
12
  //#region src/authzen/map.ts
13
13
  const UNKNOWN = {
@@ -1,4 +1,4 @@
1
- import { Lt as InstanceHandle, Rn as Denial, Rt as Instant } from "./policy-types-CCiDRZBH.js";
1
+ import { Ut as InstanceHandle, Wn as Denial, Wt as Instant } from "./policy-types-DGIO_gxq.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 { N as RoleBinding, W as CustomRoleSource, lr as Subject, q as DecisionSink, sr as Principal } from "../policy-types-CCiDRZBH.js";
1
+ import { G as CustomRoleSource, J as DecisionSink, N as RoleBinding, hr as Subject, pr as Principal } from "../policy-types-DGIO_gxq.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,13 +1,15 @@
1
- import { Rt as Instant, St as ApiKeyPrincipal, T as Policy, U as CredentialVerifier, Zt as AuthEvent, _n as ApproverInput, gt as SupportSession, lr as Subject, sr as Principal } from "../policy-types-CCiDRZBH.js";
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";
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-B6Sf4T_S.js";
4
- import { c as AccessReviewStore } from "../types-B2mlGuhW.js";
5
- import { i as SupabaseRpcCaller } from "../postgrest-DicQyqm-.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
6
  import { a as CatalogDocument } from "../types-ZzRGoViD.js";
7
- import { d as SupabasePrincipal, g as SupabaseSessionLike, v as SupabaseSubjectOptions } from "../types-ah9NlU6j.js";
8
- import { c as LinkPolicy, o as CapabilityPrincipal, t as Capability } from "../capability-ChuiONQU.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";
9
+ import { t as SqlQuery } from "../sql-B80DFdpG.js";
10
+ import { c as LinkPolicy, o as CapabilityPrincipal, t as Capability } from "../capability-Di9tiUvi.js";
9
11
  import { AuthorizationProvider } from "better-supabase/config";
10
- import { AuthSession, AuthorizationHooks, Authorizer, SupportAuthorize, SupportAuthorizeInput } from "better-supabase/server";
12
+ import { AuthSession, AuthorizationHooks, AuthorizationRequest, Authorizer, SupportAuthorize, SupportAuthorizeInput } from "better-supabase/server";
11
13
  import { EntitlementClaimOptions } from "better-supabase/blocks/entitlements";
12
14
  import { ApiKey, ApiKeyClaimsOptions, ApiKeys } from "better-supabase/blocks/api-keys";
13
15
  import { AccessTopicPolicy } from "better-supabase/realtime";
@@ -159,6 +161,18 @@ type ApiKeySessionOptions = {
159
161
  */
160
162
  readonly serviceRoles?: ServiceRoles<ApiKeySession>;
161
163
  };
164
+ /**
165
+ * better-supabase's `SessionSnapshot` (0.15 and later): one verified token,
166
+ * from `bsb.getRequestSession()`, that `'use cache: private'` scopes share. Its
167
+ * `issuedAt` and `authzVersion` come from the `iat` and `authz_ver` claims.
168
+ */
169
+ type SessionSnapshotLike = {
170
+ readonly accessToken: string;
171
+ readonly userId: string;
172
+ readonly claims: unknown;
173
+ readonly issuedAt?: number | null;
174
+ readonly authzVersion?: number | null;
175
+ };
162
176
  /** The claim, and the short code better-supabase writes for each feature key. */
163
177
  type FeatureClaim = EntitlementClaimOptions;
164
178
  type BetterSupabaseSubjectOptions = Omit<SupabaseSubjectOptions, "claims"> & {
@@ -184,9 +198,10 @@ type BetterSupabaseSubjectOptions = Omit<SupabaseSubjectOptions, "claims"> & {
184
198
  * verified `apiKey` session is the key's credential subject: a personal key
185
199
  * acts as its user within the key's scopes, a tenant key as a `service`
186
200
  * principal holding `serviceRoles`. Without `apiKeys`, and for `anon`,
187
- * `service` and `invalid` sessions, the subject is anonymous.
201
+ * `service` and `invalid` sessions, the subject is anonymous. A
202
+ * `SessionSnapshot` maps as the user session of its claims.
188
203
  */
189
- export declare function subjectFromBetterSupabase(session: SupabaseSessionLike | ApiKeySession | null | undefined, options?: BetterSupabaseSubjectOptions): Subject<SupabasePrincipal> | Subject<ApiKeyPrincipal> | Subject;
204
+ export declare function subjectFromBetterSupabase(session: SupabaseSessionLike | ApiKeySession | SessionSnapshotLike | null | undefined, options?: BetterSupabaseSubjectOptions): Subject<SupabasePrincipal> | Subject<ApiKeyPrincipal> | Subject;
190
205
  //#endregion
191
206
  //#region src/better-supabase/subscribers.d.ts
192
207
  /** The fields of better-supabase's `OutboxEvent` the policy reads. */
@@ -350,6 +365,17 @@ type AuthorizationHooksOptions = {
350
365
  */
351
366
  export declare function authorizationHooks(options: AuthorizationHooksOptions): AuthorizationHooks;
352
367
  //#endregion
368
+ //#region src/better-supabase/active-tenant.d.ts
369
+ /**
370
+ * better-supabase's `blocks.permissions.activeTenant`: where its
371
+ * `switch_organization` writes the active tenant and `current_tenant_id()`
372
+ * reads it.
373
+ */
374
+ type BetterSupabaseActiveTenant = "claim" | "resolver" | {
375
+ readonly profileColumn: string;
376
+ readonly key?: string;
377
+ };
378
+ //#endregion
353
379
  //#region src/better-supabase/provider.d.ts
354
380
  type AuthorizationProviderOptions = {
355
381
  /**
@@ -380,6 +406,14 @@ type AuthorizationProviderOptions = {
380
406
  * `permdock_is_approver` from `rls.approvals`.
381
407
  */
382
408
  readonly approvers?: ProviderApprovers;
409
+ /**
410
+ * better-supabase's `blocks.permissions.activeTenant`. When the token hook
411
+ * reads the active tenant from another place than better-supabase writes it,
412
+ * `problems` names the `supabase.hook.activeFrom` to set. With `"resolver"`
413
+ * the tenant comes from the request, so `tokenHook.activeOrganizationFrom`
414
+ * stays unset and doctor BS409 has nothing to compare.
415
+ */
416
+ readonly activeTenant?: BetterSupabaseActiveTenant;
383
417
  };
384
418
  /**
385
419
  * better-supabase's `authorization` config value, built from PermDock's
@@ -387,16 +421,31 @@ type AuthorizationProviderOptions = {
387
421
  * templates, the membership tables, suspension rows, the token hook and every
388
422
  * catalog key with `sqlComplete` set from its `rowConditions`. A `_for`
389
423
  * template and `permissionsFor` are set only when the manifest lists their
390
- * helper, which `rls.mode: 'database'` writes; `isApprover` only with
391
- * `approvers` and `permdock_is_approver`, and otherwise `canApprove` only with
392
- * `approver`. `holdersOf` (`permitted_<tenant scope>_users`) and
393
- * `actorMayWrite` (`permdock_actor_may_write()`) are set when the manifest
394
- * lists their helper, and so is `teamIdsOf` (`member_<scope>_ids_of({user})`)
395
- * for a scope named `team` or `teams`. Throws when the manifest or catalog is
396
- * invalid, or when the tenant scope is ambiguous.
424
+ * helper, which `rls.mode: 'database'` writes. `isApprover` is set with
425
+ * `approvers` or `approver` and `permdock_is_approver`: `approver` fills its
426
+ * `'ai-tool'` entry. `canApprove` is never set. `holdersOf` (`permitted_<tenant
427
+ * scope>_users`) and `actorMayWrite` (`permdock_actor_may_write()`) are set
428
+ * when the manifest lists their helper, and so is `teamIdsOf`
429
+ * (`member_<scope>_ids_of({user})`) for a scope named `team` or `teams`. Throws
430
+ * when the manifest or catalog is invalid, or when the tenant scope is
431
+ * ambiguous.
397
432
  */
398
433
  export declare function authorizationProvider(options: AuthorizationProviderOptions): AuthorizationProvider;
399
434
  //#endregion
435
+ //#region src/better-supabase/report.d.ts
436
+ /** What an `onError` sink receives next to the thrown error. */
437
+ type BetterSupabaseErrorContext = {
438
+ /** The key of the permission being checked, when the request named one. */
439
+ readonly permission: string | null;
440
+ /** The active tenant the check ran in, or `null`. */
441
+ readonly tenant: string | null;
442
+ };
443
+ /**
444
+ * Receives an error a permission check threw. The check still denies; a sink
445
+ * that throws is ignored.
446
+ */
447
+ type BetterSupabaseOnError = (error: unknown, context: BetterSupabaseErrorContext) => void;
448
+ //#endregion
400
449
  //#region src/better-supabase/authorizer.d.ts
401
450
  /**
402
451
  * The table operations better-supabase's `permissions: true` resolves through
@@ -416,10 +465,36 @@ type AuthorizerOptions = {
416
465
  */
417
466
  readonly operations?: Readonly<Record<string, Partial<Record<AuthorizerOperation, Permission>>>>;
418
467
  /**
419
- * Sources and sinks for each instance. The subject, actor and tenant always
420
- * come from the verified request.
468
+ * The membership source a stale or truncated token is re-read from, wrapped
469
+ * in `claimsFirst(source, { onStale: 'reread', versions })`. `versions` is
470
+ * the cache better-supabase passes at runtime (`createNext({ versions })`),
471
+ * else the `versions` option.
421
472
  */
422
- readonly options?: Omit<PermDockOptions, "tenant" | "actor" | "delegation" | "session" | "expiresAt">;
473
+ readonly memberships?: MembershipSource | readonly MembershipSource[];
474
+ /**
475
+ * The current authorization version for `memberships`, such as
476
+ * `authzVersion({ query })`; default the source's own `version`.
477
+ */
478
+ readonly version?: MembershipSource["version"];
479
+ /**
480
+ * The version cache for `memberships` when better-supabase passes none (0.13
481
+ * and 0.14, or a server created without `versions`).
482
+ */
483
+ readonly versions?: VersionCache;
484
+ /**
485
+ * The intent of one check. By default a batch (`evaluations`, list and row
486
+ * filtering) and an action named `read`, `list` or `view` are `read`, so
487
+ * `claimsFirst` may answer from the version cache; every other check is
488
+ * `write` and reads the version live.
489
+ */
490
+ readonly intent?: (request: AuthorizationRequest<Permission>) => Intent;
491
+ /** Receives every error a check threw; the check still denies. */
492
+ readonly onError?: BetterSupabaseOnError;
493
+ /**
494
+ * Sources and sinks for each instance. The subject, actor, tenant and intent
495
+ * always come from the verified request.
496
+ */
497
+ readonly options?: Omit<PermDockOptions, "tenant" | "actor" | "delegation" | "session" | "expiresAt" | "intent">;
423
498
  };
424
499
  /**
425
500
  * better-supabase's `authorizer` for PermDock: every resource, action, route
@@ -427,10 +502,76 @@ type AuthorizerOptions = {
427
502
  * subject is mapped from the verified claims with `subjectFromBetterSupabase`;
428
503
  * the request's `context.tenant` selects the active tenant only among the
429
504
  * memberships the claims hold. A caller without claims is anonymous, and a
430
- * throw denies.
505
+ * throw denies. With better-supabase 0.15's runtime `memo`, the checks of one
506
+ * request scope share an instance per claims, tenant and intent.
431
507
  */
432
508
  export declare function authorizer(options: AuthorizerOptions): Authorizer<Permission>;
433
509
  //#endregion
510
+ //#region src/better-supabase/block-memberships.d.ts
511
+ /**
512
+ * A roles table the membership's role column references, in better-supabase's
513
+ * `blocks.memberships.options.roleThrough` shape: the role column holds
514
+ * `table.id`, and `table.column` holds the role key.
515
+ */
516
+ type BlockRoleThrough = {
517
+ readonly table: string;
518
+ readonly id: string;
519
+ readonly column: string;
520
+ };
521
+ /**
522
+ * A role junction holding several roles per membership: one row per role,
523
+ * `membership` referencing the membership's `id` column and `role` holding the
524
+ * role key.
525
+ */
526
+ type BlockRoleJunction = {
527
+ readonly table: string;
528
+ /** The junction column referencing the membership. */
529
+ readonly membership: string;
530
+ /** The junction column holding the role key. */
531
+ readonly role: string;
532
+ /** The membership's primary key column. Default `id`. */
533
+ readonly id?: string;
534
+ };
535
+ type BlockMembershipSourceOptions = {
536
+ /** The memberships block's table. Default `better_supabase.memberships`. */
537
+ readonly table?: string;
538
+ /** The declared scope a row is a membership of. Default `organization`. */
539
+ readonly scope?: string;
540
+ /**
541
+ * Physical column names, keyed like better-supabase's
542
+ * `blocks.memberships.columns.memberships`. Defaults `organization_id`,
543
+ * `user_id`, `role` and `disabled_at`.
544
+ */
545
+ readonly columns?: {
546
+ readonly tenant?: string;
547
+ readonly user?: string;
548
+ readonly role?: string;
549
+ readonly disabledAt?: string | null;
550
+ };
551
+ /**
552
+ * The roles table the role column references, so a custom role's key reads
553
+ * through it. The same value as `blocks.memberships.options.roleThrough`.
554
+ */
555
+ readonly roleThrough?: BlockRoleThrough;
556
+ /**
557
+ * A role junction read instead of the role column. `"many"` reads
558
+ * `membership_roles` in the table's schema, the role set
559
+ * `blocks.memberships.options.roles.many` keeps, keyed by the tenant and user
560
+ * columns.
561
+ */
562
+ readonly roles?: BlockRoleJunction | "many";
563
+ readonly query?: SqlQuery;
564
+ readonly suspension?: SupabaseSuspension;
565
+ };
566
+ /**
567
+ * Memberships from better-supabase's `memberships` block table: one row per
568
+ * user and organization, its role key in `role`, a custom role's key through
569
+ * `roleThrough`, or several roles from a `roles` junction or, with `roles:
570
+ * "many"`, from better-supabase's `membership_roles`. A row with `disabled_at`
571
+ * set is no membership.
572
+ */
573
+ export declare function blockMembershipSource(options?: BlockMembershipSourceOptions): SqlMembershipSource;
574
+ //#endregion
434
575
  //#region src/better-supabase/policies.d.ts
435
576
  type AccessScope = {
436
577
  /**
@@ -536,6 +677,11 @@ type ToolPolicyOptions<C> = {
536
677
  * with a row condition denies.
537
678
  */
538
679
  readonly data?: (ctx: C, tool: McpToolRef, args: unknown) => unknown;
680
+ /**
681
+ * Receives every error `authorize` or `visible` threw; the tool stays
682
+ * refused.
683
+ */
684
+ readonly onError?: BetterSupabaseOnError;
539
685
  };
540
686
  type ToolPolicy<C> = {
541
687
  readonly authorize: (ctx: C, tool: McpToolRef, args: unknown) => Promise<McpToolDecision>;
@@ -546,7 +692,8 @@ type ToolPolicy<C> = {
546
692
  * tools whose `meta` is a PermDock permission. A tool without a permission is
547
693
  * hidden and refused. `authorize` grants only a `granted` decision: an
548
694
  * approval-required call is refused, because `createMcp` has no approval flow.
549
- * A throw anywhere refuses.
695
+ * A denial's text names the first denial reason. A throw anywhere refuses and
696
+ * reaches `onError`.
550
697
  */
551
698
  export declare function toolPolicy<C>(options: ToolPolicyOptions<C>): ToolPolicy<C>;
552
699
  //#endregion
@@ -729,19 +876,37 @@ export declare function subjectFromShareLink(token: string | undefined | null, o
729
876
  type HandlerPermDockSource = {
730
877
  readonly getPermDock: (request: Request) => PermDock | Promise<PermDock>;
731
878
  };
879
+ type HookCanOptions = {
880
+ /**
881
+ * Loads the row the permission `key` is decided on in `tenant`, so a
882
+ * condition on the row applies. Without it there is no row; a throw is
883
+ * `false`.
884
+ */
885
+ readonly data?: (tenant: string, key: string) => unknown;
886
+ };
887
+ type HandlerCanOptions = {
888
+ /**
889
+ * Loads the row the permission `key` is decided on for `request`, so a
890
+ * condition on the row applies. Without it there is no row; a throw is
891
+ * `false` (403).
892
+ */
893
+ readonly data?: (request: Request, key: string) => unknown;
894
+ };
732
895
  /**
733
896
  * The `can` option of better-supabase's `authorizeHook`, for the caller's
734
897
  * `permdock`: `true` only when the caller is a member of the hook's tenant and
735
- * `decide` grants the permission its `hookMetadata` names there. An unknown
736
- * key, `approval-required` and a throw are `false`.
898
+ * `decide` grants the permission its `hookMetadata` names there, on the row
899
+ * `options.data` loads. An unknown key, `approval-required` and a throw are
900
+ * `false`.
737
901
  */
738
- export declare function hookCan(permdock: PermDock): NonNullable<AuthorizeHookOptions["can"]>;
902
+ export declare function hookCan(permdock: PermDock, options?: HookCanOptions): NonNullable<AuthorizeHookOptions["can"]>;
739
903
  /**
740
904
  * The `can` option of better-supabase's `protectWebHandler`: `undefined` (401)
741
905
  * when the request has no signed-in principal or `getPermDock` throws,
742
906
  * otherwise whether `decide` grants the permission in the request's active
743
- * tenant. An unknown key and `approval-required` are `false` (403).
907
+ * tenant, on the row `options.data` loads. An unknown key, `approval-required`
908
+ * and a throwing `data` are `false` (403).
744
909
  */
745
- export declare function handlerCan(source: HandlerPermDockSource): ProtectWebHandlerOptions["can"];
910
+ export declare function handlerCan(source: HandlerPermDockSource, options?: HandlerCanOptions): ProtectWebHandlerOptions["can"];
746
911
  //#endregion
747
- export type { AccessPolicyOptions, AccessReviewApplierOptions, AccessReviewApplyFailure, AccessReviewApplyResult, ApiKeySession, ApiKeySessionOptions, ApiKeyVerifierOptions, AuthorizationHooksOptions, AuthorizationProviderOptions, AuthorizerOperation, AuthorizerOptions, BetterSupabaseIdentityLink, BetterSupabaseMembershipRow, BetterSupabaseSubjectOptions, BucketAccess, CredentialGuardOptions, HandlerPermDockSource, McpToolDecision, McpToolRef, PendingSupportSession, PrincipalFromMembershipsOptions, PrincipalSourceOptions, ProviderApprovers, RoleOrderOptions, ServiceRoles, ShareLinkResolver, ShareLinkRow, ShareLinkSubjectOptions, ShareLinkTarget, SubscriberPolicyEvent, SubscriberPolicyOptions, SupabasePrincipal, SupportPolicyOptions, ToolPolicy, ToolPolicyOptions, TopicAccess };
912
+ 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 };