permdock 0.27.3 → 0.28.1

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 (185) hide show
  1. package/dist/{2020-bJfT8aIA.js → 2020-DBXhfpuK.js} +2 -2
  2. package/dist/{adoption-scan-CHMU7gnE.js → adoption-scan-6eUACbvC.js} +1 -1
  3. package/dist/approvals/index.d.ts +1 -1
  4. package/dist/{arazzo-DuXmPMSu.js → arazzo-DSzOxgr1.js} +1 -1
  5. package/dist/{arazzo-D1ZHjjea.js → arazzo-Du3koIf5.js} +2 -2
  6. package/dist/{args-0EWFk-4S.js → args-Bc0HLiD4.js} +1 -1
  7. package/dist/better-supabase/index.d.ts +2 -0
  8. package/dist/better-supabase/index.js +8 -6
  9. package/dist/{casbin-Bf9jkDMy.js → casbin-B5UnU9nM.js} +1 -1
  10. package/dist/{casbin-CwLL5QnK.js → casbin-CW2uo-Jt.js} +1 -1
  11. package/dist/catalog/index.d.ts +1 -1
  12. package/dist/{catalog-B3MJShnZ.js → catalog-COoxFOoy.js} +1 -1
  13. package/dist/catalog-DCjJIl3n.js +1 -0
  14. package/dist/{catalog-DyC3LKc7.js → catalog-DXSP1we9.js} +1 -1
  15. package/dist/cli/bin.js +1 -1
  16. package/dist/cli/generate/watch-worker.js +1 -1
  17. package/dist/cli/index.d.ts +5 -4
  18. package/dist/cli/index.js +1 -1
  19. package/dist/cli/plugins/app.d.ts +1 -1
  20. package/dist/cli/plugins/app.js +1 -1
  21. package/dist/cli/plugins/better-supabase.d.ts +1 -1
  22. package/dist/cli/plugins/openapi.d.ts +1 -1
  23. package/dist/cli/plugins/openapi.js +1 -1
  24. package/dist/cli/plugins/powersync.d.ts +1 -1
  25. package/dist/cli/plugins/powersync.js +1 -1
  26. package/dist/cli/plugins/rls.d.ts +2 -2
  27. package/dist/cli/plugins/rls.js +1 -1
  28. package/dist/cli/plugins/schemas.d.ts +1 -1
  29. package/dist/cli/plugins/schemas.js +1 -1
  30. package/dist/cli/plugins/scim.d.ts +2 -2
  31. package/dist/cli/plugins/supabase-hook.d.ts +2 -2
  32. package/dist/cli/plugins/supabase-hook.js +1 -1
  33. package/dist/cli/plugins/supabase.d.ts +3 -3
  34. package/dist/cli/plugins/supabase.js +2 -2
  35. package/dist/cli/plugins/ui.d.ts +1 -1
  36. package/dist/cli/plugins/ui.js +1 -1
  37. package/dist/{cloud-nXogJ7e1.js → cloud-DhpR9oxl.js} +2 -2
  38. package/dist/{codemod-Bp2bKwKe.js → codemod-BRY1780A.js} +2 -2
  39. package/dist/{codemod-DwL1E5of.js → codemod-DEsebwQn.js} +2 -2
  40. package/dist/{collect-BJZsuBW4.js → collect-BOh9Pxob.js} +1 -1
  41. package/dist/{collect-CpGnmGpL.js → collect-BYPq-0JU.js} +2 -2
  42. package/dist/collect-XcoQRyiA.js +1 -0
  43. package/dist/{compile-NM1GOb2q.js → compile-CT7x66_U.js} +1 -1
  44. package/dist/{completion-BQovwoTx.js → completion-CW1poYOM.js} +2 -2
  45. package/dist/{config-DSyn7r1l.js → config-DP7Stalz.js} +1 -1
  46. package/dist/{config-report--ae2r_MI.js → config-report-CnuPIG_V.js} +2 -2
  47. package/dist/{context-DmH-Eyvx.js → context-BdoA9DhS.js} +2 -2
  48. package/dist/{core-DKqrD_xW.js → core-tEfD0lwu.js} +1 -1
  49. package/dist/delivery/index.d.ts +1 -1
  50. package/dist/{diff-BIqibFnm.js → diff-CXRZ6qPa.js} +1 -1
  51. package/dist/{diff-n6LONVwL.js → diff-Cv9inVY5.js} +1 -1
  52. package/dist/{doctor-CIV882xS.js → doctor-B3rZsURs.js} +3 -3
  53. package/dist/{doctor-kbRrZD3Q.js → doctor-CkaAS-Uk.js} +74 -27
  54. package/dist/{execute-CE8P72Ez.js → execute-CdqPJ6SP.js} +3 -3
  55. package/dist/{gen-CuEt0o6p.js → gen-DCmo0Irk.js} +3 -3
  56. package/dist/gen-DnaCR5w3.js +1 -0
  57. package/dist/{gen-kind-BLIhHgD3.js → gen-kind-10IxFLdl.js} +1 -1
  58. package/dist/{generate-B-Hlc08D.js → generate-BuNebxmi.js} +2 -2
  59. package/dist/{generate-Dl75LKbW.js → generate-CYUj-cvA.js} +11 -11
  60. package/dist/{generate-options-BUh621MW.js → generate-options-AvKV0IXA.js} +6 -6
  61. package/dist/{hook-sql-Bxc_YRrd.js → hook-sql-Cunsdk5x.js} +6 -5
  62. package/dist/{import-BKTq4cxW.js → import-CDCWY5Ou.js} +1 -1
  63. package/dist/{index-Cq9N5B92.d.ts → index-BSJoxaOi.d.ts} +1 -1
  64. package/dist/{index-BXz-XXC3.d.ts → index-D1msamx_.d.ts} +1 -1
  65. package/dist/{index-CVuc3E1O.d.ts → index-eaNHkELi.d.ts} +1 -1
  66. package/dist/index.d.ts +2 -2
  67. package/dist/index.js +1 -1
  68. package/dist/{init-B8GG9vjg.js → init-QA12XZy5.js} +3 -3
  69. package/dist/{init-D4YO8hVa.js → init-erhwH2o6.js} +1 -1
  70. package/dist/{json-schema-SDkWXxhu.d.ts → json-schema-DAeA-lJa.d.ts} +1 -1
  71. package/dist/{lazy-provider-CydlnKkS.d.ts → lazy-provider-C48LDq0q.d.ts} +1 -1
  72. package/dist/{lazy-provider-DG5rMeqL.js → lazy-provider-CVX534Kk.js} +1 -1
  73. package/dist/{login-OJdYkueH.js → login-BJmDn5p2.js} +3 -3
  74. package/dist/{login-Bl-SuTJA.js → login-OBqLmoA2.js} +1 -1
  75. package/dist/{manifest-BY8lK4l4.js → manifest-BY70KZmp.js} +35 -35
  76. package/dist/{migrate-CmTMk7rd.js → migrate-BwXtXUtE.js} +1 -1
  77. package/dist/next/index.d.ts +2 -2
  78. package/dist/next/plugin.d.ts +1 -1
  79. package/dist/next/plugin.js +1 -1
  80. package/dist/{openapi-Dpetebzt.js → openapi-B9Lpb4Px.js} +1 -1
  81. package/dist/{openapi-CvAjVdK7.js → openapi-DmEgZ9X8.js} +3 -3
  82. package/dist/{openapi-document-7K7rofeR.js → openapi-document-BJDwMJRO.js} +1 -1
  83. package/dist/{output-Cq0neio3.js → output-Cqtb8lW_.js} +1 -1
  84. package/dist/{output-files-DNid6TBl.js → output-files-D5D-8-4l.js} +1 -1
  85. package/dist/output-files-aPXXhV4q.js +1 -0
  86. package/dist/{ownership-CHND0y5L.js → ownership-fYxdtYs0.js} +1 -1
  87. package/dist/{permissions-ijDw4sO1.js → permissions-Bj3DRIEi.js} +1 -1
  88. package/dist/{plugin-1XW5OfAZ.d.ts → plugin-zOs9uqQj.d.ts} +1 -1
  89. package/dist/{policy-bundle-Dafv5nOx.js → policy-bundle-AFVba7nt.js} +3 -3
  90. package/dist/{policy-DzTU5233.js → policy-gS3zexF5.js} +1 -1
  91. package/dist/{powersync-BfMIjRqo.js → powersync-TraBGEw2.js} +1 -1
  92. package/dist/{powersync-IrDmJbqx.js → powersync-WvWQh2kU.js} +1 -1
  93. package/dist/{powersync-DNeS5JrT.js → powersync-d4eoYO3I.js} +6 -6
  94. package/dist/{prompt-CSXHcJxy.js → prompt-CPlJn_4-.js} +3 -3
  95. package/dist/{protected-action-D6T3eJyW.d.ts → protected-action-CEzNNtfi.d.ts} +2 -2
  96. package/dist/{protected-action-BMb0ftEu.js → protected-action-Dco5O_Kc.js} +1 -1
  97. package/dist/{provider-ClD4rfgT.js → provider-BYcoTKuS.js} +1 -1
  98. package/dist/{provider-CydlnKkS.d.ts → provider-C48LDq0q.d.ts} +1 -1
  99. package/dist/{provider-store-atQUfsVO.js → provider-store-Dq_olUjC.js} +1 -1
  100. package/dist/{provider-with-CSw4mBDU.js → provider-with-fxHItxDh.js} +1 -1
  101. package/dist/pull-Bn9a5g9Q.js +1 -0
  102. package/dist/{pull-DOwvDn98.js → pull-xhMWizWH.js} +1 -1
  103. package/dist/{push-Cb7PqXdO.js → push-DXh936bz.js} +1 -1
  104. package/dist/{pushed-policy-pH-EFWyx.d.ts → pushed-policy-APjMbYdV.d.ts} +1 -1
  105. package/dist/{rbac-CygtQB85.js → rbac-ir19O-e-.js} +1 -1
  106. package/dist/react/index.d.ts +4 -4
  107. package/dist/react/index.js +3 -3
  108. package/dist/react/lazy.d.ts +4 -4
  109. package/dist/react/lazy.js +3 -3
  110. package/dist/react/provider-client-lazy.d.ts +1 -1
  111. package/dist/react/provider-client-lazy.js +1 -1
  112. package/dist/react/provider-client.d.ts +1 -1
  113. package/dist/react/provider-client.js +1 -1
  114. package/dist/react-native/index.d.ts +4 -4
  115. package/dist/react-native/index.js +2 -2
  116. package/dist/{resolve-names-D0hNHBp5.js → resolve-names-B3PM0l3J.js} +1 -1
  117. package/dist/{resolver-kdZ4HrpC.js → resolver-4qxIIHcC.js} +1 -1
  118. package/dist/{rls-BjEp-1Ob.js → rls-CYbk1UmD.js} +7 -7
  119. package/dist/{rls-BDmebOIp.js → rls-DEPAx9uQ.js} +1 -1
  120. package/dist/{rls-files-kGXtfslQ.js → rls-files-CxdOxMKl.js} +2 -2
  121. package/dist/{rls-options-CEpg5nDP.d.ts → rls-options-BZxfMDFo.d.ts} +1 -1
  122. package/dist/run-BtTQlk1R.js +1 -0
  123. package/dist/{run-DFe2I0T7.js → run-CI5opYjC.js} +3 -3
  124. package/dist/{saas-DzjKUQr5.js → saas-CUwmgUB8.js} +2 -2
  125. package/dist/{scan-DGCpdOuR.js → scan-BrILYXP9.js} +1 -1
  126. package/dist/{schema-wummOGn9.js → schema-C-Nn6M1P.js} +2 -2
  127. package/dist/{size-DF7xQ-nH.js → size-BqLd5oJ4.js} +1 -1
  128. package/dist/{skills-BntnICiJ.js → skills-C2SqRGXy.js} +2 -2
  129. package/dist/{skills-BQ9bEjPV.js → skills-Cuf4gcfr.js} +2 -2
  130. package/dist/{snapshot-size-DU7CvpMt.js → snapshot-size-B_chu2c1.js} +1 -1
  131. package/dist/{snapshot-size-D-pCR8x0.js → snapshot-size-CHig-Nq_.js} +1 -1
  132. package/dist/solid/index.d.ts +24 -24
  133. package/dist/solid/index.js +2 -2
  134. package/dist/{src-D6_T4zd7.js → src-BAYcigFU.js} +1 -1
  135. package/dist/{store-core-eqG8jijs.d.ts → store-core-DyNo_BwA.d.ts} +4 -2
  136. package/dist/{store-options-C8x39AHa.js → store-options-BtHrfJUU.js} +1 -1
  137. package/dist/{stores-DoA7ACkz.js → stores-BIMyclLg.js} +1 -1
  138. package/dist/{stores-4DOaL4ZP.d.ts → stores-DyFCruRC.d.ts} +2 -2
  139. package/dist/supabase/index.d.ts +6 -0
  140. package/dist/supabase/index.js +2 -2
  141. package/dist/{supabase-BI5ZhzLl.js → supabase-BzK3lplm.js} +4 -4
  142. package/dist/{supabase-CjUsihRL.js → supabase-V_yr_spa.js} +1 -1
  143. package/dist/{supabase-config-CbK7xX77.js → supabase-config-BrhSp-U7.js} +1 -1
  144. package/dist/supabase-hook-BJImmLmb.js +2 -0
  145. package/dist/{supabase-hook-nGLUvn5x.js → supabase-hook-C7v1wRUV.js} +4 -4
  146. package/dist/svelte/index.d.ts +3 -3
  147. package/dist/svelte/index.js +3 -3
  148. package/dist/svelte/runtime.d.ts +2 -2
  149. package/dist/svelte/runtime.js +1 -1
  150. package/dist/svelte/source.d.ts +3 -3
  151. package/dist/svelte/source.js +2 -2
  152. package/dist/{tables-CbVpFhC6.js → tables-D-tmMHww.js} +44 -7
  153. package/dist/testing/core.js +1 -1
  154. package/dist/testing/index.d.ts +3 -3
  155. package/dist/testing/index.js +5 -5
  156. package/dist/testing/saas/index.js +2 -2
  157. package/dist/testing/saas/permissions.js +1 -1
  158. package/dist/{text-diff-CsglY49A.js → text-diff-DxKRNFlx.js} +2 -2
  159. package/dist/{types-C7QtRn3n.d.ts → types-4wjWMSFM.d.ts} +2 -2
  160. package/dist/{types-CVCRFYY_.d.ts → types-CQF-oYSz.d.ts} +1 -1
  161. package/dist/{types-3pRMqcvw.d.ts → types-PS10T9UK.d.ts} +1 -1
  162. package/dist/{types-nXo_oQYk.d.ts → types-config-Cq72dArb.d.ts} +740 -782
  163. package/dist/types-run-DG1H5vrX.d.ts +44 -0
  164. package/dist/unplugin/index.d.ts +1 -1
  165. package/dist/unplugin/index.js +1 -1
  166. package/dist/{usage-L1G1zlwz.js → usage-Bh-VP8co.js} +1 -1
  167. package/dist/usage-DpmLPRRx.js +1 -0
  168. package/dist/{usage-C1NKRxBJ.js → usage-XS56d_Kx.js} +3 -3
  169. package/dist/{verify-KX4Ohvs_.js → verify-aCeiREkh.js} +4 -4
  170. package/dist/vue/index.d.ts +1 -1
  171. package/dist/vue/index.js +2 -2
  172. package/dist/{watch-CiN6WU9k.js → watch-BNxvqCS4.js} +1 -1
  173. package/dist/watch-CGLmIdld.js +1 -0
  174. package/dist/{watch-DNIGANvR.js → watch-CnRyGEtp.js} +1 -1
  175. package/package.json +14 -14
  176. package/skills/permdock-data/references/queries-and-rls.md +1 -0
  177. package/dist/catalog-CgK_L4Qf.js +0 -1
  178. package/dist/collect-CPvCXMQ-.js +0 -1
  179. package/dist/gen-DbPS6a4x.js +0 -1
  180. package/dist/output-files-C5LFnQa4.js +0 -1
  181. package/dist/pull-Qh7JjiO7.js +0 -1
  182. package/dist/run-CdxQr6w8.js +0 -1
  183. package/dist/supabase-hook-b7tej2Vw.js +0 -2
  184. package/dist/usage-BAUV1SYl.js +0 -1
  185. package/dist/watch-NAUnUXph.js +0 -1
