permdock 0.38.1 → 0.39.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 (236) hide show
  1. package/dist/a2a/index.js +2 -2
  2. package/dist/{adoption-scan-CkkOzkXs.js → adoption-scan-Cg4pyRhm.js} +1 -1
  3. package/dist/agent/index.js +1 -1
  4. package/dist/ai-sdk/index.js +3 -3
  5. package/dist/{annotate-dUrBHXWa.js → annotate-DcSH62rl.js} +2 -2
  6. package/dist/{annotate-doc-BA0betEO.js → annotate-doc-CLU0DxK7.js} +1 -1
  7. package/dist/app/index.js +1 -1
  8. package/dist/{approval-chain-BEeExHpb.js → approval-chain-e4HcSs3o.js} +2 -2
  9. package/dist/{arazzo-BKYLAE5e.js → arazzo-BcSSf6Du.js} +1 -1
  10. package/dist/{arazzo-n8as0lFp.js → arazzo-C1JA-k9F.js} +3 -3
  11. package/dist/{ast-CAOxvn9t.js → ast-BhvgF264.js} +1 -1
  12. package/dist/astro/index.js +1 -1
  13. package/dist/authzen/index.js +1 -1
  14. package/dist/better-supabase/index.js +6 -6
  15. package/dist/{bind-BNYcJ1D9.js → bind-CFwfgfp2.js} +2 -2
  16. package/dist/{bsb-access-tags-DaGRSYnv.js → bsb-access-tags-DUdAk1Jc.js} +3 -3
  17. package/dist/{bsb-action-keys-LgveZiHJ.js → bsb-action-keys-CQdOwvrl.js} +4 -4
  18. package/dist/{budgets-DFnMBpKz.js → budgets-6cfA6Ibw.js} +3 -3
  19. package/dist/{build-instance-BGpABVbM.js → build-instance-BX5yWZDz.js} +1 -1
  20. package/dist/{bundle-size-Pgm7BB5m.js → bundle-size-CeLuyWm0.js} +2 -2
  21. package/dist/bundle-size-DRu3x2lW.js +1 -0
  22. package/dist/{casbin-BmYeMFeI.js → casbin-BthXLWZo.js} +1 -1
  23. package/dist/{casbin-BlQqoRlv.js → casbin-DilG0fwi.js} +1 -1
  24. package/dist/catalog/index.js +2 -2
  25. package/dist/{catalog-DYC6wfAj.js → catalog-Beg7WzxZ.js} +1 -1
  26. package/dist/{catalog-SnaPhbZ1.js → catalog-DlVcHvH5.js} +3 -3
  27. package/dist/catalog-WP3LwPu_.js +1 -0
  28. package/dist/{catalog-operations-BqSsByIE.js → catalog-operations-DsbLxw1f.js} +1 -1
  29. package/dist/chat/index.js +1 -1
  30. package/dist/claims-size-C0kHWqou.js +1 -0
  31. package/dist/{claims-size-ZiUJBn0r.js → claims-size-Dxm9zWw5.js} +2 -2
  32. package/dist/claude-agent/index.js +2 -2
  33. package/dist/cli/bin.js +1 -1
  34. package/dist/cli/generate/watch-worker.js +2 -2
  35. package/dist/cli/index.js +3 -3
  36. package/dist/cli/plugins/app.js +1 -1
  37. package/dist/cli/plugins/openapi.js +2 -2
  38. package/dist/cli/plugins/powersync.js +1 -1
  39. package/dist/cli/plugins/rls.js +1 -1
  40. package/dist/cli/plugins/schemas.js +1 -1
  41. package/dist/cli/plugins/supabase-hook.js +1 -1
  42. package/dist/cli/plugins/supabase.js +2 -2
  43. package/dist/cli/plugins/ui.js +1 -1
  44. package/dist/{cloud-DxDQff7G.js → cloud-0zu4L55w.js} +2 -2
  45. package/dist/{codemod-DjcAtHr9.js → codemod-CtF7Vk_T.js} +6 -6
  46. package/dist/{codemod-CX9EGBJw.js → codemod-DaU2mOwl.js} +5 -5
  47. package/dist/collect-BchFfzIJ.js +1 -0
  48. package/dist/{collect-Co-w8Eg2.js → collect-BqaPdsk1.js} +4 -4
  49. package/dist/{collect-CcE8QBtZ.js → collect-CcQDJuYi.js} +2 -2
  50. package/dist/{compile-BWOrvhGt.js → compile-CeaX5VD-.js} +8 -8
  51. package/dist/{completion-9B7fZWsn.js → completion-Cyp3kn5b.js} +1 -1
  52. package/dist/{config-Dan6vcvj.js → config-C1lTq4gJ.js} +3 -3
  53. package/dist/{config-BgBDv1UW.js → config-CNloPiIn.js} +1 -1
  54. package/dist/{config-paths-CQvGng3k.js → config-paths-Cg3IXh9T.js} +3 -3
  55. package/dist/{config-report-oYAr9Opz.js → config-report-i9ujoKAl.js} +4 -4
  56. package/dist/{context-DntIOpzS.js → context-BKZmdYRf.js} +1 -1
  57. package/dist/{context-Nr3nknZX.js → context-CzHYMZr9.js} +1 -1
  58. package/dist/convex/index.js +2 -2
  59. package/dist/{core-BFR-V5CL.js → core-BEA7805j.js} +3 -3
  60. package/dist/{create-Dapy8DIK.js → create-DRiggRWE.js} +3 -3
  61. package/dist/{create-BICq9l-p.js → create-fNkkpOy5.js} +2 -2
  62. package/dist/{custom-role-rebuild-BwM6hBqt.js → custom-role-rebuild-DzbBD1cq.js} +5 -5
  63. package/dist/{define-permdock-B0q7Rg9b.js → define-permdock-CGI9pgqL.js} +2 -2
  64. package/dist/{diff-BebUlh4Z.js → diff-Bv-oDvZq.js} +1 -1
  65. package/dist/{diff-Sxca4_5q.js → diff-YsQOcb9N.js} +4 -4
  66. package/dist/{doctor-Dqh8AzIx.js → doctor-BuPSrNmh.js} +60 -47
  67. package/dist/{doctor-CDSxgnut.js → doctor-Mgbj6UO0.js} +2 -2
  68. package/dist/{edits-CqU8s2GC.js → edits-Ckbit4uD.js} +1 -1
  69. package/dist/elysia/index.js +1 -1
  70. package/dist/evaluator-C4RrXo4y.js +2 -0
  71. package/dist/{evaluator-eager-BLNVbEAC.js → evaluator-eager-B_4KdPgg.js} +1 -1
  72. package/dist/eve/index.d.ts +50 -1
  73. package/dist/eve/index.js +39 -3
  74. package/dist/{execute-CUGaCy_9.js → execute-D6FFwdwW.js} +5 -5
  75. package/dist/{explain-CgKGadRa.js → explain-CPYRj0qn.js} +3 -3
  76. package/dist/{explain-BrvY9cXX.js → explain-CvCujO8Q.js} +2 -2
  77. package/dist/express/index.js +1 -1
  78. package/dist/fastify/index.js +1 -1
  79. package/dist/{fetch-adapter-dmABnF7F.js → fetch-adapter-niRAPzNm.js} +1 -1
  80. package/dist/{fields-CKX-qjWb.js → fields-DWAwA8vX.js} +3 -3
  81. package/dist/{fixtures-3aUUP6Nx.js → fixtures-B29C2DGA.js} +1 -1
  82. package/dist/{from-snapshot-DZ4D2sLa.js → from-snapshot-O341Vdgj.js} +12 -4
  83. package/dist/{gen-D85_gUOz.js → gen-CZB21YVB.js} +6 -6
  84. package/dist/{gen-kind-Bi0dtNoV.js → gen-kind-2KPUHSs6.js} +1 -1
  85. package/dist/gen-tTRu05jZ.js +1 -0
  86. package/dist/{generate-C8kAhef2.js → generate-DFffYRB7.js} +3 -3
  87. package/dist/{generate-BnOSZLka.js → generate-DePdrbn_.js} +19 -19
  88. package/dist/{generate-options-eMjRViev.js → generate-options-Bq5qQ9H7.js} +13 -13
  89. package/dist/h3/index.js +2 -2
  90. package/dist/{helper-calls-DN1PJcNY.js → helper-calls-jStpeQ2_.js} +1 -1
  91. package/dist/hono/index.js +1 -1
  92. package/dist/{hook-sql-BQcxbOzi.js → hook-sql-Dys1kW5p.js} +13 -13
  93. package/dist/{import-BLN-HGJG.js → import-BIJM6oAh.js} +1 -1
  94. package/dist/{import-wBO24zgo.js → import-bTvN77Uj.js} +3 -3
  95. package/dist/{index-B1hyWi7O.d.ts → index-Cnrz9ChE.d.ts} +3 -2
  96. package/dist/index.d.ts +1 -1
  97. package/dist/index.js +4 -4
  98. package/dist/{init-B8bPTGMb.js → init-CfDdG_Fj.js} +3 -3
  99. package/dist/{init-BQnRbzUb.js → init-yo4GJOkM.js} +1 -1
  100. package/dist/{inspect-functions-GXdyPFwI.js → inspect-functions-Cj7kZDJt.js} +1 -1
  101. package/dist/{instance-snapshot-D03srwnf.js → instance-snapshot-BJam8gUa.js} +10 -3
  102. package/dist/{interactive-only-C9NQJXpi.js → interactive-only-ek-Kf0Kq.js} +5 -5
  103. package/dist/{kernel-yI0nUyuX.js → kernel-UOKCD3tV.js} +3 -3
  104. package/dist/{keys-QhAlAjXf.js → keys-CBblXqiu.js} +1 -1
  105. package/dist/{lazy-provider-b8UHGi8P.js → lazy-provider-BPSgEG-A.js} +1 -1
  106. package/dist/{load-m7jmit3y.js → load-D03A3tZL.js} +1 -1
  107. package/dist/load-r-TDUcRq.js +1 -0
  108. package/dist/{login-kQOIJoFN.js → login-2hkrhPGs.js} +3 -3
  109. package/dist/{login-DnVKv2ib.js → login-CsTj_pBQ.js} +1 -1
  110. package/dist/{manager-chain-CFkceFls.js → manager-chain-BbrD-s7u.js} +2 -2
  111. package/dist/{manifest-CMh8sAAH.js → manifest-CZvwWacN.js} +42 -42
  112. package/dist/mcp/index.js +2 -2
  113. package/dist/{measure-DJl28Whs.js → measure-BhjWMmvj.js} +5 -5
  114. package/dist/{memberships-DiCbNRny.js → memberships-DEW0FU2p.js} +1 -1
  115. package/dist/{memberships-CDiSsFTu.js → memberships-DaKwjhc5.js} +3 -3
  116. package/dist/{migrate-BXk_rUmb.js → migrate-BBPxqBMF.js} +2 -2
  117. package/dist/{model-DQQYg8UW.js → model-BfhDMEDf.js} +2 -2
  118. package/dist/{module-values-D-AiNhBp.js → module-values-BvR7QHTM.js} +2 -2
  119. package/dist/{names-DwGleRKB.js → names-zCkaCepO.js} +3 -3
  120. package/dist/nest/index.js +1 -1
  121. package/dist/next/index.js +3 -3
  122. package/dist/next/plugin.js +1 -1
  123. package/dist/node/index.js +1 -1
  124. package/dist/openai/index.js +3 -3
  125. package/dist/{openapi-CuyzmD9h.js → openapi-1ZydKQE3.js} +4 -4
  126. package/dist/{openapi-D7kRYqWu.js → openapi-CufQiEo8.js} +2 -2
  127. package/dist/{openapi-document-ClyLB0-z.js → openapi-document-oqfHlSZt.js} +1 -1
  128. package/dist/{optional-CaQWp9HA.js → optional-Dw7to-jw.js} +11 -1
  129. package/dist/orpc/index.js +2 -2
  130. package/dist/{output-ONUzppLo.js → output-yUW7fcAk.js} +1 -1
  131. package/dist/{ownership-CCgncSLb.js → ownership-Bx_s_E8i.js} +7 -7
  132. package/dist/pdp/index.js +1 -1
  133. package/dist/{permdock-CbavFN6u.js → permdock-B0aE5Ime.js} +1 -1
  134. package/dist/{permissions-BPYOb5OB.js → permissions-CF8Ed44S.js} +1 -1
  135. package/dist/{pipeline-DGFc6y6x.js → pipeline-BTsmCn1p.js} +2 -2
  136. package/dist/{policy-AWd-ccJJ.js → policy-CXAhfYIt.js} +2 -2
  137. package/dist/{policy-bundle-rC5_X9hX.js → policy-bundle-BZyCcphj.js} +3 -3
  138. package/dist/{policy-from-catalog-BohzTN3J.js → policy-from-catalog-hECiBs9M.js} +1 -1
  139. package/dist/{powersync-DW7seEgS.js → powersync-C6F2F_VP.js} +1 -1
  140. package/dist/{powersync-C84aHECl.js → powersync-CcXYDuyo.js} +1 -1
  141. package/dist/{powersync-C1OW6iVd.js → powersync-DVUeHJpL.js} +13 -13
  142. package/dist/{program-CvarkLMS.js → program-C2fbc9NO.js} +2 -2
  143. package/dist/{provider-NQwLSlgb.js → provider-BT8hVigf.js} +1 -1
  144. package/dist/{provider-hQFC3b98.js → provider-DRsBw6My.js} +1 -1
  145. package/dist/{provider-store-BizF6jyu.js → provider-store-fzaF1R6q.js} +1 -1
  146. package/dist/{prune-config-DeTUhG2J.js → prune-config-CPvDryuI.js} +10 -10
  147. package/dist/{pull-C851tQak.js → pull-CEv7O_zQ.js} +1 -1
  148. package/dist/pull-DeXUmRKY.js +1 -0
  149. package/dist/{push-Br0Uz5pT.js → push-Dq9qatTg.js} +3 -3
  150. package/dist/{pushed-policy-dm_hFstN.js → pushed-policy-DXA5KLo6.js} +1 -1
  151. package/dist/{quote-LNaBdCGA.js → quote-BX3DDoTX.js} +1 -1
  152. package/dist/{rbac-ByuGspKZ.js → rbac-COexzCC9.js} +5 -5
  153. package/dist/react/index.js +1 -1
  154. package/dist/react/lazy.js +1 -1
  155. package/dist/react/provider-client-lazy.js +1 -1
  156. package/dist/react/provider-client.js +1 -1
  157. package/dist/react-native/index.js +1 -1
  158. package/dist/{rename-BgfR3xB9.js → rename-CoG144pW.js} +9 -9
  159. package/dist/{report-x9GeUvjx.js → report-B7UuE4dW.js} +1 -1
  160. package/dist/{report-Dp-ApWVC.js → report-CMncWbQ-.js} +1 -1
  161. package/dist/{request-context-C9FFFpuH.js → request-context-Bi0Crsd5.js} +1 -1
  162. package/dist/{resolve-config-Cu_mE2wt.js → resolve-config-LiLfxe8X.js} +1 -1
  163. package/dist/{resolve-names-DmX503uX.js → resolve-names-ybewcnpW.js} +7 -7
  164. package/dist/{resolver-C9-dU-SZ.js → resolver-CkK3cvQc.js} +4 -4
  165. package/dist/{rls-DTN_-HX2.js → rls-C-UfcYPG.js} +5 -5
  166. package/dist/{rls-JSxuWcf-.js → rls-CTWb0XEV.js} +13 -13
  167. package/dist/{rls-files-BsJsEeJ_.js → rls-files-DFUG6y5D.js} +1 -1
  168. package/dist/{roles-BeNEhv7Q.js → roles-MVZd_RrF.js} +1 -1
  169. package/dist/{rpc-RDBrKR7N.js → rpc-C-kZGWs6.js} +1 -1
  170. package/dist/{run-BgNlYtQJ.js → run-B9MRT-5k.js} +3 -3
  171. package/dist/run-me1Fi6eQ.js +1 -0
  172. package/dist/{saas-CHviJgF2.js → saas-DDz3ivSL.js} +2 -2
  173. package/dist/{scan-pHPntFbs.js → scan-BoHmvDOe.js} +1 -1
  174. package/dist/{schema-DJd7Gq_p.js → schema-Bk0R_6ul.js} +1 -1
  175. package/dist/{schema-tables-Ba9LE_XB.js → schema-tables-CqEHokUT.js} +2 -2
  176. package/dist/server/index.js +1 -1
  177. package/dist/{shared-DnVY767H.js → shared-BRLAQqj4.js} +1 -1
  178. package/dist/{size-Dm3777Ev.js → size-CQkUXcPF.js} +4 -4
  179. package/dist/{skills-txCdqGns.js → skills-BIGdhR5i.js} +1 -1
  180. package/dist/{skills-D4ItrS0F.js → skills-DiMXWCQY.js} +1 -1
  181. package/dist/{snapshot-size-CpdksnSr.js → snapshot-size-1zICkeFb.js} +1 -1
  182. package/dist/{snapshot-size-I_-fxGry.js → snapshot-size-CFwBMDNC.js} +1 -1
  183. package/dist/solid/index.js +1 -1
  184. package/dist/solid-start/index.js +2 -2
  185. package/dist/{sources-C6Id63F8.js → sources-DNVEyJxb.js} +10 -2
  186. package/dist/{src-10d_jun2.js → src-DUWw9z1D.js} +2 -2
  187. package/dist/{stores-jgDndNHa.js → stores-qYmLHVKv.js} +1 -1
  188. package/dist/{subject-B7p94Y0s.js → subject-CMkc28eP.js} +1 -1
  189. package/dist/supabase/index.js +3 -3
  190. package/dist/supabase/middleware.js +3 -3
  191. package/dist/{supabase-D-kxyoaX.js → supabase-BBEop7q7.js} +2 -2
  192. package/dist/{supabase-hook-DDxDjlOU.js → supabase-hook-C3q-XEnu.js} +8 -8
  193. package/dist/supabase-hook-DLnH3_5Z.js +2 -0
  194. package/dist/{supabase-schemas-D6ezN5Ln.js → supabase-schemas-RPYfnE6O.js} +2 -2
  195. package/dist/{supabase-CeJAHqZp.js → supabase-zRUmN_PE.js} +3 -3
  196. package/dist/svelte/index.js +2 -2
  197. package/dist/svelte/runtime.js +1 -1
  198. package/dist/svelte/source.js +1 -1
  199. package/dist/sveltekit/index.js +1 -1
  200. package/dist/{table-reads-DHB56kFZ.js → table-reads-CegjCVHG.js} +1 -1
  201. package/dist/{table-reads-Doh_Egx2.js → table-reads-DpncF1F-.js} +3 -3
  202. package/dist/{tables-E-dIHUN_.js → tables-Dr4BUH9i.js} +12 -8
  203. package/dist/tanstack-start/index.js +1 -1
  204. package/dist/{tenant-check-DGfE7Sns.js → tenant-check-C5DAstGo.js} +3 -3
  205. package/dist/terminal/index.js +2 -2
  206. package/dist/testing/core.js +1 -1
  207. package/dist/testing/index.d.ts +1 -1
  208. package/dist/testing/index.js +7 -7
  209. package/dist/testing/saas/index.js +2 -2
  210. package/dist/testing/saas/permissions.js +1 -1
  211. package/dist/trpc/index.js +2 -2
  212. package/dist/unplugin/index.js +1 -1
  213. package/dist/{usage-DymSoYQZ.js → usage-D5Rin-a_.js} +1 -1
  214. package/dist/usage-D7eCW8yi.js +1 -0
  215. package/dist/{usage-CX_wmL5W.js → usage-DDr-iwHr.js} +6 -6
  216. package/dist/{verify-CHlmYg2d.js → verify-Df9u1-v5.js} +13 -13
  217. package/dist/vue/index.js +1 -1
  218. package/dist/{warm-BOrs0-_j.js → warm-C6Hn4J-4.js} +1 -1
  219. package/dist/{watch-BFDMb5N4.js → watch-BuQhtt25.js} +2 -2
  220. package/dist/{watch-CkL1iuKJ.js → watch-DEPXy-r0.js} +2 -2
  221. package/dist/watch-wQLoPqC-.js +1 -0
  222. package/dist/workflow/index.js +1 -1
  223. package/package.json +3 -3
  224. package/skills/permdock-agents/references/runtimes.md +1 -1
  225. package/dist/bundle-size-CGd8wVIu.js +0 -1
  226. package/dist/catalog-e6QRd1JP.js +0 -1
  227. package/dist/claims-size-B0OvYh9z.js +0 -1
  228. package/dist/collect-C2_CKZ09.js +0 -1
  229. package/dist/evaluator-zpeC7zel.js +0 -2
  230. package/dist/gen-CNYlckFE.js +0 -1
  231. package/dist/load-BCABUQZi.js +0 -1
  232. package/dist/pull-CylkuBGR.js +0 -1
  233. package/dist/run-C7nX-hkR.js +0 -1
  234. package/dist/supabase-hook-BTiZ8LTJ.js +0 -2
  235. package/dist/usage-DcVP-SFj.js +0 -1
  236. package/dist/watch-5WP3ZCcR.js +0 -1
