permdock 0.21.0 → 0.22.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 (359) hide show
  1. package/README.md +2 -1
  2. package/dist/a2a/index.d.ts +5 -5
  3. package/dist/a2a/index.js +5 -4
  4. package/dist/{adoption-scan-UkQisAqe.js → adoption-scan-_bHLMnVQ.js} +1 -1
  5. package/dist/agent/index.d.ts +2 -2
  6. package/dist/agent/index.js +1 -1
  7. package/dist/ai-sdk/index.d.ts +4 -4
  8. package/dist/ai-sdk/index.js +3 -3
  9. package/dist/app/index.d.ts +85 -0
  10. package/dist/app/index.js +91 -0
  11. package/dist/app-DIvM65Mv.js +24 -0
  12. package/dist/{approval-policies-CKlByf5o.d.ts → approval-policies-UnDSxT__.d.ts} +2 -2
  13. package/dist/{approval-prompt-CQFiO1KE.d.ts → approval-prompt-2hTqo6IM.d.ts} +2 -2
  14. package/dist/approvals/index.d.ts +3 -3
  15. package/dist/approvals/index.js +3 -3
  16. package/dist/{approvals-CuXILe52.js → approvals-B_sn4Wrn.js} +6 -6
  17. package/dist/{arazzo-CUthH61H.js → arazzo-BXD-VJU_.js} +1 -1
  18. package/dist/{arazzo-BC3uLIZy.js → arazzo-Ct0PGblq.js} +3 -3
  19. package/dist/astro/index.d.ts +6 -6
  20. package/dist/astro/index.js +2 -2
  21. package/dist/{audience-BUonniPx.js → audience-5Xx1hdIv.js} +1 -1
  22. package/dist/{auth-j3Eu-j4h.js → auth-BxXHxWRy.js} +1 -1
  23. package/dist/authzen/index.d.ts +5 -5
  24. package/dist/authzen/index.js +4 -4
  25. package/dist/{automation-CpOk7Tlu.d.ts → automation-B20_8UoT.d.ts} +3 -3
  26. package/dist/{automation-x3KEUusw.js → automation-BueW05db.js} +2 -2
  27. package/dist/better-auth/index.d.ts +2 -2
  28. package/dist/better-auth/index.js +1 -1
  29. package/dist/better-supabase/index.d.ts +113 -56
  30. package/dist/better-supabase/index.js +200 -62
  31. package/dist/better-supabase-DF8f8oly.js +194 -0
  32. package/dist/{bind-CJf7S-Jd.js → bind-B4Z0U2Gr.js} +5 -5
  33. package/dist/{bind-XvnD_SUz.d.ts → bind-CnOMjazH.d.ts} +7 -7
  34. package/dist/{build-instance-CkRKgjSj.js → build-instance-B0vsViF5.js} +3 -25
  35. package/dist/{capability-zN6T9fxe.js → capability-CenWwTMR.js} +1 -1
  36. package/dist/{capability-v2xZB7us.d.ts → capability-YkRMUAsF.d.ts} +2 -2
  37. package/dist/{casbin-BOZN1P2Y.js → casbin-D5evU3lX.js} +1 -1
  38. package/dist/{casbin-v9Xo_XPa.js → casbin-imBS3UIf.js} +1 -1
  39. package/dist/catalog/index.d.ts +5 -5
  40. package/dist/catalog/index.js +5 -5
  41. package/dist/catalog-C462QC3A.js +1 -0
  42. package/dist/{catalog-DjDc87R2.js → catalog-CoyKnU5c.js} +1 -1
  43. package/dist/{catalog-s0waIrfY.js → catalog-Y4CjN8NA.js} +4 -4
  44. package/dist/{catalog-operations-BD22drQf.js → catalog-operations-Do1eD-Rt.js} +1 -1
  45. package/dist/{challenge-DbkpCx_v.js → challenge-B__LcNve.js} +3 -3
  46. package/dist/chat/index.d.ts +1 -1
  47. package/dist/chat/index.js +3 -2
  48. package/dist/chat-sdk/index.d.ts +3 -3
  49. package/dist/claude-agent/index.d.ts +3 -3
  50. package/dist/claude-agent/index.js +2 -2
  51. package/dist/clerk/index.d.ts +3 -3
  52. package/dist/cli/bin.js +1 -1
  53. package/dist/cli/index.d.ts +8 -7
  54. package/dist/cli/index.js +3 -3
  55. package/dist/cloud/index.d.ts +8 -8
  56. package/dist/cloud/index.js +3 -3
  57. package/dist/{cloud-CB0btByh.js → cloud-DWCeStPH.js} +2 -2
  58. package/dist/{codemod-C3a3Iz_w.js → codemod-B7QKJ_ak.js} +2 -2
  59. package/dist/{codemod-B-duJDFD.js → codemod-BaPmaCYQ.js} +13 -6
  60. package/dist/{collect-DN_x7hvV.js → collect-Cr71JA7z.js} +8 -7
  61. package/dist/{collect-DMQ6Sxr6.js → collect-ScSG05VJ.js} +2 -2
  62. package/dist/collect-W9i7REKT.js +1 -0
  63. package/dist/compile/index.d.ts +1 -1
  64. package/dist/compile/index.js +1 -1
  65. package/dist/{compile-B_oJqmIg.js → compile-Cvru58id.js} +2 -2
  66. package/dist/{compile-DonvwG9x.d.ts → compile-DC-BrhH1.d.ts} +3 -3
  67. package/dist/{completion-6IshPaPd.js → completion-DOUMyCwa.js} +1 -1
  68. package/dist/{delegation-aK4T_5WU.js → condition-evaluate-bVVRSdzq.js} +159 -159
  69. package/dist/{config-C45X7mpm.js → config-DRp-E8Ly.js} +1 -1
  70. package/dist/{config-D2oXUwos.js → config-DyNanTjZ.js} +10 -8
  71. package/dist/{config-report-Bmo62RRr.js → config-report-Bh_nLdAE.js} +2 -2
  72. package/dist/{config-shape-D9paLhEX.js → config-shape-C4zqzG2K.js} +9 -2
  73. package/dist/{context-YhyXyqBI.js → context-Cem4QafV.js} +2 -2
  74. package/dist/convex/index.d.ts +5 -5
  75. package/dist/convex/index.js +2 -2
  76. package/dist/{core-Dxkwz4xR.js → core-CUjhfz0W.js} +6 -6
  77. package/dist/{core-9KbhurkH.d.ts → core-D2JNg5jA.d.ts} +3 -3
  78. package/dist/coverage-D8jBJdgD.d.ts +114 -0
  79. package/dist/coverage-Dh2W_DmF.js +211 -0
  80. package/dist/{create-DH4ZD0A7.d.ts → create-B2tdOygC.d.ts} +7 -7
  81. package/dist/{create-Q0wF9Elt.js → create-BJ2_8NDO.js} +5 -5
  82. package/dist/{create-BRiRVNUO.js → create-BsL5lCWR.js} +8 -7
  83. package/dist/{create-BzgDDamI.d.ts → create-CPDSbK1a.d.ts} +5 -5
  84. package/dist/{create-BQOQkYYg.d.ts → create-oMCcZV4X.d.ts} +9 -9
  85. package/dist/{credential-B3Hj4puZ.js → credential-Bap3HClV.js} +4 -4
  86. package/dist/{server-D0PW6ZCw.js → credentials-BXV0oz56.js} +3 -146
  87. package/dist/credentials-DPX140fN.d.ts +125 -0
  88. package/dist/delivery/index.d.ts +4 -4
  89. package/dist/delivery/index.js +1 -1
  90. package/dist/{denied-text-De8cw3MW.d.ts → denied-text-BXQkWU7d.d.ts} +2 -2
  91. package/dist/{describe-DibQM6g-.d.ts → describe-DVobr5FX.d.ts} +2 -2
  92. package/dist/{diff-BJv7I3GR.js → diff-BR9JArxz.js} +6 -6
  93. package/dist/{diff-3fpwo3UD.js → diff-Jc_kbDz-.js} +1 -1
  94. package/dist/{doctor-Bz7s3JYD.js → doctor-BBMW5ZT_.js} +310 -36
  95. package/dist/{doctor-keoa9DpH.js → doctor-DhqSiPkq.js} +3 -3
  96. package/dist/drizzle/index.d.ts +3 -3
  97. package/dist/drizzle/index.js +1 -1
  98. package/dist/elysia/index.d.ts +5 -5
  99. package/dist/elysia/index.js +3 -3
  100. package/dist/{errors-OTE9u4Wk.d.ts → errors-D_JIQJYb.d.ts} +1 -1
  101. package/dist/{evaluate-Dcq_U2TV.js → evaluate-B5yZHmts.js} +16 -16
  102. package/dist/{evaluations-CNMVJVD6.js → evaluations-BzTDWO4m.js} +57 -57
  103. package/dist/{evaluations-OCm_Z-8V.d.ts → evaluations-DQYfh4Jh.d.ts} +3 -3
  104. package/dist/eve/index.d.ts +5 -5
  105. package/dist/eve/index.js +3 -3
  106. package/dist/express/index.d.ts +5 -5
  107. package/dist/express/index.js +3 -3
  108. package/dist/fastify/index.d.ts +5 -5
  109. package/dist/fastify/index.js +3 -3
  110. package/dist/{fetch-adapter-BlL-ZhHq.d.ts → fetch-adapter-DxqsIXSO.d.ts} +4 -4
  111. package/dist/{fetch-adapter-4EB3cLgB.js → fetch-adapter-MoYZ-vF5.js} +3 -3
  112. package/dist/{fields-D_TfExiI.js → fields-CVyOk-f1.js} +2 -2
  113. package/dist/{fixtures-Cemqurt8.js → fixtures-BVZc7OCF.js} +1 -1
  114. package/dist/{from-snapshot-DHnb8Fh4.js → from-snapshot-oR_N97dM.js} +346 -14
  115. package/dist/{gen-DYF4LKUP.js → gen-DXXoFjyf.js} +1 -1
  116. package/dist/{gen-Cf7nQsOb.js → gen-WdycZ_-b.js} +5 -5
  117. package/dist/{grantee-conditions-DX4K_gGI.js → grantee-conditions-Dzprappv.js} +1 -1
  118. package/dist/{grantee-match-BP-k4vRJ.js → grantee-match-8J2y60MF.js} +3 -3
  119. package/dist/h3/index.d.ts +4 -4
  120. package/dist/h3/index.js +3 -3
  121. package/dist/{helpers-D-MXwkOF.js → helpers-DzBIfL1N.js} +25 -25
  122. package/dist/hono/index.d.ts +5 -5
  123. package/dist/hono/index.js +3 -3
  124. package/dist/{hosted-C2Pmhy2x.js → hosted-C5I2TSXm.js} +4 -4
  125. package/dist/{hosted-yhyAuQkL.d.ts → hosted-DXq1plaP.d.ts} +1 -1
  126. package/dist/{http-DhMWeB_h.js → http-dptLQzPP.js} +1 -1
  127. package/dist/{expiry-6XByK0dm.js → ids-DzhJaCUj.js} +23 -23
  128. package/dist/{import-CQ_kH_Ny.js → import-BE5sDazm.js} +2 -2
  129. package/dist/{import-C2ExjVvv.js → import-CvXswHDy.js} +2 -2
  130. package/dist/index-BcS8c_2S.d.ts +101 -0
  131. package/dist/{index--AwSBzJC.d.ts → index-BdZpqhJK.d.ts} +2 -2
  132. package/dist/{index-CLbGOPBr.d.ts → index-C-R8lBPb.d.ts} +3 -3
  133. package/dist/{index-Do7FqHEr.d.ts → index-C_8uxAlv.d.ts} +5 -5
  134. package/dist/{index-tuR-kZoJ.d.ts → index-Cjfa1Uwr.d.ts} +21 -40
  135. package/dist/{index-BqzpT-90.d.ts → index-iIsqXFVu.d.ts} +6 -6
  136. package/dist/index.d.ts +19 -20
  137. package/dist/index.js +25 -24
  138. package/dist/{init-kTFkEu8S.js → init-B_S8Xdz1.js} +4 -4
  139. package/dist/{init-DvkvbvZ_.js → init-CqGHcvyR.js} +2 -2
  140. package/dist/{instance-options-Cq66kEeR.d.ts → instance-options-C6gEDOts.d.ts} +1 -1
  141. package/dist/instance-options-URVwqpMW.js +24 -0
  142. package/dist/{instance-snapshot-Bi4-dJk0.js → instance-snapshot-D_dGTq--.js} +9 -9
  143. package/dist/jwt/index.d.ts +4 -4
  144. package/dist/jwt/index.js +2 -2
  145. package/dist/{kernel-CLEzDmbv.js → kernel-NmxiWII2.js} +8 -8
  146. package/dist/kysely/index.d.ts +3 -3
  147. package/dist/kysely/index.js +1 -1
  148. package/dist/limits-CAhpRrhk.js +167 -0
  149. package/dist/{load-BaEamml-.js → load-C4p4VgwR.js} +2 -2
  150. package/dist/load-DiBUJx77.js +1 -0
  151. package/dist/{login-9ycIcJZH.js → login-CzwlsBEO.js} +4 -4
  152. package/dist/{login-CM_etiLM.js → login-DoLxv1s5.js} +3 -3
  153. package/dist/{manifest-CCd-xrM3.js → manifest-BAf7cgRx.js} +35 -35
  154. package/dist/{map-claims-PQwHynxV.js → map-claims-CAa_bQt9.js} +1 -1
  155. package/dist/{map-error-EOhahOVA.js → map-error-p4ROJ_26.js} +1 -1
  156. package/dist/mcp/index.d.ts +9 -9
  157. package/dist/mcp/index.js +9 -8
  158. package/dist/{migrate-CkLHdwuH.js → migrate-DVsxeE0y.js} +1 -1
  159. package/dist/{module-values-BYuNtdK5.js → module-values-BLiVlO1X.js} +3 -3
  160. package/dist/nest/index.d.ts +5 -5
  161. package/dist/nest/index.js +3 -3
  162. package/dist/next/index.d.ts +43 -17
  163. package/dist/next/index.js +54 -21
  164. package/dist/next/plugin.d.ts +1 -1
  165. package/dist/next/plugin.js +1 -1
  166. package/dist/node/index.d.ts +5 -5
  167. package/dist/node/index.js +2 -2
  168. package/dist/openai/index.d.ts +5 -5
  169. package/dist/openai/index.js +3 -3
  170. package/dist/openapi/index.d.ts +5 -59
  171. package/dist/openapi/index.js +3 -2
  172. package/dist/{openapi-BOsx0xn9.js → openapi-Cc-aS9xC.js} +6 -135
  173. package/dist/{openapi-QnnU2A1c.js → openapi-DroBcLJZ.js} +2 -2
  174. package/dist/{openapi-DA7FVG2F.js → openapi-EmvKwuWj.js} +4 -4
  175. package/dist/{operations-Ci_rT6Uo.d.ts → operations-BMPx7HyO.d.ts} +1 -1
  176. package/dist/optional-8TKc-0j4.js +47 -0
  177. package/dist/orpc/index.d.ts +7 -7
  178. package/dist/orpc/index.js +4 -4
  179. package/dist/otel/index.d.ts +3 -3
  180. package/dist/otel/index.js +1 -1
  181. package/dist/{output-KT0a3B3H.js → output-CYgfpT6o.js} +1 -1
  182. package/dist/{ownership-CeNOtQMV.js → ownership-adPAsUwY.js} +15 -13
  183. package/dist/{parse-CXTT7hBq.js → parse-CORUNcCo.js} +1 -1
  184. package/dist/{parse-local-manifest-CE4tgFsj.d.ts → parse-local-manifest-BaCqsqwC.d.ts} +1 -1
  185. package/dist/pdp/index.d.ts +3 -3
  186. package/dist/pdp/index.js +4 -3
  187. package/dist/{permdock-DbAq8_Fp.js → permdock-B5LyNVgn.js} +70 -34
  188. package/dist/{permdock-CsrvbzHk.d.ts → permdock-BaB-KQqn.d.ts} +46 -9
  189. package/dist/{permissions-Dz79qsFw.js → permissions-COpRGKt7.js} +1 -1
  190. package/dist/{permissions-Bx6UI8n1.d.ts → permissions-DriWkV7q.d.ts} +1 -2
  191. package/dist/{policy-from-catalog-BtqfxytV.js → policy-from-catalog-Cy103lsm.js} +8 -8
  192. package/dist/{policy-types-BI9C5Sp5.d.ts → policy-types-rNfz7t0M.d.ts} +9 -3
  193. package/dist/{policy-CaAME-Rh.js → policy-wGzbAPQF.js} +7 -7
  194. package/dist/{policy-Dh9WVSVz.d.ts → policy-x8RBKW8d.d.ts} +2 -2
  195. package/dist/{postgrest-CWCCbaxm.d.ts → postgrest-Cn0Res25.d.ts} +9 -21
  196. package/dist/powersync-BdoR7nwS.js +1 -0
  197. package/dist/{powersync-CWsN-QaK.js → powersync-BeI0VmEK.js} +2 -2
  198. package/dist/{powersync-DiqY3VBG.js → powersync-Dpa5AnnN.js} +11 -11
  199. package/dist/preset/index.js +1 -1
  200. package/dist/{preset-pPrVyGU5.js → preset-Bn5Z54cH.js} +5 -6
  201. package/dist/prisma/index.d.ts +2 -2
  202. package/dist/prisma/index.js +1 -1
  203. package/dist/{protected-action-CuG0xz4P.d.ts → protected-action-C4aj1KjO.d.ts} +6 -7
  204. package/dist/{protected-action-CD1HXwQK.js → protected-action-E7Sdt_Dt.js} +1 -1
  205. package/dist/{provider-ihxuJbMi.d.ts → provider-B-1DlOGM.d.ts} +1 -1
  206. package/dist/{provider-qESIf_C0.js → provider-DKO9KHua.js} +2 -2
  207. package/dist/{provider-store-BTHGJH9j.js → provider-store-D4PU1my_.js} +2 -2
  208. package/dist/{pull-B4EhSqOG.js → pull-3tkn25ll.js} +5 -5
  209. package/dist/pull-D90HqWNP.js +1 -0
  210. package/dist/{push-DYOI4bPf.js → push-dMyKdlEm.js} +6 -6
  211. package/dist/{pushed-policy-Dszouliu.js → pushed-policy-Bi5-il4C.js} +2 -2
  212. package/dist/{pushed-policy-P0hgyLBh.d.ts → pushed-policy-P55cJNx5.d.ts} +1 -1
  213. package/dist/react/index.d.ts +6 -6
  214. package/dist/react/index.js +3 -3
  215. package/dist/react/provider-client.d.ts +1 -1
  216. package/dist/react/provider-client.js +1 -1
  217. package/dist/react-native/index.d.ts +9 -9
  218. package/dist/react-native/index.js +7 -7
  219. package/dist/{relation-walk-DK_gkgL7.js → relation-walk-BDTaTKTM.js} +1 -1
  220. package/dist/{relations-BxvRvDHK.js → relations-CMsJ1ARY.js} +1 -1
  221. package/dist/{replay-DYXI4gRN.d.ts → replay-DKhFvt0L.d.ts} +1 -1
  222. package/dist/{request-context-VjeXst1z.js → request-context-5gl_oxO1.js} +2 -2
  223. package/dist/resend/index.d.ts +4 -4
  224. package/dist/resend/index.js +2 -2
  225. package/dist/{resolve-names-BIHnWL_L.js → resolve-names-BnGJU88N.js} +4 -4
  226. package/dist/{rls-C7qXye9M.js → rls-DIYSRnDZ.js} +1 -1
  227. package/dist/{rls-CMFZWosz.js → rls-qrehUPf_.js} +45 -18
  228. package/dist/{role-builder-C5AgaC1x.js → role-builder-boQiUvfo.js} +3 -3
  229. package/dist/{rpc-CYXICjM1.d.ts → rpc-BqRiVpbP.d.ts} +2 -2
  230. package/dist/{rpc-BNIQwEB6.js → rpc-Dhi55Whd.js} +2 -2
  231. package/dist/run-elFdnSZx.js +1 -0
  232. package/dist/{run-CMJX9x7b.js → run-oNqBe0gc.js} +3 -3
  233. package/dist/{run-ticket-CjvXr6wj.js → run-ticket-Ddxt9OuU.js} +2 -2
  234. package/dist/{run-ticket-BXYqQ9dy.d.ts → run-ticket-Dulj4RQk.d.ts} +2 -2
  235. package/dist/{saas-DHFfthXv.js → saas-DABv6vjy.js} +6 -5
  236. package/dist/{scan-CSOkcNdl.js → scan-BYXqcgON.js} +1 -1
  237. package/dist/{schema-7pXCaRYB.js → schema-Wf-SvlHG.js} +1 -1
  238. package/dist/scim/index.d.ts +1 -1
  239. package/dist/scim/index.js +1 -1
  240. package/dist/{scopes-BSdYaGHs.js → scopes-gdH__vDZ.js} +1 -1
  241. package/dist/server/index.d.ts +11 -10
  242. package/dist/server/index.js +7 -6
  243. package/dist/server-CKjFooaJ.js +147 -0
  244. package/dist/{server-types-Bfl-IrzZ.d.ts → server-types--_Hann81.d.ts} +9 -9
  245. package/dist/{shared-sW3VYchq.js → shared-DfaIWvIJ.js} +11 -2
  246. package/dist/{sink-RwmP7ZHs.d.ts → sink-Cs6z34AX.d.ts} +4 -4
  247. package/dist/{skills-DAjg-rgF.js → skills-417bOj4o.js} +1 -1
  248. package/dist/{skills-DrX83QBK.js → skills-B9U465B7.js} +2 -2
  249. package/dist/{snapshot-DHPih65J.js → snapshot-C2j96x97.js} +4 -4
  250. package/dist/{snapshot-cache-MPinwwgZ.d.ts → snapshot-cache-Cc7VNabe.d.ts} +1 -1
  251. package/dist/solid/index.d.ts +6 -7
  252. package/dist/solid/index.js +2 -2
  253. package/dist/solid-start/index.d.ts +6 -6
  254. package/dist/solid-start/index.js +3 -3
  255. package/dist/{sources-sgQlMfmz.d.ts → sources-BfTza0zT.d.ts} +1 -1
  256. package/dist/{src-Cop53_X1.js → src-BG9YJM3Q.js} +96 -247
  257. package/dist/ssf/index.d.ts +3 -3
  258. package/dist/ssf/index.js +3 -3
  259. package/dist/{standard-webhooks-CFZIYtBF.d.ts → standard-webhooks-CJBgfl7y.d.ts} +2 -2
  260. package/dist/{store-CSOsXd5s.js → store-BpKH-pLm.js} +2 -2
  261. package/dist/{store-CRQ5VrWR.d.ts → store-DSyjHD5-.d.ts} +5 -5
  262. package/dist/{store-options-CDvoX52-.js → store-options-CXv6BHH6.js} +5 -6
  263. package/dist/{stores-PpYVQ5yF.js → stores-BuqAHjp_.js} +1 -1
  264. package/dist/{stores-pEBMy94l.d.ts → stores-C6-7TPTV.d.ts} +6 -7
  265. package/dist/{postgrest-BrjrckDG.js → subject-BqFwS6l3.js} +214 -319
  266. package/dist/subject-cache-BT1fGuea.js +193 -0
  267. package/dist/subject-cache-d_Z4KAnm.d.ts +144 -0
  268. package/dist/supabase/index.d.ts +6 -5
  269. package/dist/supabase/index.js +3 -2
  270. package/dist/supabase/middleware.d.ts +6 -6
  271. package/dist/supabase/middleware.js +6 -6
  272. package/dist/{supabase-Cbl2orB2.js → supabase-D0J99yqL.js} +2 -2
  273. package/dist/{supabase-CVZuytCC.js → supabase-DnazO6W4.js} +3 -3
  274. package/dist/{supabase-hook-BUcu3vPM.js → supabase-hook-Bh5syR9N.js} +174 -62
  275. package/dist/supabase-hook-CVAenq-w.js +1 -0
  276. package/dist/{supautils-a_253u1X.js → supautils-ChXR-4Or.js} +302 -43
  277. package/dist/{support-session-BsmPCbz8.js → support-session-BGeEYDSq.js} +2 -2
  278. package/dist/svelte/index.d.ts +5 -5
  279. package/dist/svelte/index.js +3 -3
  280. package/dist/svelte/runtime.d.ts +3 -3
  281. package/dist/svelte/runtime.js +1 -1
  282. package/dist/svelte/source.d.ts +5 -5
  283. package/dist/svelte/source.js +2 -2
  284. package/dist/sveltekit/index.d.ts +6 -6
  285. package/dist/sveltekit/index.js +2 -2
  286. package/dist/{tables-XrvffTMj.js → tables-CbEOy2Ma.js} +137 -55
  287. package/dist/tanstack-start/index.d.ts +6 -6
  288. package/dist/tanstack-start/index.js +2 -2
  289. package/dist/{tenancy-DvOHHk3-.js → tenancy-BlxY5T0q.js} +2 -2
  290. package/dist/terminal/index.d.ts +6 -6
  291. package/dist/terminal/index.js +6 -6
  292. package/dist/testing/core.d.ts +1 -1
  293. package/dist/testing/core.js +1 -1
  294. package/dist/testing/fixtures/index.d.ts +35 -2
  295. package/dist/testing/fixtures/index.js +39 -2
  296. package/dist/testing/index.d.ts +41 -25
  297. package/dist/testing/index.js +114 -26
  298. package/dist/testing/saas/index.d.ts +5 -5
  299. package/dist/testing/saas/index.js +2 -2
  300. package/dist/testing/saas/permissions.d.ts +1 -1
  301. package/dist/testing/saas/permissions.js +1 -1
  302. package/dist/trpc/index.d.ts +6 -6
  303. package/dist/trpc/index.js +4 -4
  304. package/dist/{type-helpers-BjOLGVy1.d.ts → type-helpers-iXJEIDe7.d.ts} +3 -4
  305. package/dist/{types-p8mhWTcR.d.ts → types-B9F0EZAF.d.ts} +3 -3
  306. package/dist/{types-DZwEOsK1.d.ts → types-BSNZMp5b.d.ts} +1 -1
  307. package/dist/{types-MixnvXQ5.d.ts → types-BpxdxaRD.d.ts} +5 -5
  308. package/dist/{types-C3C9ien9.d.ts → types-CD1qmxdx.d.ts} +4 -4
  309. package/dist/{types-D1NjjwI4.d.ts → types-CS1DI_Ke.d.ts} +40 -9
  310. package/dist/{types-zh4WGQcP.d.ts → types-C_a44wSr.d.ts} +3 -3
  311. package/dist/{types-DBVSljAx.d.ts → types-Cq2rvv-C.d.ts} +3 -3
  312. package/dist/{types--_lpWUGV.d.ts → types-CuDXvyIT.d.ts} +5 -5
  313. package/dist/{types-7Vlz1Wi2.d.ts → types-DAyp592k.d.ts} +2 -2
  314. package/dist/{types-DjGZAU64.d.ts → types-NikV1pND.d.ts} +4 -4
  315. package/dist/{types-BzxA2OAD.d.ts → types-ZfjQB0KC.d.ts} +2 -2
  316. package/dist/{types-DotXrris.d.ts → types-_pi9kxS2.d.ts} +2 -2
  317. package/dist/unplugin/index.d.ts +1 -1
  318. package/dist/unplugin/index.js +1 -1
  319. package/dist/{usage-DPbdI3Vi.js → usage-0wsl83uw.js} +10 -10
  320. package/dist/{usage-DHsqp4lN.js → usage-Bl-BkXEq.js} +1 -1
  321. package/dist/usage-CmyGbo4e.js +1 -0
  322. package/dist/{validation-error-DkOK9zUE.d.ts → validation-error-DLAYFlkr.d.ts} +1 -1
  323. package/dist/{verify-C0jGJrmb.js → verify-BSLotSa0.js} +41 -24
  324. package/dist/version-sources-BC3hf2ME.js +34 -0
  325. package/dist/{permission-types-CAY-GU7e.d.ts → vocabulary-DeZvUaTw.d.ts} +69 -1
  326. package/dist/vue/index.d.ts +6 -7
  327. package/dist/vue/index.js +2 -2
  328. package/dist/{waiter-BjVI_Byg.d.ts → waiter-cbK1CBhT.d.ts} +2 -2
  329. package/dist/{watch-Dz2LNM1R.js → watch-BigZ260i.js} +2 -2
  330. package/dist/watch-CHURMgrv.js +1 -0
  331. package/dist/webmcp/index.d.ts +2 -2
  332. package/dist/{who-can-CZeAwQZD.js → who-can-CjfMP9a4.js} +8 -8
  333. package/dist/workflow/index.d.ts +3 -3
  334. package/dist/workflow/index.js +6 -5
  335. package/dist/workflow-sdk/index.d.ts +5 -5
  336. package/dist/{wrap-EQ6Or2Hi.d.ts → wrap-B-k2qHJx.d.ts} +2 -2
  337. package/package.json +16 -4
  338. package/skills/permdock-wire/references/presets-and-recipes.md +2 -2
  339. package/dist/better-supabase-ayun1IKE.js +0 -122
  340. package/dist/catalog-BTPySmbp.js +0 -1
  341. package/dist/collect-eSTXOZDC.js +0 -1
  342. package/dist/index-DuOF7OqS.d.ts +0 -222
  343. package/dist/load-CjnlPxpL.js +0 -1
  344. package/dist/powersync-CWCirKAJ.js +0 -1
  345. package/dist/pull-VzcECZ-R.js +0 -1
  346. package/dist/run-D2e1tybu.js +0 -1
  347. package/dist/supabase-hook-QWphWBnG.js +0 -1
  348. package/dist/usage-dmSjKx-Z.js +0 -1
  349. package/dist/version-cache-q5cpaDSt.d.ts +0 -57
  350. package/dist/vocabulary-DEJ5j4mR.d.ts +0 -70
  351. package/dist/watch-CS69ftMP.js +0 -1
  352. package/dist/where-scope-BAyOsPQW.js +0 -332
  353. package/dist/{approval-normalize-hlfO9BJv.js → approval-normalize-DNLW0zOM.js} +1 -1
  354. package/dist/{body-C9JbIoqb.js → body-B3ylkmmE.js} +1 -1
  355. package/dist/{catalog-doc-nrgfbh8I.js → catalog-doc-Zi0jRpyH.js} +2 -2
  356. package/dist/{device-BwbJNmb2.js → device-BkSynWdg.js} +1 -1
  357. package/dist/{prompt-BYc6drYW.js → prompt-D1Gj1W4Y.js} +1 -1
  358. package/dist/{scim-C30QBBoF.js → scim-BG6uPUeW.js} +1 -1
  359. package/dist/{wrap-C5PWzgkq.js → wrap-BKU5Arsu.js} +1 -1
