permdock 0.22.0 → 0.23.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 (320) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +4 -4
  3. package/dist/{adoption-scan-_bHLMnVQ.js → adoption-scan-CNoE5yBA.js} +1 -1
  4. package/dist/agent/index.d.ts +2 -2
  5. package/dist/agent/index.js +1 -1
  6. package/dist/ai-sdk/index.d.ts +3 -3
  7. package/dist/ai-sdk/index.js +2 -2
  8. package/dist/app/index.d.ts +6 -6
  9. package/dist/app/index.js +4 -4
  10. package/dist/{approval-normalize-DNLW0zOM.js → approval-normalize-KfhzpD93.js} +1 -1
  11. package/dist/{approval-policies-UnDSxT__.d.ts → approval-policies-D7moEfTM.d.ts} +1 -1
  12. package/dist/{approval-prompt-2hTqo6IM.d.ts → approval-prompt-DtfKSH-8.d.ts} +1 -1
  13. package/dist/approvals/index.d.ts +3 -3
  14. package/dist/approvals/index.js +3 -3
  15. package/dist/{approvals-B_sn4Wrn.js → approvals-BfzI8Foe.js} +5 -5
  16. package/dist/{arazzo-BXD-VJU_.js → arazzo-4rMFOHbu.js} +1 -1
  17. package/dist/{arazzo-Ct0PGblq.js → arazzo-rsYPFgga.js} +2 -2
  18. package/dist/astro/index.d.ts +4 -4
  19. package/dist/astro/index.js +2 -2
  20. package/dist/{audience-5Xx1hdIv.js → audience-N2BqOvES.js} +1 -1
  21. package/dist/authzen/index.d.ts +5 -5
  22. package/dist/authzen/index.js +3 -3
  23. package/dist/{automation-B20_8UoT.d.ts → automation-CrGcfIZn.d.ts} +1 -1
  24. package/dist/better-auth/index.d.ts +1 -1
  25. package/dist/better-auth/index.js +1 -1
  26. package/dist/better-supabase/index.d.ts +35 -10
  27. package/dist/better-supabase/index.js +70 -21
  28. package/dist/{bind-B4Z0U2Gr.js → bind-Cx10JuJ-.js} +3 -3
  29. package/dist/{bind-CnOMjazH.d.ts → bind-N5jf6kjk.d.ts} +7 -7
  30. package/dist/{body-B3ylkmmE.js → body-Cy9S8zhw.js} +1 -1
  31. package/dist/{build-instance-B0vsViF5.js → build-instance-BDGzsGcn.js} +1 -1
  32. package/dist/{capability-YkRMUAsF.d.ts → capability-mLbd3KZ0.d.ts} +1 -1
  33. package/dist/{casbin-imBS3UIf.js → casbin-CjUT-wqV.js} +1 -1
  34. package/dist/{casbin-D5evU3lX.js → casbin-Dg5N0Gfa.js} +1 -1
  35. package/dist/catalog/index.d.ts +4 -4
  36. package/dist/catalog/index.js +5 -5
  37. package/dist/{catalog-Y4CjN8NA.js → catalog-BJu0A15r.js} +2 -2
  38. package/dist/{catalog-CoyKnU5c.js → catalog-CgA6-DQA.js} +1 -1
  39. package/dist/catalog-DqYnQz8U.js +1 -0
  40. package/dist/{catalog-doc-Zi0jRpyH.js → catalog-doc-BoSOQRXT.js} +2 -2
  41. package/dist/{challenge-B__LcNve.js → challenge-DVw1SrH9.js} +1 -1
  42. package/dist/chat/index.d.ts +1 -1
  43. package/dist/chat/index.js +3 -3
  44. package/dist/chat-sdk/index.d.ts +3 -3
  45. package/dist/claude-agent/index.d.ts +3 -3
  46. package/dist/claude-agent/index.js +1 -1
  47. package/dist/clerk/index.d.ts +2 -2
  48. package/dist/cli/bin.js +1 -1
  49. package/dist/cli/index.d.ts +4 -4
  50. package/dist/cli/index.js +2 -2
  51. package/dist/cloud/index.d.ts +8 -8
  52. package/dist/cloud/index.js +2 -2
  53. package/dist/{cloud-DWCeStPH.js → cloud-Blw4AaQv.js} +2 -2
  54. package/dist/{codemod-BaPmaCYQ.js → codemod-BFFXaS-S.js} +1 -1
  55. package/dist/{codemod-B7QKJ_ak.js → codemod-ByRUKVp-.js} +2 -2
  56. package/dist/{collect-ScSG05VJ.js → collect-COqPRz6O.js} +2 -2
  57. package/dist/collect-CjFczu8a.js +1 -0
  58. package/dist/{collect-Cr71JA7z.js → collect-D3ToPa6Z.js} +1 -1
  59. package/dist/compile/index.d.ts +1 -1
  60. package/dist/{compile-DC-BrhH1.d.ts → compile-DSwZUJmL.d.ts} +2 -2
  61. package/dist/{completion-DOUMyCwa.js → completion-BW53byZN.js} +1 -1
  62. package/dist/{config-DRp-E8Ly.js → config-B0qti4jI.js} +1 -1
  63. package/dist/{config-report-Bh_nLdAE.js → config-report-DgMqeeK6.js} +2 -2
  64. package/dist/{context-Cem4QafV.js → context-KrAhRY22.js} +2 -2
  65. package/dist/convex/index.d.ts +4 -4
  66. package/dist/convex/index.js +1 -1
  67. package/dist/{core-CUjhfz0W.js → core-DMQsq2Gv.js} +5 -5
  68. package/dist/{core-D2JNg5jA.d.ts → core-KsoqXWhf.d.ts} +2 -2
  69. package/dist/{create-BsL5lCWR.js → create-BRr7Gu7N.js} +6 -6
  70. package/dist/{create-oMCcZV4X.d.ts → create-ChK8bpCK.d.ts} +7 -7
  71. package/dist/{create-CPDSbK1a.d.ts → create-DGFv7Dje.d.ts} +4 -4
  72. package/dist/{create-BJ2_8NDO.js → create-bYkJ4-tg.js} +3 -3
  73. package/dist/{create-B2tdOygC.d.ts → create-goT32QIN.d.ts} +6 -6
  74. package/dist/{credential-Bap3HClV.js → credential-DrVrRL7z.js} +2 -2
  75. package/dist/{credentials-BXV0oz56.js → credentials-UwTE2wCW.js} +1 -1
  76. package/dist/{credentials-DPX140fN.d.ts → credentials-fqa_Xzzh.d.ts} +2 -2
  77. package/dist/{condition-evaluate-bVVRSdzq.js → delegation-CrdqnesZ.js} +123 -156
  78. package/dist/delivery/index.d.ts +4 -4
  79. package/dist/delivery/index.js +1 -1
  80. package/dist/{denied-text-BXQkWU7d.d.ts → denied-text-BTMxIn5W.d.ts} +1 -1
  81. package/dist/{describe-DVobr5FX.d.ts → describe-CazEjtOH.d.ts} +1 -1
  82. package/dist/{diff-Jc_kbDz-.js → diff-BkuW_5dK.js} +1 -1
  83. package/dist/{diff-BR9JArxz.js → diff-DLcsCeVo.js} +3 -3
  84. package/dist/{doctor-DhqSiPkq.js → doctor-Jk2Ifezw.js} +2 -2
  85. package/dist/{doctor-BBMW5ZT_.js → doctor-oD08zL1e.js} +37 -19
  86. package/dist/drizzle/index.d.ts +3 -3
  87. package/dist/elysia/index.d.ts +4 -4
  88. package/dist/elysia/index.js +3 -3
  89. package/dist/{errors-D_JIQJYb.d.ts → errors-CXxQwtbZ.d.ts} +1 -1
  90. package/dist/{evaluate-B5yZHmts.js → evaluate-_JdlbJ32.js} +11 -8
  91. package/dist/{evaluations-BzTDWO4m.js → evaluations-Bj5xw0EM.js} +3 -3
  92. package/dist/{evaluations-DQYfh4Jh.d.ts → evaluations-DcUW5VkX.d.ts} +3 -3
  93. package/dist/evaluator-BvRk9kiK.js +0 -0
  94. package/dist/evaluator-eager-DvmrpdZt.js +9 -0
  95. package/dist/evaluator-mHAoYEkk.js +2 -0
  96. package/dist/eve/index.d.ts +4 -4
  97. package/dist/eve/index.js +2 -2
  98. package/dist/express/index.d.ts +4 -4
  99. package/dist/express/index.js +3 -3
  100. package/dist/fastify/index.d.ts +4 -4
  101. package/dist/fastify/index.js +3 -3
  102. package/dist/{fetch-adapter-MoYZ-vF5.js → fetch-adapter-CAA3VJMX.js} +3 -3
  103. package/dist/{fetch-adapter-DxqsIXSO.d.ts → fetch-adapter-eQ-mdk8n.d.ts} +2 -2
  104. package/dist/{fields-CVyOk-f1.js → fields-B17OWcPx.js} +1 -1
  105. package/dist/fields-DlKwZYiy.js +26 -0
  106. package/dist/from-snapshot-CdGYjHUg.js +153 -0
  107. package/dist/{gen-WdycZ_-b.js → gen-BwcwwLok.js} +3 -3
  108. package/dist/{gen-DXXoFjyf.js → gen-D4ulqsYR.js} +1 -1
  109. package/dist/grantee-OG4klcNr.js +110 -0
  110. package/dist/{grantee-match-8J2y60MF.js → grantee-match-CPQ9zV-H.js} +1 -1
  111. package/dist/h3/index.d.ts +4 -4
  112. package/dist/h3/index.js +3 -3
  113. package/dist/{helpers-DzBIfL1N.js → helpers-CO2hDpBU.js} +1 -1
  114. package/dist/hono/index.d.ts +4 -4
  115. package/dist/hono/index.js +3 -3
  116. package/dist/{hosted-DXq1plaP.d.ts → hosted-BUCpV8-u.d.ts} +1 -1
  117. package/dist/{hosted-C5I2TSXm.js → hosted-cPDyrlsQ.js} +5 -4
  118. package/dist/{import-CvXswHDy.js → import-B2jgnNS0.js} +1 -1
  119. package/dist/{import-BE5sDazm.js → import-BsrnU4BF.js} +1 -1
  120. package/dist/{index-C-R8lBPb.d.ts → index-BXS29UnX.d.ts} +1 -1
  121. package/dist/{index-BcS8c_2S.d.ts → index-CvKGALWb.d.ts} +4 -4
  122. package/dist/{index-BdZpqhJK.d.ts → index-CxA-ygwc.d.ts} +2 -2
  123. package/dist/{index-Cjfa1Uwr.d.ts → index-DD2FBFdm.d.ts} +10 -8
  124. package/dist/{index-iIsqXFVu.d.ts → index-DQCBzEhO.d.ts} +4 -4
  125. package/dist/{index-C_8uxAlv.d.ts → index-DYAJ9JX1.d.ts} +4 -4
  126. package/dist/index.d.ts +16 -16
  127. package/dist/index.js +21 -18
  128. package/dist/{init-CqGHcvyR.js → init-Baq0yYfu.js} +1 -1
  129. package/dist/{init-B_S8Xdz1.js → init-Cik6ITgM.js} +3 -3
  130. package/dist/{instance-options-C6gEDOts.d.ts → instance-options-BDHB3qBG.d.ts} +1 -1
  131. package/dist/{instance-snapshot-D_dGTq--.js → instance-snapshot-LPNBG9np.js} +67 -8
  132. package/dist/jwt/index.d.ts +4 -4
  133. package/dist/{kernel-NmxiWII2.js → kernel-BY3rVRs2.js} +8 -8
  134. package/dist/kysely/index.d.ts +3 -3
  135. package/dist/{login-DoLxv1s5.js → login-CUboKh0f.js} +3 -3
  136. package/dist/{login-CzwlsBEO.js → login-CcBS1xkU.js} +1 -1
  137. package/dist/{manifest-BdzBobNK.js → manifest-BoCYBbQL.js} +1 -1
  138. package/dist/{manifest-B5yF3CIq.d.ts → manifest-C6eFl3Vo.d.ts} +1 -0
  139. package/dist/{manifest-BAf7cgRx.js → manifest-CIlVL-QT.js} +35 -35
  140. package/dist/{manifest-schema-CsFsYLF-.js → manifest-schema-svAkgqMc.js} +5 -1
  141. package/dist/{map-error-p4ROJ_26.js → map-error-BCdb2Nrp.js} +2 -2
  142. package/dist/may-use-D0_wNcgB.js +126 -0
  143. package/dist/mcp/index.d.ts +8 -8
  144. package/dist/mcp/index.js +5 -5
  145. package/dist/membership-filter-CfLdP_F9.js +68 -0
  146. package/dist/nest/index.d.ts +4 -4
  147. package/dist/nest/index.js +3 -3
  148. package/dist/next/index.d.ts +10 -10
  149. package/dist/next/index.js +6 -6
  150. package/dist/next/plugin.d.ts +1 -1
  151. package/dist/next/plugin.js +1 -1
  152. package/dist/node/index.d.ts +4 -4
  153. package/dist/node/index.js +2 -2
  154. package/dist/openai/index.d.ts +4 -4
  155. package/dist/openai/index.js +2 -2
  156. package/dist/openapi/index.d.ts +2 -2
  157. package/dist/{openapi-EmvKwuWj.js → openapi-DglIpD53.js} +2 -2
  158. package/dist/{openapi-DroBcLJZ.js → openapi-DobvXTF6.js} +2 -2
  159. package/dist/orpc/index.d.ts +5 -5
  160. package/dist/orpc/index.js +3 -3
  161. package/dist/otel/index.d.ts +3 -3
  162. package/dist/otel/index.js +1 -1
  163. package/dist/{output-CYgfpT6o.js → output-B81GJ6u6.js} +1 -1
  164. package/dist/{ownership-adPAsUwY.js → ownership-B7Ea-hUY.js} +3 -3
  165. package/dist/{parse-local-manifest-BaCqsqwC.d.ts → parse-local-manifest-DzZOzDsK.d.ts} +1 -1
  166. package/dist/pdp/index.d.ts +3 -3
  167. package/dist/pdp/index.js +3 -3
  168. package/dist/{permdock-B5LyNVgn.js → permdock-HfTF99xX.js} +26 -15
  169. package/dist/{permdock-BaB-KQqn.d.ts → permdock-vD3mwLSm.d.ts} +3 -3
  170. package/dist/{permissions-COpRGKt7.js → permissions-CGYZqYsY.js} +2 -2
  171. package/dist/{policy-x8RBKW8d.d.ts → policy-B_cqFLHu.d.ts} +1 -1
  172. package/dist/{policy-wGzbAPQF.js → policy-BovcTojN.js} +5 -4
  173. package/dist/{policy-from-catalog-Cy103lsm.js → policy-from-catalog-lKL280I8.js} +7 -7
  174. package/dist/{policy-types-rNfz7t0M.d.ts → policy-types-CCBrL7me.d.ts} +14 -0
  175. package/dist/{postgrest-Cn0Res25.d.ts → postgrest-5WOO47Ud.d.ts} +2 -2
  176. package/dist/{powersync-BeI0VmEK.js → powersync-B6f4l8C1.js} +2 -2
  177. package/dist/{powersync-Dpa5AnnN.js → powersync-BUUqJfH2.js} +6 -6
  178. package/dist/powersync-D12Q6Chj.js +1 -0
  179. package/dist/prisma/index.d.ts +2 -2
  180. package/dist/{protected-action-E7Sdt_Dt.js → protected-action-CdqR2-E2.js} +80 -12
  181. package/dist/{protected-action-C4aj1KjO.d.ts → protected-action-DGuJNiMA.d.ts} +20 -8
  182. package/dist/{provider-DKO9KHua.js → provider-6mpRZO1E.js} +21 -3
  183. package/dist/{provider-store-D4PU1my_.js → provider-store-BLd4UEmg.js} +4 -3
  184. package/dist/{provider-B-1DlOGM.d.ts → provider-yIM04TwN.d.ts} +1 -1
  185. package/dist/{pull-3tkn25ll.js → pull-4Yi8zYeU.js} +3 -3
  186. package/dist/pull-Dr6Bq5Jo.js +1 -0
  187. package/dist/{push-dMyKdlEm.js → push-Dv1nfFPr.js} +3 -3
  188. package/dist/{pushed-policy-P55cJNx5.d.ts → pushed-policy-B2ZSpnRY.d.ts} +1 -1
  189. package/dist/{pushed-policy-Bi5-il4C.js → pushed-policy-DJoyBZsd.js} +2 -2
  190. package/dist/react/index.d.ts +7 -7
  191. package/dist/react/index.js +4 -4
  192. package/dist/react/provider-client.d.ts +1 -1
  193. package/dist/react/provider-client.js +1 -1
  194. package/dist/react-native/index.d.ts +8 -8
  195. package/dist/react-native/index.js +7 -6
  196. package/dist/{replay-DKhFvt0L.d.ts → replay-CsErjiHt.d.ts} +1 -1
  197. package/dist/{request-context-5gl_oxO1.js → request-context-B_L4ev8L.js} +2 -2
  198. package/dist/resend/index.d.ts +4 -4
  199. package/dist/resend/index.js +2 -2
  200. package/dist/{resolve-names-BnGJU88N.js → resolve-names-SGcLjtFc.js} +10 -5
  201. package/dist/{rls-DIYSRnDZ.js → rls-Df9NEWD3.js} +1 -1
  202. package/dist/{rls-qrehUPf_.js → rls-hmwRIS3-.js} +11 -11
  203. package/dist/{role-builder-boQiUvfo.js → role-builder-BXdhhQcB.js} +5 -3
  204. package/dist/row-pair-DglMdRFh.js +34 -0
  205. package/dist/{rpc-BqRiVpbP.d.ts → rpc-D3St8vPO.d.ts} +1 -1
  206. package/dist/{rpc-Dhi55Whd.js → rpc-DFtputZ1.js} +1 -1
  207. package/dist/{run-oNqBe0gc.js → run-BXmJIjRA.js} +2 -2
  208. package/dist/run-DnzrDgU-.js +1 -0
  209. package/dist/{run-ticket-Dulj4RQk.d.ts → run-ticket-zfABczfh.d.ts} +2 -2
  210. package/dist/{saas-DABv6vjy.js → saas-DIThcxbn.js} +5 -5
  211. package/dist/{scan-BYXqcgON.js → scan-BrTSlc_5.js} +1 -1
  212. package/dist/{schema-Wf-SvlHG.js → schema-UOeI_LTB.js} +1 -1
  213. package/dist/scim/index.d.ts +1 -1
  214. package/dist/server/index.d.ts +11 -11
  215. package/dist/server/index.js +5 -5
  216. package/dist/{server-types--_Hann81.d.ts → server-types-CtJSDhOv.d.ts} +8 -8
  217. package/dist/{sink-Cs6z34AX.d.ts → sink-BskpqwLl.d.ts} +2 -2
  218. package/dist/{skills-B9U465B7.js → skills-BTVeFptV.js} +1 -1
  219. package/dist/{skills-417bOj4o.js → skills-CAgWKbDR.js} +1 -1
  220. package/dist/{snapshot-C2j96x97.js → snapshot-BcHYtUIg.js} +57 -7
  221. package/dist/{snapshot-cache-Cc7VNabe.d.ts → snapshot-cache-BnXMcJbK.d.ts} +1 -1
  222. package/dist/snapshot-empty-BoPBFoB8.js +17 -0
  223. package/dist/snapshot-evaluate-CwYVSUgO.js +501 -0
  224. package/dist/snapshot-reads-DOsTYC82.js +66 -0
  225. package/dist/solid/index.d.ts +5 -5
  226. package/dist/solid/index.js +2 -2
  227. package/dist/solid-start/index.d.ts +4 -4
  228. package/dist/solid-start/index.js +3 -3
  229. package/dist/{sources-BfTza0zT.d.ts → sources-DhCtO9G8.d.ts} +2 -2
  230. package/dist/{src-BG9YJM3Q.js → src-BZKQe1lr.js} +13 -12
  231. package/dist/ssf/index.d.ts +3 -3
  232. package/dist/ssf/index.js +2 -2
  233. package/dist/{standard-webhooks-CJBgfl7y.d.ts → standard-webhooks-kQDkIPj3.d.ts} +2 -2
  234. package/dist/{store-BpKH-pLm.js → store-DXO0aVgf.js} +2 -2
  235. package/dist/{store-DSyjHD5-.d.ts → store-core-CDabEiO9.d.ts} +27 -6
  236. package/dist/{store-options-CXv6BHH6.js → store-options-COLWAd1K.js} +92 -12
  237. package/dist/{stores-BuqAHjp_.js → stores-DYxx75fk.js} +1 -1
  238. package/dist/{stores-C6-7TPTV.d.ts → stores-Mw_VAJ3B.d.ts} +5 -5
  239. package/dist/{subject-cache-d_Z4KAnm.d.ts → subject-cache-DrJGnRiV.d.ts} +1 -1
  240. package/dist/supabase/index.d.ts +7 -7
  241. package/dist/supabase/index.js +2 -2
  242. package/dist/supabase/middleware.d.ts +5 -5
  243. package/dist/supabase/middleware.js +5 -5
  244. package/dist/{supabase-DnazO6W4.js → supabase-BDr-fIHp.js} +1 -1
  245. package/dist/{supabase-D0J99yqL.js → supabase-Bt8rb-ah.js} +2 -2
  246. package/dist/{supabase-hook-Bh5syR9N.js → supabase-hook-Cb3UZpGC.js} +6 -5
  247. package/dist/supabase-hook-D1pwHu87.js +1 -0
  248. package/dist/{supautils-ChXR-4Or.js → supautils-CuR9rPsi.js} +8 -8
  249. package/dist/svelte/index.d.ts +5 -5
  250. package/dist/svelte/index.js +3 -3
  251. package/dist/svelte/runtime.d.ts +3 -3
  252. package/dist/svelte/runtime.js +1 -1
  253. package/dist/svelte/source.d.ts +5 -5
  254. package/dist/svelte/source.js +2 -2
  255. package/dist/sveltekit/index.d.ts +4 -4
  256. package/dist/sveltekit/index.js +2 -2
  257. package/dist/{tables-CbEOy2Ma.js → tables-Bl_ozD0k.js} +35 -13
  258. package/dist/tanstack-start/index.d.ts +4 -4
  259. package/dist/tanstack-start/index.js +2 -2
  260. package/dist/terminal/index.d.ts +5 -5
  261. package/dist/terminal/index.js +3 -3
  262. package/dist/testing/core.d.ts +1 -1
  263. package/dist/testing/core.js +1 -1
  264. package/dist/testing/fixtures/index.d.ts +4 -4
  265. package/dist/testing/fixtures/index.js +7 -1
  266. package/dist/testing/index.d.ts +24 -24
  267. package/dist/testing/index.js +47 -41
  268. package/dist/testing/saas/index.d.ts +3 -3
  269. package/dist/testing/saas/index.js +2 -2
  270. package/dist/testing/saas/permissions.js +1 -1
  271. package/dist/trpc/index.d.ts +5 -5
  272. package/dist/trpc/index.js +3 -3
  273. package/dist/{type-helpers-iXJEIDe7.d.ts → type-helpers-fQdBvtU0.d.ts} +1 -1
  274. package/dist/{types-BpxdxaRD.d.ts → types-BSGrzDPi.d.ts} +4 -4
  275. package/dist/{types-ZfjQB0KC.d.ts → types-CAp7UGiB.d.ts} +1 -1
  276. package/dist/{types-CD1qmxdx.d.ts → types-CErg7ft6.d.ts} +3 -3
  277. package/dist/{types-_pi9kxS2.d.ts → types-CXUwgZ3d.d.ts} +2 -2
  278. package/dist/{types-C_a44wSr.d.ts → types-Cc68_zqR.d.ts} +2 -2
  279. package/dist/{types-Cq2rvv-C.d.ts → types-CdXM6qPc.d.ts} +2 -2
  280. package/dist/{types-BSNZMp5b.d.ts → types-ChYCRn7Y.d.ts} +1 -1
  281. package/dist/{types-CuDXvyIT.d.ts → types-DDlaFDM3.d.ts} +4 -4
  282. package/dist/{types-NikV1pND.d.ts → types-DM0o1YyJ.d.ts} +4 -4
  283. package/dist/{types-B9F0EZAF.d.ts → types-DyA4Loy4.d.ts} +3 -3
  284. package/dist/{types-CS1DI_Ke.d.ts → types-JmB6unT6.d.ts} +1 -1
  285. package/dist/unplugin/index.d.ts +1 -1
  286. package/dist/unplugin/index.js +1 -1
  287. package/dist/{usage-0wsl83uw.js → usage-B6sQwycY.js} +4 -4
  288. package/dist/{usage-Bl-BkXEq.js → usage-CNkKk27O.js} +1 -1
  289. package/dist/usage-Cem1FOeJ.js +1 -0
  290. package/dist/{validation-error-DLAYFlkr.d.ts → validation-error-BE8bpmhR.d.ts} +1 -1
  291. package/dist/{validity-Buc7w8E9.js → validity-IcjQSR7I.js} +1 -26
  292. package/dist/{verify-BSLotSa0.js → verify-OtU4yCzg.js} +11 -11
  293. package/dist/{version-sources-BC3hf2ME.js → version-sources-BZ7V6Z8Z.js} +1 -1
  294. package/dist/{grantee-Dke-9rd1.js → vocabulary-BuYFWeCU.js} +1 -107
  295. package/dist/vue/index.d.ts +5 -5
  296. package/dist/vue/index.js +2 -2
  297. package/dist/{waiter-cbK1CBhT.d.ts → waiter-LdnPaBJE.d.ts} +2 -2
  298. package/dist/watch-B8F7Wgdy.js +1 -0
  299. package/dist/{watch-BigZ260i.js → watch-CR2ZIT_5.js} +1 -1
  300. package/dist/webmcp/index.d.ts +1 -1
  301. package/dist/{who-can-CjfMP9a4.js → who-can-DcrHB6ya.js} +2 -2
  302. package/dist/workflow/index.d.ts +3 -3
  303. package/dist/workflow/index.js +2 -2
  304. package/dist/workflow-sdk/index.d.ts +4 -4
  305. package/dist/{wrap-B-k2qHJx.d.ts → wrap-CVBPIuEs.d.ts} +2 -2
  306. package/package.json +1 -1
  307. package/schemas/supabase-manifest-v1.json +7 -1
  308. package/skills/permdock-wire/references/adapters.md +2 -0
  309. package/dist/catalog-C462QC3A.js +0 -1
  310. package/dist/collect-W9i7REKT.js +0 -1
  311. package/dist/from-snapshot-oR_N97dM.js +0 -927
  312. package/dist/powersync-BdoR7nwS.js +0 -1
  313. package/dist/pull-D90HqWNP.js +0 -1
  314. package/dist/run-elFdnSZx.js +0 -1
  315. package/dist/supabase-hook-CVAenq-w.js +0 -1
  316. package/dist/usage-CmyGbo4e.js +0 -1
  317. package/dist/watch-CHURMgrv.js +0 -1
  318. package/dist/{connection-QFsv-kbh.js → connection-zoAgwdsD.js} +1 -1
  319. package/dist/{problem-BWP1l86g.js → problem-CPB8kqk7.js} +1 -1
  320. package/dist/{wrap-BKU5Arsu.js → wrap-C5PWzgkq.js} +1 -1