@@ -2,9 +2,9 @@ import { i as describe } from "../describe-lAafaRQQ.js";
2
2
  import { c as requiredPlans } from "../errors-DUJ7wLlE.js";
3
3
  import { t as approvalHeaders } from "../headers-D1oRr-js.js";
4
4
  import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-C1zIMtJr.js";
5
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-D6T3eJyW.js";
5
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-CEzNNtfi.js";
6
6
  import { t as onlineRefresh } from "../refresh-online-vtUfV6dk.js";
7
- import { t as PermDockProvider } from "../provider-CydlnKkS.js";
8
- import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-3pRMqcvw.js";
9
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-eqG8jijs.js";
7
+ import { t as PermDockProvider } from "../provider-C48LDq0q.js";
8
+ import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-PS10T9UK.js";
9
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-DyNo_BwA.js";
10
10
  export { type ActionResult, type ApprovalHandle, type ApprovalState, type AuthzChangeRefresh, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type PermDockDefaults, PermDockProvider, type PermDockProviderProps, type PermissionOutcome, type PermissionSet, type PermissionState, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type RefreshTrigger, type RolesOptions, type SubjectView, type TenantView, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, onlineRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDecision, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };
@@ -2,8 +2,8 @@
2
2
  import { n as describe } from "../describe-B7EosIKA.js";
