permdock 0.1.0 → 0.2.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 (349) hide show
  1. package/README.md +106 -47
  2. package/dist/a2a/index.d.ts +7 -16
  3. package/dist/a2a/index.js +59 -98
  4. package/dist/adapter-context-mlWsVGGg.js +23 -0
  5. package/dist/ai-sdk/index.d.ts +37 -16
  6. package/dist/ai-sdk/index.js +30 -13
  7. package/dist/approvals/index.d.ts +3 -3
  8. package/dist/approvals/index.js +5 -4
  9. package/dist/{approvals-DaxY-Bdg.js → approvals-DbYAuNkG.js} +17 -11
  10. package/dist/approvers-DT4AVyIg.js +52 -0
  11. package/dist/{arazzo-CTeVuXr5.js → arazzo-BAgw9ap6.js} +2 -2
  12. package/dist/{arazzo-aoTkqYsJ.js → arazzo-cmvX2jDe.js} +2 -2
  13. package/dist/authzen/index.d.ts +4 -13
  14. package/dist/authzen/index.js +16 -50
  15. package/dist/better-auth/index.d.ts +20 -3
  16. package/dist/better-auth/index.js +27 -7
  17. package/dist/better-supabase/index.d.ts +206 -0
  18. package/dist/better-supabase/index.js +620 -0
  19. package/dist/bind-CVy3Espv.d.ts +25 -0
  20. package/dist/bind-VnYn2HKq.js +97 -0
  21. package/dist/boundary-BM8a_P6E.js +13 -0
  22. package/dist/boundary-BmHxVH1J.d.ts +15 -0
  23. package/dist/canonical-json-DemiK4Vp.js +26 -0
  24. package/dist/{capability-B68OFnZx.js → capability-4qPdO9gk.js} +7 -5
  25. package/dist/{capability-BDG_nkxt.d.ts → capability-Dq43tT1u.d.ts} +2 -2
  26. package/dist/catalog/index.d.ts +1 -1
  27. package/dist/catalog/index.js +1 -1
  28. package/dist/catalog-BjZSovXQ.js +2 -0
  29. package/dist/{catalog-doc-BSo_Q_-6.js → catalog-doc-Dsc9y7sd.js} +23 -12
  30. package/dist/{catalog-B0E6bggc.js → catalog-h2tlKFkq.js} +2 -2
  31. package/dist/{catalog-H-vFGwWK.js → catalog-z8q6bi_r.js} +4 -4
  32. package/dist/claude-agent/index.d.ts +5 -14
  33. package/dist/claude-agent/index.js +4 -10
  34. package/dist/clerk/index.d.ts +12 -3
  35. package/dist/clerk/index.js +26 -5
  36. package/dist/cli/bin.js +1 -1
  37. package/dist/cli/index.d.ts +3 -3
  38. package/dist/cli/index.js +2 -2
  39. package/dist/clients-C7zLFuWT.d.ts +12 -0
  40. package/dist/clients-DjU5ABMy.js +23 -0
  41. package/dist/cloud/index.d.ts +4 -5
  42. package/dist/cloud/index.js +20 -6
  43. package/dist/{cloud-BNQTrmrr.js → cloud-BGhHS-lY.js} +2 -2
  44. package/dist/{cloud-Cuxr6Czw.js → cloud-Bo3e9Ak3.js} +7 -6
  45. package/dist/{collect-O-tOtbnk.js → collect-DDDv_ESs.js} +194 -42
  46. package/dist/collect-DLlujdHC.js +83 -0
  47. package/dist/collect-rG2IQ3t0.js +2 -0
  48. package/dist/{commands-BMh_Etm2.js → commands-DWOrSQic.js} +16 -12
  49. package/dist/compile/index.d.ts +3 -0
  50. package/dist/compile/index.js +2 -0
  51. package/dist/{compile-D22iwvuV.js → compile-Ba4blROR.js} +85 -30
  52. package/dist/compile-CNnl6uIt.d.ts +94 -0
  53. package/dist/config-BJiM-xAm.js +157 -0
  54. package/dist/config-Bn00Z3ks.js +36 -0
  55. package/dist/config-report-Dw_JcUqT.js +44 -0
  56. package/dist/{connection-JvqwHODC.js → connection-CU8MQxRi.js} +1 -1
  57. package/dist/{context-CKEAabd7.js → context-Ttp0ekMT.js} +36 -27
  58. package/dist/convex/index.d.ts +9 -4
  59. package/dist/convex/index.js +14 -4
  60. package/dist/create-BWyx3jua.d.ts +245 -0
  61. package/dist/create-CPhDL6qx.js +253 -0
  62. package/dist/{credential-B_rkUNlY.js → credential-8P81ff4u.js} +26 -46
  63. package/dist/delegation-D8pUEuce.js +103 -0
  64. package/dist/{describe-Bt1YD5uS.js → describe-B_gVZEVi.js} +10 -15
  65. package/dist/{describe-DernyItf.d.ts → describe-PdoqESvg.d.ts} +9 -10
  66. package/dist/{diff-x5Il8LVa.js → diff-B8Tunc3o.js} +44 -11
  67. package/dist/{diff-BUzf5Poi.js → diff-CzqLxZ77.js} +2 -2
  68. package/dist/doctor-WpvG6p4k.js +1194 -0
  69. package/dist/doctor-collect-ByfYlNv1.js +664 -0
  70. package/dist/{doctor-Bqo6FwUa.js → doctor-rOr-4ZfS.js} +2 -2
  71. package/dist/drizzle/index.d.ts +4 -3
  72. package/dist/drizzle/index.js +3 -3
  73. package/dist/elysia/index.d.ts +6 -28
  74. package/dist/elysia/index.js +16 -60
  75. package/dist/{errors-DSMnAVNa.js → errors-CWfoNg9N.js} +8 -4
  76. package/dist/{errors-Iy71s7Oj.js → errors-Cz5zn0mW.js} +17 -71
  77. package/dist/{errors-DbZ1YOnb.d.ts → errors-DAqevpNk.d.ts} +8 -21
  78. package/dist/{errors-m3u9TmDu.js → errors-DRnGZHzF.js} +4 -1
  79. package/dist/evaluation-items-CfCCejQd.js +40 -0
  80. package/dist/{evaluations-DsAU9ppl.js → evaluations-tz6D9A2G.js} +28 -46
  81. package/dist/eve/index.d.ts +6 -15
  82. package/dist/eve/index.js +7 -12
  83. package/dist/expiry-BoBJ8Tvc.js +7 -0
  84. package/dist/express/index.d.ts +6 -29
  85. package/dist/express/index.js +28 -58
  86. package/dist/fastify/index.d.ts +6 -29
  87. package/dist/fastify/index.js +16 -65
  88. package/dist/fields-BMl1RxoX.js +26 -0
  89. package/dist/{files-B_wAGYmt.js → files-DWUN9PzI.js} +5 -1
  90. package/dist/{fixtures-Cvaw0gDG.js → fixtures-ht28Cplr.js} +5 -2
  91. package/dist/{freeze-y1_jQL4v.js → freeze-CrU8nQeX.js} +31 -2
  92. package/dist/{from-snapshot-BMGnhmgv.js → from-snapshot-C3sHpZNS.js} +65 -48
  93. package/dist/{grantee-Bv04_Vzf.js → grantee-Cv5Sogfv.js} +88 -7
  94. package/dist/graph-sql-B-dsAT6j.d.ts +29 -0
  95. package/dist/{headers-B5RRv3Xm.js → headers-BZSDieNT.js} +1 -1
  96. package/dist/{headers-C8SHQccD.d.ts → headers-Cf-zWvsO.d.ts} +1 -1
  97. package/dist/helpers-H_KARDVC.js +421 -0
  98. package/dist/hono/index.d.ts +6 -28
  99. package/dist/hono/index.js +11 -43
  100. package/dist/{hosted-BwKQ1BTA.js → hosted-DJQw46hn.js} +6 -5
  101. package/dist/{http-GgVApX1k.js → http-BIhmLfCc.js} +4 -20
  102. package/dist/http-SO7qGttf.js +44 -0
  103. package/dist/ids-DC4V4CFu.js +18 -0
  104. package/dist/{index-LF_hS-yn.d.ts → index-A0YNL8jZ.d.ts} +1 -1
  105. package/dist/index-CtE07CBF.d.ts +6 -0
  106. package/dist/{index-xIxJLwOQ.d.ts → index-D3vbkoSI.d.ts} +75 -7
  107. package/dist/{index-CltcQ4Bf.d.ts → index-D6_cSa1z.d.ts} +68 -5
  108. package/dist/index.d.ts +14 -9
  109. package/dist/index.js +22 -17
  110. package/dist/instance-options-BK_rNOSC.d.ts +11 -0
  111. package/dist/instance-options-Dhhcnm3y.js +22 -0
  112. package/dist/{parse-DPfIvFMU.js → json-schema-BsAflUGW.js} +28 -57
  113. package/dist/jwt/index.d.ts +10 -6
  114. package/dist/jwt/index.js +32 -13
  115. package/dist/kernel-GSQnMz3O.js +208 -0
  116. package/dist/kysely/index.d.ts +4 -3
  117. package/dist/kysely/index.js +3 -3
  118. package/dist/live-options-H2eG8dfJ.js +60 -0
  119. package/dist/{load-BZ24CpZP.js → load-DhWEB9P1.js} +16 -10
  120. package/dist/load-DwJUafYN.js +2 -0
  121. package/dist/manifest-iaoBXHKc.js +783 -0
  122. package/dist/manifest-uDS9y5de.d.ts +206 -0
  123. package/dist/{map-DowSO96j.js → map-AcxK9o_D.js} +4 -15
  124. package/dist/{map-claims-B_6I1Rn-.js → map-claims-Z4QZOiFF.js} +13 -4
  125. package/dist/map-error-pgUWNNtG.js +23 -0
  126. package/dist/may-use-DndQ5tQ-.js +77 -0
  127. package/dist/mcp/index.d.ts +54 -22
  128. package/dist/mcp/index.js +218 -178
  129. package/dist/nest/index.d.ts +26 -31
  130. package/dist/nest/index.js +75 -84
  131. package/dist/next/client.d.ts +7 -8
  132. package/dist/next/client.js +11 -9
  133. package/dist/next/index.d.ts +30 -47
  134. package/dist/next/index.js +45 -60
  135. package/dist/next/plugin.d.ts +1 -1
  136. package/dist/next/plugin.js +32 -1
  137. package/dist/node/index.d.ts +9 -28
  138. package/dist/node/index.js +11 -43
  139. package/dist/openai/index.d.ts +6 -15
  140. package/dist/openai/index.js +7 -20
  141. package/dist/openapi/index.d.ts +87 -4
  142. package/dist/openapi/index.js +3 -3
  143. package/dist/{openapi-CwePaF7C.js → openapi-Bbg4wGVL.js} +3 -3
  144. package/dist/{openapi-DcqM8nU7.js → openapi-BqRBvAng.js} +237 -5
  145. package/dist/{openapi-DWD0Uc_4.js → openapi-CqqEbHsL.js} +5 -5
  146. package/dist/{openapi-import-BWRUNNeW.js → openapi-import-cmwetbzw.js} +1 -1
  147. package/dist/{openapi-schema-D8j_T9tO.js → openapi-schema--ARjyfQr.js} +2 -2
  148. package/dist/orpc/index.d.ts +15 -28
  149. package/dist/orpc/index.js +74 -117
  150. package/dist/otel/index.d.ts +2 -2
  151. package/dist/parse-BuyjxhZV.js +53 -0
  152. package/dist/parse-local-manifest-BkGQNzAh.d.ts +10 -0
  153. package/dist/parse-local-manifest-BrMozJCo.js +36 -0
  154. package/dist/pdp/index.d.ts +2 -2
  155. package/dist/pdp/index.js +14 -127
  156. package/dist/{permdock-yoZ7EjxX.js → permdock-CzqXjCpU.js} +641 -126
  157. package/dist/{permissions-B8vCg_bI.d.ts → permissions-CDgvKG5L.d.ts} +2 -2
  158. package/dist/{permissions-CofRqesP.js → permissions-CpZrivYv.js} +3 -3
  159. package/dist/{permissions-DC7GROPA.js → permissions-DVoF6dMt.js} +77 -15
  160. package/dist/{permissions-B4apnahQ.d.ts → permissions-DttnqqxC.d.ts} +34 -5
  161. package/dist/{pins-CqE1jZuF.js → pins-8ILTftC9.js} +2 -2
  162. package/dist/{policy-CInmNGkM.d.ts → policy-CFZAr_Al.d.ts} +330 -37
  163. package/dist/{policy-Cq2fB8Q5.d.ts → policy-D8UFyERw.d.ts} +2 -2
  164. package/dist/{policy-ANp36PnI.js → policy-xyWg7QdR.js} +173 -22
  165. package/dist/powersync-A8x_Yyvh.js +2 -0
  166. package/dist/powersync-C7kLglqX.js +540 -0
  167. package/dist/powersync-yW1UUFzp.js +62 -0
  168. package/dist/prisma/index.d.ts +3 -2
  169. package/dist/prisma/index.js +45 -20
  170. package/dist/{problem-Cgp9-KZA.js → problem-B43ztKIm.js} +74 -109
  171. package/dist/problem-details-CkL50EEf.d.ts +7 -0
  172. package/dist/problem-details-_AMOYz-w.js +144 -0
  173. package/dist/{protected-BuPAycJT.d.ts → protected-CNsMzrVd.d.ts} +5 -4
  174. package/dist/protected-Cs6kTaHo.js +100 -0
  175. package/dist/protected-bZs6rbT1.d.ts +40 -0
  176. package/dist/{provider-wTAUda2v.d.ts → provider-Cjr62YMV.d.ts} +1 -1
  177. package/dist/provider-DLzpb2Xz.js +52 -0
  178. package/dist/provider-store-DNyC1y48.js +43 -0
  179. package/dist/react/index.d.ts +7 -5
  180. package/dist/react/index.js +5 -4
  181. package/dist/react/provider-client.d.ts +1 -1
  182. package/dist/react/provider-client.js +1 -1
  183. package/dist/react-native/index.d.ts +166 -10
  184. package/dist/react-native/index.js +607 -85
  185. package/dist/{refs-ChLSxbST.js → refs-KYb4ntaz.js} +4 -3
  186. package/dist/{relations-r4soIFZB.js → relations-cjOL01hZ.js} +110 -31
  187. package/dist/replay-BsOyTrdV.js +28 -0
  188. package/dist/replay-sqBGMnNs.d.ts +5 -0
  189. package/dist/resource-ref-CaS9yVPi.js +20 -0
  190. package/dist/revocations-Bhr0aMIC.js +27 -0
  191. package/dist/rls-BMNydpHk.js +2521 -0
  192. package/dist/{rls-BOFU3chG.js → rls-CEvs64Kj.js} +8 -3
  193. package/dist/rls-fields-BMasREhR.js +3502 -0
  194. package/dist/{rls-graph-DxQ39PJj.js → rls-graph-pc9fuXYm.js} +100 -36
  195. package/dist/{rls-import-CXV6LBlS.js → rls-import-D8F7j35Q.js} +7 -6
  196. package/dist/{rls-migrate-DrFPbf8p.js → rls-migrate-7wikfrVI.js} +6 -5
  197. package/dist/rls-ownership-B5Lkq62W.js +843 -0
  198. package/dist/rls-shared-aOQ4hGTO.js +493 -0
  199. package/dist/rls-verify-D8B7dOTh.js +745 -0
  200. package/dist/{row-check-BajTgQZ-.d.ts → row-check-Dt35czLy.d.ts} +12 -15
  201. package/dist/rpc-DOK54_CS.js +89 -0
  202. package/dist/{run-CJ6UvS3a.js → run-YXCJDNYk.js} +31 -12
  203. package/dist/runtime-CB8gQFvS.js +11 -0
  204. package/dist/{saas-BRrZzJkM.js → saas-Bj_FFkjN.js} +17 -7
  205. package/dist/{schema-P8yoma__.js → schema-D3MnDMxa.js} +8 -4
  206. package/dist/scim/index.d.ts +1 -1
  207. package/dist/scim/index.js +1 -1
  208. package/dist/{scim-9NFa0XVZ.js → scim-BFGBBAqR.js} +1 -1
  209. package/dist/{scopes-cKVp_WTw.js → scopes-CVdPrWN-.js} +35 -8
  210. package/dist/server/index.d.ts +22 -11
  211. package/dist/server/index.js +11 -8
  212. package/dist/{credentials-BgRX3WEg.js → server-DlZ28Oz5.js} +1 -1
  213. package/dist/shared-DRu8VFVM.js +123 -0
  214. package/dist/{sink-Cfr9-7YC.d.ts → sink-Gs6TTVa-.d.ts} +1 -1
  215. package/dist/skills-Biq5uup3.js +192 -0
  216. package/dist/{skills-C_lpV4Jx.js → skills-JaymNCdK.js} +10 -4
  217. package/dist/{snapshot-DE8dE_hz.js → snapshot-Enxd0n-s.js} +138 -214
  218. package/dist/snapshot-cache-D6jLelln.js +44 -0
  219. package/dist/snapshot-cache-DwQH8ufx.d.ts +45 -0
  220. package/dist/solid/index.d.ts +39 -9
  221. package/dist/solid/index.js +76 -85
  222. package/dist/sources-B0UvrJ21.js +534 -0
  223. package/dist/sources-BcJgw0lt.d.ts +192 -0
  224. package/dist/{sql-Bll1d7y0.js → sql-xdg5f4Fi.js} +6 -1
  225. package/dist/{src-CTNT-PBW.js → src-CSbUiozF.js} +149 -11
  226. package/dist/ssf/index.d.ts +3 -2
  227. package/dist/ssf/index.js +3 -29
  228. package/dist/store-DMAWwAJV.js +371 -0
  229. package/dist/{store-Bq90395i.d.ts → store-D_pjn91-.d.ts} +13 -4
  230. package/dist/store-options-yO0V6gRn.js +716 -0
  231. package/dist/{stores-CkG2HrSg.js → stores-4_sqiOA1.js} +10 -63
  232. package/dist/{stores-CvOnu_2T.d.ts → stores-DVR5NHLE.d.ts} +20 -9
  233. package/dist/{stream-Q_xlB6Ko.js → stream-DDpvynSB.js} +16 -2
  234. package/dist/{stream-BhMfZOwr.d.ts → stream-DlvG2hs-.d.ts} +2 -2
  235. package/dist/subject-settings-BwBmCdTR.js +128 -0
  236. package/dist/supabase/index.d.ts +122 -6
  237. package/dist/supabase/index.js +4 -3
  238. package/dist/supabase/middleware.d.ts +32 -27
  239. package/dist/supabase/middleware.js +56 -22
  240. package/dist/{supabase-D8UlBA7Z.js → supabase-CwafwxxF.js} +3 -3
  241. package/dist/{supabase-DTxGtYdi.js → supabase-DTBaC20O.js} +345 -367
  242. package/dist/supabase-config-Bs44dare.js +472 -0
  243. package/dist/{supabase-hook-D_OqGb_V.js → supabase-hook-BuxLQLpU.js} +994 -708
  244. package/dist/supabase-hook-D5qVd_D8.js +2 -0
  245. package/dist/supautils-DYZnzRWV.js +91 -0
  246. package/dist/svelte/PermissionBoundary.svelte +37 -0
  247. package/dist/svelte/Protected.svelte +8 -2
  248. package/dist/svelte/index.d.ts +9 -6
  249. package/dist/svelte/index.js +61 -7
  250. package/dist/svelte/runtime.d.ts +4 -3
  251. package/dist/svelte/runtime.js +4 -3
  252. package/dist/svelte/source.d.ts +9 -6
  253. package/dist/svelte/source.js +7 -4
  254. package/dist/terminal/index.d.ts +6 -14
  255. package/dist/terminal/index.js +44 -32
  256. package/dist/testing/index.d.ts +105 -16
  257. package/dist/testing/index.js +504 -40
  258. package/dist/testing/saas/index.d.ts +4 -4
  259. package/dist/testing/saas/index.js +2 -2
  260. package/dist/testing/saas/permissions.d.ts +1 -1
  261. package/dist/testing/saas/permissions.js +1 -1
  262. package/dist/token-CIWxJOCh.js +50 -0
  263. package/dist/trpc/index.d.ts +7 -26
  264. package/dist/trpc/index.js +17 -100
  265. package/dist/types-9AWO9EGt.d.ts +197 -0
  266. package/dist/{types-D6Z6-rKJ.d.ts → types-BPxgszlT.d.ts} +260 -22
  267. package/dist/{types-BvBk1wgn.d.ts → types-BVyImy5I.d.ts} +5 -3
  268. package/dist/{types-CxquUByI.d.ts → types-Bvc4oWT6.d.ts} +1 -1
  269. package/dist/types-C3s9xVJG.d.ts +48 -0
  270. package/dist/{types-BBK-exvJ.d.ts → types-Dnemwd77.d.ts} +7 -1
  271. package/dist/types-kxznc7cn.d.ts +52 -0
  272. package/dist/{types-B8w5PFtS.d.ts → types-vKyAMtcX.d.ts} +17 -1
  273. package/dist/{types-B9dmiiab.d.ts → types-vNSDF7Dq.d.ts} +1 -1
  274. package/dist/{sources-DOpW5Ila.d.ts → types-yF5LmQVD.d.ts} +86 -127
  275. package/dist/unplugin/index.d.ts +1 -1
  276. package/dist/unplugin/index.js +10 -9
  277. package/dist/{usage-1ozMubLY.js → usage-D07N9QJ3.js} +2 -2
  278. package/dist/usage-D82l1CwK.js +2 -0
  279. package/dist/{usage-CUnK6Ou9.js → usage-DG1oeCca.js} +225 -62
  280. package/dist/validation-error-CnjZ4t92.js +33 -0
  281. package/dist/validation-error-CtF23SrC.d.ts +26 -0
  282. package/dist/{validity-D0uRmJKJ.js → validity-uOp8UpYn.js} +57 -36
  283. package/dist/{verifier-B90agnhl.js → verifier-BxBo6I44.js} +10 -5
  284. package/dist/version-BvacVTZR.js +17 -0
  285. package/dist/views-Soe7bGSC.js +95 -0
  286. package/dist/{vocabulary-Dk0fs-Jk.d.ts → vocabulary-DA8a8zif.d.ts} +1 -1
  287. package/dist/vue/index.d.ts +35 -13
  288. package/dist/vue/index.js +86 -93
  289. package/dist/watch-Etoa_Mvr.js +2 -0
  290. package/dist/watch-UihESpsJ.js +128 -0
  291. package/dist/webmcp/index.d.ts +2 -2
  292. package/dist/webmcp/index.js +7 -13
  293. package/package.json +62 -36
  294. package/schemas/approval-request-v1.json +175 -0
  295. package/schemas/catalog-v1.json +29 -1
  296. package/schemas/supabase-claims-v1.json +6 -1
  297. package/schemas/supabase-manifest-v1.json +150 -6
  298. package/skills/permdock/SKILL.md +7 -7
  299. package/skills/permdock-agents/SKILL.md +5 -5
  300. package/skills/permdock-agents/references/runtimes.md +12 -10
  301. package/skills/permdock-approvals/SKILL.md +4 -4
  302. package/skills/permdock-approvals/references/stores-and-resume.md +15 -4
  303. package/skills/permdock-audit/SKILL.md +3 -3
  304. package/skills/permdock-credentials/SKILL.md +4 -4
  305. package/skills/permdock-credentials/references/tokens-keys-links.md +7 -2
  306. package/skills/permdock-data/SKILL.md +4 -4
  307. package/skills/permdock-data/references/queries-and-rls.md +14 -6
  308. package/skills/permdock-data/references/relationships.md +5 -3
  309. package/skills/permdock-tenancy/SKILL.md +9 -6
  310. package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +14 -8
  311. package/skills/permdock-wire/SKILL.md +4 -4
  312. package/skills/permdock-wire/references/adapters.md +42 -30
  313. package/skills/permdock-wire/references/policy-options.md +5 -3
  314. package/dist/approvers-aH0PJkmf.js +0 -20
  315. package/dist/catalog-idsHc0vo.js +0 -2
  316. package/dist/collect-B7_TIfmg.js +0 -49
  317. package/dist/collect-fRPAQIWb.js +0 -2
  318. package/dist/compile-CQbvyIBr.d.ts +0 -30
  319. package/dist/config-BPYmjTOp.js +0 -26
  320. package/dist/context-gtAwAILx.js +0 -6
  321. package/dist/create-BKF3dgFk.d.ts +0 -162
  322. package/dist/create-CSkhDU9T.js +0 -222
  323. package/dist/doctor-BGle8Gqi.js +0 -1314
  324. package/dist/helpers-DnSOrhB9.js +0 -682
  325. package/dist/index-fG6NSXlc.d.ts +0 -9
  326. package/dist/kernel-YOGCWNLf.js +0 -211
  327. package/dist/load-QOOm1z70.js +0 -2
  328. package/dist/manifest-DDQbC6K0.d.ts +0 -118
  329. package/dist/map-error-RJ3ZsUyA.js +0 -16
  330. package/dist/may-use-CnFEjVEp.js +0 -37
  331. package/dist/pg-4GJWDUxG.js +0 -953
  332. package/dist/plugin-4gr7IxFJ.js +0 -65
  333. package/dist/protected-B4K3BKoX.js +0 -138
  334. package/dist/protected-wY7nXhY9.d.ts +0 -23
  335. package/dist/provider-_wx46HpB.js +0 -48
  336. package/dist/rls-CJVja9Ww.js +0 -2119
  337. package/dist/rls-helpers-BxRuif0l.js +0 -1346
  338. package/dist/runtime-DP9ttFh1.js +0 -27
  339. package/dist/skills-Dx3QLnMY.js +0 -110
  340. package/dist/source-DoBBYJi2.js +0 -6
  341. package/dist/sources-DVHM3Mwq.js +0 -284
  342. package/dist/store-C6hFW6ta.js +0 -508
  343. package/dist/subject-settings-xt7V845g.js +0 -82
  344. package/dist/supabase-hook-DW-xP4hU.js +0 -2
  345. package/dist/types-DbWdEfcm.d.ts +0 -87
  346. package/dist/types-bva3i4Gf.d.ts +0 -98
  347. package/dist/types-i4BAOvdb.d.ts +0 -97
  348. package/dist/usage-PyEor6GA.js +0 -2
  349. package/dist/version-CnSh33Fj.js +0 -16