@@ -30,20 +30,20 @@ const SECTIONS = [
30
30
  docs: "init",
31
31
  effects: ["files"],
32
32
  config: false,
33
- load: async () => (await import("./init-B_S8Xdz1.js")).init
33
+ load: async () => (await import("./init-Cik6ITgM.js")).init
34
34
  }),
35
35
  group("preset", "Decode a preset code, or print its permdock.com/create link", "preset", [leaf("decode", "Print what a preset code holds", {
36
36
  examples: ["permdock preset decode p1AQIDBAc"],
37
37
  docs: "preset",
38
38
  effects: [],
39
39
  config: false,
40
- load: async () => (await import("./init-B_S8Xdz1.js")).presetDecode
40
+ load: async () => (await import("./init-Cik6ITgM.js")).presetDecode
41
41
  }), leaf("url", "Print the permdock.com/create link that opens a code", {
42
42
  examples: ["permdock preset url p1AQIDBAc"],
43
43
  docs: "preset",
44
44
  effects: [],
45
45
  config: false,
46
- load: async () => (await import("./init-B_S8Xdz1.js")).presetUrl
46
+ load: async () => (await import("./init-Cik6ITgM.js")).presetUrl
47
47
  })]),
48
48
  group("skills", "Install, update or list the PermDock Agent Skills", "skills", [
49
49
  leaf("install", "Copy the Agent Skills into the agent folders", {
@@ -55,21 +55,21 @@ const SECTIONS = [
55
55
  docs: "skills",
56
56
  effects: ["files"],
57
57
  config: false,
58
- load: async () => (await import("./skills-B9U465B7.js")).install
58
+ load: async () => (await import("./skills-BTVeFptV.js")).install
59
59
  }),
60
60
  leaf("update", "Replace installed skills with this version's", {
61
61
  examples: ["permdock skills update"],
62
62
  docs: "skills",
63
63
  effects: ["files"],
64
64
  config: false,
65
- load: async () => (await import("./skills-B9U465B7.js")).update
65
+ load: async () => (await import("./skills-BTVeFptV.js")).update
66
66
  }),
67
67
  leaf("list", "List the skills and where each is installed", {
68
68
  examples: ["permdock skills list"],
69
69
  docs: "skills",
70
70
  effects: [],
71
71
  config: false,
72
- load: async () => (await import("./skills-B9U465B7.js")).list
72
+ load: async () => (await import("./skills-BTVeFptV.js")).list
73
73
  })
74
74
  ]),
75
75
  leaf("doctor", "Check a PermDock installation and print a fix for each finding", {
@@ -83,7 +83,7 @@ const SECTIONS = [
83
83
  effects: ["files", "database:read"],
84
84
  config: true,
85
85
  findings: true,
86
- load: async () => (await import("./doctor-DhqSiPkq.js")).doctor
86
+ load: async () => (await import("./doctor-Jk2Ifezw.js")).doctor
87
87
  }),
88
88
  leaf("completion", "Print the shell completion script for bash, zsh or fish", {
89
89
  examples: ["permdock completion zsh > ~/.zfunc/_permdock", "eval \"$(permdock completion bash)\""],
@@ -91,7 +91,7 @@ const SECTIONS = [
91
91
  effects: [],
92
92
  config: false,
93
93
  shellOutput: true,
94
- load: async () => (await import("./completion-DOUMyCwa.js")).completion
94
+ load: async () => (await import("./completion-BW53byZN.js")).completion
95
95
  })
96
96
  ]
97
97
  },
@@ -107,14 +107,14 @@ const SECTIONS = [
107
107
  docs: "collect",
108
108
  effects: ["files"],
109
109
  config: true,
110
- load: async () => (await import("./collect-ScSG05VJ.js")).collect
110
+ load: async () => (await import("./collect-COqPRz6O.js")).collect
111
111
  }),
