permdock 0.5.0 → 0.6.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 (281) hide show
  1. package/dist/a2a/index.d.ts +5 -5
  2. package/dist/a2a/index.js +3 -3
  3. package/dist/{adoption-scan-B4R5fnMU.js → adoption-scan-DCYe60Pi.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 +4 -4
  7. package/dist/ai-sdk/index.js +3 -3
  8. package/dist/{approval-prompt-Djo_PyZc.d.ts → approval-prompt-DvSSPQJX.d.ts} +2 -2
  9. package/dist/approvals/index.d.ts +3 -3
  10. package/dist/approvals/index.js +3 -3
  11. package/dist/{approvals-DJ6Yd5z1.js → approvals-p1PGoVjb.js} +3 -3
  12. package/dist/{arazzo-B6lebmiQ.js → arazzo-41WuzHou.js} +1 -1
  13. package/dist/{arazzo-BWhNF-k0.js → arazzo-CaUVBn7D.js} +2 -2
  14. package/dist/astro/index.d.ts +6 -6
  15. package/dist/astro/index.js +2 -2
  16. package/dist/{audience-Dg8XsRaO.js → audience-DabClFLQ.js} +1 -1
  17. package/dist/authzen/index.d.ts +4 -4
  18. package/dist/authzen/index.js +2 -2
  19. package/dist/{automation-BMZPIVUM.d.ts → automation-BNM3TtDo.d.ts} +3 -3
  20. package/dist/better-auth/index.d.ts +2 -2
  21. package/dist/better-auth/index.js +1 -1
  22. package/dist/better-supabase/index.d.ts +7 -7
  23. package/dist/better-supabase/index.js +6 -6
  24. package/dist/{bind-CZzhx-Vj.js → bind-CAvgUuKs.js} +4 -4
  25. package/dist/{bind--9EFVYWF.d.ts → bind-DOyrv6zi.d.ts} +7 -7
  26. package/dist/{build-instance-BMnAudHn.js → build-instance-Bu_eDqYw.js} +1 -1
  27. package/dist/{capability-BSslw1QV.d.ts → capability-Drg-1YhL.d.ts} +2 -2
  28. package/dist/catalog/index.d.ts +5 -5
  29. package/dist/catalog/index.js +3 -3
  30. package/dist/catalog-BoWglDPI.js +1 -0
  31. package/dist/{catalog-R_A__RsH.js → catalog-DZVbrF-z.js} +1 -1
  32. package/dist/{catalog-BECMPrwc.js → catalog-HD2gf5mY.js} +2 -2
  33. package/dist/{catalog-doc-C9wjsfNY.js → catalog-doc-Cdn7-0pQ.js} +1 -1
  34. package/dist/chat/index.d.ts +1 -1
  35. package/dist/chat/index.js +2 -2
  36. package/dist/chat-sdk/index.d.ts +3 -3
  37. package/dist/claude-agent/index.d.ts +3 -3
  38. package/dist/claude-agent/index.js +2 -2
  39. package/dist/clerk/index.d.ts +3 -3
  40. package/dist/cli/bin.js +1 -1
  41. package/dist/cli/index.d.ts +3 -3
  42. package/dist/cli/index.js +2 -2
  43. package/dist/cloud/index.d.ts +8 -8
  44. package/dist/cloud/index.js +1 -1
  45. package/dist/{cloud-CIoHNevm.js → cloud-ytQ3uviA.js} +2 -2
  46. package/dist/{codemod-Bmj9dWMH.js → codemod-5mpSpnUY.js} +2 -2
  47. package/dist/{codemod-Cxvvc70T.js → codemod-ua2hHy7w.js} +1 -1
  48. package/dist/{collect-DloHbDVa.js → collect-Ci6akVwH.js} +2 -2
  49. package/dist/collect-D7eQDffE.js +1 -0
  50. package/dist/{collect-CrZJJnEF.js → collect-mLTY4nwb.js} +2 -2
  51. package/dist/compile/index.d.ts +1 -1
  52. package/dist/{compile-Ckm2HqBZ.d.ts → compile-1bsAezL0.d.ts} +3 -3
  53. package/dist/{completion-BqhRBJD8.js → completion-BTFrHZhX.js} +1 -1
  54. package/dist/{config-B46rm9sc.js → config-Bj2Ixq3d.js} +1 -1
  55. package/dist/{config-report-DUgj62Ai.js → config-report-DSpsLpCE.js} +2 -2
  56. package/dist/{context-bbFHR-0D.js → context-B_u3_bDJ.js} +2 -2
  57. package/dist/convex/index.d.ts +5 -5
  58. package/dist/convex/index.js +2 -2
  59. package/dist/{create-0VZ7Pdiu.d.ts → create-B30OMUOJ.d.ts} +5 -5
  60. package/dist/{create-BDS7wc3y.d.ts → create-CBMmFie-.d.ts} +9 -9
  61. package/dist/{create-C3b4B5eF.js → create-CGm28gyI.js} +4 -4
  62. package/dist/{create-BWRSXgOF.js → create-CQWIpUG-.js} +1 -1
  63. package/dist/{create-DnrmLnLW.js → create-DCF2SvoT.js} +4 -4
  64. package/dist/{create-BFfm17UA.d.ts → create-D_NmPOdH.d.ts} +7 -7
  65. package/dist/{credential-DM2um3ha.js → credential-BcoiejpY.js} +2 -2
  66. package/dist/{delegation-DaXVdDhM.js → delegation-j6-rc37o.js} +2 -2
  67. package/dist/delivery/index.d.ts +4 -4
  68. package/dist/delivery/index.js +1 -1
  69. package/dist/{denied-text-D8jDHgsl.d.ts → denied-text-CiFQNuMV.d.ts} +2 -2
  70. package/dist/{describe-BZUsixiL.d.ts → describe-B5qgDvEW.d.ts} +2 -2
  71. package/dist/{diff-DCePiN6M.js → diff-3jbx6Rm4.js} +3 -3
  72. package/dist/{diff-CxZo9pTq.js → diff-CmuSD3vc.js} +1 -1
  73. package/dist/{doctor-CxiwSfqH.js → doctor-3ZqNHX_G.js} +2 -2
  74. package/dist/{doctor-DFjUxf2f.js → doctor-BdZw53-k.js} +14 -14
  75. package/dist/drizzle/index.d.ts +3 -3
  76. package/dist/elysia/index.d.ts +5 -5
  77. package/dist/elysia/index.js +3 -3
  78. package/dist/{errors-C2PXIv4c.d.ts → errors-DH5QEGXh.d.ts} +2 -2
  79. package/dist/{evaluate-_R8QkWaf.js → evaluate-CNClBvcj.js} +81 -28
  80. package/dist/{evaluations-16UqqQ6W.d.ts → evaluations-C_1vdSZc.d.ts} +3 -3
  81. package/dist/{evaluations-DZ2CbV5k.js → evaluations-beAooV0n.js} +1 -1
  82. package/dist/eve/index.d.ts +5 -5
  83. package/dist/eve/index.js +3 -3
  84. package/dist/express/index.d.ts +5 -5
  85. package/dist/express/index.js +3 -3
  86. package/dist/fastify/index.d.ts +5 -5
  87. package/dist/fastify/index.js +3 -3
  88. package/dist/{fetch-adapter-g0ypLkID.js → fetch-adapter-DD_gfmrC.js} +2 -2
  89. package/dist/{fetch-adapter-qKJBuRqy.d.ts → fetch-adapter-Dw0MTS3D.d.ts} +4 -4
  90. package/dist/{fields-D9tPVUUS.js → fields-OYG_JR78.js} +3 -3
  91. package/dist/{from-snapshot-D2lZt4Dd.js → from-snapshot-CTCMsFZk.js} +4 -4
  92. package/dist/{grantee-Cn1HyUsI.js → grantee-hxrUsbpM.js} +13 -3
  93. package/dist/{grantee-match-DHArqY82.js → grantee-match-DbENBHLB.js} +1 -1
  94. package/dist/h3/index.d.ts +4 -4
  95. package/dist/h3/index.js +3 -3
  96. package/dist/{helpers-DTcZOzhF.js → helpers-CBYVMjwh.js} +1 -1
  97. package/dist/hono/index.d.ts +5 -5
  98. package/dist/hono/index.js +3 -3
  99. package/dist/{hosted-BZIAYvon.js → hosted-B46-5LYE.js} +3 -3
  100. package/dist/{hosted-DBDX0M-P.d.ts → hosted-BPk51-kX.d.ts} +1 -1
  101. package/dist/{import-DMmOG27O.js → import-wyqXUyjm.js} +3 -3
  102. package/dist/{index-Chrs5fQ-.d.ts → index-B8YjkEZ4.d.ts} +6 -6
  103. package/dist/{index-CxGUswIC.d.ts → index-C-6Letxg.d.ts} +5 -5
  104. package/dist/{index-SGdIQyzc.d.ts → index-Ch8LpNDp.d.ts} +2 -2
  105. package/dist/{index-D8EovfsP.d.ts → index-Cp_ilKi1.d.ts} +2 -2
  106. package/dist/{index-BcHcPyIo.d.ts → index-CueFnxQc.d.ts} +6 -6
  107. package/dist/{index-DOVf7RJv.d.ts → index-DuWxc5dt.d.ts} +21 -12
  108. package/dist/index.d.ts +17 -17
  109. package/dist/index.js +14 -14
  110. package/dist/{instance-options-Omfd793B.d.ts → instance-options-BsVpyGIk.d.ts} +1 -1
  111. package/dist/{instance-snapshot-Cxq4ygFc.js → instance-snapshot-BOEhcqIF.js} +10 -9
  112. package/dist/jwt/index.d.ts +4 -4
  113. package/dist/{kernel-5JatXyND.js → kernel-D0NVb1cK.js} +5 -5
  114. package/dist/kysely/index.d.ts +3 -3
  115. package/dist/{manifest-CtKR3GXL.js → manifest-dvL2XEe1.js} +23 -23
  116. package/dist/{map-error-TCAdw-eW.js → map-error-Dr70oA_3.js} +1 -1
  117. package/dist/mcp/index.d.ts +9 -9
  118. package/dist/mcp/index.js +4 -4
  119. package/dist/{migrate-BShP7Vf4.js → migrate-CIq4-E9F.js} +1 -1
  120. package/dist/nest/index.d.ts +5 -5
  121. package/dist/nest/index.js +3 -3
  122. package/dist/next/index.d.ts +9 -9
  123. package/dist/next/index.js +3 -3
  124. package/dist/next/plugin.d.ts +1 -1
  125. package/dist/next/plugin.js +1 -1
  126. package/dist/node/index.d.ts +5 -5
  127. package/dist/node/index.js +2 -2
  128. package/dist/openai/index.d.ts +5 -5
  129. package/dist/openai/index.js +3 -3
  130. package/dist/openapi/index.d.ts +3 -3
  131. package/dist/{openapi-ahr8rHu3.js → openapi-C4dDTVEd.js} +1 -1
  132. package/dist/{openapi-DTaEmTSW.js → openapi-DD1SV-5-.js} +1 -1
  133. package/dist/{operations-CxybZErY.d.ts → operations-X0VM7F3m.d.ts} +1 -1
  134. package/dist/orpc/index.d.ts +6 -6
  135. package/dist/orpc/index.js +3 -3
  136. package/dist/otel/index.d.ts +3 -3
  137. package/dist/{output-Dyw8fyPF.js → output-1im__-08.js} +1 -1
  138. package/dist/{ownership-BatFgAA4.js → ownership-DqaJNJPn.js} +921 -858
  139. package/dist/{parse-local-manifest-DgqtruPn.d.ts → parse-local-manifest-5ODwqu8b.d.ts} +1 -1
  140. package/dist/pdp/index.d.ts +3 -3
  141. package/dist/pdp/index.js +1 -1
  142. package/dist/{permdock-B9JxkBwC.js → permdock-BrAscV28.js} +5 -5
  143. package/dist/{permdock-D7eeLJER.d.ts → permdock-SV8ZINYT.d.ts} +4 -4
  144. package/dist/{permissions-CZKiUfFM.js → permissions-BPxlwVhN.js} +2 -2
  145. package/dist/{permissions-oEWfl-kl.d.ts → permissions-u_KHg-sN.d.ts} +1 -1
  146. package/dist/{policies-CO1oOymN.js → policies-DP2nqRoF.js} +1 -1
  147. package/dist/{policy-Czo4n3Hs.d.ts → policy-77FSAq_V.d.ts} +2 -2
  148. package/dist/{policy-DLZJ5gAp.js → policy-DbM5YYtV.js} +2 -2
  149. package/dist/{policy-from-catalog-DzhEc3Y9.js → policy-from-catalog-C2gMa2Dj.js} +5 -5
  150. package/dist/{policy-types-DzwivBgR.d.ts → policy-types-n0uRTsW8.d.ts} +28 -3
  151. package/dist/{postgrest-NUqZT-RB.d.ts → postgrest-CEgRbefE.d.ts} +1 -1
  152. package/dist/{postgrest-CW0IqC-U.js → postgrest-DAjUkF9w.js} +10 -1
  153. package/dist/{powersync-bYUDLOAO.js → powersync-BkWWCS1K.js} +6 -6
  154. package/dist/{powersync-BHfuehf3.js → powersync-DISt6SUe.js} +2 -2
  155. package/dist/powersync-MMJ2mI2q.js +1 -0
  156. package/dist/prisma/index.d.ts +2 -2
  157. package/dist/{problem-details-DXlt-vks.d.ts → problem-details-B45V5d2b.d.ts} +1 -1
  158. package/dist/{protected-DfjY5mLA.js → protected-BlF0F6wL.js} +1 -1
  159. package/dist/{protected-DEPHc2xV.d.ts → protected-RFGpakN9.d.ts} +5 -5
  160. package/dist/{provider-CC-u3bYP.js → provider-B1al-AZz.js} +2 -2
  161. package/dist/{provider-DMVt6yYn.d.ts → provider-DILL9oPK.d.ts} +1 -1
  162. package/dist/{provider-store-B5Yrkhzr.js → provider-store-DM6DNcta.js} +2 -2
  163. package/dist/pull-CvpINcMK.js +1 -0
  164. package/dist/{pull-BgIfno6w.js → pull-jEwbf80J.js} +1 -1
  165. package/dist/{push-CmFVBOeI.js → push-BD4f15co.js} +2 -2
  166. package/dist/{pushed-policy-DobP7AHI.js → pushed-policy-CqtxkV4G.js} +1 -1
  167. package/dist/{pushed-policy-BImMTTIM.d.ts → pushed-policy-DCW91KQU.d.ts} +1 -1
  168. package/dist/react/index.d.ts +6 -6
  169. package/dist/react/index.js +2 -2
  170. package/dist/react/provider-client.d.ts +1 -1
  171. package/dist/react/provider-client.js +1 -1
  172. package/dist/react-native/index.d.ts +9 -9
  173. package/dist/react-native/index.js +10 -8
  174. package/dist/{replay-D7iKcLFe.d.ts → replay-Bkm-Ne4l.d.ts} +1 -1
  175. package/dist/{request-context-BTRTG7OT.js → request-context-C81Pip9n.js} +1 -1
  176. package/dist/resend/index.d.ts +4 -4
  177. package/dist/{rls-BA8an5Ap.js → rls-BAqP4q66.js} +1 -1
  178. package/dist/{rls-j6t43t7n.js → rls-DTvYd-lI.js} +12 -12
  179. package/dist/{role-builder-CXbis5-X.js → role-builder-uWQZ4v84.js} +1 -1
  180. package/dist/{rpc-aPyNi6tA.js → rpc-VSl5ylaQ.js} +1 -1
  181. package/dist/{run-DOfMtc9V.js → run-CUKuz0A8.js} +2 -2
  182. package/dist/run-DDwUaJDU.js +1 -0
  183. package/dist/{run-ticket-BjhTOi6u.d.ts → run-ticket-DocwaTKn.d.ts} +2 -2
  184. package/dist/{saas-FO-Q8oj0.js → saas-BCXRuXca.js} +5 -5
  185. package/dist/{scan-BOI5tJ-6.js → scan-qvOe0hS3.js} +1 -1
  186. package/dist/scim/index.d.ts +1 -1
  187. package/dist/server/index.d.ts +10 -10
  188. package/dist/server/index.js +4 -4
  189. package/dist/{server-DqCT4CgZ.js → server-C3WXAHZj.js} +1 -1
  190. package/dist/{server-types-BLd4MnBX.d.ts → server-types-CKQiCnON.d.ts} +9 -9
  191. package/dist/{shared-CD11nBbC.js → shared-BAK8t4Uo.js} +2 -1
  192. package/dist/{sink-Bj_lDUDq.d.ts → sink-4-eQIRWf.d.ts} +4 -4
  193. package/dist/{snapshot-CXUWfsNy.js → snapshot-B7DkYg6g.js} +1 -1
  194. package/dist/{snapshot-cache-DqK9eDmM.d.ts → snapshot-cache-PXI-vGpY.d.ts} +1 -1
  195. package/dist/solid/index.d.ts +5 -5
  196. package/dist/solid/index.js +2 -2
  197. package/dist/solid-start/index.d.ts +6 -6
  198. package/dist/solid-start/index.js +3 -3
  199. package/dist/{sources-BV9j0DeZ.d.ts → sources-Xc4zkszI.d.ts} +2 -2
  200. package/dist/{src-DLfUWFAI.js → src-Cu2m75uo.js} +24 -15
  201. package/dist/ssf/index.d.ts +3 -3
  202. package/dist/ssf/index.js +1 -1
  203. package/dist/{standard-webhooks-6lg8v_is.d.ts → standard-webhooks-rbD7LS6h.d.ts} +2 -2
  204. package/dist/{store-4u_hxjWa.js → store-BDutJkDL.js} +1 -1
  205. package/dist/{store-options-BqEakYRa.js → store-options-u0ycEe8s.js} +4 -4
  206. package/dist/{stores-ClZUgeoP.d.ts → stores-BUGNbJTt.d.ts} +5 -5
  207. package/dist/{stores-BbsD4fAR.js → stores-CGhM8BN_.js} +1 -1
  208. package/dist/{stream-7-xmnf3U.d.ts → stream-CeCMJmBB.d.ts} +2 -2
  209. package/dist/supabase/index.d.ts +5 -5
  210. package/dist/supabase/index.js +2 -2
  211. package/dist/supabase/middleware.d.ts +6 -6
  212. package/dist/supabase/middleware.js +5 -5
  213. package/dist/{supabase-9pqI57pW.js → supabase-By_frk3U.js} +2 -2
  214. package/dist/{supabase-hook-DdDQhMlw.js → supabase-hook-BMoEhZir.js} +14 -9
  215. package/dist/supabase-hook-CCw5m35C.js +1 -0
  216. package/dist/{supabase-Dxlp8A94.js → supabase-x5JtR2tc.js} +3 -3
  217. package/dist/svelte/index.d.ts +5 -5
  218. package/dist/svelte/index.js +2 -2
  219. package/dist/svelte/runtime.d.ts +3 -3
  220. package/dist/svelte/runtime.js +1 -1
  221. package/dist/svelte/source.d.ts +5 -5
  222. package/dist/svelte/source.js +1 -1
  223. package/dist/sveltekit/index.d.ts +6 -6
  224. package/dist/sveltekit/index.js +2 -2
  225. package/dist/tanstack-start/index.d.ts +6 -6
  226. package/dist/tanstack-start/index.js +2 -2
  227. package/dist/terminal/index.d.ts +6 -6
  228. package/dist/terminal/index.js +3 -3
  229. package/dist/testing/index.d.ts +20 -20
  230. package/dist/testing/index.js +18 -18
  231. package/dist/testing/saas/index.d.ts +5 -5
  232. package/dist/testing/saas/index.js +2 -2
  233. package/dist/testing/saas/permissions.d.ts +1 -1
  234. package/dist/testing/saas/permissions.js +1 -1
  235. package/dist/trpc/index.d.ts +6 -6
  236. package/dist/trpc/index.js +3 -3
  237. package/dist/{types-C8-KNsFf.d.ts → types-8RnwUAvE.d.ts} +5 -5
  238. package/dist/{types-BNORmDM8.d.ts → types-B3_ooZgZ.d.ts} +4 -4
  239. package/dist/{types-CCpc2Dcv.d.ts → types-BdtSDbBO.d.ts} +2 -2
  240. package/dist/{types-DX0LaKTb.d.ts → types-BtHtcKMr.d.ts} +3 -3
  241. package/dist/{types-CdlxsYQh.d.ts → types-BzzaHxt3.d.ts} +1 -1
  242. package/dist/{types-DiQjupG2.d.ts → types-C791HFu9.d.ts} +2 -2
  243. package/dist/{types-BjV-fqcA.d.ts → types-C863OQiR.d.ts} +4 -4
  244. package/dist/{types-fbZ7JEXr.d.ts → types-CVZSNocA.d.ts} +4 -4
  245. package/dist/{types-tIgIeIKJ.d.ts → types-CX7AvRqP.d.ts} +4 -4
  246. package/dist/{types-_sHy8BQf.d.ts → types-C_IiEs64.d.ts} +1 -1
  247. package/dist/{types-5Ut_pbKy.d.ts → types-Dfv0aTER.d.ts} +4 -2
  248. package/dist/{types-CZTnPFzM.d.ts → types-Druu9wLM.d.ts} +2 -2
  249. package/dist/{types-ClZaWzfb.d.ts → types-_WhUP7ud.d.ts} +3 -3
  250. package/dist/{types-BqAKcRNW.d.ts → types-lUlG3TVd.d.ts} +2 -2
  251. package/dist/unplugin/index.d.ts +1 -1
  252. package/dist/unplugin/index.js +1 -1
  253. package/dist/{usage-DHtE8j4E.js → usage-CRVl9V3t.js} +1 -1
  254. package/dist/usage-CZpSQP6L.js +1 -0
  255. package/dist/{usage-T5mXq98v.js → usage-SveTRTyr.js} +4 -4
  256. package/dist/{validation-error-Bg5Tpluk.d.ts → validation-error-DHUrAkku.d.ts} +1 -1
  257. package/dist/{verify-DbCL9bnB.js → verify-BaAKx7t6.js} +11 -11
  258. package/dist/{vocabulary-D6lPdb4Z.d.ts → vocabulary-CN8H_9UF.d.ts} +2 -0
  259. package/dist/vue/index.d.ts +5 -5
  260. package/dist/vue/index.js +2 -2
  261. package/dist/{waiter-CKy4MQSY.d.ts → waiter-B986w1oK.d.ts} +2 -2
  262. package/dist/watch--ovlPOc0.js +1 -0
  263. package/dist/{watch-CszoTJMq.js → watch-vea54PRw.js} +1 -1
  264. package/dist/webmcp/index.d.ts +2 -2
  265. package/dist/{where-scope-Dv-WTP-w.js → where-scope-C9vfEphl.js} +2 -2
  266. package/dist/{who-can-D0QoYbEb.js → who-can-DWBAcaCQ.js} +2 -2
  267. package/dist/workflow/index.d.ts +3 -3
  268. package/dist/workflow/index.js +2 -2
  269. package/dist/workflow-sdk/index.d.ts +5 -5
  270. package/dist/{wrap-Bd1Tejur.d.ts → wrap-C5jC6sKI.d.ts} +2 -2
  271. package/package.json +2 -2
  272. package/skills/permdock-data/references/queries-and-rls.md +1 -1
  273. package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +1 -0
  274. package/dist/catalog-DjhMYYCq.js +0 -1
  275. package/dist/collect-FlXJlhus.js +0 -1
  276. package/dist/powersync-CbzkqL_M.js +0 -1
  277. package/dist/pull-ByOks_Tg.js +0 -1
  278. package/dist/run-CNsApDpd.js +0 -1
  279. package/dist/supabase-hook-CXcGpHqq.js +0 -1
  280. package/dist/usage-CHOtwL19.js +0 -1
  281. package/dist/watch-Cb-NcaUw.js +0 -1
@@ -1,4 +1,4 @@
1
- import { Bt as LocalSnapshotManifest } from "./policy-types-DzwivBgR.js";
1
+ import { Bt as LocalSnapshotManifest } from "./policy-types-n0uRTsW8.js";
2
2
  //#region src/core/parse-local-manifest.d.ts
3
3
  /**
4
4
  * Whether `value` has the shape `localSnapshotManifest(policy)` writes, with
@@ -1,6 +1,6 @@
1
- import { K as DecisionProvider, T as Policy, j as PolicyVocabulary, rr as Principal } from "../policy-types-DzwivBgR.js";
2
- import { i as PermDockOptions } from "../permdock-D7eeLJER.js";
3
- import { a as RelationMap, c as RemotePdpEndpoints, d as SpiceDbCheck, f as SpiceDbOptions, i as PdpPermDock, l as RemotePdpMapping, n as OpenFgaTuple, o as RemotePdpAuth, r as PdpFactory, s as RemotePdpCache, t as OpenFgaOptions, u as RemotePdpOptions } from "../types-ClZaWzfb.js";
1
+ import { K as DecisionProvider, T as Policy, j as PolicyVocabulary, rr as Principal } from "../policy-types-n0uRTsW8.js";
2
+ import { i as PermDockOptions } from "../permdock-SV8ZINYT.js";
3
+ import { a as RelationMap, c as RemotePdpEndpoints, d as SpiceDbCheck, f as SpiceDbOptions, i as PdpPermDock, l as RemotePdpMapping, n as OpenFgaTuple, o as RemotePdpAuth, r as PdpFactory, s as RemotePdpCache, t as OpenFgaOptions, u as RemotePdpOptions } from "../types-_WhUP7ud.js";
4
4
  //#region src/pdp/create.d.ts
5
5
  /** The PDP-aware instance, built synchronously like core `getPermDockSync`; use `getPermDock` for asynchronous inputs. */
6
6
  export declare function getPermDockSync<TUser, TPrincipal extends Principal = Principal, V extends PolicyVocabulary = PolicyVocabulary>(policy: Policy<TUser, TPrincipal, V>, user: TUser | null, options?: PermDockOptions): PdpPermDock<V>;
package/dist/pdp/index.js CHANGED
@@ -5,7 +5,7 @@ import { a as deniedMessage, i as approvalMessage, n as PermDockDeniedError, t a
5
5
  import { n as internalsOf, t as attachInternals } from "../internals-Dk8A8fX3.js";
6
6
  import { a as getResource, c as listPermissions } from "../permission-registry-Br4jSNVi.js";
7
7
  import { n as toWireDelegation } from "../wire-delegation-Cv3W2eaM.js";
8
- import { n as getPermDockSync$1, t as getPermDock$1 } from "../permdock-B9JxkBwC.js";
8
+ import { n as getPermDockSync$1, t as getPermDock$1 } from "../permdock-BrAscV28.js";
9
9
  import { a as postJson, c as ttlMs, i as joinUrl, n as denied, o as resourceIdOf, r as granted, s as ttlCache, t as cacheKey } from "../shared-DvvFzYXe.js";
10
10
  //#region src/pdp/create.ts
11
11
  function withoutProviders(policy) {
@@ -9,12 +9,12 @@ import { i as readAppData } from "./app-data-MuyzVqX8.js";
9
9
  import { a as normalizeMemberships, d as scopeList, m as tenantOf } from "./scopes-CUPSjo9q.js";
10
10
  import { o as pickVisible, s as sanitizeContext } from "./validity-CZ7-y0Cj.js";
11
11
  import { c as nowSeconds, d as resolveActiveTenant, m as tenantsOf, p as scopeField, t as heldRoleNamesIn, u as relatesTo } from "./tenancy-DN2QAx9z.js";
12
- import { l as policyX } from "./policy-DLZJ5gAp.js";
13
- import { A as isContact, C as emptyListeners, S as emitSafe, i as customRolesFor, k as contactMemberships, o as roleSourceFor, r as assignableNamesFor, s as sourceName, t as evaluate, u as customGrantsFor, w as finish } from "./evaluate-_R8QkWaf.js";
14
- import { a as whereGrant, c as applyRoleKinds, i as collectSnapshotGrants, l as audiencesOf, o as heldRoleNames, p as asMembershipSource, r as assignableIn, s as roleLeaf, t as snapshotOf } from "./instance-snapshot-Cxq4ygFc.js";
12
+ import { l as policyX } from "./policy-DbM5YYtV.js";
13
+ import { E as finish, M as isContact, T as emptyListeners, i as customRolesFor, j as contactMemberships, o as roleSourceFor, r as assignableNamesFor, s as sourceName, t as evaluate, u as customGrantsFor, w as emitSafe } from "./evaluate-CNClBvcj.js";
14
+ import { a as whereGrant, c as applyRoleKinds, i as collectSnapshotGrants, l as audiencesOf, o as heldRoleNames, p as asMembershipSource, r as assignableIn, s as roleLeaf, t as snapshotOf } from "./instance-snapshot-BOEhcqIF.js";
15
15
  import { r as relationReader, t as pendingRelations } from "./relations-BnCWnJGI.js";
16
- import { r as snapshotGrant } from "./snapshot-CXUWfsNy.js";
17
- import { i as decideForTarget, n as mayUse, o as signSnapshot, r as permittedIds, t as whereFromGrants } from "./where-scope-Dv-WTP-w.js";
16
+ import { r as snapshotGrant } from "./snapshot-B7DkYg6g.js";
17
+ import { i as decideForTarget, n as mayUse, o as signSnapshot, r as permittedIds, t as whereFromGrants } from "./where-scope-C9vfEphl.js";
18
18
  import { r as isSubject, t as anonymousSubject } from "./subject-BGoM5o8B.js";
19
19
  //#region src/core/app.ts
20
20
  const APP = Symbol.for("permdock.app");
@@ -1,7 +1,7 @@
1
- import { $n as Delegation, Bn as LimitDetail, G as CustomRoleSourceFactory, Hn as Obligation, J as EntitlementSource, Nn as Decision, Q as LimitStore, Rn as ExplainedDecision, Rt as Instant, T as Policy, Un as Quota, Vt as Snapshot, W as CustomRoleSource, Xt as DecisionEvent, _ as GrantLimit, at as SettingsSource, cn as Scope, et as MembershipSource, h as Grant, i as ApprovalOption, ir as Subject, it as RelationSource, j as PolicyVocabulary, lr as Condition, nr as Membership, q as DecisionSink, qn as Actor, qt as AuthEvent, rr as Principal, sr as AdapterId, ut as TokenSigner } from "./policy-types-DzwivBgR.js";
2
- import { N as ResourceNode, V as AppData, a as RoleTree, n as PlanTree, r as Role, w as Permission } from "./vocabulary-D6lPdb4Z.js";
3
- import { i as OperationEffect, s as OperationMeta, t as Operation, u as OperationRisk } from "./operations-CxybZErY.js";
4
- import { i as HostedPolicies } from "./hosted-DBDX0M-P.js";
1
+ import { $n as Delegation, Bn as LimitDetail, G as CustomRoleSourceFactory, Hn as Obligation, J as EntitlementSource, Nn as Decision, Q as LimitStore, Rn as ExplainedDecision, Rt as Instant, T as Policy, Un as Quota, Vt as Snapshot, W as CustomRoleSource, Xt as DecisionEvent, _ as GrantLimit, ar as Subject, at as SettingsSource, cn as Scope, cr as AdapterId, et as MembershipSource, h as Grant, i as ApprovalOption, it as RelationSource, j as PolicyVocabulary, nr as Membership, q as DecisionSink, qn as Actor, qt as AuthEvent, rr as Principal, ur as Condition, ut as TokenSigner } from "./policy-types-n0uRTsW8.js";
2
+ import { N as ResourceNode, V as AppData, a as RoleTree, n as PlanTree, r as Role, w as Permission } from "./vocabulary-CN8H_9UF.js";
3
+ import { i as OperationEffect, s as OperationMeta, t as Operation, u as OperationRisk } from "./operations-X0VM7F3m.js";
4
+ import { i as HostedPolicies } from "./hosted-BPk51-kX.js";
5
5
  //#region src/core/approval-policies.d.ts
6
6
  /**
7
7
  * One approval requirement kept as data, for a tenant or the whole platform.
@@ -1,6 +1,6 @@
1
- import { i as crud } from "./src-DLfUWFAI.js";
1
+ import { i as crud } from "./src-Cu2m75uo.js";
2
2
  import { _ as resource } from "./permission-registry-Br4jSNVi.js";
3
- import { f as definePlans, p as defineRoles } from "./grantee-Cn1HyUsI.js";
3
+ import { f as definePlans, p as defineRoles } from "./grantee-hxrUsbpM.js";
4
4
  import { t as definePermissions } from "./permissions-B-wCP5ZC.js";
5
5
  //#region src/testing/saas/schema.ts
6
6
  function accepts(kind, value) {
@@ -1,4 +1,4 @@
1
- import { C as InferPermissionTree, k as ResourceInit, r as Role, t as Plan } from "./vocabulary-D6lPdb4Z.js";
1
+ import { C as InferPermissionTree, k as ResourceInit, r as Role, t as Plan } from "./vocabulary-CN8H_9UF.js";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  //#region src/testing/saas/permissions.d.ts
4
4
  declare const SaasProjectSchema: StandardSchemaV1<SaasProject>;
@@ -1,7 +1,7 @@
1
1
  import { a as sole } from "./compact-CAf557ZB.js";
2
2
  import { i as configError, n as CliError } from "./errors-CWTY6uih.js";
3
3
  import { i as requirePeer } from "./peer-C8swJ2GH.js";
4
- import { M as qualified, _ as subjectClaimJsonSql } from "./shared-CD11nBbC.js";
4
+ import { M as qualified, _ as subjectClaimJsonSql } from "./shared-BAK8t4Uo.js";
5
5
  //#region src/cli/pg.ts
6
6
  const CONNECT_TIMEOUT_MS = 1e4;
7
7
  const STATEMENT_TIMEOUT_MS = 6e4;
@@ -1,5 +1,5 @@
1
- import { T as Policy, ir as Subject, rr as Principal } from "./policy-types-DzwivBgR.js";
2
- import { c as saasPlans, l as saasRoles, s as saasPermissions } from "./permissions-oEWfl-kl.js";
1
+ import { T as Policy, ar as Subject, rr as Principal } from "./policy-types-n0uRTsW8.js";
2
+ import { c as saasPlans, l as saasRoles, s as saasPermissions } from "./permissions-u_KHg-sN.js";
3
3
  //#region src/testing/saas/policy.d.ts
4
4
  /** Daily API-key quota per subject; the bucket should be per tenant too. */
5
5
  declare const SAAS_API_KEY_LIMIT = 5;
@@ -1,12 +1,12 @@
1
1
  import { t as compact } from "./compact-CAf557ZB.js";
2
2
  import { n as freezeDeep } from "./freeze-CrU8nQeX.js";
3
- import { c as withGrantSchema, d as assertApprovalVersions, i as completeGrant, o as flattenGrants, p as normalizeWhere, s as flattenPermissions, u as assertApprovalRelations } from "./role-builder-CXbis5-X.js";
3
+ import { c as withGrantSchema, d as assertApprovalVersions, i as completeGrant, o as flattenGrants, p as normalizeWhere, s as flattenPermissions, u as assertApprovalRelations } from "./role-builder-uWQZ4v84.js";
4
4
  import { c as listPermissions, i as getRegistry, m as annotationsFor, n as findPermission, s as isRegistryTree } from "./permission-registry-Br4jSNVi.js";
5
5
  import { d as isSelfParented, l as isFieldRelation } from "./resource-relations-D_jw0BFx.js";
6
6
  import { t as canonicalJson } from "./canonical-json-BC8_nMTw.js";
7
7
  import { r as sha256Digest } from "./sha256-D9ihqmvd.js";
8
8
  import { n as defineScopes, o as resolveScope } from "./scopes-CUPSjo9q.js";
9
- import { o as flattenGrantee, r as asGrantee, v as listRoles } from "./grantee-Cn1HyUsI.js";
9
+ import { o as flattenGrantee, r as asGrantee, v as listRoles } from "./grantee-hxrUsbpM.js";
10
10
  import { n as normalizeValidity } from "./validity-CZ7-y0Cj.js";
11
11
  import { a as relationStart, i as relationHops, n as isGraphRelation, t as inheritCondition } from "./grantee-conditions-CcXf8hMM.js";
12
12
  import { a as memberOfFields, p as scopeField, u as relatesTo } from "./tenancy-DN2QAx9z.js";
@@ -1,17 +1,17 @@
1
1
  import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
2
2
  import { n as freezeDeep } from "./freeze-CrU8nQeX.js";
3
- import { p as normalizeWhere } from "./role-builder-CXbis5-X.js";
3
+ import { p as normalizeWhere } from "./role-builder-uWQZ4v84.js";
4
4
  import { n as PermDockValidationError } from "./validation-error-ZfUHbKvf.js";
5
5
  import { _ as resource, i as getRegistry, n as findPermission } from "./permission-registry-Br4jSNVi.js";
6
6
  import { n as defineScopes } from "./scopes-CUPSjo9q.js";
7
- import { f as definePlans, p as defineRoles } from "./grantee-Cn1HyUsI.js";
7
+ import { f as definePlans, p as defineRoles } from "./grantee-hxrUsbpM.js";
8
8
  import { r as readWireValidity } from "./validity-CZ7-y0Cj.js";
9
- import { i as indexPolicy, u as normalizeDelegation } from "./policy-DLZJ5gAp.js";
10
- import { r as isPortableCondition } from "./hosted-BZIAYvon.js";
9
+ import { i as indexPolicy, u as normalizeDelegation } from "./policy-DbM5YYtV.js";
10
+ import { r as isPortableCondition } from "./hosted-B46-5LYE.js";
11
11
  import { t as definePermissions } from "./permissions-B-wCP5ZC.js";
12
12
  import { n as copyJson, t as checkSchema } from "./json-schema-B-vAwlde.js";
13
13
  import { t as parseCatalog } from "./parse-Cxq0WxrA.js";
14
- import { n as parsePushedPolicy } from "./pushed-policy-DobP7AHI.js";
14
+ import { n as parsePushedPolicy } from "./pushed-policy-CqtxkV4G.js";
15
15
  //#region src/catalog/json-schema-validator.ts
16
16
  const ANNOTATIONS = /* @__PURE__ */ new Set([
17
17
  "$schema",
@@ -1,4 +1,4 @@
1
- import { E as PermissionTree, H as AppDataSchema, N as ResourceNode, T as PermissionKind, U as MetaValue, V as AppData, a as RoleTree, i as RoleMeta, n as PlanTree, r as Role, t as Plan, w as Permission } from "./vocabulary-D6lPdb4Z.js";
1
+ import { E as PermissionTree, H as AppDataSchema, N as ResourceNode, T as PermissionKind, U as MetaValue, V as AppData, a as RoleTree, i as RoleMeta, n as PlanTree, r as Role, t as Plan, w as Permission } from "./vocabulary-CN8H_9UF.js";
2
2
  //#region src/conditions/ast.d.ts
3
3
  type ConditionRef = {
4
4
  readonly ref: string;
@@ -286,6 +286,7 @@ type TenantCustomRole = CustomRoleBody & {
286
286
  readonly id?: string;
287
287
  /** Input only: `scope` = the second scope, `id` = this team. */
288
288
  readonly team?: string;
289
+ readonly shared?: undefined;
289
290
  };
290
291
  /**
291
292
  * A role the platform defines, held through `principal.roles` like a declared
@@ -297,8 +298,23 @@ type GlobalCustomRole = CustomRoleBody & {
297
298
  readonly tenant?: undefined;
298
299
  readonly id?: undefined;
299
300
  readonly team?: undefined;
301
+ readonly shared?: undefined;
300
302
  };
301
- type CustomRole = TenantCustomRole | GlobalCustomRole;
303
+ /**
304
+ * A role the platform defines once for every tenant, held on memberships of
305
+ * its scope in any tenant. Tenant admins assign it but never edit it. Its
306
+ * ceiling is the assignable declared roles of its scope; its name wins over
307
+ * a tenant custom role of the same name.
308
+ */
309
+ type SharedCustomRole = CustomRoleBody & {
310
+ readonly shared: true;
311
+ /** The scope the role is held at, never `'global'`; defaults to the first scope. */
312
+ readonly scope?: string;
313
+ readonly tenant?: undefined;
314
+ readonly id?: undefined;
315
+ readonly team?: undefined;
316
+ };
317
+ type CustomRole = TenantCustomRole | SharedCustomRole | GlobalCustomRole;
302
318
  type Principal = {
303
319
  readonly id: string;
304
320
  readonly issuer?: string;
@@ -1409,6 +1425,15 @@ type CustomRoleSource = {
1409
1425
  globalRoles?(context?: {
1410
1426
  readonly held: readonly string[];
1411
1427
  }): CustomRole[] | Promise<CustomRole[]>;
1428
+ /**
1429
+ * Shared custom roles (`shared: true`), defined once for every tenant and
1430
+ * read once per subject with a tenant membership, with `held`, the role
1431
+ * names its live memberships hold in any tenant. A role here without
1432
+ * `shared: true` is ignored.
1433
+ */
1434
+ sharedRoles?(context?: {
1435
+ readonly held: readonly string[];
1436
+ }): CustomRole[] | Promise<CustomRole[]>;
1412
1437
  };
1413
1438
  /**
1414
1439
  * A `CustomRoleSource` built for the subject the instance serves, for an adapter
@@ -2147,4 +2172,4 @@ type SubjectOf<P> = {
2147
2172
  readonly expiresAt?: number;
2148
2173
  };
2149
2174
  //#endregion
2150
- export { MemberEntry as $, Delegation as $n, DeliveryFailureCause as $t, PolicyScopes as A, relation as An, CredentialRequest as At, ValidateMode as B, LimitDetail as Bn, LocalSnapshotManifest as Bt, MembershipFixture as C, RelationGrantee as Cn, isConditionRef as Cr, Credential as Ct, PolicyDelegation as D, authenticated as Dn, CredentialPermissionInput as Dt, PolicyAppDataSchemas as E, assurance as En, CredentialPermission as Et, RoleScope as F, DenialDetails as Fn, isFeedId as Ft, CustomRoleSourceFactory as G, TraceSkip as Gn, SnapshotScope as Gt, WireValidity as H, Obligation as Hn, SnapshotAssignable as Ht, SeparationConflict as I, DenialReason as In, parseCredential as It, EntitlementSource as J, Assurance as Jn, AutomationEvent as Jt, DecisionProvider as K, TraceSkipReason as Kn, AccessEvent as Kt, SubjectOf as L, DeniedDecision as Ln, InstanceHandle as Lt, PrincipalOf as M, ApprovalRequiredDecision as Mn, credentialDelegation as Mt, RoleBinding as N, Decision as Nn, credentialPolicyViolation as Nt, PolicyOAuthScope as O, inherit as On, CredentialPolicy as Ot, RoleOptions as P, Denial as Pn, decideCredential as Pt, LimitStore as Q, CustomRoleGrant as Qn, DeliveryEvent as Qt, SupportAccessOptions as R, ExplainedDecision as Rn, Instant as Rt, HostedGrantRef as S, InheritGrantee as Sn, isConditionDate as Sr, ApiKeyPrincipal as St, Policy as T, anyone as Tn, CredentialKind as Tt, CredentialVerifier as U, Quota as Un, SnapshotGrant as Ut, VocabularyFromInput as V, MatchedGrant as Vn, Snapshot as Vt, CustomRoleSource as W, Trace as Wn, SnapshotNotEntitled as Wt, LimitConsumeInput as X, Binding as Xn, DecisionEvent as Xt, JwtClaims as Y, AuthorizationDetail as Yn, CredentialEvent as Yt, LimitRemaining as Z, CustomRole as Zn, DeliveryChannel as Zt, GrantLimit as _, anyOf as _n, RestrictedAncestors as _r, SupportSessionDecision as _t, ApprovalRequirement as a, WireDenial as an, VerifiedClaims as ar, SettingsSource as at, GrantScope as b, Grantee as bn, hasConditionOp as br, decideSupportSession as bt, BreakGlassOptions as c, Scope as cn, MembershipVia as cr, TenantSettings as ct, ClosureContext as d, AnyOfApprover as dn, ConditionValue as dr, TokenVerifier as dt, DirectoryEvent as en, GnapAccess as er, MembershipSource as et, ClosureGrantFn as f, Approver as fn, MemberOfCondition as fr, VerificationFailure as ft, GrantCondition as g, allOf as gn, RelatedHop as gr, SupportSession as gt, Grant as h, UserApprover as hn, RelatedCondition as hr, DecideSupportSessionOptions as ht, ApprovalOption as i, WireDecision as in, Subject as ir, RelationSource as it, PolicyVocabulary as j, AppObligation as jn, DecideCredentialOptions as jt, PolicyOptions as k, plan as kn, CredentialPolicyViolation as kt, BreakGlassRequirements as l, ScopeDeclaration as ln, Condition as lr, TokenFailureCause as lt, DelegationTarget as m, PermissionApprover as mn, OpaqueCondition as mr, WhereCompiler as mt, ApprovalEscalation as n, MembershipEvent as nn, Membership as nr, RelationGroup as nt, ApprovalStage as o, WireDelegation as on, ActorKind as or, SnapshotSource as ot, DelegationInput as p, ApproverInput as pn, MemberOfParent as pr, VerifiedToken as pt, DecisionSink as q, Actor as qn, AuthEvent as qt, ApprovalMode as r, SinkEvent as rn, Principal as rr, RelationHolder as rt, AssuranceRequirement as s, PolicyScopesInput as sn, AdapterId as sr, SubjectResolver as st, ActivationOption as t, EmailCategory as tn, JsonWebKeyLike as tr, RelationChain as tt, BreakGlassSpec as u, ScopeNames as un, ConditionRef as ur, TokenSigner as ut, GrantMeta as v, holder as vn, SqlFunctionArg as vr, SupportSessionPolicy as vt, ObligationInput as w, actor as wn, isSqlFunctionField as wr, CredentialDecision as wt, GrantValidity as x, GranteeInput as xn, isCondition as xr, parseSupportSession as xt, GrantOptions as y, user as yn, SqlFunctionCondition as yr, SupportSessionRequest as yt, SupportConsent as z, GrantedDecision as zn, LocalCustomRoleTable as zt };
2175
+ export { MemberEntry as $, Delegation as $n, DeliveryFailureCause as $t, PolicyScopes as A, relation as An, CredentialRequest as At, ValidateMode as B, LimitDetail as Bn, LocalSnapshotManifest as Bt, MembershipFixture as C, RelationGrantee as Cn, isConditionDate as Cr, Credential as Ct, PolicyDelegation as D, authenticated as Dn, CredentialPermissionInput as Dt, PolicyAppDataSchemas as E, assurance as En, CredentialPermission as Et, RoleScope as F, DenialDetails as Fn, isFeedId as Ft, CustomRoleSourceFactory as G, TraceSkip as Gn, SnapshotScope as Gt, WireValidity as H, Obligation as Hn, SnapshotAssignable as Ht, SeparationConflict as I, DenialReason as In, parseCredential as It, EntitlementSource as J, Assurance as Jn, AutomationEvent as Jt, DecisionProvider as K, TraceSkipReason as Kn, AccessEvent as Kt, SubjectOf as L, DeniedDecision as Ln, InstanceHandle as Lt, PrincipalOf as M, ApprovalRequiredDecision as Mn, credentialDelegation as Mt, RoleBinding as N, Decision as Nn, credentialPolicyViolation as Nt, PolicyOAuthScope as O, inherit as On, CredentialPolicy as Ot, RoleOptions as P, Denial as Pn, decideCredential as Pt, LimitStore as Q, CustomRoleGrant as Qn, DeliveryEvent as Qt, SupportAccessOptions as R, ExplainedDecision as Rn, Instant as Rt, HostedGrantRef as S, InheritGrantee as Sn, isCondition as Sr, ApiKeyPrincipal as St, Policy as T, anyone as Tn, isSqlFunctionField as Tr, CredentialKind as Tt, CredentialVerifier as U, Quota as Un, SnapshotGrant as Ut, VocabularyFromInput as V, MatchedGrant as Vn, Snapshot as Vt, CustomRoleSource as W, Trace as Wn, SnapshotNotEntitled as Wt, LimitConsumeInput as X, Binding as Xn, DecisionEvent as Xt, JwtClaims as Y, AuthorizationDetail as Yn, CredentialEvent as Yt, LimitRemaining as Z, CustomRole as Zn, DeliveryChannel as Zt, GrantLimit as _, anyOf as _n, RelatedHop as _r, SupportSessionDecision as _t, ApprovalRequirement as a, WireDenial as an, Subject as ar, SettingsSource as at, GrantScope as b, Grantee as bn, SqlFunctionCondition as br, decideSupportSession as bt, BreakGlassOptions as c, Scope as cn, AdapterId as cr, TenantSettings as ct, ClosureContext as d, AnyOfApprover as dn, ConditionRef as dr, TokenVerifier as dt, DirectoryEvent as en, GnapAccess as er, MembershipSource as et, ClosureGrantFn as f, Approver as fn, ConditionValue as fr, VerificationFailure as ft, GrantCondition as g, allOf as gn, RelatedCondition as gr, SupportSession as gt, Grant as h, UserApprover as hn, OpaqueCondition as hr, DecideSupportSessionOptions as ht, ApprovalOption as i, WireDecision as in, SharedCustomRole as ir, RelationSource as it, PolicyVocabulary as j, AppObligation as jn, DecideCredentialOptions as jt, PolicyOptions as k, plan as kn, CredentialPolicyViolation as kt, BreakGlassRequirements as l, ScopeDeclaration as ln, MembershipVia as lr, TokenFailureCause as lt, DelegationTarget as m, PermissionApprover as mn, MemberOfParent as mr, WhereCompiler as mt, ApprovalEscalation as n, MembershipEvent as nn, Membership as nr, RelationGroup as nt, ApprovalStage as o, WireDelegation as on, VerifiedClaims as or, SnapshotSource as ot, DelegationInput as p, ApproverInput as pn, MemberOfCondition as pr, VerifiedToken as pt, DecisionSink as q, Actor as qn, AuthEvent as qt, ApprovalMode as r, SinkEvent as rn, Principal as rr, RelationHolder as rt, AssuranceRequirement as s, PolicyScopesInput as sn, ActorKind as sr, SubjectResolver as st, ActivationOption as t, EmailCategory as tn, JsonWebKeyLike as tr, RelationChain as tt, BreakGlassSpec as u, ScopeNames as un, Condition as ur, TokenSigner as ut, GrantMeta as v, holder as vn, RestrictedAncestors as vr, SupportSessionPolicy as vt, ObligationInput as w, actor as wn, isConditionRef as wr, CredentialDecision as wt, GrantValidity as x, GranteeInput as xn, hasConditionOp as xr, parseSupportSession as xt, GrantOptions as y, user as yn, SqlFunctionArg as yr, SupportSessionRequest as yt, SupportConsent as z, GrantedDecision as zn, LocalCustomRoleTable as zt };
@@ -1,4 +1,4 @@
1
- import { $ as MemberEntry, T as Policy, W as CustomRoleSource, Zn as CustomRole, et as MembershipSource, ir as Subject, nr as Membership } from "./policy-types-DzwivBgR.js";
1
+ import { $ as MemberEntry, T as Policy, W as CustomRoleSource, Zn as CustomRole, ar as Subject, et as MembershipSource, nr as Membership } from "./policy-types-n0uRTsW8.js";
2
2
  //#region src/supabase/postgrest.d.ts
3
3
  /** What a supabase-js `rpc` call resolves to: `data` or an `error` with a message. */
4
4
  type SupabaseRpcResult = {
@@ -409,10 +409,15 @@ function customRoleOf(value) {
409
409
  grants,
410
410
  ...includes.length === 0 ? {} : { includes }
411
411
  };
412
- if (value["scope"] === "global") return value["tenant"] === void 0 ? {
412
+ if (value["scope"] === "global") return value["tenant"] === void 0 && value["shared"] === void 0 ? {
413
413
  ...body,
414
414
  scope: "global"
415
415
  } : void 0;
416
+ if (value["shared"] === true) return value["tenant"] === void 0 && value["id"] === void 0 ? compact({
417
+ ...body,
418
+ shared: true,
419
+ scope: typeof value["scope"] === "string" ? value["scope"] : void 0
420
+ }) : void 0;
416
421
  if (typeof value["tenant"] !== "string") return;
417
422
  return compact({
418
423
  ...body,
@@ -540,6 +545,10 @@ function postgrestSources(client, options = {}) {
540
545
  async globalRoles(context) {
541
546
  if (onlyDeclared(context?.held)) return [];
542
547
  return ((await live(principal.id))?.customRoles ?? []).filter((role) => role.scope === "global");
548
+ },
549
+ async sharedRoles(context) {
550
+ if (onlyDeclared(context?.held)) return [];
551
+ return ((await live(principal.id))?.customRoles ?? []).filter((role) => role.shared === true);
543
552
  }
544
553
  };
545
554
  },
@@ -1,9 +1,9 @@
1
1
  import { c as isConditionRef, s as isConditionDate } from "./refs-K6eWUJ0H.js";
2
- import { E as memoryCustomRoleSource, f as localSnapshotManifest } from "./src-DLfUWFAI.js";
2
+ import { E as memoryCustomRoleSource, f as localSnapshotManifest } from "./src-Cu2m75uo.js";
3
3
  import { n as findPermission } from "./permission-registry-Br4jSNVi.js";
4
4
  import { d as scopeList, o as resolveScope } from "./scopes-CUPSjo9q.js";
5
5
  import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
6
- import { t as getPermDock } from "./permdock-B9JxkBwC.js";
6
+ import { t as getPermDock } from "./permdock-BrAscV28.js";
7
7
  import { u as usageResult } from "./errors-CWTY6uih.js";
8
8
  import { c as requirePolicy } from "./load-DFS_ry0W.js";
9
9
  import { i as scopeMembershipTable, r as scopeColumn } from "./compile-CMqMx_IN.js";
@@ -12,10 +12,10 @@ import "./sources-vs5dGOsS.js";
12
12
  import { t as applyFiles } from "./files-C5ZI27eV.js";
13
13
  import { i as fileDrift } from "./output-files-DhRBBE4n.js";
14
14
  import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-B7XrLeY7.js";
15
- import { N as quoteIdent, a as customRolesOn, t as CUSTOM_ROLES } from "./shared-CD11nBbC.js";
16
- import { f as pgConnector } from "./policies-CO1oOymN.js";
17
- import { M as contextRefs, k as collectGrants, t as ownershipRules } from "./ownership-BatFgAA4.js";
18
- import { m as tableFor, t as canFixture } from "./verify-DbCL9bnB.js";
15
+ import { N as quoteIdent, a as customRolesOn, t as CUSTOM_ROLES } from "./shared-BAK8t4Uo.js";
16
+ import { f as pgConnector } from "./policies-DP2nqRoF.js";
17
+ import { A as collectGrants, N as contextRefs, t as ownershipRules } from "./ownership-DqaJNJPn.js";
18
+ import { m as tableFor, t as canFixture } from "./verify-BaAKx7t6.js";
19
19
  import { resolve } from "node:path";
20
20
  //#region src/cli/powersync/streams.ts
21
21
  function ident(name) {
@@ -14,7 +14,7 @@ const generate = defineLeaf({
14
14
  async run(ctx, { flags }) {
15
15
  const out = fileOut("powersync", flags.out);
16
16
  const from = given(flags.policy);
17
- const { runPowerSync } = await import("./powersync-CbzkqL_M.js");
17
+ const { runPowerSync } = await import("./powersync-MMJ2mI2q.js");
18
18
  return runPowerSync({
19
19
  cwd: ctx.cwd,
20
20
  config: ctx.config,
@@ -45,7 +45,7 @@ const verify = defineLeaf({
45
45
  const db = await dbUrl(ctx, flags, { required: true });
46
46
  const fixtures = given(flags.fixtures);
47
47
  const from = given(flags.policy);
48
- const { runPowerSync } = await import("./powersync-CbzkqL_M.js");
48
+ const { runPowerSync } = await import("./powersync-MMJ2mI2q.js");
49
49
  return runPowerSync({
50
50
  cwd: ctx.cwd,
51
51
  config: ctx.config,
@@ -0,0 +1 @@
1
+ export { n as runPowerSync } from "./powersync-BkWWCS1K.js";
@@ -1,5 +1,5 @@
1
- import { Rt as Instant, ir as Subject, lr as Condition } from "../policy-types-DzwivBgR.js";
2
- import { c as WhereResult } from "../permdock-D7eeLJER.js";
1
+ import { Rt as Instant, ar as Subject, ur as Condition } from "../policy-types-n0uRTsW8.js";
2
+ import { c as WhereResult } from "../permdock-SV8ZINYT.js";
3
3
  import { r as RelationsMapping } from "../graph-sql-B-dsAT6j.js";
4
4
  import { n as WithSubjectOptions, t as RowCheck } from "../row-check-Dt35czLy.js";
5
5
  //#region src/prisma/model-fields.d.ts
@@ -1,4 +1,4 @@
1
- import { Nn as Decision } from "./policy-types-DzwivBgR.js";
1
+ import { Nn as Decision } from "./policy-types-n0uRTsW8.js";
2
2
  //#region src/core/problem-details.d.ts
3
3
  type Disclosure = "hide" | "reveal";
4
4
  /** The plans a `not-entitled` denial asks for; empty unless every denial is `not-entitled`. */
@@ -1,4 +1,4 @@
1
- import { n as storeOf } from "./store-options-BqEakYRa.js";
1
+ import { n as storeOf } from "./store-options-u0ycEe8s.js";
2
2
  import { c as rolesView, d as subjectView, f as tenantView, i as gateView, l as scopedTenant, n as describeWith, o as permissionSet, r as filterResult, s as protectedView, t as approvalHandle, u as slotContent } from "./views-DTIIO-oQ.js";
3
3
  import { a as PermDockUiContext, i as PermDockStoreContext, r as PermDockSnapshotPromiseContext } from "./live-options-BaAFCIiu.js";
4
4
  import { Suspense, use, useMemo, useSyncExternalStore } from "react";
@@ -1,8 +1,8 @@
1
- import { Nn as Decision, j as PolicyVocabulary, nr as Membership } from "./policy-types-DzwivBgR.js";
2
- import { r as Role, w as Permission } from "./vocabulary-D6lPdb4Z.js";
3
- import { r as DescribeOptions, t as DecisionDescription } from "./describe-BZUsixiL.js";
4
- import { a as FilterResult, c as PermissionSet, d as RolesOptions, f as SubjectView, l as PermissionState, o as GateMode, p as TenantView, r as ClientPermDock, s as GateView, t as ApprovalHandle } from "./types-BNORmDM8.js";
5
- import { r as ProtectedProps } from "./types-tIgIeIKJ.js";
1
+ import { Nn as Decision, j as PolicyVocabulary, nr as Membership } from "./policy-types-n0uRTsW8.js";
2
+ import { r as Role, w as Permission } from "./vocabulary-CN8H_9UF.js";
3
+ import { r as DescribeOptions, t as DecisionDescription } from "./describe-B5qgDvEW.js";
4
+ import { a as FilterResult, c as PermissionSet, d as RolesOptions, f as SubjectView, l as PermissionState, o as GateMode, p as TenantView, r as ClientPermDock, s as GateView, t as ApprovalHandle } from "./types-B3_ooZgZ.js";
5
+ import { r as ProtectedProps } from "./types-CX7AvRqP.js";
6
6
  import { ReactNode } from "react";
7
7
  //#region src/react/hooks.d.ts
8
8
  declare function usePermDock<V extends PolicyVocabulary = PolicyVocabulary>(): ClientPermDock<V>;
@@ -1,6 +1,6 @@
1
1
  import { t as compact } from "./compact-CAf557ZB.js";
2
- import { t as emptySnapshot } from "./from-snapshot-D2lZt4Dd.js";
3
- import { t as adapterStore } from "./store-options-BqEakYRa.js";
2
+ import { t as emptySnapshot } from "./from-snapshot-CTCMsFZk.js";
3
+ import { t as adapterStore } from "./store-options-u0ycEe8s.js";
4
4
  import { a as PermDockUiContext, i as PermDockStoreContext, n as useKeyed, r as PermDockSnapshotPromiseContext, t as useLiveOptions } from "./live-options-BaAFCIiu.js";
5
5
  import { useLayoutEffect, useMemo } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { n as PermDockProviderProps } from "./types-tIgIeIKJ.js";
1
+ import { n as PermDockProviderProps } from "./types-CX7AvRqP.js";
2
2
  import { ReactElement } from "react";
3
3
  //#region src/react/provider.d.ts
4
4
  declare function PermDockProvider(props: PermDockProviderProps): ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { t as compact } from "./compact-CAf557ZB.js";
2
- import { t as emptySnapshot } from "./from-snapshot-D2lZt4Dd.js";
3
- import { i as isPromiseLike, t as adapterStore } from "./store-options-BqEakYRa.js";
2
+ import { t as emptySnapshot } from "./from-snapshot-CTCMsFZk.js";
3
+ import { i as isPromiseLike, t as adapterStore } from "./store-options-u0ycEe8s.js";
4
4
  //#region src/client/provider-store.ts
5
5
  /**
6
6
  * Store options that read `read()` on every request, so a rotated token, a
@@ -0,0 +1 @@
1
+ export { n as runCloudPull } from "./pull-jEwbf80J.js";
@@ -3,7 +3,7 @@ import { t as catalogFingerprint } from "./catalog-fingerprint-CCP0-yQS.js";
3
3
  import { a as describeError } from "./errors-CWTY6uih.js";
4
4
  import { s as writeFileEnsuringDir } from "./files-D_JIzUrP.js";
5
5
  import { s as cliVersion } from "./version-CEbQ5UeM.js";
6
- import { a as formatCatalogJson } from "./catalog-doc-C9wjsfNY.js";
6
+ import { a as formatCatalogJson } from "./catalog-doc-Cdn7-0pQ.js";
7
7
  import { t as catalogPath } from "./catalog-path-CnI0XTFK.js";
8
8
  import { t as parseSupabaseManifest } from "./manifest-C8IzW3Do.js";
9
9
  import { t as parseCatalog } from "./parse-Cxq0WxrA.js";
@@ -4,8 +4,8 @@ import { s as cliVersion } from "./version-CEbQ5UeM.js";
4
4
  import { i as loadConfiguredPolicy } from "./load-DFS_ry0W.js";
5
5
  import { t as parseSupabaseManifest } from "./manifest-C8IzW3Do.js";
6
6
  import { t as parseCatalog } from "./parse-Cxq0WxrA.js";
7
- import { r as pushedPolicy } from "./pushed-policy-DobP7AHI.js";
8
- import { n as runCatalog } from "./catalog-BECMPrwc.js";
7
+ import { r as pushedPolicy } from "./pushed-policy-CqtxkV4G.js";
8
+ import { n as runCatalog } from "./catalog-HD2gf5mY.js";
9
9
  import { n as httpRequest, t as authFailure } from "./http-DXJ37RDA.js";
10
10
  import { a as pushAuth, l as cloudUrl, n as cliRuntime, u as firstNonEmpty } from "./auth-DRLEizbL.js";
11
11
  import "./manifest-json-CAGzls-C.js";
@@ -3,7 +3,7 @@ import { n as freezeDeep } from "./freeze-CrU8nQeX.js";
3
3
  import { n as PermDockValidationError } from "./validation-error-ZfUHbKvf.js";
4
4
  import { n as RFC3339_PATTERN } from "./time-DkWjdL98.js";
5
5
  import { i as wireValidity } from "./validity-CZ7-y0Cj.js";
6
- import { n as snapshotScopes } from "./instance-snapshot-Cxq4ygFc.js";
6
+ import { n as snapshotScopes } from "./instance-snapshot-BOEhcqIF.js";
7
7
  import { n as copyJson, r as forbiddenKeyPath, t as checkSchema } from "./json-schema-B-vAwlde.js";
8
8
  //#region src/catalog/pushed-policy.ts
9
9
  const strings = {
@@ -1,4 +1,4 @@
1
- import { Gt as SnapshotScope, H as WireValidity, T as Policy, _ as GrantLimit, a as ApprovalRequirement, bn as Grantee, jn as AppObligation, lr as Condition, u as BreakGlassSpec, v as GrantMeta } from "./policy-types-DzwivBgR.js";
1
+ import { Gt as SnapshotScope, H as WireValidity, T as Policy, _ as GrantLimit, a as ApprovalRequirement, bn as Grantee, jn as AppObligation, u as BreakGlassSpec, ur as Condition, v as GrantMeta } from "./policy-types-n0uRTsW8.js";
2
2
  import { t as JsonSchemaNode } from "./json-schema-CN_iLFH2.js";
3
3
  //#region src/catalog/pushed-policy.d.ts
4
4
  /**
@@ -1,8 +1,8 @@
1
- import { n as requiredPlans } from "../problem-details-DXlt-vks.js";
2
- import { i as describe } from "../describe-BZUsixiL.js";
1
+ import { n as requiredPlans } from "../problem-details-B45V5d2b.js";
2
+ import { i as describe } from "../describe-B5qgDvEW.js";
3
3
  import { t as approvalHeaders } from "../headers-CIbDTUTK.js";
4
- import { a as FilterResult, c as PermissionSet, f as SubjectView, i as ClientStatus, l as PermissionState, n as ApprovalState, o as GateMode, p as TenantView, r as ClientPermDock, s as GateView, t as ApprovalHandle } from "../types-BNORmDM8.js";
5
- import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-tIgIeIKJ.js";
6
- import { a as useDescribe, c as useMemberships, d as usePermissions, f as useRoles, i as useAssignableRoles, l as usePermDock, m as useTenant, n as useApproval, o as useFilter, p as useSubject, r as useAssignablePermissions, s as useGate, t as Protected, u as usePermission } from "../protected-DEPHc2xV.js";
7
- import { t as PermDockProvider } from "../provider-DMVt6yYn.js";
4
+ import { a as FilterResult, c as PermissionSet, f as SubjectView, i as ClientStatus, l as PermissionState, n as ApprovalState, o as GateMode, p as TenantView, r as ClientPermDock, s as GateView, t as ApprovalHandle } from "../types-B3_ooZgZ.js";
5
+ import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-CX7AvRqP.js";
6
+ import { a as useDescribe, c as useMemberships, d as usePermissions, f as useRoles, i as useAssignableRoles, l as usePermDock, m as useTenant, n as useApproval, o as useFilter, p as useSubject, r as useAssignablePermissions, s as useGate, t as Protected, u as usePermission } from "../protected-RFGpakN9.js";
7
+ import { t as PermDockProvider } from "../provider-DILL9oPK.js";
8
8
  export { type ApprovalHandle, type ApprovalState, type ClientPermDock, type ClientStatus, type FilterResult, type GateMode, type GateView, type PermDockDefaults, PermDockProvider, type PermDockProviderProps, type PermissionSet, type PermissionState, Protected, type ProtectedProps, type SubjectView, type TenantView, approvalHeaders, describe, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useRoles, useSubject, useTenant };
@@ -2,6 +2,6 @@
2
2
  import { r as requiredPlans } from "../problem-details-cn5X30gZ.js";
3
3
  import { t as describe } from "../describe-BybMRY7A.js";
4
4
  import { t as approvalHeaders } from "../headers-BIjfMaoC.js";
5
- import { a as useDescribe, c as useMemberships, d as usePermissions, f as useRoles, i as useAssignableRoles, l as usePermDock, m as useTenant, n as useApproval, o as useFilter, p as useSubject, r as useAssignablePermissions, s as useGate, t as Protected, u as usePermission } from "../protected-DfjY5mLA.js";
6
- import { t as PermDockProvider } from "../provider-CC-u3bYP.js";
5
+ import { a as useDescribe, c as useMemberships, d as usePermissions, f as useRoles, i as useAssignableRoles, l as usePermDock, m as useTenant, n as useApproval, o as useFilter, p as useSubject, r as useAssignablePermissions, s as useGate, t as Protected, u as usePermission } from "../protected-BlF0F6wL.js";
6
+ import { t as PermDockProvider } from "../provider-B1al-AZz.js";
7
7
  export { PermDockProvider, Protected, approvalHeaders, describe, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useRoles, useSubject, useTenant };
@@ -1,2 +1,2 @@
1
- import { t as PermDockProvider } from "../provider-DMVt6yYn.js";
1
+ import { t as PermDockProvider } from "../provider-DILL9oPK.js";
2
2
  export { PermDockProvider };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export { t as PermDockProvider } from "../provider-CC-u3bYP.js";
2
+ export { t as PermDockProvider } from "../provider-B1al-AZz.js";
@@ -1,13 +1,13 @@
1
- import { Bt as LocalSnapshotManifest, Rt as Instant, Vt as Snapshot, Zn as CustomRole, nr as Membership, ot as SnapshotSource } from "../policy-types-DzwivBgR.js";
2
- import { w as Permission } from "../vocabulary-D6lPdb4Z.js";
3
- import { n as requiredPlans } from "../problem-details-DXlt-vks.js";
4
- import { i as describe } from "../describe-BZUsixiL.js";
5
- import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-DgqtruPn.js";
1
+ import { Bt as LocalSnapshotManifest, Rt as Instant, Vt as Snapshot, Zn as CustomRole, nr as Membership, ot as SnapshotSource } from "../policy-types-n0uRTsW8.js";
2
+ import { w as Permission } from "../vocabulary-CN8H_9UF.js";
3
+ import { n as requiredPlans } from "../problem-details-B45V5d2b.js";
4
+ import { i as describe } from "../describe-B5qgDvEW.js";
5
+ import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-5ODwqu8b.js";
6
6
  import { t as approvalHeaders } from "../headers-CIbDTUTK.js";
7
- import { a as FilterResult, c as PermissionSet, f as SubjectView, i as ClientStatus, l as PermissionState, m as ClientStore, n as ApprovalState, o as GateMode, p as TenantView, r as ClientPermDock, s as GateView, t as ApprovalHandle } from "../types-BNORmDM8.js";
8
- import { r as ProtectedProps, t as PermDockDefaults } from "../types-tIgIeIKJ.js";
9
- import { a as useDescribe, c as useMemberships, d as usePermissions, f as useRoles, i as useAssignableRoles, l as usePermDock, m as useTenant, n as useApproval, o as useFilter, p as useSubject, r as useAssignablePermissions, s as useGate, t as Protected, u as usePermission } from "../protected-DEPHc2xV.js";
10
- import { a as SubscribeOnline, i as SubscribeForeground, n as ReactNativePermDockProviderProps, r as SnapshotStorage, t as NativeRevalidate } from "../types-BjV-fqcA.js";
7
+ import { a as FilterResult, c as PermissionSet, f as SubjectView, i as ClientStatus, l as PermissionState, m as ClientStore, n as ApprovalState, o as GateMode, p as TenantView, r as ClientPermDock, s as GateView, t as ApprovalHandle } from "../types-B3_ooZgZ.js";
8
+ import { r as ProtectedProps, t as PermDockDefaults } from "../types-CX7AvRqP.js";
9
+ import { a as useDescribe, c as useMemberships, d as usePermissions, f as useRoles, i as useAssignableRoles, l as usePermDock, m as useTenant, n as useApproval, o as useFilter, p as useSubject, r as useAssignablePermissions, s as useGate, t as Protected, u as usePermission } from "../protected-RFGpakN9.js";
10
+ import { a as SubscribeOnline, i as SubscribeForeground, n as ReactNativePermDockProviderProps, r as SnapshotStorage, t as NativeRevalidate } from "../types-C863OQiR.js";
11
11
  import { ReactElement } from "react";
12
12
  //#region src/react-native/guards.d.ts
13
13
  /** `true` once the provider has a snapshot to answer from: storage was read or a seed was given. Hide the splash screen on it. */
@@ -6,15 +6,15 @@ import { t as describe } from "../describe-BybMRY7A.js";
6
6
  import { n as isThenable } from "../thenable-yD7SabqG.js";
7
7
  import { h as secondsAt, m as rfc3339 } from "../time-DkWjdL98.js";
8
8
  import { a as normalizeMemberships, d as scopeList, m as tenantOf$1, o as resolveScope } from "../scopes-CUPSjo9q.js";
9
- import { o as flattenGrantee } from "../grantee-Cn1HyUsI.js";
9
+ import { o as flattenGrantee } from "../grantee-hxrUsbpM.js";
10
10
  import { d as resolveActiveTenant } from "../tenancy-DN2QAx9z.js";
11
- import { i as bindConditionRefs, n as parseSnapshot } from "../snapshot-CXUWfsNy.js";
12
- import { r as heldRoleNames, t as emptySnapshot } from "../from-snapshot-D2lZt4Dd.js";
11
+ import { i as bindConditionRefs, n as parseSnapshot } from "../snapshot-B7DkYg6g.js";
12
+ import { r as heldRoleNames, t as emptySnapshot } from "../from-snapshot-CTCMsFZk.js";
13
13
  import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-CVSs6J9I.js";
14
14
  import { t as approvalHeaders } from "../headers-BIjfMaoC.js";
15
- import { n as storeOf, r as isJws, t as adapterStore } from "../store-options-BqEakYRa.js";
15
+ import { n as storeOf, r as isJws, t as adapterStore } from "../store-options-u0ycEe8s.js";
16
16
  import { a as PermDockUiContext, i as PermDockStoreContext, n as useKeyed, t as useLiveOptions } from "../live-options-BaAFCIiu.js";
17
- import { a as useDescribe, c as useMemberships, d as usePermissions, f as useRoles, i as useAssignableRoles, l as usePermDock, m as useTenant, n as useApproval, o as useFilter, p as useSubject, r as useAssignablePermissions, s as useGate, t as Protected, u as usePermission } from "../protected-DfjY5mLA.js";
17
+ import { a as useDescribe, c as useMemberships, d as usePermissions, f as useRoles, i as useAssignableRoles, l as usePermDock, m as useTenant, n as useApproval, o as useFilter, p as useSubject, r as useAssignablePermissions, s as useGate, t as Protected, u as usePermission } from "../protected-BlF0F6wL.js";
18
18
  import { useEffect, useMemo, useRef } from "react";
19
19
  import { jsx } from "react/jsx-runtime";
20
20
  //#region src/react-native/guards.ts
@@ -123,7 +123,7 @@ function isList(value) {
123
123
  return Array.isArray(value);
124
124
  }
125
125
  function customScope(role, scopes) {
126
- if (role.scope === "global") return "global";
126
+ if (role.scope === "global") return role.shared === true ? void 0 : "global";
127
127
  if (role.scope !== void 0) return resolveScope(scopes, role.scope);
128
128
  return role.team === void 0 ? scopes[0]?.name : scopes[1]?.name;
129
129
  }
@@ -175,7 +175,9 @@ function buildLocalSnapshot(manifest, data, at) {
175
175
  }
176
176
  for (const membership of memberships) if (scoped.every((item) => declared.has(item.role) && membership.roles.includes(item.role) && (typeof item.scope === "string" ? membership.scope === item.scope : membership.on !== void 0))) attach(grant, membership);
177
177
  }
178
- const custom = (data.customRoles ?? []).filter((role) => role !== null && typeof role === "object" && typeof role.name === "string" && !declared.has(role.name));
178
+ const formed = (data.customRoles ?? []).filter((role) => role !== null && typeof role === "object" && typeof role.name === "string" && !declared.has(role.name));
179
+ const sharedNames = new Set(formed.filter((role) => role.shared === true).map((role) => role.name));
180
+ const custom = formed.filter((role) => role.shared === true || role.scope === "global" || !sharedNames.has(role.name));
179
181
  for (const role of custom) {
180
182
  const scope = customScope(role, scopes);
181
183
  const table = scope !== void 0 && Object.hasOwn(manifest.custom, scope) ? manifest.custom[scope] : void 0;
@@ -186,7 +188,7 @@ function buildLocalSnapshot(manifest, data, at) {
186
188
  continue;
187
189
  }
188
190
  const id = role.team ?? role.id;
189
- for (const membership of memberships) if (membership.scope === scope && typeof role.tenant === "string" && tenantOf$1(membership, scopes) === role.tenant && (id === void 0 || membership.id === id) && membership.roles.includes(role.name)) for (const grant of resolved) attach(grant, membership);
191
+ for (const membership of memberships) if (membership.scope === scope && (role.shared === true ? role.tenant === void 0 && id === void 0 && tenantOf$1(membership, scopes) !== void 0 : typeof role.tenant === "string" && tenantOf$1(membership, scopes) === role.tenant) && (id === void 0 || membership.id === id) && membership.roles.includes(role.name)) for (const grant of resolved) attach(grant, membership);
190
192
  }
191
193
  const roles = subject.principal === null ? [] : heldRoleNames(subject, tenant, scopes, { rank: manifest.rank ?? [] }, now);
192
194
  return freezeDeep(compact({
@@ -1,4 +1,4 @@
1
- import { l as ReplayStore } from "./types-DiQjupG2.js";
1
+ import { l as ReplayStore } from "./types-C791HFu9.js";
2
2
  //#region src/ssf/replay.d.ts
3
3
  declare function memoryReplayStore(): ReplayStore;
4
4
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { t as assertAppData } from "./app-data-MuyzVqX8.js";
2
2
  import { n as wrapPermDock } from "./wrap-gX61EtpB.js";
3
- import { t as buildInstance } from "./build-instance-BMnAudHn.js";
3
+ import { t as buildInstance } from "./build-instance-Bu_eDqYw.js";
4
4
  //#region src/core/request-context.ts
5
5
  /**
6
6
  * Errors an adapter raises around one instance (a `context` hook that threw,
@@ -1,7 +1,7 @@
1
- import { q as DecisionSink } from "../policy-types-DzwivBgR.js";
2
- import { n as ApprovalUrl, t as ApprovalPrompt } from "../approval-prompt-Djo_PyZc.js";
3
- import { d as EmailTransport, o as DeliveryResult, u as EmailMessage } from "../types-DX0LaKTb.js";
4
- import { l as ReplayStore } from "../types-DiQjupG2.js";
1
+ import { q as DecisionSink } from "../policy-types-n0uRTsW8.js";
2
+ import { n as ApprovalUrl, t as ApprovalPrompt } from "../approval-prompt-DvSSPQJX.js";
3
+ import { d as EmailTransport, o as DeliveryResult, u as EmailMessage } from "../types-BtHtcKMr.js";
4
+ import { l as ReplayStore } from "../types-C791HFu9.js";
5
5
  //#region src/resend/approval-email.d.ts
6
6
  type ApprovalEmailOptions = {
7
7
  /** The app's approval page: a base the request id is appended to, or a function of the prompt. Must be https. */
@@ -186,7 +186,7 @@ async function rlsInput(ctx, verb, shape, options) {
186
186
  };
187
187
  }
188
188
  async function runRls(input) {
189
- return (await import("./rls-j6t43t7n.js")).runRls(input);
189
+ return (await import("./rls-DTvYd-lI.js")).runRls(input);
190
190
  }
191
191
  const generate = defineLeaf({
192
192
  flags: {