@@ -1,15 +1,167 @@
1
1
  import { n as isReadonlyArray } from "./compact-CAf557ZB.js";
2
2
  import { r as ownGet } from "./paths-CUvURzHp.js";
3
3
  import { a as resolveConditionRef, c as isConditionDate, d as parentHop, l as isConditionRef } from "./refs-C8BKxc_e.js";
4
- import { o as sameId, t as expiredAt } from "./expiry-6XByK0dm.js";
4
+ import { t as isActive } from "./validity-Buc7w8E9.js";
5
5
  import { g as formerScopes, m as annotationsFor, n as findPermission } from "./permission-registry-B8tYxPIt.js";
6
+ import { o as flattenGrantee } from "./grantee-Dke-9rd1.js";
6
7
  import { o as epochSeconds } from "./time-nR1JesoH.js";
7
- import { d as scopeList, p as tenantOf, s as resolveScope } from "./scopes-BSdYaGHs.js";
8
+ import { a as expiredAt, i as sameId } from "./ids-DzhJaCUj.js";
9
+ import { d as scopeList, p as tenantOf, s as resolveScope } from "./scopes-gdH__vDZ.js";
10
+ import { n as matchGrantee } from "./grantee-match-8J2y60MF.js";
8
11
  import { t as isoInstant } from "./instant-DK3Iz83e.js";
