permdock 0.4.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 (515) hide show
  1. package/README.md +37 -35
  2. package/dist/{schema-Bol6gqXA.js → 2020-C9VN-x8c.js} +5 -130
  3. package/dist/a2a/index.d.ts +6 -6
  4. package/dist/a2a/index.js +14 -17
  5. package/dist/{adapter-context-mlWsVGGg.js → adapter-context-CRhqyzCk.js} +1 -1
  6. package/dist/adoption-scan-DCYe60Pi.js +107 -0
  7. package/dist/agent/index.d.ts +3 -0
  8. package/dist/agent/index.js +1 -0
  9. package/dist/ai-sdk/index.d.ts +18 -35
  10. package/dist/ai-sdk/index.js +37 -23
  11. package/dist/{app-data-CV8pqqMi.js → app-data-MuyzVqX8.js} +2 -1
  12. package/dist/approval-header-CJACtHkv.js +23 -0
  13. package/dist/approval-prompt-Dg5LeAcT.js +62 -0
  14. package/dist/approval-prompt-DvSSPQJX.d.ts +57 -0
  15. package/dist/approvals/index.d.ts +5 -3
  16. package/dist/approvals/index.js +8 -5
  17. package/dist/approvals-p1PGoVjb.js +995 -0
  18. package/dist/arazzo-41WuzHou.js +36 -0
  19. package/dist/{arazzo-C4BcskbX.js → arazzo-CaUVBn7D.js} +20 -14
  20. package/dist/args-IIolxxKA.js +197 -0
  21. package/dist/astro/index.d.ts +43 -0
  22. package/dist/astro/index.js +27 -0
  23. package/dist/audience-DabClFLQ.js +55 -0
  24. package/dist/auth-DRLEizbL.js +178 -0
  25. package/dist/authzen/index.d.ts +26 -6
  26. package/dist/authzen/index.js +94 -79
  27. package/dist/automation-BNM3TtDo.d.ts +114 -0
  28. package/dist/automation-DVjOckjV.js +157 -0
  29. package/dist/better-auth/index.d.ts +8 -6
  30. package/dist/better-auth/index.js +9 -8
  31. package/dist/better-supabase/index.d.ts +357 -30
  32. package/dist/better-supabase/index.js +936 -194
  33. package/dist/{bind-kk-uyCwH.js → bind-CAvgUuKs.js} +14 -10
  34. package/dist/{bind-BzqG8SMb.d.ts → bind-DOyrv6zi.d.ts} +12 -10
  35. package/dist/body-CH5of8Ne.js +10 -0
  36. package/dist/body-text-QcXok_SI.js +52 -0
  37. package/dist/{build-instance-DIIV9DbC.js → build-instance-Bu_eDqYw.js} +4 -3
  38. package/dist/{canonical-json-CFKyFOke.js → canonical-json-BC8_nMTw.js} +5 -3
  39. package/dist/{capability-CksyCWDH.d.ts → capability-Drg-1YhL.d.ts} +44 -25
  40. package/dist/{capability-txATtKV4.js → capability-N1K9IpqS.js} +68 -42
  41. package/dist/casbin-Cr7RLtA3.js +30 -0
  42. package/dist/casbin-Dyu2gnUD.js +234 -0
  43. package/dist/casl-64gpT-8x.js +24 -0
  44. package/dist/casl-DjEDhTCP.js +299 -0
  45. package/dist/catalog/index.d.ts +74 -2
  46. package/dist/catalog/index.js +51 -2
  47. package/dist/catalog-BoWglDPI.js +1 -0
  48. package/dist/catalog-DZVbrF-z.js +52 -0
  49. package/dist/{catalog-tZUyOfOv.js → catalog-HD2gf5mY.js} +51 -6
  50. package/dist/{catalog-doc-DWtg0gGR.js → catalog-doc-Cdn7-0pQ.js} +45 -23
  51. package/dist/catalog-fingerprint-CCP0-yQS.js +153 -0
  52. package/dist/chat/index.d.ts +2 -0
  53. package/dist/chat/index.js +224 -0
  54. package/dist/chat-sdk/index.d.ts +87 -0
  55. package/dist/chat-sdk/index.js +197 -0
  56. package/dist/claims-map-7oQ3ue4X.js +13 -0
  57. package/dist/claims-map-Ca-QX8C6.d.ts +32 -0
  58. package/dist/claude-agent/index.d.ts +7 -14
  59. package/dist/claude-agent/index.js +24 -27
  60. package/dist/clerk/index.d.ts +9 -8
  61. package/dist/clerk/index.js +9 -14
  62. package/dist/cli/bin.js +36 -17
  63. package/dist/cli/index.d.ts +19 -5
  64. package/dist/cli/index.js +164 -4
  65. package/dist/cloud/index.d.ts +102 -63
  66. package/dist/cloud/index.js +239 -340
  67. package/dist/cloud-ytQ3uviA.js +87 -0
  68. package/dist/codemod-5mpSpnUY.js +37 -0
  69. package/dist/codemod-ua2hHy7w.js +2084 -0
  70. package/dist/collect-Ci6akVwH.js +55 -0
  71. package/dist/collect-D7eQDffE.js +1 -0
  72. package/dist/{collect-2SrB7lfk.js → collect-mLTY4nwb.js} +75 -11
  73. package/dist/command-L8EstFNm.js +6 -0
  74. package/dist/compile/index.d.ts +1 -1
  75. package/dist/compile/index.js +1 -2
  76. package/dist/{compile-CtTP7eur.d.ts → compile-1bsAezL0.d.ts} +5 -3
  77. package/dist/{compile-CcEu2ZQ1.js → compile-CMqMx_IN.js} +11 -8
  78. package/dist/completion-BTFrHZhX.js +143 -0
  79. package/dist/config-Bj2Ixq3d.js +26 -0
  80. package/dist/{config-BIjREpyE.js → config-bs_kZeYq.js} +12 -7
  81. package/dist/{config-report--Xb9APJS.js → config-report-DSpsLpCE.js} +15 -5
  82. package/dist/{connection-DUsczpB5.js → connection-DjhIJSs2.js} +6 -5
  83. package/dist/{context-DieZVJXu.js → context-B_u3_bDJ.js} +2 -2
  84. package/dist/convex/index.d.ts +11 -10
  85. package/dist/convex/index.js +6 -4
  86. package/dist/create-B30OMUOJ.d.ts +107 -0
  87. package/dist/create-CBMmFie-.d.ts +138 -0
  88. package/dist/create-CGm28gyI.js +130 -0
  89. package/dist/create-CQWIpUG-.js +403 -0
  90. package/dist/{create-BBO24vj6.js → create-DCF2SvoT.js} +31 -32
  91. package/dist/create-D_NmPOdH.d.ts +110 -0
  92. package/dist/{credential-kue0qpbm.js → credential-BcoiejpY.js} +152 -31
  93. package/dist/credentials-DPyHmYz5.js +74 -0
  94. package/dist/delegation-j6-rc37o.js +286 -0
  95. package/dist/delivery/index.d.ts +5 -0
  96. package/dist/delivery/index.js +5 -0
  97. package/dist/delivery-DCAgNyCn.js +499 -0
  98. package/dist/delivery-event-xX4obB8F.js +40 -0
  99. package/dist/{denied-text-DfRk15uw.d.ts → denied-text-CiFQNuMV.d.ts} +5 -5
  100. package/dist/{describe-C3ldA9os.d.ts → describe-B5qgDvEW.d.ts} +2 -2
  101. package/dist/{describe-Cgkp7eP0.js → describe-BybMRY7A.js} +6 -2
  102. package/dist/device-BARQ8eYG.js +193 -0
  103. package/dist/{diff-rpqoe7Ag.js → diff-3jbx6Rm4.js} +60 -54
  104. package/dist/diff-CmuSD3vc.js +37 -0
  105. package/dist/doctor-3ZqNHX_G.js +44 -0
  106. package/dist/{doctor-owlv6ddh.js → doctor-BdZw53-k.js} +245 -50
  107. package/dist/drizzle/index.d.ts +5 -3
  108. package/dist/drizzle/index.js +2 -2
  109. package/dist/elysia/index.d.ts +16 -13
  110. package/dist/elysia/index.js +13 -12
  111. package/dist/env-DJZrPjRi.js +8 -0
  112. package/dist/errors-BDUwg2qC.js +27 -0
  113. package/dist/{errors-drnfxYtm.js → errors-BKy0EfhN.js} +5 -9
  114. package/dist/errors-BWXBMaKK.d.ts +11 -0
  115. package/dist/errors-CWTY6uih.js +143 -0
  116. package/dist/{errors-OD_4c__H.d.ts → errors-DH5QEGXh.d.ts} +2 -2
  117. package/dist/evaluate-CNClBvcj.js +1785 -0
  118. package/dist/evaluations-C_1vdSZc.d.ts +32 -0
  119. package/dist/{evaluations-C9YJsv3H.js → evaluations-beAooV0n.js} +145 -34
  120. package/dist/eve/index.d.ts +12 -16
  121. package/dist/eve/index.js +22 -28
  122. package/dist/event-time-CsegxXxB.js +23 -0
  123. package/dist/expiry-D4_YKRKD.js +52 -0
  124. package/dist/express/index.d.ts +13 -10
  125. package/dist/express/index.js +12 -11
  126. package/dist/fastify/index.d.ts +25 -22
  127. package/dist/fastify/index.js +13 -12
  128. package/dist/fetch-adapter-DD_gfmrC.js +120 -0
  129. package/dist/fetch-adapter-Dw0MTS3D.d.ts +31 -0
  130. package/dist/fields-OYG_JR78.js +203 -0
  131. package/dist/files-C5ZI27eV.js +124 -0
  132. package/dist/{fixtures-h2eG2OZV.js → fixtures-B7XrLeY7.js} +8 -7
  133. package/dist/flags-C3DktBDY.js +86 -0
  134. package/dist/{from-snapshot-7REQZe0H.js → from-snapshot-CTCMsFZk.js} +55 -52
  135. package/dist/{grantee-conditions-MQs5NIuX.js → grantee-conditions-CcXf8hMM.js} +4 -3
  136. package/dist/{grantee-CXY-0C87.js → grantee-hxrUsbpM.js} +16 -6
  137. package/dist/{grantee-match-fxYp9Nmt.js → grantee-match-DbENBHLB.js} +5 -4
  138. package/dist/h3/index.d.ts +37 -0
  139. package/dist/h3/index.js +35 -0
  140. package/dist/headers-BIjfMaoC.js +8 -0
  141. package/dist/headers-CIbDTUTK.d.ts +7 -0
  142. package/dist/{helpers-C9YmyBIa.js → helpers-CBYVMjwh.js} +45 -38
  143. package/dist/hono/index.d.ts +12 -9
  144. package/dist/hono/index.js +13 -12
  145. package/dist/hosted-B46-5LYE.js +315 -0
  146. package/dist/hosted-BPk51-kX.d.ts +78 -0
  147. package/dist/{http-DPuDaChb.d.ts → http-B_LphE5Y.d.ts} +1 -2
  148. package/dist/http-DXJ37RDA.js +46 -0
  149. package/dist/{http-BEbdMZ05.js → http-ujKm0JXE.js} +1 -2
  150. package/dist/{import-UHk1N7vH.js → import-CNV7I2Dw.js} +25 -20
  151. package/dist/{import-BFIlhetD.js → import-wyqXUyjm.js} +190 -53
  152. package/dist/index-B8YjkEZ4.d.ts +210 -0
  153. package/dist/index-C-6Letxg.d.ts +431 -0
  154. package/dist/index-CaxrMD1A.d.ts +1 -0
  155. package/dist/{index-BwMe94Xq.d.ts → index-Ch8LpNDp.d.ts} +34 -16
  156. package/dist/index-Cp_ilKi1.d.ts +91 -0
  157. package/dist/index-CueFnxQc.d.ts +110 -0
  158. package/dist/index-DuWxc5dt.d.ts +909 -0
  159. package/dist/index.d.ts +19 -15
  160. package/dist/index.js +31 -21
  161. package/dist/init-DeMYsnYJ.js +96 -0
  162. package/dist/init-GG6Jh8HD.js +95 -0
  163. package/dist/{instance-options-plkrsAog.d.ts → instance-options-BsVpyGIk.d.ts} +2 -2
  164. package/dist/instance-snapshot-BOEhcqIF.js +601 -0
  165. package/dist/instant-BluqDvyS.js +19 -0
  166. package/dist/internals-Dk8A8fX3.js +17 -0
  167. package/dist/{json-schema-DBkdUuCO.js → json-schema-B-vAwlde.js} +45 -6
  168. package/dist/json-schema-CN_iLFH2.d.ts +40 -0
  169. package/dist/jwt/index.d.ts +18 -11
  170. package/dist/jwt/index.js +156 -135
  171. package/dist/{kernel-CB3LrIJM.js → kernel-D0NVb1cK.js} +52 -24
  172. package/dist/kysely/index.d.ts +5 -3
  173. package/dist/kysely/index.js +2 -2
  174. package/dist/load-BxEtwlBS.js +1 -0
  175. package/dist/{load-C3_oTHyO.js → load-DFS_ry0W.js} +22 -6
  176. package/dist/{load-jose-BL6LH4bL.js → load-jose-DZ4dnjri.js} +1 -4
  177. package/dist/login-Dfe5RlYk.js +68 -0
  178. package/dist/login-imhuwvn3.js +254 -0
  179. package/dist/manifest-C8IzW3Do.js +42 -0
  180. package/dist/manifest-dvL2XEe1.js +370 -0
  181. package/dist/manifest-json-CAGzls-C.js +9 -0
  182. package/dist/{manifest-uDS9y5de.d.ts → manifest-mx5ghSFM.d.ts} +9 -2
  183. package/dist/manifest-schema-C0kK_8V0.js +399 -0
  184. package/dist/{map-claims-AVlBaJoa.js → map-claims-D3oRmTk0.js} +13 -10
  185. package/dist/{map-error-BE27PYkE.js → map-error-Dr70oA_3.js} +3 -3
  186. package/dist/{markers-CiwAOZtO.js → markers-C6joDI3o.js} +2 -1
  187. package/dist/mcp/index.d.ts +22 -12
  188. package/dist/mcp/index.js +57 -39
  189. package/dist/{migrate-BwlB5-Wk.js → migrate-CIq4-E9F.js} +53 -14
  190. package/dist/nest/index.d.ts +12 -9
  191. package/dist/nest/index.js +15 -14
  192. package/dist/next/index.d.ts +18 -21
  193. package/dist/next/index.js +13 -11
  194. package/dist/next/plugin.d.ts +1 -1
  195. package/dist/next/plugin.js +2 -2
  196. package/dist/node/index.d.ts +10 -10
  197. package/dist/node/index.js +7 -9
  198. package/dist/{ocsf-uYFXGVw2.js → ocsf-BFp-PZZA.js} +22 -11
  199. package/dist/openai/index.d.ts +9 -16
  200. package/dist/openai/index.js +17 -24
  201. package/dist/openapi/index.d.ts +3 -3
  202. package/dist/openapi/index.js +1 -1
  203. package/dist/{openapi-DBzHQbov.js → openapi-B7HZ0f-r.js} +8 -8
  204. package/dist/openapi-C4dDTVEd.js +138 -0
  205. package/dist/{openapi-BJdBmYDG.js → openapi-DD1SV-5-.js} +10 -9
  206. package/dist/operation-findings-DgATDpvh.js +36 -0
  207. package/dist/operations-X0VM7F3m.d.ts +59 -0
  208. package/dist/orpc/index.d.ts +13 -10
  209. package/dist/orpc/index.js +20 -15
  210. package/dist/otel/index.d.ts +3 -2
  211. package/dist/otel/index.js +30 -7
  212. package/dist/output-1im__-08.js +88 -0
  213. package/dist/output-files-B3IZJksC.js +1 -0
  214. package/dist/{output-files-CgIsvdSa.js → output-files-DhRBBE4n.js} +24 -26
  215. package/dist/{permission-keys-B26jeyUv.js → ownership-DqaJNJPn.js} +1045 -153
  216. package/dist/{package-root-DtNnpmUd.js → package-root-Dk_ETdkp.js} +1 -1
  217. package/dist/{parse-CVFQHk6c.js → parse-Cxq0WxrA.js} +2 -2
  218. package/dist/{parse-local-manifest-DvYUR0QL.d.ts → parse-local-manifest-5ODwqu8b.d.ts} +1 -1
  219. package/dist/{parse-local-manifest-C-q02Pal.js → parse-local-manifest-CVSs6J9I.js} +1 -1
  220. package/dist/parse-request-D_tUXG6M.js +26 -0
  221. package/dist/paths-DXSHAMIa.js +42 -0
  222. package/dist/pdp/index.d.ts +7 -3
  223. package/dist/pdp/index.js +45 -26
  224. package/dist/{peer-BOr_kJE1.js → peer-C8swJ2GH.js} +23 -4
  225. package/dist/peer-CRvC7Hg1.js +1 -0
  226. package/dist/permdock-BrAscV28.js +868 -0
  227. package/dist/permdock-SV8ZINYT.d.ts +502 -0
  228. package/dist/{permission-registry-BsblpB-z.js → permission-registry-Br4jSNVi.js} +3 -3
  229. package/dist/permissions-B-wCP5ZC.js +30 -0
  230. package/dist/{permissions-CCJ6lmxB.js → permissions-BPxlwVhN.js} +4 -3
  231. package/dist/{permissions-COH-KRgT.d.ts → permissions-u_KHg-sN.d.ts} +1 -2
  232. package/dist/policies-DP2nqRoF.js +295 -0
  233. package/dist/{policy-ur0BBK_e.d.ts → policy-77FSAq_V.d.ts} +2 -2
  234. package/dist/{hosted-CBHgkzDl.js → policy-DbM5YYtV.js} +17 -273
  235. package/dist/policy-from-catalog-C2gMa2Dj.js +450 -0
  236. package/dist/policy-module-CTlwMvLI.js +89 -0
  237. package/dist/{policy-types-sp9P1iIV.d.ts → policy-types-n0uRTsW8.d.ts} +460 -632
  238. package/dist/postgrest-CEgRbefE.d.ts +100 -0
  239. package/dist/postgrest-DAjUkF9w.js +575 -0
  240. package/dist/{powersync-cZe4kzhL.js → powersync-BkWWCS1K.js} +23 -24
  241. package/dist/powersync-DISt6SUe.js +62 -0
  242. package/dist/powersync-MMJ2mI2q.js +1 -0
  243. package/dist/preset/index.d.ts +146 -0
  244. package/dist/preset/index.js +1 -0
  245. package/dist/preset-DZdU0tne.js +1768 -0
  246. package/dist/principal-source-pHneukrx.js +103 -0
  247. package/dist/prisma/index.d.ts +6 -3
  248. package/dist/prisma/index.js +2 -2
  249. package/dist/{problem-CnWraVhC.js → problem-CTviyH5L.js} +13 -23
  250. package/dist/{problem-details-rIIo8B2C.d.ts → problem-details-B45V5d2b.d.ts} +1 -1
  251. package/dist/{problem-details-DECUnXAn.js → problem-details-cn5X30gZ.js} +43 -40
  252. package/dist/problem-types-CJ2325SZ.js +5 -0
  253. package/dist/{prompt-CXYhLfsS.js → prompt-DfZLJLIn.js} +2 -2
  254. package/dist/{protected-BN7BUdY1.js → protected-BlF0F6wL.js} +21 -4
  255. package/dist/{protected-B3_P7xuw.d.ts → protected-RFGpakN9.d.ts} +16 -8
  256. package/dist/{provider-Bi-0HNL3.js → provider-B1al-AZz.js} +2 -2
  257. package/dist/{provider-kwHC9CZD.d.ts → provider-DILL9oPK.d.ts} +1 -1
  258. package/dist/{provider-store-Ctt-81Ni.js → provider-store-DM6DNcta.js} +2 -2
  259. package/dist/pull-CvpINcMK.js +1 -0
  260. package/dist/pull-jEwbf80J.js +256 -0
  261. package/dist/push-BD4f15co.js +116 -0
  262. package/dist/pushed-policy-CqtxkV4G.js +238 -0
  263. package/dist/pushed-policy-DCW91KQU.d.ts +57 -0
  264. package/dist/react/index.d.ts +8 -8
  265. package/dist/react/index.js +6 -6
  266. package/dist/react/provider-client.d.ts +1 -1
  267. package/dist/react/provider-client.js +1 -2
  268. package/dist/react-native/index.d.ts +24 -72
  269. package/dist/react-native/index.js +29 -25
  270. package/dist/{refs-f3imMjNW.js → refs-K6eWUJ0H.js} +1 -1
  271. package/dist/{relation-walk-BXnlLtg2.js → relation-walk-3OyDBF0S.js} +2 -2
  272. package/dist/{relations-CvmSpG67.js → relations-BnCWnJGI.js} +3 -3
  273. package/dist/renames-CGj7YwcQ.js +175 -0
  274. package/dist/{replay-COpmZUfx.d.ts → replay-Bkm-Ne4l.d.ts} +1 -1
  275. package/dist/{replay-BsOyTrdV.js → replay-Du1tJjG7.js} +2 -1
  276. package/dist/{request-context-BVM7aWNs.js → request-context-C81Pip9n.js} +3 -3
  277. package/dist/request-schema-CMreVuFM.js +148 -0
  278. package/dist/resend/index.d.ts +126 -0
  279. package/dist/resend/index.js +379 -0
  280. package/dist/{resource-relations-D1Un3pcz.js → resource-relations-D_jw0BFx.js} +1 -1
  281. package/dist/{retire-BFcxL6un.js → retire-CALjIQ7e.js} +2 -2
  282. package/dist/{revocations-Cy06JNx2.d.ts → revocations-R07lFBnX.d.ts} +2 -0
  283. package/dist/rls-BAqP4q66.js +336 -0
  284. package/dist/{rls-BEktUaqg.js → rls-DTvYd-lI.js} +288 -690
  285. package/dist/{role-builder-B4GbKM-i.js → role-builder-uWQZ4v84.js} +14 -207
  286. package/dist/{rpc-nYC3cR_u.js → rpc-VSl5ylaQ.js} +7 -7
  287. package/dist/run-CUKuz0A8.js +723 -0
  288. package/dist/run-DDwUaJDU.js +1 -0
  289. package/dist/run-ticket-DocwaTKn.d.ts +124 -0
  290. package/dist/run-ticket-sxFI6LAk.js +337 -0
  291. package/dist/{runtime-D_tMXnsq.js → runtime-D3VTAiCA.js} +1 -1
  292. package/dist/{saas-DtaA4JuW.js → saas-BCXRuXca.js} +16 -14
  293. package/dist/scan-qvOe0hS3.js +29 -0
  294. package/dist/{schema-DjQBcAP9.js → schema-B4v0Qrac.js} +102 -8
  295. package/dist/schema-yLuBWWsh.js +130 -0
  296. package/dist/scim/index.d.ts +2 -2
  297. package/dist/scim/index.js +1 -2
  298. package/dist/{scim-vFR1O5oG.js → scim-ClHtpyV3.js} +208 -76
  299. package/dist/{scopes-tvpa34ep.js → scopes-CUPSjo9q.js} +12 -7
  300. package/dist/server/index.d.ts +12 -143
  301. package/dist/server/index.js +12 -9
  302. package/dist/server-C3WXAHZj.js +453 -0
  303. package/dist/{server-types-DdqBwZN_.d.ts → server-types-CKQiCnON.d.ts} +51 -68
  304. package/dist/{sha256-BO0swRXL.js → sha256-D9ihqmvd.js} +8 -1
  305. package/dist/{shared-1uhI-e-b.js → shared-BAK8t4Uo.js} +20 -9
  306. package/dist/{shared-JhMeOsDF.js → shared-DvvFzYXe.js} +8 -9
  307. package/dist/signals-D3NcTKUS.js +32 -0
  308. package/dist/sink-4-eQIRWf.d.ts +225 -0
  309. package/dist/sink-BEZSlMS_.js +957 -0
  310. package/dist/{skills-BZdRQkxs.js → skills-B6lVdD_W.js} +13 -6
  311. package/dist/skills-CTYwkl44.js +51 -0
  312. package/dist/snapshot-B7DkYg6g.js +269 -0
  313. package/dist/{snapshot-cache-Cod40D-X.js → snapshot-cache-DZHQ0KF6.js} +11 -5
  314. package/dist/{snapshot-cache-J5T7t_vD.d.ts → snapshot-cache-PXI-vGpY.d.ts} +7 -5
  315. package/dist/solid/index.d.ts +11 -12
  316. package/dist/solid/index.js +7 -7
  317. package/dist/solid-start/index.d.ts +52 -0
  318. package/dist/solid-start/index.js +49 -0
  319. package/dist/{sources-Dljy06zL.d.ts → sources-Xc4zkszI.d.ts} +7 -13
  320. package/dist/{sources-B1-b-R0t.js → sources-vs5dGOsS.js} +125 -119
  321. package/dist/{sql-t8teWOfo.js → sql-B5T1IL83.js} +13 -1
  322. package/dist/src-Cu2m75uo.js +1860 -0
  323. package/dist/ssf/index.d.ts +4 -4
  324. package/dist/ssf/index.js +384 -47
  325. package/dist/standard-webhooks-DgFFD-Ga.js +228 -0
  326. package/dist/standard-webhooks-rbD7LS6h.d.ts +88 -0
  327. package/dist/storage-C2bWdvJH.js +132 -0
  328. package/dist/{store-ILkLUj_o.js → store-BDutJkDL.js} +40 -53
  329. package/dist/{store-options-CbUHDoSe.js → store-options-u0ycEe8s.js} +26 -21
  330. package/dist/{stores-Cxz_80g-.d.ts → stores-BUGNbJTt.d.ts} +7 -8
  331. package/dist/{stores-BHXdSbw9.js → stores-CGhM8BN_.js} +2 -2
  332. package/dist/{stream-Dwsg6WwE.d.ts → stream-CeCMJmBB.d.ts} +2 -2
  333. package/dist/{stream-BMui98KK.js → stream-CvdUS9V1.js} +9 -2
  334. package/dist/style-DiKWnAvn.js +1 -0
  335. package/dist/{style-CTm1AXDT.js → style-Uao76wO7.js} +3 -2
  336. package/dist/subject-BGoM5o8B.js +17 -0
  337. package/dist/supabase/index.d.ts +23 -106
  338. package/dist/supabase/index.js +5 -4
  339. package/dist/supabase/middleware.d.ts +7 -6
  340. package/dist/supabase/middleware.js +13 -11
  341. package/dist/supabase-By_frk3U.js +92 -0
  342. package/dist/{supabase-hook-Cva3ikXz.js → supabase-hook-BMoEhZir.js} +960 -64
  343. package/dist/supabase-hook-CCw5m35C.js +1 -0
  344. package/dist/{supabase-C1TWlnYt.js → supabase-x5JtR2tc.js} +99 -206
  345. package/dist/support-session-C6xJQYut.js +158 -0
  346. package/dist/svelte/Protected.svelte +4 -4
  347. package/dist/svelte/index.d.ts +7 -7
  348. package/dist/svelte/index.js +10 -10
  349. package/dist/svelte/runtime.d.ts +3 -3
  350. package/dist/svelte/runtime.js +3 -3
  351. package/dist/svelte/source.d.ts +7 -7
  352. package/dist/svelte/source.js +4 -4
  353. package/dist/sveltekit/index.d.ts +51 -0
  354. package/dist/sveltekit/index.js +27 -0
  355. package/dist/tanstack-start/index.d.ts +51 -0
  356. package/dist/tanstack-start/index.js +40 -0
  357. package/dist/target-Bw37TFNA.js +51 -0
  358. package/dist/{tenancy-DshjqY0n.js → tenancy-DN2QAx9z.js} +5 -5
  359. package/dist/terminal/index.d.ts +11 -9
  360. package/dist/terminal/index.js +23 -287
  361. package/dist/testing/index.d.ts +311 -38
  362. package/dist/testing/index.js +3475 -201
  363. package/dist/testing/saas/index.d.ts +9 -8
  364. package/dist/testing/saas/index.js +2 -2
  365. package/dist/testing/saas/permissions.d.ts +1 -1
  366. package/dist/testing/saas/permissions.js +1 -2
  367. package/dist/text-BMFRfBqc.js +8 -0
  368. package/dist/{text-diff-BdkkYSbi.js → text-diff-BQcUapOb.js} +1 -1
  369. package/dist/thenable-yD7SabqG.js +31 -0
  370. package/dist/time-DkWjdL98.js +71 -0
  371. package/dist/{token-Bx9qy30p.js → token-BLZcjQgt.js} +15 -6
  372. package/dist/{tool-refusal-CQ7OEia9.js → tool-refusal-CMLN5xhn.js} +2 -2
  373. package/dist/trpc/index.d.ts +12 -9
  374. package/dist/trpc/index.js +16 -14
  375. package/dist/types-8RnwUAvE.d.ts +107 -0
  376. package/dist/{store-9KO4BlkB.d.ts → types-B3_ooZgZ.d.ts} +100 -75
  377. package/dist/{types-Br9IXUBG.d.ts → types-BdtSDbBO.d.ts} +77 -17
  378. package/dist/types-BtHtcKMr.d.ts +157 -0
  379. package/dist/{types-CqrjB9o6.d.ts → types-BzzaHxt3.d.ts} +23 -11
  380. package/dist/types-C791HFu9.d.ts +332 -0
  381. package/dist/types-C863OQiR.d.ts +57 -0
  382. package/dist/{types-ByUo56un.d.ts → types-CVZSNocA.d.ts} +23 -22
  383. package/dist/{types-DHrmBJLH.d.ts → types-CX7AvRqP.d.ts} +7 -7
  384. package/dist/types-C_IiEs64.d.ts +65 -0
  385. package/dist/{types-7rJVLWe5.d.ts → types-Dfv0aTER.d.ts} +63 -11
  386. package/dist/types-DqzsnlSA.js +67 -0
  387. package/dist/{types-DpWfQdSh.d.ts → types-Druu9wLM.d.ts} +46 -11
  388. package/dist/{types-CIlTojhq.d.ts → types-_WhUP7ud.d.ts} +9 -6
  389. package/dist/{types-CUcFZfpU.d.ts → types-lUlG3TVd.d.ts} +2 -1
  390. package/dist/unplugin/index.d.ts +1 -1
  391. package/dist/unplugin/index.js +2 -2
  392. package/dist/usage-CRVl9V3t.js +32 -0
  393. package/dist/usage-CZpSQP6L.js +1 -0
  394. package/dist/{usage-CG9nOYZw.js → usage-SveTRTyr.js} +54 -11
  395. package/dist/{validation-error-BSSw0l_8.d.ts → validation-error-DHUrAkku.d.ts} +1 -1
  396. package/dist/{validity-dVrUEPJt.js → validity-CZ7-y0Cj.js} +32 -15
  397. package/dist/{verifier-DMr_Zmb_.js → verifier-DHuh-okk.js} +18 -7
  398. package/dist/{verify-BztUB3GX.js → verify-BaAKx7t6.js} +645 -50
  399. package/dist/{version-BEogC-rB.js → version-CEbQ5UeM.js} +4 -3
  400. package/dist/version-DXkYUISx.js +1 -0
  401. package/dist/{views-CJsrBS1f.js → views-DTIIO-oQ.js} +22 -5
  402. package/dist/{permission-types-Dg39z9Kv.d.ts → vocabulary-CN8H_9UF.d.ts} +67 -2
  403. package/dist/vue/index.d.ts +9 -10
  404. package/dist/vue/index.js +8 -8
  405. package/dist/waiter-B986w1oK.d.ts +36 -0
  406. package/dist/waiter-BGUtGYoU.js +67 -0
  407. package/dist/watch--ovlPOc0.js +1 -0
  408. package/dist/{watch-zeucB7eF.js → watch-vea54PRw.js} +44 -5
  409. package/dist/webmcp/index.d.ts +2 -2
  410. package/dist/webmcp/index.js +3 -3
  411. package/dist/where-scope-C9vfEphl.js +306 -0
  412. package/dist/who-can-DWBAcaCQ.js +364 -0
  413. package/dist/wire-delegation-Cv3W2eaM.js +36 -0
  414. package/dist/wire-denial-C7PaVYEM.js +27 -0
  415. package/dist/workflow/index.d.ts +5 -0
  416. package/dist/workflow/index.js +223 -0
  417. package/dist/workflow-sdk/index.d.ts +56 -0
  418. package/dist/workflow-sdk/index.js +78 -0
  419. package/dist/{wrap-Cr93qqdP.d.ts → wrap-C5jC6sKI.d.ts} +2 -1
  420. package/dist/{wrap-DWsU_5Bd.js → wrap-gX61EtpB.js} +7 -6
  421. package/package.json +136 -37
  422. package/schemas/access-event-v1.json +118 -0
  423. package/schemas/approval-request-v1.json +34 -1
  424. package/schemas/approval-signature-v1.json +94 -0
  425. package/schemas/automation-event-v1.json +113 -0
  426. package/schemas/capability-v1.json +84 -0
  427. package/schemas/catalog-event-v1.json +87 -0
  428. package/schemas/catalog-v1.json +123 -12
  429. package/schemas/cli-commands-v1.json +164 -0
  430. package/schemas/cli-result-v1.json +96 -0
  431. package/schemas/cloud-api-v1.json +5407 -0
  432. package/schemas/connector-v1.json +408 -0
  433. package/schemas/credential-event-v1.json +81 -0
  434. package/schemas/credential-v1.json +134 -0
  435. package/schemas/decision-event-v1.json +288 -0
  436. package/schemas/delivery-event-v1.json +117 -0
  437. package/schemas/directory-event-v1.json +85 -0
  438. package/schemas/evidence-export-v1.json +54 -0
  439. package/schemas/membership-event-v1.json +93 -0
  440. package/schemas/policy-v1.json +68 -0
  441. package/schemas/pushed-policy-v1.json +236 -0
  442. package/schemas/run-v1.json +162 -0
  443. package/schemas/snapshot-v1.json +138 -0
  444. package/schemas/supabase-claims-v1.json +4 -4
  445. package/schemas/supabase-manifest-v1.json +5 -1
  446. package/schemas/support-session-v1.json +111 -0
  447. package/skills/permdock/SKILL.md +16 -12
  448. package/skills/permdock-agents/SKILL.md +40 -23
  449. package/skills/permdock-agents/references/operations-automations-chat.md +221 -0
  450. package/skills/permdock-agents/references/runtimes.md +22 -18
  451. package/skills/permdock-approvals/SKILL.md +29 -13
  452. package/skills/permdock-approvals/references/delivery-and-waiters.md +172 -0
  453. package/skills/permdock-approvals/references/stores-and-resume.md +21 -7
  454. package/skills/permdock-audit/SKILL.md +3 -3
  455. package/skills/permdock-credentials/SKILL.md +5 -5
  456. package/skills/permdock-credentials/references/tokens-keys-links.md +14 -10
  457. package/skills/permdock-data/SKILL.md +6 -6
  458. package/skills/permdock-data/references/queries-and-rls.md +10 -9
  459. package/skills/permdock-data/references/relationships.md +3 -3
  460. package/skills/permdock-tenancy/SKILL.md +20 -7
  461. package/skills/permdock-tenancy/references/contacts-and-support-sessions.md +122 -0
  462. package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +6 -4
  463. package/skills/permdock-wire/SKILL.md +17 -11
  464. package/skills/permdock-wire/references/adapters.md +139 -51
  465. package/skills/permdock-wire/references/policy-options.md +5 -5
  466. package/skills/permdock-wire/references/presets-and-recipes.md +58 -0
  467. package/dist/approvals-DZL76lKW.js +0 -240
  468. package/dist/arazzo-CD8d0WLb.js +0 -54
  469. package/dist/catalog-6yWAX6Ps.js +0 -2
  470. package/dist/catalog-WHG4kBq7.js +0 -48
  471. package/dist/cloud-C7bSDgX4.js +0 -50
  472. package/dist/cloud-PeBN3IEn.js +0 -118
  473. package/dist/collect-Bw2Jdq1q.js +0 -2
  474. package/dist/collect-CQx4hX4N.js +0 -83
  475. package/dist/commands-Cpip4ULx.js +0 -97
  476. package/dist/config-DLt6BvV7.js +0 -36
  477. package/dist/diff-Cnghh_Ip.js +0 -48
  478. package/dist/doctor-CuVJvhV_.js +0 -53
  479. package/dist/duration-xK2jGFVc.js +0 -25
  480. package/dist/errors-CWfoNg9N.js +0 -47
  481. package/dist/errors-DRnGZHzF.js +0 -30
  482. package/dist/expiry-BoBJ8Tvc.js +0 -7
  483. package/dist/fields-fwfXN01n.js +0 -1016
  484. package/dist/headers-BZSDieNT.js +0 -6
  485. package/dist/headers-Cf-zWvsO.d.ts +0 -6
  486. package/dist/ids-DC4V4CFu.js +0 -18
  487. package/dist/index-DgM7w96K.d.ts +0 -6
  488. package/dist/index-Dz7didpC.d.ts +0 -201
  489. package/dist/index-UdVQgq48.d.ts +0 -550
  490. package/dist/load-B_shHrmd.js +0 -2
  491. package/dist/manifest-BngWKryL.js +0 -770
  492. package/dist/may-use-BOn_dR_w.js +0 -78
  493. package/dist/openapi-DcQ1Kg40.js +0 -164
  494. package/dist/ownership-BgnbOJFT.js +0 -851
  495. package/dist/permdock-L26udHSk.js +0 -3646
  496. package/dist/powersync-BFSbSElQ.js +0 -62
  497. package/dist/powersync-DCDgZgfZ.js +0 -2
  498. package/dist/rls-55DQTuf5.js +0 -250
  499. package/dist/run-DMcNW_8T.js +0 -174
  500. package/dist/server-ZYEHtNHS.js +0 -268
  501. package/dist/sink-BTtmfPnE.js +0 -141
  502. package/dist/sink-CPN4zLfs.d.ts +0 -104
  503. package/dist/skills-Dle4ZoLF.js +0 -56
  504. package/dist/snapshot-Dc9CHPME.js +0 -1078
  505. package/dist/src-Bb7no-hS.js +0 -639
  506. package/dist/subject-C6dLxqHU.js +0 -24
  507. package/dist/supabase-Dbqr141s.js +0 -83
  508. package/dist/supabase-hook-BULg7Ut_.js +0 -2
  509. package/dist/thenable-QSmvt-vZ.js +0 -65
  510. package/dist/types-C0dee0Qf.d.ts +0 -197
  511. package/dist/types-DvupZE0w.d.ts +0 -9
  512. package/dist/usage-4G6t643F.js +0 -42
  513. package/dist/usage-iFLJ0-rr.js +0 -2
  514. package/dist/vocabulary-hhEFLFoL.d.ts +0 -65
  515. package/dist/watch-C8TpsAl4.js +0 -2