package/dist/eve/index.js CHANGED
@@ -1,11 +1,13 @@
1
- import { t as agentRuntime } from "../create-BICq9l-p.js";
1
+ import { t as agentRuntime } from "../create-fNkkpOy5.js";
2
2
  import { t as boundedMap } from "../lru-Cp-AEvpR.js";
3
3
  import { c as isApprovalError } from "../types-DFZKovb3.js";
4
4
  import { o as resolveApproval } from "../helpers-COh0lLc1.js";
5
- import { u as withApp } from "../permdock-CbavFN6u.js";
5
+ import { u as withApp } from "../permdock-B0aE5Ime.js";
6
6
  import { t as compact } from "../compact-C4LFuqbW.js";
7
7
  // src/eve/create.ts
8
8
  const TOKENS_PER_PROCESS = 1e3;
9
+ /** The tool name a subscription check is recorded and delegated under. */
10
+ const SUBSCRIBE_TOOL = "eve__subscribe";
9
11
  function rolesOf(principal) {
10
12
  const roles = principal?.attributes?.["roles"];
11
13
  if (typeof roles === "string") return [roles];
@@ -158,10 +160,44 @@ function createPermDock(policy, given) {
158
160
  });
159
161
  return pairFor(() => binding);
160
162
  };
163
+ const subscriptionFor = (permission, subscriptionOptions) => {
164
+ const { data } = subscriptionOptions;
165
+ const load = (input) => data?.(input);
166
+ const binding = compact({
167
+ permission,
168
+ data: data === void 0 ? void 0 : load
169
+ });
170
+ const verdictFor = (subscriber, input) => {
171
+ if (subscriber.auth === null) return Promise.resolve({
172
+ outcome: "denied",
173
+ decision: null,
174
+ permission,
175
+ reason: "Denied: the subscribing session has no authenticated caller."
176
+ });
177
+ return kernel.evaluate(binding, SUBSCRIBE_TOOL, input, { session: {
178
+ id: subscriber.sessionId,
179
+ auth: {
180
+ initiator: subscriber.auth,
181
+ current: subscriber.auth
182
+ }
183
+ } }, { denyPending: true });
184
+ };
185
+ return Object.freeze({
186
+ onSubscribe: async (context) => {
187
+ const verdict = await verdictFor(context, context.subscription.input);
188
+ if (verdict.outcome === "granted") return;
189
+ throw new Error(verdict.outcome === "denied" ? verdict.reason : verdict.summary);
190
+ },
191
+ onEvent: async (context) => {
192
+ return (await verdictFor(context, context.subscription.input)).outcome === "granted" ? subscriptionOptions.onEvent(context) : null;
193
+ }
194
+ });
195
+ };
161
196
  return Object.freeze({
162
197
  ...agent,
163
198
  approval,
164
- approvalFor
199
+ approvalFor,
200
+ subscriptionFor
165
201
  });