112
112
  leaf("catalog", "Export the catalog as catalog JSON, JSON Schema or Markdown", {
113
113
  examples: ["permdock catalog --out permissions.catalog.json", "permdock catalog --kind markdown"],
114
114
  docs: "catalog",
115
115
  effects: ["files"],
116
116
  config: true,
117
- load: async () => (await import("./catalog-CoyKnU5c.js")).catalog
117
+ load: async () => (await import("./catalog-CgA6-DQA.js")).catalog
118
118
  }),
119
119
  leaf("gen", "Write typed constants, schemas, factories, hooks and messages from the policy", {
120
120
  examples: [
@@ -125,7 +125,7 @@ const SECTIONS = [
125
125
  docs: "gen",
126
126
  effects: ["files"],
127
127
  config: true,
128
- load: async () => (await import("./gen-DXXoFjyf.js")).gen
128
+ load: async () => (await import("./gen-D4ulqsYR.js")).gen
129
129
  }),
130
130
  leaf("usage", "Report unused, ungranted and role-less permissions and conditions on undeclared fields", {
131
131
  examples: ["permdock usage", "permdock usage --fail-on warning"],
@@ -133,14 +133,14 @@ const SECTIONS = [
133
133
  effects: [],
134
134
  config: true,
135
135
  findings: true,
136
- load: async () => (await import("./usage-Bl-BkXEq.js")).usage
136
+ load: async () => (await import("./usage-CNkKk27O.js")).usage
137
137
  }),
138
138
  leaf("diff", "Compare two policies or catalogs; exit 1 on a breaking change", {
139
139
  examples: ["permdock diff main.catalog.json permissions.catalog.json", "permdock diff ./old-policy.ts ./src/policy.ts --impact"],
140
140
  docs: "diff",
141
141
  effects: [],
142
142
  config: true,
143
- load: async () => (await import("./diff-Jc_kbDz-.js")).diff
143
+ load: async () => (await import("./diff-BkuW_5dK.js")).diff
144
144
  }),
145
145
  leaf("config", "Check permdock.config.ts for unknown keys, or print the effective config", {
146
146
  examples: ["permdock config", "permdock config --print"],
@@ -148,7 +148,7 @@ const SECTIONS = [
148
148
  effects: [],
149
149
  config: true,
150
150
  findings: true,
151
- load: async () => (await import("./config-DRp-E8Ly.js")).config
151
+ load: async () => (await import("./config-B0qti4jI.js")).config
152
152
  })
153
153
  ]
154
154
  },
@@ -165,14 +165,14 @@ const SECTIONS = [
165
165
  "network"
166
166
  ],
167
167
  config: true,
168
- load: async () => (await import("./rls-DIYSRnDZ.js")).generate
168
+ load: async () => (await import("./rls-Df9NEWD3.js")).generate
169
169
  }),