@@ -1,4 +1,5 @@
1
- import { a as SqlMembershipSource } from "./sources-DOpW5Ila.js";
1
+ import { n as RoleThrough } from "./types-yF5LmQVD.js";
2
+ import { o as SqlMembershipSource } from "./sources-BcJgw0lt.js";
2
3
  //#region src/cli/types.d.ts
3
4
  type CollectConfig = {
4
5
  readonly srcPath?: readonly string[];
@@ -13,7 +14,11 @@ type RlsTarget = "sql" | "drizzle" | "prisma";
13
14
  type RlsMembershipTable = {
14
15
  readonly table: string;
15
16
  readonly user: string;
16
- readonly role: string;
17
+ /**
18
+ * The role key column, a reference to a roles table that holds the key, or
19
+ * several of them: the row holds every non-null key.
20
+ */
21
+ readonly role: string | RoleThrough | readonly (string | RoleThrough)[];
17
22
  /** Per scope name, the column holding that scope's id: the table's own scope and its ancestors. */
18
23
  readonly columns?: Readonly<Record<string, string>>;
19
24
  /** Column of the first scope's id; shorthand for `columns[<first scope>]`. */
@@ -22,8 +27,14 @@ type RlsMembershipTable = {
22
27
  readonly team?: string;
23
28
  readonly id?: string;
24
29
  readonly expiresAt?: string;
25
- /** Column holding the membership kind (`Membership.via`); roles with `for` need it. */
26
- readonly via?: string;
30
+ readonly disabledAt?: string;
31
+ /**
32
+ * The membership kind (`Membership.via`) roles with `for` match: a column
33
+ * holding it, or `{ value }` when every row has the same kind.
34
+ */
35
+ readonly via?: string | {
36
+ readonly value: string;
37
+ };
27
38
  };
28
39
  type RlsMemberships = {
29
40
  /** The membership table of each named scope. */
@@ -45,11 +56,28 @@ type RlsActiveRow = {
45
56
  readonly status?: string;
46
57
  readonly active?: readonly string[];
47
58
  };
59
+ /** A scope's active-row table, with the permissions its suspended instances keep. */
60
+ type RlsSuspendedScope = RlsActiveRow & {
61
+ /**
62
+ * Permissions (references or keys) members of a suspended instance, and of
63
+ * every instance nested in it, still hold: restoring it, cancelling a
64
+ * scheduled deletion, exporting before a purge.
65
+ */
66
+ readonly keep?: readonly (string | {
67
+ readonly key: string;
68
+ })[];
69
+ };
70
+ type RlsSuspendedMembership = {
71
+ readonly keep?: readonly (string | {
72
+ readonly key: string;
73
+ })[];
74
+ };
48
75
  type RlsSuspension = {
49
76
  /** A suspended user holds no role and no membership. */
50
77
  readonly users?: RlsActiveRow;
51
- /** Per scope name: a suspended instance voids its memberships and every membership nested under it. */
52
- readonly scopes?: Readonly<Record<string, RlsActiveRow>>;
78
+ /** Per scope name: a suspended instance voids its memberships and every membership nested under it, except for `keep`. */
79
+ readonly scopes?: Readonly<Record<string, RlsSuspendedScope>>;
80
+ readonly memberships?: RlsSuspendedMembership;
53
81
  };
54
82
  type RlsFunctionMapping = {
55
83
  readonly twin: unknown;
@@ -74,6 +102,14 @@ type RlsConfig = {
74
102
  readonly force?: boolean;
75
103
  readonly fixtures?: string;
76
104
  readonly tenantClaim?: string;
105
+ /**
106
+ * Which tenants the helpers and `memberOf` checks admit. `'active'`
107
+ * (default): when the token carries a non-empty `tenantClaim`, only that
108
+ * tenant; without one, every tenant the subject is a member of. `'all'`:
109
+ * every such tenant whatever the claim says, for apps whose tenant comes
110
+ * from the URL or the query.
111
+ */
112
+ readonly tenants?: "active" | "all";
77
113
  /** Postgres type of tenant columns (`uuid` by default); the tenant claim and helper results are cast to it. */
78
114
  readonly tenantType?: string;
79
115
  /** Postgres type of team columns; defaults to `tenantType`. */
@@ -87,12 +123,12 @@ type RlsConfig = {
87
123
  readonly drizzle?: {
88
124
  /** Module exporting the tables, as imported from `out`. Default `./schema`. */
89
125
  readonly schema?: string;
90
- /** Export name per table name; defaults to the camelCased table name. */
126
+ /** Export name per table name; defaults to the camelCased table name without its schema. */
91
127
  readonly exports?: Readonly<Record<string, string>>;
92
128
  };
93
129
  /** `--target prisma`: the model each table maps to. */
94
130
  readonly prisma?: {
95
- /** Model name per table name; defaults to the PascalCased table name. */
131
+ /** Model name per table name; defaults to the PascalCased table name without its schema. */
96
132
  readonly models?: Readonly<Record<string, string>>;
97
133
  };
98
134
  /** Schema of `role_permissions` and the RLS helpers (`permdock_has`, `permitted_<scope>_ids`, `member_<scope>_ids`) (and the RBAC scaffold). Default `permdock`; keep it out of `[api] schemas`. */
@@ -107,6 +143,25 @@ type RlsConfig = {
107
143
  * always intersected with the `permdock_ceiling` view. Off by default.
108
144
  */
109
145
  readonly customRoles?: boolean;
146
+ /** How the generated custom-role write functions check the caller (`database` mode with `customRoles`). */
147
+ readonly customRoleWrites?: {
148
+ /**
149
+ * Who may change custom roles at all, checked before the hand-out check:
150
+ * permission keys of which the caller must hold one in the tenant (or
151
+ * through a global role; only through a global role for a platform custom
152
+ * role), or `'manageRoles'` for any permission with `meta.manageRoles`.
153
+ * Unset, any member may write a role within what they may hand out.
154
+ */
155
+ readonly requires?: "manageRoles" | readonly string[];
156
+ /**
157
+ * The application's own roles table, one row per custom role. A trigger
158
+ * on it moves a role's grants and includes when the row's name, tenant,
159
+ * scope or instance changes, and deletes them with the row. A signed-in
160
+ * caller goes through the same checks as the write functions; a trusted
161
+ * path (a migration, a job, a nested trigger) moves the rows directly.
162
+ */
163
+ readonly roles?: RlsCustomRoleTable;
164
+ };
110
165
  /**
111
166
  * Let link capabilities reach resource-scoped grants: `anon` policies that call
112
167
  * `permdock_capability_ids`, which reads the `capability` claim `exchangeCapability`
@@ -121,6 +176,69 @@ type RlsConfig = {
121
176
  * too. Off by default.
122
177
  */
123
178
  readonly anonymousSignIns?: "deny";
179
+ /**
180
+ * Grant `anon` usage on the helper schema and `execute` on the helpers, for
181
+ * hand-written policies that apply to `public` or `anon` and call them. They
182
+ * find no subject for `anon` and return nothing. Off by default: a policy
183
+ * that calls a helper says `to authenticated`.
184
+ */
185
+ readonly anonExecute?: boolean;
186
+ /**
187
+ * Check role assignments in the database: a trigger on each scope's
188
+ * `rls.memberships` table, the global-roles table `rls.roles` and each
189
+ * table in `tables` (such as invitations) refuses a client write that
190
+ * assigns, changes or removes a role the caller may not assign there, by
191
+ * the policy's `assigns` graph or, for a custom role, by what the caller may
192
+ * hand out. Writes that do not run as a client role (the table owner, a
193
+ * `security definer` function, a backend role) are trusted. Needs a role
194
+ * that declares `assigns`.
195
+ */
196
+ readonly assignments?: true | {
197
+ readonly tables?: readonly RlsAssignmentTable[];
198
+ /**
199
+ * `'refuse'`: a client write to a row whose user is the caller is
200
+ * refused on every guarded table with a user column, whatever the
201
+ * role. A map refuses it on the tables it names (`schema.table` as
202
+ * configured). Unset, a caller may change their own row within what
203
+ * they may assign.
204
+ */
205
+ readonly ownRole?: "refuse" | Readonly<Record<string, "refuse">>;
206
+ };
207
+ /**
208
+ * Add the approval store `supabaseApprovalStore` reads and writes: the
209
+ * `approval_requests` table and one function per `ApprovalStore` method, in
210
+ * the helper schema, executable by no client role. Off by default. An
211
+ * object adopts a table the app already has instead.
212
+ */
213
+ readonly approvals?: boolean | RlsApprovalsAdopt;
214
+ /**
215
+ * A pg_jsonschema check constraint on generated `jsonb` columns: the
216
+ * approval store's `body` must match `approval-request-v1.json`. `true`
217
+ * installs the extension into `extensions`; `'auto'` adds the constraint
218
+ * only where `pg_available_extensions` lists it. Off by default.
219
+ */
220
+ readonly jsonSchema?: "auto" | boolean;
221
+ /**
222
+ * `false` leaves out the holder-count and transfer-only triggers `min`,
223
+ * `max` and `transferOnly` put on the membership tables; a map with
224
+ * `<scope>: false` leaves them out for those scopes only. Those rules are
225
+ * then checked by `decideRoleChange` alone. On by default.
226
+ */
227
+ readonly ownershipTriggers?: false | Readonly<Record<string, false>>;
228
+ /**
229
+ * Make a session acting for a user read-only in the database: one
230
+ * restrictive policy per table and write command the generated policies
231
+ * allow, refusing the write when the token's `act` claim names one of these
232
+ * actor kinds, unless `act.read_only` is `false`. `true` is
233
+ * `['support', 'impersonation']`; with `support`, an `act` with a
234
+ * `session_id` and no `kind` counts too. Off by default.
235
+ */
236
+ readonly readOnlyActors?: boolean | readonly string[];
237
+ readonly apiKeys?: true | RlsApiKeys;
238
+ /** Supabase Realtime: policies on `realtime.messages` for private channels. Supabase dialect only. */
239
+ readonly realtime?: RlsRealtime;
240
+ /** Supabase Storage: policies on `storage.objects` for buckets keyed by a scope folder. Supabase dialect only. */
241
+ readonly storage?: RlsStorage;
124
242
  /**
125
243
  * `'views'`: one `security_invoker` view `<table>_visible` per table with field-limited
126
244
  * read grants, whose restricted columns are `case when <permitted> then col end`. Off by default.
@@ -149,6 +267,14 @@ type RlsConfig = {
149
267
  readonly actions?: RlsActions;
150
268
  /** Emit only the helpers, their seeds and the scaffold; the table policies stay hand-written. */
151
269
  readonly helpersOnly?: boolean;
270
+ /**
271
+ * Emit `permitted_<resource>_rows(p_permission)` and its `_for` form for
272
+ * these resources, or for every resource a grant reaches with `true`: the
273
+ * row ids the caller may act on, as the generated policies decide them.
274
+ */
275
+ readonly rowHelpers?: true | readonly string[];
276
+ readonly trustedReaders?: readonly string[];
277
+ readonly treeValues?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
152
278
  /** `rls migrate`: how existing helper calls map onto the generated helpers. */
153
279
  readonly migrate?: RlsMigrateConfig;
154
280
  /**
@@ -158,6 +284,72 @@ type RlsConfig = {
158
284
  */
159
285
  readonly shims?: boolean | RlsShimsConfig;
160
286
  };
287
+ /**
288
+ * `rls.approvals` on a table the app already has: the store functions keep
289
+ * each request's body in `body` and its token in `token` (both added when
290
+ * missing) and read every field from the body; `mirror` copies request
291
+ * fields into the app's own columns on each write, converted to their types.
292
+ */
293
+ type RlsApprovalsAdopt = {
294
+ /** `table` or `schema.table`. */
295
+ readonly table: string;
296
+ /** A text column unique per request. Default `token`. */
297
+ readonly token?: string;
298
+ /** A jsonb column holding the `ApprovalRequest`. Default `body`. */
299
+ readonly body?: string;
300
+ readonly open?: "insert" | "attach";
301
+ readonly schema?: string;
302
+ /** Request fields copied into the app's columns, field to column. */
303
+ readonly mirror?: {
304
+ readonly status?: string;
305
+ readonly permission?: string;
306
+ readonly tenant?: string;
307
+ readonly principalId?: string;
308
+ readonly actorId?: string;
309
+ readonly session?: string;
310
+ readonly approvals?: string;
311
+ readonly createdAt?: string;
312
+ readonly expiresAt?: string;
313
+ readonly resolvedAt?: string;
314
+ readonly resolvedBy?: string;
315
+ readonly consumedAt?: string;
316
+ };
317
+ };
318
+ type RlsApiKeys = {
319
+ readonly claim?: string;
320
+ readonly scopes?: string;
321
+ readonly tenant?: string;
322
+ readonly roles?: string;
323
+ readonly serviceRoles?: readonly string[];
324
+ };
325
+ /** One more table whose rows assign a role, such as invitations (`rls.assignments.tables`). */
326
+ type RlsAssignmentTable = {
327
+ readonly table: string;
328
+ /** The declared scope the row assigns the role at. */
329
+ readonly scope: string;
330
+ /** The column holding the scope instance id. */
331
+ readonly id: string;
332
+ /** The tenant column for a scope below the first; defaults to `id` at the first scope. */
333
+ readonly tenant?: string;
334
+ /** The role key column, a reference to a roles table that holds the key, or several of them. */
335
+ readonly role: string | RoleThrough | readonly (string | RoleThrough)[];
336
+ /** The column holding the user the row assigns to, which `ownRole` compares with the caller. */
337
+ readonly user?: string;
338
+ };
339
+ /** `rls.customRoleWrites.roles`: the application's table of custom roles. */
340
+ type RlsCustomRoleTable = {
341
+ readonly table: string;
342
+ /** The column holding the role name. */
343
+ readonly key: string;
344
+ /** The tenant column; a row with no tenant is a platform custom role (`scope: 'global'`). Without it every row is a platform role. */
345
+ readonly tenant?: string;
346
+ /** A text column holding the scope name; without it a row with a tenant lives at the first scope. */
347
+ readonly scope?: string;
348
+ /** A column pinning the role to one instance of its scope. */
349
+ readonly id?: string;
350
+ /** A boolean column marking rows that are not custom roles (declared or system roles); those rows are skipped. */
351
+ readonly skip?: string;
352
+ };
161
353
  /** `rls.shims`: where the legacy-named wrappers go. */
162
354
  type RlsShimsConfig = {
163
355
  /** Schema of the legacy helpers. Default `public`. */
@@ -190,24 +382,44 @@ type RlsMigrateConfig = {
190
382
  /** For `scoped` helpers, a scope literal's PermDock scope when the names differ. */
191
383
  readonly scopes?: Readonly<Record<string, string>>;
192
384
  };
193
- /**
194
- * The role column of a global-roles table that holds a foreign key: the role
195
- * key is `column` of `through`, joined on `on` (`{ role_id: 'id' }`).
196
- */
197
- type RoleThrough = {
198
- /** The roles table; unqualified, it is in the global-roles table's schema. */
199
- readonly through: string;
200
- /** One entry: the global-roles column to the roles table column it references. */
201
- readonly on: Readonly<Record<string, string>>;
202
- /** The roles table column that holds the role key. */
203
- readonly column: string;
204
- };
205
385
  /** Where global roles live: `table (user, role)`. Defaults `user_id` and `role`. */
206
386
  type GlobalRoles = {
207
387
  readonly table: string;
208
388
  readonly user?: string;
209
389
  readonly role?: string | RoleThrough;
210
390
  };
391
+ /** A permission reference from the app's definitions; only its `key` is read. */
392
+ type RlsPermissionRef = {
393
+ readonly key: string;
394
+ };
395
+ /**
396
+ * One private Realtime topic pattern, such as `org:{organization}:chat`:
397
+ * `:`-separated segments, one of them `{<scope>}`, which holds the id of a
398
+ * scope instance.
399
+ */
400
+ type RlsRealtimeTopic = {
401
+ /** Receive broadcast and presence messages: `select` on `realtime.messages`. */
402
+ readonly read: RlsPermissionRef;
403
+ /** Send broadcast messages and track presence: `insert`. Absent: nobody may. */
404
+ readonly write?: RlsPermissionRef;
405
+ };
406
+ type RlsRealtime = {
407
+ readonly topics: Readonly<Record<string, RlsRealtimeTopic>>;
408
+ };
409
+ /** One Storage bucket whose object paths start with a scope instance id. */
410
+ type RlsStorageBucket = {
411
+ readonly scope: string;
412
+ /** The 1-based `storage.foldername(name)` entry that holds the id. Default 1. */
413
+ readonly folder?: number;
414
+ /** Download and list: `select` on `storage.objects`. */
415
+ readonly read?: RlsPermissionRef;
416
+ /** Upload and overwrite: `insert` and `update`. */
417
+ readonly write?: RlsPermissionRef;
418
+ readonly delete?: RlsPermissionRef;
419
+ };
420
+ type RlsStorage = {
421
+ readonly buckets: Readonly<Record<string, RlsStorageBucket>>;
422
+ };
211
423
  /** `permdock supabase hook generate` input. */
212
424
  type SupabaseHookConfig = {
213
425
  /** The same `fromTable` / `fromJunction` sources the app passes as `memberships`. */
@@ -239,12 +451,19 @@ type SupabaseHookConfig = {
239
451
  };
240
452
  /**
241
453
  * Claims other packages own, each `claim: '<schema>.<function>'`, for
242
- * example `{ features: 'better_supabase.feature_claims' }`. The function
454
+ * example `{ features: 'public.feature_claims' }`. The function
243
455
  * takes the user id (`uuid`) and returns `jsonb`; `null` omits the claim.
244
456
  * Reserved names are refused, the claims sit outside `budget`, and a
245
457
  * suspended user gets none.
246
458
  */
247
459
  readonly claims?: Readonly<Record<string, string>>;
460
+ readonly before?: string | readonly string[];
461
+ /**
462
+ * Check the claims the hook wrote against `supabase-claims-v1.json` with
463
+ * pg_jsonschema, and drop them all on a mismatch so the user signs in with
464
+ * no PermDock access instead of an error. Needs the extension. Default `false`.
465
+ */
466
+ readonly validate?: boolean;
248
467
  /** Bytes of JSON the `memberships` claim may use. Default `supabaseMembershipsBudget` (1024). */
249
468
  readonly budget?: number;
250
469
  /** Keep `permdock_authz_version` and write the `authz_ver` claim. Default `true`. */
@@ -259,6 +478,13 @@ type SupabaseConfig = {
259
478
  readonly hook?: SupabaseHookConfig;
260
479
  };
261
480
  type DoctorConfig = {
481
+ /**
482
+ * Directories or globs the source checks read (PD001, PD002, PD007 to
483
+ * PD015, PD044 and the other checks over files), default `collect.srcPath`.
484
+ * The catalog `collect` writes still comes from `collect.srcPath`, and PD004
485
+ * compares the catalog on disk with that one.
486
+ */
487
+ readonly srcPath?: readonly string[];
262
488
  readonly sensitiveActions?: readonly string[];
263
489
  readonly memberships?: string;
264
490
  /** A JSON fixture `{ credentials?, settings? }` of API-key credentials and per-tenant settings (the `memorySettings` input) for PD029. */
@@ -280,8 +506,20 @@ type PermDockConfig = {
280
506
  };
281
507
  readonly rls?: RlsConfig;
282
508
  readonly supabase?: SupabaseConfig;
509
+ readonly powersync?: PowerSyncConfig;
283
510
  readonly doctor?: DoctorConfig;
284
511
  };
512
+ /** `permdock powersync generate` and `verify` input. Tables and memberships come from `rls`. */
513
+ type PowerSyncConfig = {
514
+ /** The Sync Streams file; default `sync-config.yaml`. */
515
+ readonly out?: string;
516
+ /** Resources that get a stream; default every resource with a grant of `action`. */
517
+ readonly resources?: readonly string[];
518
+ /** The action whose grants decide which rows sync; default `read`. */
519
+ readonly action?: string;
520
+ /** Where `generate` writes `localSnapshotManifest(policy)` as JSON for `localSnapshot` and `powersyncSource`; none by default. */
521
+ readonly manifest?: string;
522
+ };
285
523
  type CliIo = {
286
524
  readonly stdout: (text: string) => void;
287
525
  readonly stderr: (text: string) => void;
@@ -309,4 +547,4 @@ type PermDockPluginOptions = {
309
547
  readonly check?: boolean;
310
548
  };
311
549
  //#endregion
312
- export { PermDockPluginOptions as a, RlsDialect as c, RlsMemberships as d, RlsSuspension as f, PermDockConfig as i, RlsFunctionMapping as l, RunResult as m, CliIo as n, RlsActiveRow as o, RlsTarget as p, CollectConfig as r, RlsConfig as s, CatalogConfig as t, RlsMembershipTable as u };
550
+ export { RunResult as _, PermDockPluginOptions as a, RlsConfig as c, RlsMembershipTable as d, RlsMemberships as f, RlsTarget as g, RlsSuspension as h, PermDockConfig as i, RlsDialect as l, RlsSuspendedScope as m, CliIo as n, RlsActiveRow as o, RlsSuspendedMembership as p, CollectConfig as r, RlsApiKeys as s, CatalogConfig as t, RlsFunctionMapping as u };
@@ -1,5 +1,5 @@
1
- import { C as Policy, Cn as ArazzoPlan, E as PolicyVocabulary, In as ExplainedDecision, Mn as Decision, Qt as PermDockOptions, Xt as DecideOptions, Zt as PermDock, en as SimulateOptions, hr as Subject, mr as Principal, pr as Membership, tn as WhereResult, wn as ArazzoSimulateInput } from "./policy-CInmNGkM.js";
2
- import { d as Permission, p as PermissionTree } from "./permissions-B4apnahQ.js";
1
+ import { $n as ExplainedDecision, C as Policy, D as PolicyVocabulary, In as ArazzoPlan, Ln as ArazzoSimulateInput, Mr as Membership, Nr as Principal, Pr as Subject, Yn as Decision, cn as DeriveOptions, fn as SimulateOptions, ln as PermDock, mn as WhereResult, sn as DecideOptions, un as PermDockOptions } from "./policy-CFZAr_Al.js";
2
+ import { f as Permission, m as PermissionTree } from "./permissions-DttnqqxC.js";
3
3
  //#region src/pdp/types.d.ts
4
4
  type RemotePdpAuth = {
5
5
  readonly bearer: string | (() => string | Promise<string>);
@@ -84,7 +84,9 @@ type SpiceDbOptions = {
84
84
  readonly cache?: RemotePdpCache;
85
85
  readonly fetch?: typeof fetch;
86
86
  };
87
- type PdpPermDock<V extends PolicyVocabulary = PolicyVocabulary> = Omit<PermDock<V>, "can" | "decide" | "assert" | "explain" | "filter" | "where" | "simulate" | "tenant" | "team"> & {
87
+ type PdpPermDock<V extends PolicyVocabulary = PolicyVocabulary> = Omit<PermDock<V>, "can" | "decide" | "assert" | "explain" | "filter" | "where" | "simulate" | "tenant" | "team" | "derive"> & {
88
+ /** `permdock.derive` with the same providers: the result asks the PDP too. */
89
+ readonly derive: (options: DeriveOptions) => PdpPermDock<V> | Promise<PdpPermDock<V>>;
88
90
  /**
89
91
  * For a delegated permission whose provider lists ids, an `in` over them
90
92
  * (AND the local condition when local grants exist); otherwise the local
@@ -1,4 +1,4 @@
1
- import { d as Permission } from "./permissions-B4apnahQ.js";
1
+ import { f as Permission } from "./permissions-DttnqqxC.js";
2
2
  //#region src/agent/types.d.ts
3
3
  type ToolBinding = {
4
4
  readonly permission: Permission;
@@ -0,0 +1,48 @@
1
+ import { Ft as TokenVerifier, Tt as Snapshot, Yn as Decision } from "./policy-CFZAr_Al.js";
2
+ import { f as Permission } from "./permissions-DttnqqxC.js";
3
+ import { ReactNode } from "react";
4
+ //#region src/react/types.d.ts
5
+ type PermDockProviderProps = ({
6
+ readonly snapshot: Snapshot | string;
7
+ readonly snapshotPromise?: never;
8
+ } | {
9
+ /**
10
+ * An unawaited snapshot from a Server Component. Hooks never suspend on it: until it
11
+ * resolves they deny with `status: 'pending'`, then re-render. A rejection fails closed
12
+ * (`server-only`). Set `suspend` to suspend readers through `use()` instead.
13
+ */
14
+ readonly snapshotPromise: PromiseLike<Snapshot | string>;
15
+ readonly snapshot?: never;
16
+ }) & {
17
+ /**
18
+ * With `snapshotPromise`: `true` suspends every hook to the nearest Suspense boundary until it
19
+ * resolves, and a rejection reaches the nearest error boundary. Defaults to `false`.
20
+ */
21
+ readonly suspend?: boolean;
22
+ /**
23
+ * The AuthZEN evaluations endpoint for checks the snapshot cannot answer. `false` never
24
+ * fetches: those checks answer `denied` with reason `server-only`.
25
+ */
26
+ readonly endpoint?: string | false;
27
+ /** Where `refresh()` fetches a fresh snapshot. Defaults to `endpoint`. */
28
+ readonly snapshotUrl?: string;
29
+ readonly approvals?: string;
30
+ readonly tenant?: string;
31
+ readonly fetch?: typeof fetch;
32
+ readonly headers?: Readonly<Record<string, string>>;
33
+ readonly maxAge?: number;
34
+ readonly verifier?: TokenVerifier;
35
+ readonly children: ReactNode;
36
+ };
37
+ type ProtectedProps = {
38
+ readonly permission: Permission;
39
+ readonly data?: unknown;
40
+ readonly tenant?: string;
41
+ readonly pending?: ReactNode;
42
+ readonly fallback?: ReactNode | ((decision: Decision) => ReactNode);
43
+ readonly children: ReactNode | ((decision: Extract<Decision, {
44
+ readonly outcome: "granted";
45
+ }>) => ReactNode);
46
+ };
47
+ //#endregion
48
+ export { ProtectedProps as n, PermDockProviderProps as t };
@@ -1,4 +1,4 @@
1
- import { b as ResourceRelation } from "./permissions-B4apnahQ.js";
1
+ import { S as ResourceRelation } from "./permissions-DttnqqxC.js";
2
2
  //#region src/catalog/types.d.ts
3
3
  type CatalogUsage = {
4
4
  readonly file: string;
@@ -15,6 +15,8 @@ type CatalogPermission = {
15
15
  readonly usages: readonly CatalogUsage[];
16
16
  /** Keys the permission was renamed from (`definePermissions` `renamed`), sorted; absent when none. */
17
17
  readonly renamedFrom?: readonly string[];
18
+ /** Level names a custom role may pick for the permission (`resource(…, { levels })`); absent when none. */
19
+ readonly levels?: readonly string[];
18
20
  /** Present only when the policy lists the permission in `hostable`. */
19
21
  readonly hostable?: true;
20
22
  /**
@@ -61,6 +63,7 @@ type CatalogResource = {
61
63
  readonly version?: string;
62
64
  /** The boolean column that keeps ancestor grants out of a row. */
63
65
  readonly restricted?: string;
66
+ readonly restrictedStops?: readonly string[];
64
67
  };
65
68
  type CatalogRole = {
66
69
  readonly key: string;
@@ -134,6 +137,8 @@ type CatalogGrant = {
134
137
  readonly validity?: CatalogValidity;
135
138
  readonly name?: string;
136
139
  readonly purpose?: readonly string[];
140
+ /** The permission key the subject must also hold through a role on the row's scope instance (`requires`). */
141
+ readonly requires?: string | readonly string[];
137
142
  readonly limit?: {
138
143
  readonly count: number;
139
144
  readonly per: string;
@@ -169,6 +174,7 @@ type CatalogDelegation = {
169
174
  readonly to: {
170
175
  readonly kind: string;
171
176
  readonly id?: string;
177
+ readonly client?: string;
172
178
  };
173
179
  readonly permissions: readonly string[];
174
180
  readonly validity?: CatalogValidity;
@@ -0,0 +1,52 @@
1
+ import { Cr as Actor, D as PolicyVocabulary, Nr as Principal, Yn as Decision, kr as Delegation, ln as PermDock } from "./policy-CFZAr_Al.js";
2
+ import { f as Permission } from "./permissions-DttnqqxC.js";
3
+ //#region src/client/types.d.ts
4
+ type ClientStatus = "ready" | "pending" | "stale" | "server-only";
5
+ type PermissionState = {
6
+ readonly allowed: boolean;
7
+ readonly status: ClientStatus;
8
+ readonly decision: Decision;
9
+ };
10
+ type PermissionSet = {
11
+ readonly granted: readonly Permission[];
12
+ get(permission: Permission): PermissionState | undefined;
13
+ };
14
+ type ClientPermDock<V extends PolicyVocabulary = PolicyVocabulary> = PermDock<V> & {
15
+ status(permission?: Permission, data?: unknown): ClientStatus;
16
+ invalidate(ref: Permission | {
17
+ readonly [key: string]: unknown;
18
+ }): void;
19
+ refresh(options?: {
20
+ readonly tenant?: string;
21
+ }): Promise<void>;
22
+ clear(): void;
23
+ subscribe(listener: () => void): () => void;
24
+ };
25
+ type ApprovalState = "not-needed" | "required" | "pending" | "approved" | "rejected" | "expired";
26
+ type ApprovalHandle = {
27
+ readonly state: ApprovalState;
28
+ readonly token: string | undefined;
29
+ readonly request: (note?: string) => Promise<void>;
30
+ };
31
+ type SubjectView = {
32
+ readonly principal: Principal | null;
33
+ readonly actor: Actor | undefined;
34
+ readonly delegation: Delegation | undefined;
35
+ readonly expiresAt: number | undefined;
36
+ readonly simulated: boolean;
37
+ };
38
+ type TenantView = {
39
+ readonly tenant: string | null;
40
+ readonly tenants: readonly string[];
41
+ readonly switchTo: (id: string) => Promise<void>;
42
+ readonly status: ClientStatus;
43
+ };
44
+ type FilterResult<T> = readonly T[] & {
45
+ readonly partial: boolean;
46
+ };
47
+ type UseRolesOptions = {
48
+ readonly tenant?: string;
49
+ readonly team?: string;
50
+ };
51
+ //#endregion
52
+ export { FilterResult as a, SubjectView as c, ClientStatus as i, TenantView as l, ApprovalState as n, PermissionSet as o, ClientPermDock as r, PermissionState as s, ApprovalHandle as t, UseRolesOptions as u };
@@ -1,4 +1,4 @@
1
- import { U as Approver, hr as Subject, o as ApprovalStage, pr as Membership, qn as RelationGrantee, r as ApprovalMode } from "./policy-CInmNGkM.js";
1
+ import { G as Approver, Mr as Membership, Pr as Subject, dr as RelationGrantee, o as ApprovalStage, r as ApprovalMode } from "./policy-CFZAr_Al.js";
2
2
  //#region src/approvals/types.d.ts
3
3
  type ApprovalStatus = "pending" | "approved" | "rejected" | "expired";
4
4
  type ApprovalApprovers = {
@@ -24,6 +24,7 @@ type ApprovalSignature = {
24
24
  readonly by: string;
25
25
  readonly at: string;
26
26
  readonly stage?: number;
27
+ readonly vouched?: string;
27
28
  };
28
29
  type ApprovalSubjectSummary = {
29
30
  readonly principal: {
@@ -63,6 +64,7 @@ type ApprovalRequest = {
63
64
  readonly resolvedAt?: string;
64
65
  /** The approver whose verdict resolved the request (the last of `approvals` on a quorum), or `system:<by>` for a cancellation. */
65
66
  readonly resolvedBy?: string;
67
+ readonly vouched?: string;
66
68
  readonly note?: string;
67
69
  readonly consumedAt?: string;
68
70
  };
@@ -77,6 +79,14 @@ type ApprovalVerdict = {
77
79
  * none, so relation approvers match nobody.
78
80
  */
79
81
  readonly relations?: readonly string[];
82
+ /**
83
+ * The `holder(permission)` approvers (by permission key) that `by` holds
84
+ * in the request's tenant, as `approverPermissions` read them from the
85
+ * approver's own instance. Server-side input, never from the request body.
86
+ * Absent means none, so permission approvers match nobody.
87
+ */
88
+ readonly permissions?: readonly string[];
89
+ readonly vouched?: string;
80
90
  };
81
91
  type ApprovalListFilter = {
82
92
  readonly status?: ApprovalStatus;
@@ -104,6 +114,12 @@ type ApprovalCancelMeta = {
104
114
  readonly note?: string;
105
115
  };
106
116
  type ApprovalStore = {
117
+ /**
118
+ * How long a request opened against this store stays open, in
119
+ * milliseconds, when the caller sets no `ttl`; absent means
120
+ * `DEFAULT_APPROVAL_TTL_MS`. A grant's `approval.ttl` still caps it.
121
+ */
122
+ readonly ttl?: number;
107
123
  create(request: ApprovalRequest): Promise<void> | void;
108
124
  get(token: string): Promise<ApprovalRequest | null> | ApprovalRequest | null;
109
125
  resolve(token: string, verdict: ApprovalVerdict): Promise<ApprovalRequest> | ApprovalRequest;
@@ -1,4 +1,4 @@
1
- import { E as PolicyVocabulary, Z as DecisionEvent, Zt as PermDock } from "./policy-CInmNGkM.js";
1
+ import { D as PolicyVocabulary, ln as PermDock, rt as DecisionEvent } from "./policy-CFZAr_Al.js";
2
2
  //#region src/otel/types.d.ts
3
3
  declare const GENAI_SEMCONV_PIN = "1.37.0";
4
4
  declare const GEN_AI_TOOL_NAME = "gen_ai.tool.name";