@@ -1,5 +1,4 @@
1
- import { D as AppData, O as AppDataSchema, d as Permission, f as PermissionKind, k as MetaValue, p as PermissionTree, y as ResourceNode } from "./permission-types-Dg39z9Kv.js";
2
- import { a as RoleTree, i as RoleMeta, n as PlanTree, r as Role, t as Plan } from "./vocabulary-hhEFLFoL.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";
3
2
  //#region src/conditions/ast.d.ts
4
3
  type ConditionRef = {
5
4
  readonly ref: string;
@@ -164,6 +163,22 @@ type FieldWhere<V> = V | FieldOperator | {
164
163
  readonly ref: string;
165
164
  };
166
165
  //#endregion
166
+ //#region src/core/open-union.d.ts
167
+ /**
168
+ * A string union that stays open: the listed values autocomplete, and an
169
+ * integrator may pass its own. Only for ids that core compares for equality,
170
+ * where an unknown value can only fail to match. A union whose members core
171
+ * interprets one by one (denial reasons, approval modes, condition operators,
172
+ * credential kinds, delivery channels) stays closed.
173
+ */
174
+ type OpenUnion<T extends string> = T | (string & NonNullable<unknown>);
175
+ /** `actor.kind`: the values PermDock's adapters set, or an integrator's own; a policy delegation matches it by equality. */
176
+ type ActorKind = OpenUnion<"mcp-client" | "oauth-client" | "support" | "impersonation" | "ai-sdk" | "claude-agent" | "openai-agent" | "eve" | "terminal" | "web-bot-auth" | "a2a-agent" | "automation" | "job" | "caller" | "workload">;
177
+ /** The adapter a decision event names: a PermDock entry, or an integrator's own adapter. */
178
+ type AdapterId = OpenUnion<"server" | "next" | "hono" | "express" | "fastify" | "elysia" | "nest" | "node" | "h3" | "sveltekit" | "astro" | "solid-start" | "tanstack-start" | "trpc" | "orpc" | "supabase-middleware" | "convex" | "authzen" | "mcp" | "a2a" | "agent" | "ai-sdk" | "claude-agent" | "openai" | "eve" | "terminal" | "webmcp" | "workflow" | "chat" | "delivery">;
179
+ /** How a membership was obtained (`membership.via`); `viaOnly` and support rules match it by equality. */
180
+ type MembershipVia = OpenUnion<"direct" | "contact" | "credential" | "elevated" | "feed" | "link" | "share" | "support" | "support-session" | "scim">;
181
+ //#endregion
167
182
  //#region src/core/subject.d.ts
168
183
  type JsonWebKeyLike = {
169
184
  readonly kty?: string;
@@ -208,13 +223,13 @@ type Membership = {
208
223
  readonly roles: readonly string[];
209
224
  /** Roles the holder may activate here but does not hold; `permdock.activate` writes an elevated membership. */
210
225
  readonly eligible?: readonly string[];
211
- readonly via?: string;
226
+ readonly via?: MembershipVia;
212
227
  readonly expiresAt?: number;
213
228
  /** The principal id that wrote this membership: who elevated, consented to or granted the access. */
214
229
  readonly grantedBy?: string;
215
230
  /** Free text recording why the membership was written: the activation or consent justification. */
216
231
  readonly reason?: string;
217
- /** A subgroup the holder belongs to inside the instance (`vendor-support`); a `fromJunction` group column fills it. */
232
+ /** A subgroup the holder belongs to inside the instance (`vendor-support`); a `junctionMembershipSource` group column fills it. */
218
233
  readonly member?: {
219
234
  readonly group: string;
220
235
  };
@@ -271,6 +286,7 @@ type TenantCustomRole = CustomRoleBody & {
271
286
  readonly id?: string;
272
287
  /** Input only: `scope` = the second scope, `id` = this team. */
273
288
  readonly team?: string;
289
+ readonly shared?: undefined;
274
290
  };
275
291
  /**
276
292
  * A role the platform defines, held through `principal.roles` like a declared
@@ -282,12 +298,33 @@ type GlobalCustomRole = CustomRoleBody & {
282
298
  readonly tenant?: undefined;
283
299
  readonly id?: undefined;
284
300
  readonly team?: undefined;
301
+ readonly shared?: undefined;
302
+ };
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;
285
316
  };
286
- type CustomRole = TenantCustomRole | GlobalCustomRole;
317
+ type CustomRole = TenantCustomRole | SharedCustomRole | GlobalCustomRole;
287
318
  type Principal = {
288
319
  readonly id: string;
289
320
  readonly issuer?: string;
290
- readonly kind?: "user" | "service" | "workload" | "link";
321
+ /**
322
+ * `contact`: an external person (a customer contact, a portal user). Only
323
+ * its `{ on }` memberships count; it never approves, creates keys or
324
+ * publishes, and is read-only unless a role whose `for` lists `contact`
325
+ * grants the write.
326
+ */
327
+ readonly kind?: "user" | "service" | "workload" | "link" | "feed" | "contact";
291
328
  readonly roles?: readonly string[];
292
329
  readonly plans?: readonly string[];
293
330
  readonly memberships?: readonly Membership[];
@@ -302,9 +339,9 @@ type Principal = {
302
339
  };
303
340
  type Actor = {
304
341
  readonly id: string;
305
- readonly kind: string;
342
+ readonly kind: ActorKind;
306
343
  readonly binding?: Binding;
307
- /** `true` narrows every policy delegation to this actor to its read-only permissions (`readOnlyHint`). */
344
+ /** `true` denies every permission without `readOnlyHint` (`not-delegated`), with or without a policy delegation. */
308
345
  readonly readOnly?: boolean;
309
346
  /** The stable name the application gives this OAuth client (`ClientNames`), set by the subject resolver from the verified client id; policy delegations match it with `to: { kind, client }`. */
310
347
  readonly client?: string;
@@ -340,12 +377,12 @@ type Subject<TPrincipal extends Principal = Principal> = {
340
377
  };
341
378
  //#endregion
342
379
  //#region src/core/decision.d.ts
343
- type DenialReason = "no-grant" | "condition" | "deny" | "inactive-grant" | "closure-error" | "opaque-condition" | "server-only" | "anonymous" | "not-delegated" | "no-delegation" | "insufficient-user-authentication" | "not-entitled" | "purpose" | "reason-required" | "actor-required" | "limit" | "limit-unavailable" | "relation-depth" | "relation-unavailable" | "validation" | "tenant-mismatch" | "no-membership" | "scope" | "expired-membership" | "stale-credentials" | "unknown-role" | "last-holder" | "max-holders" | "transfer-only" | "not-assignable-by" | "self-demotion" | "externally-managed" | "not-allowed-for-membership" | "conflicting-role" | "approval" | "stale-approval" | "pdp-denied" | "pdp-unavailable" | "pdp-invalid-response" | "undocumented" | "unsupported" | "exceeds-creator" | "credential-policy";
380
+ type DenialReason = "no-grant" | "condition" | "deny" | "inactive-grant" | "closure-error" | "opaque-condition" | "server-only" | "anonymous" | "not-delegated" | "no-delegation" | "agent-tool-not-delegated" | "insufficient-user-authentication" | "not-entitled" | "purpose" | "reason-required" | "actor-required" | "limit" | "limit-unavailable" | "relation-depth" | "relation-unavailable" | "validation" | "tenant-mismatch" | "no-membership" | "scope" | "expired-membership" | "stale-credentials" | "unknown-role" | "last-holder" | "max-holders" | "transfer-only" | "not-assignable-by" | "self-demotion" | "externally-managed" | "not-allowed-for-membership" | "conflicting-role" | "approval" | "stale-approval" | "pdp-denied" | "pdp-unavailable" | "pdp-invalid-response" | "undocumented" | "unsupported" | "exceeds-creator" | "credential-policy";
344
381
  /** The `detail` each denial reason carries, where PermDock sets a structured one. */
345
382
  type DenialDetails = {
346
383
  readonly limit: LimitDetail;
347
384
  /** The window the inactive allow applies in. */
348
- readonly "inactive-grant": GrantValidity;
385
+ readonly "inactive-grant": WireValidity;
349
386
  /** The matching deny's declared `name`. */
350
387
  readonly deny: {
351
388
  readonly name?: string;
@@ -399,19 +436,19 @@ type AppObligation = {
399
436
  readonly name: string;
400
437
  readonly detail?: MetaValue;
401
438
  };
402
- /** What is left of the `limit` that applied; `resetsAt` is Unix seconds. */
439
+ /** What is left of the `limit` that applied; `resetsAt` is RFC 3339. */
403
440
  type Quota = {
404
441
  readonly remaining: number;
405
- readonly resetsAt: number;
442
+ readonly resetsAt: string;
406
443
  };
407
444
  /**
408
- * The `detail` of a `limit` denial: the grant's `count`, its window in
409
- * seconds and when the window resets (Unix seconds).
445
+ * The `detail` of a `limit` denial: the grant's `count`, its `per` window
446
+ * in seconds and when the window resets (RFC 3339).
410
447
  */
411
448
  type LimitDetail = {
412
449
  readonly count: number;
413
- readonly window: number;
414
- readonly resetsAt: number;
450
+ readonly per: number;
451
+ readonly resetsAt: string;
415
452
  };
416
453
  /**
417
454
  * Why a candidate grant for the permission was passed over before its
@@ -596,65 +633,35 @@ declare function allOf(...items: readonly ApproverInput[]): readonly ApproverInp
596
633
  /** A named approver for `approval.by`, matched on the approver's principal id. */
597
634
  declare function user(id: string): UserApprover;
598
635
  //#endregion
599
- //#region src/core/arazzo.d.ts
600
- type ArazzoSimulateInput = {
601
- readonly arazzo: unknown;
602
- readonly openapi: unknown;
603
- readonly workflowId?: string;
604
- readonly permissions?: PermissionTree;
605
- readonly inputs?: Readonly<Record<string, unknown>>;
606
- };
607
- type ArazzoStepResult = {
608
- readonly stepId: string;
609
- /** The nested workflow that owns the step, when it is not the plan's workflow. */
610
- readonly workflowId?: string;
611
- readonly operationId?: string;
612
- readonly permissions: readonly Permission[];
613
- readonly decision: Decision;
614
- readonly provisional?: true;
615
- };
616
- type ArazzoPlan = {
617
- readonly workflowId: string;
618
- readonly outcome: Decision["outcome"];
619
- readonly steps: readonly ArazzoStepResult[];
620
- };
621
- type ArazzoFinding = {
622
- readonly stepId: string;
623
- readonly workflowId: string;
624
- readonly reason: "undocumented" | "unsupported" | "validation" | "unknown-key";
625
- readonly detail: string;
626
- };
627
- declare function arazzoFindings(input: ArazzoSimulateInput, tree: PermissionTree | undefined): readonly ArazzoFinding[];
628
- declare function simulateArazzo(input: ArazzoSimulateInput, tree: PermissionTree | undefined, decide: (permission: Permission, data: unknown) => Decision): ArazzoPlan;
629
- //#endregion
630
- //#region src/core/elevated.d.ts
636
+ //#region src/core/scopes.d.ts
637
+ /** One entry of `definePolicy({ scopes })`: the row field holding the scope id, and its parent scope. */
638
+ type ScopeDeclaration = {
639
+ readonly key: string;
640
+ readonly within?: string;
641
+ };
642
+ type PolicyScopesInput = Readonly<Record<string, ScopeDeclaration>>;
631
643
  /**
632
- * The only deny override: a break-glass grant overrides deny grants whose
633
- * `name` it lists, and nothing else. It is an allow that stays non-portable
634
- * (RLS never compiles it) and grants only once its `requires` are met.
644
+ * A declared scope, in declaration order. `key` is absent only on the
645
+ * implicit `tenant` / `team` pair of a policy that declares no scopes.
635
646
  */
636
- declare function breakGlass<T>(permission: Permission<string, T> | readonly Permission<string, T>[], options?: BreakGlassOptions): Omit<Grant, "role" | "scope"> | Omit<Grant, "role" | "scope">[];
647
+ type Scope = {
648
+ readonly name: string;
649
+ readonly key?: string;
650
+ readonly within?: string;
651
+ };
652
+ /** The names `role(..., { on })`, `memberOf` and memberships may use: declared names plus the aliases. */
653
+ type ScopeNames<S> = [S] extends [PolicyScopesInput] ? string extends keyof S ? string : (keyof S & string) | "tenant" | "team" : string;
654
+ //#endregion
655
+ //#region src/core/wire-delegation.d.ts
637
656
  /**
638
- * Support access with tenant consent: a role a vendor holds only through a
639
- * consented, time-bound `via: 'support'` membership. `actorRequired` denies
640
- * every decision under it without an `act`; `forbid` compiles to deny grants
641
- * scoped to `via: 'support'`.
657
+ * A delegation as every PermDock wire form carries it: OAuth `scope`
658
+ * (RFC 6749, space-separated) and RFC 9396 `authorization_details`. An empty
659
+ * `scope` is an empty scope list, which delegates nothing.
642
660
  */
643
- declare function supportAccess<const S extends string>(options: SupportAccessOptions<S> & {
644
- readonly on: S;
645
- }): RoleBinding<S>;
646
- /** Support access held in the `tenant` scope. */
647
- declare function supportAccess(options: SupportAccessOptions<never>): RoleBinding<"tenant">;
648
- type ActivateInput = {
649
- readonly role: string | Role;
650
- /** The scope the activation applies in (a declared name or the `tenant` / `team` alias). */
651
- readonly scope: string;
652
- readonly id: string;
653
- /** Ancestor scope ids, keyed by scope name, for a nested-scope activation. */
654
- readonly within?: Readonly<Record<string, string>>;
655
- /** How long the elevation lasts; capped at the role's `maxDuration`. */
656
- readonly duration?: string;
657
- readonly reason?: string;
661
+ type WireDelegation = {
662
+ readonly scope?: string;
663
+ readonly authorization_details?: readonly AuthorizationDetail[];
664
+ readonly access?: readonly GnapAccess[];
658
665
  };
659
666
  //#endregion
660
667
  //#region src/core/wire-denial.d.ts
@@ -679,7 +686,8 @@ type WireDecision = GrantedDecision | ApprovalRequiredDecision | (Omit<DeniedDec
679
686
  type DirectoryEvent = {
680
687
  readonly type: "directory";
681
688
  readonly at: string;
682
- readonly source: "scim";
689
+ /** `scim`, or an integrator's own directory sync. */
690
+ readonly source: OpenUnion<"scim">;
683
691
  readonly operation: "create" | "replace" | "patch" | "delete";
684
692
  readonly tenant: string;
685
693
  readonly resource: {
@@ -693,6 +701,8 @@ type DirectoryEvent = {
693
701
  readonly iss?: string;
694
702
  };
695
703
  readonly active?: boolean;
704
+ /** The application's own data, set where the event is built; plain JSON, never read by a decision. */
705
+ readonly x?: AppData;
696
706
  };
697
707
  type MembershipEvent = {
698
708
  readonly type: "membership";
@@ -708,9 +718,9 @@ type MembershipEvent = {
708
718
  readonly id?: string;
709
719
  /** The id of every ancestor scope, keyed by scope name. */
710
720
  readonly within?: Readonly<Record<string, string>>;
711
- readonly via?: string;
712
- /** When the membership lapses, in seconds since the epoch. */
713
- readonly expiresAt?: number;
721
+ readonly via?: MembershipVia;
722
+ /** When the membership lapses, an RFC 3339 instant. */
723
+ readonly expiresAt?: string;
714
724
  readonly roles: {
715
725
  readonly added: readonly string[];
716
726
  readonly removed: readonly string[];
@@ -719,6 +729,8 @@ type MembershipEvent = {
719
729
  readonly id: string;
720
730
  readonly kind: string;
721
731
  };
732
+ /** The application's own data, set where the event is built; plain JSON, never read by a decision. */
733
+ readonly x?: AppData;
722
734
  };
723
735
  /**
724
736
  * An API key's lifecycle: `created`, `rotated` and `revoked` from the
@@ -738,14 +750,105 @@ type CredentialEvent = {
738
750
  readonly id: string;
739
751
  };
740
752
  readonly tenant?: string;
741
- readonly expiresAt?: number;
753
+ /** When the key expires, an RFC 3339 instant. */
754
+ readonly expiresAt?: string;
742
755
  readonly by?: {
743
756
  readonly id: string;
744
757
  readonly kind: string;
745
758
  };
746
759
  readonly sample?: number;
760
+ /** The application's own data, set where the event is built; plain JSON, never read by a decision. */
761
+ readonly x?: AppData;
762
+ };
763
+ /**
764
+ * An automation's lifecycle: `published`, `changed` (a new version) and
765
+ * `revoked` from the application, `run` when a run starts. It records the
766
+ * delegation for access review; it never decides.
767
+ */
768
+ type AutomationEvent = {
769
+ readonly type: "automation";
770
+ readonly at: string;
771
+ readonly source: string;
772
+ readonly operation: "published" | "changed" | "revoked" | "run";
773
+ readonly automation: {
774
+ readonly id: string;
775
+ readonly version: number | string;
776
+ readonly mode: "publisher" | "service";
777
+ readonly name?: string;
778
+ };
779
+ /** The principal each run acts as. */
780
+ readonly principal: {
781
+ readonly id: string;
782
+ };
783
+ readonly publishedBy: string;
784
+ readonly tenant?: string;
785
+ readonly roles?: readonly string[];
786
+ /** The delegated permission keys. */
787
+ readonly permissions: readonly string[];
788
+ /** Set on `run` events only. */
789
+ readonly run?: {
790
+ readonly id: string;
791
+ };
792
+ readonly by?: {
793
+ readonly id: string;
794
+ readonly kind: string;
795
+ };
796
+ /** The application's own data, set where the event is built; plain JSON, never read by a decision. */
797
+ readonly x?: AppData;
798
+ };
799
+ type SinkEvent = DecisionEvent | DirectoryEvent | MembershipEvent | CredentialEvent | AccessEvent | AutomationEvent | DeliveryEvent;
800
+ /** A delivery channel: an email, a chat message or an outbound webhook. */
801
+ type DeliveryChannel = "email" | "chat" | "webhook";
802
+ /** What an email is for; only `notification` mail carries `List-Unsubscribe`. */
803
+ type EmailCategory = "transactional" | "notification" | "security" | "approval";
804
+ /**
805
+ * Why a delivery failed. `denied` and `unlinked` are the router's refusals of
806
+ * a recipient; the rest come from a transport or a provider webhook.
807
+ */
808
+ type DeliveryFailureCause = "denied" | "unlinked" | "no-transport" | "no-message" | "invalid-recipient" | "invalid-message" | "rate-limited" | "quota-exceeded" | "unauthorized" | "unavailable" | "suppressed" | "rejected";
809
+ /**
810
+ * One recipient's delivery: `sent` when a transport accepted it, then
811
+ * `delivered`, `bounced` or `complained` from the provider, or `failed`.
812
+ * It carries no address, only the principal the router checked.
813
+ */
814
+ type DeliveryEvent = {
815
+ readonly type: "delivery";
816
+ readonly at: string;
817
+ readonly source: string;
818
+ readonly operation: "sent" | "delivered" | "bounced" | "complained" | "failed";
819
+ readonly channel: DeliveryChannel;
820
+ /** The delivery's id and this recipient's key, sent as the `Idempotency-Key`. */
821
+ readonly delivery: {
822
+ readonly id: string;
823
+ readonly key: string;
824
+ };
825
+ /** The checked principal, or `trusted` for an address the server loaded itself. */
826
+ readonly recipient?: {
827
+ readonly principal?: {
828
+ readonly id: string;
829
+ };
830
+ readonly trusted?: true;
831
+ };
832
+ /** The permission the recipient was checked for. */
833
+ readonly permission?: string;
834
+ readonly tenant?: string;
835
+ readonly category?: EmailCategory;
836
+ /** The approval request a prompt was delivered for. */
837
+ readonly approval?: string;
838
+ /** The transport or provider, and its message id. */
839
+ readonly provider?: {
840
+ readonly name: string;
841
+ readonly id?: string;
842
+ };
843
+ /** Set on `failed` only. */
844
+ readonly cause?: DeliveryFailureCause;
845
+ /** Set on `failed` only: whether a retry with the same key may succeed. */
846
+ readonly retryable?: boolean;
847
+ /** The denial reason when `cause` is `denied`. */
848
+ readonly reason?: string;
849
+ /** The application's own data, set where the event is built; plain JSON, never read by a decision. */
850
+ readonly x?: AppData;
747
851
  };
748
- type SinkEvent = DecisionEvent | DirectoryEvent | MembershipEvent | CredentialEvent | AccessEvent;
749
852
  /**
750
853
  * A support-access session lifecycle event: a tenant consented to vendor
751
854
  * support (`started`), the session lapsed (`ended`), or the tenant pulled
@@ -762,12 +865,13 @@ type AccessEvent = {
762
865
  readonly id: string;
763
866
  };
764
867
  /** The membership kind the session runs under (`support`). */
765
- readonly via: string;
868
+ readonly via: MembershipVia;
766
869
  readonly roles: readonly string[];
767
870
  readonly member?: {
768
871
  readonly group: string;
769
872
  };
770
- readonly expiresAt?: number;
873
+ /** When the session lapses, an RFC 3339 instant. */
874
+ readonly expiresAt?: string;
771
875
  /** The tenant principal that consented. */
772
876
  readonly grantedBy?: string;
773
877
  readonly reason?: string;
@@ -775,9 +879,19 @@ type AccessEvent = {
775
879
  readonly id: string;
776
880
  readonly kind: string;
777
881
  };
882
+ /** A `SupportSession`: its id and the principal the staff member views as. */
883
+ readonly session?: {
884
+ readonly id: string;
885
+ readonly principal: string;
886
+ };
887
+ /** A `SupportSession`'s permission keys. */
888
+ readonly permissions?: readonly string[];
889
+ /** The application's own data, set where the event is built; plain JSON, never read by a decision. */
890
+ readonly x?: AppData;
778
891
  };
779
892
  type DecisionEvent = {
780
893
  readonly type: "decision";
894
+ /** An RFC 3339 instant. */
781
895
  readonly at: string;
782
896
  readonly outcome: "granted" | "denied" | "approval-required";
783
897
  readonly permission: string;
@@ -796,18 +910,23 @@ type DecisionEvent = {
796
910
  readonly id: string;
797
911
  readonly kind: string;
798
912
  };
799
- readonly delegation?: {
800
- readonly scopes?: readonly string[];
801
- readonly authorizationDetails?: readonly unknown[];
802
- };
913
+ /** OAuth `scope` and RFC 9396 `authorization_details`, as every wire form carries a delegation. */
914
+ readonly delegation?: WireDelegation;
803
915
  /** The API key the subject came from. */
804
916
  readonly credential?: {
805
917
  readonly id: string;
806
918
  readonly kind: CredentialKind;
807
919
  };
920
+ /** The support session the subject came from: the `id` its `access` events carry as `session.id`. */
921
+ readonly supportSession?: {
922
+ readonly id: string;
923
+ };
808
924
  };
809
925
  readonly tenant?: string;
810
- readonly membership?: Membership;
926
+ /** The membership that answered, with `expiresAt` as an RFC 3339 instant. */
927
+ readonly membership?: Omit<Membership, "expiresAt"> & {
928
+ readonly expiresAt?: string;
929
+ };
811
930
  readonly via?: string | null;
812
931
  readonly matched?: {
813
932
  readonly role: string | null;
@@ -830,19 +949,27 @@ type DecisionEvent = {
830
949
  readonly alternatives?: readonly string[];
831
950
  readonly token?: string;
832
951
  readonly trusted: boolean;
833
- readonly source: "can" | "decide" | "assert" | "filter" | "endpoint" | "adapter" | "approval" | "simulate" | "explain";
834
- readonly adapter?: string;
835
- readonly phase?: "requested" | "resolved";
952
+ /** The call that produced the decision. */
953
+ readonly call: "can" | "decide" | "assert" | "filter" | "endpoint" | "adapter" | "approval" | "simulate" | "explain";
954
+ readonly adapter?: AdapterId;
955
+ /** The model id the agent model gate decided, or the model that drove the call. */
956
+ readonly model?: string;
957
+ /** Set on an approval lifecycle event (`com.permdock.approval.<phase>`). */
958
+ readonly phase?: "requested" | "resolved" | "expired" | "cancelled";
836
959
  readonly counts?: {
837
960
  readonly granted: number;
838
961
  readonly denied: number;
839
962
  readonly approvalRequired: number;
840
963
  };
964
+ /** The application's own data, set where the event is built; plain JSON, never read by a decision. */
965
+ readonly x?: AppData;
841
966
  };
842
967
  type AuthEvent = {
843
968
  readonly reason: "invalid-token" | "schema" | "unknown-role" | "groups-overflow" | "source-threw";
844
969
  readonly cause?: string;
845
970
  readonly source: string;
971
+ /** The `name` of the source that threw, when it has one. */
972
+ readonly name?: string;
846
973
  readonly kid?: string;
847
974
  readonly alg?: string;
848
975
  readonly typ?: string;
@@ -850,91 +977,11 @@ type AuthEvent = {
850
977
  readonly requestId?: string;
851
978
  };
852
979
  //#endregion
853
- //#region src/core/scopes.d.ts
854
- /** One entry of `definePolicy({ scopes })`: the row field holding the scope id, and its parent scope. */
855
- type ScopeDeclaration = {
856
- readonly key: string;
857
- readonly within?: string;
858
- };
859
- type PolicyScopesInput = Readonly<Record<string, ScopeDeclaration>>;
860
- /**
861
- * A declared scope, in declaration order. `key` is absent only on the
862
- * implicit `tenant` / `team` pair of a policy that declares no scopes.
863
- */
864
- type Scope = {
865
- readonly name: string;
866
- readonly key?: string;
867
- readonly within?: string;
868
- };
869
- /** The names `role(..., { on })`, `memberOf` and memberships may use: declared names plus the aliases. */
870
- type ScopeNames<S> = [S] extends [PolicyScopesInput] ? string extends keyof S ? string : (keyof S & string) | "tenant" | "team" : string;
871
- //#endregion
872
- //#region src/core/ownership.d.ts
873
- /** Who a role change is about: their principal id and their membership in the scope instance. */
874
- type RoleChangeTarget = {
875
- readonly id: string;
876
- /** The kind of the target's membership in the instance (`staff`, `contact`, ...). */
877
- readonly via?: string;
878
- /** The roles the target holds in the instance now. */
879
- readonly roles?: readonly string[];
880
- /** `idp` when the identity provider owns the target's membership: the application cannot change it. */
881
- readonly managedBy?: "idp";
882
- };
883
- type RoleChangeBase = {
884
- readonly kind: "assign" | "revoke" | "transfer";
885
- readonly role: string | Role;
886
- /** Ids of the instance's ancestor scopes; a holder there may assign here. */
887
- readonly within?: Readonly<Record<string, string>>;
888
- readonly target: RoleChangeTarget;
889
- /**
890
- * How many principals hold `role` in the instance now, from the
891
- * application's store. Without it a role with `min`, `max` or
892
- * `transferOnly` is denied.
893
- */
894
- readonly holders?: number;
895
- };
896
- /**
897
- * A role held at a named scope instance (`scope` is a declared name or alias
898
- * and `id` the instance), or a global role: `scope: 'global'` with no `id`.
899
- * A global change has no tenant, so `within` and `holders` do not apply to it.
900
- */
901
- type RoleChange = RoleChangeBase & ({
902
- /** The scope the role is held at (a declared name or alias). */
903
- readonly scope: string;
904
- /** The scope instance. */
905
- readonly id: string;
906
- } | {
907
- readonly scope: "global";
908
- readonly id?: undefined;
909
- });
910
- /**
911
- * `granted` names the role that authorised the change (`null` when a
912
- * `meta.manageRoles` holder or the declared-role ceiling did); `denied` lists
913
- * every rule the change breaks.
914
- */
915
- type RoleChangeDecision = {
916
- readonly outcome: "granted";
917
- readonly change: RoleChange;
918
- readonly role: string | null;
919
- } | {
920
- readonly outcome: "denied";
921
- readonly change: RoleChange;
922
- readonly denials: readonly Denial[];
923
- };
924
- type RoleChangeOptions = {
925
- /**
926
- * `true` when the application loaded `change.within` from its own store
927
- * (the instance's stored parent), not from the request. Without it, a
928
- * nested instance's tenant comes only from a live membership the actor
929
- * holds on that instance or under it.
930
- */
931
- readonly trusted?: boolean;
932
- };
933
- //#endregion
934
980
  //#region src/core/snapshot-types.d.ts
935
981
  type Snapshot = {
936
982
  readonly v: 1;
937
- readonly issuedAt: number;
983
+ /** RFC 3339. The epoch for a snapshot built without a clock. Signed, it is the token's `iat`. */
984
+ readonly issuedAt: string;
938
985
  readonly subject: {
939
986
  readonly principal: {
940
987
  readonly id: string;
@@ -943,7 +990,8 @@ type Snapshot = {
943
990
  readonly tenant?: string;
944
991
  readonly memberships?: readonly Membership[];
945
992
  } | null;
946
- readonly delegation?: Subject["delegation"];
993
+ /** OAuth `scope` and RFC 9396 `authorization_details`, as the token carried them. */
994
+ readonly delegation?: WireDelegation;
947
995
  readonly context: Readonly<Record<string, unknown>>;
948
996
  };
949
997
  /** Roles held in the active tenant, in rank order. */
@@ -954,7 +1002,8 @@ type Snapshot = {
954
1002
  readonly tenants: readonly string[];
955
1003
  readonly include?: readonly string[];
956
1004
  readonly simulated?: true;
957
- readonly expiresAt?: number;
1005
+ /** RFC 3339. Signed, it is the token's `exp`. */
1006
+ readonly expiresAt?: string;
958
1007
  readonly vocabulary?: {
959
1008
  readonly roles?: Readonly<Record<string, Role>>;
960
1009
  readonly plans?: Readonly<Record<string, Plan>>;
@@ -1020,8 +1069,8 @@ type SnapshotGrant = {
1020
1069
  readonly membership?: Membership;
1021
1070
  readonly portable?: false;
1022
1071
  readonly fields?: readonly string[];
1023
- /** When the grant applies (Unix seconds, `from` inclusive, `until` exclusive); absent means always. */
1024
- readonly validity?: GrantValidity;
1072
+ /** When the grant applies (RFC 3339, `from` inclusive, `until` exclusive); absent means always. */
1073
+ readonly validity?: WireValidity;
1025
1074
  /** The grant's declared `name`. */
1026
1075
  readonly name?: string;
1027
1076
  /** The grant's declared `meta`; visible to the client that holds the snapshot. */
@@ -1058,409 +1107,34 @@ type LocalCustomRoleTable = {
1058
1107
  readonly includes: Readonly<Record<string, readonly SnapshotGrant[]>>;
1059
1108
  };
1060
1109
  //#endregion
1061
- //#region src/core/validation.d.ts
1062
- type Boundary = "http-body" | "mcp-args" | "tool-args" | "decision-endpoint" | "manual";
1063
- //#endregion
1064
- //#region src/core/who-can.d.ts
1065
- /** One way a principal holds a permission on an object. */
1066
- type HoldingVia = {
1067
- readonly kind: "role";
1068
- readonly role: string;
1069
- readonly membership: Membership;
1070
- } | {
1071
- readonly kind: "relation";
1072
- readonly resource: string;
1073
- readonly relation: string;
1074
- /** The instance the relation is held on: the object or one of its ancestors. */
1075
- readonly id: string;
1076
- } | {
1077
- readonly kind: "share";
1078
- readonly resource: string;
1079
- readonly relation: string;
1080
- readonly id: string;
1081
- readonly expiresAt?: number;
1082
- /** The group the share names, when the principal holds it as one of its members. */
1083
- readonly group?: RelationGroup;
1084
- };
1085
- type Holder = {
1086
- readonly principal: {
1087
- readonly id: string;
1088
- };
1089
- readonly via: readonly HoldingVia[];
1090
- };
1091
- /**
1092
- * Who holds a permission on one object, for share dialogs and access
1093
- * reviews. It lists and never grants. `complete: false` means some grantee
1094
- * could not be enumerated (a global role, a plan, a source without `list`,
1095
- * an unavailable relation): holders may be missing, so check with `decide`.
1096
- */
1097
- type WhoCan = {
1098
- readonly permission: string;
1099
- readonly holders: readonly Holder[];
1100
- readonly complete: boolean;
1101
- };
1102
- //#endregion
1103
- //#region src/core/approval-policies.d.ts
1104
- /**
1105
- * One approval requirement kept as data, for a tenant or the whole platform.
1106
- * It adds to what the code requires and never removes a requirement.
1107
- */
1108
- type ApprovalPolicy = {
1109
- /** The permission key; a former key from `renamed` resolves. */
1110
- readonly permission: string;
1111
- /** Absent: every tenant. */
1112
- readonly tenant?: string;
1113
- /** Actor kinds it applies to (`['agent']`); absent: every call. A call without an actor never matches a list. */
1114
- readonly actors?: readonly string[];
1115
- /** A portable condition over the row; instance permissions only, since a collection action has no row. */
1116
- readonly where?: Condition;
1117
- /** A portable condition over the call's input (the proposed row). */
1118
- readonly check?: Condition;
1119
- /**
1120
- * The same shape as `allow(..., { approval })`. An `escalation` here widens
1121
- * only this entry's stages, never the code's.
1122
- */
1123
- readonly approval: ApprovalOption;
1124
- };
1110
+ //#region src/core/time.d.ts
1125
1111
  /**
1126
- * Data-driven approval requirements, a subject input like `RoleSource`:
1127
- * read once per instance for the subject's tenants (entries without a
1128
- * tenant always apply). A throw, a rejected promise or an invalid entry
1129
- * denies every call an allow would otherwise permit.
1112
+ * The one time rule: NumericDate (whole seconds) for JWT registered claims
1113
+ * and the claims SQL reads, RFC 3339 for every other JSON field, integer
1114
+ * seconds for durations, and an `Instant` for every runtime `now`.
1130
1115
  */
1131
- type ApprovalPolicySource = {
1132
- approvalPoliciesFor(query: {
1133
- readonly tenants: readonly string[];
1134
- }): readonly ApprovalPolicy[] | Promise<readonly ApprovalPolicy[]>;
1135
- };
1136
- /** The denial detail when an `ApprovalPolicySource` fails: every call an allow would grant denies with reason `approval`. */
1137
- declare const APPROVAL_POLICY_UNAVAILABLE = "approval-policy-unavailable";
1138
- declare function memoryApprovalPolicies(policies: readonly ApprovalPolicy[]): ApprovalPolicySource;
1139
1116
  /**
1140
- * Why an `ApprovalPolicy` entry does not load. `unknown-permission`: the
1141
- * policy declares no such key (the entry applies to nothing). `invalid`: a
1142
- * field has the wrong shape or the approval option does not normalise.
1143
- * `where-on-collection`: `where` reads a row, which a collection action
1144
- * never has, so the entry could never match; use `check` over the input.
1145
- * `stale-on-without-version`: `staleOn` needs an instance permission whose
1146
- * resource declares `version`.
1117
+ * The part of a `Temporal.Instant` PermDock reads. Public options take it
1118
+ * structurally so their declarations compile under a TypeScript lib without
1119
+ * `Temporal` (5.9); every `Temporal.Instant` satisfies it.
1147
1120
  */
1148
- type ApprovalPolicyProblem = "unknown-permission" | "invalid" | "where-on-collection" | "stale-on-without-version";
1149
- type ApprovalPolicyValidation = {
1150
- readonly ok: true;
1151
- } | {
1152
- readonly ok: false;
1153
- readonly problem: ApprovalPolicyProblem;
1121
+ type Instant = {
1122
+ readonly epochMilliseconds: number;
1154
1123
  };
1155
- /**
1156
- * Checks one entry against the policy the way `approvalPoliciesFor` loads
1157
- * it, for an application to refuse a bad entry when it is saved instead of
1158
- * finding every call denied. Never throws.
1159
- */
1160
- declare function validateApprovalPolicy(policy: Policy, entry: unknown): ApprovalPolicyValidation;
1161
1124
  //#endregion
1162
- //#region src/core/hosted.d.ts
1163
- /** One grant authored in PermDock Cloud; its grantee is a declared role, plan or relation. */
1164
- type HostedGrant = {
1165
- readonly id: string;
1166
- readonly permission: string;
1167
- readonly effect?: "allow" | "deny";
1168
- readonly to: Grantee | readonly Grantee[];
1169
- readonly where?: Condition;
1170
- readonly check?: Condition;
1171
- readonly approval?: "human" | ApprovalRequirement;
1172
- readonly fields?: readonly string[];
1173
- };
1174
- /** PolicyDocument v1: the payload of a `permdock-policy+jwt` under the `policy` claim. */
1175
- type PolicyDocument = {
1176
- readonly v: 1;
1177
- readonly id: string;
1178
- readonly fingerprint: string;
1179
- /** The catalog fingerprint the document was authored against. */
1180
- readonly catalog: string;
1181
- readonly issuedAt: number;
1182
- readonly grants: readonly HostedGrant[];
1183
- };
1184
- /**
1185
- * The channel for hosted grants. `createPermDock` reads `current()` once;
1186
- * the application calls `refresh()` on its own schedule, never a check.
1187
- */
1188
- type PolicySource = {
1189
- current(): PolicyDocument | null;
1190
- refresh(): Promise<void>;
1191
- };
1192
- type HostedGrantDropReason = "not-hostable" | "unknown-permission" | "unknown-grantee" | "non-portable" | "weaker-approval" | "invalid";
1193
- /** Reported through `on('error')` when a hosted grant is not merged; never thrown. */
1194
- type HostedGrantDropped = {
1195
- readonly kind: "hosted-grant-dropped";
1196
- readonly document: string;
1197
- readonly grant: string;
1198
- readonly reason: HostedGrantDropReason;
1199
- };
1200
- declare function memoryPolicySource(document?: PolicyDocument | null): PolicySource;
1201
- /** Validates the document envelope; per-grant checks happen at merge time. */
1202
- declare function parsePolicyDocument(json: unknown): PolicyDocument;
1203
- /** True for the portable subset only: no `opaque`, no `sqlFunction`, no unknown op. */
1204
- declare function isPortableCondition(value: unknown): value is Condition;
1125
+ //#region src/core/internals.d.ts
1205
1126
  /**
1206
- * The code policy plus the hosted grants that pass every rule. Hosted
1207
- * allows OR with code allows and any deny still wins, so a hosted grant can
1208
- * never override a code deny; one that fails a rule is dropped, not thrown.
1127
+ * Any instance a feature function accepts: a server `PermDock`, one built
1128
+ * from a snapshot, or an adapter's wrapper such as `PdpPermDock`.
1209
1129
  */
1210
- declare function mergeHostedGrants(policy: Policy, document: PolicyDocument | null): {
1211
- readonly policy: Policy;
1212
- readonly dropped: readonly HostedGrantDropped[];
1213
- };
1214
- //#endregion
1215
- //#region src/core/permdock.d.ts
1216
- type DecideOptions = {
1217
- /** `true` skips schema validation for a row the server loaded itself. Otherwise `data` is validated against the resource schema first (`validate: 'boundary'`), and a failure denies with reason `validation`. */
1218
- readonly trusted?: boolean;
1219
- /** Where untrusted data came from, reported on validation errors. Defaults to `'manual'`. */
1220
- readonly boundary?: Boundary;
1221
- /** Decision clock in Unix seconds, for expiries and limits. Defaults to the current time. */
1222
- readonly now?: number;
1223
- /** The call that produced the decision, reported on the decision event. Defaults to `'decide'`. */
1224
- readonly source?: DecisionEvent["source"];
1225
- /** The adapter that made the call, reported on the decision event. */
1226
- readonly adapter?: string;
1227
- /** Per-call unauthorized handler for `assert`; runs before instance and policy handlers. */
1228
- readonly onDenied?: (decision: Decision) => never | void;
1229
- /** The field being read or written; only grants whose `fields` cover it match. */
1230
- readonly field?: string;
1231
- /** `true` attaches a `trace` to the decision: the grants evaluated, matched and skipped. Off by default and free when off. */
1232
- readonly explain?: boolean;
1233
- /**
1234
- * A declared scope name: only memberships of that scope answer the check.
1235
- * Naming the first scope keeps nested memberships out of a tenant-level
1236
- * guard on a collection action. Global roles still apply; resource roles
1237
- * and memberships of other scopes are skipped with reason `scope`.
1238
- */
1239
- readonly scope?: string;
1240
- };
1241
- type SimulateOptions = {
1242
- /** Decision clock in Unix seconds for the whole batch: grant validity, membership expiry and limits are read as of this instant. Defaults to the current time. */
1243
- readonly now?: number;
1244
- };
1245
- type RowPair<T> = {
1246
- readonly current: T;
1247
- readonly next: T;
1248
- };
1249
- type WhereResult = {
1250
- readonly condition: Condition | {
1251
- readonly op: "or";
1252
- readonly conditions: readonly [];
1253
- };
1254
- readonly partial: boolean;
1255
- /**
1256
- * The subject `where()` was built for. `toWhere` reads its memberships for
1257
- * `memberOf` when no `subject` option is passed. Not enumerable, so it never
1258
- * serialises with the result.
1259
- */
1260
- readonly subject?: Subject;
1261
- /** The policy's scopes, for `memberOf`; not enumerable either. */
1262
- readonly scopes?: readonly Scope[];
1263
- /** The policy's resource graph, for `related`; not enumerable either. */
1264
- readonly resources?: ReadonlyMap<string, ResourceNode>;
1265
- };
1266
- type SnapshotOptions = {
1267
- readonly include?: readonly (Permission | {
1268
- readonly [key: string]: unknown;
1269
- })[];
1270
- readonly tenants?: "all";
1271
- readonly signer?: TokenSigner;
1272
- readonly audience?: string | readonly string[];
1273
- };
1274
- type PermDock<V extends PolicyVocabulary = PolicyVocabulary> = {
1275
- readonly can: {
1276
- (permission: Permission<string, unknown, "instance">, data: unknown, options?: DecideOptions): boolean;
1277
- (permission: Permission<string, unknown, "collection">, data?: unknown, options?: DecideOptions): boolean;
1278
- /**
1279
- * A permission held as `Permission` at run time (from a list, a catalog
1280
- * or `findPermission`), whose kind the type does not say: pass `data`,
1281
- * or `undefined` for a check without a row.
1282
- */
1283
- (permission: Permission, data: unknown, options?: DecideOptions): boolean;
1284
- };
1285
- readonly decide: {
1286
- (permission: Permission<string, unknown, "instance">, data: unknown, options?: DecideOptions): Decision;
1287
- (permission: Permission<string, unknown, "collection">, data?: unknown, options?: DecideOptions): Decision;
1288
- /**
1289
- * A permission held as `Permission` at run time (from a list, a catalog
1290
- * or `findPermission`), whose kind the type does not say: pass `data`,
1291
- * or `undefined` for a check without a row.
1292
- */
1293
- (permission: Permission, data: unknown, options?: DecideOptions): Decision;
1294
- };
1295
- readonly assert: {
1296
- (permission: Permission<string, unknown, "instance">, data: unknown, options?: DecideOptions): Extract<Decision, {
1297
- readonly outcome: "granted";
1298
- }>;
1299
- (permission: Permission<string, unknown, "collection">, data?: unknown, options?: DecideOptions): Extract<Decision, {
1300
- readonly outcome: "granted";
1301
- }>;
1302
- /**
1303
- * A permission held as `Permission` at run time (from a list, a catalog
1304
- * or `findPermission`), whose kind the type does not say: pass `data`,
1305
- * or `undefined` for a check without a row.
1306
- */
1307
- (permission: Permission, data: unknown, options?: DecideOptions): Extract<Decision, {
1308
- readonly outcome: "granted";
1309
- }>;
1310
- };
1311
- /**
1312
- * `decide` with `explain: true`: the same decision, with a `trace` that
1313
- * names the grants evaluated, the allows and denies that matched (so a
1314
- * `denied` says which deny won) and the grants passed over. Local
1315
- * computation only; the trace never reaches a `DecisionSink`.
1316
- */
1317
- readonly explain: {
1318
- (permission: Permission<string, unknown, "instance">, data: unknown, options?: Omit<DecideOptions, "explain">): ExplainedDecision;
1319
- (permission: Permission<string, unknown, "collection">, data?: unknown, options?: Omit<DecideOptions, "explain">): ExplainedDecision;
1320
- (permission: Permission, data: unknown, options?: Omit<DecideOptions, "explain">): ExplainedDecision;
1321
- };
1322
- readonly filter: <T>(permission: Permission<string, T, "instance">, rows: readonly T[], options?: DecideOptions) => T[];
1323
- readonly pick: <T>(permission: Permission<string, T, "instance">, row: T, options?: DecideOptions) => Partial<T>;
1324
- readonly where: (permission: Permission) => WhereResult;
1325
- readonly actions: (resource: Permission | {
1326
- readonly [key: string]: unknown;
1327
- }, data: unknown, options?: DecideOptions) => Permission[];
1328
- readonly simulate: {
1329
- (checks: readonly (readonly [Permission, unknown?])[], options?: SimulateOptions): Decision[];
1330
- (preview: {
1331
- readonly roles?: readonly (string | Role)[];
1332
- readonly memberships?: readonly Membership[];
1333
- readonly tenant?: string;
1334
- }): PermDock<V>;
1335
- (plan: ArazzoSimulateInput): ArazzoPlan;
1336
- };
1337
- readonly snapshot: {
1338
- (options?: SnapshotOptions & {
1339
- readonly signer?: undefined;
1340
- }): Snapshot;
1341
- (options: SnapshotOptions & {
1342
- readonly signer: TokenSigner;
1343
- }): Promise<string>;
1344
- (options?: SnapshotOptions): Snapshot | Promise<string>;
1345
- };
1346
- readonly on: (event: "decision" | "denied" | "approval" | "auth" | "error", handler: (payload: unknown) => void) => () => void;
1347
- readonly tenant: (id: string) => PermDock<V>;
1348
- readonly team: (id: string) => PermDock<V>;
1349
- readonly memberships: () => readonly Membership[];
1350
- readonly tenants: () => readonly string[];
1351
- /**
1352
- * Roles held in a tenant (the active one by default), or only on the
1353
- * memberships of one `scope` (and instance `id`). Ordered by rank: a role
1354
- * comes before the roles its `assigns` lists.
1355
- */
1356
- readonly heldRoles: (options?: {
1357
- readonly tenant?: string;
1358
- readonly scope?: string;
1359
- readonly id?: string;
1360
- }) => readonly Role[];
1361
- /** The distinct `meta.audience` values of the roles held in the active tenant, in rank order. */
1362
- readonly audiences: () => readonly string[];
1363
- /**
1364
- * The roles the subject may hand out in a tenant (the active one by
1365
- * default), or with `scope: 'global'` the global roles it may hand out. A
1366
- * snapshot answers only the tenant form.
1367
- */
1368
- readonly assignableRoles: (options?: {
1369
- readonly tenant?: string;
1370
- readonly scope?: "global";
1371
- }) => readonly Role[];
1372
- /**
1373
- * The custom-role ceiling the subject may hand out: in a tenant (empty
1374
- * without one), or with `scope: 'global'` for platform custom roles, the
1375
- * allows of assignable global roles the subject holds. A snapshot answers
1376
- * only the tenant form.
1377
- */
1378
- readonly assignablePermissions: (options?: {
1379
- readonly tenant?: string;
1380
- readonly scope?: "global";
1381
- }) => readonly Permission[];
1382
- /**
1383
- * The levels of `permission` (`resource(…, { levels })`) the subject may
1384
- * hand out in a custom role: those it holds, or every level with
1385
- * `meta.manageRoles`. Empty when the permission is not assignable.
1386
- */
1387
- readonly assignableLevels: (permission: Permission, options?: {
1388
- readonly tenant?: string;
1389
- readonly scope?: "global";
1390
- }) => readonly string[];
1391
- /**
1392
- * Whether the subject may assign, revoke or transfer a role in one scope
1393
- * instance: `assigns`, the ceiling, `for`, `exclusiveWith`, `min`, `max`
1394
- * and `transferOnly`. It never writes; the application does, and generated
1395
- * RLS triggers re-check the holder counts at commit. A nested instance's
1396
- * tenant comes from a live membership the subject holds on it, or from
1397
- * `change.within` only with `{ trusted: true }`; otherwise `no-membership`.
1398
- */
1399
- readonly decideRoleChange: (change: RoleChange, options?: RoleChangeOptions) => RoleChangeDecision;
1400
- /**
1401
- * Loads the relation facts `permission` needs for `rows` into this
1402
- * instance's cache, so `can`, `decide` and `filter` answer synchronously
1403
- * over an async `RelationSource`. It never grants; a failed load leaves
1404
- * the checks denied with `relation-unavailable`.
1405
- */
1406
- readonly loadRelations: (permission: Permission, rows: readonly unknown[]) => Promise<void>;
1407
- /**
1408
- * Who holds `permission` on `resource` and how (role, relation or share),
1409
- * from `MembershipSource.list` and `RelationSource.related`. It lists and
1410
- * never grants; `complete: false` means some holders could not be listed.
1411
- */
1412
- readonly whoCan: (permission: Permission<string, unknown, "instance">, resource: unknown) => Promise<WhoCan>;
1413
- /**
1414
- * Requests a just-in-time activation of an eligible role. It never writes:
1415
- * a granted decision carries the elevated membership under `elevation` for
1416
- * the app to write, and `approval-required` comes back first when the
1417
- * role's `activation` sets `approval`.
1418
- */
1419
- readonly activate: (input: ActivateInput) => Decision;
1420
- readonly roles: V["roles"] extends RoleTree ? V["roles"] : RoleTree;
1421
- readonly plans: V["plans"] extends PlanTree ? V["plans"] : PlanTree;
1422
- readonly permissions: V["permissions"] extends Policy["permissions"] ? V["permissions"] : Policy["permissions"];
1130
+ type InstanceHandle = {
1423
1131
  readonly subject: Subject;
1424
- /**
1425
- * The same subject, tenant, team, actor, delegation, sink and limits with
1426
- * other sources: `customRoles`, `approvalPolicies` or `relations`. The
1427
- * sources it names are read again for the subject's tenants; the others
1428
- * keep what this instance loaded. Returns a promise when a source it names
1429
- * answers asynchronously.
1430
- */
1431
- readonly derive: (options: DeriveOptions) => PermDock<V> | Promise<PermDock<V>>;
1432
- };
1433
- /** What `permdock.derive` may replace: the sources read after the subject is resolved. */
1434
- type DeriveOptions = Pick<PermDockOptions, "customRoles" | "approvalPolicies" | "relations">;
1435
- type PermDockOptions = {
1436
- readonly tenant?: string;
1437
- /** One source, or several composed with `composeMemberships`. */
1438
- readonly memberships?: MembershipSource | readonly MembershipSource[];
1439
- readonly customRoles?: RoleSource | RoleSourceFactory;
1440
- /** Plans and seats from billing, merged into `principal.plans` for the active tenant. */
1441
- readonly entitlements?: EntitlementSource;
1442
- readonly actor?: Actor;
1443
- readonly delegation?: Delegation;
1444
- readonly sink?: DecisionSink;
1445
- readonly limits?: LimitStore;
1446
- readonly session?: string;
1447
- readonly expiresAt?: number;
1448
- /** Hosted grants; `current()` is read once, when the instance is created. */
1449
- readonly policies?: PolicySource;
1450
- /** The object graph for `through` and edge-table relations; without it they deny with `relation-unavailable`. */
1451
- readonly relations?: RelationSource;
1452
- /** Approval requirements kept as data; they add to the code's and never remove one. A throw denies. */
1453
- readonly approvalPolicies?: ApprovalPolicySource;
1454
- /**
1455
- * Request values an adapter's `context` hook derived on the server, merged
1456
- * into `subject.context`; keys from `policy.context` win on a clash.
1457
- */
1458
- readonly context?: Readonly<Record<string, unknown>>;
1459
1132
  };
1460
- declare function createPermDock<TUser, TPrincipal extends Principal = Principal, V extends PolicyVocabulary = PolicyVocabulary>(policy: Policy<TUser, TPrincipal, V>, user: TUser | Subject | null, options?: PermDockOptions): PermDock<V> | Promise<PermDock<V>>;
1461
1133
  //#endregion
1462
1134
  //#region src/core/credential.d.ts
1463
- type CredentialKind = "user" | "service";
1135
+ type CredentialKind = "user" | "service" | "feed";
1136
+ /** A feed id: lowercase, so a mail system that lowercases a local part still matches. At most 16 characters, so `pdfeed_<id>_<secret>` fits an email local part. */
1137
+ declare function isFeedId(value: string): boolean;
1464
1138
  /** One permission (a key) a credential may use: on every instance, or only on `ids`. */
1465
1139
  type CredentialPermission = {
1466
1140
  readonly permission: string;
@@ -1485,17 +1159,22 @@ type Credential = {
1485
1159
  * credential, where it keeps only the owner's memberships inside it.
1486
1160
  */
1487
1161
  readonly tenant?: string;
1488
- /** Service only: the roles it holds in `tenant`. */
1162
+ /** Service: the roles it holds in `tenant`. Feed: the resource roles it holds on `on`. */
1489
1163
  readonly roles?: readonly string[];
1164
+ /** Feed only: the resource instance the roles are held on. */
1165
+ readonly on?: {
1166
+ readonly resource: string;
1167
+ readonly id: string;
1168
+ };
1490
1169
  readonly permissions: readonly CredentialPermission[];
1491
1170
  readonly createdBy: string;
1492
- /** Seconds since the epoch. */
1493
- readonly createdAt: number;
1494
- /** Seconds since the epoch; absent only where a credential policy allows it. */
1495
- readonly expiresAt?: number;
1171
+ /** RFC 3339. */
1172
+ readonly createdAt: string;
1173
+ /** RFC 3339; absent only where a credential policy allows it. */
1174
+ readonly expiresAt?: string;
1496
1175
  readonly name?: string;
1497
1176
  };
1498
- type CredentialPrincipal = Principal & {
1177
+ type ApiKeyPrincipal = Principal & {
1499
1178
  readonly credential: Credential;
1500
1179
  };
1501
1180
  /**
@@ -1520,7 +1199,8 @@ type CredentialPermissionInput = Permission | {
1520
1199
  type CredentialRequestBase = {
1521
1200
  readonly id: string;
1522
1201
  readonly permissions: readonly CredentialPermissionInput[];
1523
- readonly expiresAt?: number;
1202
+ /** RFC 3339; must be after `now`. */
1203
+ readonly expiresAt?: string;
1524
1204
  readonly name?: string;
1525
1205
  };
1526
1206
  type CredentialRequest = (CredentialRequestBase & {
@@ -1533,6 +1213,15 @@ type CredentialRequest = (CredentialRequestBase & {
1533
1213
  readonly principal?: string;
1534
1214
  readonly tenant: string;
1535
1215
  readonly roles: readonly string[];
1216
+ }) | (CredentialRequestBase & {
1217
+ readonly kind: "feed";
1218
+ readonly on: {
1219
+ readonly resource: Permission | PermissionTree;
1220
+ readonly id: string;
1221
+ };
1222
+ readonly roles: readonly string[];
1223
+ /** A row the server loaded. Each permission must be granted on it. */
1224
+ readonly row: unknown;
1536
1225
  });
1537
1226
  type CredentialDecision = {
1538
1227
  readonly outcome: "granted";
@@ -1551,8 +1240,8 @@ type DecideCredentialOptions = {
1551
1240
  readonly settings?: SettingsSource;
1552
1241
  /** The `token` of an approval the application consumed for this request. */
1553
1242
  readonly approved?: string;
1554
- /** Seconds since the epoch. */
1555
- readonly now?: number;
1243
+ /** The creation time; defaults to the clock. */
1244
+ readonly now?: Instant;
1556
1245
  };
1557
1246
  /**
1558
1247
  * The first rule of `policy` the credential breaks, or `undefined`. A key
@@ -1574,20 +1263,6 @@ declare function parseCredential(input: unknown): Credential | undefined;
1574
1263
  * key is gone delegates nothing and every check is denied.
1575
1264
  */
1576
1265
  declare function credentialDelegation(credential: Credential, permissions: PermissionTree): Delegation;
1577
- /**
1578
- * The subject a verified credential acts as. A `user` credential is its
1579
- * owner, passed live as `owner` (roles and memberships as of this request),
1580
- * with the credential's delegation: every check is the owner's rights
1581
- * intersected with the key's. One that names a `tenant` makes it the active
1582
- * tenant, and `createPermDock` then keeps only the owner's memberships
1583
- * inside it and no global role. A `service` credential is a `service`
1584
- * principal whose only membership is `roles` in `tenant`. An owner whose id
1585
- * is not the credential's `principal`, or who is not a user, is anonymous.
1586
- */
1587
- declare function credentialSubject(credential: Credential, options: {
1588
- readonly permissions: PermissionTree;
1589
- readonly owner?: Principal;
1590
- }): Subject<CredentialPrincipal> | Subject;
1591
1266
  /**
1592
1267
  * Decides whether the subject of `permdock` may create the credential in
1593
1268
  * `request`. The creator must be a signed-in user or service that is not
@@ -1602,7 +1277,113 @@ declare function credentialSubject(credential: Credential, options: {
1602
1277
  * its token. PermDock never stores the credential; the application does,
1603
1278
  * after a `granted` result.
1604
1279
  */
1605
- declare function decideCredential(permdock: PermDock, request: CredentialRequest, options?: DecideCredentialOptions): Promise<CredentialDecision>;
1280
+ /**
1281
+ * Decides whether the subject of `permdock` may create the credential in
1282
+ * `request`: the creator's own reach, the `credentials` policy of the key's
1283
+ * tenant (the call's `settings`, else the instance's), and `approval`.
1284
+ * PermDock never stores the credential; the application does, after a
1285
+ * `granted` result. An instance built from a snapshot denies with
1286
+ * `unsupported`.
1287
+ */
1288
+ declare function decideCredential(permdock: InstanceHandle, request: CredentialRequest, options?: DecideCredentialOptions): Promise<CredentialDecision>;
1289
+ //#endregion
1290
+ //#region src/core/support-session.d.ts
1291
+ /**
1292
+ * SupportSession v1: a support staff member (`actor`, kind `support`)
1293
+ * viewing the app as `principal` in `tenant`, for a stated `reason`. Each
1294
+ * request in the session acts as `principal` with their live rights,
1295
+ * narrowed to `permissions`.
1296
+ */
1297
+ type SupportSession = {
1298
+ readonly v: 1;
1299
+ readonly id: string;
1300
+ /** The person the session views the app as. */
1301
+ readonly principal: string;
1302
+ /** The support staff member running the session. */
1303
+ readonly actor: string;
1304
+ readonly tenant: string;
1305
+ readonly reason: string;
1306
+ /** The delegation: permission keys, read-only unless listed on purpose. */
1307
+ readonly permissions: readonly string[];
1308
+ /** RFC 3339. */
1309
+ readonly startedAt: string;
1310
+ /** RFC 3339. */
1311
+ readonly expiresAt: string;
1312
+ /** Who approved the session; never `actor`. */
1313
+ readonly approvedBy?: string;
1314
+ /** The application's ticket or case id. */
1315
+ readonly reference?: string;
1316
+ };
1317
+ /** A tenant's rules for support sessions. Every field only tightens. */
1318
+ type SupportSessionPolicy = {
1319
+ /** No session may start in this tenant. */
1320
+ readonly disabled?: boolean;
1321
+ /** Longest a session may last, in seconds. */
1322
+ readonly maxTtl?: number;
1323
+ /** Only `readOnlyHint` permissions, whatever the request lists. */
1324
+ readonly readOnly?: boolean;
1325
+ };
1326
+ type SupportSessionRequest = {
1327
+ readonly id: string;
1328
+ /** The person to view the app as. */
1329
+ readonly principal: string;
1330
+ /** Defaults to the actor's active tenant. */
1331
+ readonly tenant?: string;
1332
+ /** Required: why the session is needed. */
1333
+ readonly reason: string;
1334
+ /** Defaults to every `readOnlyHint` permission the actor can use. */
1335
+ readonly permissions?: readonly Permission[];
1336
+ /** Seconds the session lasts. Defaults to 3600; at most 86400. */
1337
+ readonly expiresIn?: number;
1338
+ readonly reference?: string;
1339
+ };
1340
+ type SupportSessionDecision = {
1341
+ readonly outcome: "granted";
1342
+ readonly session: SupportSession;
1343
+ } | {
1344
+ readonly outcome: "approval-required";
1345
+ readonly session: SupportSession;
1346
+ /** Bound to the request and the actor; pass it as `approved` to resume. */
1347
+ readonly token: string;
1348
+ } | {
1349
+ readonly outcome: "denied";
1350
+ readonly denials: readonly Denial[];
1351
+ };
1352
+ type DecideSupportSessionOptions = {
1353
+ /** Where the tenant's `supportSessions` policy comes from. */
1354
+ readonly settings?: SettingsSource;
1355
+ /** Approval is required unless this is `false`. */
1356
+ readonly approval?: boolean;
1357
+ /** The `token` of an approval the application consumed for this request. */
1358
+ readonly approved?: string;
1359
+ /** The principal id that approved; required with `approved` and never the actor. */
1360
+ readonly approvedBy?: string;
1361
+ /** The start time; defaults to the clock. */
1362
+ readonly now?: Instant;
1363
+ };
1364
+ /**
1365
+ * Validates an untrusted support-session record and returns a frozen copy
1366
+ * with only the v1 fields, or `undefined`.
1367
+ */
1368
+ declare function parseSupportSession(input: unknown): SupportSession | undefined;
1369
+ /**
1370
+ * Decides whether the subject of `permdock` may start the support session
1371
+ * in `request`. The actor must be a signed-in person acting for themselves
1372
+ * (`exceeds-creator` otherwise), give a `reason` (`reason-required`), be a
1373
+ * member of the tenant (`tenant-mismatch`) and be able to use every
1374
+ * permission (`exceeds-creator`). Without `permissions` the session gets the
1375
+ * actor's read-only permissions. The tenant's `supportSessions` policy then
1376
+ * applies, and the result is `approval-required` until `approved` carries
1377
+ * its token and `approvedBy` names someone other than the actor.
1378
+ */
1379
+ /**
1380
+ * Decides whether the subject of `permdock` may start the support session
1381
+ * in `request` and returns the record to sign: a stated reason, membership
1382
+ * of the tenant, the actor's own reach, the tenant's `supportSessions`
1383
+ * policy and approval by someone else. An instance built from a snapshot
1384
+ * denies with `unsupported`.
1385
+ */
1386
+ declare function decideSupportSession(permdock: InstanceHandle, request: SupportSessionRequest, options?: DecideSupportSessionOptions): Promise<SupportSessionDecision>;
1606
1387
  //#endregion
1607
1388
  //#region src/core/interfaces.d.ts
1608
1389
  type DecisionProvider = {
@@ -1624,9 +1405,11 @@ type DecisionProvider = {
1624
1405
  readonly subject: Subject;
1625
1406
  }): Promise<readonly string[] | null | undefined>;
1626
1407
  };
1627
- type RoleSource = {
1408
+ type CustomRoleSource = {
1409
+ /** Names the implementation in errors and events. */
1410
+ readonly name?: string;
1628
1411
  /**
1629
- * The custom roles of one tenant. `createPermDock` passes `held`, the role
1412
+ * The custom roles of one tenant. `getPermDock` passes `held`, the role
1630
1413
  * names the subject's live memberships hold there, declared or not, so a
1631
1414
  * source can skip its read when none of them is a custom role.
1632
1415
  */
@@ -1642,14 +1425,23 @@ type RoleSource = {
1642
1425
  globalRoles?(context?: {
1643
1426
  readonly held: readonly string[];
1644
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[]>;
1645
1437
  };
1646
1438
  /**
1647
- * A `RoleSource` built for the subject the instance serves, for an adapter
1439
+ * A `CustomRoleSource` built for the subject the instance serves, for an adapter
1648
1440
  * option shared by every request: it gets the resolved subject (principal,
1649
1441
  * actor and delegation) and returns that subject's source, or `undefined`
1650
1442
  * for none. A throw reads no custom roles and reports `source-threw`.
1651
1443
  */
1652
- type RoleSourceFactory = (subject: Subject) => RoleSource | undefined;
1444
+ type CustomRoleSourceFactory = (subject: Subject) => CustomRoleSource | undefined;
1653
1445
  /** One member of a scope instance, as `MembershipSource.list` returns it. */
1654
1446
  type MemberEntry = {
1655
1447
  readonly principal: {
@@ -1658,6 +1450,8 @@ type MemberEntry = {
1658
1450
  readonly membership: Membership;
1659
1451
  };
1660
1452
  type MembershipSource = {
1453
+ /** Names the implementation in errors and events. */
1454
+ readonly name?: string;
1661
1455
  membershipsFor(principal: {
1662
1456
  readonly id: string;
1663
1457
  readonly kind?: string;
@@ -1730,6 +1524,8 @@ type RelationHolder = HolderPeriod & ({
1730
1524
  * `relation-unavailable`.
1731
1525
  */
1732
1526
  type RelationSource = {
1527
+ /** Names the implementation in errors and events. */
1528
+ readonly name?: string;
1733
1529
  /**
1734
1530
  * With `through: 'parent'`, the parent chain; with a link name, the one
1735
1531
  * instance that link points to (`depth` is then 1).
@@ -1752,6 +1548,8 @@ type RelationSource = {
1752
1548
  };
1753
1549
  /** Plan and seat names a principal holds in a tenant, from billing (Stripe Entitlements, a table). */
1754
1550
  type EntitlementSource = {
1551
+ /** Names the implementation in errors and events. */
1552
+ readonly name?: string;
1755
1553
  entitlementsFor(principal: {
1756
1554
  readonly id: string;
1757
1555
  }, options: {
@@ -1783,6 +1581,8 @@ type VerificationFailure = {
1783
1581
  readonly cause: TokenFailureCause;
1784
1582
  };
1785
1583
  type TokenVerifier<TClaims extends JwtClaims = JwtClaims> = {
1584
+ /** Names the implementation in errors and events. */
1585
+ readonly name?: string;
1786
1586
  verify(token: string, expectations: {
1787
1587
  readonly typ?: string | readonly string[];
1788
1588
  readonly audience?: string | readonly string[];
@@ -1791,10 +1591,18 @@ type TokenVerifier<TClaims extends JwtClaims = JwtClaims> = {
1791
1591
  }): Promise<VerifiedToken<TClaims> | VerificationFailure>;
1792
1592
  };
1793
1593
  type TokenSigner = {
1594
+ /** Names the implementation in errors and events. */
1595
+ readonly name?: string;
1794
1596
  sign(payload: Readonly<Record<string, unknown>>, options: {
1795
- readonly typ: "permdock-snapshot+jwt" | "permdock-approval+jwt" | "permdock-decisions+jwt" | "permdock-policy+jwt" | "permdock-capability+jwt";
1597
+ readonly typ: "vnd.permdock.snapshot+jwt" | "vnd.permdock.approval+jwt" | "vnd.permdock.policy+jwt" | "vnd.permdock.capability+jwt" | "vnd.permdock.run+jwt" | "vnd.permdock.support-session+jwt" | "vnd.permdock.evidence+jwt" | "at+jwt" | "secevent+jwt";
1598
+ /** `aud`; a signer with no default audience refuses to sign without one. */
1796
1599
  readonly audience?: string | readonly string[];
1600
+ /** `exp`, a NumericDate; one hour after `iat` when absent. */
1797
1601
  readonly expiresAt?: number;
1602
+ /** `iat`, a NumericDate: the artefact's issue time. The signer's clock when absent. */
1603
+ readonly issuedAt?: number;
1604
+ /** `jti`: the artefact's id. A fresh UUID when absent. */
1605
+ readonly jti?: string;
1798
1606
  }): Promise<string>;
1799
1607
  readonly kid?: string;
1800
1608
  jwks?(): Promise<{
@@ -1805,6 +1613,8 @@ type SubjectResolver<TInput, TPrincipal extends Principal = Principal> = (input:
1805
1613
  readonly tenant?: string;
1806
1614
  }) => Subject<TPrincipal> | Promise<Subject<TPrincipal>>;
1807
1615
  type SnapshotSource = {
1616
+ /** Names the implementation in errors and events. */
1617
+ readonly name?: string;
1808
1618
  get(): Promise<Snapshot | string> | Snapshot | string;
1809
1619
  subscribe?(listener: () => void): () => void;
1810
1620
  };
@@ -1813,8 +1623,10 @@ type LimitConsumeInput = {
1813
1623
  readonly key: string;
1814
1624
  readonly subjectId: string;
1815
1625
  readonly count: number;
1816
- readonly per: string;
1817
- readonly now?: number;
1626
+ /** The window in seconds; windows are aligned to the epoch. */
1627
+ readonly per: number;
1628
+ /** The decision clock; the store reads the clock when absent. */
1629
+ readonly now?: Instant;
1818
1630
  /** The active tenant; a quota counts per subject and tenant. */
1819
1631
  readonly tenant?: string;
1820
1632
  };
@@ -1822,10 +1634,14 @@ type LimitRemaining = {
1822
1634
  readonly remaining: number;
1823
1635
  };
1824
1636
  type LimitStore = {
1637
+ /** Names the implementation in errors and events. */
1638
+ readonly name?: string;
1825
1639
  consume(input: LimitConsumeInput): Promise<LimitRemaining> | LimitRemaining;
1826
1640
  remaining(input: LimitConsumeInput): LimitRemaining | undefined;
1827
1641
  };
1828
1642
  type DecisionSink = {
1643
+ /** Names the implementation in errors and events. */
1644
+ readonly name?: string;
1829
1645
  write(events: readonly SinkEvent[]): Promise<void> | void;
1830
1646
  flush?(): Promise<void>;
1831
1647
  };
@@ -1836,24 +1652,30 @@ type DecisionSink = {
1836
1652
  * never core's.
1837
1653
  */
1838
1654
  type CredentialVerifier = {
1655
+ /** Names the implementation in errors and events. */
1656
+ readonly name?: string;
1839
1657
  verify(secret: string): Credential | null | Promise<Credential | null>;
1840
1658
  /**
1841
- * Records a successful use at `at` (Unix seconds), for a `lastUsedAt`
1842
- * column. Called after a key resolved and not awaited; a throw or a
1843
- * rejection is ignored, so it never changes the subject.
1659
+ * Records a successful use at `at`, for a `lastUsedAt` column. Called
1660
+ * after a key resolved and not awaited; a throw or a rejection is
1661
+ * ignored, so it never changes the subject.
1844
1662
  */
1845
- touch?(id: string, at: number): void | Promise<void>;
1663
+ touch?(id: string, at: Instant): void | Promise<void>;
1846
1664
  };
1847
1665
  /** What one tenant configures for itself. Every field only tightens. */
1848
1666
  type TenantSettings = {
1849
1667
  /** Rules for API keys created in, or used against, this tenant. */
1850
1668
  readonly credentials?: CredentialPolicy;
1669
+ /** Rules for support sessions started in this tenant. */
1670
+ readonly supportSessions?: SupportSessionPolicy;
1851
1671
  };
1852
1672
  /**
1853
- * Per-tenant settings, a subject input like `RoleSource`: they tighten what
1673
+ * Per-tenant settings, a subject input like `CustomRoleSource`: they tighten what
1854
1674
  * a key may be and never grant. A throw denies.
1855
1675
  */
1856
1676
  type SettingsSource = {
1677
+ /** Names the implementation in errors and events. */
1678
+ readonly name?: string;
1857
1679
  settingsFor(tenant: string): TenantSettings | undefined | Promise<TenantSettings | undefined>;
1858
1680
  };
1859
1681
  //#endregion
@@ -1875,8 +1697,8 @@ type ClosureContext = {
1875
1697
  type ClosureGrantFn<T = unknown> = (data: T, ctx: ClosureContext) => boolean;
1876
1698
  /** Who else may approve once a request has waited `after`. */
1877
1699
  type ApprovalEscalation = {
1878
- /** A duration (`'4h'`) from the request's creation. */
1879
- readonly after: string;
1700
+ /** Seconds from the request's creation. */
1701
+ readonly after: number;
1880
1702
  readonly to: Approver | readonly Approver[];
1881
1703
  };
1882
1704
  /** One group of approvers; `quorum` distinct approvers of `by` complete it. */
@@ -1906,8 +1728,8 @@ type ApprovalRequirement = {
1906
1728
  readonly staleOn?: "resource-change";
1907
1729
  /** Distinct approvers a request needs before it is approved under `by`; absent means 1. */
1908
1730
  readonly quorum?: number;
1909
- /** How long a request stays open (`'30m'`); the store's default when absent, and never longer than it. */
1910
- readonly ttl?: string;
1731
+ /** Seconds a request stays open; the store's default when absent, and never longer than it. */
1732
+ readonly ttl?: number;
1911
1733
  readonly escalation?: ApprovalEscalation;
1912
1734
  };
1913
1735
  type ApprovalOption = "human" | {
@@ -1917,9 +1739,9 @@ type ApprovalOption = "human" | {
1917
1739
  readonly stages?: readonly {
1918
1740
  readonly by: ApproverInput;
1919
1741
  readonly quorum?: number;
1920
- /** After `after`, `to` may approve this stage as well as `by`. */
1742
+ /** After `after` seconds, `to` may approve this stage as well as `by`. */
1921
1743
  readonly escalation?: {
1922
- readonly after: string;
1744
+ readonly after: number;
1923
1745
  readonly to: ApproverInput;
1924
1746
  };
1925
1747
  }[];
@@ -1933,11 +1755,11 @@ type ApprovalOption = "human" | {
1933
1755
  readonly staleOn?: "resource-change";
1934
1756
  /** Distinct approvers needed (an integer of at least 1); the same approver counts once. Absent means 1. */
1935
1757
  readonly quorum?: number;
1936
- /** How long the request stays open (`'30m'`, `'2d'`); caps the approval store's default. */
1937
- readonly ttl?: string;
1938
- /** After `after` (`'4h'`), `to` may approve as well as `by`, at any open stage; same kinds as `by`. */
1758
+ /** Seconds the request stays open (`1800`); caps the approval store's default. */
1759
+ readonly ttl?: number;
1760
+ /** After `after` seconds (`14_400`), `to` may approve as well as `by`, at any open stage; same kinds as `by`. */
1939
1761
  readonly escalation?: {
1940
- readonly after: string;
1762
+ readonly after: number;
1941
1763
  readonly to: ApproverInput;
1942
1764
  };
1943
1765
  };
@@ -1948,7 +1770,8 @@ type ApprovalOption = "human" | {
1948
1770
  */
1949
1771
  type GrantLimit = {
1950
1772
  readonly count: number;
1951
- readonly per: string;
1773
+ /** The window in seconds (`3600` for an hour), aligned to the epoch. */
1774
+ readonly per: number;
1952
1775
  readonly mode?: "hard" | "soft";
1953
1776
  readonly alertAt?: number;
1954
1777
  };
@@ -1967,8 +1790,8 @@ type AssuranceRequirement = {
1967
1790
  * mints the elevated membership to write.
1968
1791
  */
1969
1792
  type ActivationOption = {
1970
- /** The longest an activation may last, as a duration (`'4h'`, `'30m'`). */
1971
- readonly maxDuration?: string;
1793
+ /** The longest an activation may last, in seconds (`14_400`). */
1794
+ readonly maxDuration?: number;
1972
1795
  /** `'required'` denies an activation without a reason. */
1973
1796
  readonly justification?: "required" | "optional";
1974
1797
  /** When set, `activate` returns `approval-required` before the membership can be written. */
@@ -1977,7 +1800,7 @@ type ActivationOption = {
1977
1800
  readonly assurance?: AssuranceRequirement;
1978
1801
  };
1979
1802
  type ActivationSpec = {
1980
- readonly maxDuration?: string;
1803
+ readonly maxDuration?: number;
1981
1804
  readonly justification: "required" | "optional";
1982
1805
  readonly approval?: "human" | ApprovalRequirement;
1983
1806
  readonly assurance?: AssuranceRequirement;
@@ -1994,8 +1817,8 @@ type BreakGlassOptions = {
1994
1817
  /** Names of the deny grants this override lifts; every other deny still wins. */
1995
1818
  readonly overrides?: readonly string[];
1996
1819
  readonly requires?: BreakGlassRequirements;
1997
- /** The longest a break-glass session may last, as a duration. */
1998
- readonly maxDuration?: string;
1820
+ /** The longest a break-glass session may last, in seconds. */
1821
+ readonly maxDuration?: number;
1999
1822
  /** Follow-ups the grant owes: each becomes an obligation on the decision. */
2000
1823
  readonly obligations?: readonly ("notify" | "review")[];
2001
1824
  };
@@ -2005,14 +1828,14 @@ type BreakGlassSpec = {
2005
1828
  readonly purpose?: readonly string[];
2006
1829
  readonly reason: boolean;
2007
1830
  readonly assurance?: AssuranceRequirement;
2008
- readonly maxDuration?: string;
1831
+ readonly maxDuration?: number;
2009
1832
  readonly obligations: readonly ("notify" | "review")[];
2010
1833
  };
2011
1834
  /** How a tenant consents to support access, and for how long. */
2012
1835
  type SupportConsent = {
2013
1836
  readonly by: GranteeInput;
2014
- /** The durations a tenant owner may pick, as duration strings. */
2015
- readonly durations: readonly string[];
1837
+ /** The durations a tenant owner may pick, in seconds. */
1838
+ readonly durations: readonly number[];
2016
1839
  };
2017
1840
  type SupportAccessOptions<S extends string = string> = {
2018
1841
  /** The role a consented support membership holds. */
@@ -2032,7 +1855,7 @@ type SupportSpec = {
2032
1855
  readonly actorRequired: boolean;
2033
1856
  readonly consent: {
2034
1857
  readonly by: Grantee | readonly Grantee[];
2035
- readonly durations: readonly string[];
1858
+ readonly durations: readonly number[];
2036
1859
  };
2037
1860
  readonly group: string;
2038
1861
  };
@@ -2060,10 +1883,10 @@ type GrantOptions<T = Record<string, unknown>> = {
2060
1883
  readonly obligations?: readonly ObligationInput[];
2061
1884
  /** Purposes of use (`context.purpose`) that make the grant apply; non-portable. */
2062
1885
  readonly purpose?: readonly string[];
2063
- /** The grant applies from this instant on (RFC 3339 string or Unix seconds); before it an allow denies with `inactive-grant` and a deny does not apply. */
2064
- readonly validFrom?: string | number;
2065
- /** The grant stops applying at this instant (exclusive; RFC 3339 string or Unix seconds). */
2066
- readonly validUntil?: string | number;
1886
+ /** The grant applies from this instant on (RFC 3339 or an `Instant`); before it an allow denies with `inactive-grant` and a deny does not apply. */
1887
+ readonly validFrom?: string | Instant;
1888
+ /** The grant stops applying at this instant (exclusive; RFC 3339 or an `Instant`). */
1889
+ readonly validUntil?: string | Instant;
2067
1890
  /**
2068
1891
  * An allow on an instance action counts only on rows whose scope instance
2069
1892
  * (or the whole app, globally) is one where the subject also holds this
@@ -2091,13 +1914,18 @@ type GrantValidity = {
2091
1914
  readonly from?: number;
2092
1915
  readonly until?: number;
2093
1916
  };
1917
+ /** A grant's validity in JSON (snapshots, catalogs, `inactive-grant` details): RFC 3339 bounds. */
1918
+ type WireValidity = {
1919
+ readonly from?: string;
1920
+ readonly until?: string;
1921
+ };
2094
1922
  /**
2095
1923
  * The actor a policy delegation is for: an actor kind, narrowed to one id
2096
1924
  * when `id` is set, or to one named client when `client` is set (the name
2097
1925
  * the subject resolver gives a verified client id through `clients`).
2098
1926
  */
2099
1927
  type DelegationTarget = {
2100
- readonly kind: string;
1928
+ readonly kind: ActorKind;
2101
1929
  readonly id?: string;
2102
1930
  readonly client?: string;
2103
1931
  };
@@ -2121,8 +1949,8 @@ type DelegationInput = {
2121
1949
  readonly to: ActorGrantee | string | DelegationTarget;
2122
1950
  /** The leaves or subtrees the actor may use; a deny grant still applies. */
2123
1951
  readonly permissions: readonly (Permission | PermissionTree)[];
2124
- readonly validFrom?: string | number;
2125
- readonly validUntil?: string | number;
1952
+ readonly validFrom?: string | Instant;
1953
+ readonly validUntil?: string | Instant;
2126
1954
  };
2127
1955
  /** A declared scope name (or the `tenant` / `team` alias), or the resource a role is held on. */
2128
1956
  type RoleScope<S extends string = string> = S | Permission | PermissionTree | readonly (Permission | PermissionTree)[];
@@ -2180,7 +2008,7 @@ type Grant = {
2180
2008
  /** Set on a break-glass allow: it overrides named denies and carries obligations. */
2181
2009
  readonly breakGlass?: BreakGlassSpec;
2182
2010
  /** The membership kind (`via`) this grant applies under; others never match it. */
2183
- readonly viaOnly?: string;
2011
+ readonly viaOnly?: MembershipVia;
2184
2012
  /** Set only on a grant merged from a hosted policy document. */
2185
2013
  readonly hosted?: HostedGrantRef;
2186
2014
  /** When the grant applies; absent means always. */
@@ -2283,7 +2111,7 @@ type PolicyAppDataSchemas = {
2283
2111
  readonly grant?: AppDataSchema<unknown>;
2284
2112
  readonly membership?: AppDataSchema<unknown>;
2285
2113
  };
2286
- type DefinePolicyOptions<TUser, TPrincipal extends Principal, S extends PolicyScopesInput = PolicyScopesInput> = {
2114
+ type PolicyOptions<TUser, TPrincipal extends Principal, S extends PolicyScopesInput = PolicyScopesInput> = {
2287
2115
  readonly x?: PolicyAppDataSchemas;
2288
2116
  readonly roles?: readonly RoleBinding<ScopeNames<S>>[];
2289
2117
  readonly grants?: readonly (Omit<Grant, "role" | "scope"> | readonly Omit<Grant, "role" | "scope">[] | Grant)[];
@@ -2293,8 +2121,8 @@ type DefinePolicyOptions<TUser, TPrincipal extends Principal, S extends PolicySc
2293
2121
  * the first and second scope.
2294
2122
  */
2295
2123
  readonly scopes?: S;
2296
- readonly principal?: (user: TUser) => TPrincipal | null;
2297
- readonly subject?: (user: TUser) => TPrincipal | null;
2124
+ /** Maps the application's user to the principal PermDock decides for; `null` is anonymous. */
2125
+ readonly subject: (user: TUser) => TPrincipal | null;
2298
2126
  readonly context?: (user: TUser) => Readonly<Record<string, unknown>> | Promise<Readonly<Record<string, unknown>>>;
2299
2127
  readonly validate?: ValidateMode;
2300
2128
  readonly onDenied?: (decision: unknown) => never | void;
@@ -2344,4 +2172,4 @@ type SubjectOf<P> = {
2344
2172
  readonly expiresAt?: number;
2345
2173
  };
2346
2174
  //#endregion
2347
- export { RelationGroup as $, inherit as $n, validateApprovalPolicy as $t, PolicyScopes as A, ArazzoFinding as An, VerifiedClaims as Ar, DeriveOptions as At, ValidateMode as B, UserApprover as Bn, SqlFunctionArg as Br, HostedGrantDropped as Bt, HostedGrantRef as C, MembershipEvent as Cn, CustomRoleGrant as Cr, DecideCredentialOptions as Ct, PolicyAppDataSchemas as D, ActivateInput as Dn, Membership as Dr, decideCredential as Dt, Policy as E, WireDenial as En, JsonWebKeyLike as Er, credentialSubject as Et, RoleScope as F, simulateArazzo as Fn, MemberOfParent as Fr, SnapshotOptions as Ft, EntitlementSource as G, Grantee as Gn, isConditionRef as Gr, mergeHostedGrants as Gt, CredentialVerifier as H, anyOf as Hn, hasConditionOp as Hr, PolicySource as Ht, SeparationConflict as I, AnyOfApprover as In, OpaqueCondition as Ir, WhereResult as It, LimitRemaining as J, RelationGrantee as Jn, ApprovalPolicy as Jt, JwtClaims as K, GranteeInput as Kn, isSqlFunctionField as Kr, parsePolicyDocument as Kt, SubjectOf as L, Approver as Ln, RelatedCondition as Lr, createPermDock as Lt, PrincipalOf as M, ArazzoSimulateInput as Mn, ConditionRef as Mr, PermDockOptions as Mt, RoleBinding as N, ArazzoStepResult as Nn, ConditionValue as Nr, RowPair as Nt, PolicyDelegation as O, breakGlass as On, Principal as Or, parseCredential as Ot, RoleOptions as P, arazzoFindings as Pn, MemberOfCondition as Pr, SimulateOptions as Pt, RelationChain as Q, authenticated as Qn, memoryApprovalPolicies as Qt, SupportAccessOptions as R, ApproverInput as Rn, RelatedHop as Rr, HostedGrant as Rt, GrantValidity as S, DirectoryEvent as Sn, CustomRole as Sr, CredentialRequest as St, ObligationInput as T, WireDecision as Tn, GnapAccess as Tr, credentialPolicyViolation as Tt, DecisionProvider as U, holder as Un, isCondition as Ur, isPortableCondition as Ut, VocabularyFromInput as V, allOf as Vn, SqlFunctionCondition as Vr, PolicyDocument as Vt, DecisionSink as W, user as Wn, isConditionDate as Wr, memoryPolicySource as Wt, MemberEntry as X, anyone as Xn, ApprovalPolicySource as Xt, LimitStore as Y, actor as Yn, ApprovalPolicyProblem as Yt, MembershipSource as Z, assurance as Zn, ApprovalPolicyValidation as Zt, GrantCondition as _, ScopeNames as _n, TraceSkipReason as _r, CredentialPermission as _t, ApprovalRequirement as a, Snapshot as an, Denial as ar, SnapshotSource as at, GrantOptions as b, CredentialEvent as bn, AuthorizationDetail as br, CredentialPolicyViolation as bt, BreakGlassOptions as c, SnapshotNotEntitled as cn, DeniedDecision as cr, TokenFailureCause as ct, ClosureContext as d, RoleChangeDecision as dn, LimitDetail as dr, VerificationFailure as dt, Holder as en, plan as er, RelationHolder as et, ClosureGrantFn as f, RoleChangeOptions as fn, MatchedGrant as fr, VerifiedToken as ft, Grant as g, ScopeDeclaration as gn, TraceSkip as gr, CredentialKind as gt, DelegationTarget as h, Scope as hn, Trace as hr, CredentialDecision as ht, ApprovalOption as i, LocalSnapshotManifest as in, Decision as ir, SettingsSource as it, PolicyVocabulary as j, ArazzoPlan as jn, Condition as jr, PermDock as jt, PolicyOAuthScope as k, supportAccess as kn, Subject as kr, DecideOptions as kt, BreakGlassRequirements as l, SnapshotScope as ln, ExplainedDecision as lr, TokenSigner as lt, DelegationInput as m, PolicyScopesInput as mn, Quota as mr, Credential as mt, ApprovalEscalation as n, WhoCan as nn, AppObligation as nr, RoleSource as nt, ApprovalStage as o, SnapshotAssignable as on, DenialDetails as or, SubjectResolver as ot, DefinePolicyOptions as p, RoleChangeTarget as pn, Obligation as pr, WhereCompiler as pt, LimitConsumeInput as q, InheritGrantee as qn, APPROVAL_POLICY_UNAVAILABLE as qt, ApprovalMode as r, LocalCustomRoleTable as rn, ApprovalRequiredDecision as rr, RoleSourceFactory as rt, AssuranceRequirement as s, SnapshotGrant as sn, DenialReason as sr, TenantSettings as st, ActivationOption as t, HoldingVia as tn, relation as tr, RelationSource as tt, BreakGlassSpec as u, RoleChange as un, GrantedDecision as ur, TokenVerifier as ut, GrantLimit as v, AccessEvent as vn, Actor as vr, CredentialPermissionInput as vt, MembershipFixture as w, SinkEvent as wn, Delegation as wr, credentialDelegation as wt, GrantScope as x, DecisionEvent as xn, Binding as xr, CredentialPrincipal as xt, GrantMeta as y, AuthEvent as yn, Assurance as yr, CredentialPolicy as yt, SupportConsent as z, PermissionApprover as zn, RestrictedAncestors as zr, HostedGrantDropReason 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 };