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
@@ -21,7 +21,7 @@ const diff = defineLeaf({
21
21
  }
22
22
  },
23
23
  async run(ctx, { flags, args }) {
24
- return (await import("./diff-iZWV65nC.js")).runDiff({
24
+ return (await import("./diff-CQegtBAo.js")).runDiff({
25
25
  cwd: ctx.cwd,
26
26
  config: ctx.config,
27
27
  sources: [args["before"], args["after"]].filter((value) => value !== void 0),
@@ -1,8 +1,8 @@
1
- import { A as memoryCustomRoleSource } from "./src-DZ0l9UAg.js";
1
+ import { j as memoryCustomRoleSource } from "./src-C_pi2Rnh.js";
2
2
  import { n as findPermission } from "./permission-registry-B8tYxPIt.js";
3
3
  import { g as secondsOf } from "./time-nR1JesoH.js";
4
4
  import { t as canonicalJson } from "./canonical-json-DwilZ1iB.js";
5
- import { t as getPermDock } from "./permdock-L-_I_3zP.js";
5
+ import { t as getPermDock } from "./permdock-BvjivVb9.js";
6
6
  import { i as configError, u as usageResult } from "./errors-Vpu6rKHl.js";
7
7
  import { t as buildCatalog } from "./catalog-doc-DjMKzJp9.js";
8
8
  import { a as loadModule, n as asPolicy, s as pickNamed } from "./load-DjSU5KXO.js";
@@ -10,7 +10,7 @@ const doctor = defineLeaf({
10
10
  description: "Check codes or groups to run",
11
11
  valueHint: "code",
12
12
  async complete() {
13
- const { DOCTOR_CHECKS } = await import("./doctor-CHD1M9R5.js");
13
+ const { DOCTOR_CHECKS } = await import("./doctor-DfTnMaUt.js");
14
14
  return [.../* @__PURE__ */ new Set([...DOCTOR_CHECKS.map(({ code }) => code), ...DOCTOR_CHECKS.flatMap(({ groups }) => groups)])];
15
15
  }
16
16
  },
@@ -27,7 +27,7 @@ const doctor = defineLeaf({
27
27
  if (answer === void 0) return CANCELLED;
28
28
  fix = answer;
29
29
  }
30
- return (await import("./doctor-CHD1M9R5.js")).runDoctor({
30
+ return (await import("./doctor-DfTnMaUt.js")).runDoctor({
31
31
  cwd: ctx.cwd,
32
32
  config: ctx.config,
33
33
  only: flags.only,
@@ -1,11 +1,12 @@
1
+ import { r as isRecord } from "./compact-CAf557ZB.js";
1
2
  import { o as hasConditionOp } from "./refs-C8BKxc_e.js";
2
3
  import { c as listPermissions, h as formerKeys } from "./permission-registry-B8tYxPIt.js";
3
4
  import { u as isPrincipalRelation } from "./resource-relations-8-pCScBO.js";
4
5
  import { t as canonicalJson } from "./canonical-json-DwilZ1iB.js";
5
- import { f as scopeList, o as normalizeMemberships, s as resolveScope } from "./scopes-0Up_UA2t.js";
6
+ import { f as scopeList, l as rootScope, o as normalizeMemberships, s as resolveScope } from "./scopes-0Up_UA2t.js";
6
7
  import { o as flattenGrantee } from "./grantee-Dke-9rd1.js";
7
8
  import { u as separationConflicts } from "./policy-CLQ8__GF.js";
8
- import { T as validateCustomRole } from "./evaluate-Dd8Ta0Ie.js";
9
+ import { T as validateCustomRole } from "./evaluate-BAmf_AQd.js";
9
10
  import { s as parseCredential } from "./credential-CyyyvCsL.js";
10
11
  import { a as describeError } from "./errors-Vpu6rKHl.js";
11
12
  import { t as policyRowConditionKeys } from "./row-conditions-BAGHOmVq.js";
@@ -14,34 +15,36 @@ import { i as DOCTOR_REPORT_SCHEMA } from "./version-DMQ0dnN5.js";
14
15
  import { c as jsonSchemaOf, i as catalogOAuthScopes } from "./catalog-doc-DjMKzJp9.js";
15
16
  import { a as loadModule, i as loadConfiguredPolicy, n as asPolicy, s as pickNamed } from "./load-DjSU5KXO.js";
16
17
  import { t as catalogPath } from "./catalog-path-CnI0XTFK.js";
17
- import { r as runCollect } from "./collect-B7ZFAJU3.js";
18
+ import { r as runCollect } from "./collect-WCl8cJQV.js";
18
19
  import { i as qualifySqlTable, s as quoteSqlLiteral } from "./sql-0WjxIp9g.js";
19
20
  import { a as scopeMembershipTable } from "./compile-EzEMB-7v.js";
20
21
  import { n as supabaseTenantClaim } from "./budget-BELja5A9.js";
21
- import { d as keptKeys, r as PERMDOCK_SCHEMA } from "./sources-CMAM-2A3.js";
22
+ import { d as keptKeys, r as PERMDOCK_SCHEMA } from "./sources-C4vkzZJV.js";
22
23
  import { t as parseCatalog } from "./parse-1_ZheTW5.js";
24
+ import { n as activeTenantMismatch } from "./active-tenant-DVee32-T.js";
23
25
  import "./markers-BeHZ4x9Q.js";
24
26
  import { t as didYouMean } from "./args-0FrVs5EH.js";
25
- import { t as DOCS_BASE } from "./manifest-Cgiq5oqc.js";
27
+ import { t as DOCS_BASE } from "./manifest-B4ENCp2I.js";
26
28
  import { t as createStyle } from "./style-Ds11Hmk4.js";
27
- import { a as nonEmptyOr, r as findingOf } from "./output-tkju6U7R.js";
28
- import { i as runSkillsInstall } from "./skills-Bjj7BNEQ.js";
29
+ import { a as nonEmptyOr, r as findingOf } from "./output-LsbLe41I.js";
30
+ import { i as runSkillsInstall } from "./skills-iwbRxavw.js";
29
31
  import { n as MIGRATION_DIRS, t as DEFAULT_SENSITIVE_ACTIONS } from "./constants-DcJABbLW.js";
30
32
  import { l as partPath } from "./output-files-BIQ_9pIs.js";
31
- import { _ as supabaseConfig, a as supabaseHookManifest, c as pd039, g as readSupabaseConfig, h as pd074, m as pd045, n as hookOut, p as attrsPlan, u as resolveSchemas } from "./supabase-hook-B-yXnzUl.js";
32
- import { G as byKey, Q as graphSqlName, n as tableNameOf, o as graphPlan, r as tableNames } from "./tables-DeMNEy6V.js";
33
- import { a as guardedTables, p as contextRefs, r as unsatisfiedKinds, t as ownershipRules } from "./ownership-B4L59T9u.js";
33
+ import { _ as readSupabaseConfig, a as supabaseHookManifest, c as activeSource, d as resolveSchemas, g as pd074, h as pd045, l as pd039, m as attrsPlan, n as hookOut, v as supabaseConfig } from "./supabase-hook-BT2P9wah.js";
34
+ import { G as byKey, Q as graphSqlName, n as tableNameOf, o as graphPlan, r as tableNames } from "./tables-DimBcVWY.js";
35
+ import { a as guardedTables, p as contextRefs, r as unsatisfiedKinds, t as ownershipRules } from "./ownership-qqBuGJXr.js";
34
36
  import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
35
37
  import { i as group, n as membershipColumns, o as sqlStatements, r as tableKey } from "./deciding-columns-NB4wcyBf.js";
36
- import { t as resolveNames } from "./resolve-names-CF7xXLSG.js";
37
- import { t as FIELD_VIEWS } from "./fields-D0vUI6dq.js";
38
- import { a as pd010, c as pd014, d as pd038, f as pd041, i as pd008, l as pd015, n as pd001, o as pd011, p as pd057, r as pd007, s as pd013, t as runUsage, u as pd036 } from "./usage-CxEzS4ey.js";
39
- import { d as rowConditionMessage, f as commandFor, m as tableFor, p as compileGrants, s as ROW_CONDITION_FIX, u as helperTablePolicies } from "./verify-DZeqoWu5.js";
40
- import { a as streamOf, i as scopeSourcesOf, r as staleFiles, t as powersyncFiles } from "./powersync-DHNQX06W.js";
41
- import { a as generateOptions, c as buildContext, n as inheritTargets, o as isRefusal, t as supautilsRejections } from "./supautils-BU-pAEpf.js";
38
+ import { t as FIELD_VIEWS } from "./fields-DI8s3cPl.js";
39
+ import { t as resolveNames } from "./resolve-names-Y1Cb22cp.js";
40
+ import { a as pd010, c as pd014, d as pd038, f as pd041, i as pd008, l as pd015, n as pd001, o as pd011, p as pd057, r as pd007, s as pd013, t as runUsage, u as pd036 } from "./usage-t_nXnwCW.js";
41
+ import { d as rowConditionMessage, f as commandFor, m as tableFor, p as compileGrants, s as ROW_CONDITION_FIX, u as helperTablePolicies } from "./verify-jHrbmn-E.js";
42
+ import { a as streamOf, i as scopeSourcesOf, r as staleFiles, t as powersyncFiles } from "./powersync-DUT-UKgw.js";
43
+ import { a as buildContext, n as generateOptions, r as isRefusal, s as inheritTargets, t as supautilsRejections } from "./supautils-DBKOoyjn.js";
42
44
  import { n as legacyHelperNames, r as retirePlan, t as legacyHelperCalls } from "./retire-B2xffQgY.js";
43
45
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
44
46
  import { basename, dirname, join, resolve } from "node:path";
47
+ import { pathToFileURL } from "node:url";
45
48
  import { createRequire } from "node:module";
46
49
  //#region src/cli/shared/doctor-files.ts
47
50
  const nodeFiles = Object.freeze({
@@ -212,6 +215,120 @@ async function pd064(input) {
212
215
  }));
213
216
  }
214
217
  //#endregion
218
+ //#region src/cli/doctor/better-supabase.ts
219
+ const CONFIG_FILES = [
220
+ "better-supabase.config.ts",
221
+ "better-supabase.config.mts",
222
+ "better-supabase.config.js",
223
+ "better-supabase.config.mjs"
224
+ ];
225
+ /** The default export of the project's `better-supabase.config.*`, if it loads. */
226
+ async function betterSupabaseConfig(input) {
227
+ const files = filesOf(input);
228
+ const path = CONFIG_FILES.map((name) => resolve(input.cwd, name)).find((file) => files.exists(file));
229
+ if (path === void 0) return;
230
+ try {
231
+ const loaded = (await loadModule(path))["default"];
232
+ return isRecord(loaded) ? loaded : void 0;
233
+ } catch {
234
+ return;
235
+ }
236
+ }
237
+ function activeTenantOf(config) {
238
+ const blocks = config["blocks"];
239
+ const permissions = isRecord(blocks) ? blocks["permissions"] : void 0;
240
+ const value = isRecord(permissions) ? permissions["activeTenant"] : void 0;
241
+ if (value === "claim" || value === "resolver") return value;
242
+ if (isRecord(value) && typeof value["profileColumn"] === "string") {
243
+ const key = value["key"];
244
+ return {
245
+ profileColumn: value["profileColumn"],
246
+ ...typeof key === "string" ? { key } : {}
247
+ };
248
+ }
249
+ }
250
+ /**
251
+ * PermDock's token hook reads the active tenant from another place than
252
+ * better-supabase's `blocks.permissions.activeTenant` writes it, so
253
+ * `switch_organization` never changes the tenant claim.
254
+ */
255
+ async function pd078(input) {
256
+ const hook = input.config.supabase?.hook;
257
+ if (hook === void 0) return [];
258
+ const config = await betterSupabaseConfig(input);
259
+ const activeTenant = config === void 0 ? void 0 : activeTenantOf(config);
260
+ if (activeTenant === void 0) return [];
261
+ const policy = await policyOf(input);
262
+ const root = policy === void 0 ? void 0 : rootScope(scopeList(policy.scopes));
263
+ let from;
264
+ try {
265
+ from = activeSource(hook.activeFrom, root ?? "tenant");
266
+ } catch {
267
+ return [];
268
+ }
269
+ const mismatch = activeTenantMismatch(from, input.config.rls?.tenantClaim ?? "tenant_id", activeTenant);
270
+ return mismatch === void 0 ? [] : [{
271
+ code: "PD078",
272
+ severity: "warning",
273
+ message: mismatch,
274
+ fix: "set supabase.hook.activeFrom, then run permdock supabase hook generate"
275
+ }];
276
+ }
277
+ function isBlockPermissionKey(value) {
278
+ return isRecord(value) && typeof value["module"] === "string" && typeof value["action"] === "string" && typeof value["key"] === "string";
279
+ }
280
+ /**
281
+ * Every permission key the configured blocks check, from the project's own
282
+ * `better-supabase/sql`; `undefined` when it does not resolve or refuses the
283
+ * config.
284
+ */
285
+ async function blockPermissionKeys(cwd, blocks) {
286
+ try {
287
+ const file = createRequire(resolve(cwd, "package.json")).resolve("better-supabase/sql");
288
+ const list = (await import(pathToFileURL(file).href))["modulePermissionKeys"];
289
+ if (!isKeyLister(list)) return;
290
+ const keys = list(blocks, Object.keys(blocks));
291
+ return Array.isArray(keys) ? keys.filter(isBlockPermissionKey) : void 0;
292
+ } catch {
293
+ return;
294
+ }
295
+ }
296
+ function isKeyLister(value) {
297
+ return typeof value === "function";
298
+ }
299
+ /**
300
+ * A permission key a configured better-supabase block checks that the catalog
301
+ * does not list: no role holds it, so the block's SQL checks deny it.
302
+ */
303
+ async function pd079(input) {
304
+ const blocks = (await betterSupabaseConfig(input))?.["blocks"];
305
+ if (!isRecord(blocks)) return [];
306
+ const files = filesOf(input);
307
+ const path = catalogPath(input.config, input.cwd);
308
+ if (!files.exists(path)) return [];
309
+ let declared;
310
+ try {
311
+ declared = new Set(parseCatalog(files.read(path)).permissions.map(({ key }) => key));
312
+ } catch {
313
+ return [];
314
+ }
315
+ const keys = await blockPermissionKeys(input.cwd, blocks);
316
+ if (keys === void 0) return [];
317
+ const missing = /* @__PURE__ */ new Map();
318
+ for (const entry of keys) if (!declared.has(entry.key)) {
319
+ const uses = missing.get(entry.key) ?? [];
320
+ uses.push(`blocks.${entry.module}.permissions.${entry.action}`);
321
+ missing.set(entry.key, uses);
322
+ }
323
+ const catalog = rel(input.cwd, path);
324
+ return [...missing].map(([key, uses]) => ({
325
+ code: "PD079",
326
+ severity: "warning",
327
+ message: `${key} (${[...new Set(uses)].join(", ")}) is not in ${catalog}, so no role holds it and better-supabase's SQL check denies it`,
328
+ fix: `declare ${key} in the policy and run permdock collect, or map the block action to a key the catalog lists`
329
+ }));
330
+ }
331
+ //#endregion
215
332
  //#region src/cli/doctor/catalog.ts
216
333
  /**
217
334
  * A policy that declares `oauthScopes` against a catalog on disk without them,
@@ -2250,6 +2367,17 @@ const DOCTOR_CHECKS = [
2250
2367
  when: (config) => config.policy !== void 0,
2251
2368
  run: pd070
2252
2369
  },
2370
+ {
2371
+ code: "PD078",
2372
+ groups: ["supabase", "better-supabase"],
2373
+ when: (config) => config.supabase?.hook !== void 0,
2374
+ run: pd078
2375
+ },
2376
+ {
2377
+ code: "PD079",
2378
+ groups: ["catalog", "better-supabase"],
2379
+ run: pd079
2380
+ },
2253
2381
  {
2254
2382
  code: "PD005",
2255
2383
  groups: ["skills"],
@@ -1,7 +1,7 @@
1
- import { Rt as Instant, lr as Subject, mr as Condition } from "../policy-types-CCiDRZBH.js";
2
- import { f as WhereResult } from "../permdock-B6Sf4T_S.js";
1
+ import { Wt as Instant, br as Condition, hr as Subject } from "../policy-types-DGIO_gxq.js";
2
+ import { f as WhereResult } from "../permdock-CprAPN3w.js";
3
3
  import { r as RelationsMapping } from "../graph-sql-BwFC4Qjs.js";
4
- import { s as MembershipsMapping } from "../compile-BFzysW3o.js";
4
+ import { s as MembershipsMapping } from "../compile-BEklRUYo.js";
5
5
  import { n as RowCheck, t as WithSubjectOptions } from "../subject-settings-vNW8qmUH.js";
6
6
  import { SQL, Table } from "drizzle-orm";
7
7
  //#region src/drizzle/types.d.ts
@@ -1,9 +1,9 @@
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 { a as PermDock } from "../permdock-B6Sf4T_S.js";
3
+ import { a as PermDock } from "../permdock-CprAPN3w.js";
4
4
  import { n as RevocationFeed } from "../revocations-BaUXHM1N.js";
5
- import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CIlpSA2G.js";
6
- import { t as ServerAdapterOptions } from "../bind-Cp2hBHzP.js";
5
+ import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CyRN0-Cd.js";
6
+ import { t as ServerAdapterOptions } from "../bind-YYjvfpB9.js";
7
7
  import { Elysia } from "elysia";
8
8
  //#region src/elysia/create.d.ts
9
9
  type ElysiaRequestContext = {
@@ -1,7 +1,7 @@
1
1
  import { a as parsedBody, r as hasCredentials } from "../http-DKLXrFGk.js";
2
2
  import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-IBceAeKT.js";
3
3
  import { t as problemFromError } from "../map-error-pasIGqMT.js";
4
- import { a as socketConnection, i as decorate, r as bindKernel } from "../bind-D_sZSVA3.js";
4
+ import { a as socketConnection, i as decorate, r as bindKernel } from "../bind-BNQA9JK9.js";
5
5
  import { a as onRevoked, n as closeReason, t as POLICY_VIOLATION } from "../stream-CDvF0sJm.js";
6
6
  import { Elysia } from "elysia";
7
7
  //#region src/elysia/create.ts
@@ -1,4 +1,4 @@
1
- import { Ln as Decision, ln as WireDenial, lr as Subject } from "./policy-types-CCiDRZBH.js";
1
+ import { Un as Decision, hn as WireDenial, hr as Subject } from "./policy-types-DGIO_gxq.js";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  //#region src/core/problem-details.d.ts
4
4
  type Disclosure = "hide" | "reveal";
@@ -1174,11 +1174,14 @@ function roleSourceFor(option, subject, auth) {
1174
1174
  return;
1175
1175
  }
1176
1176
  }
1177
- function customRolesFor(source, tenants, auth, globalHeld, heldIn) {
1177
+ function customRolesFor(source, tenants, auth, globalHeld, heldIn, memo) {
1178
1178
  if (source === void 0) return [];
1179
1179
  const loaded = [];
1180
1180
  for (const tenant of tenants) try {
1181
- loaded.push(source.rolesFor(tenant, { held: heldIn(tenant) }));
1181
+ loaded.push(source.rolesFor(tenant, compact({
1182
+ held: heldIn(tenant),
1183
+ memo
1184
+ })));
1182
1185
  } catch {
1183
1186
  auth.push({
1184
1187
  reason: "source-threw",
@@ -1202,12 +1205,18 @@ function customRolesFor(source, tenants, auth, globalHeld, heldIn) {
1202
1205
  };
1203
1206
  if (globalHeld !== void 0 && source.globalRoles !== void 0) {
1204
1207
  const read = source.globalRoles.bind(source);
1205
- once(() => read({ held: globalHeld }), onlyGlobal);
1208
+ once(() => read(compact({
1209
+ held: globalHeld,
1210
+ memo
1211
+ })), onlyGlobal);
1206
1212
  }
1207
1213
  if (tenants.length > 0 && source.sharedRoles !== void 0) {
1208
1214
  const read = source.sharedRoles.bind(source);
1209
1215
  const held = [...new Set(tenants.flatMap((tenant) => heldIn(tenant)))];
1210
- once(() => read({ held }), onlyShared);
1216
+ once(() => read(compact({
1217
+ held,
1218
+ memo
1219
+ })), onlyShared);
1211
1220
  }
1212
1221
  if (loaded.some((item) => isThenable(item))) return Promise.all(loaded.map((item) => Promise.resolve(item).catch(() => {
1213
1222
  auth.push({
@@ -1,6 +1,6 @@
1
- import { T as Policy } from "./policy-types-CCiDRZBH.js";
2
- import { a as PermDock } from "./permdock-B6Sf4T_S.js";
3
- import { m as ApprovalStore } from "./types-B_tiYvk8.js";
1
+ import { T as Policy } from "./policy-types-DGIO_gxq.js";
2
+ import { a as PermDock } from "./permdock-CprAPN3w.js";
3
+ import { m as ApprovalStore } from "./types-DLvhVm1r.js";
4
4
  //#region src/server/evaluations.d.ts
5
5
  /** AuthZEN 1.0 section 7.1.2.1 `options.evaluations_semantic` values. */
6
6
  declare const EVALUATIONS_SEMANTICS: readonly ["execute_all", "deny_on_first_deny", "permit_on_first_permit"];
@@ -1,8 +1,8 @@
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 { a as PermDock } from "../permdock-B6Sf4T_S.js";
4
- import { u as ApprovalRequest } from "../types-B_tiYvk8.js";
5
- import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-BSNrVuxh.js";
3
+ import { a as PermDock } from "../permdock-CprAPN3w.js";
4
+ import { u as ApprovalRequest } from "../types-DLvhVm1r.js";
5
+ import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-BPUopdfL.js";
6
6
  //#region src/eve/create.d.ts
7
7
  /** Structural `SessionAuthContext` from `eve`. */
8
8
  type EvePrincipal = {
package/dist/eve/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as compact } from "../compact-CAf557ZB.js";
2
- import { l as withApp } from "../permdock-L-_I_3zP.js";
2
+ import { l as withApp } from "../permdock-BvjivVb9.js";
3
3
  import { c as isApprovalError } from "../types-CcUXciSj.js";
4
4
  import { o as resolveApproval } from "../helpers-DJicaG6f.js";
5
- import { t as agentRuntime } from "../create-Cq4Uox0f.js";
5
+ import { t as agentRuntime } from "../create-6EwRQlig.js";
6
6
  import { t as boundedMap } from "../lru-8q4WZjBV.js";
7
7
  //#region src/eve/create.ts
8
8
  const TOKENS_PER_PROCESS = 1e3;
@@ -1,8 +1,8 @@
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 { a as PermDock } from "../permdock-B6Sf4T_S.js";
4
- import { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CIlpSA2G.js";
5
- import { t as ServerAdapterOptions } from "../bind-Cp2hBHzP.js";
3
+ import { a as PermDock } from "../permdock-CprAPN3w.js";
4
+ import { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CyRN0-Cd.js";
5
+ import { t as ServerAdapterOptions } from "../bind-YYjvfpB9.js";
6
6
  import { i as toRequest, r as sendResponse } from "../http-B_LphE5Y.js";
7
7
  import { ErrorRequestHandler, Request, RequestHandler, Response, Router } from "express";
8
8
  //#region src/express/create.d.ts
@@ -1,7 +1,7 @@
1
1
  import { r as hasCredentials } from "../http-DKLXrFGk.js";
2
2
  import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-IBceAeKT.js";
3
3
  import { t as problemFromError } from "../map-error-pasIGqMT.js";
4
- import { i as decorate, r as bindKernel } from "../bind-D_sZSVA3.js";
4
+ import { i as decorate, r as bindKernel } from "../bind-BNQA9JK9.js";
5
5
  import { n as sendResponse, r as toRequest } from "../http-DH94eh6f.js";
6
6
  import express from "express";
7
7
  //#region src/express/create.ts
@@ -1,8 +1,8 @@
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 { a as PermDock } from "../permdock-B6Sf4T_S.js";
4
- import { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CIlpSA2G.js";
5
- import { t as ServerAdapterOptions } from "../bind-Cp2hBHzP.js";
3
+ import { a as PermDock } from "../permdock-CprAPN3w.js";
4
+ import { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CyRN0-Cd.js";
5
+ import { t as ServerAdapterOptions } from "../bind-YYjvfpB9.js";
6
6
  import { FastifyPluginAsync, FastifyReply, FastifyRequest, FastifySchema, FastifyTypeProvider, FastifyTypeProviderDefault, RawRequestDefaultExpression, RawServerDefault, RouteGenericInterface } from "fastify";
7
7
  //#region src/server/http.d.ts
8
8
  /** A Fastify-style reply: `code`, `header` and `send`. */
@@ -1,7 +1,7 @@
1
1
  import { c as writeReply, i as headersFrom, n as firstHeader, r as hasCredentials, t as fetchRequest } from "../http-DKLXrFGk.js";
2
2
  import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-IBceAeKT.js";
3
3
  import { t as problemFromError } from "../map-error-pasIGqMT.js";
4
- import { i as decorate, r as bindKernel } from "../bind-D_sZSVA3.js";
4
+ import { i as decorate, r as bindKernel } from "../bind-BNQA9JK9.js";
5
5
  //#region src/fastify/http.ts
6
6
  function toRequest(request) {
7
7
  const host = firstHeader(request.headers.host) ?? "localhost";
@@ -1,8 +1,8 @@
1
1
  import { u as Permission } from "./permission-types-CAY-GU7e.js";
2
2
  import { a as OperationInput, t as Operation } from "./operations-Ci_rT6Uo.js";
3
3
  import { n as RevocationFeed } from "./revocations-BaUXHM1N.js";
4
- import { o as ProtectOptions } from "./server-types-CIlpSA2G.js";
5
- import { t as ServerAdapterOptions } from "./bind-Cp2hBHzP.js";
4
+ import { o as ProtectOptions } from "./server-types-CyRN0-Cd.js";
5
+ import { t as ServerAdapterOptions } from "./bind-YYjvfpB9.js";
6
6
  //#region src/server/fetch-adapter.d.ts
7
7
  /**
8
8
  * What `protect` checks: a permission, an operation from `defineOperations`, or
@@ -3,7 +3,7 @@ import { o as isPermission } from "./permission-registry-B8tYxPIt.js";
3
3
  import { r as hasCredentials } from "./http-DKLXrFGk.js";
4
4
  import { o as methodNotAllowed } from "./problem-BVLHFK33.js";
5
5
  import { t as problemFromError } from "./map-error-pasIGqMT.js";
6
- import { i as decorate, r as bindKernel } from "./bind-D_sZSVA3.js";
6
+ import { i as decorate, r as bindKernel } from "./bind-BNQA9JK9.js";
7
7
  //#region src/server/fetch-adapter.ts
8
8
  /**
9
9
  * `protect(target, data, options)(handler)` for a framework whose routes are
@@ -1,7 +1,7 @@
1
1
  import { a as sole } from "./compact-CAf557ZB.js";
2
2
  import { i as configError } from "./errors-Vpu6rKHl.js";
3
3
  import { c as jsonSchemaOf } from "./catalog-doc-DjMKzJp9.js";
4
- import { A as quoteQualified, D as qualified, E as helperSchema, O as quoteIdent, _ as subjectClaimJsonSql, k as quoteLiteral, s as signedIn } from "./shared-Afctg7B0.js";
4
+ import { A as quoteQualified, D as qualified, E as helperSchema, O as quoteIdent, _ as subjectClaimJsonSql, k as quoteLiteral, s as signedIn } from "./shared-DrGLwM3s.js";
5
5
  //#region src/cli/sql/clauses.ts
6
6
  /**
7
7
  * True when `sql` is one parenthesised expression, so AND / OR need not wrap it
@@ -7,10 +7,10 @@ import { t as byCodePoint } from "./compare-DTfyUunF.js";
7
7
  import { i as configError, n as CliError } from "./errors-Vpu6rKHl.js";
8
8
  import { c as jsonSchemaOf } from "./catalog-doc-DjMKzJp9.js";
9
9
  import { c as requirePolicy } from "./load-DjSU5KXO.js";
10
- import { t as loadConfiguredOperations } from "./catalog-operations-Dadrl7Z-.js";
10
+ import { t as loadConfiguredOperations } from "./catalog-operations-DeHTrJSV.js";
11
11
  import { n as fileSummary, r as planFiles } from "./files-B3AA05f1.js";
12
12
  import { f as writeOutputFiles, r as driftOf } from "./output-files-BIQ_9pIs.js";
13
- import { t as resolveNames } from "./resolve-names-CF7xXLSG.js";
13
+ import { t as resolveNames } from "./resolve-names-Y1Cb22cp.js";
14
14
  import { i as schemaExpression } from "./generate-CezbCaTI.js";
15
15
  import { existsSync, readFileSync } from "node:fs";
16
16
  import { dirname, extname, relative, resolve } from "node:path";
@@ -41,7 +41,7 @@ const gen = defineLeaf({
41
41
  const out = given(flags.out);
42
42
  const outDir = given(flags["out-dir"]);
43
43
  const from = given(flags.policy);
44
- const { runGen } = await import("./gen-DWCYcMQM.js");
44
+ const { runGen } = await import("./gen-DuAhghDw.js");
45
45
  return runGen({
46
46
  cwd: ctx.cwd,
47
47
  config: ctx.config,
@@ -1,7 +1,7 @@
1
- import { Gt as Snapshot, T as Policy, j as PolicyVocabulary, sr as Principal } from "../policy-types-CCiDRZBH.js";
2
- import { a as PermDock } from "../permdock-B6Sf4T_S.js";
3
- import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CIlpSA2G.js";
4
- import { a as ProtectTarget, n as FetchAdapterOptions, r as FetchProtect, t as ContextReader } from "../fetch-adapter-C1DCvpqV.js";
1
+ import { T as Policy, Zt as Snapshot, j as PolicyVocabulary, pr as Principal } from "../policy-types-DGIO_gxq.js";
2
+ import { a as PermDock } from "../permdock-CprAPN3w.js";
3
+ import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CyRN0-Cd.js";
4
+ import { a as ProtectTarget, n as FetchAdapterOptions, r as FetchProtect, t as ContextReader } from "../fetch-adapter-BIbBAtPZ.js";
5
5
  import { EventHandler, H3Event, H3EventContext, Middleware } from "h3";
6
6
  //#region src/h3/create.d.ts
7
7
  type H3PermDockOptions<TUser = unknown> = FetchAdapterOptions<H3Event, TUser>;
package/dist/h3/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-IBceAeKT.js";
2
- import { i as decorate } from "../bind-D_sZSVA3.js";
3
- import { t as fetchAdapter } from "../fetch-adapter-JL43jD3E.js";
2
+ import { i as decorate } from "../bind-BNQA9JK9.js";
3
+ import { t as fetchAdapter } from "../fetch-adapter-dPTgJVHd.js";
4
4
  //#region src/h3/create.ts
5
5
  function createPermDock(policy, options) {
6
6
  const adapter = fetchAdapter(policy, options, "h3", (event) => event.req);
@@ -1,9 +1,9 @@
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 { a as PermDock } from "../permdock-B6Sf4T_S.js";
3
+ import { a as PermDock } from "../permdock-CprAPN3w.js";
4
4
  import { n as RevocationFeed } from "../revocations-BaUXHM1N.js";
5
- import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CIlpSA2G.js";
6
- import { t as ServerAdapterOptions } from "../bind-Cp2hBHzP.js";
5
+ import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CyRN0-Cd.js";
6
+ import { t as ServerAdapterOptions } from "../bind-YYjvfpB9.js";
7
7
  import { Context, Hono, MiddlewareHandler } from "hono";
8
8
  import { SSEMessage, SSEStreamingApi } from "hono/streaming";
9
9
  import { WSEvents } from "hono/ws";
@@ -2,7 +2,7 @@ import { t as compact } from "../compact-CAf557ZB.js";
2
2
  import { r as PermDockRevokedError } from "../errors-B6R_lg2a.js";
3
3
  import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-IBceAeKT.js";
4
4
  import { t as problemFromError } from "../map-error-pasIGqMT.js";
5
- import { r as bindKernel } from "../bind-D_sZSVA3.js";
5
+ import { r as bindKernel } from "../bind-BNQA9JK9.js";
6
6
  import { a as onRevoked, n as closeReason, r as guardIterable, t as POLICY_VIOLATION } from "../stream-CDvF0sJm.js";
7
7
  import { Hono } from "hono";
8
8
  //#region src/hono/create.ts
@@ -1,4 +1,4 @@
1
- import { T as Policy, a as ApprovalRequirement, mr as Condition, wn as Grantee } from "./policy-types-CCiDRZBH.js";
1
+ import { An as Grantee, T as Policy, a as ApprovalRequirement, br as Condition } from "./policy-types-DGIO_gxq.js";
2
2
  //#region src/core/hosted.d.ts
3
3
  /**
4
4
  * One grant authored in PermDock Cloud; its grantee is a declared role, plan or
@@ -2,9 +2,9 @@ import { r as isRecord } from "./compact-CAf557ZB.js";
2
2
  import { i as configError, u as usageResult } from "./errors-Vpu6rKHl.js";
3
3
  import { s as writeFileEnsuringDir } from "./files-BSjrtIHw.js";
4
4
  import { r as escapeSqlIdent, s as quoteSqlLiteral } from "./sql-0WjxIp9g.js";
5
- import { C as parseMembershipsFlag, r as HELPERS } from "./shared-Afctg7B0.js";
5
+ import { C as parseMembershipsFlag, r as HELPERS } from "./shared-DrGLwM3s.js";
6
6
  import { n as pgConnector } from "./pg-DQTqRrou.js";
7
- import { t as FIELD_VIEWS } from "./fields-D0vUI6dq.js";
7
+ import { t as FIELD_VIEWS } from "./fields-DI8s3cPl.js";
8
8
  import { n as emptySchema, r as isSchemaKind, t as emitPermissionsModule } from "./generate-CezbCaTI.js";
9
9
  import { existsSync, readFileSync } from "node:fs";
10
10
  import { resolve } from "node:path";
@@ -4,7 +4,7 @@ import { i as readJsonFile } from "./files-BSjrtIHw.js";
4
4
  import { t as applyFiles } from "./files-B3AA05f1.js";
5
5
  import { n as httpRequest } from "./http-DOL33cO0.js";
6
6
  import { i as schemaExpression, t as emitPermissionsModule } from "./generate-CezbCaTI.js";
7
- import { t as validateOpenapi } from "./schema-Dst9I9Gs.js";
7
+ import { t as validateOpenapi } from "./schema-3PJ8wAeL.js";
8
8
  import { existsSync, readFileSync } from "node:fs";
9
9
  import { resolve } from "node:path";
10
10
  //#region ../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/browser/dist/nodes/identity.js
@@ -1,5 +1,5 @@
1
- import { T as Policy, sr as Principal, ut as TokenSigner } from "./policy-types-CCiDRZBH.js";
2
- import { E as SsfPermDockOptions, O as SsfStreamConfiguration, T as SsfPermDock, _ as SetSubject, c as PushSetOptions, d as SetDelivery, g as SetQueue, h as SetPollHandlerOptions, k as SsfStreamStatus, m as SetEvent, p as SetError, t as CaepCommon, v as SignSetOptions } from "./types-DjuMBNF9.js";
1
+ import { T as Policy, mt as TokenSigner, pr as Principal } from "./policy-types-DGIO_gxq.js";
2
+ import { E as SsfPermDockOptions, O as SsfStreamConfiguration, T as SsfPermDock, _ as SetSubject, c as PushSetOptions, d as SetDelivery, g as SetQueue, h as SetPollHandlerOptions, k as SsfStreamStatus, m as SetEvent, p as SetError, t as CaepCommon, v as SignSetOptions } from "./types-DsHGPtkR.js";
3
3
  //#region src/ssf/create.d.ts
4
4
  declare function createPermDock<TUser, TPrincipal extends Principal = Principal>(policy: Policy<TUser, TPrincipal>, options: SsfPermDockOptions): SsfPermDock;
5
5
  //#endregion
@@ -1,8 +1,8 @@
1
- import { Ct as Credential, Ln as Decision, St as ApiKeyPrincipal, T as Policy, Tt as CredentialKind, U as CredentialVerifier, Zt as AuthEvent, at as SettingsSource, dt as TokenVerifier, gt as SupportSession, j as PolicyVocabulary, lr as Subject, lt as TokenFailureCause, q as DecisionSink, sr as Principal, ut as TokenSigner } from "./policy-types-CCiDRZBH.js";
1
+ import { J as DecisionSink, Ot as ApiKeyPrincipal, St as SupportSession, T as Policy, U as CredentialVerifier, Un as Decision, hr as Subject, ht as TokenVerifier, j as PolicyVocabulary, jt as CredentialKind, kt as Credential, mt as TokenSigner, pr as Principal, pt as TokenFailureCause, rn as AuthEvent, st as SettingsSource } 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 } from "./permdock-B6Sf4T_S.js";
4
- import { a as ProblemDetails, s as Disclosure, t as ApprovalHint } from "./errors-zi_4T-rx.js";
5
- import { c as ServerPermDock, l as ServerPermDockOptions } from "./server-types-CIlpSA2G.js";
3
+ import { _ as PrincipalSource } from "./permdock-CprAPN3w.js";
4
+ import { a as ProblemDetails, s as Disclosure, t as ApprovalHint } from "./errors-BIM4MFsJ.js";
5
+ import { c as ServerPermDock, l as ServerPermDockOptions } from "./server-types-CyRN0-Cd.js";
6
6
  //#region src/server/create.d.ts
7
7
  /**
8
8
  * The Fetch factory behind every HTTP adapter. The subject and actor are