9
- import { o as flattenGrantee } from "./grantee-Dke-9rd1.js";
10
- import { t as isActive } from "./validity-Buc7w8E9.js";
11
- import { n as matchGrantee } from "./grantee-match-BP-k4vRJ.js";
12
- //#region src/conditions/evaluate.ts
12
+ //#region src/core/delegation.ts
13
+ /**
14
+ * The permission's scope and any scope it was renamed from: tokens issued
15
+ * before a rename keep working.
16
+ */
17
+ function scopeNames(permission) {
18
+ return [permission.scope, ...formerScopes(permission)];
19
+ }
20
+ /**
21
+ * Whether a delegated caller may use a permission its principal holds, through
22
+ * OAuth `scopes`, RFC 9396 `authorizationDetails` or GNAP `access`. `undefined`
23
+ * means covered; otherwise the denial reason `decide` would add.
24
+ */
25
+ function coveredByDelegation(permission, delegation, resourceId, hasActor = false) {
26
+ const unscoped = hasActor ? "no-delegation" : void 0;
27
+ if (delegation === void 0) return unscoped;
28
+ const hasScopes = delegation.scopes !== void 0;
29
+ const hasDetails = delegation.authorizationDetails !== void 0;
30
+ const hasAccess = delegation.access !== void 0;
31
+ if (!hasScopes && !hasDetails && !hasAccess) return unscoped;
32
+ const emptyScopes = hasScopes && (delegation.scopes?.length ?? 0) === 0;
33
+ const emptyAccess = hasAccess && (delegation.access?.length ?? 0) === 0;
34
+ if (emptyScopes && !hasDetails && !hasAccess) return "no-delegation";
35
+ if (emptyAccess && !hasScopes && !hasDetails) return "no-delegation";
36
+ if (emptyScopes && emptyAccess && !hasDetails) return "no-delegation";
37
+ const scopes = scopeNames(permission);
38
+ const scopeOk = delegation.scopes?.some((scope) => scopes.includes(scope)) ?? false;
39
+ const detailOk = delegation.authorizationDetails?.some((detail) => {
40
+ if (detail.type !== permission.resource) return false;
41
+ const identifier = detail["identifier"];
42
+ if (identifier !== void 0 && (typeof identifier !== "string" || identifier !== resourceId)) return false;
43
+ const actions = detail.actions;
44
+ if (actions === void 0) return true;
45
+ return Array.isArray(actions) && actions.includes(permission.action);
46
+ }) ?? false;
47
+ const accessOk = accessCovers(permission, delegation.access, resourceId);
48
+ if (scopeOk || detailOk || accessOk) return;
49
+ return "not-delegated";
50
+ }
51
+ /**
52
+ * A `readOnly` actor never uses a permission without `readOnlyHint`, delegated
53
+ * or not.
54
+ */
55
+ function readOnlyActorRefuses(actor, permission) {
56
+ return actor?.readOnly === true && !annotationsFor(permission).readOnlyHint;
57
+ }
58
+ /**
59
+ * Whether an `agent` actor may call the tool `name`: its `tools` list names it.
60
+ * An agent without a `tools` list and any other actor kind are not restricted
61
+ * here; a `tools` value that is not a list of strings refuses every tool.
62
+ */
63
+ function actorMayCallTool(actor, name) {
64
+ if (actor?.kind !== "agent" || !Object.hasOwn(actor, "tools")) return true;
65
+ const tools = actor["tools"];
66
+ return Array.isArray(tools) && tools.some((tool) => typeof tool === "string" && tool === name);
67
+ }
68
+ function coversRequirements(tree, requires, delegation, resourceId, hasActor = false) {
69
+ return (requires ?? []).every((key) => {
70
+ const leaf = findPermission(tree, key);
71
+ return leaf !== void 0 && coveredByDelegation(leaf, delegation, resourceId, hasActor) === void 0;
72
+ });
73
+ }
74
+ function requiresStandIn(grant) {
75
+ return (grant.requires ?? []).length > 0 && annotationsFor(grant.permission).readOnlyHint && !flattenGrantee(grant.to).some((item) => item.kind === "role");
76
+ }
77
+ function accessCovers(permission, access, resourceId) {
78
+ if (access === void 0) return false;
79
+ return access.some((entry) => {
80
+ if (typeof entry === "string") return scopeNames(permission).includes(entry);
81
+ if (entry === null || typeof entry !== "object") return false;
82
+ const type = entry["type"];
83
+ if (typeof type !== "string" || !typeMatches(type, permission.resource)) return false;
84
+ const actions = entry["actions"];
85
+ if (actions !== void 0 && (!Array.isArray(actions) || !actions.includes(permission.action))) return false;
86
+ const identifier = entry["identifier"];
87
+ if (identifier !== void 0 && (typeof identifier !== "string" || identifier !== resourceId)) return false;
88
+ return true;
89
+ });
90
+ }
91
+ function typeMatches(type, resource) {
92
+ if (type === resource) return true;
93
+ return type.endsWith(`/${resource}`);
94
+ }
95
+ /**
96
+ * Whether the subject's principal is a `from` of the delegation: every item
97
+ * matches, with roles checked against the roles the principal holds here
98
+ * (`matchGrantee` leaves role holding to the caller) and nothing that needs a
99
+ * row.
100
+ */
101
+ function handsOver(delegation, subject, heldRoles, now) {
102
+ const items = flattenGrantee(delegation.from);
103
+ if (items.length === 0 || subject.principal === null) return false;
104
+ return items.every((item) => {
105
+ if (item.kind === "role") return heldRoles.has(item.role);
106
+ if (item.kind === "relation") return false;
107
+ const match = matchGrantee(item, subject, now, void 0);
108
+ return match.matched && match.where === void 0;
109
+ });
110
+ }
111
+ /**
112
+ * The permission keys the policy's delegations let `subject.actor` use for
113
+ * `subject.principal` right now: the union over every active delegation whose
114
+ * `to` matches the actor and whose `from` the principal holds. `undefined` when
115
+ * none applies, so the call falls back to the token delegation alone. An actor
116
+ * with `readOnly: true` gets only each delegation's read-only keys. Attenuation
117
+ * only: a key here still needs a matching allow and no deny.
118
+ */
119
+ function delegatedPermissions(delegations, subject, heldRoles, now) {
120
+ const actor = subject.actor;
121
+ if (actor === void 0 || delegations === void 0) return;
122
+ let keys;
123
+ for (const delegation of delegations) {
124
+ if (delegation.to.kind !== actor.kind || delegation.to.id !== void 0 && delegation.to.id !== actor.id || delegation.to.client !== void 0 && delegation.to.client !== actor.client || !isActive(delegation.validity, now) || !handsOver(delegation, subject, heldRoles, now)) continue;
125
+ keys ??= /* @__PURE__ */ new Set();
126
+ for (const key of actor.readOnly === true ? delegation.readOnly : delegation.permissions) keys.add(key);
127
+ }
128
+ return keys;
129
+ }
130
+ //#endregion
131
+ //#region src/core/row-pair.ts
132
+ function isRowPair(value) {
133
+ return value !== null && typeof value === "object" && "current" in value && "next" in value;
134
+ }
135
+ /**
136
+ * The row a `where` reads and the row a `check` reads. An instance check takes
137
+ * a `{ current, next }` pair or one row for both; a collection check has no
138
+ * current row, only the input it creates.
139
+ */
140
+ function rowValues(permission, data) {
141
+ if (permission.kind === "collection") return {
142
+ current: void 0,
143
+ next: data
144
+ };
145
+ if (permission.kind === "instance" && isRowPair(data)) return {
146
+ current: data.current,
147
+ next: data.next
148
+ };
149
+ return {
150
+ current: data,
151
+ next: data
152
+ };
153
+ }
154
+ /**
155
+ * The row's id under `field` as a string, or `*` when the row has no string or
156
+ * number there.
157
+ */
158
+ function rowIdOf(row, field = "id") {
159
+ if (row === null || typeof row !== "object" || !Object.hasOwn(row, field)) return "*";
160
+ const id = Reflect.get(row, field);
161
+ return typeof id === "string" || typeof id === "number" ? String(id) : "*";
162
+ }
163
+ //#endregion
164
+ //#region src/conditions/condition-evaluate.ts
13
165
  function resolveRef(ref, subject) {
14
166
  return resolveConditionRef(ref, subject);
15
167
  }
