permdock 0.32.0 → 0.34.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 (378) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +2 -2
  3. package/dist/{adoption-scan-BJMEEu7V.js → adoption-scan-BPW1eWy5.js} +1 -1
  4. package/dist/agent/index.d.ts +2 -2
  5. package/dist/agent/index.js +1 -1
  6. package/dist/ai-sdk/index.d.ts +3 -3
  7. package/dist/ai-sdk/index.js +3 -3
  8. package/dist/app/index.d.ts +1 -1
  9. package/dist/app/index.js +1 -1
  10. package/dist/{approval-chain-D97rgMoA.js → approval-chain-BEeExHpb.js} +15 -10
  11. package/dist/{approval-prompt-yNyhQqn8.d.ts → approval-prompt-CJvYBdja.d.ts} +1 -1
  12. package/dist/approvals/index.d.ts +3 -3
  13. package/dist/{arazzo-C_xK2Kaa.js → arazzo-BUXKjylF.js} +1 -1
  14. package/dist/{arazzo-BAgh0PT6.js → arazzo-DqzmZG-x.js} +2 -2
  15. package/dist/astro/index.d.ts +4 -4
  16. package/dist/astro/index.js +1 -1
  17. package/dist/{audience-CARf-b-R.js → audience-B6DQ5wQu.js} +1 -1
  18. package/dist/authzen/index.d.ts +6 -6
  19. package/dist/authzen/index.js +1 -1
  20. package/dist/{automation-0VF1xe4o.d.ts → automation-BqUmdFfe.d.ts} +1 -1
  21. package/dist/better-auth/index.d.ts +1 -1
  22. package/dist/better-supabase/index.d.ts +34 -13
  23. package/dist/better-supabase/index.js +21 -21
  24. package/dist/{bind-zQacwAOg.d.ts → bind-Bwk9tt1z.d.ts} +7 -7
  25. package/dist/{bind-BYeoLJgN.js → bind-DPptdk31.js} +2 -2
  26. package/dist/{bsb-access-tags-CjeR7v7-.js → bsb-access-tags-Nv4nDQ2U.js} +11 -2
  27. package/dist/{budgets-Dpumu_Dt.js → budgets-hi-ecgEd.js} +3 -3
  28. package/dist/{build-instance-CFiegi_w.js → build-instance-DZEWYO-A.js} +1 -1
  29. package/dist/bundle-size-BRFeBvuv.js +1 -0
  30. package/dist/{bundle-size-Ddhv_H_v.js → bundle-size-DbXV65Ix.js} +2 -2
  31. package/dist/{capability-BPzseilU.d.ts → capability-qoD_jlcI.d.ts} +1 -1
  32. package/dist/{casbin-EwdKipQs.js → casbin-CM9mWO1V.js} +1 -1
  33. package/dist/{casbin-BErdqy1J.js → casbin-qEW6RfXA.js} +1 -1
  34. package/dist/catalog/index.d.ts +4 -4
  35. package/dist/catalog/index.js +4 -4
  36. package/dist/{challenge-CRB1X3Ry.js → challenge-E9sicsCA.js} +1 -1
  37. package/dist/chat/index.d.ts +1 -1
  38. package/dist/chat/index.js +1 -1
  39. package/dist/chat-sdk/index.d.ts +3 -3
  40. package/dist/{claims-size-BsSDVD5u.js → claims-size-BUhCWS88.js} +18 -3
  41. package/dist/claims-size-C6oKGuOM.js +1 -0
  42. package/dist/claude-agent/index.d.ts +3 -3
  43. package/dist/claude-agent/index.js +2 -2
  44. package/dist/clerk/index.d.ts +2 -2
  45. package/dist/cli/bin.js +1 -1
  46. package/dist/cli/generate/watch-worker.js +1 -1
  47. package/dist/cli/index.d.ts +6 -6
  48. package/dist/cli/index.js +2 -2
  49. package/dist/cli/plugins/app.d.ts +1 -1
  50. package/dist/cli/plugins/app.js +1 -1
  51. package/dist/cli/plugins/better-supabase.d.ts +1 -1
  52. package/dist/cli/plugins/openapi.d.ts +1 -1
  53. package/dist/cli/plugins/openapi.js +1 -1
  54. package/dist/cli/plugins/powersync.d.ts +1 -1
  55. package/dist/cli/plugins/powersync.js +1 -1
  56. package/dist/cli/plugins/rls.d.ts +2 -2
  57. package/dist/cli/plugins/rls.js +1 -1
  58. package/dist/cli/plugins/schemas.d.ts +1 -1
  59. package/dist/cli/plugins/schemas.js +1 -1
  60. package/dist/cli/plugins/scim.d.ts +2 -2
  61. package/dist/cli/plugins/supabase-hook.d.ts +2 -2
  62. package/dist/cli/plugins/supabase-hook.js +1 -1
  63. package/dist/cli/plugins/supabase.d.ts +3 -3
  64. package/dist/cli/plugins/supabase.js +2 -2
  65. package/dist/cli/plugins/ui.d.ts +1 -1
  66. package/dist/cli/plugins/ui.js +1 -1
  67. package/dist/{client-subject-xCSkKD1C.d.ts → client-subject-Dzo49nco.d.ts} +2 -2
  68. package/dist/cloud/index.d.ts +8 -8
  69. package/dist/cloud/index.js +1 -1
  70. package/dist/{cloud-DW3q3qnp.js → cloud-CNGblWX0.js} +2 -2
  71. package/dist/{codemod-DVDMFsTX.js → codemod-BtJFcsD7.js} +5 -5
  72. package/dist/{codemod-CF7NNDzA.js → codemod-Dlhxov9D.js} +1 -1
  73. package/dist/compile/index.d.ts +1 -1
  74. package/dist/{compile-tG1zkSgX.d.ts → compile-DNgpHgcK.d.ts} +2 -2
  75. package/dist/{compile-BXKYYmT1.js → compile-nR1gQhXo.js} +10 -9
  76. package/dist/{completion-B59uPAnZ.js → completion-BIN9YXIe.js} +1 -1
  77. package/dist/{config-VCa1RLUe.js → config-CoYhD6ur.js} +1 -1
  78. package/dist/{config-report-CjvA6lGI.js → config-report-D_L1HXDb.js} +3 -3
  79. package/dist/{context-CAFddgb9.js → context-D8tN3SZm.js} +1 -1
  80. package/dist/{context-BQHKgT1m.js → context-Nr3nknZX.js} +2 -2
  81. package/dist/convex/index.d.ts +4 -4
  82. package/dist/convex/index.js +2 -2
  83. package/dist/{core-C5yCD-Ls.js → core-DIUrkFNL.js} +5 -5
  84. package/dist/{core-bf8qgaZf.d.ts → core-DPuDmlbL.d.ts} +2 -2
  85. package/dist/{create-Cn5EpEez.d.ts → create-BKrKxipb.d.ts} +4 -4
  86. package/dist/{create-COQVXK6C.js → create-BMRnaZel.js} +3 -3
  87. package/dist/{create-nOWD3Joc.js → create-BRY0OtFV.js} +3 -3
  88. package/dist/{create-B7Xa4jSQ.d.ts → create-CdB9FCZh.d.ts} +7 -7
  89. package/dist/{create-DHA0fhmi.d.ts → create-CdbVXh5I.d.ts} +6 -6
  90. package/dist/{credentials-COT-cjnP.d.ts → credentials-Dl0-R2aB.d.ts} +2 -2
  91. package/dist/{custom-role-rebuild-BK73tPib.js → custom-role-rebuild-wzN8pqDk.js} +5 -5
  92. package/dist/{define-permdock-DBgwTFi1.d.ts → define-permdock-4IkoNaB3.d.ts} +6 -6
  93. package/dist/{define-permdock-D7aKxIax.js → define-permdock-CO7YNrOF.js} +2 -2
  94. package/dist/{definition-options-9o8Hdww3.js → definition-options-DO0kIrB9.js} +7 -1
  95. package/dist/delivery/index.d.ts +4 -4
  96. package/dist/delivery/index.js +1 -1
  97. package/dist/{denied-text-C_AWc0f0.d.ts → denied-text-CllTzVJM.d.ts} +1 -1
  98. package/dist/{describe-AdETpWsn.d.ts → describe-FT1oVN_o.d.ts} +1 -1
  99. package/dist/{diff-CW9eZy9X.js → diff-CS8ks9h3.js} +1 -1
  100. package/dist/{diff-COdwpP31.js → diff-CkSZF7LO.js} +2 -2
  101. package/dist/{doctor-ervtBRzG.js → doctor-Bn5OPJMB.js} +94 -35
  102. package/dist/{doctor-ELj5hrVv.js → doctor-C9lLeLp2.js} +2 -2
  103. package/dist/drizzle/index.d.ts +3 -3
  104. package/dist/elysia/index.d.ts +4 -4
  105. package/dist/elysia/index.js +1 -1
  106. package/dist/{errors-COoiWqIs.d.ts → errors-BGosrHl8.d.ts} +1 -1
  107. package/dist/{evaluate-Dmd0bShm.js → evaluate-DNz6wMYv.js} +1 -1
  108. package/dist/{evaluations-GW9j_ARq.d.ts → evaluations-CaXNkxTp.d.ts} +3 -3
  109. package/dist/{evaluator-eager-CpVYslzY.js → evaluator-eager-BLNVbEAC.js} +1 -1
  110. package/dist/evaluator-zpeC7zel.js +2 -0
  111. package/dist/eve/index.d.ts +4 -4
  112. package/dist/eve/index.js +2 -2
  113. package/dist/{execute-ix7AAdWg.js → execute-DsHFIBuO.js} +4 -4
  114. package/dist/{explain-DRC9V5Qb.js → explain-D4ipf8IH.js} +1 -1
  115. package/dist/{explain-jg0KLCVt.js → explain-DISCeeYS.js} +2 -2
  116. package/dist/express/index.d.ts +4 -4
  117. package/dist/express/index.js +1 -1
  118. package/dist/fastify/index.d.ts +4 -4
  119. package/dist/fastify/index.js +1 -1
  120. package/dist/{fetch-adapter-CU1DIkXu.js → fetch-adapter-BXQc4NoV.js} +1 -1
  121. package/dist/{fetch-adapter-CJncmsPg.d.ts → fetch-adapter-Dci9NnyZ.d.ts} +2 -2
  122. package/dist/{fields-y_PSRCyJ.js → fields-CwFej4gp.js} +3 -3
  123. package/dist/{from-snapshot-DGc9W4QU.js → from-snapshot-DZ4D2sLa.js} +14 -9
  124. package/dist/gen-CpS9JkCb.js +1 -0
  125. package/dist/{gen-8rW_AUG5.js → gen-Fi4GcvIY.js} +3 -3
  126. package/dist/{gen-kind-C9ikF8nb.js → gen-kind-DR2-to9P.js} +1 -1
  127. package/dist/{generate-CW7gNfLr.js → generate-BSD_eI61.js} +18 -17
  128. package/dist/{generate-BmpCt5oi.js → generate-QEHCJSyv.js} +3 -3
  129. package/dist/{generate-options-DiR4r_sk.js → generate-options-BZ2nqy28.js} +14 -13
  130. package/dist/h3/index.d.ts +4 -4
  131. package/dist/h3/index.js +2 -2
  132. package/dist/{helper-calls-DHvgN9tr.js → helper-calls-B5MOl99d.js} +1 -1
  133. package/dist/hono/index.d.ts +4 -4
  134. package/dist/hono/index.js +1 -1
  135. package/dist/{hook-sql-D-abRHut.js → hook-sql-CbkH78FC.js} +267 -223
  136. package/dist/{hosted-Bkw3Oyh-.d.ts → hosted-BISipW6F.d.ts} +1 -1
  137. package/dist/{hosted-DZwCFrcy.js → hosted-D3USbpS6.js} +1 -1
  138. package/dist/{import-D_8tLF9g.js → import-Bz6IKoMM.js} +3 -3
  139. package/dist/{import-BAhoTYTk.js → import-DppjSugv.js} +1 -1
  140. package/dist/{index-DT3hOxA7.d.ts → index-BDJ2OZvV.d.ts} +34 -11
  141. package/dist/{index-Kj5S3IWE.d.ts → index-BF4IlvkT.d.ts} +4 -4
  142. package/dist/{index-DWmIuQLz.d.ts → index-BO5f180f.d.ts} +4 -4
  143. package/dist/{index-WOx7TBbj.d.ts → index-CWwWkz10.d.ts} +2 -2
  144. package/dist/{index-xShPsK8G.d.ts → index-Co_e22iJ.d.ts} +1 -1
  145. package/dist/{index-DPVeDtAO.d.ts → index-giCl-aQY.d.ts} +4 -4
  146. package/dist/index.d.ts +16 -16
  147. package/dist/index.js +13 -13
  148. package/dist/{init-DkRHIe8-.js → init-BOYIObRF.js} +3 -3
  149. package/dist/{init-zxb0BVDJ.js → init-DJYSpo-H.js} +1 -1
  150. package/dist/inspect-functions-CwEAQpVF.js +34 -0
  151. package/dist/{instance-options-DQCiBBuz.d.ts → instance-options-hq5Cp2Ih.d.ts} +1 -1
  152. package/dist/{instance-snapshot-D9kjL37B.js → instance-snapshot-D03srwnf.js} +9 -8
  153. package/dist/{interactive-only-Dqww0ABO.js → interactive-only-Bbq9e61G.js} +10 -182
  154. package/dist/jwt/index.d.ts +4 -4
  155. package/dist/{kernel-C5akxw5n.js → kernel-DSnWVZ0O.js} +5 -5
  156. package/dist/{keys-DQsHrgBM.js → keys-U2V0maaq.js} +1 -1
  157. package/dist/kysely/index.d.ts +3 -3
  158. package/dist/{lazy-provider-CMgFAGf8.d.ts → lazy-provider-W8KwlWJU.d.ts} +1 -1
  159. package/dist/{lazy-provider-DNVjY4n3.js → lazy-provider-b8UHGi8P.js} +2 -2
  160. package/dist/{login-C1p3gmj8.js → login-Dv8TFykx.js} +1 -1
  161. package/dist/{login-DOEZveP6.js → login-xgjt0a5o.js} +3 -3
  162. package/dist/{manager-chain-DdkiCw5q.js → manager-chain-FggG63qD.js} +1 -1
  163. package/dist/{manifest-31igzVGQ.js → manifest-BUeAHWDT.js} +44 -37
  164. package/dist/{manifest-DgsxeAsM.d.ts → manifest-BwhZ1s5b.d.ts} +35 -3
  165. package/dist/{manifest-B487A3po.js → manifest-CIWOmdlP.js} +1 -1
  166. package/dist/{manifest-schema-D7RQbnGY.js → manifest-schema-N3v2RVL-.js} +24 -0
  167. package/dist/{may-use-4HzzgYJ3.js → may-use-ikNCnNgZ.js} +1 -1
  168. package/dist/mcp/index.d.ts +8 -8
  169. package/dist/mcp/index.js +2 -2
  170. package/dist/measure-DZtly0oE.js +272 -0
  171. package/dist/membership-claim-sql-DGfhIn__.js +33 -0
  172. package/dist/{membership-filter-C7ZuhAqJ.js → membership-filter-Bz9QX6E9.js} +1 -1
  173. package/dist/memberships-4e6qi8Uv.js +1 -0
  174. package/dist/memberships-CNoAlsma.js +180 -0
  175. package/dist/{migrate-pg-lkbDu.js → migrate-BXk_rUmb.js} +2 -2
  176. package/dist/{model-BXhr8gUI.js → model-D0EKt-ED.js} +3 -3
  177. package/dist/names-DBxKx2bz.js +182 -0
  178. package/dist/nest/index.d.ts +4 -4
  179. package/dist/nest/index.js +1 -1
  180. package/dist/next/index.d.ts +11 -11
  181. package/dist/next/index.js +3 -3
  182. package/dist/next/plugin.d.ts +1 -1
  183. package/dist/node/index.d.ts +4 -4
  184. package/dist/node/index.js +1 -1
  185. package/dist/openai/index.d.ts +4 -4
  186. package/dist/openai/index.js +3 -3
  187. package/dist/openapi/index.d.ts +2 -2
  188. package/dist/{openapi-DEGesHWH.js → openapi-Bfakk4cF.js} +1 -1
  189. package/dist/{openapi-document-CEQ6jqqR.js → openapi-document-ZWpur4f1.js} +1 -1
  190. package/dist/{openapi-BeMVHVY4.js → openapi-g58VVrsc.js} +2 -2
  191. package/dist/orpc/index.d.ts +5 -5
  192. package/dist/orpc/index.js +2 -2
  193. package/dist/otel/index.d.ts +3 -3
  194. package/dist/{output-C7EPeSZj.js → output-D4FLF3_v.js} +1 -1
  195. package/dist/{ownership-Csk9C3Js.js → ownership-DvmaGcup.js} +7 -6
  196. package/dist/{parse-local-manifest-B92rFWnk.d.ts → parse-local-manifest-AJWs3pkW.d.ts} +1 -1
  197. package/dist/pdp/index.d.ts +3 -3
  198. package/dist/pdp/index.js +1 -1
  199. package/dist/{permdock-CJPIwU1T.js → permdock-JM9TKevZ.js} +14 -14
  200. package/dist/{permdock-BShHM8OJ.d.ts → permdock-V86uejcm.d.ts} +2 -2
  201. package/dist/{permissions-wEkTVr_I.js → permissions-xPyAmuXi.js} +1 -1
  202. package/dist/{pipeline-Bbu7uw28.js → pipeline-DCERGTTY.js} +2 -2
  203. package/dist/{plugin-L3G7jPGE.d.ts → plugin-BnvEp5tS.d.ts} +2 -2
  204. package/dist/{policy-BBvhhH9X.js → policy-CZBJDcTx.js} +2 -1
  205. package/dist/{policy-BUtwixSN.d.ts → policy-DZORR-Fw.d.ts} +1 -1
  206. package/dist/{policy-CSOOQ3rR.js → policy-DoHkOOTQ.js} +1 -1
  207. package/dist/{policy-bundle-KYI0EnrM.js → policy-bundle-CsnNAo-n.js} +3 -3
  208. package/dist/{policy-from-catalog-_zwn1sNj.js → policy-from-catalog-BohzTN3J.js} +3 -3
  209. package/dist/{policy-types-CfW4X_yX.d.ts → policy-types-BnBZvh7N.d.ts} +50 -1
  210. package/dist/{postgrest-PQ3zAOD2.d.ts → postgrest-BG0ipED3.d.ts} +9 -2
  211. package/dist/{powersync-CM6Vg4RH.js → powersync-CTKfjnPT.js} +12 -12
  212. package/dist/{powersync-CGvu6j5U.js → powersync-Cz3MUw6R.js} +1 -1
  213. package/dist/{powersync-C1ix7CEY.js → powersync-Dbpn-n0o.js} +1 -1
  214. package/dist/prisma/index.d.ts +2 -2
  215. package/dist/{protected-action-BPN0NaRb.js → protected-action-DDYvU-9Z.js} +1 -1
  216. package/dist/{protected-action-DhCQ4bSe.d.ts → protected-action-aGL_gT4j.d.ts} +5 -5
  217. package/dist/{provider-BV_v0JAY.js → provider-BwqzED5h.js} +83 -50
  218. package/dist/{provider-1xqxLVEz.js → provider-NQwLSlgb.js} +2 -2
  219. package/dist/{provider-CMgFAGf8.d.ts → provider-W8KwlWJU.d.ts} +1 -1
  220. package/dist/{provider-store-Cf8HRNtb.js → provider-store-BizF6jyu.js} +2 -2
  221. package/dist/{provider-with-cpL9vRjC.js → provider-with-DtBgCCV_.js} +1 -1
  222. package/dist/{prune-config-CdoPJIGz.js → prune-config--x-cEF8G.js} +5 -5
  223. package/dist/{pull-BaB401Bk.js → pull-BQELP7aV.js} +2 -2
  224. package/dist/pull-C_ZiPZ5X.js +1 -0
  225. package/dist/{push-DcjvEj0m.js → push-D5so0ptb.js} +2 -2
  226. package/dist/{pushed-policy-DcvO8NXy.d.ts → pushed-policy-CQaXRDe3.d.ts} +1 -1
  227. package/dist/{pushed-policy-DSjSWEAl.js → pushed-policy-dm_hFstN.js} +1 -1
  228. package/dist/{quote-BKrTBbcH.js → quote-LNaBdCGA.js} +1 -1
  229. package/dist/{rbac-mblGDx-Z.js → rbac-BRMnQ9Rl.js} +5 -4
  230. package/dist/react/index.d.ts +6 -6
  231. package/dist/react/index.js +3 -3
  232. package/dist/react/lazy.d.ts +6 -6
  233. package/dist/react/lazy.js +3 -3
  234. package/dist/react/provider-client-lazy.d.ts +1 -1
  235. package/dist/react/provider-client-lazy.js +1 -1
  236. package/dist/react/provider-client.d.ts +1 -1
  237. package/dist/react/provider-client.js +1 -1
  238. package/dist/react-native/index.d.ts +8 -8
  239. package/dist/react-native/index.js +5 -5
  240. package/dist/read-memberships-DVBitJZG.js +164 -0
  241. package/dist/{rename-BZNOV8H9.js → rename-BjP2CFUY.js} +5 -5
  242. package/dist/replay-Dg5-l7xu.d.ts +3 -0
  243. package/dist/{report-DCAiUc5U.js → report-DF0zUNut.js} +1 -1
  244. package/dist/{report-DievqWhf.js → report-XdCm1y_J.js} +1 -1
  245. package/dist/{request-context-BNVY3kZ1.js → request-context-CqqdiVp4.js} +1 -1
  246. package/dist/resend/index.d.ts +4 -4
  247. package/dist/{resolve-config-9NYYVc30.js → resolve-config-Cu_mE2wt.js} +1 -1
  248. package/dist/{resolve-names-Cth1UQ-8.js → resolve-names-xBg9s2IJ.js} +7 -6
  249. package/dist/{resolver-CuIY8aFD.js → resolver-C_a-bddD.js} +99 -15
  250. package/dist/{rls-BtkZgaZp.js → rls-BzCz7ZV0.js} +51 -4
  251. package/dist/{rls-files-ucAI0J5j.js → rls-files-Bu0O7cZ6.js} +1 -1
  252. package/dist/{rls-options-BFGRmdcH.d.ts → rls-options-f1wRhXSG.d.ts} +1 -1
  253. package/dist/{rls-DUYok5e9.js → rls-rk-QH4fc.js} +13 -13
  254. package/dist/{rpc-D7G7IJDa.js → rpc-BQPa7tLP.js} +1 -1
  255. package/dist/{rpc-COnquydd.d.ts → rpc-DyCWVn6C.d.ts} +1 -1
  256. package/dist/run-BvtApZDp.js +1 -0
  257. package/dist/{run-WIqPbnjD.js → run-DTz-e3Od.js} +2 -2
  258. package/dist/{run-ticket-Mmor5sYW.d.ts → run-ticket-mVPqm6M6.d.ts} +2 -2
  259. package/dist/{saas-DcqUkynn.js → saas-DSeazNrN.js} +3 -3
  260. package/dist/{scan-Badcllgg.js → scan-Cn79IAJs.js} +1 -1
  261. package/dist/{schema-DBRKgQb4.js → schema-CbzVUpWv.js} +1 -1
  262. package/dist/scim/index.d.ts +1 -1
  263. package/dist/seeds/index.d.ts +1 -1
  264. package/dist/{seeds-Cih1ztkf.d.ts → seeds-DLjPbhvM.d.ts} +1 -1
  265. package/dist/server/index.d.ts +11 -11
  266. package/dist/server/index.js +1 -1
  267. package/dist/{server-types-C2XX60aF.d.ts → server-types-BlMijUtb.d.ts} +8 -8
  268. package/dist/share-key-claims-CZGAeVqa.js +28 -0
  269. package/dist/{shared-C6_T7QUo.js → shared-DnVY767H.js} +2 -1
  270. package/dist/{sink-BQ_6K81r.d.ts → sink-DhrVLPSJ.d.ts} +2 -2
  271. package/dist/{size-l1pDHE2z.js → size-CY6rK6l9.js} +3 -3
  272. package/dist/{skills-Ba9hHGO6.js → skills-BKrN1qej.js} +1 -1
  273. package/dist/{skills-CTKq3o8D.js → skills-oZ8Ng2e7.js} +1 -1
  274. package/dist/{snapshot-Ty0uk9wZ.js → snapshot-Dzi4LR6n.js} +8 -1
  275. package/dist/{snapshot-cache-DGvLQW0-.d.ts → snapshot-cache-CVYqOThu.d.ts} +1 -1
  276. package/dist/{snapshot-compact-yXFxZLPo.js → snapshot-compact-BWMLnIXK.js} +35 -4
  277. package/dist/{snapshot-evaluate-DSNj2rhV.js → snapshot-evaluate-C382Z1mQ.js} +1 -1
  278. package/dist/{snapshot-reads-BnAHiuoa.js → snapshot-reads-JxcUSUfW.js} +2 -2
  279. package/dist/{snapshot-size-DNY1MTsV.js → snapshot-size-D6ixbYvH.js} +1 -1
  280. package/dist/{snapshot-size-2fkXbCkP.js → snapshot-size-NklqBKcV.js} +1 -1
  281. package/dist/solid/index.d.ts +5 -5
  282. package/dist/solid/index.js +2 -2
  283. package/dist/solid-start/index.d.ts +4 -4
  284. package/dist/solid-start/index.js +2 -2
  285. package/dist/{sources-CjgZns7t.d.ts → sources-Bq7k7g34.d.ts} +7 -2
  286. package/dist/{sources-DnjJPGfb.js → sources-C6Id63F8.js} +2 -1
  287. package/dist/{src-HRYn4UFj.js → src-BXDohWNO.js} +154 -11
  288. package/dist/ssf/index.d.ts +3 -3
  289. package/dist/{standard-webhooks-Bnnrqa6d.d.ts → standard-webhooks-D6SPYjSQ.d.ts} +2 -2
  290. package/dist/{store-core-BdFcruPm.d.ts → store-core-Bq7Qc9QM.d.ts} +4 -4
  291. package/dist/{store-options-DpCQo0vB.js → store-options-DgOuhUSn.js} +4 -4
  292. package/dist/{stores-D6MIjN_-.d.ts → stores-Dn7TpQFa.d.ts} +5 -5
  293. package/dist/{stores-KpBCaY6c.js → stores-jgDndNHa.js} +1 -1
  294. package/dist/{subject-CrldGifz.js → subject-B7p94Y0s.js} +1 -1
  295. package/dist/{subject-cache-CnJcz2K_.d.ts → subject-cache-UKUgQCEX.d.ts} +3 -1
  296. package/dist/supabase/index.d.ts +36 -9
  297. package/dist/supabase/index.js +8 -7
  298. package/dist/supabase/middleware.d.ts +5 -5
  299. package/dist/supabase/middleware.js +4 -4
  300. package/dist/{supabase-CGiB83XQ.js → supabase-BNPS-Gr1.js} +15 -1
  301. package/dist/{supabase-kWQlkrHw.js → supabase-DrazwRER.js} +14 -7
  302. package/dist/supabase-hook-D0Yzbl19.js +2 -0
  303. package/dist/{supabase-hook-CqO_0Koh.js → supabase-hook-t1HnQf8U.js} +7 -7
  304. package/dist/{supabase-schemas-BglbAG2Z.js → supabase-schemas-_ubYYw9i.js} +2 -2
  305. package/dist/svelte/index.d.ts +5 -5
  306. package/dist/svelte/index.js +5 -3
  307. package/dist/svelte/runtime.d.ts +3 -3
  308. package/dist/svelte/runtime.js +1 -1
  309. package/dist/svelte/source.d.ts +5 -5
  310. package/dist/svelte/source.js +2 -2
  311. package/dist/sveltekit/index.d.ts +4 -4
  312. package/dist/sveltekit/index.js +1 -1
  313. package/dist/{table-reads-AnHPrBp8.js → table-reads-B7z40Yu-.js} +297 -48
  314. package/dist/{table-reads-BviGc0L_.js → table-reads-Ci-ZVo5m.js} +1 -1
  315. package/dist/{tables-CDq0HVVq.js → tables-Bxmf2beb.js} +102 -8
  316. package/dist/tanstack-start/index.d.ts +4 -4
  317. package/dist/tanstack-start/index.js +1 -1
  318. package/dist/{tenant-check-D7g9oNVH.js → tenant-check-DW0kbH-a.js} +4 -4
  319. package/dist/terminal/index.d.ts +5 -5
  320. package/dist/terminal/index.js +3 -3
  321. package/dist/testing/core.d.ts +1 -1
  322. package/dist/testing/core.js +1 -1
  323. package/dist/testing/fixtures/index.d.ts +4 -4
  324. package/dist/testing/fixtures/index.js +29 -11
  325. package/dist/testing/index.d.ts +23 -23
  326. package/dist/testing/index.js +13 -13
  327. package/dist/testing/saas/index.d.ts +3 -3
  328. package/dist/testing/saas/index.js +2 -2
  329. package/dist/testing/saas/permissions.js +1 -1
  330. package/dist/trpc/index.d.ts +5 -5
  331. package/dist/trpc/index.js +2 -2
  332. package/dist/{type-helpers-CUmJFGV6.d.ts → type-helpers-CVN-p62O.d.ts} +1 -1
  333. package/dist/{types-vKKndyxx.d.ts → types-5cvjmHTG.d.ts} +1 -1
  334. package/dist/{types-DwoRXDvN.d.ts → types-BMKDvcXc.d.ts} +2 -2
  335. package/dist/{types-CIzXPPV-.d.ts → types-B_I8TBA9.d.ts} +2 -2
  336. package/dist/{types-h9W3CNC_.d.ts → types-BmTW35E5.d.ts} +4 -4
  337. package/dist/{types-BhBfMdQ5.d.ts → types-CDkJNA3a.d.ts} +3 -3
  338. package/dist/{types-euUv1wsO.d.ts → types-CgaGxF5q.d.ts} +1 -1
  339. package/dist/{types-BsRf5rKk.d.ts → types-CrUguLsE.d.ts} +2 -2
  340. package/dist/{types-BRECeQ2n.d.ts → types-DNOJRhyn.d.ts} +3 -3
  341. package/dist/{types-BKnUwgvx.d.ts → types-Dl2jRkyq.d.ts} +4 -4
  342. package/dist/{types-config-DNIw_Gt5.d.ts → types-config-CyawIkMF.d.ts} +2 -2
  343. package/dist/{types-CjZscT16.d.ts → types-gp1w86cV.d.ts} +4 -4
  344. package/dist/{types-run-Bwn1MuW0.d.ts → types-run-ByHuYUen.d.ts} +1 -1
  345. package/dist/unplugin/index.d.ts +1 -1
  346. package/dist/{usage-CW6xhRcV.js → usage-B8ca_Nj_.js} +2 -2
  347. package/dist/usage-CKTsomEq.js +1 -0
  348. package/dist/{usage-n4V2k_a6.js → usage-Do7LQ4i4.js} +1 -1
  349. package/dist/{validation-error-P4Z9HUuP.d.ts → validation-error-BKgVVMc1.d.ts} +1 -1
  350. package/dist/{verify-CKzngsUH.js → verify-ZojGAC3f.js} +12 -12
  351. package/dist/{version-cache-BzK8dwJy.js → version-cache-Ccrfu2A4.js} +6 -1
  352. package/dist/vue/index.d.ts +5 -5
  353. package/dist/vue/index.js +2 -2
  354. package/dist/{waiter-BqUxSRxq.d.ts → waiter-Bov7Cig6.d.ts} +2 -2
  355. package/dist/{warm-BR-mrnY-.d.ts → warm-BKD3FN6k.d.ts} +1 -1
  356. package/dist/{warm-5yxlUmBh.js → warm-BZ0ZwSmO.js} +1 -1
  357. package/dist/{watch-C12Ub7x4.js → watch-EzX_aG73.js} +1 -1
  358. package/dist/webmcp/index.d.ts +1 -1
  359. package/dist/webmcp/index.js +1 -1
  360. package/dist/{who-can-CGVpM3fZ.js → who-can-CIgYpEvy.js} +1 -1
  361. package/dist/workflow/index.d.ts +3 -3
  362. package/dist/workflow/index.js +1 -1
  363. package/dist/workflow-sdk/index.d.ts +4 -4
  364. package/dist/{wrap-D8WtzrB7.d.ts → wrap-CaAA3ubO.d.ts} +2 -2
  365. package/package.json +11 -11
  366. package/schemas/snapshot-v2.json +20 -0
  367. package/schemas/supabase-claims-v1.json +48 -2
  368. package/schemas/supabase-manifest-v1.json +28 -0
  369. package/dist/bundle-size-DwZ4e1gu.js +0 -1
  370. package/dist/claims-size-B6j0Ff4Q.js +0 -1
  371. package/dist/evaluator-COmATWCr.js +0 -2
  372. package/dist/gen-BtiGMiuH.js +0 -1
  373. package/dist/pull-Bp63vtgu.js +0 -1
  374. package/dist/read-memberships-BkePIa1F.js +0 -63
  375. package/dist/replay-BCOZifwx.d.ts +0 -3
  376. package/dist/run-BjMxYYTe.js +0 -1
  377. package/dist/supabase-hook-CluYxKee.js +0 -2
  378. package/dist/usage-Ci7Glu-H.js +0 -1