170
170
  leaf("import", "Turn existing RLS policies into a generated definition", {
171
171
  examples: ["permdock rls import --sql schema.sql --out src/permissions.generated.ts", "permdock rls import --db-url-stdin --out src/permissions.generated.ts"],
172
172
  docs: "rls",
173
173
  effects: ["files", "database:read"],
174
174
  config: true,
175
- load: async () => (await import("./rls-DIYSRnDZ.js")).importPolicies
175
+ load: async () => (await import("./rls-Df9NEWD3.js")).importPolicies
176
176
  }),
177
177
  leaf("verify", "Run the fixtures against the policies, or compare a live database", {
178
178
  examples: [
@@ -184,21 +184,21 @@ const SECTIONS = [
184
184
  effects: ["files", "database:read"],
185
185
  config: true,
186
186
  findings: true,
187
- load: async () => (await import("./rls-DIYSRnDZ.js")).verify
187
+ load: async () => (await import("./rls-Df9NEWD3.js")).verify
188
188
  }),
189
189
  leaf("migrate", "Rewrite hand-written policies onto the generated helpers", {
190
190
  examples: ["permdock rls migrate --sql supabase/migrations --dry-run", "permdock rls migrate --sql supabase/migrations"],
191
191
  docs: "rls",
192
192
  effects: ["rewrite", "files"],
193
193
  config: true,
194
- load: async () => (await import("./rls-DIYSRnDZ.js")).migrate
194
+ load: async () => (await import("./rls-Df9NEWD3.js")).migrate
195
195
  }),
196
196
  leaf("explain", "Show the tables, membership sources and triggers the SQL binds to", {
197
197
  examples: ["permdock rls explain", "permdock rls explain --db-url-stdin --json"],
198
198
  docs: "rls",
199
199
  effects: ["database:read"],
200
200
  config: true,
201
- load: async () => (await import("./rls-DIYSRnDZ.js")).explain
201
+ load: async () => (await import("./rls-Df9NEWD3.js")).explain
202
202
  })
203
203
  ]),