@@ -140,156 +292,4 @@ function evaluateCondition(condition, data, subject, now = epochSeconds(), scope
140
292
  }
141
293
  }
142
294
  //#endregion
143
- //#region src/core/row-pair.ts
144
- function isRowPair(value) {
145
- return value !== null && typeof value === "object" && "current" in value && "next" in value;
146
- }
147
- /**
148
- * The row a `where` reads and the row a `check` reads. An instance check takes
149
- * a `{ current, next }` pair or one row for both; a collection check has no
150
- * current row, only the input it creates.
151
- */
152
- function rowValues(permission, data) {
153
- if (permission.kind === "collection") return {
154
- current: void 0,
155
- next: data
156
- };
157
- if (permission.kind === "instance" && isRowPair(data)) return {
158
- current: data.current,
159
- next: data.next
160
- };
161
- return {
162
- current: data,
163
- next: data
164
- };
165
- }
166
- /**
167
- * The row's id under `field` as a string, or `*` when the row has no string or
168
- * number there.
169
- */
170
- function rowIdOf(row, field = "id") {
171
- if (row === null || typeof row !== "object" || !Object.hasOwn(row, field)) return "*";
172
- const id = Reflect.get(row, field);
173
- return typeof id === "string" || typeof id === "number" ? String(id) : "*";
174
- }
175
- //#endregion
176
- //#region src/core/delegation.ts
177
- /**
178
- * The permission's scope and any scope it was renamed from: tokens issued
179
- * before a rename keep working.
180
- */
181
- function scopeNames(permission) {
182
- return [permission.scope, ...formerScopes(permission)];
183
- }
184
- /**
185
- * Whether a delegated caller may use a permission its principal holds, through
186
- * OAuth `scopes`, RFC 9396 `authorizationDetails` or GNAP `access`. `undefined`
187
- * means covered; otherwise the denial reason `decide` would add.
188
- */
189
- function coveredByDelegation(permission, delegation, resourceId, hasActor = false) {
190
- const unscoped = hasActor ? "no-delegation" : void 0;
191
- if (delegation === void 0) return unscoped;
192
- const hasScopes = delegation.scopes !== void 0;
193
- const hasDetails = delegation.authorizationDetails !== void 0;
194
- const hasAccess = delegation.access !== void 0;
195
- if (!hasScopes && !hasDetails && !hasAccess) return unscoped;
196
- const emptyScopes = hasScopes && (delegation.scopes?.length ?? 0) === 0;
197
- const emptyAccess = hasAccess && (delegation.access?.length ?? 0) === 0;
198
- if (emptyScopes && !hasDetails && !hasAccess) return "no-delegation";
199
- if (emptyAccess && !hasScopes && !hasDetails) return "no-delegation";
200
- if (emptyScopes && emptyAccess && !hasDetails) return "no-delegation";
201
- const scopes = scopeNames(permission);
202
- const scopeOk = delegation.scopes?.some((scope) => scopes.includes(scope)) ?? false;
203
- const detailOk = delegation.authorizationDetails?.some((detail) => {
204
- if (detail.type !== permission.resource) return false;
205
- const identifier = detail["identifier"];
206
- if (identifier !== void 0 && (typeof identifier !== "string" || identifier !== resourceId)) return false;
207
- const actions = detail.actions;
208
- if (actions === void 0) return true;
209
- return Array.isArray(actions) && actions.includes(permission.action);
210
- }) ?? false;
211
- const accessOk = accessCovers(permission, delegation.access, resourceId);
212
- if (scopeOk || detailOk || accessOk) return;
213
- return "not-delegated";
214
- }
215
- /**
216
- * A `readOnly` actor never uses a permission without `readOnlyHint`, delegated
217
- * or not.
218
- */
219
- function readOnlyActorRefuses(actor, permission) {
220
- return actor?.readOnly === true && !annotationsFor(permission).readOnlyHint;
221
- }
222
- /**
223
- * Whether an `agent` actor may call the tool `name`: its `tools` list names it.
224
- * An agent without a `tools` list and any other actor kind are not restricted
225
- * here; a `tools` value that is not a list of strings refuses every tool.
226
- */
227
- function actorMayCallTool(actor, name) {
228
- if (actor?.kind !== "agent" || !Object.hasOwn(actor, "tools")) return true;
229
- const tools = actor["tools"];
230
- return Array.isArray(tools) && tools.some((tool) => typeof tool === "string" && tool === name);
231
- }
232
- function coversRequirements(tree, requires, delegation, resourceId, hasActor = false) {
233
- return (requires ?? []).every((key) => {
234
- const leaf = findPermission(tree, key);
235
- return leaf !== void 0 && coveredByDelegation(leaf, delegation, resourceId, hasActor) === void 0;
236
- });
237
- }
238
- function requiresStandIn(grant) {
239
- return (grant.requires ?? []).length > 0 && annotationsFor(grant.permission).readOnlyHint && !flattenGrantee(grant.to).some((item) => item.kind === "role");
240
- }
241
- function accessCovers(permission, access, resourceId) {
242
- if (access === void 0) return false;
243
- return access.some((entry) => {
244
- if (typeof entry === "string") return scopeNames(permission).includes(entry);
245
- if (entry === null || typeof entry !== "object") return false;
246
- const type = entry["type"];
247
- if (typeof type !== "string" || !typeMatches(type, permission.resource)) return false;
248
- const actions = entry["actions"];
249
- if (actions !== void 0 && (!Array.isArray(actions) || !actions.includes(permission.action))) return false;
250
- const identifier = entry["identifier"];
251
- if (identifier !== void 0 && (typeof identifier !== "string" || identifier !== resourceId)) return false;
252
- return true;
253
- });
254
- }
255
- function typeMatches(type, resource) {
256
- if (type === resource) return true;
257
- return type.endsWith(`/${resource}`);
258
- }
259
- /**
260
- * Whether the subject's principal is a `from` of the delegation: every item
261
- * matches, with roles checked against the roles the principal holds here
262
- * (`matchGrantee` leaves role holding to the caller) and nothing that needs a
263
- * row.
264
- */
265
- function handsOver(delegation, subject, heldRoles, now) {
266
- const items = flattenGrantee(delegation.from);
267
- if (items.length === 0 || subject.principal === null) return false;
268
- return items.every((item) => {
269
- if (item.kind === "role") return heldRoles.has(item.role);
270
- if (item.kind === "relation") return false;
271
- const match = matchGrantee(item, subject, now, void 0);
272
- return match.matched && match.where === void 0;
273
- });
274
- }
275
- /**
276
- * The permission keys the policy's delegations let `subject.actor` use for
277
- * `subject.principal` right now: the union over every active delegation whose
278
- * `to` matches the actor and whose `from` the principal holds. `undefined` when
279
- * none applies, so the call falls back to the token delegation alone. An actor
280
- * with `readOnly: true` gets only each delegation's read-only keys. Attenuation
281
- * only: a key here still needs a matching allow and no deny.
282
- */
283
- function delegatedPermissions(delegations, subject, heldRoles, now) {
284
- const actor = subject.actor;
285
- if (actor === void 0 || delegations === void 0) return;
286
- let keys;
287
- for (const delegation of delegations) {
288
- if (delegation.to.kind !== actor.kind || delegation.to.id !== void 0 && delegation.to.id !== actor.id || delegation.to.client !== void 0 && delegation.to.client !== actor.client || !isActive(delegation.validity, now) || !handsOver(delegation, subject, heldRoles, now)) continue;
289
- keys ??= /* @__PURE__ */ new Set();
290
- for (const key of actor.readOnly === true ? delegation.readOnly : delegation.permissions) keys.add(key);
291
- }
292
- return keys;
293
- }
294
- //#endregion
295
- export { readOnlyActorRefuses as a, rowIdOf as c, delegatedPermissions as i, rowValues as l, coveredByDelegation as n, requiresStandIn as o, coversRequirements as r, isRowPair as s, actorMayCallTool as t, evaluateCondition as u };
295
+ export { actorMayCallTool as a, delegatedPermissions as c, rowValues as i, readOnlyActorRefuses as l, isRowPair as n, coveredByDelegation as o, rowIdOf as r, coversRequirements as s, evaluateCondition as t, requiresStandIn as u };
@@ -10,7 +10,7 @@ const config = defineLeaf({
10
10
  ...failOnFlag
11
11
  },
12
12
  async run(ctx, { flags }) {
13
- const { runConfig } = await import("./config-report-Bmo62RRr.js");
13
+ const { runConfig } = await import("./config-report-Bh_nLdAE.js");
14
14
  return runConfig({
15
15
  cwd: ctx.cwd,
16
16
  config: ctx.config,
@@ -1,7 +1,7 @@
1
1
  import { r as isRecord } from "./compact-CAf557ZB.js";
2
2
  import { i as configError, n as CliError } from "./errors-BhRkoNS7.js";
3
- import { n as betterSupabaseConfig, r as betterSupabaseDefaults } from "./better-supabase-ayun1IKE.js";
4
- import { a as isSection, i as isModuleKey, n as MODULE_KEYS, o as kindOf, r as describeKinds, t as CONFIG_SHAPE } from "./config-shape-D9paLhEX.js";
3
+ import { a as betterSupabaseInstalled, i as betterSupabaseDefaults, r as betterSupabaseConfig } from "./better-supabase-DF8f8oly.js";
4
+ import { a as isSection, i as isModuleKey, n as MODULE_KEYS, o as kindOf, r as describeKinds, t as CONFIG_SHAPE } from "./config-shape-C4zqzG2K.js";
5
5
  import { existsSync } from "node:fs";
6
6
  import { dirname, relative, resolve } from "node:path";
7
7
  //#region src/cli/project/config-schema.ts
@@ -77,17 +77,19 @@ async function readConfig(cwd, fromFlag, options) {
77
77
  file: void 0
78
78
  };
79
79
  if (!existsSync(path)) throw new CliError("usage", `PermDock CLI: config file not found: ${path}`, { code: "config_not_found" });
80
- const { loadModule, pickNamed } = await import("./load-CjnlPxpL.js");
80
+ const { loadModule, pickNamed } = await import("./load-DiBUJx77.js");
81
81
  const mod = await loadModule(path, options);
82
82
  const display = relative(cwd, path).replaceAll("\\", "/");
83
83
  const raw = pickNamed(mod, ["default"]);
84
84
  const parsed = parseConfig(hasModuleValue(raw) ? await traceValues(cwd, path, display, raw, options) : raw, display);
85
+ const lookup = {
86
+ cwd,
87
+ from: dirname(path),
88
+ ...parsed.config.betterSupabase?.config === void 0 ? {} : { path: parsed.config.betterSupabase.config }
89
+ };
85
90
  return {
86
91
  ...parsed,
87
- config: betterSupabaseDefaults(parsed.config, await betterSupabaseConfig({
88
- cwd,
89
- from: dirname(path)
90
- })),
92
+ config: betterSupabaseDefaults(parsed.config, await betterSupabaseConfig(lookup), betterSupabaseInstalled(lookup)),
91
93
  file: path
92
94
  };
93
95
  }
@@ -95,7 +97,7 @@ function hasModuleValue(raw) {
95
97
  return isRecord(raw) && Object.keys(MODULE_KEYS).some((key) => isRecord(raw[key]));
96
98
  }
97
99
  async function traceValues(cwd, file, display, config, options) {
98
- const { traceModuleValues } = await import("./module-values-BYuNtdK5.js");
100
+ const { traceModuleValues } = await import("./module-values-BLiVlO1X.js");
99
101
  return traceModuleValues({
100
102
  cwd,
101
103
  file,
@@ -1,9 +1,9 @@
1
1
  import { a as rel, t as defaultSrcPath } from "./files-BSjrtIHw.js";
2
2
  import { r as CONFIG_REPORT_SCHEMA } from "./version-DMQ0dnN5.js";
3
3
  import { t as catalogPath } from "./catalog-path-CnI0XTFK.js";
4
- import { n as guessPermissions, t as barrelFile } from "./collect-DN_x7hvV.js";
4
+ import { n as guessPermissions, t as barrelFile } from "./collect-Cr71JA7z.js";
5
5
  import "./sources-C4vkzZJV.js";
6
- import { t as DOCS_BASE } from "./manifest-CCd-xrM3.js";
6
+ import { t as DOCS_BASE } from "./manifest-BAf7cgRx.js";
7
7
  import { n as MIGRATION_DIRS, t as DEFAULT_SENSITIVE_ACTIONS } from "./constants-DcJABbLW.js";
8
8
  //#region src/cli/config-report.ts
9
9
  function configReport(input) {
@@ -19,7 +19,13 @@ const CONFIG_SHAPE = {
19
19
  barrel: BOOLEAN_OR_STRING
20
20
  },
21
21
  catalog: { out: STRING },
22
- openapi: { doc: ARRAY },
22
+ openapi: {
23
+ doc: ARRAY,
24
+ operations: STRING,
25
+ tenantPaths: ARRAY,
26
+ base: STRING
27
+ },
28
+ betterSupabase: { config: STRING },
23
29
  rls: {
24
30
  tables: OBJECT,
25
31
  dialect: STRING,
@@ -33,6 +39,7 @@ const CONFIG_SHAPE = {
33
39
  verify: OBJECT,
34
40
  tenantClaim: STRING,
35
41
  scopeTypes: OBJECT,
42
+ idTypes: OBJECT,
36
43
  roleClaim: STRING,
37
44
  roleValues: OBJECT,
38
45
  gucPrefix: STRING,
@@ -55,6 +62,7 @@ const CONFIG_SHAPE = {
55
62
  roles: OBJECT,
56
63
  actions: OBJECT,
57
64
  helpersOnly: BOOLEAN,
65
+ memo: STRING,
58
66
  rowHelpers: BOOLEAN_OR_ARRAY,
59
67
  seeds: STRING,
60
68
  treeValues: OBJECT,
@@ -93,7 +101,6 @@ const CONFIG_SHAPE = {
93
101
  migrations: ARRAY,
94
102
  claims: STRING,
95
103
  srcPath: ARRAY,
96
- sharedTables: ARRAY,
97
104
  cacheHelpers: ARRAY,
98
105
  ignore: ARRAY,
99
106
  waivers: ARRAY
@@ -1,6 +1,6 @@
1
1
  import { t as compact } from "./compact-CAf557ZB.js";
2
- import { l as isPromiseLike } from "./store-options-CDvoX52-.js";
3
- import { n as switchTenant, t as providerStore } from "./provider-store-BTHGJH9j.js";
2
+ import { l as isPromiseLike } from "./store-options-CXv6BHH6.js";
3
+ import { n as switchTenant, t as providerStore } from "./provider-store-D4PU1my_.js";
4
4
  import { getContext, onDestroy, setContext } from "svelte";
5
5
  import { toStore } from "svelte/store";
6
6
  //#region src/svelte/context.ts
@@ -1,8 +1,8 @@
1
- import { D as Policy, N as PolicyVocabulary, yr as Principal } from "../policy-types-BI9C5Sp5.js";
2
- import { u as Permission } from "../permission-types-CAY-GU7e.js";
3
- import { a as PermDock } from "../permdock-CsrvbzHk.js";
4
- import { a as ProblemDetails, r as PermDockDeniedError } from "../errors-OTE9u4Wk.js";
5
- import { t as InstanceOptions } from "../instance-options-Cq66kEeR.js";
1
+ import { D as Policy, N as PolicyVocabulary, yr as Principal } from "../policy-types-rNfz7t0M.js";
2
+ import { w as Permission } from "../vocabulary-DeZvUaTw.js";
3
+ import { a as PermDock } from "../permdock-BaB-KQqn.js";
4
+ import { a as ProblemDetails, r as PermDockDeniedError } from "../errors-D_JIQJYb.js";
5
+ import { t as InstanceOptions } from "../instance-options-C6gEDOts.js";
6
6
  //#region src/convex/types.d.ts
7
7
  type ConvexContextLike = {
8
8
  readonly auth?: {
@@ -1,9 +1,9 @@
1
1
  import { t as compact } from "../compact-CAf557ZB.js";
2
2
  import { n as PermDockValidationError } from "../validation-error-CYg2kJEw.js";
3
3
  import { n as PermDockDeniedError, t as PermDockApprovalRequiredError } from "../errors-ynga1EQy.js";
4
- import { l as withApp } from "../permdock-DbAq8_Fp.js";
5
- import { n as resolveOrNull, t as buildInstance } from "../build-instance-CkRKgjSj.js";
4
+ import { r as withApp } from "../app-DIvM65Mv.js";
6
5
  import { n as tenantScope, t as actorFrom } from "../adapter-context-OHikyRqV.js";
6
+ import { n as resolveOrNull, t as buildInstance } from "../build-instance-B0vsViF5.js";
7
7
  //#region src/convex/create.ts
8
8
  /**
9
9
  * Convex's runtime sends `data` to the client only for an error carrying this
@@ -1,10 +1,10 @@
1
- import { A as memoryCustomRoleSource } from "./src-Cop53_X1.js";
1
+ import { D as memoryCustomRoleSource } from "./src-BG9YJM3Q.js";
2
+ import { n as fromSnapshot } from "./from-snapshot-oR_N97dM.js";
2
3
  import { c as listPermissions } from "./permission-registry-B8tYxPIt.js";
3
- import { d as scopeList } from "./scopes-BSdYaGHs.js";
4
- import { y as membershipsClaim } from "./evaluate-Dcq_U2TV.js";
5
- import { n as parseSnapshot } from "./snapshot-DHPih65J.js";
6
- import { n as fromSnapshot } from "./from-snapshot-DHnb8Fh4.js";
7
- import { t as getPermDock } from "./permdock-DbAq8_Fp.js";
4
+ import { d as scopeList } from "./scopes-gdH__vDZ.js";
5
+ import { n as parseSnapshot } from "./snapshot-C2j96x97.js";
6
+ import { t as getPermDock } from "./permdock-B5LyNVgn.js";
7
+ import { y as membershipsClaim } from "./evaluate-B5yZHmts.js";
8
8
  import "./budget-BBCPDOGP.js";
9
9
  import { c as quoteSqlTable, n as defaultSqlCommand, o as quoteSqlIdent, t as SQL_IDENT } from "./sql-0WjxIp9g.js";
10
10
  //#region src/testing/policy-matrix.ts
@@ -1,6 +1,6 @@
1
- import { D as Policy, Yn as Decision, pr as CustomRole, vr as Membership } from "./policy-types-BI9C5Sp5.js";
2
- import { u as Permission } from "./permission-types-CAY-GU7e.js";
3
- import { f as WhereResult, o as PermDockOptions } from "./permdock-CsrvbzHk.js";
1
+ import { D as Policy, Yn as Decision, pr as CustomRole, vr as Membership } from "./policy-types-rNfz7t0M.js";
2
+ import { w as Permission } from "./vocabulary-DeZvUaTw.js";
3
+ import { f as WhereResult, o as PermDockOptions } from "./permdock-BaB-KQqn.js";
4
4
  //#region src/testing/policy-matrix.d.ts
5
5
  type MatrixOutcome = "granted" | "denied" | "approval-required";
6
6
  type MatrixCell = MatrixOutcome | {
@@ -0,0 +1,114 @@
1
+ import { E as PermissionTree, w as Permission } from "./vocabulary-DeZvUaTw.js";
2
+ //#region src/openapi/operations.d.ts
3
+ /**
4
+ * One declared operation: a permission, or a permission with the operation id a
5
+ * tool name uses and the OAuth scopes that reach it, or only OAuth scopes for a
6
+ * route that checks no permission (`protect(null)`).
7
+ */
8
+ type OperationEntry = Permission | {
9
+ readonly permission: Permission;
10
+ readonly operationId?: string;
11
+ readonly oauthScopes?: readonly string[];
12
+ } | {
13
+ readonly permission?: undefined;
14
+ readonly operationId?: string;
15
+ readonly oauthScopes: readonly string[];
16
+ };
17
+ /**
18
+ * The permission of each operation of an API, declared once and read by the
19
+ * HTTP gate and by `permdock/mcp`'s `permissionFor`, so a REST route and the
20
+ * MCP tool that calls it can never disagree.
21
+ */
22
+ type OperationPermissions = {
23
+ /**
24
+ * The permission of a request: the declared operation whose method and path
25
+ * template match, a literal segment winning over a `{param}`. `undefined` for
26
+ * an undeclared operation, which a gate denies, and for an operation that
27
+ * declares only OAuth scopes. A `HEAD` request matches the `GET` entry of its
28
+ * path when no `HEAD` entry matches.
29
+ */
30
+ forRequest: (method: string, path: string) => Permission | undefined;
31
+ /**
32
+ * The permission of an operation id; pass it as `permissionFor` when tool
33
+ * names are operation ids.
34
+ */
35
+ forOperation: (id: string) => Permission | undefined;
36
+ oauthScopesForRequest: (method: string, path: string) => readonly string[] | undefined;
37
+ oauthScopesForOperation: (id: string) => readonly string[] | undefined;
38
+ /**
39
+ * Every declared operation in declaration order, with the key's method
40
+ * upper-cased and its path template as written. `testOperationCoverage` and
41
+ * `permdock doctor` (PD091) compare it with an OpenAPI document.
42
+ */
43
+ entries: () => readonly OperationDeclaration[];
44
+ };
45
+ /** One declared operation as `OperationPermissions.entries()` lists it. */
46
+ type OperationDeclaration = {
47
+ readonly method: string;
48
+ readonly path: string;
49
+ readonly permission?: Permission;
50
+ readonly operationId?: string;
51
+ readonly oauthScopes?: readonly string[];
52
+ };
53
+ /** An OpenAPI operation `operationPermissionsFromOpenApi` read. */
54
+ type OpenApiOperationRef = {
55
+ readonly method: string;
56
+ readonly path: string;
57
+ readonly operationId?: string;
58
+ };
59
+ /** Why `operationPermissionsFromOpenApi` left an operation out. */
60
+ type OperationSkipCause = "no-permission" | "several-permissions" | "unknown-permission" | "invalid-extension";
61
+ /** Every skip cause, for a table or an exhaustive switch. */
62
+ declare const OPERATION_SKIP_CAUSES: readonly OperationSkipCause[];
63
+ /**
64
+ * Operations as `"METHOD /path/{param}"` keys, the OpenAPI path template, to a
65
+ * permission. `base` is a prefix requests carry and the keys do not
66
+ * (`/api/v1`). A key that is not a method and a path throws.
67
+ */
68
+ declare function operationPermissions(operations: Readonly<Record<string, OperationEntry>>, options?: {
69
+ readonly base?: string;
70
+ }): OperationPermissions;
71
+ /**
72
+ * The operation permissions an OpenAPI document declares: every operation whose
73
+ * `x-permdock-permissions` names exactly one permission of `tree`, keyed by its
74
+ * method, path and `operationId`. An operation naming none, several or an
75
+ * unknown key is left out, so a gate denies it; `onSkip` hears each one with
76
+ * its cause.
77
+ */
78
+ declare function operationPermissionsFromOpenApi(document: unknown, tree: PermissionTree, options?: {
79
+ readonly base?: string;
80
+ readonly onSkip?: (operation: OpenApiOperationRef, cause: OperationSkipCause) => void;
81
+ }): OperationPermissions;
82
+ //#endregion
83
+ //#region src/openapi/coverage.d.ts
84
+ type OperationCoverageOptions = {
85
+ /**
86
+ * Path templates whose operations act on a tenant, such as `/orgs/{orgId}`.
87
+ * An operation under one needs an entry; others may go undeclared. A
88
+ * `{param}` matches any parameter name.
89
+ */
90
+ readonly tenantPaths: readonly string[];
91
+ /** A prefix the document's paths carry and the declared keys do not. */
92
+ readonly base?: string;
93
+ };
94
+ type OperationCoverage = {
95
+ /**
96
+ * Tenant-path operations of the document with no declared entry, as `METHOD
97
+ * /path`.
98
+ */
99
+ readonly undeclared: readonly string[];
100
+ /**
101
+ * Declared entries that match no operation of the document, as `METHOD
102
+ * /path`.
103
+ */
104
+ readonly stale: readonly string[];
105
+ };
106
+ /**
107
+ * Compares the declared operations with an OpenAPI document: a tenant-path
108
+ * operation with no entry is `undeclared` (a gate denies it), an entry that
109
+ * matches no operation is `stale`. `testOperationCoverage` and `permdock
110
+ * doctor` (PD091) run this one function.
111
+ */
112
+ declare function operationCoverage(operations: OperationPermissions, document: unknown, options: OperationCoverageOptions): OperationCoverage;
113
+ //#endregion
114
+ export { OpenApiOperationRef as a, OperationPermissions as c, operationPermissionsFromOpenApi as d, OPERATION_SKIP_CAUSES as i, OperationSkipCause as l, OperationCoverageOptions as n, OperationDeclaration as o, operationCoverage as r, OperationEntry as s, OperationCoverage as t, operationPermissions as u };