@@ -5,15 +5,17 @@ import { c as rootScope, d as scopeList } from "./scopes-B-KX9EI8.js";
5
5
  import { t as canonicalJson } from "./canonical-json-BibZkXtE.js";
6
6
  import { r as relationCondition, t as inheritCondition } from "./grantee-conditions-Dob6QQAc.js";
7
7
  import { l as partitionsOf, p as scopeField } from "./tenancy-B5Xxt9Sc.js";
8
- import { a as delegatedScopeMap } from "./permdock-CJPIwU1T.js";
8
+ import { a as delegatedScopeMap } from "./permdock-JM9TKevZ.js";
9
9
  import { i as configError } from "./errors-DgLOqc6j.js";
10
10
  import { d as sqlTextArray, i as qualifySqlTable, t as SQL_IDENT } from "./sql-T4GaBh9X.js";
11
11
  import { d as restrictedRowsSql, i as scopeColumn, l as relationArmSql } from "./compile-BUKXrueE.js";
12
- import { t as AUTHZ_VERSION_TABLE } from "./sources-DnjJPGfb.js";
13
- import { a as quoteIdent, c as quoteTable, i as qualified, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-BKrTBbcH.js";
14
- import { C as tenantTypeOf, a as kindFilterSql, b as idTypeOf, c as roleKindSql, d as subjectClaimSql, f as subjectIdSql, i as keyTenantSql, m as userIdHelperSql, s as memberVia, u as subjectClaimJsonSql, x as scopeTypeOf } from "./subject-CrldGifz.js";
15
- import { i as allowEntry, n as GLOBAL_ROLES, o as rootName, r as HELPERS, s as signedIn, t as CUSTOM_ROLES } from "./shared-C6_T7QUo.js";
16
- import { $ as linkHelper, B as rolesTableScope, C as sourceRows, E as sqlBody, F as customRolesSql, G as graphHelper, H as trustedReaderGrants, I as hasCustomRoleChecksFor, J as hasMemberFor, K as graphSqlName, L as perScope, M as userActive, N as globalRoleSource, O as instancesActive, P as currentKeyExpr, Q as isTeamScope, R as raiseSql, S as sourceIdOf, T as sourcesKeep, V as storedTenant, W as CLOSURE, Y as hasMemberOf, _ as memoWriteSql, at as memberRoleOf, b as scopedBody, c as memoUserSql, ct as restrictedHelper, d as disabledColumn, dt as activeInstancesSql, et as memberForHelper, f as functionBody, ft as activeMembershipSql, g as memoHitList, gt as grantPermissionSql, h as memberColumn, i as interactiveAllowsSql, it as memberOfHelper, k as keyTenantLine, l as claimKeptLines, lt as scopeSources, mt as activeUserSql, n as delegatedGlobalSql, o as interactiveSessionSql, ot as permittedForHelper, p as hasBody, pt as activeRowSql, q as graphSqlText, r as interactiveAllowsCall, rt as memberIdsHelper, s as memoGlobalUserSql, st as permittedIdsHelper, tt as memberForSources, u as claimTenant, ut as scopeTable, v as memoizedSetofSql, w as sourcesBodyOf, x as sourceFilters, y as memoizes, z as roleReadersSql } from "./interactive-only-Dqww0ABO.js";
12
+ import { t as AUTHZ_VERSION_TABLE } from "./sources-C6Id63F8.js";
13
+ import { t as compactMembershipsSql } from "./membership-claim-sql-DGfhIn__.js";
14
+ import { a as quoteIdent, c as quoteTable, i as qualified, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-LNaBdCGA.js";
15
+ import { C as tenantTypeOf, a as kindFilterSql, b as idTypeOf, c as roleKindSql, d as subjectClaimSql, f as subjectIdSql, i as keyTenantSql, m as userIdHelperSql, s as memberVia, u as subjectClaimJsonSql, x as scopeTypeOf } from "./subject-B7p94Y0s.js";
16
+ import { i as allowEntry, n as GLOBAL_ROLES, o as rootName, r as HELPERS, s as signedIn, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
17
+ import { B as rolesTableScope, C as sourceRows, E as sqlBody, F as customRolesSql, G as activeRowSql, H as trustedReaderGrants, I as hasCustomRoleChecksFor, J as grantPermissionSql, K as activeUserSql, L as perScope, M as userActive, N as globalRoleSource, O as instancesActive, P as currentKeyExpr, R as raiseSql, S as sourceIdOf, T as sourcesKeep, U as activeInstancesSql, V as storedTenant, W as activeMembershipSql, _ as memoWriteSql, b as scopedBody, c as memoUserSql, d as disabledColumn, f as functionBody, g as memoHitList, h as memberColumn, i as interactiveAllowsSql, k as keyTenantLine, l as claimKeptLines, n as delegatedGlobalSql, o as interactiveSessionSql, p as hasBody, r as interactiveAllowsCall, s as memoGlobalUserSql, u as claimTenant, v as memoizedSetofSql, w as sourcesBodyOf, x as sourceFilters, y as memoizes, z as roleReadersSql } from "./interactive-only-Bbq9e61G.js";
18
+ import { S as scopeTable, _ as memberRoleOf, a as graphSqlText, b as restrictedHelper, d as linkHelper, f as memberForHelper, g as memberOfHelper, h as memberIdsHelper, i as graphSqlName, n as CLOSURE, o as hasMemberFor, p as memberForSources, r as graphHelper, s as hasMemberOf, u as isTeamScope, v as permittedForHelper, x as scopeSources, y as permittedIdsHelper } from "./names-DBxKx2bz.js";
17
19
  import { n as byKey, t as byCodeUnit } from "./compare-8SNJN-9U.js";
18
20
  import { createHash } from "node:crypto";
19
21
  // src/cli/rls/graph.ts
@@ -1273,6 +1275,54 @@ drop trigger if exists "permdock_custom_role_name_guard" on ${target};
1273
1275
  create trigger "permdock_custom_role_name_guard"
1274
1276
  before insert or update on ${target}
1275
1277
  for each row execute function ${fn}();
1278
+ ${systemGuardSql(ctx, target, key)}`;
1279
+ }
1280
+ /** Postgres roles a client request runs as; any other role is trusted SQL. */
1281
+ const CLIENT_ROLES = [
1282
+ "anon",
1283
+ "anonymous",
1284
+ "authenticated"
1285
+ ];
1286
+ /**
1287
+ * The name guard lets a row the `skip` column marks through, so only trusted
1288
+ * SQL may mark one: a security invoker trigger refuses a client role that sets
1289
+ * the column, or renames or moves a row that has it. A row created by trusted
1290
+ * SQL, such as an organization's seeded system roles, keeps it.
1291
+ */
1292
+ function systemGuardSql(ctx, target, key) {
1293
+ const table = ctx.customRoles?.table;
1294
+ if (table?.skip === void 0 || table.tenant === void 0) return "";
1295
+ const fn = qualified(ctx, CUSTOM_ROLES.systemGuard);
1296
+ const skip = quoteIdent(table.skip);
1297
+ const tenant = quoteIdent(table.tenant);
1298
+ return `
1299
+ -- the application's roles table: only trusted SQL marks a role as a system role, or renames or moves one
1300
+ create or replace function ${fn}()
1301
+ returns trigger
1302
+ language plpgsql
1303
+ volatile
1304
+ security invoker
1305
+ set search_path = ''
1306
+ as $$
1307
+ begin
1308
+ if not ${`current_user::text = any(array[${CLIENT_ROLES.map(quoteLiteral).join(", ")}])`} then
1309
+ return new;
1310
+ end if;
1311
+ if (tg_op = 'INSERT' and coalesce(new.${skip}, false))
1312
+ or (tg_op = 'UPDATE' and (
1313
+ coalesce(new.${skip}, false) is distinct from coalesce(old.${skip}, false)
1314
+ or (coalesce(old.${skip}, false) and (${key} is distinct from old.${quoteIdent(table.key)}::text or new.${tenant} is distinct from old.${tenant}))
1315
+ )) then
1316
+ ${raiseSql(" ", "42501", "'permdock: only trusted SQL writes a system role'", "system-role")}
1317
+ end if;
1318
+ return new;
1319
+ end;
1320
+ $$;
1321
+ revoke execute on function ${fn}() from public, anon, authenticated;
1322
+ drop trigger if exists "permdock_custom_role_system_guard" on ${target};
1323
+ create trigger "permdock_custom_role_system_guard"
1324
+ before insert or update on ${target}
1325
+ for each row execute function ${fn}();
1276
1326
  `;
1277
1327
  }
1278
1328
  // src/cli/rls/custom-role-writes.ts
@@ -1721,7 +1771,7 @@ function memberBody(ctx, scope, type, roles) {
1721
1771
  if (ctx.authorize !== "database") return sqlBody(` select distinct (m ->> 'id')::${type}
1722
1772
  from (select ${membershipClaim(ctx)} as v) pdk_c
1723
1773
  cross join lateral jsonb_array_elements(
1724
- case jsonb_typeof(pdk_c.v) when 'array' then pdk_c.v else '[]'::jsonb end
1774
+ case jsonb_typeof(pdk_c.v) when 'array' then pdk_c.v when 'object' then ${compactMembershipsSql("pdk_c.v")} else '[]'::jsonb end
1725
1775
  ) m
1726
1776
  where ${signedIn(ctx)}
1727
1777
  and m ->> 'scope' = ${quoteLiteral(scope)}
@@ -2054,6 +2104,21 @@ function scopeHasHelper(scope) {
2054
2104
  return permittedIdsHelper(scope).replace(/^permitted_/u, "permdock_").replace(/_ids$/u, "_has");
2055
2105
  }
2056
2106
  /**
2107
+ * `permdock_<root>_has_active(p_grant)`: the same test as
2108
+ * `permdock_<root>_has`, with the tenant read from the token. The answer
2109
+ * depends only on the caller's grants of that key in the active tenant.
2110
+ */
2111
+ function scopeHasActiveHelper(scope) {
2112
+ return `${scopeHasHelper(scope)}_active`;
2113
+ }
2114
+ /**
2115
+ * The active tenant, or null when the claim is absent. An empty string is not
2116
+ * cast: `''::uuid` throws, and no tenant must answer false.
2117
+ */
2118
+ function activeTenantSql(ctx, type) {
2119
+ return `nullif(${subjectClaimSql(ctx, ctx.tenantClaim)}, '')::${type}`;
2120
+ }
2121
+ /**
2057
2122
  * `permitted_<scope>_id_array(p_grant)` for one scope: a policy writes
2058
2123
  * `<column> = any(<array>)`, which an index on the column serves. The root
2059
2124
  * scope also gets `permdock_<scope>_has(p_grant, p_tenant)`, one membership
@@ -2090,6 +2155,19 @@ as $$
2090
2155
  select p_tenant = any(${array}(p_grant))
2091
2156
  $$;
2092
2157
  ${grants(fn, `text, ${type}`)}`);
2158
+ const active = qualified(ctx, scopeHasActiveHelper(scope));
2159
+ chunks.push(`-- the same test for the tenant the token names; a shared function calls it with a literal key
2160
+ create or replace function ${active}(p_grant text)
2161
+ returns boolean
2162
+ language sql
2163
+ stable
2164
+ security invoker
2165
+ cost 1000${parallel}
2166
+ set search_path = ''
2167
+ as $$
2168
+ select ${fn}(p_grant, ${activeTenantSql(ctx, type)})
2169
+ $$;
2170
+ ${grants(active, "text")}`);
2093
2171
  }
2094
2172
  return chunks.join("\n");
2095
2173
  }
@@ -2254,7 +2332,7 @@ begin
2254
2332
  return coalesce((
2255
2333
  select to_jsonb(v.version) = (c.j -> 'authz_ver')
2256
2334
  and coalesce(c.j -> 'memberships_truncated', 'false'::jsonb) <> 'true'::jsonb
2257
- and jsonb_typeof(c.j -> 'memberships') = 'array'
2335
+ and jsonb_typeof(c.j -> 'memberships') in ('array', 'object')
2258
2336
  from ${version} v
2259
2337
  cross join (select auth.jwt() as j) c
2260
2338
  where v.user_id = ${subjectIdSql(ctx)}
@@ -3244,6 +3322,22 @@ ${grantsSql(fn, "text", anonExecute)}`);
3244
3322
  chunks.push(`-- the permission keys the caller holds on one ${scope.name}: what permdock_has_permission or permitted_${scope.name}_ids_by_permission answers for each key, in one call
3245
3323
  ${keysFunction(keysFn, `p_id ${type}`, keysBody(scope.name, caller, false), grantsSql(keysFn, type, anonExecute), parallel)}
3246
3324
  ${keysFunction(keysFn, `p_id ${type}, p_keys text[]`, keysBody(scope.name, caller, true), grantsSql(keysFn, `${type}, text[]`, anonExecute), parallel)}`);
3325
+ if (rootScope(ctx.scopes) === scope.name) {
3326
+ const activeName = checkName(`${permissionKeysHelper(scope.name)}_active`);
3327
+ const active = qualified(ctx, activeName);
3328
+ chunks.push(`-- which of p_keys the caller holds on the tenant the token names
3329
+ create or replace function ${active}(p_keys text[])
3330
+ returns setof text
3331
+ language sql
3332
+ stable
3333
+ security invoker
3334
+ cost 1000${parallel ? "\nparallel safe" : ""}
3335
+ set search_path = ''
3336
+ as $$
3337
+ select ${keysFn}(${activeTenantSql(ctx, type)}, p_keys)
3338
+ $$;
3339
+ ${grantsSql(active, "text[]", anonExecute)}`);
3340
+ }
3247
3341
  chunks.push(`-- with p_conditioned true, also the instances a conditioned allow reaches, minus only unconditional denies: the caller applies the row condition
3248
3342
  ${byPermission(fn, "p_permission text, p_conditioned boolean", scope.name, "", true)}
3249
3343
  ${grantsSql(fn, "text, boolean", anonExecute)}`);
@@ -1,9 +1,9 @@
1
- import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-C2XX60aF.js";
1
+ import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-BlMijUtb.js";
2
2
  import { a as OperationInput, t as Operation } from "../operations-DaEoGpMV.js";
3
- import { a as PermDock } from "../permdock-BShHM8OJ.js";
3
+ import { a as PermDock } from "../permdock-V86uejcm.js";
4
4
  import { w as Permission } from "../vocabulary-DHfKPIC5.js";
5
- import { D as Policy, Er as Principal, N as PolicyVocabulary, nn as Snapshot } from "../policy-types-CfW4X_yX.js";
6
- import { a as ProtectTarget, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-CJncmsPg.js";
5
+ import { D as Policy, N as PolicyVocabulary, Or as Principal, rn as Snapshot } from "../policy-types-BnBZvh7N.js";
6
+ import { a as ProtectTarget, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-Dci9NnyZ.js";
7
7
  import { RequestMiddleware, RequestMiddlewareAfterServer, createMiddleware } from "@tanstack/react-start";
8
8
  type TanStackStartPermDockOptions<TUser = unknown> = FetchAdapterOptions<Request, TUser>;
9
9
  /**
@@ -1,5 +1,5 @@
1
1
  import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-DPEAu_jM.js";
2
- import { t as fetchAdapter } from "../fetch-adapter-CU1DIkXu.js";
2
+ import { t as fetchAdapter } from "../fetch-adapter-BXQc4NoV.js";
3
3
  import { createMiddleware } from "@tanstack/react-start";
4
4
  // src/tanstack-start/create.ts
5
5
  function createPermDock(policy, options) {
@@ -1,8 +1,8 @@
1
1
  import { r as isRecord } from "./compact-C4LFuqbW.js";
2
2
  import { n as CliError } from "./errors-DgLOqc6j.js";
3
- import { i as tableNames } from "./tables-CDq0HVVq.js";
4
- import { r as compileGrants } from "./compile-BXKYYmT1.js";
5
- import { i as buildContext, n as isRefusal, t as generateOptions } from "./generate-options-DiR4r_sk.js";
3
+ import { i as tableNames } from "./tables-Bxmf2beb.js";
4
+ import { r as compileGrants } from "./compile-nR1gQhXo.js";
5
+ import { i as buildContext, n as isRefusal, t as generateOptions } from "./generate-options-BZ2nqy28.js";
6
6
  // src/cli/rls/key-reasons.ts
7
7
  /** A grant key written as a condition group (`k#1`) or a level (`k@own`). */
8
8
  function isConditionKey(permission, grantKey) {
@@ -62,7 +62,7 @@ function keyReasons(config, policy, cwd) {
62
62
  }
63
63
  /** The sentence for `key`, which `reasons` may not know. */
64
64
  function keyReason(reasons, key) {
65
- return reasons.reasons.get(key) ?? (reasons.swappable.has(key) ? "every grant of it is unconditional; permdock codemod bsb-access-tags moves the policy unless another policy or tenant column on the table prevents it" : "the policy declares no grant of it");
65
+ return reasons.reasons.get(key) ?? (reasons.swappable.has(key) ? "every grant of it is unconditional" : "the policy declares no grant of it");
66
66
  }
67
67
  /** `keyReasons`, or `undefined` for a policy or config the generator refuses. */
68
68
  function tryKeyReasons(config, policy, cwd) {
@@ -1,8 +1,8 @@
1
- import { D as Policy, Er as Principal, N as PolicyVocabulary, Or as Subject, nr as Decision, qt as Instant } from "../policy-types-CfW4X_yX.js";
2
- import { m as ApprovalStore } from "../types-vKKndyxx.js";
3
- import { a as ProblemDetails, t as ApprovalHint } from "../errors-COoiWqIs.js";
4
- import { t as InstanceOptions } from "../instance-options-DQCiBBuz.js";
5
- import { a as PermDock } from "../permdock-BShHM8OJ.js";
1
+ import { Ar as Subject, D as Policy, N as PolicyVocabulary, Or as Principal, ir as Decision, qt as Instant } from "../policy-types-BnBZvh7N.js";
2
+ import { m as ApprovalStore } from "../types-5cvjmHTG.js";
3
+ import { a as ProblemDetails, t as ApprovalHint } from "../errors-BGosrHl8.js";
4
+ import { t as InstanceOptions } from "../instance-options-hq5Cp2Ih.js";
5
+ import { a as PermDock } from "../permdock-V86uejcm.js";
6
6
  import { w as Permission } from "../vocabulary-DHfKPIC5.js";
7
7
  type TokenSourceName = "device" | "keychain" | "env" | "ci-oidc";
8
8
  type TokenSource = TokenSourceName | {
@@ -1,11 +1,11 @@
1
1
  import { l as storedApprovalToken, s as resumeDecision } from "../helpers-COh0lLc1.js";
2
- import { u as withApp } from "../permdock-CJPIwU1T.js";
3
- import { n as resolveOrNull, t as buildInstance } from "../build-instance-CFiegi_w.js";
2
+ import { u as withApp } from "../permdock-JM9TKevZ.js";
3
+ import { n as resolveOrNull, t as buildInstance } from "../build-instance-DZEWYO-A.js";
4
4
  import { t as compact } from "../compact-C4LFuqbW.js";
5
5
  import { n as resourceRef } from "../resource-ref-BiQtFK-I.js";
6
6
  import { r as isSubject } from "../subject-DkxY-AhF.js";
7
7
  import { a as refreshCredential, o as revokeCredential, s as runDeviceFlow, t as TERMINAL_TIMEOUT_MS } from "../device-f3JEnqa0.js";
8
- import { i as expandSnapshot } from "../snapshot-compact-yXFxZLPo.js";
8
+ import { i as expandSnapshot } from "../snapshot-compact-BWMLnIXK.js";
9
9
  import { a as deniedMessage, i as approvalMessage, n as PermDockDeniedError, t as PermDockApprovalRequiredError } from "../errors-DOSkVeTC.js";
10
10
  import { i as writeCredentials, n as deleteCredentials, r as readCredentials } from "../storage-BhGDhsXm.js";
11
11
  import { h as secondsAt } from "../time-r0CKBm57.js";
@@ -1,2 +1,2 @@
1
- import { S as policyMatrix, _ as DescribePolicyConfig, a as OrmParityScenario, b as PolicyMatrixCell, c as RlsFieldsOutcome, d as RlsParityOptions, f as RlsParityReport, g as testRlsParity, h as RlsQueryResult, i as OrmParityRunInput, l as RlsParityCase, m as RlsQueryFn, n as OrmParityOptions, o as testOrmParity, p as RlsParitySubject, r as OrmParityReport, s as RlsDbOutcome, t as OrmParityCase, u as RlsParityFixture, v as MatrixCell, x as PolicyMatrixReport, y as MatrixOutcome } from "../core-bf8qgaZf.js";
1
+ import { S as policyMatrix, _ as DescribePolicyConfig, a as OrmParityScenario, b as PolicyMatrixCell, c as RlsFieldsOutcome, d as RlsParityOptions, f as RlsParityReport, g as testRlsParity, h as RlsQueryResult, i as OrmParityRunInput, l as RlsParityCase, m as RlsQueryFn, n as OrmParityOptions, o as testOrmParity, p as RlsParitySubject, r as OrmParityReport, s as RlsDbOutcome, t as OrmParityCase, u as RlsParityFixture, v as MatrixCell, x as PolicyMatrixReport, y as MatrixOutcome } from "../core-DPuDmlbL.js";
2
2
  export { type DescribePolicyConfig, type MatrixCell, type MatrixOutcome, type OrmParityCase, type OrmParityOptions, type OrmParityReport, type OrmParityRunInput, type OrmParityScenario, type PolicyMatrixCell, type PolicyMatrixReport, type RlsDbOutcome, type RlsFieldsOutcome, type RlsParityCase, type RlsParityFixture, type RlsParityOptions, type RlsParityReport, type RlsParitySubject, type RlsQueryFn, type RlsQueryResult, policyMatrix, testOrmParity, testRlsParity };
@@ -1 +1 @@
1
- export { r as policyMatrix, t as testOrmParity, n as testRlsParity } from "../core-C5yCD-Ls.js";
1
+ export { r as policyMatrix, t as testOrmParity, n as testRlsParity } from "../core-DIUrkFNL.js";
@@ -1,8 +1,8 @@
1
1
  import { a as CatalogDocument } from "../../types-CbJ5mxXv.js";
2
- import { i as SupabaseManifest } from "../../manifest-DgsxeAsM.js";
3
- import { rt as MemberEntry } from "../../policy-types-CfW4X_yX.js";
4
- import { r as SubjectRecord } from "../../subject-cache-CnJcz2K_.js";
5
- import { i as SupabaseRpcClient } from "../../postgrest-PQ3zAOD2.js";
2
+ import { i as SupabaseManifest } from "../../manifest-BwhZ1s5b.js";
3
+ import { rt as MemberEntry } from "../../policy-types-BnBZvh7N.js";
4
+ import { r as SubjectRecord } from "../../subject-cache-UKUgQCEX.js";
5
+ import { i as SupabaseRpcClient } from "../../postgrest-BG0ipED3.js";
6
6
  type PostgrestFixtureOptions = {
7
7
  /** The users `subject_for` knows, by id. An unknown user answers `null`. */
8
8
  readonly subjects: Readonly<Record<string, SubjectRecord>>;
@@ -1,5 +1,5 @@
1
1
  import { t as parseCatalog } from "../../parse-CUqZ_lLC.js";
2
- import { n as parseSupabaseManifest } from "../../manifest-B487A3po.js";
2
+ import { n as parseSupabaseManifest } from "../../manifest-CIWOmdlP.js";
3
3
  // src/testing/fixtures/better-supabase.catalog.json
4
4
  var better_supabase_catalog_default = {
5
5
  $schema: "https://permdock.com/schemas/catalog-v2.json",
@@ -786,65 +786,83 @@ var better_supabase_manifest_default = {
786
786
  {
787
787
  "table": "public.contacts",
788
788
  "share": "row",
789
- "rules": ["unknown"]
789
+ "rules": ["unknown"],
790
+ "reason": "row level security is on and no permissive select policy applies to authenticated or public, so the table is not read through PostgREST by a signed-in role; inspect does not read grants, so a table grant is not checked"
790
791
  },
791
792
  {
792
793
  "table": "public.customers",
793
794
  "share": "row",
794
- "rules": ["unknown"]
795
+ "rules": ["unknown"],
796
+ "reason": "row level security is on and no permissive select policy applies to authenticated or public, so the table is not read through PostgREST by a signed-in role; inspect does not read grants, so a table grant is not checked"
795
797
  },
796
798
  {
797
799
  "table": "public.datetime_preferences",
798
800
  "share": "row",
799
- "rules": ["owner"]
801
+ "rules": ["owner"],
802
+ "reason": "policy datetime_preferences_own_read in supabase/schemas/public/tables/datetime_preferences.sql is an owner rule: it calls auth.uid() and reads column user_id, so a row is read by the user it names, not by a tenant grant"
800
803
  },
801
804
  {
802
805
  "table": "public.organization_features",
803
806
  "share": "row",
804
- "rules": ["unknown"]
807
+ "rules": ["unknown"],
808
+ "reason": "row level security is on and no permissive select policy applies to authenticated or public (policies: organization_features_auth_admin_read), so the table is not read through PostgREST by a signed-in role; inspect does not read grants, so a table grant is not checked"
805
809
  },
806
810
  {
807
811
  "table": "public.organization_memberships",
808
812
  "share": "row",
809
- "rules": ["owner", "restrictive"]
813
+ "rules": ["owner", "restrictive"],
814
+ "reason": "policy organization_memberships_read in supabase/schemas/public/tables/organization_memberships.sql is an owner rule: it calls auth.uid(), better_supabase.member_organization_ids() and reads column user_id, organization_id, so a row is read by the user it names, not by a tenant grant; restrictive policy bsb_tenant_scope_select in supabase/schemas/900_better_supabase_004_memberships.sql reads column organization_id, user_id, so the rows it hides differ per row, not per tenant"
810
815
  },
811
816
  {
812
817
  "table": "public.organizations",
813
818
  "share": "row",
814
- "rules": ["condition"]
819
+ "rules": ["condition"],
820
+ "reason": "policy organizations_public_read in supabase/schemas/public/tables/organizations.sql is a row condition: it calls none and reads no column, which no tenant check of permdock.permitted_organization_ids_by_permission covers"
815
821
  },
816
822
  {
817
823
  "table": "public.quotes",
818
824
  "share": "row",
819
- "rules": ["condition"]
825
+ "rules": ["condition"],
826
+ "reason": "policy quotes_select in supabase/schemas/public/policies/permdock.sql is a row condition: it calls permdock.permitted_organization_ids(), permdock.permitted_customer_ids() and reads column organization_id, customer_id, which no tenant check of permdock.permitted_organization_ids_by_permission covers"
820
827
  },
821
828
  {
822
829
  "table": "public.role_permissions",
823
830
  "share": "row",
824
831
  "permissions": ["roles.manage"],
825
- "rules": ["condition"]
832
+ "rules": ["condition"],
833
+ "reason": "policy role_permissions_manage in supabase/schemas/public/tables/role_permissions.sql is a row condition: it calls permdock.permitted_organization_ids_by_permission() and reads column r.id, role_id, r.organization_id, which no tenant check of permdock.permitted_organization_ids_by_permission covers"
826
834
  },
827
835
  {
828
836
  "table": "public.roles",
829
837
  "share": "row",
830
- "rules": ["condition"]
838
+ "rules": ["condition"],
839
+ "reason": "policy roles_read_members in supabase/schemas/public/tables/roles.sql is a row condition: it calls permdock.member_organization_ids() and reads column organization_id, which no tenant check of permdock.permitted_organization_ids_by_permission covers"
831
840
  },
832
841
  {
833
842
  "table": "public.staff",
834
843
  "share": "row",
835
844
  "rules": ["form"],
836
- "reason": "key staff.list: every grant of it is unconditional; permdock codemod bsb-access-tags moves the policy unless another policy or tenant column on the table prevents it; key staff.read: every grant of it is unconditional; permdock codemod bsb-access-tags moves the policy unless another policy or tenant column on the table prevents it"
845
+ "reason": "policy staff_select in supabase/schemas/public/policies/permdock.sql uses permdock.permitted_organization_ids inside a larger expression, not as \"<column> in (select permdock.permitted_organization_ids('<key>'))\"; key staff.list: every grant of it is unconditional; key staff.read: every grant of it is unconditional"
837
846
  }
838
847
  ],
839
848
  "sharedFunctions": [],
840
849
  "tenantPureHelpers": [{
841
850
  "name": "permdock.permdock_organization_has",
842
851
  "keyArgument": "p_grant",
852
+ "keyPosition": 0,
843
853
  "tenantArgument": "p_tenant"
844
854
  }, {
845
855
  "name": "permdock.permitted_organization_permission_keys",
846
856
  "keyArgument": "p_keys",
857
+ "keyPosition": 1,
847
858
  "tenantArgument": "p_id"
859
+ }],
860
+ "permissionFilters": [{
861
+ "name": "permdock.permdock_organization_has_active",
862
+ "keyPosition": 0
863
+ }, {
864
+ "name": "permdock.permitted_organization_permission_keys_active",
865
+ "keyPosition": 0
848
866
  }]
849
867
  },
850
868
  decidingColumns: [
@@ -1,32 +1,32 @@
1
- import { Ct as WhereCompiler, D as Policy, Er as Principal, G as CredentialVerifier, Or as Subject, Tr as Membership, X as DecisionSink, Y as DecisionProvider, Z as EntitlementSource, _t as TokenSigner, ct as RelationSource, it as MembershipSource, lt as SettingsSource, mt as SubjectResolver, nn as Snapshot, nt as LimitStore, q as CustomRoleSource, ut as SnapshotSource, vn as DeliveryChannel, vt as TokenVerifier } from "../policy-types-CfW4X_yX.js";
2
- import { S as policyMatrix, _ as DescribePolicyConfig, a as OrmParityScenario, b as PolicyMatrixCell, c as RlsFieldsOutcome, d as RlsParityOptions, f as RlsParityReport, g as testRlsParity, h as RlsQueryResult, i as OrmParityRunInput, l as RlsParityCase, m as RlsQueryFn, n as OrmParityOptions, o as testOrmParity, p as RlsParitySubject, r as OrmParityReport, s as RlsDbOutcome, t as OrmParityCase, u as RlsParityFixture, v as MatrixCell, x as PolicyMatrixReport, y as MatrixOutcome } from "../core-bf8qgaZf.js";
1
+ import { Ar as Subject, Ct as WhereCompiler, D as Policy, Dr as Membership, G as CredentialVerifier, Or as Principal, X as DecisionSink, Y as DecisionProvider, Z as EntitlementSource, _t as TokenSigner, bn as DeliveryChannel, ct as RelationSource, it as MembershipSource, lt as SettingsSource, mt as SubjectResolver, nt as LimitStore, q as CustomRoleSource, rn as Snapshot, ut as SnapshotSource, vt as TokenVerifier } from "../policy-types-BnBZvh7N.js";
2
+ import { S as policyMatrix, _ as DescribePolicyConfig, a as OrmParityScenario, b as PolicyMatrixCell, c as RlsFieldsOutcome, d as RlsParityOptions, f as RlsParityReport, g as testRlsParity, h as RlsQueryResult, i as OrmParityRunInput, l as RlsParityCase, m as RlsQueryFn, n as OrmParityOptions, o as testOrmParity, p as RlsParitySubject, r as OrmParityReport, s as RlsDbOutcome, t as OrmParityCase, u as RlsParityFixture, v as MatrixCell, x as PolicyMatrixReport, y as MatrixOutcome } from "../core-DPuDmlbL.js";
3
3
  import { A as ResourceInit, C as InferPermissionTree, r as Role, w as Permission } from "../vocabulary-DHfKPIC5.js";
4
4
  import { l as OperationLookup, n as OperationCoverageOptions } from "../coverage-AOeWiQ7Z.js";
5
- import { dt as LegacyCheck } from "../index-DT3hOxA7.js";
6
- import { C as Limits, D as InstanceCache, a as PermDock, g as PrincipalIdentity, u as SnapshotOptions, v as PrincipalSource, z as ApprovalPolicySource } from "../permdock-BShHM8OJ.js";
7
- import { i as Seeds } from "../seeds-Cih1ztkf.js";
5
+ import { dt as LegacyCheck } from "../index-BDJ2OZvV.js";
6
+ import { C as Limits, D as InstanceCache, a as PermDock, g as PrincipalIdentity, u as SnapshotOptions, v as PrincipalSource, z as ApprovalPolicySource } from "../permdock-V86uejcm.js";
7
+ import { i as Seeds } from "../seeds-DLjPbhvM.js";
8
8
  import { t as SqlQuery } from "../sql-BYYNi1lu.js";
9
- import { a as ApprovalDelegationSource, m as ApprovalStore } from "../types-vKKndyxx.js";
9
+ import { a as ApprovalDelegationSource, m as ApprovalStore } from "../types-5cvjmHTG.js";
10
10
  import { n as RevocationFeed } from "../revocations-ku_f2d2y.js";
11
11
  import { a as SaasProject } from "../permissions-UyQD5nRN.js";
12
- import { n as saasPolicy } from "../policy-BUtwixSN.js";
13
- import { c as ModelMap, t as AgentPermDock, u as ToolMap } from "../create-B7Xa4jSQ.js";
14
- import { t as CloudApproverOptions } from "../types-h9W3CNC_.js";
15
- import { c as AccessReviewStore } from "../types-euUv1wsO.js";
12
+ import { n as saasPolicy } from "../policy-DZORR-Fw.js";
13
+ import { c as ModelMap, t as AgentPermDock, u as ToolMap } from "../create-CdB9FCZh.js";
14
+ import { t as CloudApproverOptions } from "../types-BmTW35E5.js";
15
+ import { c as AccessReviewStore } from "../types-CgaGxF5q.js";
16
16
  import { t as supabaseMembershipsBudget } from "../budget-5LJ8kfZk.js";
17
- import { R as IdempotencyStore } from "../index-DPVeDtAO.js";
18
- import { g as SetQueue, l as ReplayStore } from "../types-CIzXPPV-.js";
19
- import { S as SsfStreamStore } from "../index-WOx7TBbj.js";
20
- import { s as PolicySource } from "../hosted-Bkw3Oyh-.js";
21
- import { l as VersionStore, n as SubjectCache, s as VersionCache } from "../subject-cache-CnJcz2K_.js";
22
- import { r as SnapshotStorage } from "../types-CjZscT16.js";
23
- import { a as AutomationSource, t as Automation } from "../automation-0VF1xe4o.js";
24
- import { s as SupportSessionSource } from "../index-DWmIuQLz.js";
25
- import { n as ApprovalWaiter } from "../waiter-BqUxSRxq.js";
26
- import { c as DeliveryTransport, g as TransportMessages } from "../types-BhBfMdQ5.js";
27
- import { x as DirectoryStore } from "../index-xShPsK8G.js";
28
- import { r as SupabaseHookManifest } from "../manifest-DgsxeAsM.js";
29
- import { a as ProblemDetails } from "../errors-COoiWqIs.js";
17
+ import { R as IdempotencyStore } from "../index-giCl-aQY.js";
18
+ import { g as SetQueue, l as ReplayStore } from "../types-B_I8TBA9.js";
19
+ import { S as SsfStreamStore } from "../index-CWwWkz10.js";
20
+ import { s as PolicySource } from "../hosted-BISipW6F.js";
21
+ import { l as VersionStore, n as SubjectCache, s as VersionCache } from "../subject-cache-UKUgQCEX.js";
22
+ import { r as SnapshotStorage } from "../types-gp1w86cV.js";
23
+ import { a as AutomationSource, t as Automation } from "../automation-BqUmdFfe.js";
24
+ import { s as SupportSessionSource } from "../index-BO5f180f.js";
25
+ import { n as ApprovalWaiter } from "../waiter-Bov7Cig6.js";
26
+ import { c as DeliveryTransport, g as TransportMessages } from "../types-CDkJNA3a.js";
27
+ import { x as DirectoryStore } from "../index-Co_e22iJ.js";
28
+ import { r as SupabaseHookManifest } from "../manifest-BwhZ1s5b.js";
29
+ import { a as ProblemDetails } from "../errors-BGosrHl8.js";
30
30
  import { expectTypeOf } from "vitest";
31
31
  /** `policyMatrix` under Vitest: one test per cell, plus the exhaustive check. */
32
32
  export declare function describePolicy<TSubject>(policy: Policy, config: DescribePolicyConfig<TSubject>): void;
@@ -1,11 +1,11 @@
1
- import { i as policyMatrixLayout, n as testRlsParity, r as policyMatrix, t as testOrmParity } from "../core-C5yCD-Ls.js";
2
- import { d as clientBundle, t as getPermDock } from "../permdock-CJPIwU1T.js";
3
- import { t as fromSnapshot } from "../from-snapshot-DGc9W4QU.js";
4
- import { n as parseSnapshot } from "../snapshot-Ty0uk9wZ.js";
1
+ import { i as policyMatrixLayout, n as testRlsParity, r as policyMatrix, t as testOrmParity } from "../core-DIUrkFNL.js";
2
+ import { p as clientBundle, t as getPermDock } from "../permdock-JM9TKevZ.js";
3
+ import { t as fromSnapshot } from "../from-snapshot-DZ4D2sLa.js";
4
+ import { n as parseSnapshot } from "../snapshot-Dzi4LR6n.js";
5
5
  import { t as operationCoverage } from "../coverage-C3jVYC9Y.js";
6
- import { E as approvalPoliciesFor, d as snapshotFor, k as memoryCustomRoleSource } from "../src-HRYn4UFj.js";
7
- import { C as saasOrg, E as saasSeed, S as saasMemberships, a as saasProject, g as verifySaasSession, h as signSaasToken, k as saasPolicy, t as saasDoc, w as saasPrincipal, x as saasCustomRoles } from "../saas-DcqUkynn.js";
8
- import { i as saasPermissions } from "../permissions-wEkTVr_I.js";
6
+ import { A as memoryCustomRoleSource, D as approvalPoliciesFor, d as snapshotFor } from "../src-BXDohWNO.js";
7
+ import { C as saasOrg, E as saasSeed, S as saasMemberships, a as saasProject, g as verifySaasSession, h as signSaasToken, k as saasPolicy, t as saasDoc, w as saasPrincipal, x as saasCustomRoles } from "../saas-DSeazNrN.js";
8
+ import { i as saasPermissions } from "../permissions-xPyAmuXi.js";
9
9
  import { c as quoteSqlTable, o as quoteSqlIdent } from "../sql-T4GaBh9X.js";
10
10
  import { o as resolveApproval } from "../helpers-COh0lLc1.js";
11
11
  import { c as problemFromDecision } from "../problem-BZB7zPC7.js";
@@ -17,23 +17,23 @@ import { t as APPROVAL_HEADER } from "../types-DFZKovb3.js";
17
17
  import { t as byCodePoint } from "../compare-dfHDj8kT.js";
18
18
  import { n as role, r as allow } from "../role-builder-BksM3Q9O.js";
19
19
  import { t as definePermissions } from "../permissions-DJ_QV9L7.js";
20
- import { r as definePolicy } from "../policy-BBvhhH9X.js";
20
+ import { r as definePolicy } from "../policy-CZBJDcTx.js";
21
21
  import { i as principal } from "../refs-Cix9Zjis.js";
22
22
  import { v as resource } from "../permission-registry-DstT40VS.js";
23
- import { i as cloudEndpoints, n as cloud, s as approverHeaders, t as bearerChallenge } from "../challenge-CRB1X3Ry.js";
23
+ import { i as cloudEndpoints, n as cloud, s as approverHeaders, t as bearerChallenge } from "../challenge-E9sicsCA.js";
24
24
  import { r as isRecord } from "../compact-C4LFuqbW.js";
25
25
  import { d as isoNow, f as nowMillis, p as nowSeconds, u as isoAt } from "../time-r0CKBm57.js";
26
- import { c as mergeHostedGrants, l as parsePolicyDocument } from "../hosted-DZwCFrcy.js";
26
+ import { c as mergeHostedGrants, l as parsePolicyDocument } from "../hosted-D3USbpS6.js";
27
27
  import { t as catalogFingerprint } from "../catalog-fingerprint-DAWZARy6.js";
28
28
  import { n as discoverAuthorizationServer } from "../device-f3JEnqa0.js";
29
29
  import { t as POLICY_NOT_PUBLISHED } from "../problem-types-81BEw0IN.js";
30
30
  import { t as require__2020 } from "../2020-DBXhfpuK.js";
31
31
  import { t as APPROVAL_REQUEST_SCHEMA } from "../request-schema-DzEoR310.js";
32
- import { t as PUSHED_POLICY_SCHEMA } from "../pushed-policy-DSjSWEAl.js";
32
+ import { t as PUSHED_POLICY_SCHEMA } from "../pushed-policy-dm_hFstN.js";
33
33
  import { n as supabaseMembershipsBudget } from "../budget-BH81q2cj.js";
34
34
  import { t as catalogSchema } from "../schema-D2OK4RrB.js";
35
35
  import { t as CONNECTOR_SCHEMA } from "../connector-schema-BSRMyq4M.js";
36
- import { t as supabaseManifestSchema } from "../manifest-schema-D7RQbnGY.js";
36
+ import { t as supabaseManifestSchema } from "../manifest-schema-N3v2RVL-.js";
37
37
  import { n as freezeDeep } from "../freeze-DGfJq_j2.js";
38
38
  import { c as evaluateCondition } from "../delegation-0DVVomzu.js";
39
39
  import { s as parseCredential } from "../credential-D9in5keC.js";
@@ -42,7 +42,7 @@ import { n as loadPrincipalByIdentity, t as loadPrincipal } from "../principal-s
42
42
  import { r as parseAutomation } from "../automation-D58PEI7Y.js";
43
43
  import { a as authenticated } from "../grantee-BSCdpIF3.js";
44
44
  import { d as scopeList, o as normalizeMemberships } from "../scopes-B-KX9EI8.js";
45
- import { O as validateCustomRole } from "../evaluate-Dmd0bShm.js";
45
+ import { O as validateCustomRole } from "../evaluate-DNz6wMYv.js";
46
46
  import { l as sha256Hex, n as scimHandler, t as directoryMembershipSource } from "../scim-B9QyJ23q.js";
47
47
  import { afterAll, assert, beforeAll, describe, expect, expectTypeOf, it, vi } from "vitest";
48
48
  // src/testing/describe-policy.ts
@@ -1,7 +1,7 @@
1
1
  import { a as SaasProject, c as saasPlans, i as SaasFolderSchema, l as saasRoles, n as SaasDocSchema, o as SaasProjectSchema, r as SaasFolder, s as saasPermissions, t as SaasDoc, u as saasTenantRoleNames } from "../../permissions-UyQD5nRN.js";
2
- import { n as saasPolicy, t as SAAS_API_KEY_LIMIT } from "../../policy-BUtwixSN.js";
3
- import { Er as Principal, Or as Subject, Sr as Delegation, Tr as Membership, br as CustomRole, ct as RelationSource, gr as Actor, nt as LimitStore, qt as Instant } from "../../policy-types-CfW4X_yX.js";
4
- import { o as PermDockOptions } from "../../permdock-BShHM8OJ.js";
2
+ import { n as saasPolicy, t as SAAS_API_KEY_LIMIT } from "../../policy-DZORR-Fw.js";
3
+ import { Ar as Subject, Dr as Membership, Or as Principal, Sr as CustomRole, ct as RelationSource, nt as LimitStore, qt as Instant, vr as Actor, wr as Delegation } from "../../policy-types-BnBZvh7N.js";
4
+ import { o as PermDockOptions } from "../../permdock-V86uejcm.js";
5
5
  import { w as Permission } from "../../vocabulary-DHfKPIC5.js";
6
6
  import { StandardSchemaV1 } from "@standard-schema/spec";
7
7
  type FieldKind = "string" | "boolean" | "nullable-string";
@@ -1,3 +1,3 @@
1
- import { a as saasPlans, c as rowSchema, i as saasPermissions, n as SaasFolderSchema, o as saasRoles, r as SaasProjectSchema, s as saasTenantRoleNames, t as SaasDocSchema } from "../../permissions-wEkTVr_I.js";
2
- import { C as saasOrg, D as saasUsers, E as saasSeed, O as SAAS_API_KEY_LIMIT, S as saasMemberships, T as saasRelations, _ as verifySaasToken, a as saasProject, b as SAAS_EXPIRED_AT, c as saasUser, d as saasIssuer, f as saasJwks, g as verifySaasSession, h as signSaasToken, i as saasLimitStore, k as saasPolicy, l as SAAS_TOKEN_TTL_SECONDS, m as saasPublicJwk, n as saasFolder, o as saasScenarioOptions, p as saasPrivateJwk, r as saasFolderScenarios, s as saasScenarios, t as saasDoc, u as saasAudience, v as saasSchemaSql, w as saasPrincipal, x as saasCustomRoles, y as saasSeedSql } from "../../saas-DcqUkynn.js";
1
+ import { a as saasPlans, c as rowSchema, i as saasPermissions, n as SaasFolderSchema, o as saasRoles, r as SaasProjectSchema, s as saasTenantRoleNames, t as SaasDocSchema } from "../../permissions-xPyAmuXi.js";
2
+ import { C as saasOrg, D as saasUsers, E as saasSeed, O as SAAS_API_KEY_LIMIT, S as saasMemberships, T as saasRelations, _ as verifySaasToken, a as saasProject, b as SAAS_EXPIRED_AT, c as saasUser, d as saasIssuer, f as saasJwks, g as verifySaasSession, h as signSaasToken, i as saasLimitStore, k as saasPolicy, l as SAAS_TOKEN_TTL_SECONDS, m as saasPublicJwk, n as saasFolder, o as saasScenarioOptions, p as saasPrivateJwk, r as saasFolderScenarios, s as saasScenarios, t as saasDoc, u as saasAudience, v as saasSchemaSql, w as saasPrincipal, x as saasCustomRoles, y as saasSeedSql } from "../../saas-DSeazNrN.js";
3
3
  export { SAAS_API_KEY_LIMIT, SAAS_EXPIRED_AT, SAAS_TOKEN_TTL_SECONDS, SaasDocSchema, SaasFolderSchema, SaasProjectSchema, rowSchema, saasAudience, saasCustomRoles, saasDoc, saasFolder, saasFolderScenarios, saasIssuer, saasJwks, saasLimitStore, saasMemberships, saasOrg, saasPermissions, saasPlans, saasPolicy, saasPrincipal, saasPrivateJwk, saasProject, saasPublicJwk, saasRelations, saasRoles, saasScenarioOptions, saasScenarios, saasSchemaSql, saasSeed, saasSeedSql, saasTenantRoleNames, saasUser, saasUsers, signSaasToken, verifySaasSession, verifySaasToken };
@@ -1 +1 @@
1
- export { t as SaasDocSchema, n as SaasFolderSchema, r as SaasProjectSchema, i as saasPermissions, a as saasPlans, o as saasRoles, s as saasTenantRoleNames } from "../../permissions-wEkTVr_I.js";
1
+ export { t as SaasDocSchema, n as SaasFolderSchema, r as SaasProjectSchema, i as saasPermissions, a as saasPlans, o as saasRoles, s as saasTenantRoleNames } from "../../permissions-xPyAmuXi.js";
@@ -1,10 +1,10 @@
1
- import { a as PermDock } from "../permdock-BShHM8OJ.js";
1
+ import { a as PermDock } from "../permdock-V86uejcm.js";
2
2
  import { w as Permission } from "../vocabulary-DHfKPIC5.js";
3
- import { D as Policy, Er as Principal } from "../policy-types-CfW4X_yX.js";
3
+ import { D as Policy, Or as Principal } from "../policy-types-BnBZvh7N.js";
4
4
  import { n as RevocationFeed } from "../revocations-ku_f2d2y.js";
5
- import { t as ServerAdapterOptions } from "../bind-zQacwAOg.js";
6
- import { D as ConnectionOptions, T as Connection, i as OpenApiHooks } from "../server-types-C2XX60aF.js";
7
- import { t as RpcProtectOptions } from "../rpc-COnquydd.js";
5
+ import { t as ServerAdapterOptions } from "../bind-Bwk9tt1z.js";
6
+ import { D as ConnectionOptions, T as Connection, i as OpenApiHooks } from "../server-types-BlMijUtb.js";
7
+ import { t as RpcProtectOptions } from "../rpc-DyCWVn6C.js";
8
8
  import { AnyTRPCMiddlewareFunction } from "@trpc/server";
9
9
  type TrpcMiddlewareOpts<TCtx = object, TInput = unknown> = {
10
10
  readonly ctx: TCtx;
@@ -1,7 +1,7 @@
1
- import { n as attached } from "../bind-BYeoLJgN.js";
1
+ import { n as attached } from "../bind-DPptdk31.js";
2
2
  import { o as problemMessage } from "../http-C9jDw_bZ.js";
3
3
  import { t as problemFromError } from "../map-error-DYQbf-3Q.js";
4
- import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-D7G7IJDa.js";
4
+ import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-BQPa7tLP.js";
5
5
  import { i as isAsyncIterable, o as reloadAfter } from "../stream-DdF94h7T.js";
6
6
  import { r as permissionList } from "../decide-set-CgNcE6pP.js";
7
7
  import { TRPCError, isTrackedEnvelope } from "@trpc/server";
@@ -1,6 +1,6 @@
1
1
  import { U as POLICY_SCOPES, n as PlanTree, w as Permission } from "./vocabulary-DHfKPIC5.js";
2
2
  import { o as OperationMap } from "./operations-DaEoGpMV.js";
3
- import { N as PolicyVocabulary, jn as ScopeNames } from "./policy-types-CfW4X_yX.js";
3
+ import { N as PolicyVocabulary, Nn as ScopeNames } from "./policy-types-BnBZvh7N.js";
4
4
  /** Recursion guard: a tree nests resources at most this many levels deep. */
5
5
  type Depth = [never, 0, 1, 2, 3, 4, 5, 6, 7];
6
6
  /** The literal string keys of `T`, without an index signature. */
@@ -1,5 +1,5 @@
1
1
  import { K as AppData } from "./vocabulary-DHfKPIC5.js";
2
- import { Dn as WireDelegation, Kn as RelationGrantee, Nn as Approver, Or as Subject, Tr as Membership, a as ApprovalMode, c as ApprovalStage, i as ApprovalFallback, jr as AdapterId, n as ApprovalCombine, qt as Instant } from "./policy-types-CfW4X_yX.js";
2
+ import { Ar as Subject, Dr as Membership, Fn as Approver, Jn as RelationGrantee, Nr as AdapterId, a as ApprovalMode, c as ApprovalStage, i as ApprovalFallback, kn as WireDelegation, n as ApprovalCombine, qt as Instant } from "./policy-types-BnBZvh7N.js";
3
3
  type ApprovalStatus = "pending" | "approved" | "rejected" | "expired";
4
4
  type ApprovalApprovers = {
5
5
  /** Under `combine: 'any'` (the default). */
@@ -1,5 +1,5 @@
1
- import { N as PolicyVocabulary, _n as DecisionEvent } from "./policy-types-CfW4X_yX.js";
2
- import { a as PermDock } from "./permdock-BShHM8OJ.js";
1
+ import { N as PolicyVocabulary, yn as DecisionEvent } from "./policy-types-BnBZvh7N.js";
2
+ import { a as PermDock } from "./permdock-V86uejcm.js";
3
3
  declare const GENAI_SEMCONV_PIN = "1.37.0";
4
4
  declare const GEN_AI_TOOL_NAME = "gen_ai.tool.name";
5
5
  declare const GEN_AI_TOOL_CALL_ID = "gen_ai.tool.call.id";
@@ -1,5 +1,5 @@
1
- import { m as ApprovalStore } from "./types-vKKndyxx.js";
2
- import { $ as JwtClaims, Er as Principal, Or as Subject, gr as Actor, gt as TokenFailureCause, it as MembershipSource, mn as AuthEvent, vt as TokenVerifier } from "./policy-types-CfW4X_yX.js";
1
+ import { m as ApprovalStore } from "./types-5cvjmHTG.js";
2
+ import { $ as JwtClaims, Ar as Subject, Or as Principal, gn as AuthEvent, gt as TokenFailureCause, it as MembershipSource, vr as Actor, vt as TokenVerifier } from "./policy-types-BnBZvh7N.js";
3
3
  import { n as RevocationFeed } from "./revocations-ku_f2d2y.js";
4
4
  import { t as ClaimsMap } from "./claims-map-CLKQWxJG.js";
5
5
  import { t as ClientNames } from "./clients-DGcyFDCc.js";
@@ -1,8 +1,8 @@
1
- import { m as ApprovalStore, u as ApprovalRequest } from "./types-vKKndyxx.js";
1
+ import { m as ApprovalStore, u as ApprovalRequest } from "./types-5cvjmHTG.js";
2
2
  import { a as CatalogDocument } from "./types-CbJ5mxXv.js";
3
- import { s as PolicySource } from "./hosted-Bkw3Oyh-.js";
4
- import { Or as Subject, X as DecisionSink, _t as TokenSigner, ut as SnapshotSource, vt as TokenVerifier } from "./policy-types-CfW4X_yX.js";
5
- import { a as CatalogFinding } from "./sink-BQ_6K81r.js";
3
+ import { s as PolicySource } from "./hosted-BISipW6F.js";
4
+ import { Ar as Subject, X as DecisionSink, _t as TokenSigner, ut as SnapshotSource, vt as TokenVerifier } from "./policy-types-BnBZvh7N.js";
5
+ import { a as CatalogFinding } from "./sink-DhrVLPSJ.js";
6
6
  type CloudEndpointOptions = {
7
7
  readonly url?: string;
8
8
  readonly environment?: string;