166
202
  }
167
203
  export { actorFromEve, createPermDock, rolesOf, subjectFromEve };
@@ -1,10 +1,10 @@
1
- import { n as budgetBreaches, t as breachText } from "./budgets-DFnMBpKz.js";
1
+ import { n as budgetBreaches, t as breachText } from "./budgets-6cfA6Ibw.js";
2
2
  import { a as suggestion } from "./args-BSpXxMnb.js";
3
3
  import { n as CliError } from "./errors-DgLOqc6j.js";
4
- import { r as runGen } from "./gen-D85_gUOz.js";
5
- import { c as requirePolicy } from "./load-m7jmit3y.js";
6
- import { t as projectContext } from "./context-DntIOpzS.js";
7
- import { r as runGenerate } from "./pipeline-DGFc6y6x.js";
4
+ import { r as runGen } from "./gen-CZB21YVB.js";
5
+ import { c as requirePolicy } from "./load-D03A3tZL.js";
6
+ import { t as projectContext } from "./context-BKZmdYRf.js";
7
+ import { r as runGenerate } from "./pipeline-BTsmCn1p.js";
8
8
  import { n as isPermDockPlugin } from "./plugin-MQVfUBUS.js";
9
9
  import { relative, resolve } from "node:path";
10
10
  import { fileURLToPath } from "node:url";
@@ -1,8 +1,8 @@
1
1
  import { n as findPermission } from "./permission-registry-DstT40VS.js";
2
- import { t as getPermDock } from "./permdock-CbavFN6u.js";
3
- import { A as memoryCustomRoleSource } from "./src-10d_jun2.js";
2
+ import { t as getPermDock } from "./permdock-B0aE5Ime.js";
3
+ import { A as memoryCustomRoleSource } from "./src-DUWw9z1D.js";
4
4
  import { i as configError } from "./errors-DgLOqc6j.js";
5
- import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-3aUUP6Nx.js";
5
+ import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-B29C2DGA.js";
6
6
  // src/cli/explain.ts