3
3
  import { r as requiredPlans } from "../problem-details-EJHcvYCz.js";
4
4
  import { r as approvalHeaders } from "../protected-action-DiXulRVj.js";
5
- import { a as eventSourceRefresh, i as broadcastChannelRefresh, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-C8x39AHa.js";
6
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-BMb0ftEu.js";
5
+ import { a as eventSourceRefresh, i as broadcastChannelRefresh, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-BtHrfJUU.js";
6
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-Dco5O_Kc.js";
7
7
  import { t as onlineRefresh } from "../refresh-online-CYGZNo6V.js";
8
- import { t as PermDockProvider } from "../provider-ClD4rfgT.js";
8
+ import { t as PermDockProvider } from "../provider-BYcoTKuS.js";
9
9
  export { PermDockProvider, Protected, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, onlineRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDecision, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };
@@ -2,9 +2,9 @@ import { i as describe } from "../describe-lAafaRQQ.js";
2
2
  import { c as requiredPlans } from "../errors-DUJ7wLlE.js";
3
3
  import { t as approvalHeaders } from "../headers-D1oRr-js.js";
4
4
  import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-C1zIMtJr.js";
5
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-D6T3eJyW.js";
5
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-CEzNNtfi.js";
6
6
  import { t as onlineRefresh } from "../refresh-online-vtUfV6dk.js";
7
- import { t as PermDockProvider } from "../lazy-provider-CydlnKkS.js";
8
- import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-3pRMqcvw.js";
9
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-eqG8jijs.js";
7
+ import { t as PermDockProvider } from "../lazy-provider-C48LDq0q.js";
8
+ import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-PS10T9UK.js";
9
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-DyNo_BwA.js";
10
10
  export { type ActionResult, type ApprovalHandle, type ApprovalState, type AuthzChangeRefresh, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type PermDockDefaults, PermDockProvider, type PermDockProviderProps, type PermissionOutcome, type PermissionSet, type PermissionState, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type RefreshTrigger, type RolesOptions, type SubjectView, type TenantView, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, onlineRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDecision, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };
@@ -2,8 +2,8 @@
2
2
  import { n as describe } from "../describe-B7EosIKA.js";
3
3
  import { r as requiredPlans } from "../problem-details-EJHcvYCz.js";
4
4
  import { r as approvalHeaders } from "../protected-action-DiXulRVj.js";
5
- import { a as eventSourceRefresh, i as broadcastChannelRefresh, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-C8x39AHa.js";
6
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-BMb0ftEu.js";
5
+ import { a as eventSourceRefresh, i as broadcastChannelRefresh, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-BtHrfJUU.js";
6
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-Dco5O_Kc.js";
7
7
  import { t as onlineRefresh } from "../refresh-online-CYGZNo6V.js";
8
- import { t as PermDockProvider } from "../lazy-provider-DG5rMeqL.js";
8
+ import { t as PermDockProvider } from "../lazy-provider-CVX534Kk.js";
9
9
  export { PermDockProvider, Protected, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, onlineRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDecision, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };
@@ -1,2 +1,2 @@
1
- import { t as PermDockProvider } from "../lazy-provider-CydlnKkS.js";
1
+ import { t as PermDockProvider } from "../lazy-provider-C48LDq0q.js";
2
2
  export { PermDockProvider };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export { t as PermDockProvider } from "../lazy-provider-DG5rMeqL.js";
2
+ export { t as PermDockProvider } from "../lazy-provider-CVX534Kk.js";
@@ -1,2 +1,2 @@
1
- import { t as PermDockProvider } from "../provider-CydlnKkS.js";
1
+ import { t as PermDockProvider } from "../provider-C48LDq0q.js";
2
2
  export { PermDockProvider };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export { t as PermDockProvider } from "../provider-ClD4rfgT.js";
2
+ export { t as PermDockProvider } from "../provider-BYcoTKuS.js";
@@ -2,14 +2,14 @@ import { i as describe } from "../describe-lAafaRQQ.js";
2
2
  import { t as approvalHeaders } from "../headers-D1oRr-js.js";
3
3
  import { c as requiredPlans } from "../errors-DUJ7wLlE.js";
4
4
  import { i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, t as AuthzChangeRefresh } from "../refresh-on-C1zIMtJr.js";
5
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, n as Protected, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-D6T3eJyW.js";
6
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, t as ClientStore, v as TenantView, y as ActionResult } from "../store-core-eqG8jijs.js";
7
- import { r as ProtectedProps, t as PermDockDefaults } from "../types-3pRMqcvw.js";
5
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, n as Protected, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-CEzNNtfi.js";
6
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, t as ClientStore, v as TenantView, y as ActionResult } from "../store-core-DyNo_BwA.js";
7
+ import { r as ProtectedProps, t as PermDockDefaults } from "../types-PS10T9UK.js";
8
8
  import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-BGLWVchi.js";
9
9
  import { w as Permission } from "../vocabulary-FYgI_NoI.js";
10
10
  import { $t as LocalSnapshotManifest, Qt as LocalRowValue, Xt as LocalMembershipRows, Zt as LocalRowColumn, en as LocalSnapshotRows, gr as CustomRole, qt as Instant, tn as Snapshot, ut as SnapshotSource, xr as Membership } from "../policy-types-93NwI8iI.js";
11
11
  import { n as RealtimeRefreshClient, t as RealtimeRefreshChannel } from "../client-V95IvZsF.js";
12
- import { a as SubscribeOnline, i as SubscribeForeground, n as ReactNativePermDockProviderProps, r as SnapshotStorage, t as NativeRevalidate } from "../types-C7QtRn3n.js";
12
+ import { a as SubscribeOnline, i as SubscribeForeground, n as ReactNativePermDockProviderProps, r as SnapshotStorage, t as NativeRevalidate } from "../types-4wjWMSFM.js";
13
13
  import { ReactElement } from "react";
14
14
  /**
15
15
  * `true` once the provider has a snapshot to answer from: storage was read or a
@@ -2,8 +2,8 @@
2
2
  import { n as describe } from "../describe-B7EosIKA.js";
3
3
  import { r as requiredPlans } from "../problem-details-EJHcvYCz.js";
4
4
  import { r as approvalHeaders } from "../protected-action-DiXulRVj.js";
5
- import { a as eventSourceRefresh, c as isJws, n as storeOf, r as authzChangeRefresh, t as adapterStore } from "../store-options-C8x39AHa.js";
6
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, n as Protected, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-BMb0ftEu.js";
5
+ import { a as eventSourceRefresh, c as isJws, n as storeOf, r as authzChangeRefresh, t as adapterStore } from "../store-options-BtHrfJUU.js";
6
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, n as Protected, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-Dco5O_Kc.js";
7
7
  import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-CfMjZAFi.js";
8
8
  import { a as heldRoleNames, n as parseSnapshot, s as bindConditionRefs } from "../snapshot-DckMnHk8.js";
9
9
  import { r as isRecord, t as compact } from "../compact-C4LFuqbW.js";
@@ -5,7 +5,7 @@ import "./budget-BH81q2cj.js";
5
5
  import "./sources-DnjJPGfb.js";
6
6
  import { i as configError } from "./errors-DgLOqc6j.js";
7
7
  import { t as FIELD_VIEWS } from "./fields-6d1j-q3c.js";
8
- import { C as forUserContext, Z as graphPlan, d as permittedByPermissionHelper, i as tableNames, o as PERMISSION_HELPERS, p as holderSources, s as checkName, w as grantBodies } from "./tables-CbVpFhC6.js";
8
+ import { C as forUserContext, Q as graphPlan, d as permittedByPermissionHelper, i as tableNames, o as PERMISSION_HELPERS, p as holderSources, s as checkName, w as grantBodies } from "./tables-D-tmMHww.js";
9
9
  import { D as idTypeOf, O as scopeTypeOf } from "./shared-BdF5DJDQ.js";
10
10
  import { G as graphHelper, K as graphSqlName, Q as isTeamScope, T as globalRoleRows, X as hasPermittedUsers, Z as inheritedRowsHelper, ct as restrictedHelper, et as memberForHelper, f as holderBody, it as memberOfHelper, ot as permittedForHelper, rt as memberIdsHelper, st as permittedIdsHelper, ut as scopeTable } from "./interactive-only-CQsgMc1E.js";
11
11
  import { a as quoteIdent, i as qualified, o as quoteLiteral, s as quoteQualified } from "./quote-BKrTBbcH.js";
@@ -366,7 +366,7 @@ function createResolver(given) {
366
366
  if (options.subjects !== void 0 && id !== void 0 && known !== void 0) try {
367
367
  await options.subjects.record(id, known);
368
368
  const record = result?.subject === void 0 ? void 0 : readSubjectRecord(result.subject);
369
- if (record?.active === true && record.id === id && record.authzVersion === known) await options.subjects.seed(record);
369
+ if (record?.active === true && (result?.subjectTenant ?? tenant ?? null) === (tenant ?? null) && record.id === id && record.authzVersion === known) await options.subjects.seed(record);
370
370
  } catch {}
371
371
  const { permdock } = await buildInstance({
372
372
  policy: options.policy,
@@ -2,15 +2,15 @@ import "./sources-DnjJPGfb.js";
2
2
  import { a as describeError, f as usageResult, o as exitCodeOfError } from "./errors-DgLOqc6j.js";
3
3
  import { i as requirePeer, n as packageManagerOf, t as addLine } from "./peer-D77JpXe-.js";
4
4
  import { n as pgConnector, t as connectPgPool } from "./pg-CA651850.js";
5
- import { f as isSupabaseSchemas, m as schemasRefusal } from "./hook-sql-Bxc_YRrd.js";
6
- import { a as nonEmptyOr } from "./output-Cq0neio3.js";
7
- import { n as describeExplain, t as runRlsGenerate } from "./generate-Dl75LKbW.js";
8
- import { a as COLUMNS_SQL, o as INDEX_COLUMNS_SQL, u as readTableIndexFacts } from "./compile-NM1GOb2q.js";
5
+ import { f as isSupabaseSchemas, m as schemasRefusal } from "./hook-sql-Cunsdk5x.js";
6
+ import { a as nonEmptyOr } from "./output-Cqtb8lW_.js";
7
+ import { n as describeExplain, t as runRlsGenerate } from "./generate-CYUj-cvA.js";
8
+ import { a as COLUMNS_SQL, o as INDEX_COLUMNS_SQL, u as readTableIndexFacts } from "./compile-CT7x66_U.js";
9
9
  import { r as escapeSqlIdent } from "./sql-T4GaBh9X.js";
10
10
  import { t as beforeFirst } from "./text-D704xHVl.js";
11
- import { a as verifyResult, c as callsHelper, i as verifyIgnores, l as helperCallKeys, n as runRlsVerify, o as HELPER_TABLES, r as rlsFinding } from "./verify-KX4Ohvs_.js";
11
+ import { a as verifyResult, c as callsHelper, i as verifyIgnores, l as helperCallKeys, n as runRlsVerify, o as HELPER_TABLES, r as rlsFinding } from "./verify-aCeiREkh.js";
12
12
  import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-6d1j-q3c.js";
13
- import { r as parseRbacAuthorize } from "./rbac-CygtQB85.js";
13
+ import { r as parseRbacAuthorize } from "./rbac-ir19O-e-.js";
14
14
  import { delimiter, join } from "node:path";
15
15
  import { spawn } from "node:child_process";
16
16
  // src/cli/rls/grant-calls.ts
@@ -770,7 +770,7 @@ async function migrate(input) {
770
770
  output: generated.output
771
771
  };
772
772
  await requirePeer(() => import("pgsql-parser"), "pgsql-parser", "permdock rls migrate", input.cwd, PGSQL_PARSER_MAJOR);
773
- const { migrateTarget, runRlsMigrate } = await import("./migrate-CmTMk7rd.js");
773
+ const { migrateTarget, runRlsMigrate } = await import("./migrate-BwXtXUtE.js");
774
774
  return runRlsMigrate({
775
775
  cwd: input.cwd,
776
776
  sql: input.sql,
@@ -192,7 +192,7 @@ async function rlsInput(ctx, verb, shape, options) {
192
192
  };
193
193
  }
194
194
  async function runRls(input) {
195
- return (await import("./rls-BjEp-1Ob.js")).runRls(input);
195
+ return (await import("./rls-CYbk1UmD.js")).runRls(input);
196
196
  }
197
197
  ({
198
198
  ...shapeFlags,
@@ -1,9 +1,9 @@
1
1
  import { n as isSeeds } from "./seeds-BDTG7xl-.js";
2
2
  import { i as dateAt } from "./time-r0CKBm57.js";
3
3
  import { n as CliError } from "./errors-DgLOqc6j.js";
4
- import { m as seedsMigration, p as seedDeltaNote } from "./output-files-DNid6TBl.js";
4
+ import { m as seedsMigration, p as seedDeltaNote } from "./output-files-D5D-8-4l.js";
5
5
  import { a as fixturesPresent, i as defaultsSeedSql, o as fixturesSeedSql, r as FIXTURES_PATH, t as DEFAULTS_MARKER } from "./seed-sql-CjF7u0aX.js";
6
- import { t as runRlsGenerate } from "./generate-Dl75LKbW.js";
6
+ import { t as runRlsGenerate } from "./generate-CYUj-cvA.js";
7
7
  import { a as quietIo, r as noted } from "./plugin-MQVfUBUS.js";
8
8
  // src/cli/generate/plugins/rls-options.ts
9
9
  function seedMode(seeds) {
@@ -1,4 +1,4 @@
1
- import { b as SupabaseSchemas, u as RlsConfig, v as RlsTarget } from "./types-nXo_oQYk.js";
1
+ import { c as RlsConfig, g as RlsTarget, o as SupabaseSchemas } from "./types-config-Cq72dArb.js";
2
2
  /**
3
3
  * `rls.seeds` as a mode, or `false` to skip the rows, or where they are
4
4
  * written.
@@ -0,0 +1 @@
1
+ export { t as run } from "./run-CI5opYjC.js";
@@ -2,10 +2,10 @@ import { i as dateAt } from "./time-r0CKBm57.js";
2
2
  import { a as resolveCwd, i as readConfig, o as withPluginOutputs } from "./config-iyy90IOU.js";
3
3
  import { t as beforeFirst } from "./text-D704xHVl.js";
4
4
  import { a as describeError, n as CliError, r as cliFailure, s as failureOf, u as kindOfCode } from "./errors-DgLOqc6j.js";
5
- import { a as suggestion, i as parseLeaf, o as GLOBAL_FLAGS, r as parseFlags } from "./args-0EWFk-4S.js";
6
- import { c as confirmationRequired, d as quote, f as replayArgv, i as githubAnnotations, l as consentDigest, n as errorDocument, o as resultDocument, s as sarifLog, t as dataOf, u as consentReasons } from "./output-Cq0neio3.js";
5
+ import { a as suggestion, i as parseLeaf, o as GLOBAL_FLAGS, r as parseFlags } from "./args-Bc0HLiD4.js";
6
+ import { c as confirmationRequired, d as quote, f as replayArgv, i as githubAnnotations, l as consentDigest, n as errorDocument, o as resultDocument, s as sarifLog, t as dataOf, u as consentReasons } from "./output-Cqtb8lW_.js";
7
7
  import { r as progressReporter, t as redact } from "./credentials-6ZWbJ-Re.js";
8
- import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-BY8lK4l4.js";
8
+ import { a as resolve, i as leaves, n as ROOT, r as SECTIONS, t as DOCS_BASE } from "./manifest-BY70KZmp.js";
9
9
  import { t as createStyle } from "./style-CQDaLJtP.js";
10
10
  import { s as cliVersion } from "./version-D-jWyJb9.js";
11
11
  import { n as isPermDockPlugin } from "./plugin-MQVfUBUS.js";
@@ -1,9 +1,9 @@
1
- import { a as saasPlans, i as saasPermissions, o as saasRoles } from "./permissions-ijDw4sO1.js";
1
+ import { a as saasPlans, i as saasPermissions, o as saasRoles } from "./permissions-Bj3DRIEi.js";
2
2
  import { a as deny, n as role, r as allow } from "./role-builder-DhsGEVq-.js";
3
3
  import { l as relation, n as anyone } from "./grantee-BPUG6f0r.js";
4
4
  import { r as definePolicy } from "./policy-DFD2J5o_.js";
5
5
  import { i as principal } from "./refs-Cix9Zjis.js";
6
- import { E as memoryCustomRoleSource, b as memoryRelationSource } from "./src-D6_T4zd7.js";
6
+ import { E as memoryCustomRoleSource, b as memoryRelationSource } from "./src-BAYcigFU.js";
7
7
  import { s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
8
8
  import { r as isRecord } from "./compact-C4LFuqbW.js";
9
9
  import { h as secondsAt } from "./time-r0CKBm57.js";
@@ -16,7 +16,7 @@ const scan = defineLeaf({
16
16
  }
17
17
  },
18
18
  async run(ctx, { flags }) {
19
- const { runAdoptionScan } = await import("./adoption-scan-CHMU7gnE.js");
19
+ const { runAdoptionScan } = await import("./adoption-scan-6eUACbvC.js");
20
20
  return runAdoptionScan({
21
21
  cwd: ctx.cwd,
22
22
  srcPath: flags.src.length > 0 ? flags.src : ctx.config.collect?.srcPath ?? ["src"],
@@ -1,7 +1,7 @@
1
- import { t as require__2020 } from "./2020-bJfT8aIA.js";
1
+ import { t as require__2020 } from "./2020-DBXhfpuK.js";
2
2
  import { r as isRecord } from "./compact-C4LFuqbW.js";
3
3
  import { t as DRAFT_PINS } from "./pins-CXXkVEiD.js";
4
- import { a as nonEmptyOr } from "./output-Cq0neio3.js";
4
+ import { a as nonEmptyOr } from "./output-Cqtb8lW_.js";
5
5
  import { l as packageRoot } from "./version-D-jWyJb9.js";
6
6
  import { readFileSync } from "node:fs";
7
7
  import { join } from "node:path";
@@ -38,7 +38,7 @@ const snapshotSize = defineLeaf({
38
38
  },
39
39
  async run(ctx, { flags }) {
40
40
  try {
41
- const { runSnapshotSize, SNAPSHOT_BUDGET_BYTES } = await import("./snapshot-size-DU7CvpMt.js");
41
+ const { runSnapshotSize, SNAPSHOT_BUDGET_BYTES } = await import("./snapshot-size-B_chu2c1.js");
42
42
  const path = given(flags.policy) ?? ctx.config.policy;
43
43
  return runSnapshotSize({
44
44
  policy: await requirePolicy(ctx.cwd, path, "set policy in permdock.config.ts or pass --policy"),
@@ -1,7 +1,7 @@
1
1
  import { t as defineLeaf } from "./command-9GAzSI7E.js";
2
2
  import { t as checkFlag } from "./flags-C0e-BzGW.js";
3
- import { r as pick, t as CANCELLED } from "./prompt-CSXHcJxy.js";
4
- import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-BQ9bEjPV.js";
3
+ import { r as pick, t as CANCELLED } from "./prompt-CPlJn_4-.js";
4
+ import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-Cuf4gcfr.js";
5
5
  // src/cli/commands/skills.ts
6
6
  const forFlag = { for: {
7
7
  type: "string",
@@ -1,6 +1,6 @@
1
1
  import { t as byCodePoint } from "./compare-dfHDj8kT.js";
2
- import { t as didYouMean } from "./args-0EWFk-4S.js";
3
- import { a as nonEmptyOr } from "./output-Cq0neio3.js";
2
+ import { t as didYouMean } from "./args-Bc0HLiD4.js";
3
+ import { a as nonEmptyOr } from "./output-Cqtb8lW_.js";
4
4
  import { i as readJsonFile, s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
5
5
  import { l as packageRoot } from "./version-D-jWyJb9.js";
6
6
  import { cpSync, existsSync, lstatSync, readFileSync, readdirSync, readlinkSync, realpathSync } from "node:fs";
@@ -1 +1 @@
1
- export { t as SNAPSHOT_BUDGET_BYTES, r as runSnapshotSize } from "./snapshot-size-D-pCR8x0.js";
1
+ export { t as SNAPSHOT_BUDGET_BYTES, r as runSnapshotSize } from "./snapshot-size-CHig-Nq_.js";
@@ -1,5 +1,5 @@
1
1
  import { d as scopeList } from "./scopes-B-KX9EI8.js";
2
- import { d as snapshotFor } from "./src-D6_T4zd7.js";
2
+ import { d as snapshotFor } from "./src-BAYcigFU.js";
3
3
  import { gzipSync } from "node:zlib";
4
4
  // src/cli/snapshot-size.ts
5
5
  /** The default budget of the PD112 doctor rule, in bytes of JSON. */
@@ -2,7 +2,7 @@ import { i as describe, r as DescribeOptions, t as DecisionDescription } from ".
2
2
  import { c as requiredPlans } from "../errors-DUJ7wLlE.js";
3
3
  import { t as approvalHeaders } from "../headers-D1oRr-js.js";
4
4
  import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-C1zIMtJr.js";
5
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, h as ProviderOptionsBase, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, r as ApprovalHandle, s as FilterResult, v as TenantView, y as ActionResult } from "../store-core-eqG8jijs.js";
5
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, h as ProviderOptionsBase, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, r as ApprovalHandle, s as FilterResult, v as TenantView, y as ActionResult } from "../store-core-DyNo_BwA.js";
6
6
  import { Jt as ClientBundle, N as PolicyVocabulary, Qn as Decision, Zn as ApprovalRequiredDecision, ir as GrantedDecision, tn as Snapshot, vt as TokenVerifier, xr as Membership } from "../policy-types-93NwI8iI.js";