204
204
  group("supabase", "Generate the Supabase Custom Access Token Hook, or inspect its manifest", "supabase", [group("hook", "The Custom Access Token Hook", "supabase", [leaf("generate", "Compile the membership sources into the hook migration", {
@@ -206,26 +206,26 @@ const SECTIONS = [
206
206
  docs: "supabase",
207
207
  effects: ["files", "database:read"],
208
208
  config: true,
209
- load: async () => (await import("./supabase-D0J99yqL.js")).hookGenerate
209
+ load: async () => (await import("./supabase-Bt8rb-ah.js")).hookGenerate
210
210
  })]), leaf("inspect", "Print or write the hook and helper manifest", {
211
211
  examples: ["permdock supabase inspect", "permdock supabase inspect --out"],
212
212
  docs: "supabase",
213
213
  effects: ["files"],
214
214
  config: true,
215
- load: async () => (await import("./supabase-D0J99yqL.js")).inspect
215
+ load: async () => (await import("./supabase-Bt8rb-ah.js")).inspect
216
216
  })]),
217
217
  group("powersync", "Generate PowerSync Sync Streams from the policy, or verify them", "powersync", [leaf("generate", "Compile the read grants into sync-config.yaml", {
218
218
  examples: ["permdock powersync generate", "permdock powersync generate --check"],
219
219
  docs: "powersync",
220
220
  effects: ["files"],
221
221
  config: true,
222
- load: async () => (await import("./powersync-BeI0VmEK.js")).generate
222
+ load: async () => (await import("./powersync-B6f4l8C1.js")).generate
223
223
  }), leaf("verify", "Fail on stale streams or a stream that syncs a denied row", {
224
224
  examples: ["permdock powersync verify", "permdock powersync verify --db-url-stdin"],
225
225
  docs: "powersync",
226
226
  effects: ["database:read"],
227
227
  config: true,
228
- load: async () => (await import("./powersync-BeI0VmEK.js")).verify
228
+ load: async () => (await import("./powersync-B6f4l8C1.js")).verify
229
229
  })]),
230
230
  group("scim", "Generate the Postgres tables postgresDirectoryStore keeps a SCIM directory in", "scim", [leaf("generate", "Write the tenant-keyed users, groups and members tables", {
231
231
  examples: [
@@ -248,13 +248,13 @@ const SECTIONS = [
248
248
  docs: "openapi",
249
249
  effects: ["files"],
250
250
  config: true,
251
- load: async () => (await import("./openapi-DroBcLJZ.js")).emit
251
+ load: async () => (await import("./openapi-DobvXTF6.js")).emit
252
252
  }), leaf("import", "Turn an OpenAPI document into a generated definition", {
253
253
  examples: ["permdock openapi import --doc openapi.yaml --out src/permissions.generated.ts"],
254
254
  docs: "openapi",
255
255
  effects: ["files", "network"],
256
256
  config: false,
257
- load: async () => (await import("./openapi-DroBcLJZ.js")).importDocument
257
+ load: async () => (await import("./openapi-DobvXTF6.js")).importDocument
258
258
  })]),
259
259
  group("arazzo", "Check Arazzo workflows against the permissions", "arazzo", [leaf("check", "Resolve every Arazzo step to x-permdock-permissions", {
260
260
  examples: ["permdock arazzo check --doc arazzo.json --openapi openapi.json"],
@@ -262,7 +262,7 @@ const SECTIONS = [
262
262
  effects: [],
263
263
  config: true,
264
264
  findings: true,
265
- load: async () => (await import("./arazzo-BXD-VJU_.js")).check
265
+ load: async () => (await import("./arazzo-4rMFOHbu.js")).check
266
266
  })]),
267
267
  leaf("scan", "List authorization checks written without PermDock, to adopt it in an existing app", {
268
268
  examples: ["permdock scan", "permdock scan --src app,lib --pattern isBeta"],
@@ -270,7 +270,7 @@ const SECTIONS = [
270
270
  effects: [],
271
271
  config: true,
272
272
  findings: true,
273
- load: async () => (await import("./scan-BYXqcgON.js")).scan
273
+ load: async () => (await import("./scan-BrTSlc_5.js")).scan
274
274
  }),
275
275
  group("casl", "Import CASL rules into a generated module", "casl", [leaf("import", "Turn CASL rules per role into a permissions and policy module", {
276
276
  examples: ["permdock casl import --rules rules.json --out src/permissions.generated.ts"],
@@ -284,7 +284,7 @@ const SECTIONS = [
284
284
  docs: "casbin",
285
285
  effects: ["files"],
286
286
  config: false,
287
- load: async () => (await import("./casbin-imBS3UIf.js")).casbinImport
287
+ load: async () => (await import("./casbin-CjUT-wqV.js")).casbinImport
288
288
  })])
289
289
  ]
290
290
  },
@@ -296,34 +296,34 @@ const SECTIONS = [
296
296
  docs: "login",
297
297
  effects: ["network", "files"],
298
298
  config: false,
299
- load: async () => (await import("./login-DoLxv1s5.js")).login
299
+ load: async () => (await import("./login-CUboKh0f.js")).login
300
300
  }),
301
301
  leaf("logout", "Revoke and delete the stored PermDock Cloud login", {
302
302
  examples: ["permdock logout"],
303
303
  docs: "login",
304
304
  effects: ["network", "files"],
305
305
  config: false,
306
- load: async () => (await import("./login-DoLxv1s5.js")).logout
306
+ load: async () => (await import("./login-CUboKh0f.js")).logout
307
307
  }),
308
308
  leaf("whoami", "Print the PermDock Cloud identity the CLI acts as", {
309
309
  examples: ["permdock whoami", "permdock whoami --json"],
310
310
  docs: "login",
311
311
  effects: [],
312
312
  config: false,
313
- load: async () => (await import("./login-DoLxv1s5.js")).whoami
313
+ load: async () => (await import("./login-CUboKh0f.js")).whoami
314
314
  }),
315
315
  group("cloud", "Publish to or pull from a PermDock Cloud project", "cloud", [leaf("push", "Publish the catalog, policy and manifest to a Cloud project", {
316
316
  examples: ["permdock cloud push --dry-run", "permdock cloud push --project prj_123"],
317
317
  docs: "cloud",
318
318
  effects: ["network", "cloud:write"],
319
319
  config: true,
320
- load: async () => (await import("./cloud-DWCeStPH.js")).push
320
+ load: async () => (await import("./cloud-Blw4AaQv.js")).push
321
321
  }), leaf("pull", "Write a Cloud project's published catalog and manifest", {
322
322
  examples: ["permdock cloud pull --project prj_123"],
323
323
  docs: "cloud",
324
324
  effects: ["network", "files"],
325
325
  config: true,
326
- load: async () => (await import("./cloud-DWCeStPH.js")).pull
326
+ load: async () => (await import("./cloud-Blw4AaQv.js")).pull
327
327
  })])
328
328
  ]
329
329
  },
@@ -334,7 +334,7 @@ const SECTIONS = [
334
334
  docs: "codemod",
335
335
  effects: ["rewrite"],
336
336
  config: false,
337
- load: async () => (await import("./codemod-B7QKJ_ak.js")).codemod
337
+ load: async () => (await import("./codemod-ByRUKVp-.js")).codemod
338
338
  })]