7
7
  function grantOf(grant) {
8
8
  return {
@@ -1,7 +1,7 @@
1
1
  import { t as defineLeaf } from "./command-9GAzSI7E.js";
2
2
  import { f as usageResult } from "./errors-DgLOqc6j.js";
3
3
  import { f as policyFlag, l as given } from "./flags-DQzNPxg1.js";
4
- import { c as requirePolicy } from "./load-m7jmit3y.js";
4
+ import { c as requirePolicy } from "./load-D03A3tZL.js";
5
5
  // src/cli/commands/explain.ts
6
6
  const explain = defineLeaf({
7
7
  positionals: [{
@@ -19,7 +19,7 @@ const explain = defineLeaf({
19
19
  },
20
20
  async run(ctx, { flags, args }) {
21
21
  try {
22
- const { runExplain } = await import("./explain-CgKGadRa.js");
22
+ const { runExplain } = await import("./explain-CPYRj0qn.js");
23
23
  const policy = await requirePolicy(ctx.cwd, given(flags.policy) ?? ctx.config.policy, "set policy in permdock.config.ts or pass --policy");
24
24
  return await runExplain({
25
25
  cwd: ctx.cwd,
@@ -1,5 +1,5 @@
1
1
  import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-DPEAu_jM.js";
2
- import { i as decorate, r as bindKernel } from "../bind-BNYcJ1D9.js";
2
+ import { i as decorate, r as bindKernel } from "../bind-CFwfgfp2.js";
3
3
  import { r as hasCredentials } from "../http-C9jDw_bZ.js";
4
4
  import { t as problemFromError } from "../map-error-DYQbf-3Q.js";
5
5
  import { n as sendResponse, r as toRequest } from "../http-dNltTpC8.js";
@@ -1,5 +1,5 @@
1
1
  import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-DPEAu_jM.js";
2
- import { i as decorate, r as bindKernel } from "../bind-BNYcJ1D9.js";
2
+ import { i as decorate, r as bindKernel } from "../bind-CFwfgfp2.js";
3
3
  import { c as writeReply, i as headersFrom, n as firstHeader, r as hasCredentials, t as fetchRequest } from "../http-C9jDw_bZ.js";
4
4
  import { t as problemFromError } from "../map-error-DYQbf-3Q.js";
5
5
  // src/fastify/http.ts
@@ -1,6 +1,6 @@
1
1
  import { t as compact } from "./compact-C4LFuqbW.js";
2
2
  import { o as isPermission } from "./permission-registry-DstT40VS.js";
3
- import { i as decorate, r as bindKernel } from "./bind-BNYcJ1D9.js";
3
+ import { i as decorate, r as bindKernel } from "./bind-CFwfgfp2.js";
4
4
  import { r as hasCredentials } from "./http-C9jDw_bZ.js";
5
5
  import { t as problemFromError } from "./map-error-DYQbf-3Q.js";
6
6
  import { o as methodNotAllowed } from "./problem-BZB7zPC7.js";
@@ -1,9 +1,9 @@
1
1
  import { c as jsonSchemaOf } from "./catalog-doc-BX97oFAn.js";
2
2
  import { i as configError } from "./errors-DgLOqc6j.js";
3
- import { a as quoteIdent, i as qualified, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-LNaBdCGA.js";
4
- import { s as signedIn } from "./shared-DnVY767H.js";
3
+ import { a as quoteIdent, i as qualified, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-BX3DDoTX.js";
4
+ import { s as signedIn } from "./shared-BRLAQqj4.js";
5
5
  import { a as sole } from "./compact-C4LFuqbW.js";
6
- import { u as subjectClaimJsonSql } from "./subject-B7p94Y0s.js";
6
+ import { u as subjectClaimJsonSql } from "./subject-CMkc28eP.js";
7
7
  // src/cli/sql/clauses.ts
8
8
  /**
9
9
  * True when `sql` is one parenthesised expression, so AND / OR need not wrap it
@@ -1,7 +1,7 @@
1
1
  import { r as isRecord } from "./compact-C4LFuqbW.js";
2
2
  import { i as configError } from "./errors-DgLOqc6j.js";
3
3
  import { i as readJsonFile } from "./files-DAR51W3J.js";
4
- import { a as loadModule, s as pickNamed } from "./load-m7jmit3y.js";
4
+ import { a as loadModule, s as pickNamed } from "./load-D03A3tZL.js";
5
5
  import { existsSync } from "node:fs";
6
6
  import { resolve } from "node:path";
7
7
  // src/cli/fixtures.ts
@@ -22,10 +22,18 @@ function resourceRef(snapshot, permission, data) {
22
22
  }
23
23
  function fromSnapshot(input, options = {}) {
24
24
  const wire = parseSnapshot(input);
25
- const snapshot = expandSnapshot(wire, compact({
25
+ return scopedInstance(wire, expandSnapshot(wire, compact({
26
26
  bundle: options.bundle,
27
27
  customRoles: options.customRoles
28
- }));
28
+ })), options);
29
+ }
30
+ /**
31
+ * The instance of one tenant and team over a snapshot that is already parsed
32
+ * and expanded. The expanded grants are frozen and do not depend on the tenant
33
+ * or team, so `tenant()` and `team()` share them and never expand the wire
34
+ * snapshot again.
35
+ */
36
+ function scopedInstance(wire, snapshot, options) {
29
37
  const subject = subjectFromSnapshot(snapshot, options.tenant);
30
38
  const team = options.team;
31
39
  const run = (permission, data, decideOptions = {}) => evaluateSnapshot(snapshot, subject, permission, data, team, decideOptions);
@@ -129,7 +137,7 @@ function fromSnapshot(input, options = {}) {
129
137
  return () => void 0;
130
138
  },
131
139
  tenant(id) {
132
- return fromSnapshot(wire, compact({
140
+ return scopedInstance(wire, snapshot, compact({
133
141
  tenant: id,
134
142
  team,
135
143
  bundle: options.bundle,
@@ -137,7 +145,7 @@ function fromSnapshot(input, options = {}) {
137
145
  }));
138
146
  },
139
147
  team(id) {
140
- return fromSnapshot(wire, compact({
148
+ return scopedInstance(wire, snapshot, compact({
141
149
  tenant: options.tenant,
142
150
  team: id,
143
151
  bundle: options.bundle,
@@ -1,11 +1,11 @@
1
- import { p as clientBundle } from "./permdock-CbavFN6u.js";
2
- import { t as loadConfiguredOperations } from "./catalog-operations-BqSsByIE.js";
1
+ import { p as clientBundle } from "./permdock-B0aE5Ime.js";
2
+ import { t as loadConfiguredOperations } from "./catalog-operations-DsbLxw1f.js";
3
3
  import { i as configError, n as CliError } from "./errors-DgLOqc6j.js";
4
4
  import { n as fileSummary, r as planFiles } from "./files-DuV7wRim.js";
5
5
  import { _ as writeOutputFiles, r as driftOf } from "./output-files-8lfALMSU.js";
6
6
  import { t as pluginVersion } from "./version-CU6e2wxV.js";
7
- import { c as requirePolicy } from "./load-m7jmit3y.js";
8
- import { i as withSchemaDefaults } from "./schema-tables-Ba9LE_XB.js";
7
+ import { c as requirePolicy } from "./load-D03A3tZL.js";
8
+ import { i as withSchemaDefaults } from "./schema-tables-CqEHokUT.js";
9
9
  import { t as canonicalJson } from "./canonical-json-BibZkXtE.js";
10
10
  import { r as isRecord } from "./compact-C4LFuqbW.js";
11
11
  import { t as byCodePoint } from "./compare-dfHDj8kT.js";
@@ -13,7 +13,7 @@ import { c as listPermissions } from "./permission-registry-DstT40VS.js";
13
13
  import { d as scopeList } from "./scopes-B-KX9EI8.js";
14
14
  import { o as listPlans, s as listRoles } from "./vocabulary-CE2k7s1a.js";
15
15
  import { c as jsonSchemaOf } from "./catalog-doc-BX97oFAn.js";
16
- import { t as resolveNames } from "./resolve-names-DmX503uX.js";
16
+ import { t as resolveNames } from "./resolve-names-ybewcnpW.js";
17
17
  import { t as DESCRIBE_TITLES } from "./describe-B7EosIKA.js";
18
18
  import { i as schemaExpression } from "./generate-5_kz2309.js";
19
19
  import { existsSync, readFileSync } from "node:fs";
@@ -401,7 +401,7 @@ function modelDigest(model) {
401
401
  return createHash("sha256").update(canonicalJson(model)).digest("base64url");
402
402
  }
403
403
  /**
404
- * `// @generated by permdock generate zod@0.38.1 from policy.ts sha-256:…; do
404
+ * `// @generated by permdock generate zod@0.39.0 from policy.ts sha-256:…; do
405
405
  * not edit`.
406
406
  */
407
407
  function generatedHeader(kind, info) {
@@ -47,7 +47,7 @@ function kindPlugin(kind, options = {}) {
47
47
  }],
48
48
  emit: async (_task, model, source) => {
49
49
  if (source === void 0) return [];
50
- const { renderKinds } = await import("./gen-CNYlckFE.js");
50
+ const { renderKinds } = await import("./gen-tTRu05jZ.js");
51
51
  const files = await renderKinds({
52
52
  cwd: source.cwd,
53
53
  config: source.config,
@@ -0,0 +1 @@
1
+ export { n as renderKinds } from "./gen-CZB21YVB.js";
@@ -1,8 +1,8 @@
1
1
  import { t as defineLeaf } from "./command-9GAzSI7E.js";
2
2
  import { n as CliError } from "./errors-DgLOqc6j.js";
3
3
  import { c as generateFlags, f as policyFlag, i as dryRunFlag, n as dbUrl, r as dbUrlFlags, t as checkFlag } from "./flags-DQzNPxg1.js";
4
- import { t as executeGenerate } from "./execute-CUGaCy_9.js";
5
- import { n as receiptRows } from "./pipeline-DGFc6y6x.js";
4
+ import { t as executeGenerate } from "./execute-D6FFwdwW.js";
5
+ import { n as receiptRows } from "./pipeline-BTsmCn1p.js";
6
6
  // src/cli/commands/generate.ts
7
7
  function concurrencyFlag(value) {
8
8
  if (value === void 0 || value === "") return;
@@ -24,7 +24,7 @@ const generate = defineLeaf({
24
24
  const db = await dbUrl(ctx, flags);
25
25
  const policy = flags.policy !== void 0 && flags.policy !== "" ? flags.policy : ctx.config.policy;
26
26
  if (flags.watch) {
27
- const { watchGenerate } = await import("./watch-CkL1iuKJ.js");
27
+ const { watchGenerate } = await import("./watch-DEPXy-r0.js");
28
28
  return watchGenerate(ctx, {
29
29
  ...policy === void 0 ? {} : { policy },
30
30
  only: flags.only,
@@ -1,38 +1,38 @@
1
1
  import { c as listPermissions, u as renamedKeys } from "./permission-registry-DstT40VS.js";
2
2
  import { n as policyRowConditionKeys, t as grantHasRowConditions } from "./row-conditions-BjARoFLU.js";
3
3
  import { a as describeError, i as configError, o as exitCodeOfError } from "./errors-DgLOqc6j.js";
4
- import { i as withSchemaDefaults } from "./schema-tables-Ba9LE_XB.js";
4
+ import { i as withSchemaDefaults } from "./schema-tables-CqEHokUT.js";
5
5
  import { r as isRecord, t as compact } from "./compact-C4LFuqbW.js";
6
6
  import { n as supabaseDir } from "./supabase-dir-0lxKbrYu.js";
7
7
  import { a as parseSqlFile, f as stringValues, g as statementRanges, l as readRelation, m as splitUndiffed, o as parseSqlLenient, t as SqlSyntaxError } from "./ast-Dnm2TOHN.js";
8
8
  import { n as loadBsbSql, r as schemaSqlFiles } from "./bsb-access-Bcw6GrQm.js";
9
- import { D as seedSql, F as guardAuthAdminGrants, I as unguardAuthAdminGrants, S as accessSql, T as helpersSql, Z as closureBackfillSql, c as permissionHelpersSql, d as permittedByPermissionHelper, i as tableNames, o as PERMISSION_HELPERS, r as tableNameOf, s as checkName, tt as graphSql, u as permissionKeysHelper } from "./tables-E-dIHUN_.js";
9
+ import { D as seedSql, F as guardAuthAdminGrants, I as unguardAuthAdminGrants, S as accessSql, T as helpersSql, Z as closureBackfillSql, c as permissionHelpersSql, d as permittedByPermissionHelper, i as tableNames, o as PERMISSION_HELPERS, r as tableNameOf, s as checkName, tt as graphSql, u as permissionKeysHelper } from "./tables-Dr4BUH9i.js";
10
10
  import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
11
- import { a as tableFor, d as pruneIndexTargets, f as readTableIndexFacts, i as inferredCommand, l as indexTargets, r as compileGrants, u as indexesSql } from "./compile-BWOrvhGt.js";
12
- import { a as CANDIDATES, c as rowHelpersSql, i as buildContext, l as rowSetSql, n as isRefusal, o as inheritTargets, r as splitsPart, s as levelKeys, t as generateOptions } from "./generate-options-eMjRViev.js";
13
- import { t as policyFromCatalog } from "./policy-from-catalog-BohzTN3J.js";
14
- import { t as fetchProjectPolicy } from "./pull-C851tQak.js";
15
- import { c as requirePolicy } from "./load-m7jmit3y.js";
16
- import { o as nonEmptyOr } from "./output-ONUzppLo.js";
11
+ import { a as tableFor, d as pruneIndexTargets, f as readTableIndexFacts, i as inferredCommand, l as indexTargets, r as compileGrants, u as indexesSql } from "./compile-CeaX5VD-.js";
12
+ import { a as CANDIDATES, c as rowHelpersSql, i as buildContext, l as rowSetSql, n as isRefusal, o as inheritTargets, r as splitsPart, s as levelKeys, t as generateOptions } from "./generate-options-Bq5qQ9H7.js";
13
+ import { t as policyFromCatalog } from "./policy-from-catalog-hECiBs9M.js";
14
+ import { t as fetchProjectPolicy } from "./pull-CEv7O_zQ.js";
15
+ import { c as requirePolicy } from "./load-D03A3tZL.js";
16
+ import { o as nonEmptyOr } from "./output-yUW7fcAk.js";
17
17
  import { i as INDEXES_MARKER, n as GRANTS_MARKER, o as SEEDS_MARKER, t as BACKFILL_MARKER } from "./markers-C-kThnKN.js";
18
- import { S as scopeTable, h as memberIdsHelper, i as graphSqlName, r as graphHelper, t as BOOTSTRAP_PERMISSIONS, x as scopeSources, y as permittedIdsHelper } from "./names-DwGleRKB.js";
19
- import { a as quoteIdent, c as quoteTable, i as qualified$1, o as quoteLiteral, s as quoteQualified } from "./quote-LNaBdCGA.js";
20
- import { b as idTypeOf, f as subjectIdSql, l as sessionLiveHelperSql, t as SESSION_LIVE_HELPER, u as subjectClaimJsonSql, x as scopeTypeOf } from "./subject-B7p94Y0s.js";
21
- import { a as supabaseHookSql, c as asideAuthzReceive, d as declarativeSql, t as grantsLabel, u as approvalsSql } from "./hook-sql-BQcxbOzi.js";
22
- import { i as assignmentSql, n as ownershipSql } from "./ownership-CCgncSLb.js";
23
- import { r as rebuildPlan, t as DROPPED_LIST } from "./custom-role-rebuild-BwM6hBqt.js";
18
+ import { S as scopeTable, h as memberIdsHelper, i as graphSqlName, r as graphHelper, t as BOOTSTRAP_PERMISSIONS, x as scopeSources, y as permittedIdsHelper } from "./names-zCkaCepO.js";
19
+ import { a as quoteIdent, c as quoteTable, i as qualified$1, o as quoteLiteral, s as quoteQualified } from "./quote-BX3DDoTX.js";
20
+ import { b as idTypeOf, f as subjectIdSql, l as sessionLiveHelperSql, t as SESSION_LIVE_HELPER, u as subjectClaimJsonSql, x as scopeTypeOf } from "./subject-CMkc28eP.js";
21
+ import { a as supabaseHookSql, c as asideAuthzReceive, d as declarativeSql, t as grantsLabel, u as approvalsSql } from "./hook-sql-Dys1kW5p.js";
22
+ import { i as assignmentSql, n as ownershipSql } from "./ownership-Bx_s_E8i.js";
23
+ import { r as rebuildPlan, t as DROPPED_LIST } from "./custom-role-rebuild-DzbBD1cq.js";
24
24
  import { p as scopeField } from "./tenancy-B5Xxt9Sc.js";
25
- import { c as breakGlassKey, i as rbacScaffold, l as collectGrants, s as breakGlassHolder } from "./rbac-ByuGspKZ.js";
25
+ import { c as breakGlassKey, i as rbacScaffold, l as collectGrants, s as breakGlassHolder } from "./rbac-COexzCC9.js";
26
26
  import { t as supautilsRejections } from "./supautils-ym4X20ig.js";
27
- import { a as fieldViewsSql, c as ACTOR_MAY_WRITE, d as assemblePolicies, i as fieldViews, l as actorMayWriteCall, m as readOnlyActorPolicies, n as columnGrantSql, o as rowBranches, p as readOnlyActorKinds, r as columnRevokeSql, u as actorMayWriteSql } from "./fields-CKX-qjWb.js";
27
+ import { a as fieldViewsSql, c as ACTOR_MAY_WRITE, d as assemblePolicies, i as fieldViews, l as actorMayWriteCall, m as readOnlyActorPolicies, n as columnGrantSql, o as rowBranches, p as readOnlyActorKinds, r as columnRevokeSql, u as actorMayWriteSql } from "./fields-DWAwA8vX.js";
28
28
  import { l as isFieldRelation } from "./resource-relations-Ck5sjYQR.js";
29
29
  import { c as rootScope } from "./scopes-B-KX9EI8.js";
30
- import { o as rootName, r as HELPERS, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
31
- import { n as permissionHoldersSql } from "./resolve-names-DmX503uX.js";
30
+ import { o as rootName, r as HELPERS, t as CUSTOM_ROLES } from "./shared-BRLAQqj4.js";
31
+ import { n as permissionHoldersSql } from "./resolve-names-ybewcnpW.js";
32
32
  import { n as byKey } from "./compare-8SNJN-9U.js";
33
33
  import { i as dateAt } from "./time-r0CKBm57.js";
34
34
  import { _ as writeOutputFiles, a as isSeedsDirectory, d as pgDeltaPath, g as underSchemaDir, h as serviceRel, l as parseSplit, m as seedsMigration, n as dataMigrationFile, p as seedDeltaNote, r as driftOf, u as partPath } from "./output-files-8lfALMSU.js";
35
- import { c as readSupabaseConfig, n as resolveSchemas } from "./supabase-schemas-D6ezN5Ln.js";
35
+ import { c as readSupabaseConfig, n as resolveSchemas } from "./supabase-schemas-RPYfnE6O.js";
36
36
  import { o as sqlFiles } from "./files-DAR51W3J.js";
37
37
  import { n as MIGRATION_DIRS } from "./constants-PCJiir_3.js";
38
38
  import { readFileSync } from "node:fs";
@@ -8,20 +8,20 @@ import "./budget-BH81q2cj.js";
8
8
  import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
9
9
  import { t as membershipSourcesOf } from "./sources-BbSUNmFX.js";
10
10
  import { a as scopeMembershipTable, i as scopeColumn } from "./compile-BUKXrueE.js";
11
- import "./sources-C6Id63F8.js";
12
- import { a as quoteIdent, c as quoteTable, i as qualified, o as quoteLiteral, s as quoteQualified } from "./quote-LNaBdCGA.js";
11
+ import "./sources-DNVEyJxb.js";
12
+ import { a as quoteIdent, c as quoteTable, i as qualified, o as quoteLiteral, s as quoteQualified } from "./quote-BX3DDoTX.js";
13
13
  import { l as parseSplit } from "./output-files-8lfALMSU.js";
14
- import { f as orSql, g as branchClauses } from "./fields-CKX-qjWb.js";
15
- import { b as idTypeOf, f as subjectIdSql, g as parseMembershipsFlag, n as USER_ID_HELPER, x as scopeTypeOf, y as firstScopeType } from "./subject-B7p94Y0s.js";
16
- import { a as customRolesOn, r as HELPERS, s as signedIn, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
17
- import { R as raiseSql, a as interactiveOnlyKeys, c as memoUserSql, g as memoHitList, q as checkSuspension, v as memoizedSetofSql, y as memoizes } from "./interactive-only-C9NQJXpi.js";
18
- import { i as graphSqlName } from "./names-DwGleRKB.js";
19
- import { $ as graphIdsSql, B as apiKeyClaimSql, E as memoReadsSql, H as apiKeyUnlimitedSql, N as tokenScopesPlan, O as TOKEN_SCOPE_ALLOWS, P as memoReadTriggersSql, Q as closureDepths, R as API_KEY_ALLOWS, U as apiKeysPlan, a as tablelessResources, d as permittedByPermissionHelper, et as graphPlan, i as tableNames, j as tokenScopeUnlimitedSql, k as isTokenScopesSetting, n as resolveVias, o as PERMISSION_HELPERS, t as checkSharedTables } from "./tables-E-dIHUN_.js";
20
- import { t as resolveNames } from "./resolve-names-DmX503uX.js";
21
- import { a as resolveAuthorize, o as assignableRoles, u as roleNames } from "./rbac-ByuGspKZ.js";
22
- import { a as tableFor } from "./compile-BWOrvhGt.js";
23
- import { r as rebuildPlan, t as DROPPED_LIST } from "./custom-role-rebuild-BwM6hBqt.js";
24
- import { r as unsatisfiedKinds, t as ownershipRules } from "./ownership-CCgncSLb.js";
14
+ import { f as orSql, g as branchClauses } from "./fields-DWAwA8vX.js";
15
+ import { b as idTypeOf, f as subjectIdSql, g as parseMembershipsFlag, n as USER_ID_HELPER, x as scopeTypeOf, y as firstScopeType } from "./subject-CMkc28eP.js";
16
+ import { a as customRolesOn, r as HELPERS, s as signedIn, t as CUSTOM_ROLES } from "./shared-BRLAQqj4.js";
17
+ import { R as raiseSql, a as interactiveOnlyKeys, c as memoUserSql, g as memoHitList, q as checkSuspension, v as memoizedSetofSql, y as memoizes } from "./interactive-only-ek-Kf0Kq.js";
18
+ import { i as graphSqlName } from "./names-zCkaCepO.js";
19
+ import { $ as graphIdsSql, B as apiKeyClaimSql, E as memoReadsSql, H as apiKeyUnlimitedSql, N as tokenScopesPlan, O as TOKEN_SCOPE_ALLOWS, P as memoReadTriggersSql, Q as closureDepths, R as API_KEY_ALLOWS, U as apiKeysPlan, a as tablelessResources, d as permittedByPermissionHelper, et as graphPlan, i as tableNames, j as tokenScopeUnlimitedSql, k as isTokenScopesSetting, n as resolveVias, o as PERMISSION_HELPERS, t as checkSharedTables } from "./tables-Dr4BUH9i.js";
20
+ import { t as resolveNames } from "./resolve-names-ybewcnpW.js";
21
+ import { a as resolveAuthorize, o as assignableRoles, u as roleNames } from "./rbac-COexzCC9.js";
22
+ import { a as tableFor } from "./compile-CeaX5VD-.js";
23
+ import { r as rebuildPlan, t as DROPPED_LIST } from "./custom-role-rebuild-DzbBD1cq.js";
24
+ import { r as unsatisfiedKinds, t as ownershipRules } from "./ownership-Bx_s_E8i.js";
25
25
  // src/cli/rls/custom-role-sync.ts
26
26
  /**
27
27
  * `rls.customRoles.from.sync: 'trigger'`: after-row triggers on the legacy
package/dist/h3/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-DPEAu_jM.js";
2
- import { i as decorate } from "../bind-BNYcJ1D9.js";
3
- import { t as fetchAdapter } from "../fetch-adapter-dmABnF7F.js";
2
+ import { i as decorate } from "../bind-CFwfgfp2.js";
3
+ import { t as fetchAdapter } from "../fetch-adapter-niRAPzNm.js";
4
4
  // src/h3/create.ts
5
5
  function createPermDock(policy, options) {
6
6
  const adapter = fetchAdapter(policy, options, "h3", (event) => event.req);
@@ -1,6 +1,6 @@
1
1
  import { t as beforeFirst } from "./text-D704xHVl.js";
2
2
  import { a as parseSqlFile, c as readPolicy, t as SqlSyntaxError } from "./ast-Dnm2TOHN.js";
3
- import { r as HELPERS } from "./shared-DnVY767H.js";
3
+ import { r as HELPERS } from "./shared-BRLAQqj4.js";
4
4
  import { deparse } from "pgsql-parser";
5
5
  // src/cli/sql/helper-calls.ts
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-DPEAu_jM.js";
2
2
  import { t as compact } from "../compact-C4LFuqbW.js";
3
3
  import { r as PermDockRevokedError } from "../errors-DOSkVeTC.js";
4
- import { r as bindKernel } from "../bind-BNYcJ1D9.js";
4
+ import { r as bindKernel } from "../bind-CFwfgfp2.js";
5
5
  import { t as problemFromError } from "../map-error-DYQbf-3Q.js";
6
6
  import { a as onRevoked, n as closeReason, r as guardIterable, t as POLICY_VIOLATION } from "../stream-DdF94h7T.js";
7
7
  import { Hono } from "hono";
@@ -8,24 +8,24 @@ import { a as SUPABASE_MANIFEST_SCHEMA } from "./version-D-jWyJb9.js";
8
8
  import { t as CUSTOM_ROLES_VERSION_CLAIM } from "./budget-BH81q2cj.js";
9
9
  import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
10
10
  import { t as membershipSourcesOf } from "./sources-BbSUNmFX.js";
11
- import { a as hookApiNames, d as keptKeys, t as AUTHZ_VERSION_TABLE } from "./sources-C6Id63F8.js";
11
+ import { a as hookApiNames, d as keptKeys, t as AUTHZ_VERSION_TABLE } from "./sources-DNVEyJxb.js";
12
12
  import { r as REGISTERED_CLAIMS } from "./definition-options-DLBlRrPO.js";
13
13
  import { t as beforeFirst } from "./text-D704xHVl.js";
14
14
  import { n as GRANTS_MARKER, r as HOOK_MARKER } from "./markers-C-kThnKN.js";
15
- import { a as quoteIdent, c as quoteTable, i as qualified$1, o as quoteLiteral, s as quoteQualified } from "./quote-LNaBdCGA.js";
15
+ import { a as quoteIdent, c as quoteTable, i as qualified$1, o as quoteLiteral, s as quoteQualified } from "./quote-BX3DDoTX.js";
16
16
  import "./output-files-8lfALMSU.js";
17
17
  import { m as splitUndiffed } from "./ast-Dnm2TOHN.js";
18
- import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-CKX-qjWb.js";
19
- import { C as tenantTypeOf, S as sqlType, f as subjectIdSql, n as USER_ID_HELPER, w as userTypeOf, x as scopeTypeOf, y as firstScopeType } from "./subject-B7p94Y0s.js";
20
- import { a as customRolesOn, r as HELPERS, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
21
- import { G as activeRowSql, N as globalRoleSource, a as interactiveOnlyKeys, q as checkSuspension, t as INTERACTIVE_ALLOWS } from "./interactive-only-C9NQJXpi.js";
22
- import { f as memberForHelper, g as memberOfHelper, h as memberIdsHelper, t as BOOTSTRAP_PERMISSIONS, u as isTeamScope, v as permittedForHelper, y as permittedIdsHelper } from "./names-DwGleRKB.js";
23
- import { G as hookTeamReader, K as hookTeamsHelper, M as tokenScopesOn, O as TOKEN_SCOPE_ALLOWS, R as API_KEY_ALLOWS, V as apiKeyFields, W as HOOK_TEAM_READER, b as ASSIGNMENTS, d as permittedByPermissionHelper, l as permissionKeysForHelper, o as PERMISSION_HELPERS, s as checkName, x as OWNERSHIP } from "./tables-E-dIHUN_.js";
24
- import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-DmX503uX.js";
25
- import { a as resolveAuthorize, n as hookUri, t as authAdminRead } from "./rbac-ByuGspKZ.js";
26
- import { a as guardedTables, t as ownershipRules } from "./ownership-CCgncSLb.js";
27
- import { a as REQUEST_APPROVER_IDS, c as MANAGES, d as checkedManagers, l as MANAGES_FOR, o as approvalChainSql, p as managerEdges, s as APPROVES, u as approvalManagersSql } from "./approval-chain-BEeExHpb.js";
28
- import { a as hookMemberships, c as typedSourceUsers, i as entriesSql, l as typedUsers, n as activeSource, o as memberForPlan, r as checkSources, s as positiveInteger, t as activeFromSql } from "./memberships-CDiSsFTu.js";
18
+ import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-DWAwA8vX.js";
19
+ import { C as tenantTypeOf, S as sqlType, f as subjectIdSql, n as USER_ID_HELPER, w as userTypeOf, x as scopeTypeOf, y as firstScopeType } from "./subject-CMkc28eP.js";
20
+ import { a as customRolesOn, r as HELPERS, t as CUSTOM_ROLES } from "./shared-BRLAQqj4.js";
21
+ import { G as activeRowSql, N as globalRoleSource, a as interactiveOnlyKeys, q as checkSuspension, t as INTERACTIVE_ALLOWS } from "./interactive-only-ek-Kf0Kq.js";
22
+ import { f as memberForHelper, g as memberOfHelper, h as memberIdsHelper, t as BOOTSTRAP_PERMISSIONS, u as isTeamScope, v as permittedForHelper, y as permittedIdsHelper } from "./names-zCkaCepO.js";
23
+ import { G as hookTeamReader, K as hookTeamsHelper, M as tokenScopesOn, O as TOKEN_SCOPE_ALLOWS, R as API_KEY_ALLOWS, V as apiKeyFields, W as HOOK_TEAM_READER, b as ASSIGNMENTS, d as permittedByPermissionHelper, l as permissionKeysForHelper, o as PERMISSION_HELPERS, s as checkName, x as OWNERSHIP } from "./tables-Dr4BUH9i.js";
24
+ import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-ybewcnpW.js";
25
+ import { a as resolveAuthorize, n as hookUri, t as authAdminRead } from "./rbac-COexzCC9.js";
26
+ import { a as guardedTables, t as ownershipRules } from "./ownership-Bx_s_E8i.js";
27
+ import { a as REQUEST_APPROVER_IDS, c as MANAGES, d as checkedManagers, l as MANAGES_FOR, o as approvalChainSql, p as managerEdges, s as APPROVES, u as approvalManagersSql } from "./approval-chain-e4HcSs3o.js";
28
+ import { a as hookMemberships, c as typedSourceUsers, i as entriesSql, l as typedUsers, n as activeSource, o as memberForPlan, r as checkSources, s as positiveInteger, t as activeFromSql } from "./memberships-DaKwjhc5.js";
29
29
  import { r as tableKey, t as decidingColumns } from "./deciding-columns-DBZsrpdD.js";
30
30
  // src/cli/claims-schema.ts
31
31
  /**
@@ -6,7 +6,7 @@ import { t as applyFiles } from "./files-DuV7wRim.js";
6
6
  import { n as httpRequest } from "./http-BbX_Ou3_.js";
7
7
  import { i as readJsonFile } from "./files-DAR51W3J.js";
8
8
  import { i as schemaExpression, t as emitPermissionsModule } from "./generate-5_kz2309.js";
9
- import { t as validateOpenapi } from "./schema-DJd7Gq_p.js";
9
+ import { t as validateOpenapi } from "./schema-Bk0R_6ul.js";
10
10
  import { existsSync, readFileSync } from "node:fs";
11
11
  import { resolve } from "node:path";
12
12
  // src/cli/openapi/import.ts
@@ -3,12 +3,12 @@ import { s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
3
3
  import { n as emptySchema, r as isSchemaKind, t as emitPermissionsModule } from "./generate-5_kz2309.js";
4
4
  import { r as pgConnector } from "./pg-DmS5ITHu.js";
5
5
  import { a as parseSqlFile, c as readPolicy, t as SqlSyntaxError } from "./ast-Dnm2TOHN.js";
6
- import { g as parseMembershipsFlag } from "./subject-B7p94Y0s.js";
6
+ import { g as parseMembershipsFlag } from "./subject-CMkc28eP.js";
7
7
  import { u as isSqlFunctionField } from "./refs-Cix9Zjis.js";
8
8
  import { r as escapeSqlIdent, s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
9
- import { r as HELPERS } from "./shared-DnVY767H.js";
9
+ import { r as HELPERS } from "./shared-BRLAQqj4.js";
10
10
  import { r as isRecord } from "./compact-C4LFuqbW.js";
11
- import { t as FIELD_VIEWS } from "./fields-CKX-qjWb.js";
11
+ import { t as FIELD_VIEWS } from "./fields-DWAwA8vX.js";
12
12
  import { existsSync, readFileSync } from "node:fs";
13
13
  import { resolve } from "node:path";
14
14
  import { createHash } from "node:crypto";
@@ -111,7 +111,7 @@ declare function customRoleClaim(roles: readonly CustomRole[], policy?: Policy):
111
111
  */
112
112
  declare function parseSnapshot(json: unknown): Snapshot;
113
113
  declare function emptySnapshot(): Snapshot;
114
- declare function fromSnapshot(input: Snapshot, options?: {
114
+ interface FromSnapshotOptions {
115
115
  readonly tenant?: string;
116
116
  readonly team?: string;
117
117
  /** The `clientBundle(policy)` of a snapshot built with `omitStatic`. */
@@ -122,7 +122,8 @@ declare function fromSnapshot(input: Snapshot, options?: {
122
122
  * nothing.
123
123
  */
124
124
  readonly customRoles?: readonly CustomRoleRecord[];
125
- }): PermDock;
125
+ }
126
+ declare function fromSnapshot(input: Snapshot, options?: FromSnapshotOptions): PermDock;
126
127
  declare function requiresApproval(approval: Grant["approval"] | undefined): boolean;
127
128
  declare function definePolicy<TUser, TPrincipal extends Principal, const Input extends PermissionTree | PolicyVocabulary, const S extends PolicyScopesInput = PolicyScopesInput>(permissions: Input, options: PolicyOptions<TUser, TPrincipal, S>): Policy<TUser, TPrincipal, VocabularyFromInput<Input>, S>;
128
129
  /**
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { $n as inherit, $t as LocalRowColumn, A as PolicyOAuthScope, An as PolicyScopesInput, Ar as Subject, At as parseSupportSession, B as SupportAccessOptions, Bn as allOf, Bt as DecideCredentialOptions, C as GrantValidity, Cn as DirectoryEvent, Cr as CustomRoleGrant, Ct as WhereCompiler, D as Policy, Dn as WireDecision, Dr as Membership, Dt as SupportSessionPolicy, E as ObligationInput, En as SinkEvent, Et as SupportSessionDecision, F as RoleBinding, Fn as Approver, Fr as Condition, Ft as CredentialPermission, G as CredentialVerifier, Gn as Grantee, Gr as SqlFunctionCondition, Gt as parseCredential, H as ValidateMode, Hn as holder, Hr as RelatedHop, Ht as credentialPolicyViolation, I as RoleOptions, In as ApproverInput, Ir as ConditionRef, It as CredentialPermissionInput, J as CustomRoleSourceFactory, Jn as RelationGrantee, Jr as isConditionDate, Jt as ClientBundle, K as CustomRoleContext, Kn as GranteeInput, Kr as hasConditionOp, L as RoleScope, Ln as ManagerApprover, Lr as ConditionValue, Lt as CredentialPolicy, M as PolicyScopes, Mn as ScopeDeclaration, Mr as ActorKind, Mt as Credential, Nn as ScopeNames, Nr as AdapterId, Nt as CredentialDecision, O as PolicyAppDataSchemas, On as WireDenial, Or as Principal, Ot as SupportSessionRequest, P as PrincipalOf, Pn as AnyOfApprover, Pr as MembershipVia, Pt as CredentialKind, Q as Intent, Qn as authenticated, Qt as LocalMembershipRows, R as SeparationConflict, Rn as PermissionApprover, Rr as MemberOfCondition, Rt as CredentialPolicyViolation, S as GrantScope, Sn as DeliveryFailureCause, Sr as CustomRole, St as VersionQuery, T as MembershipFixture, Tn as MembershipEvent, Tr as GnapAccess, Tt as SupportSession, Un as manager, Ur as RestrictedAncestors, Ut as decideCredential, V as SupportConsent, Vn as anyOf, Vr as RelatedCondition, Vt as credentialDelegation, W as WireValidity, Wn as user, Wr as SqlFunctionArg, Wt as isFeedId, X as DecisionSink, Xn as anyone, Xr as isSqlFunctionField, Xt as ExpandedSnapshot, Y as DecisionProvider, Yn as actor, Yr as isConditionRef, Yt as CustomRoleRecord, Z as EntitlementSource, Zn as assurance, Zt as LocalCustomRoleTable, _ as Grant, _n as AutomationEvent, _r as TraceSkipReason, _t as TokenSigner, a as ApprovalMode, an as SnapshotCustom, ar as Denial, at as RelationChain, b as GrantMeta, bn as DeliveryChannel, br as AuthorizationDetail, bt as VerifiedToken, c as ApprovalStage, cn as SnapshotGrantTerms, cr as DeniedDecision, ct as RelationSource, d as BreakGlassRequirements, dn as SnapshotScope, dr as LimitDetail, dt as SourceCall, en as LocalRowValue, er as plan, et as LimitConsumeInput, f as BreakGlassSpec, fn as SnapshotStatic, fr as MatchedGrant, ft as SourceContext, g as DelegationTarget, gn as AuthEvent, gr as TraceSkip, gt as TokenFailureCause, h as DelegationInput, hn as AccessEvent, hr as Trace, ht as TenantSettings, i as ApprovalFallback, in as SnapshotAssignable, ir as Decision, it as MembershipSource, jn as Scope, jr as VerifiedClaims, jt as ApiKeyPrincipal, k as PolicyDelegation, kr as SharedCustomRole, kt as decideSupportSession, l as AssuranceRequirement, ln as SnapshotListRef, lr as ExplainedDecision, lt as SettingsSource, m as ClosureGrantFn, mn as SnapshotWireAssignable, mr as Quota, mt as SubjectResolver, n as ApprovalCombine, nn as LocalSnapshotRows, nr as AppObligation, nt as LimitStore, o as ApprovalOption, on as SnapshotGrant, or as DenialDetails, ot as RelationGroup, p as ClosureContext, pn as SnapshotTenants, pr as Obligation, pt as SourceMemo, q as CustomRoleSource, qn as InheritGrantee, qr as isCondition, r as ApprovalEscalation, rn as Snapshot, rr as ApprovalRequiredDecision, rt as MemberEntry, s as ApprovalRequirement, sn as SnapshotGrantRef, sr as DenialReason, st as RelationHolder, t as ActivationOption, tn as LocalSnapshotManifest, tr as relation, tt as LimitRemaining, u as BreakGlassOptions, un as SnapshotNotEntitled, ur as GrantedDecision, ut as SnapshotSource, v as GrantCondition, vn as CredentialEvent, vr as Actor, vt as TokenVerifier, w as HostedGrantRef, wn as EmailCategory, wr as Delegation, wt as DecideSupportSessionOptions, x as GrantOptions, xn as DeliveryEvent, xr as Binding, xt as VersionContext, y as GrantLimit, yn as DecisionEvent, yr as Assurance, yt as VerificationFailure, z as SubjectOf, zn as UserApprover, zr as MemberOfParent, zt as CredentialRequest } from "./policy-types-CRWqx8qf.js";
2
2
  import { A as ResourceInit, B as ResourceXTree, D as PermissionsOf, E as PermissionTree, F as ResourceOptions, G as RESOURCE_X, H as PERMISSION_ROW, I as ResourceParent, J as MetaValue, K as AppData, L as ResourceRelation, M as ResourceLink, N as ResourceMeta, O as PermissionsOptions, P as ResourceNode, R as ResourceRelationInput, S as FieldRelation, T as PermissionKind, U as POLICY_SCOPES, V as RowOf, W as RESOURCE_NAME, _ as ComputedRelation, a as RoleTree, b as EdgeMatch, c as definePlans, d as isPlan, f as isRole, g as ActionMeta, i as RoleMeta, j as ResourceLevel, k as PrincipalRelation, l as defineRoles, m as listRoles, n as PlanTree, o as Vocabulary, p as listPlans, q as AppDataSchema, r as Role, s as VocabularyOptions, t as Plan, u as findRole, v as EdgeGroup, w as Permission, x as EdgeRelation, y as EdgeGroups, z as ResourceRestricted } from "./vocabulary-DHfKPIC5.js";
3
- import { $ as resource, $t as memoryMembershipSource, A as RoleChangeCheckInput, An as validateCustomRole, At as SignSnapshotOptions, B as ActivateInput, Bt as whoCan, C as parseCatalogEventData, Cn as CustomRoleRename, Ct as arazzoFindings, D as parseSinkEvents, Dn as customRoleClaim, Dt as RuntimeCacheLike, E as parseSinkEvent, En as ValidateCustomRoleOptions, Et as QueryableLike, F as checkRoleChange, Ft as SignPolicyDocumentOptions, G as allow, Gt as stripeEntitlementSource, H as breakGlass, Ht as MemoryRelationSourceData, I as decideRoleChange, It as signPolicyDocument, J as role, Jt as countHolders, K as deny, Kt as claimsFirst, L as normalizeMembership, Lt as Holder, M as RoleChangeOptions, Mn as context, Mt as signSnapshot, N as RoleChangeTarget, Nn as principal, Nt as snapshotClaims, O as RoleChange, On as parseCustomRoleEntry, Ot as postgresCacheVersionStore, P as RoleRules, Pt as snapshotFromClaims, Q as formerKeys, Qt as memoryEntitlementSource, R as normalizeMemberships, Rt as HoldingVia, S as SINK_EVENT_SCHEMAS, Sn as CustomRoleEntry, St as ArazzoStepResult, T as parseCloudEventBatch, Tn as ResolvedCustomRole, Tt as deliveryEvent, U as supportAccess, Ut as memoryRelationSource, V as activate, Vt as MemoryEdge, W as normalizeApproval, Wt as StripeEntitlementsClient, X as readable, Xt as APPROVAL_POLICY_UNAVAILABLE, Y as crud, Yt as isExternallyManaged, Z as writable, Zt as memoryCustomRoleSource, _ as DECISION_EVENT_SCHEMA, _n as fromSnapshot, _t as customRoleRecord, a as catalogFingerprint, an as sqlFunction, at as CustomRoleReader, b as EVENT_SCHEMA_IDS, bn as CustomRoleDrop, bt as ArazzoPlan, c as OCSF_VERSION, cn as getResource, ct as CustomRoleDecision, d as accessToOcsf, dn as mergePermissions, dt as LegacyCheck, en as memorySettingsSource, et as definePermissions, f as toOcsf, fn as RoleNameOf, ft as ShadowMismatch, g as CREDENTIAL_EVENT_SCHEMA, gn as requiresApproval, gt as readSnapshot, h as CATALOG_EVENT_SCHEMA, hn as separationConflicts, ht as localSnapshotManifest, i as canonicalJson, in as accessOutcome, it as assignableFor, j as RoleChangeDecision, jn as claim, jt as SnapshotClaims, k as RoleChangeCheck, kn as resolveCustomRole, kt as runtimeCacheVersionStore, l as OcsfAuthorizeSession, ln as isPermission, lt as decideCustomRole, m as AUTOMATION_EVENT_SCHEMA, mn as isRoleName, mt as shadowMode, n as delegatedPermissions, nn as subjectMembershipSource, nt as snapshotFor, o as CSV_COLUMNS, on as opaque, ot as CustomRoleSourceOptions, p as ACCESS_EVENT_SCHEMA, pn as definePolicy, pt as ShadowOptions, q as normalizeAssurance, qt as composeMemberships, r as sha256Digest, rn as AccessOutcome, rt as AssignableForOptions, s as toCsvRow, sn as findPermission, st as customRoleSource, t as coveredByDelegation, tn as memorySnapshotSource, tt as SnapshotForOptions, u as OcsfUserManagement, un as listPermissions, ut as mayAccess, v as DELIVERY_EVENT_SCHEMA, vn as emptySnapshot, vt as clientBundle, w as parseCloudEvent, wn as CustomRoleValidation, wt as simulateArazzo, x as MEMBERSHIP_EVENT_SCHEMA, xn as CustomRoleDropReason, xt as ArazzoSimulateInput, y as DIRECTORY_EVENT_SCHEMA, yn as parseSnapshot, yt as ArazzoFinding, z as resolveScope, zt as WhoCan } from "./index-B1hyWi7O.js";
3
+ import { $ as resource, $t as memoryMembershipSource, A as RoleChangeCheckInput, An as validateCustomRole, At as SignSnapshotOptions, B as ActivateInput, Bt as whoCan, C as parseCatalogEventData, Cn as CustomRoleRename, Ct as arazzoFindings, D as parseSinkEvents, Dn as customRoleClaim, Dt as RuntimeCacheLike, E as parseSinkEvent, En as ValidateCustomRoleOptions, Et as QueryableLike, F as checkRoleChange, Ft as SignPolicyDocumentOptions, G as allow, Gt as stripeEntitlementSource, H as breakGlass, Ht as MemoryRelationSourceData, I as decideRoleChange, It as signPolicyDocument, J as role, Jt as countHolders, K as deny, Kt as claimsFirst, L as normalizeMembership, Lt as Holder, M as RoleChangeOptions, Mn as context, Mt as signSnapshot, N as RoleChangeTarget, Nn as principal, Nt as snapshotClaims, O as RoleChange, On as parseCustomRoleEntry, Ot as postgresCacheVersionStore, P as RoleRules, Pt as snapshotFromClaims, Q as formerKeys, Qt as memoryEntitlementSource, R as normalizeMemberships, Rt as HoldingVia, S as SINK_EVENT_SCHEMAS, Sn as CustomRoleEntry, St as ArazzoStepResult, T as parseCloudEventBatch, Tn as ResolvedCustomRole, Tt as deliveryEvent, U as supportAccess, Ut as memoryRelationSource, V as activate, Vt as MemoryEdge, W as normalizeApproval, Wt as StripeEntitlementsClient, X as readable, Xt as APPROVAL_POLICY_UNAVAILABLE, Y as crud, Yt as isExternallyManaged, Z as writable, Zt as memoryCustomRoleSource, _ as DECISION_EVENT_SCHEMA, _n as fromSnapshot, _t as customRoleRecord, a as catalogFingerprint, an as sqlFunction, at as CustomRoleReader, b as EVENT_SCHEMA_IDS, bn as CustomRoleDrop, bt as ArazzoPlan, c as OCSF_VERSION, cn as getResource, ct as CustomRoleDecision, d as accessToOcsf, dn as mergePermissions, dt as LegacyCheck, en as memorySettingsSource, et as definePermissions, f as toOcsf, fn as RoleNameOf, ft as ShadowMismatch, g as CREDENTIAL_EVENT_SCHEMA, gn as requiresApproval, gt as readSnapshot, h as CATALOG_EVENT_SCHEMA, hn as separationConflicts, ht as localSnapshotManifest, i as canonicalJson, in as accessOutcome, it as assignableFor, j as RoleChangeDecision, jn as claim, jt as SnapshotClaims, k as RoleChangeCheck, kn as resolveCustomRole, kt as runtimeCacheVersionStore, l as OcsfAuthorizeSession, ln as isPermission, lt as decideCustomRole, m as AUTOMATION_EVENT_SCHEMA, mn as isRoleName, mt as shadowMode, n as delegatedPermissions, nn as subjectMembershipSource, nt as snapshotFor, o as CSV_COLUMNS, on as opaque, ot as CustomRoleSourceOptions, p as ACCESS_EVENT_SCHEMA, pn as definePolicy, pt as ShadowOptions, q as normalizeAssurance, qt as composeMemberships, r as sha256Digest, rn as AccessOutcome, rt as AssignableForOptions, s as toCsvRow, sn as findPermission, st as customRoleSource, t as coveredByDelegation, tn as memorySnapshotSource, tt as SnapshotForOptions, u as OcsfUserManagement, un as listPermissions, ut as mayAccess, v as DELIVERY_EVENT_SCHEMA, vn as emptySnapshot, vt as clientBundle, w as parseCloudEvent, wn as CustomRoleValidation, wt as simulateArazzo, x as MEMBERSHIP_EVENT_SCHEMA, xn as CustomRoleDropReason, xt as ArazzoSimulateInput, y as DIRECTORY_EVENT_SCHEMA, yn as parseSnapshot, yt as ArazzoFinding, z as resolveScope, zt as WhoCan } from "./index-Cnrz9ChE.js";
4
4
  import { a as OperationInput, c as defineOperations, d as isOperationRisk, i as OperationEffect, l as OPERATION_RISKS, n as OperationData, o as OperationMap, r as OperationDefinition, s as OperationMeta, t as Operation, u as OperationRisk } from "./operations-DaEoGpMV.js";
5
5
  import { A as InstanceCacheStats, B as ApprovalPolicyValidation, C as Limits, D as InstanceCache, E as CustomRoleOwner, F as PermissionState, H as memoryApprovalPolicySource, I as ApprovalPolicies, L as ApprovalPolicy, M as GrantedPermissionsOptions, N as isGlobalPermission, O as InstanceCacheKey, P as PermissionCheck, R as ApprovalPolicyProblem, S as PermittedScopeIdsOptions, T as memoryLimitStore, U as validateApprovalPolicy, V as approvalPolicies, _ as PrincipalIdentityLink, a as PermDock, b as MembershipFilter, c as RowPair, d as UncheckedData, f as WhereOptions, g as PrincipalIdentity, h as getPermDockSync, i as LoadedRows, j as instanceCache, k as InstanceCacheOptions, l as SimulateOptions, m as getPermDock, n as DecideOptions, o as PermDockOptions, p as WhereResult, r as DeriveOptions, s as RowData, t as DecideIdsOptions, u as SnapshotOptions, v as PrincipalSource, w as limits, x as PermittedIdsOptions, y as memoryPrincipalSource, z as ApprovalPolicySource } from "./permdock-NJ4-pCZy.js";
6
6
  import { d as memoryPolicySource, f as mergeHostedGrants, i as HostedGrantDropped, l as hostedPolicies, m as policyDocumentFromClaims, o as PolicyDocument, p as parsePolicyDocument, r as HostedGrantDropReason, s as PolicySource, t as HostedGrant, u as isPortableCondition } from "./hosted-Cl7q35D-.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as isConditionDate, i as principal, l as isConditionRef, n as context, o as hasConditionOp, s as isCondition, t as claim, u as isSqlFunctionField } from "./refs-Cix9Zjis.js";
2
2
  import { a as deny, m as opaque, n as role, r as allow, t as normalizeAssurance } from "./role-builder-BksM3Q9O.js";
3
- import { A as memoryCustomRoleSource, C as signPolicyDocument, E as approvalPolicies, F as subjectMembershipSource, I as accessOutcome, L as sqlFunction, M as memoryMembershipSource, N as memorySettingsSource, O as memoryApprovalPolicySource, P as memorySnapshotSource, S as runtimeCacheVersionStore, T as stripeEntitlementSource, _ as localSnapshotManifest, a as normalizeMembership, b as simulateArazzo, c as crud, d as snapshotFor, f as assignableFor, g as shadowMode, h as mayAccess, i as decideRoleChange, j as memoryEntitlementSource, k as validateApprovalPolicy, l as readable, m as decideCustomRole, n as toCsvRow, o as normalizeMemberships, p as customRoleSource, r as checkRoleChange, s as resolveScope, t as CSV_COLUMNS, u as writable, v as customRoleRecord, w as memoryRelationSource, x as postgresCacheVersionStore, y as arazzoFindings } from "./src-10d_jun2.js";
3
+ import { A as memoryCustomRoleSource, C as signPolicyDocument, E as approvalPolicies, F as subjectMembershipSource, I as accessOutcome, L as sqlFunction, M as memoryMembershipSource, N as memorySettingsSource, O as memoryApprovalPolicySource, P as memorySnapshotSource, S as runtimeCacheVersionStore, T as stripeEntitlementSource, _ as localSnapshotManifest, a as normalizeMembership, b as simulateArazzo, c as crud, d as snapshotFor, f as assignableFor, g as shadowMode, h as mayAccess, i as decideRoleChange, j as memoryEntitlementSource, k as validateApprovalPolicy, l as readable, m as decideCustomRole, n as toCsvRow, o as normalizeMemberships, p as customRoleSource, r as checkRoleChange, s as resolveScope, t as CSV_COLUMNS, u as writable, v as customRoleRecord, w as memoryRelationSource, x as postgresCacheVersionStore, y as arazzoFindings } from "./src-DUWw9z1D.js";
4
4
  import { d as manager, f as user, n as anyOf, o as holder, t as allOf } from "./approvers-BkY_ZfWl.js";
5
5
  import { n as PermDockValidationError } from "./validation-error-CgDOA6VS.js";
6
6
  import { r as requiredPlans } from "./problem-details-EJHcvYCz.js";
@@ -15,7 +15,7 @@ import { t as requiresApproval } from "./approval-required-B-R4Yw3J.js";
15
15
  import { r as sha256Digest } from "./sha256-DFsnyVPo.js";
16
16
  import { t as approvalFingerprint } from "./token-CSljQqzA.js";
17
17
  import { n as parseSnapshot } from "./snapshot-Dzi4LR6n.js";
18
- import { n as getPermDockSync, p as clientBundle, t as getPermDock, v as isGlobalPermission } from "./permdock-CbavFN6u.js";
18
+ import { n as getPermDockSync, p as clientBundle, t as getPermDock, v as isGlobalPermission } from "./permdock-B0aE5Ime.js";
19
19
  import { r as parsePermDockDigest } from "./digest-BaP8bQzX.js";
20
20
  import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "./errors-DOSkVeTC.js";
21
21
  import { t as memoryRevocationFeed } from "./revocations-3jyzniOz.js";
@@ -28,14 +28,14 @@ import { a as hostedPolicies, c as mergeHostedGrants, l as parsePolicyDocument,
28
28
  import { n as isOperationRisk, t as OPERATION_RISKS } from "./operation-risks-BD-j14dj.js";
29
29
  import { t as defineOperations } from "./operations-dJxcshJZ.js";
30
30
  import { M as activate, N as breakGlass, O as validateCustomRole, P as supportAccess, R as APPROVAL_POLICY_UNAVAILABLE, T as resolveCustomRole, f as customRoleClaim, w as parseCustomRoleEntry } from "./evaluate-DNz6wMYv.js";
31
- import { _ as claimsFirst, b as isExternallyManaged, v as composeMemberships, y as countHolders } from "./instance-snapshot-D03srwnf.js";
31
+ import { _ as claimsFirst, b as isExternallyManaged, v as composeMemberships, y as countHolders } from "./instance-snapshot-BJam8gUa.js";
32
32
  import { n as memoryLimitStore, t as limits } from "./limits-DpTxX6N4.js";
33
33
  import { t as whoCan } from "./who-can-CIgYpEvy.js";
34
34
  import { a as snapshotFromClaims, i as snapshotClaims, n as signSnapshot } from "./membership-filter-Bz9QX6E9.js";
35
35
  import { i as instanceCache, n as memorySubjectCache, t as memoryVersionCache } from "./version-cache-l9Zrfvhz.js";
36
36
  import { t as deliveryEvent } from "./delivery-event-D5b9yhaJ.js";
37
37
  import { t as emptySnapshot } from "./snapshot-empty-pKgPDcLd.js";
38
- import { t as fromSnapshot } from "./from-snapshot-DZ4D2sLa.js";
38
+ import { t as fromSnapshot } from "./from-snapshot-O341Vdgj.js";
39
39
  import { t as parseLocalSnapshotManifest } from "./parse-local-manifest-CfMjZAFi.js";
40
40
  import { n as wrapPermDock } from "./wrap-CsfsaJhd.js";
41
41
  import { t as definePermissions } from "./permissions-DJ_QV9L7.js";
@@ -48,7 +48,7 @@ const init = defineLeaf({
48
48
  ...forceFlag
49
49
  },
50
50
  async run(ctx, { flags }) {
51
- const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-BQnRbzUb.js"), import("./peer-BWTpSLs2.js")]);
51
+ const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-yo4GJOkM.js"), import("./peer-BWTpSLs2.js")]);
52
52
  const agent = await packageManagerOf(ctx.cwd);
53
53
  const selection = {
54
54
  archetype: flags.archetype,
@@ -79,7 +79,7 @@ const presetDecode = defineLeaf({
79
79
  positionals: presetCode,
80
80
  flags: {},
81
81
  async run(_ctx, { args }) {
82
- const { runPreset } = await import("./init-BQnRbzUb.js");
82
+ const { runPreset } = await import("./init-yo4GJOkM.js");
83
83
  return runPreset("decode", args["code"] ?? "");
84
84
  }
85
85
  });
@@ -87,7 +87,7 @@ const presetUrl = defineLeaf({
87
87
  positionals: presetCode,
88
88
  flags: {},
89
89
  async run(_ctx, { args }) {
90
- const { runPreset } = await import("./init-BQnRbzUb.js");
90
+ const { runPreset } = await import("./init-yo4GJOkM.js");
91
91
  return runPreset("url", args["code"] ?? "");
92
92
  }
93
93
  });
@@ -1,7 +1,7 @@
1
1
  import { a as decodePreset, g as resolvePreset, i as presetFlags, n as generatePreset, o as encodePreset } from "./preset-BcFDaeqd.js";
2
2
  import { n as CliError } from "./errors-DgLOqc6j.js";
3
3
  import { t as applyFiles } from "./files-DuV7wRim.js";
4
- import { o as nonEmptyOr } from "./output-ONUzppLo.js";
4
+ import { o as nonEmptyOr } from "./output-yUW7fcAk.js";
5
5
  import { t as addLine } from "./peer-D77JpXe-.js";
6
6
  import { existsSync } from "node:fs";
7
7
  import { join } from "node:path";