7
7
  import { d as UncheckedData, s as RowData } from "../permdock-Dz3yzWrp.js";
8
8
  import { r as Role, w as Permission } from "../vocabulary-FYgI_NoI.js";
@@ -18,7 +18,7 @@ type PermDockProviderProps = ProviderOptionsBase & {
18
18
  * while it returns `undefined` (a loading `createResource`); a promise keeps
19
19
  * the store `pending` until it settles.
20
20
  */
21
- readonly snapshot: Snapshot | string | Accessor$1<Snapshot | string | undefined> | PromiseLike<Snapshot | string>;
21
+ readonly snapshot: Snapshot | string | Accessor<Snapshot | string | undefined> | PromiseLike<Snapshot | string>;
22
22
  /** A change switches the active tenant (`refresh({ tenant })`). */
23
23
  readonly tenant?: string;
24
24
  /**
@@ -64,44 +64,44 @@ type ProtectedProps = {
64
64
  * accessors.
65
65
  */
66
66
  type ProtectedActionAccessors<T> = {
67
- readonly gate: Accessor$1<GateView>;
68
- readonly result: Accessor$1<ActionResult<T> | undefined>;
69
- readonly pending: Accessor$1<boolean>;
70
- readonly approval: Accessor$1<ApprovalHandle | undefined>;
67
+ readonly gate: Accessor<GateView>;
68
+ readonly result: Accessor<ActionResult<T> | undefined>;
69
+ readonly pending: Accessor<boolean>;
70
+ readonly approval: Accessor<ApprovalHandle | undefined>;
71
71
  readonly run: (input: unknown) => Promise<ActionResult<T>>;
72
72
  readonly retry: () => Promise<ActionResult<T> | undefined>;
73
73
  };
74
74
  export declare function usePermDock<V extends PolicyVocabulary = PolicyVocabulary>(): ClientPermDock<V>;
75
- export declare function usePermission<D>(permission: Permission | Accessor<Permission>, data?: Accessor<UncheckedData<D>>): Accessor<PermissionState>;
76
- export declare function usePermission<P extends Permission>(permission: P | Accessor<P>, data?: Accessor<RowData<P>>): Accessor<PermissionState>;
75
+ export declare function usePermission<D>(permission: Permission | Accessor$1<Permission>, data?: Accessor$1<UncheckedData<D>>): Accessor$1<PermissionState>;
76
+ export declare function usePermission<P extends Permission>(permission: P | Accessor$1<P>, data?: Accessor$1<RowData<P>>): Accessor$1<PermissionState>;
77
77
  /**
78
78
  * What a permission-gated control renders, as `useGate` in React: `hidden`,
79
79
  * `disabled`, `needsApproval`, `upgrade` and a localised `reason`.
80
80
  */
81
- export declare function useGate<D>(permission: Permission | Accessor<Permission>, data?: Accessor<UncheckedData<D>>, options?: {
81
+ export declare function useGate<D>(permission: Permission | Accessor$1<Permission>, data?: Accessor$1<UncheckedData<D>>, options?: {
82
82
  readonly mode?: GateMode;
83
- }): Accessor<GateView>;
84
- export declare function useGate<P extends Permission>(permission: P | Accessor<P>, data?: Accessor<RowData<P>>, options?: {
83
+ }): Accessor$1<GateView>;
84
+ export declare function useGate<P extends Permission>(permission: P | Accessor$1<P>, data?: Accessor$1<RowData<P>>, options?: {
85
85
  readonly mode?: GateMode;
86
- }): Accessor<GateView>;
87
- export declare function usePermissions(permissions: Accessor<readonly Permission[]>, data?: Accessor<unknown>): Accessor<PermissionSet>;
88
- export declare function useFilter<T>(permission: Permission<string, NoInfer<T>, "instance">, rows: Accessor<readonly T[]>): Accessor<FilterResult<T>>;
89
- export declare function useTenant(): Accessor<TenantView>;
90
- export declare function useMemberships(): Accessor<readonly Membership[]>;
91
- export declare function useRoles(options?: Accessor<RolesOptions>): Accessor<{
86
+ }): Accessor$1<GateView>;
87
+ export declare function usePermissions(permissions: Accessor$1<readonly Permission[]>, data?: Accessor$1<unknown>): Accessor$1<PermissionSet>;
88
+ export declare function useFilter<T>(permission: Permission<string, NoInfer<T>, "instance">, rows: Accessor$1<readonly T[]>): Accessor$1<FilterResult<T>>;
89
+ export declare function useTenant(): Accessor$1<TenantView>;
90
+ export declare function useMemberships(): Accessor$1<readonly Membership[]>;
91
+ export declare function useRoles(options?: Accessor$1<RolesOptions>): Accessor$1<{
92
92
  readonly roles: readonly Role[];
93
93
  }>;
94
- export declare function useAssignableRoles(): Accessor<readonly Role[]>;
94
+ export declare function useAssignableRoles(): Accessor$1<readonly Role[]>;
95
95
  export declare function useAssignablePermissions(options?: {
96
96
  readonly tenant?: string;
97
- } | Accessor<{
97
+ } | Accessor$1<{
98
98
  readonly tenant?: string;
99
- }>): Accessor<{
99
+ }>): Accessor$1<{
100
100
  readonly permissions: readonly Permission[];
101
101
  readonly status: "ready" | "server-only";
102
102
  }>;
103
- export declare function useSubject(): Accessor<SubjectView>;
104
- export declare function useApproval(decision: Accessor<Decision>): Accessor<ApprovalHandle>;
103
+ export declare function useSubject(): Accessor$1<SubjectView>;
104
+ export declare function useApproval(decision: Accessor$1<Decision>): Accessor$1<ApprovalHandle>;
105
105
  /** `describe` with the provider's `messages`; a call's own `messages` win. */
106
106
  export declare function useDescribe(): (decision: Decision, options?: DescribeOptions) => DecisionDescription;
107
107
  /**
@@ -109,10 +109,10 @@ export declare function useDescribe(): (decision: Decision, options?: DescribeOp
109
109
  * in React: accessors for `gate`, `result`, `pending` and `approval`, plus
110
110
  * `run` and `retry`.
111
111
  */
112
- export declare function useProtectedAction<T, D>(action: ProtectedAction<T>, permission: Permission | Accessor<Permission>, data?: Accessor<UncheckedData<D>>, options?: {
112
+ export declare function useProtectedAction<T, D>(action: ProtectedAction<T>, permission: Permission | Accessor$1<Permission>, data?: Accessor$1<UncheckedData<D>>, options?: {
113
113
  readonly mode?: GateMode;
114
114
  }): ProtectedActionAccessors<T>;
115
- export declare function useProtectedAction<T, P extends Permission>(action: ProtectedAction<T>, permission: P | Accessor<P>, data?: Accessor<RowData<P>>, options?: {
115
+ export declare function useProtectedAction<T, P extends Permission>(action: ProtectedAction<T>, permission: P | Accessor$1<P>, data?: Accessor$1<RowData<P>>, options?: {
116
116
  readonly mode?: GateMode;
117
117
  }): ProtectedActionAccessors<T>;
118
118
  /**
@@ -1,10 +1,10 @@
1
1
  import { n as describe } from "../describe-B7EosIKA.js";
2
2
  import { r as requiredPlans } from "../problem-details-EJHcvYCz.js";
3
3
  import { n as actionRunner, r as approvalHeaders, t as actionApproval } from "../protected-action-DiXulRVj.js";
4
- import { a as eventSourceRefresh, i as broadcastChannelRefresh, l as isPromiseLike, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-C8x39AHa.js";
4
+ import { a as eventSourceRefresh, i as broadcastChannelRefresh, l as isPromiseLike, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-BtHrfJUU.js";
5
5
  import { a as gateView, c as protectedView, d as slotContent, f as subjectView, i as filterResult, l as rolesView, n as assignablePermissionsView, o as livePermDock, p as tenantView, r as describeWith, s as permissionSet, t as approvalHandle, u as scopedTenant } from "../views-Dpr1uB16.js";
6
6
  import { n as boundaryFallback, t as boundaryDigest } from "../boundary--5Swp7sN.js";
7
- import { n as switchTenant, t as providerStore } from "../provider-store-atQUfsVO.js";
7
+ import { n as switchTenant, t as providerStore } from "../provider-store-Dq_olUjC.js";
8
8
  import { t as compact } from "../compact-C4LFuqbW.js";
9
9
  import { ErrorBoundary, createComponent, createComputed, createContext, createMemo, createSignal, getOwner, on, onCleanup, useContext } from "solid-js";
10
10
  // src/solid/context.ts
@@ -338,7 +338,7 @@ function entryStages(approval) {
338
338
  function shorter(a, b) {
339
339
  if (a === void 0) return b;
340
340
  if (b === void 0) return a;
341
- return (durationOf(b) ?? Infinity) < (durationOf(a) ?? Infinity) ? b : a;
341
+ return (durationOf(b) ?? 1e400) < (durationOf(a) ?? 1e400) ? b : a;
342
342
  }
343
343
  /**
344
344
  * `code` with every matching entry added as further stages: the result needs
@@ -248,8 +248,10 @@ type ClientStore = {
248
248
  */
249
249
  quick: (permission: Permission) => PermissionOutcome | undefined;
250
250
  /**
251
- * `undefined` once the evaluator has loaded; otherwise the load in flight,
252
- * which a render reads with `use()`.
251
+ * The evaluator load, which a render reads with `use()`. After it settles the
252
+ * same promise comes back, so a replayed render sees the thenable it
253
+ * suspended on; `undefined` when the evaluator was loaded before the store
254
+ * existed.
253
255
  */
254
256
  loading: () => PromiseLike<void> | undefined;
255
257
  requestApproval: (decision: Decision, note?: string) => Promise<void>;
@@ -704,7 +704,7 @@ function createStore(options, evaluator) {
704
704
  let evaluated = evaluator.build() !== void 0;
705
705
  let loadingNow;
706
706
  const loading = () => {
707
- if (evaluated) return;
707
+ if (evaluated) return loadingNow;
708
708
  loadingNow ??= (async () => {
709
709
  try {
710
710
  await evaluator.load();
@@ -1,6 +1,6 @@
1
1
  import { n as actionRunner, t as actionApproval } from "./protected-action-DiXulRVj.js";
2
2
  import { a as gateView, f as subjectView, i as filterResult, l as rolesView, n as assignablePermissionsView, o as livePermDock, p as tenantView, r as describeWith, s as permissionSet, t as approvalHandle } from "./views-Dpr1uB16.js";
3
- import { n as getUi, r as providePermDock, t as getStore } from "./context-DmH-Eyvx.js";
3
+ import { n as getUi, r as providePermDock, t as getStore } from "./context-BdoA9DhS.js";
4
4
  import { derived, readable, toStore, writable } from "svelte/store";
5
5
  // src/svelte/stores.ts
6
6
  function fromStore(store, compute) {
@@ -1,9 +1,9 @@
1
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, l as GateView, r as ApprovalHandle, s as FilterResult, v as TenantView } from "./store-core-eqG8jijs.js";
1
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, l as GateView, r as ApprovalHandle, s as FilterResult, v as TenantView } from "./store-core-DyNo_BwA.js";
2
2
  import { N as PolicyVocabulary, Qn as Decision, xr as Membership } from "./policy-types-93NwI8iI.js";
3
3
  import { r as DescribeOptions, t as DecisionDescription } from "./describe-lAafaRQQ.js";
4
4
  import { d as UncheckedData, s as RowData } from "./permdock-Dz3yzWrp.js";
5
5
  import { r as Role, w as Permission } from "./vocabulary-FYgI_NoI.js";
6
- import { n as ProtectedActionReadable, r as SveltePermDockOptions } from "./types-CVCRFYY_.js";
6
+ import { n as ProtectedActionReadable, r as SveltePermDockOptions } from "./types-CQF-oYSz.js";
7
7
  import { Readable } from "svelte/store";
8
8
  declare function setPermDock(options: SveltePermDockOptions): ClientPermDock;
9
9
  declare function getPermDock<V extends PolicyVocabulary = PolicyVocabulary>(): ClientPermDock<V>;
@@ -167,6 +167,12 @@ type SupabaseAccessResult = {
167
167
  * `authzVersion`, so the instance reads no `subject_for`.
168
168
  */
169
169
  readonly subject?: unknown;
170
+ /**
171
+ * The tenant `subject` is restricted to; `null` or absent when it covers
172
+ * every tenant. A subject for another tenant than the one checked is not
173
+ * seeded.
174
+ */
175
+ readonly subjectTenant?: string | null;
170
176
  };
171
177
  type ResolverQuery = {
172
178
  readonly tenant?: string | null;
@@ -1,9 +1,9 @@
1
1
  import { r as readSubjectRecord } from "../version-cache-BXkl7-Fz.js";
2
2
  import { n as AUTHZ_TOPIC, r as authzUserTopic, t as AUTHZ_EVENT } from "../authz-topic-D8x24Jv-.js";
3
3
  import { n as supabaseMembershipsBudget, r as supabaseTenantClaim } from "../budget-BH81q2cj.js";
4
- import { a as tableApprovalPolicySource, c as exchangeCapability, i as tableApprovalDelegationSource, n as authorizeSql, o as supabaseApprovalStore, r as supabaseRls, s as supabaseClaims, t as definePermDock } from "../supabase-BI5ZhzLl.js";
4
+ import { a as tableApprovalPolicySource, c as exchangeCapability, i as tableApprovalDelegationSource, n as authorizeSql, o as supabaseApprovalStore, r as supabaseRls, s as supabaseClaims, t as definePermDock } from "../supabase-BzK3lplm.js";
5
5
  import { c as tableMembershipSource, i as authzVersion, o as junctionMembershipSource, s as supabasePostgresQuery, t as AUTHZ_VERSION_TABLE } from "../sources-DnjJPGfb.js";
6
- import { r as subjectFromSupabaseClient, s as postgrestSources } from "../resolver-kdZ4HrpC.js";
6
+ import { r as subjectFromSupabaseClient, s as postgrestSources } from "../resolver-4qxIIHcC.js";
7
7
  import { a as delegationOf, i as actorOf, o as subjectFromSupabase, s as subjectFromSupabaseSession } from "../definition-options-9o8Hdww3.js";
8
8
  import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-B-8d2lhG.js";
9
9
  export { AUTHZ_EVENT, AUTHZ_TOPIC, AUTHZ_VERSION_TABLE, actorOf, authorizeSql, authzUserTopic, authzVersion, definePermDock, delegationOf, exchangeCapability, hasTokenHook, junctionMembershipSource, parseSupabaseManifest, postgrestSources, readSubjectRecord, subjectFromSupabase, subjectFromSupabaseClient, subjectFromSupabaseSession, supabaseApprovalStore, supabaseClaims, supabaseMembershipsBudget, supabasePostgresQuery, supabaseRls, supabaseTenantClaim, tableApprovalDelegationSource, tableApprovalPolicySource, tableMembershipSource };
@@ -7,7 +7,7 @@ import { t as CUSTOM_ROLES_VERSION_CLAIM } from "./budget-BH81q2cj.js";
7
7
  import { s as ApprovalError } from "./types-DFZKovb3.js";
8
8
  import { c as decodeApprovalCursor, l as encodeApprovalCursor, s as approvalPageSize, t as applyApprovalVerdict } from "./store-AH8bmaxW.js";
9
9
  import { t as canonicalJson } from "./canonical-json-BibZkXtE.js";
10
- import { a as withMembers, i as ownedCaches, n as getPermissions, o as callRpc, r as subjectFromSupabaseClient, s as postgrestSources, t as createResolver } from "./resolver-kdZ4HrpC.js";
10
+ import { a as withMembers, i as ownedCaches, n as getPermissions, o as callRpc, r as subjectFromSupabaseClient, s as postgrestSources, t as createResolver } from "./resolver-4qxIIHcC.js";
11
11
  import { d as keptKeys, l as roleColumn } from "./sources-DnjJPGfb.js";
12
12
  import { a as quoteQualifiedTable, c as quoteSqlTable, d as sqlTextArray, i as qualifySqlTable, o as quoteSqlIdent, s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
13
13
  import { o as subjectFromSupabase, t as SUPABASE_OPTIONS } from "./definition-options-9o8Hdww3.js";
@@ -545,7 +545,7 @@ function claimKept(suspension) {
545
545
  }
546
546
  function customDatabaseBranch(q, scope, memberships, declared, levels, suspension) {
547
547
  const role = tenantRole(memberships);
548
- const match = `case when ${q("permdock_is_shared_role")}(${literal(scope)}, ${role.sql}) then c.tenant_id is null else c.tenant_id::text = requested_tenant end and c.scope = ${literal(scope)} and c.scope_id is null and c.role = ${role.sql}`;
548
+ const match = `case when ${q("permdock_is_shared_role")}(${literal(scope)}, ${role.sql}) then c.tenant_id is null else c.tenant_id = v_custom_tenant end and c.scope = ${literal(scope)} and c.scope_id is null and c.role = ${role.sql}`;
549
549
  const rows = (source, value, extra) => `array(select c.${value} from ${q(source)} c where ${match}${extra})`;
550
550
  return ` or exists (
551
551
  select 1
@@ -591,7 +591,7 @@ function databaseBody(q, scope, memberships, custom, suspension) {
591
591
  tenantBranch = ` if requested_tenant is not null then
592
592
  begin
593
593
  v_member_user := uid;
594
- v_member_tenant := requested_tenant;
594
+ v_member_tenant := requested_tenant;${custom === void 0 ? "" : "\n v_custom_tenant := requested_tenant;"}
595
595
  exception when invalid_text_representation or numeric_value_out_of_range then
596
596
  return false; -- not an id of the memberships table
597
597
  end;
@@ -606,7 +606,7 @@ function databaseBody(q, scope, memberships, custom, suspension) {
606
606
  return `declare
607
607
  uid uuid := (select auth.uid());${memberships !== void 0 && tenantColumn !== void 0 ? `
608
608
  v_member_user ${quoteQualifiedTable(memberships.table)}.${ident(memberships.user)}%type;
609
- v_member_tenant ${quoteQualifiedTable(memberships.table)}.${ident(tenantColumn)}%type;` : ""}
609
+ v_member_tenant ${quoteQualifiedTable(memberships.table)}.${ident(tenantColumn)}%type;${custom === void 0 ? "" : `\n v_custom_tenant ${q("custom_role_permissions")}.tenant_id%type;`}` : ""}
610
610
  begin
611
611
  if uid is null then
612
612
  return false;
@@ -15,7 +15,7 @@ const inspect = defineLeaf({
15
15
  },
16
16
  async run(ctx, { flags }) {
17
17
  const out = flags.out === "" ? true : flags.out === "-" ? void 0 : flags.out;
18
- const { runSupabase } = await import("./supabase-hook-b7tej2Vw.js");
18
+ const { runSupabase } = await import("./supabase-hook-BJImmLmb.js");
19
19
  return runSupabase({
20
20
  cwd: ctx.cwd,
21
21
  config: ctx.config,
@@ -1,6 +1,6 @@
1
1
  import "./sources-DnjJPGfb.js";
2
2
  import { a as describeError } from "./errors-DgLOqc6j.js";
3
- import { n as hookUri } from "./rbac-CygtQB85.js";
3
+ import { n as hookUri } from "./rbac-ir19O-e-.js";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  import { join, posix } from "node:path";
6
6
  // ../../node_modules/.pnpm/smol-toml@1.9.1/node_modules/smol-toml/dist/error.js
@@ -0,0 +1,2 @@
1
+ import "./hook-sql-Cunsdk5x.js";
2
+ export { r as runSupabase } from "./supabase-hook-C7v1wRUV.js";
@@ -1,14 +1,14 @@
1
1
  import { r as isRecord } from "./compact-C4LFuqbW.js";
2
2
  import { d as scopeList } from "./scopes-B-KX9EI8.js";
3
3
  import "./sources-DnjJPGfb.js";
4
- import { _ as writeOutputFiles, d as pgDeltaPath, g as underSchemaDir, h as serviceRel, r as driftOf, u as partPath } from "./output-files-DNid6TBl.js";
4
+ import { _ as writeOutputFiles, d as pgDeltaPath, g as underSchemaDir, h as serviceRel, r as driftOf, u as partPath } from "./output-files-D5D-8-4l.js";
5
5
  import { i as readJsonFile, o as sqlFiles, s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
6
6
  import { n as formatManifestJson, t as MANIFEST_FILE } from "./manifest-json-DMaBWmcG.js";
7
7
  import { c as requirePolicy } from "./load-CZnlAyZ8.js";
8
- import { n as hookUri } from "./rbac-CygtQB85.js";
9
- import { a as supabaseHookSql, c as asideAuthzReceive, f as isSupabaseSchemas, h as declarativeSql, i as supabaseHookManifest, l as configToml, m as schemasRefusal, n as hooklessDatabase, o as defaultOut, p as resolveSchemas, r as supabaseDatabaseManifest, s as hookMarker, t as grantsLabel } from "./hook-sql-Bxc_YRrd.js";
8
+ import { n as hookUri } from "./rbac-ir19O-e-.js";
9
+ import { a as supabaseHookSql, c as asideAuthzReceive, f as isSupabaseSchemas, h as declarativeSql, i as supabaseHookManifest, l as configToml, m as schemasRefusal, n as hooklessDatabase, o as defaultOut, p as resolveSchemas, r as supabaseDatabaseManifest, s as hookMarker, t as grantsLabel } from "./hook-sql-Cunsdk5x.js";
10
10
  import { r as HOOK_MARKER, s as hookMarkerFields } from "./markers-C-kThnKN.js";
11
- import { a as supabaseConfig } from "./supabase-config-CbK7xX77.js";
11
+ import { a as supabaseConfig } from "./supabase-config-BrhSp-U7.js";
12
12
  import { t as readMemberships } from "./read-memberships-BkePIa1F.js";
13
13
  import { n as pgConnector } from "./pg-CA651850.js";
14
14
  import { n as MIGRATION_DIRS } from "./constants-PCJiir_3.js";