339
339
  }
340
340
  ];
@@ -346,7 +346,7 @@ const COMPLETE_LEAF = leaf("__complete", "Print completion candidates for a part
346
346
  config: false,
347
347
  shellOutput: true,
348
348
  hidden: true,
349
- load: async () => (await import("./completion-DOUMyCwa.js")).complete
349
+ load: async () => (await import("./completion-BW53byZN.js")).complete
350
350
  });
351
351
  const ROOT = group("permdock", "Collect, export, diff and check the permissions a PermDock policy declares", "", [...SECTIONS.flatMap((section) => section.entries), COMPLETE_LEAF]);
352
352
  /** Each leaf with its path from the root, in manifest order. */
@@ -332,6 +332,10 @@ const supabaseManifestSchema = freezeDeep({
332
332
  type: "object",
333
333
  additionalProperties: {
334
334
  type: "object",
335
+ properties: { idType: {
336
+ description: "The id type the rls.rowHelpers pair rows and row take and return, with rows. Absent from a manifest written before 0.22.1, read as uuid.",
337
+ type: "string"
338
+ } },
335
339
  additionalProperties: { type: "string" }
336
340
  }
337
341
  }
@@ -426,7 +430,7 @@ const supabaseManifestSchema = freezeDeep({
426
430
  },
427
431
  helperName: {
428
432
  type: "string",
429
- pattern: "^(permdock_has(_for)?|permitted_[a-z][a-z0-9_]*_(ids|permission_keys)(_for)?|permitted_[a-z][a-z0-9_]*_users|member_[a-z][a-z0-9_]*_ids(_for|_of)?|permdock_can_assign(_any|_custom_role)?(_for)?|permdock_api_key_allows|permdock_token_scope_allows|permdock_actor_may_write|permdock_is_approver|permdock_manages|permdock_user_id)$"
433
+ pattern: "^(permdock_has(_for)?|permitted_[a-z][a-z0-9_]*_(ids|permission_keys)(_for)?|permitted_[a-z][a-z0-9_]*_users|member_[a-z][a-z0-9_]*_ids(_for|_of)?|permdock_can_assign(_any|_custom_role)?(_for)?|permdock_api_key_allows|permdock_token_scope_allows|permdock_actor_may_write|permdock_is_approver|permdock_manages|permdock_user_id|permdock_subject)$"
430
434
  },
431
435
  column: {
432
436
  type: "object",
@@ -1,8 +1,8 @@
1
1
  import { t as compact } from "./compact-CAf557ZB.js";
2
2
  import { n as PermDockValidationError } from "./validation-error-CYg2kJEw.js";
3
3
  import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "./errors-ynga1EQy.js";
4
- import { a as decisionResponse, l as problemResponse } from "./problem-BWP1l86g.js";
5
- import { f as InvalidSignatureError } from "./evaluations-BzTDWO4m.js";
4
+ import { a as decisionResponse, l as problemResponse } from "./problem-CPB8kqk7.js";
5
+ import { f as InvalidSignatureError } from "./evaluations-Bj5xw0EM.js";
6
6
  //#region src/server/map-error.ts
7
7
  /**
8
8
  * Turns a thrown PermDock error into its Problem Details response, with the
@@ -0,0 +1,126 @@
1
+ import { n as freezeDeep } from "./freeze-jjan0lCv.js";
2
+ import { d as scopeList, p as tenantOf, s as resolveScope } from "./scopes-gdH__vDZ.js";
3
+ import { a as readOnlyActorRefuses, n as coveredByDelegation } from "./delegation-CrdqnesZ.js";
4
+ import { r as readWireValidity, t as isActive } from "./validity-IcjQSR7I.js";
5
+ import { c as nowSeconds, r as isMembershipExpired } from "./tenancy-BlxY5T0q.js";
6
+ import { t as loadPrincipal } from "./principal-source-C6N60GtM.js";
7
+ //#region src/core/decide-for.ts
8
+ function deniedFor(permission, reason) {
9
+ return freezeDeep({
10
+ outcome: "denied",
11
+ permission: permission.key,
12
+ denials: [{
13
+ role: null,
14
+ reason
15
+ }],
16
+ alternatives: []
17
+ });
18
+ }
19
+ /** Rows are checked like `decide`; `call: 'can'` keeps every limit unconsumed. */
20
+ const PEEK = Object.freeze({ call: "can" });
21
+ /**
22
+ * What `permission` on `row` decides for the principal `principalId` in the
23
+ * caller's active tenant. Never throws, never consumes a limit, and grants the
24
+ * caller nothing: the target is a separate instance with its own caches.
25
+ */
26
+ async function decideForTarget(caller, principals, create, principalId, permission, row) {
27
+ if (caller.principal === null) return deniedFor(permission, "anonymous");
28
+ const tenant = caller.principal.tenant;
29
+ try {
30
+ const principal = await loadPrincipal(principals, principalId, tenant);
31
+ if (principal === null) return deniedFor(permission, "anonymous");
32
+ const target = await create(principal, tenant);
33
+ if (tenant !== void 0 && target.subject.principal?.tenant !== tenant && (principal.kind !== "contact" || target.tenants().length > 0)) return deniedFor(permission, "tenant-mismatch");
34
+ if (row !== void 0) await target.prefetchRelations(permission, [row]);
35
+ return target.decide(permission, row, PEEK);
36
+ } catch {
37
+ return deniedFor(permission, "anonymous");
38
+ }
39
+ }
40
+ //#endregion
41
+ //#region src/core/may-use.ts
42
+ function delegationMayCover(permission, delegation, hasActor) {
43
+ return [void 0, ...[...delegation?.access ?? [], ...delegation?.authorizationDetails ?? []].flatMap((entry) => typeof entry === "object" && entry !== null && typeof entry["identifier"] === "string" ? [entry["identifier"]] : [])].some((id) => coveredByDelegation(permission, delegation, id, hasActor) === void 0);
44
+ }
45
+ function blocksEveryRow(grant) {
46
+ return grant.effect === "deny" && grant.where === void 0 && grant.check === void 0 && grant.portable !== false && grant.fields === void 0 && (grant.scope === void 0 || grant.scope === "tenant");
47
+ }
48
+ function withinDelegation(permdock, permission, ceiling) {
49
+ return (ceiling === void 0 || ceiling.includes(permission.key)) && !readOnlyActorRefuses(permdock.subject.actor, permission) && delegationMayCover(permission, permdock.subject.delegation, permdock.subject.actor !== void 0 && ceiling === void 0);
50
+ }
51
+ /**
52
+ * Whether the subject's delegation, its delegated ceiling and a read-only actor
53
+ * leave `permission` within reach, whatever the grants say. A hint, never a
54
+ * decision.
55
+ */
56
+ function delegationAllows(permdock, permission) {
57
+ try {
58
+ const snapshot = permdock.snapshot();
59
+ return "grants" in snapshot && withinDelegation(permdock, permission, snapshot.delegated);
60
+ } catch {
61
+ return false;
62
+ }
63
+ }
64
+ /**
65
+ * Whether `permission` could be granted to this instance's subject for some
66
+ * row: the grants its snapshot carries for the active tenant, minus an
67
+ * unconditional deny, within its delegation. A listing hint for tools and
68
+ * skills, never a decision; the call itself is decided in full.
69
+ */
70
+ function mayUse(permdock, permission) {
71
+ try {
72
+ const snapshot = permdock.snapshot();
73
+ if (!("grants" in snapshot) || !withinDelegation(permdock, permission, snapshot.delegated)) return false;
74
+ const tenant = permdock.subject.principal?.tenant;
75
+ const scopes = scopeList(snapshot.scopes);
76
+ const grants = snapshot.grants.filter((grant) => {
77
+ if (grant.permission !== permission.key) return false;
78
+ const owner = grant.membership === void 0 ? void 0 : tenantOf(grant.membership, scopes);
79
+ return owner === void 0 || owner === tenant;
80
+ });
81
+ if (grants.some(blocksEveryRow)) return false;
82
+ return grants.some((grant) => grant.effect === "allow");
83
+ } catch {
84
+ return false;
85
+ }
86
+ }
87
+ function isConditioned(grant) {
88
+ return grant.where !== void 0 || grant.check !== void 0 || grant.validity !== void 0 || grant.portable === false;
89
+ }
90
+ /**
91
+ * The instances of `scope` in which the subject holds `permission`, from its
92
+ * live memberships of exactly that scope, within its delegation: by default
93
+ * those with an allow that carries no row condition (`where`, `check`, a
94
+ * validity window or a non-portable test; a `fields` limit is not a row
95
+ * condition), minus the instances any deny of the permission reaches. The
96
+ * in-process mirror of the SQL `permitted_<scope>_ids_by_permission`. With
97
+ * `conditioned: true` it also lists the instances where a conditioned allow
98
+ * applies, minus only unconditional denies, as
99
+ * `permitted_<scope>_ids_by_permission(p_permission, true)` does. A listing,
100
+ * never a decision: a row's own check still runs `can`.
101
+ */
102
+ function permittedIds(permdock, permission, scope, options = {}) {
103
+ try {
104
+ const snapshot = permdock.snapshot({ tenants: "all" });
105
+ if (!("grants" in snapshot)) return [];
106
+ const scopes = scopeList(snapshot.scopes);
107
+ const name = resolveScope(scopes, scope);
108
+ if (name === void 0 || !withinDelegation(permdock, permission, snapshot.delegated)) return [];
109
+ const conditioned = options.conditioned === true;
110
+ const now = nowSeconds();
111
+ const allowed = /* @__PURE__ */ new Set();
112
+ const denied = /* @__PURE__ */ new Set();
113
+ for (const grant of snapshot.grants) {
114
+ const membership = grant.membership;
115
+ if (grant.permission !== permission.key || grant.scope !== name || membership?.scope !== name || membership.id === void 0 || isMembershipExpired(membership, now) || options.within !== void 0 && tenantOf(membership, scopes) !== options.within) continue;
116
+ if (grant.effect === "deny") {
117
+ if (!conditioned || !isConditioned(grant)) denied.add(membership.id);
118
+ } else if ((conditioned || !isConditioned(grant)) && isActive(readWireValidity(grant.validity), now)) allowed.add(membership.id);
119
+ }
120
+ return [...allowed].filter((id) => !denied.has(id)).toSorted();
121
+ } catch {
122
+ return [];
123
+ }
124
+ }
125
+ //#endregion
126
+ export { deniedFor as a, decideForTarget as i, mayUse as n, permittedIds as r, delegationAllows as t };
@@ -1,14 +1,14 @@
1
- import { $ as JwtClaims, D as Policy, hr as Delegation, vt as TokenVerifier, xr as Subject, yr as Principal } from "../policy-types-rNfz7t0M.js";
1
+ import { $ as JwtClaims, D as Policy, hr as Delegation, vt as TokenVerifier, xr as Subject, yr as Principal } from "../policy-types-CCBrL7me.js";
2
2
  import { w as Permission } from "../vocabulary-DeZvUaTw.js";
3
- import { m as ApprovalStore } from "../types-ZfjQB0KC.js";
4
- import { t as ApprovalHint } from "../errors-D_JIQJYb.js";
5
- import { t as InstanceOptions } from "../instance-options-C6gEDOts.js";
3
+ import { m as ApprovalStore } from "../types-CAp7UGiB.js";
4
+ import { t as ApprovalHint } from "../errors-CXxQwtbZ.js";
5
+ import { t as InstanceOptions } from "../instance-options-BDHB3qBG.js";
6
6
  import { t as RequestContext } from "../request-context-C2_1lchh.js";
7
- import { n as PermDockWrap } from "../wrap-B-k2qHJx.js";
8
- import { o as OtelWrap } from "../types-_pi9kxS2.js";
9
- import { n as DeniedTextEvent, t as DeniedText } from "../denied-text-BXQkWU7d.js";
7
+ import { n as PermDockWrap } from "../wrap-CVBPIuEs.js";
8
+ import { o as OtelWrap } from "../types-CXUwgZ3d.js";
9
+ import { n as DeniedTextEvent, t as DeniedText } from "../denied-text-BTMxIn5W.js";
10
10
  import { t as ClientNames } from "../clients-C_NOET3z.js";
11
- import { U as JwtSubjectOptions } from "../types-Cq2rvv-C.js";
11
+ import { U as JwtSubjectOptions } from "../types-CdXM6qPc.js";
12
12
  import { CacheHint, Icon, McpServer, PromptCallback, ReadResourceCallback, ReadResourceTemplateCallback, RegisteredPrompt, RegisteredResource, RegisteredResourceTemplate, RegisteredTool, ResourceMetadata, ResourceTemplate, ScopeChallengeHandler, StandardSchemaWithJSON, ToolAnnotations, ToolCallback, Variables } from "@modelcontextprotocol/server";
13
13
  //#region src/mcp/types.d.ts
14
14
  /**
package/dist/mcp/index.js CHANGED
@@ -3,18 +3,18 @@ import { n as freezeDeep } from "../freeze-jjan0lCv.js";
3
3
  import { i as stepUpOf, o as statusProblem } from "../problem-details-CLDgX1KV.js";
4
4
  import { n as describe } from "../describe-BZAlPHxT.js";
5
5
  import { c as listPermissions, m as annotationsFor } from "../permission-registry-B8tYxPIt.js";
6
- import { a as actorMayCallTool } from "../condition-evaluate-bVVRSdzq.js";
6
+ import { t as actorMayCallTool } from "../delegation-CrdqnesZ.js";
7
7
  import { n as resourceRef } from "../resource-ref-CaS9yVPi.js";
8
- import { i as challengeScope, o as hasScope, s as scopesReaching } from "../permdock-B5LyNVgn.js";
8
+ import { i as challengeScope, o as hasScope, s as scopesReaching } from "../permdock-HfTF99xX.js";
9
9
  import { t as anonymousSubject } from "../subject-C7RddW0G.js";
10
10
  import { r as withApp } from "../app-DIvM65Mv.js";
11
- import { t as composeWraps } from "../wrap-BKU5Arsu.js";
11
+ import { t as composeWraps } from "../wrap-C5PWzgkq.js";
12
12
  import { t as instanceOptions } from "../instance-options-URVwqpMW.js";
13
13
  import { t as clientNameOf } from "../clients-DYr3U86j.js";
14
14
  import { r as mapClaimsToSubject } from "../map-claims-CAa_bQt9.js";
15
- import { l as problemResponse, o as methodNotAllowed, r as bearerChallenge, u as protectedResourceMetadataUrl } from "../problem-BWP1l86g.js";
15
+ import { l as problemResponse, o as methodNotAllowed, r as bearerChallenge, u as protectedResourceMetadataUrl } from "../problem-CPB8kqk7.js";
16
16
  import { t as decideAll } from "../decide-set-DXEPepY1.js";
17
- import { i as refusalText, n as createAgentKernel } from "../kernel-NmxiWII2.js";
17
+ import { i as refusalText, n as createAgentKernel } from "../kernel-BY3rVRs2.js";
18
18
  import { t as boundedMap } from "../lru-8q4WZjBV.js";
19
19
  import { n as delegationFrom, t as authorizationDetailsOf } from "../delegation-input-DcXhiMkf.js";
20
20
  import { n as deniedToolRefusal, r as toolErrorResult, t as approvalToolRefusal } from "../tool-refusal-D4spOJ7I.js";
@@ -0,0 +1,68 @@
1
+ import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
2
+ import { g as secondsOf, m as rfc3339 } from "./time-nR1JesoH.js";
3
+ import { n as parseSnapshot } from "./snapshot-BcHYtUIg.js";
4
+ //#region src/core/snapshot-sign.ts
5
+ /**
6
+ * The claims `signSnapshot` signs for `snapshot`. `issuedAt` and `expiresAt`
7
+ * become `iat` and `exp` and leave the `snapshot` claim, so the registered
8
+ * claims are the only times a verifier reads.
9
+ */
10
+ function snapshotClaims(snapshot) {
11
+ const { issuedAt, expiresAt, ...claim } = snapshot;
12
+ const iat = secondsOf(issuedAt);
13
+ return compact({
14
+ snapshot: claim,
15
+ sub: snapshot.subject.principal?.id,
16
+ iat: iat === void 0 || iat <= 0 ? void 0 : iat,
17
+ exp: secondsOf(expiresAt)
18
+ });
19
+ }
20
+ /**
21
+ * Signs `snapshot` as a `vnd.permdock.snapshot+jwt` with the claims
22
+ * `snapshotClaims` answers.
23
+ */
24
+ function signSnapshot(snapshot, signer, options = {}) {
25
+ const { iat, exp, ...payload } = snapshotClaims(snapshot);
26
+ return signer.sign(payload, compact({
27
+ typ: "vnd.permdock.snapshot+jwt",
28
+ audience: options.audience,
29
+ issuedAt: iat,
30
+ expiresAt: exp
31
+ }));
32
+ }
33
+ /**
34
+ * The `snapshot` claim of verified claims with `issuedAt` and `expiresAt` taken
35
+ * from `iat` and `exp`; `undefined` when the claim is not an object.
36
+ */
37
+ function snapshotClaim(claims) {
38
+ const claim = claims["snapshot"];
39
+ if (!isRecord(claim)) return;
40
+ const { issuedAt: _issuedAt, expiresAt: _expiresAt, ...rest } = claim;
41
+ return compact({
42
+ ...rest,
43
+ issuedAt: rfc3339(typeof claims.iat === "number" ? claims.iat : 0),
44
+ expiresAt: typeof claims.exp === "number" ? rfc3339(claims.exp) : void 0
45
+ });
46
+ }
47
+ /**
48
+ * The snapshot a verified `vnd.permdock.snapshot+jwt` carries, parsed as
49
+ * `parseSnapshot` parses it, with `issuedAt` and `expiresAt` from `iat` and
50
+ * `exp`. `null` when the claim is missing or not a valid snapshot.
51
+ */
52
+ function snapshotFromClaims(claims) {
53
+ const claim = snapshotClaim(claims);
54
+ if (claim === void 0) return null;
55
+ try {
56
+ return parseSnapshot(claim);
57
+ } catch {
58
+ return null;
59
+ }
60
+ }
61
+ //#endregion
62
+ //#region src/core/membership-filter.ts
63
+ function filterMemberships(memberships, filter) {
64
+ if (filter?.via === void 0 && filter?.scope === void 0) return memberships;
65
+ return memberships.filter((entry) => (filter.via === void 0 || entry.via === filter.via) && (filter.scope === void 0 || (entry.scope ?? entry.on?.resource) === filter.scope));
66
+ }
67
+ //#endregion
68
+ export { snapshotFromClaims as a, snapshotClaims as i, signSnapshot as n, snapshotClaim as r, filterMemberships as t };
@@ -1,9 +1,9 @@
1
- import { D as Policy, yr as Principal } from "../policy-types-rNfz7t0M.js";
1
+ import { D as Policy, yr as Principal } from "../policy-types-CCBrL7me.js";
2
2
  import { w as Permission } from "../vocabulary-DeZvUaTw.js";
3
- import { a as PermDock } from "../permdock-BaB-KQqn.js";
3
+ import { a as PermDock } from "../permdock-vD3mwLSm.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--_Hann81.js";
6
- import { t as ServerAdapterOptions } from "../bind-CnOMjazH.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-CtJSDhOv.js";
6
+ import { t as ServerAdapterOptions } from "../bind-N5jf6kjk.js";
7
7
  import { r as sendResponse, t as NodeRequest } from "../http-B_LphE5Y.js";
8
8
  import { CanActivate, DynamicModule, ExceptionFilter, ExecutionContext, Type } from "@nestjs/common";
9
9
  //#region src/nest/http.d.ts
@@ -1,10 +1,10 @@
1
1
  import { t as compact } from "../compact-CAf557ZB.js";
2
2
  import { n as PermDockValidationError } from "../validation-error-CYg2kJEw.js";
3
3
  import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "../errors-ynga1EQy.js";
4
- import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-BzTDWO4m.js";
4
+ import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-Bj5xw0EM.js";
5
5
  import { c as writeReply, r as hasCredentials } from "../http-DKLXrFGk.js";
6
- import { a as socketConnection, r as bindKernel } from "../bind-B4Z0U2Gr.js";
7
- import { t as problemFromError } from "../map-error-p4ROJ_26.js";
6
+ import { a as socketConnection, r as bindKernel } from "../bind-Cx10JuJ-.js";
7
+ import { t as problemFromError } from "../map-error-BCdb2Nrp.js";
8
8
  import { a as onRevoked, n as closeReason, t as POLICY_VIOLATION } from "../stream-DQ3rbO3J.js";
9
9
  import { n as sendResponse, r as toRequest$1, t as isServerResponse } from "../http-DH94eh6f.js";
10
10
  import { Catch, Controller, Get, Inject, Injectable, Module, Post, Req, Res, createParamDecorator } from "@nestjs/common";
@@ -1,14 +1,14 @@
1
- import { D as Policy, N as PolicyVocabulary, Q as Intent, Qn as DenialReason, Yn as Decision, an as SnapshotTenants, en as Snapshot, xr as Subject, yr as Principal } from "../policy-types-rNfz7t0M.js";
1
+ import { D as Policy, N as PolicyVocabulary, Q as Intent, Qn as DenialReason, Yn as Decision, an as SnapshotTenants, en as Snapshot, xr as Subject, yr as Principal } from "../policy-types-CCBrL7me.js";
2
2
  import { w as Permission } from "../vocabulary-DeZvUaTw.js";
3
- import { M as PermissionCheck, N as PermissionState, a as PermDock, d as UncheckedData, s as RowData } from "../permdock-BaB-KQqn.js";
4
- import { m as ApprovalStore } from "../types-ZfjQB0KC.js";
5
- import { t as InstanceOptions } from "../instance-options-C6gEDOts.js";
6
- import { n as PermDockWrap } from "../wrap-B-k2qHJx.js";
7
- import { o as OtelWrap } from "../types-_pi9kxS2.js";
8
- import { n as DescribeMessages } from "../describe-DVobr5FX.js";
9
- import { a as snapshotHeaders, i as cacheLifeFor, n as SnapshotHeaders, o as snapshotKey, r as SnapshotHeadersOptions, s as snapshotTag, t as CacheLifeForOptions } from "../snapshot-cache-Cc7VNabe.js";
10
- import { v as ActionResult, y as ProtectedAction } from "../store-DSyjHD5-.js";
11
- import { n as PermDockProviderProps } from "../types-BpxdxaRD.js";
3
+ import { M as PermissionCheck, N as PermissionState, a as PermDock, d as UncheckedData, s as RowData } from "../permdock-vD3mwLSm.js";
4
+ import { m as ApprovalStore } from "../types-CAp7UGiB.js";
5
+ import { t as InstanceOptions } from "../instance-options-BDHB3qBG.js";
6
+ import { n as PermDockWrap } from "../wrap-CVBPIuEs.js";
7
+ import { o as OtelWrap } from "../types-CXUwgZ3d.js";
8
+ import { n as DescribeMessages } from "../describe-CazEjtOH.js";
9
+ import { a as snapshotHeaders, i as cacheLifeFor, n as SnapshotHeaders, o as snapshotKey, r as SnapshotHeadersOptions, s as snapshotTag, t as CacheLifeForOptions } from "../snapshot-cache-BnXMcJbK.js";
10
+ import { b as ProtectedAction, y as ActionResult } from "../store-core-CDabEiO9.js";
11
+ import { n as PermDockProviderProps } from "../types-BSGrzDPi.js";
12
12
  import { ReactElement, ReactNode } from "react";
13
13
  import { StandardSchemaV1 } from "@standard-schema/spec";
14
14
  //#region src/next/types.d.ts