permdock 0.18.1 → 0.20.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 (313) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +6 -6
  3. package/dist/{adoption-scan-CxExBYSJ.js → adoption-scan-BWL5H82_.js} +1 -1
  4. package/dist/agent/index.d.ts +2 -2
  5. package/dist/agent/index.js +1 -1
  6. package/dist/ai-sdk/index.d.ts +3 -3
  7. package/dist/ai-sdk/index.js +4 -4
  8. package/dist/{approval-normalize-CUjgSsOl.js → approval-normalize-hlfO9BJv.js} +8 -1
  9. package/dist/{approval-policies-oNnckT12.d.ts → approval-policies-CKlByf5o.d.ts} +1 -1
  10. package/dist/{approval-prompt-Bg7gDSqd.d.ts → approval-prompt-CQFiO1KE.d.ts} +1 -1
  11. package/dist/approvals/index.d.ts +4 -4
  12. package/dist/approvals/index.js +3 -3
  13. package/dist/{approvals-DGId_hgJ.js → approvals-CuXILe52.js} +9 -6
  14. package/dist/{arazzo--riLuGY0.js → arazzo-B_CPVseu.js} +2 -2
  15. package/dist/{arazzo-CEDbb-uM.js → arazzo-C8u26FUA.js} +1 -1
  16. package/dist/astro/index.d.ts +4 -4
  17. package/dist/astro/index.js +2 -2
  18. package/dist/{audience-B4YR9UpV.js → audience-BUonniPx.js} +1 -1
  19. package/dist/authzen/index.d.ts +5 -5
  20. package/dist/authzen/index.js +3 -3
  21. package/dist/{automation-Bfa_wD1h.d.ts → automation-CpOk7Tlu.d.ts} +1 -1
  22. package/dist/better-auth/index.d.ts +1 -1
  23. package/dist/better-auth/index.js +1 -1
  24. package/dist/better-supabase/index.d.ts +20 -17
  25. package/dist/better-supabase/index.js +9 -9
  26. package/dist/{better-supabase-BJtQ-kNf.js → better-supabase-ayun1IKE.js} +38 -4
  27. package/dist/{bind-DR6ku3A9.d.ts → bind-CW7nsZ86.d.ts} +7 -7
  28. package/dist/{bind-B4pMH9bm.js → bind-gwEbe9hL.js} +4 -4
  29. package/dist/{body-CJQwYVa8.js → body-C9JbIoqb.js} +1 -1
  30. package/dist/{build-instance-BFMFQdE_.js → build-instance-DaBdCRiz.js} +1 -1
  31. package/dist/{capability-BZ_veK9o.d.ts → capability-v2xZB7us.d.ts} +1 -1
  32. package/dist/{casbin-DCQHkkyj.js → casbin-DaY-CWOr.js} +1 -1
  33. package/dist/{casbin-bKC1FpEx.js → casbin-JWZGKqzy.js} +1 -1
  34. package/dist/catalog/index.d.ts +5 -5
  35. package/dist/catalog/index.js +5 -5
  36. package/dist/catalog-BTPySmbp.js +1 -0
  37. package/dist/{catalog-zzNuR3sY.js → catalog-DjDc87R2.js} +1 -1
  38. package/dist/{catalog-doc-C4DGfJCO.js → catalog-doc-nrgfbh8I.js} +2 -1
  39. package/dist/{catalog-D1fw8qif.js → catalog-s0waIrfY.js} +2 -2
  40. package/dist/{challenge-B2O2OLEk.js → challenge-DbkpCx_v.js} +1 -1
  41. package/dist/chat/index.d.ts +1 -1
  42. package/dist/chat/index.js +2 -2
  43. package/dist/chat-sdk/index.d.ts +3 -3
  44. package/dist/claude-agent/index.d.ts +3 -3
  45. package/dist/claude-agent/index.js +2 -2
  46. package/dist/clerk/index.d.ts +2 -2
  47. package/dist/cli/bin.js +1 -1
  48. package/dist/cli/index.d.ts +5 -5
  49. package/dist/cli/index.js +3 -3
  50. package/dist/{client-CH7vzSAY.d.ts → client-JK504UCq.d.ts} +15 -2
  51. package/dist/cloud/index.d.ts +8 -8
  52. package/dist/cloud/index.js +2 -2
  53. package/dist/{cloud-C0vXBmLG.js → cloud-pEhjaPNs.js} +2 -2
  54. package/dist/{codemod-C-L0w-u7.js → codemod-BUhreN8m.js} +2 -2
  55. package/dist/{codemod-eYI1FbeJ.js → codemod-Cv0-7Ogj.js} +1 -1
  56. package/dist/{collect-CU85z6Ta.js → collect-DMQ6Sxr6.js} +2 -2
  57. package/dist/{collect-D878zLDP.js → collect-DN_x7hvV.js} +1 -1
  58. package/dist/collect-eSTXOZDC.js +1 -0
  59. package/dist/compile/index.d.ts +1 -1
  60. package/dist/{compile-DBm0ub4p.d.ts → compile-DZftFfXc.d.ts} +2 -2
  61. package/dist/{completion-Dauc6pVT.js → completion-BG1wcLJ3.js} +1 -1
  62. package/dist/{config-COHmivz9.js → config-D2oXUwos.js} +8 -5
  63. package/dist/{config-DWp2PucY.js → config-Di9kWoLY.js} +1 -1
  64. package/dist/{config-report-DKpFm5ID.js → config-report-B0IyW7EQ.js} +2 -2
  65. package/dist/{config-shape-tsxHx71E.js → config-shape-D9paLhEX.js} +5 -1
  66. package/dist/{connection-B72dg5Q2.js → connection-QFsv-kbh.js} +1 -1
  67. package/dist/{context-DeammvFl.js → context-YhyXyqBI.js} +3 -2
  68. package/dist/convex/index.d.ts +4 -4
  69. package/dist/convex/index.js +3 -3
  70. package/dist/{core-D87h2kpR.d.ts → core-BOeGWbcR.d.ts} +2 -2
  71. package/dist/{core-B8sLve3z.js → core-BwVkrpsi.js} +5 -5
  72. package/dist/{create-BrQXL-Wt.d.ts → create-BezeYFcT.d.ts} +6 -6
  73. package/dist/{create-C-tm3KIF.js → create-C0R8omeF.js} +4 -4
  74. package/dist/{create-3A7J9KRR.js → create-DDUFG1ul.js} +69 -29
  75. package/dist/{create-BzwjZuRS.d.ts → create-DMCC5ZOi.d.ts} +7 -7
  76. package/dist/{create-CtoT1lIQ.d.ts → create-DYSYYiLr.d.ts} +4 -4
  77. package/dist/decide-set-DXEPepY1.js +100 -0
  78. package/dist/{delegation-input-FTxMK3ji.js → delegation-input-DcXhiMkf.js} +1 -1
  79. package/dist/delivery/index.d.ts +4 -4
  80. package/dist/delivery/index.js +1 -1
  81. package/dist/{denied-text-DlIxt8fh.d.ts → denied-text-De8cw3MW.d.ts} +1 -1
  82. package/dist/{describe-BKtC_8PG.d.ts → describe-DibQM6g-.d.ts} +1 -1
  83. package/dist/{diff-BnNHqtHj.js → diff-Bd1-VCe5.js} +4 -4
  84. package/dist/{diff-CBCzOTWM.js → diff-DXRNcjpg.js} +1 -1
  85. package/dist/{doctor-xUpR5rXg.js → doctor-Bp3xspBi.js} +15 -5
  86. package/dist/{doctor-CkYKCuX7.js → doctor-DpD4nHMS.js} +295 -66
  87. package/dist/drizzle/index.d.ts +3 -3
  88. package/dist/elysia/index.d.ts +4 -4
  89. package/dist/elysia/index.js +4 -4
  90. package/dist/{errors-TpzkEKgJ.d.ts → errors-OTE9u4Wk.d.ts} +1 -1
  91. package/dist/{errors-B6R_lg2a.js → errors-ynga1EQy.js} +1 -1
  92. package/dist/{evaluate-Czbj7thS.js → evaluate-Dcq_U2TV.js} +2 -2
  93. package/dist/{evaluations-CisTTURl.d.ts → evaluations-BgxEfPL7.d.ts} +3 -3
  94. package/dist/{evaluations-h3KoJAPa.js → evaluations-CNMVJVD6.js} +3 -3
  95. package/dist/eve/index.d.ts +4 -4
  96. package/dist/eve/index.js +3 -3
  97. package/dist/express/index.d.ts +4 -4
  98. package/dist/express/index.js +3 -3
  99. package/dist/fastify/index.d.ts +4 -4
  100. package/dist/fastify/index.js +3 -3
  101. package/dist/{fetch-adapter-BdmfnbJM.d.ts → fetch-adapter-DCQ4pZxf.d.ts} +2 -2
  102. package/dist/{fetch-adapter-DH-NJPbL.js → fetch-adapter-acq4dPX3.js} +3 -3
  103. package/dist/{fields-CrjL6A49.js → fields-COvJbUva.js} +1 -1
  104. package/dist/{from-snapshot-DMlSSo9b.js → from-snapshot-DHnb8Fh4.js} +2 -2
  105. package/dist/{gen-BEIN-DRM.js → gen-B2O9T25-.js} +1 -1
  106. package/dist/{gen-mf-MRwVr.js → gen-CKr1Vfiz.js} +2 -2
  107. package/dist/h3/index.d.ts +4 -4
  108. package/dist/h3/index.js +3 -3
  109. package/dist/{helpers-DmqGy63f.js → helpers-D-MXwkOF.js} +28 -4
  110. package/dist/hono/index.d.ts +4 -4
  111. package/dist/hono/index.js +5 -5
  112. package/dist/{hosted-waouw2V-.js → hosted-C2Pmhy2x.js} +4 -3
  113. package/dist/{hosted-BFNXwcjd.d.ts → hosted-yhyAuQkL.d.ts} +1 -1
  114. package/dist/{import-DObwEota.js → import-DG6uswAo.js} +1 -1
  115. package/dist/{import-C1XXpG_m.js → import-DVI_1tO_.js} +46 -2
  116. package/dist/{index-BhnOOnp9.d.ts → index--AwSBzJC.d.ts} +2 -2
  117. package/dist/{index-rFp6X_QP.d.ts → index-B_I6N8Ju.d.ts} +5 -5
  118. package/dist/{index-CVGio3cH.d.ts → index-Bt37QovT.d.ts} +4 -4
  119. package/dist/{index-Dfv9Toct.d.ts → index-CLbGOPBr.d.ts} +1 -1
  120. package/dist/{index-CdMOd-GY.d.ts → index-CruReRkB.d.ts} +24 -6
  121. package/dist/{index-CdUTE6qd.d.ts → index-D7xGi1LS.d.ts} +24 -10
  122. package/dist/index.d.ts +17 -17
  123. package/dist/index.js +15 -15
  124. package/dist/{init-CNJ8lLjo.js → init-C-cgOvCl.js} +1 -1
  125. package/dist/{init-DS3PEsCG.js → init-DAPbdjcX.js} +3 -3
  126. package/dist/{instance-options-2sFGSdsf.d.ts → instance-options-VPsNQsTH.d.ts} +1 -1
  127. package/dist/{instance-snapshot-BWa71my8.js → instance-snapshot-SX8zH_1t.js} +3 -3
  128. package/dist/jwt/index.d.ts +4 -4
  129. package/dist/{kernel-30Z2zM_d.js → kernel-_QEUOSU0.js} +7 -7
  130. package/dist/kysely/index.d.ts +3 -3
  131. package/dist/{login-DUVzBLh7.js → login-CQGjpkuo.js} +3 -3
  132. package/dist/{login-BgK5Jloo.js → login-Cgix5FgG.js} +1 -1
  133. package/dist/{manifest-wclLWBVH.js → manifest-CMu1IE0R.js} +38 -37
  134. package/dist/{map-error-BH16Ah8P.js → map-error-EOhahOVA.js} +3 -3
  135. package/dist/mcp/index.d.ts +57 -17
  136. package/dist/mcp/index.js +199 -53
  137. package/dist/{module-values-B8tNIxdd.js → module-values-BYuNtdK5.js} +1 -1
  138. package/dist/nest/index.d.ts +4 -4
  139. package/dist/nest/index.js +5 -5
  140. package/dist/next/index.d.ts +12 -12
  141. package/dist/next/index.js +8 -8
  142. package/dist/next/plugin.d.ts +1 -1
  143. package/dist/next/plugin.js +1 -1
  144. package/dist/node/index.d.ts +4 -4
  145. package/dist/node/index.js +2 -2
  146. package/dist/openai/index.d.ts +4 -4
  147. package/dist/openai/index.js +3 -3
  148. package/dist/openapi/index.d.ts +2 -2
  149. package/dist/{openapi-zMEB9qxn.js → openapi-FVeCoh97.js} +2 -2
  150. package/dist/{openapi-C4gFqeRz.js → openapi-lsf1gEtr.js} +2 -2
  151. package/dist/orpc/index.d.ts +21 -17
  152. package/dist/orpc/index.js +18 -11
  153. package/dist/otel/index.d.ts +3 -3
  154. package/dist/{output-BFWLER4r.js → output-DZQCr2lP.js} +1 -1
  155. package/dist/{ownership-D-mIt-w0.js → ownership-CBuIjxKh.js} +2 -1
  156. package/dist/{parse-UTC-sDrt.js → parse-CXTT7hBq.js} +1 -1
  157. package/dist/{parse-local-manifest-DvjTQNuO.d.ts → parse-local-manifest-CE4tgFsj.d.ts} +1 -1
  158. package/dist/{parse-local-manifest-CxcSMQgl.js → parse-local-manifest-Ce2N-Opr.js} +1 -1
  159. package/dist/pdp/index.d.ts +3 -3
  160. package/dist/pdp/index.js +2 -2
  161. package/dist/{permdock-D-_WrdKu.js → permdock-C1DN_7a-.js} +6 -6
  162. package/dist/{permdock-ffY4CMd9.d.ts → permdock-D4F2p5J8.d.ts} +4 -4
  163. package/dist/{permissions-B3ggI88M.js → permissions-8N2yFsUM.js} +1 -1
  164. package/dist/{policy-cV_wwPb8.js → policy-CaAME-Rh.js} +2 -2
  165. package/dist/{policy-BtKSApSt.d.ts → policy-Dh9WVSVz.d.ts} +1 -1
  166. package/dist/{policy-from-catalog-B68hGC0S.js → policy-from-catalog-CUNlpgz0.js} +6 -6
  167. package/dist/{policy-types-D-GwfQTc.d.ts → policy-types-BI9C5Sp5.d.ts} +32 -2
  168. package/dist/{postgrest-D84p5dbA.d.ts → postgrest-CWCCbaxm.d.ts} +1 -1
  169. package/dist/powersync-BV68Jh-T.js +1 -0
  170. package/dist/{powersync-DStC_g0B.js → powersync-CRtuJXVB.js} +2 -2
  171. package/dist/{powersync-9PYOE1wt.js → powersync-Dz4H1FLs.js} +77 -38
  172. package/dist/prisma/index.d.ts +2 -2
  173. package/dist/{problem-BVLHFK33.js → problem-BWP1l86g.js} +8 -7
  174. package/dist/{protected-action-B40tU3yP.js → protected-action-CD1HXwQK.js} +2 -2
  175. package/dist/{protected-action-Ds_EUY8B.d.ts → protected-action-ua0cx5cW.d.ts} +5 -5
  176. package/dist/{provider-OtnIiFWm.d.ts → provider-D_hgjZRa.d.ts} +1 -1
  177. package/dist/{provider-CY4TSSJo.js → provider-qESIf_C0.js} +5 -2
  178. package/dist/{provider-store-BQP_pp8s.js → provider-store-BTHGJH9j.js} +3 -2
  179. package/dist/pull-AOmtUo8V.js +1 -0
  180. package/dist/{pull-DLP4I1Kl.js → pull-DnhBA9pf.js} +3 -3
  181. package/dist/{push-BSb8j1EW.js → push-D2SsRW0U.js} +3 -3
  182. package/dist/{pushed-policy-BecMsTtM.js → pushed-policy-BERO0x9O.js} +1 -1
  183. package/dist/{pushed-policy-Ck3FZcoy.d.ts → pushed-policy-P0hgyLBh.d.ts} +1 -1
  184. package/dist/react/index.d.ts +6 -6
  185. package/dist/react/index.js +3 -3
  186. package/dist/react/provider-client.d.ts +1 -1
  187. package/dist/react/provider-client.js +1 -1
  188. package/dist/react-native/index.d.ts +28 -14
  189. package/dist/react-native/index.js +57 -37
  190. package/dist/{replay-E5X9E1lC.d.ts → replay-DYXI4gRN.d.ts} +1 -1
  191. package/dist/{request-context-DM6_jY1n.js → request-context-BPTi68z5.js} +1 -1
  192. package/dist/resend/index.d.ts +4 -4
  193. package/dist/resend/index.js +2 -2
  194. package/dist/{resolve-names-CBl4r4_r.js → resolve-names-CDnxNqNb.js} +2 -2
  195. package/dist/{rls-pAHGYgTb.js → rls-CHZi5SUK.js} +1 -1
  196. package/dist/{rls-DGBL-jDY.js → rls-CbDKv6GP.js} +19 -13
  197. package/dist/{role-builder-CMW4wWzn.js → role-builder-C5AgaC1x.js} +18 -3
  198. package/dist/rpc-D2LnFELm.d.ts +22 -0
  199. package/dist/{rpc-KwX_Jcxz.js → rpc-DdkbQVlT.js} +16 -6
  200. package/dist/{run-B7lv3NuK.js → run-Bnm5VZ8m.js} +3 -3
  201. package/dist/run-D6U-Gwok.js +1 -0
  202. package/dist/{run-ticket-DPaD27_r.d.ts → run-ticket-94DOS9Cd.d.ts} +2 -2
  203. package/dist/{saas-B8H1MsQ3.js → saas-BEXnrH9H.js} +4 -4
  204. package/dist/{scan-0r3OZqqK.js → scan-VKkU4Ix9.js} +1 -1
  205. package/dist/{schema-B_9tXrbG.js → schema-5onstWlb.js} +1 -1
  206. package/dist/{schema-CuX70xgH.js → schema-BlnU_TzE.js} +4 -0
  207. package/dist/scim/index.d.ts +1 -1
  208. package/dist/server/index.d.ts +10 -10
  209. package/dist/server/index.js +5 -5
  210. package/dist/{server-types-3OnXjZ2D.d.ts → server-types-ChzXWU4Y.d.ts} +31 -13
  211. package/dist/{sink-ogbVkyeo.d.ts → sink-RwmP7ZHs.d.ts} +2 -2
  212. package/dist/{skills-C9sTD70r.js → skills-B6sLqv4E.js} +1 -1
  213. package/dist/{skills-B4MPRxQd.js → skills-Yz3LfoAZ.js} +1 -1
  214. package/dist/{snapshot-DN_8J27z.js → snapshot-DHPih65J.js} +2 -1
  215. package/dist/{snapshot-cache-B4YvlGG_.d.ts → snapshot-cache-MPinwwgZ.d.ts} +1 -1
  216. package/dist/solid/index.d.ts +5 -5
  217. package/dist/solid/index.js +3 -2
  218. package/dist/solid-start/index.d.ts +4 -4
  219. package/dist/solid-start/index.js +3 -3
  220. package/dist/{sources-xdQShLDU.d.ts → sources-sgQlMfmz.d.ts} +1 -1
  221. package/dist/{src-Brzq_0in.js → src-B8SQNsvw.js} +30 -13
  222. package/dist/ssf/index.d.ts +3 -3
  223. package/dist/ssf/index.js +2 -2
  224. package/dist/{standard-webhooks-BfPaZ6T1.d.ts → standard-webhooks-CFZIYtBF.d.ts} +2 -2
  225. package/dist/{store-DmVqy74I.js → store-CSOsXd5s.js} +8 -6
  226. package/dist/{store-DYeB-_U3.d.ts → store-Dpg_fSNQ.d.ts} +31 -4
  227. package/dist/{store-options--zWn48PK.js → store-options-CDvoX52-.js} +31 -8
  228. package/dist/{stores-EPul_8MN.d.ts → stores-C2A6KsxE.d.ts} +5 -5
  229. package/dist/{stores-BYFopOm1.js → stores-PpYVQ5yF.js} +1 -1
  230. package/dist/{stream-CDvF0sJm.js → stream-DQ3rbO3J.js} +1 -1
  231. package/dist/supabase/client.d.ts +1 -1
  232. package/dist/supabase/client.js +32 -4
  233. package/dist/supabase/index.d.ts +10 -5
  234. package/dist/supabase/index.js +1 -1
  235. package/dist/supabase/middleware.d.ts +5 -5
  236. package/dist/supabase/middleware.js +5 -5
  237. package/dist/{supabase-BiViJpQ4.js → supabase-CVZuytCC.js} +2 -2
  238. package/dist/{supabase-CogTyJH2.js → supabase-CWpADE8k.js} +2 -2
  239. package/dist/supabase-hook-Clczf4iF.js +1 -0
  240. package/dist/{supabase-hook-DX38Hj8h.js → supabase-hook-bDeWbKee.js} +151 -55
  241. package/dist/{supautils-BGf6zRvM.js → supautils-0RrdsFT3.js} +7 -7
  242. package/dist/svelte/index.d.ts +5 -5
  243. package/dist/svelte/index.js +3 -3
  244. package/dist/svelte/runtime.d.ts +3 -3
  245. package/dist/svelte/runtime.js +1 -1
  246. package/dist/svelte/source.d.ts +5 -5
  247. package/dist/svelte/source.js +2 -2
  248. package/dist/sveltekit/index.d.ts +4 -4
  249. package/dist/sveltekit/index.js +2 -2
  250. package/dist/{tables-BfOk0ymL.js → tables-C53U2zrN.js} +1 -1
  251. package/dist/tanstack-start/index.d.ts +4 -4
  252. package/dist/tanstack-start/index.js +2 -2
  253. package/dist/terminal/index.d.ts +5 -5
  254. package/dist/terminal/index.js +4 -4
  255. package/dist/testing/core.d.ts +1 -1
  256. package/dist/testing/core.js +1 -1
  257. package/dist/testing/fixtures/index.d.ts +1 -1
  258. package/dist/testing/fixtures/index.js +1 -1
  259. package/dist/testing/index.d.ts +23 -23
  260. package/dist/testing/index.js +22 -22
  261. package/dist/testing/saas/index.d.ts +3 -3
  262. package/dist/testing/saas/index.js +2 -2
  263. package/dist/testing/saas/permissions.js +1 -1
  264. package/dist/trpc/index.d.ts +15 -8
  265. package/dist/trpc/index.js +23 -19
  266. package/dist/{type-helpers-i1EJ3Eb1.d.ts → type-helpers-BjOLGVy1.d.ts} +1 -1
  267. package/dist/{types-D-JO7lh8.d.ts → types--_lpWUGV.d.ts} +5 -5
  268. package/dist/{types-NYoj8JBm.d.ts → types-7Vlz1Wi2.d.ts} +1 -0
  269. package/dist/{types-CqcsNCaN.d.ts → types-BzxA2OAD.d.ts} +13 -1
  270. package/dist/{types-D19MK4t-.d.ts → types-C5p2hoBR.d.ts} +3 -3
  271. package/dist/{types-B8qUkGja.d.ts → types-CMclYgSk.d.ts} +2 -2
  272. package/dist/{types-3Y8UpFkF.d.ts → types-D1NjjwI4.d.ts} +68 -4
  273. package/dist/{types-DGf_cpKF.d.ts → types-D8JVDWOr.d.ts} +2 -2
  274. package/dist/{types-Ck1KOfug.d.ts → types-DBVSljAx.d.ts} +2 -2
  275. package/dist/{types-CDVXR6YD.d.ts → types-DZwEOsK1.d.ts} +1 -1
  276. package/dist/{types-DmbfLu2p.d.ts → types-DnzRZjEu.d.ts} +9 -4
  277. package/dist/{types-o1vu6Ks3.d.ts → types-Drs3OOAy.d.ts} +4 -4
  278. package/dist/{types-CCEeSCMB.d.ts → types-p8mhWTcR.d.ts} +3 -3
  279. package/dist/unplugin/index.d.ts +1 -1
  280. package/dist/unplugin/index.js +1 -1
  281. package/dist/{usage-DC0UKe6C.js → usage-B6gmS634.js} +7 -5
  282. package/dist/{usage-DYtRVkcN.js → usage-BFMCEgJp.js} +1 -1
  283. package/dist/usage-Csu-M5jC.js +1 -0
  284. package/dist/{validation-error-Dx8PipbO.d.ts → validation-error-DkOK9zUE.d.ts} +1 -1
  285. package/dist/{verify-Bpj0hauG.js → verify-DFruUfZg.js} +79 -58
  286. package/dist/{version-cache-DzNKWiI6.d.ts → version-cache-q5cpaDSt.d.ts} +1 -1
  287. package/dist/vue/index.d.ts +5 -5
  288. package/dist/vue/index.js +2 -2
  289. package/dist/{waiter-NK_UuZbb.d.ts → waiter-BjVI_Byg.d.ts} +2 -2
  290. package/dist/watch-CS69ftMP.js +1 -0
  291. package/dist/{watch-CBHADqBH.js → watch-Dz2LNM1R.js} +2 -2
  292. package/dist/webmcp/index.d.ts +1 -1
  293. package/dist/{where-scope-BKrqUDVk.js → where-scope-BAyOsPQW.js} +1 -1
  294. package/dist/{who-can-KhVWMxtf.js → who-can-CZeAwQZD.js} +1 -1
  295. package/dist/workflow/index.d.ts +3 -3
  296. package/dist/workflow/index.js +2 -2
  297. package/dist/workflow-sdk/index.d.ts +4 -4
  298. package/dist/{wrap-BHGA-SMM.d.ts → wrap-CE5lxje7.d.ts} +2 -2
  299. package/package.json +1 -1
  300. package/schemas/catalog-v1.json +8 -0
  301. package/skills/permdock-agents/references/runtimes.md +2 -2
  302. package/skills/permdock-data/SKILL.md +1 -1
  303. package/skills/permdock-data/references/queries-and-rls.md +2 -0
  304. package/skills/permdock-wire/references/adapters.md +1 -1
  305. package/dist/catalog-Caqhbdix.js +0 -1
  306. package/dist/collect-KCtOigxx.js +0 -1
  307. package/dist/powersync-xNRlC4jN.js +0 -1
  308. package/dist/pull-UBjDnf4b.js +0 -1
  309. package/dist/run-UPbacxPg.js +0 -1
  310. package/dist/stream-W2RuUYly.d.ts +0 -13
  311. package/dist/supabase-hook-BN46IrVI.js +0 -1
  312. package/dist/usage-Cl5eb-e1.js +0 -1
  313. package/dist/watch-OYwAPCzx.js +0 -1
@@ -1,11 +1,11 @@
1
1
  import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
2
2
  import { c as isConditionDate, l as isConditionRef, o as hasConditionOp } from "./refs-C8BKxc_e.js";
3
- import { A as memoryCustomRoleSource, g as localSnapshotManifest } from "./src-Brzq_0in.js";
3
+ import { A as memoryCustomRoleSource, g as localSnapshotManifest } from "./src-B8SQNsvw.js";
4
4
  import { n as findPermission } from "./permission-registry-B8tYxPIt.js";
5
5
  import { d as scopeList, s as resolveScope } from "./scopes-BSdYaGHs.js";
6
- import { l as policyLevels } from "./policy-cV_wwPb8.js";
6
+ import { l as policyLevels } from "./policy-CaAME-Rh.js";
7
7
  import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
8
- import { t as getPermDock } from "./permdock-D-_WrdKu.js";
8
+ import { t as getPermDock } from "./permdock-C1DN_7a-.js";
9
9
  import { u as usageResult } from "./errors-BhRkoNS7.js";
10
10
  import { c as requirePolicy } from "./load-BaEamml-.js";
11
11
  import { s as quoteSqlLiteral, t as SQL_IDENT } from "./sql-0WjxIp9g.js";
@@ -14,12 +14,12 @@ import { d as keptKeys, t as AUTHZ_VERSION_TABLE } from "./sources-C4vkzZJV.js";
14
14
  import { t as applyFiles } from "./files-CfiRtQ-m.js";
15
15
  import { i as fileDrift } from "./output-files-CM0BnH05.js";
16
16
  import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-Cemqurt8.js";
17
+ import { n as pgConnector } from "./pg-Ddxsd5ZB.js";
17
18
  import { A as quoteQualified, O as quoteIdent, a as customRolesOn, t as CUSTOM_ROLES } from "./shared-DyYVEjKC.js";
18
- import { n as tableNameOf, r as tableNames } from "./tables-BfOk0ymL.js";
19
- import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, t as ownershipRules, u as roleNames } from "./ownership-D-mIt-w0.js";
19
+ import { n as tableNameOf, r as tableNames } from "./tables-C53U2zrN.js";
20
+ import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, t as ownershipRules, u as roleNames } from "./ownership-CBuIjxKh.js";
20
21
  import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
21
- import { n as pgConnector } from "./pg-Ddxsd5ZB.js";
22
- import { m as tableFor, t as canFixture } from "./verify-Bpj0hauG.js";
22
+ import { m as tableFor, t as canFixture } from "./verify-DFruUfZg.js";
23
23
  import { resolve } from "node:path";
24
24
  //#region src/cli/powersync/claims.ts
25
25
  /** The `/docs` section that explains why a claim stream needs a reconnect. */
@@ -124,10 +124,56 @@ function streamOf(source) {
124
124
  if (stream.expiresAt !== void 0) return `the ${stream.table} membership source has no stream: it has an expiry`;
125
125
  return stream;
126
126
  }
127
- function pairOf(through) {
128
- const [pair] = Object.entries(through.on);
129
- if (pair === void 0) throw new TypeError(`PermDock CLI: the reference to ${through.through} names no column`);
130
- return pair;
127
+ /**
128
+ * Every `on` pair of the reference: the referencing column, then the column of
129
+ * `through` it references. A composite key (`organization_id` and `user_id`)
130
+ * matches only when every pair does.
131
+ */
132
+ function pairsOf(through) {
133
+ const pairs = Object.entries(through.on);
134
+ if (pairs.length === 0) throw new TypeError(`PermDock CLI: the reference to ${through.through} names no column`);
135
+ return pairs;
136
+ }
137
+ /** The `ON` of a join from `table` to `keys`, the bare name of `through`. */
138
+ function joinOn(through, keys, table, dialect) {
139
+ return pairsOf(through).map(([ref, id]) => `${dialect.column(keys, id)} = ${dialect.column(table, ref)}`).join(" AND ");
140
+ }
141
+ /**
142
+ * The select list of a `through` row. PowerSync keys every synced row on an
143
+ * `id` column, so a composite reference selects its key columns and the value
144
+ * column with `id` built from them; a single reference keeps `*`.
145
+ */
146
+ function throughSelect(through, keys, dialect) {
147
+ const pairs = pairsOf(through);
148
+ if (pairs.length === 1) return "*";
149
+ const columns = [.../* @__PURE__ */ new Set([...pairs.map(([, id]) => id), through.column])].map((column) => dialect.column(keys, column));
150
+ return `${columns.join(", ")}, ${columns.join(` || ${dialect.literal(":")} || `)} AS id`;
151
+ }
152
+ /**
153
+ * The query of the `through` rows the user's own rows reference. A pair on the
154
+ * user column compares with the signed-in user, so a composite junction keyed
155
+ * on the tenant and the user syncs only the user's rows; `user` then names the
156
+ * junction's user column.
157
+ */
158
+ function throughRows(through, own, dialect, ownUser) {
159
+ const keys = bare(through.through, dialect);
160
+ const pairs = pairsOf(through);
161
+ const user = pairs.find(([ref]) => ref === ownUser)?.[1];
162
+ const where = pairs.flatMap(([ref, id]) => {
163
+ const owned = `${dialect.column(keys, id)} IN (SELECT ${dialect.column(own.table, ref)} FROM ${own.from} WHERE ${own.where.join(" AND ")})`;
164
+ if (id !== user) return [owned];
165
+ const mine = `${dialect.column(keys, id)} = ${dialect.user}`;
166
+ return pairs.length === 1 ? [mine, owned] : [mine];
167
+ });
168
+ const query = `SELECT ${throughSelect(through, keys, dialect)} FROM ${fromTable(through.through, dialect)} WHERE ${where.join(" AND ")}`;
169
+ return user === void 0 ? {
170
+ table: keys,
171
+ query
172
+ } : {
173
+ table: keys,
174
+ query,
175
+ user
176
+ };
131
177
  }
132
178
  function isFixed(roles) {
133
179
  return typeof roles === "object" && "value" in roles;
@@ -160,10 +206,9 @@ function ownRows(stream, dialect, scope, keep = false) {
160
206
  ]
161
207
  };
162
208
  const users = bare(stream.user.through, dialect);
163
- const [ref, id] = pairOf(stream.user);
164
209
  return {
165
210
  table,
166
- from: `${fromTable(stream.table, dialect)} INNER JOIN ${fromTable(stream.user.through, dialect)} ON ${dialect.column(users, id)} = ${dialect.column(table, ref)}`,
211
+ from: `${fromTable(stream.table, dialect)} INNER JOIN ${fromTable(stream.user.through, dialect)} ON ${joinOn(stream.user, users, table, dialect)}`,
167
212
  where: [
168
213
  `${dialect.column(users, stream.user.column)} = ${dialect.user}`,
169
214
  ...scoped,
@@ -188,11 +233,10 @@ function roleFilter(stream, source, role, table, dialect) {
188
233
  };
189
234
  }
190
235
  const keys = bare(source.through, dialect);
191
- const [ref, id] = pairOf(source);
192
236
  const { guard } = stream;
193
237
  const guarded = guard !== void 0 && bare(guard.table, dialect) === keys && guard.declared.includes(role) ? [anyOf([`${dialect.column(keys, guard.tenant)} IS NULL`, ...guard.skip === void 0 ? [] : [`${dialect.column(keys, guard.skip)} = ${dialect.literal(true)}`]])] : [];
194
238
  return {
195
- join: ` INNER JOIN ${fromTable(source.through, dialect)} ON ${dialect.column(keys, id)} = ${dialect.column(table, ref)}`,
239
+ join: ` INNER JOIN ${fromTable(source.through, dialect)} ON ${joinOn(source, keys, table, dialect)}`,
196
240
  where: [`${dialect.column(keys, source.column)} = ${dialect.literal(role)}`, ...guarded].join(" AND ")
197
241
  };
198
242
  }
@@ -239,15 +283,8 @@ function sourceIn(stream, scope, left, roles, ctx, keep = false) {
239
283
  function roleTableRows(stream, dialect, keep = false) {
240
284
  if (isFixed(stream.roles)) return [];
241
285
  const own = ownRows(stream, dialect, void 0, keep);
242
- return roleSources(stream.roles).flatMap((source) => {
243
- if (typeof source === "string" || "map" in source) return [];
244
- const keys = bare(source.through, dialect);
245
- const [ref, id] = pairOf(source);
246
- return [{
247
- table: keys,
248
- query: `SELECT * FROM ${fromTable(source.through, dialect)} WHERE ${dialect.column(keys, id)} IN (SELECT ${dialect.column(own.table, ref)} FROM ${own.from} WHERE ${own.where.join(" AND ")})`
249
- }];
250
- });
286
+ const user = typeof stream.user === "string" ? stream.user : void 0;
287
+ return roleSources(stream.roles).flatMap((source) => typeof source === "string" || "map" in source ? [] : [throughRows(source, own, dialect, user)]);
251
288
  }
252
289
  //#endregion
253
290
  //#region src/cli/powersync/version.ts
@@ -267,13 +304,15 @@ function authzVersionTable(config) {
267
304
  //#endregion
268
305
  //#region src/cli/powersync/rows.ts
269
306
  function throughColumn(through, device) {
270
- const [pair] = Object.entries(through.on);
307
+ const pairs = Object.entries(through.on);
308
+ const [pair] = pairs;
271
309
  return {
272
310
  column: pair?.[0] ?? "",
273
311
  through: {
274
312
  table: device(through.through),
275
313
  id: pair?.[1] ?? "",
276
- column: through.column
314
+ column: through.column,
315
+ ...pairs.length > 1 ? { on: { ...through.on } } : {}
277
316
  }
278
317
  };
279
318
  }
@@ -378,11 +417,10 @@ function roleKeyOf(role, table, dialect) {
378
417
  roleKey: dialect.column(table, role)
379
418
  };
380
419
  if ("map" in role) return;
381
- const [pair] = Object.entries(role.on);
382
- if (pair === void 0) return;
420
+ if (Object.keys(role.on).length === 0) return;
383
421
  const keys = bare(role.through, dialect);
384
422
  return {
385
- join: ` INNER JOIN ${fromTable(role.through, dialect)} ON ${dialect.column(keys, pair[1])} = ${dialect.column(table, pair[0])}`,
423
+ join: ` INNER JOIN ${fromTable(role.through, dialect)} ON ${joinOn(role, keys, table, dialect)}`,
386
424
  roleKey: dialect.column(keys, role.column)
387
425
  };
388
426
  }
@@ -740,10 +778,8 @@ function membershipIn(table, idColumn, left, roles, ctx, keep = false) {
740
778
  if (values.length === 0) return ["1 = 0"];
741
779
  return [`${left} IN (SELECT ${ctx.dialect.column(name, idColumn)} FROM ${fromTable(table.table, ctx.dialect)} WHERE ${[...filters, `${ctx.dialect.column(name, source.column)} IN (${values.join(", ")})`].join(" AND ")})`];
742
780
  }
743
- const [pair] = Object.entries(source.on);
744
781
  const keys = bare(source.through, ctx.dialect);
745
- const [ref, id] = pair ?? ["", ""];
746
- return [`${left} IN (SELECT ${ctx.dialect.column(name, idColumn)} FROM ${fromTable(table.table, ctx.dialect)} INNER JOIN ${fromTable(source.through, ctx.dialect)} ON ${ctx.dialect.column(keys, id)} = ${ctx.dialect.column(name, ref)} WHERE ${[...filters, `${ctx.dialect.column(keys, source.column)} IN (${list})`].join(" AND ")})`];
782
+ return [`${left} IN (SELECT ${ctx.dialect.column(name, idColumn)} FROM ${fromTable(table.table, ctx.dialect)} INNER JOIN ${fromTable(source.through, ctx.dialect)} ON ${joinOn(source, keys, name, ctx.dialect)} WHERE ${[...filters, `${ctx.dialect.column(keys, source.column)} IN (${list})`].join(" AND ")})`];
747
783
  });
748
784
  }
749
785
  /**
@@ -865,12 +901,15 @@ function subjectStreams(ctx) {
865
901
  const active = disabledAt !== void 0 && keptKeys(rls?.suspension?.memberships).length === 0 ? ` AND ${dialect.column(name, disabledAt)} IS NULL` : "";
866
902
  const mine = `${dialect.column(name, user)} = ${dialect.user}${active}`;
867
903
  add(name, `SELECT * FROM ${fromTable(table, dialect)} WHERE ${mine}`, user);
904
+ const rows = {
905
+ table: name,
906
+ from: fromTable(table, dialect),
907
+ where: [mine]
908
+ };
868
909
  for (const through of roleThroughs(role)) {
869
- const keys = bare(through.through, dialect);
870
- const [pair] = Object.entries(through.on);
871
- if (pair === void 0) continue;
872
- const [ref, id] = pair;
873
- add(keys, `SELECT * FROM ${fromTable(through.through, dialect)} WHERE ${dialect.column(keys, id)} IN (SELECT ${dialect.column(name, ref)} FROM ${fromTable(table, dialect)} WHERE ${mine})`);
910
+ if (Object.keys(through.on).length === 0) continue;
911
+ const keys = throughRows(through, rows, dialect, user);
912
+ add(keys.table, keys.query, keys.user);
874
913
  }
875
914
  };
876
915
  const memberships = rls?.memberships;
@@ -883,7 +922,7 @@ function subjectStreams(ctx) {
883
922
  const users = bare(stream.user.through, dialect);
884
923
  add(users, `SELECT * FROM ${fromTable(stream.user.through, dialect)} WHERE ${dialect.column(users, stream.user.column)} = ${dialect.user}`, stream.user.column);
885
924
  }
886
- for (const keys of roleTableRows(stream, dialect, keep)) add(keys.table, keys.query);
925
+ for (const keys of roleTableRows(stream, dialect, keep)) add(keys.table, keys.query, keys.user);
887
926
  }
888
927
  const schema = rls?.schema ?? "permdock";
889
928
  const database = rls?.authorize === "database";
@@ -1,5 +1,5 @@
1
- import { Kt as Instant, wr as Condition, yr as Subject } from "../policy-types-D-GwfQTc.js";
2
- import { f as WhereResult } from "../permdock-ffY4CMd9.js";
1
+ import { Er as Condition, qt as Instant, xr as Subject } from "../policy-types-BI9C5Sp5.js";
2
+ import { f as WhereResult } from "../permdock-D4F2p5J8.js";
3
3
  import { r as RelationsMapping } from "../graph-sql-BwFC4Qjs.js";
4
4
  import { n as RowCheck, t as WithSubjectOptions } from "../subject-settings-vNW8qmUH.js";
5
5
  //#region src/prisma/model-fields.d.ts
@@ -2,7 +2,7 @@ import { t as compact } from "./compact-CAf557ZB.js";
2
2
  import { n as freezeDeep } from "./freeze-jjan0lCv.js";
3
3
  import { n as PermDockValidationError } from "./validation-error-CYg2kJEw.js";
4
4
  import { a as problemType, i as stepUpOf, n as problemDetails, o as statusProblem, t as notFoundDetails } from "./problem-details-CLDgX1KV.js";
5
- import { a as deniedMessage, i as approvalMessage } from "./errors-B6R_lg2a.js";
5
+ import { a as deniedMessage, i as approvalMessage } from "./errors-ynga1EQy.js";
6
6
  import { a as durationOf, g as secondsOf, p as nowSeconds } from "./time-nR1JesoH.js";
7
7
  //#region src/server/problem.ts
8
8
  function quoted(value) {
@@ -135,13 +135,14 @@ function validationOf(decision, disclosure) {
135
135
  return disclosure !== "hide" && detail instanceof PermDockValidationError ? detail : void 0;
136
136
  }
137
137
  /** The Problem Details body `problemFromDecision` answers with. */
138
- function decisionProblem(decision, permission, subject, options = {}) {
139
- return validationOf(decision, options.disclosure)?.toProblemDetails() ?? refusalDetails(decision, permission, subject, options);
138
+ function decisionProblem(decision, permission, options = {}) {
139
+ return validationOf(decision, options.disclosure)?.toProblemDetails() ?? refusalDetails(decision, permission, options);
140
140
  }
141
- function refusalDetails(decision, permission, subject, options) {
141
+ /** The `detail` names the permission and the denials, never the subject. */
142
+ function refusalDetails(decision, permission, options) {
142
143
  const details = problemDetails(compact({
143
144
  decision,
144
- detail: decision.outcome === "approval-required" ? approvalMessage(permission.key, decision.reason, decision.token) : deniedMessage(permission.key, subject?.principal?.id, decision.denials, decision.alternatives.map((leaf) => leaf.key), subject !== void 0),
145
+ detail: decision.outcome === "approval-required" ? approvalMessage(permission.key, decision.reason, decision.token) : deniedMessage(permission.key, void 0, decision.denials, decision.alternatives.map((leaf) => leaf.key), false),
145
146
  instance: options.instance,
146
147
  permission: permission.key,
147
148
  scope: permission.scope,
@@ -157,14 +158,14 @@ function refusalDetails(decision, permission, subject, options) {
157
158
  approval
158
159
  };
159
160
  }
160
- function problemFromDecision(decision, permission, subject, options = {}) {
161
+ function problemFromDecision(decision, permission, _subject, options = {}) {
161
162
  if (decision.outcome === "granted") return new Response(null, { status: 204 });
162
163
  const validation = validationOf(decision, options.disclosure);
163
164
  if (validation !== void 0) return problemResponse(validation.toProblemDetails(), options.scope === void 0 ? permission : {
164
165
  ...permission,
165
166
  scope: options.scope
166
167
  }, decision);
167
- return decisionResponse(refusalDetails(decision, permission, subject, options), decision, compact({
168
+ return decisionResponse(refusalDetails(decision, permission, options), decision, compact({
168
169
  scope: options.scope ?? permission.scope,
169
170
  credentials: options.credentials
170
171
  }));
@@ -1,6 +1,6 @@
1
1
  import { n as actionRunner, t as actionApproval } from "./protected-action-OpOxtTsN.js";
2
2
  import { c as rolesView, d as subjectView, f as tenantView, i as gateView, l as scopedTenant, n as describeWith, o as permissionSet, r as filterResult, s as protectedView, t as approvalHandle, u as slotContent } from "./views-MWmJ6Y4P.js";
3
- import { n as storeOf } from "./store-options--zWn48PK.js";
3
+ import { n as storeOf } from "./store-options-CDvoX52-.js";
4
4
  import { a as PermDockUiContext, i as PermDockStoreContext, r as PermDockSnapshotPromiseContext } from "./live-options-BBIT68le.js";
5
5
  import { Suspense, use, useEffect, useLayoutEffect, useMemo, useState, useSyncExternalStore } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
@@ -14,7 +14,7 @@ function useStore() {
14
14
  }
15
15
  function usePermDock() {
16
16
  const store = useStore();
17
- return useSyncExternalStore((listener) => store.subscribe(listener), () => store.get(), () => store.get());
17
+ return useSyncExternalStore((listener) => store.subscribe(listener), () => store.get(), () => store.serverGet());
18
18
  }
19
19
  /**
20
20
  * Adds refresh triggers to the nearest provider while the component is mounted.
@@ -1,11 +1,11 @@
1
- import { M as PolicyVocabulary, gr as Membership, qn as Decision } from "./policy-types-D-GwfQTc.js";
1
+ import { N as PolicyVocabulary, Yn as Decision, vr as Membership } from "./policy-types-BI9C5Sp5.js";
2
2
  import { u as Permission } from "./permission-types-CAY-GU7e.js";
3
3
  import { r as Role } from "./vocabulary-DEJ5j4mR.js";
4
- import { d as UncheckedData, s as RowData } from "./permdock-ffY4CMd9.js";
5
- import { r as DescribeOptions, t as DecisionDescription } from "./describe-BKtC_8PG.js";
6
- import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, f as ProtectedActionHandle, g as SubjectView, h as RolesOptions, l as GateView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, y as ProtectedAction } from "./store-DYeB-_U3.js";
4
+ import { d as UncheckedData, s as RowData } from "./permdock-D4F2p5J8.js";
5
+ import { r as DescribeOptions, t as DecisionDescription } from "./describe-DibQM6g-.js";
6
+ import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, f as ProtectedActionHandle, g as SubjectView, h as RolesOptions, l as GateView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, y as ProtectedAction } from "./store-Dpg_fSNQ.js";
7
7
  import { r as RefreshTrigger } from "./refresh-on-L9UOwATg.js";
8
- import { r as ProtectedProps } from "./types-DmbfLu2p.js";
8
+ import { r as ProtectedProps } from "./types-DnzRZjEu.js";
9
9
  import { ReactNode } from "react";
10
10
  //#region src/react/hooks.d.ts
11
11
  declare function usePermDock<V extends PolicyVocabulary = PolicyVocabulary>(): ClientPermDock<V>;
@@ -1,4 +1,4 @@
1
- import { n as PermDockProviderProps } from "./types-DmbfLu2p.js";
1
+ import { n as PermDockProviderProps } from "./types-DnzRZjEu.js";
2
2
  import { ReactElement } from "react";
3
3
  //#region src/react/provider.d.ts
4
4
  declare function PermDockProvider(props: PermDockProviderProps): ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { t as compact } from "./compact-CAf557ZB.js";
2
- import { t as emptySnapshot } from "./from-snapshot-DMlSSo9b.js";
3
- import { t as adapterStore } from "./store-options--zWn48PK.js";
2
+ import { t as emptySnapshot } from "./from-snapshot-DHnb8Fh4.js";
3
+ import { t as adapterStore } from "./store-options-CDvoX52-.js";
4
4
  import { a as PermDockUiContext, i as PermDockStoreContext, n as useKeyed, r as PermDockSnapshotPromiseContext, t as useLiveOptions } from "./live-options-BBIT68le.js";
5
5
  import { useLayoutEffect, useMemo } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
@@ -13,6 +13,7 @@ function PermDockProvider(props) {
13
13
  const store = useKeyed(() => adapterStore(compact({
14
14
  endpoint: props.endpoint,
15
15
  snapshotUrl: props.snapshotUrl,
16
+ fetchSnapshot: props.fetchSnapshot,
16
17
  approvals: props.approvals,
17
18
  tenant: props.tenant,
18
19
  fetch: live.fetch,
@@ -29,6 +30,7 @@ function PermDockProvider(props) {
29
30
  props.snapshot,
30
31
  props.endpoint,
31
32
  props.snapshotUrl,
33
+ props.fetchSnapshot,
32
34
  props.approvals,
33
35
  props.tenant,
34
36
  live.fetch,
@@ -40,6 +42,7 @@ function PermDockProvider(props) {
40
42
  live.onClear,
41
43
  props.approvalInterval
42
44
  ]);
45
+ if (promise !== null && !suspend) store.seed(promise);
43
46
  const ui = useMemo(() => ({
44
47
  defaults: props.defaults,
45
48
  messages: props.messages
@@ -1,6 +1,6 @@
1
1
  import { t as compact } from "./compact-CAf557ZB.js";
2
- import { t as emptySnapshot } from "./from-snapshot-DMlSSo9b.js";
3
- import { l as isPromiseLike, t as adapterStore } from "./store-options--zWn48PK.js";
2
+ import { t as emptySnapshot } from "./from-snapshot-DHnb8Fh4.js";
3
+ import { l as isPromiseLike, t as adapterStore } from "./store-options-CDvoX52-.js";
4
4
  //#region src/client/provider-store.ts
5
5
  /**
6
6
  * Store options that read `read()` on every request, so a rotated token, a new
@@ -27,6 +27,7 @@ function providerStore(options, read, snapshot) {
27
27
  const store = adapterStore(compact({
28
28
  endpoint: options.endpoint,
29
29
  snapshotUrl: options.snapshotUrl,
30
+ fetchSnapshot: options.fetchSnapshot,
30
31
  approvals: options.approvals,
31
32
  tenant: options.tenant,
32
33
  maxAge: options.maxAge,
@@ -0,0 +1 @@
1
+ export { n as runCloudPull } from "./pull-DnhBA9pf.js";
@@ -3,11 +3,11 @@ import { t as catalogFingerprint } from "./catalog-fingerprint-e6aCWosn.js";
3
3
  import { a as describeError } from "./errors-BhRkoNS7.js";
4
4
  import { s as writeFileEnsuringDir } from "./files-BSjrtIHw.js";
5
5
  import { s as cliVersion } from "./version-DMQ0dnN5.js";
6
- import { o as formatCatalogJson } from "./catalog-doc-C4DGfJCO.js";
6
+ import { o as formatCatalogJson } from "./catalog-doc-nrgfbh8I.js";
7
7
  import { t as catalogPath } from "./catalog-path-CnI0XTFK.js";
8
8
  import { n as parseSupabaseManifest } from "./manifest-BdzBobNK.js";
9
- import { t as parseCatalog } from "./parse-UTC-sDrt.js";
10
- import { a as nonEmptyOr } from "./output-BFWLER4r.js";
9
+ import { t as parseCatalog } from "./parse-CXTT7hBq.js";
10
+ import { a as nonEmptyOr } from "./output-DZQCr2lP.js";
11
11
  import { t as POLICY_NOT_PUBLISHED } from "./problem-types-DSsRfONQ.js";
12
12
  import { n as httpRequest, t as authFailure } from "./http-DhMWeB_h.js";
13
13
  import { l as cloudUrl, n as cliRuntime, o as readAuth } from "./auth-j3Eu-j4h.js";
@@ -5,9 +5,9 @@ import { a as describeError, n as CliError } from "./errors-BhRkoNS7.js";
5
5
  import { s as cliVersion } from "./version-DMQ0dnN5.js";
6
6
  import { i as loadConfiguredPolicy } from "./load-BaEamml-.js";
7
7
  import { n as parseSupabaseManifest } from "./manifest-BdzBobNK.js";
8
- import { t as parseCatalog } from "./parse-UTC-sDrt.js";
9
- import { r as pushedPolicy } from "./pushed-policy-BecMsTtM.js";
10
- import { n as runCatalog } from "./catalog-D1fw8qif.js";
8
+ import { t as parseCatalog } from "./parse-CXTT7hBq.js";
9
+ import { r as pushedPolicy } from "./pushed-policy-BERO0x9O.js";
10
+ import { n as runCatalog } from "./catalog-s0waIrfY.js";
11
11
  import { n as httpRequest, t as authFailure } from "./http-DhMWeB_h.js";
12
12
  import { a as pushAuth, l as cloudUrl, n as cliRuntime, u as firstNonEmpty } from "./auth-j3Eu-j4h.js";
13
13
  import "./manifest-json-CAGzls-C.js";
@@ -3,7 +3,7 @@ import { n as freezeDeep } from "./freeze-jjan0lCv.js";
3
3
  import { n as PermDockValidationError } from "./validation-error-CYg2kJEw.js";
4
4
  import { n as RFC3339_PATTERN } from "./time-nR1JesoH.js";
5
5
  import { i as wireValidity } from "./validity-Buc7w8E9.js";
6
- import { n as snapshotScopes } from "./instance-snapshot-BWa71my8.js";
6
+ import { n as snapshotScopes } from "./instance-snapshot-SX8zH_1t.js";
7
7
  import { n as copyJson, r as forbiddenKeyPath, t as checkSchema } from "./json-schema-BPGa-RjQ.js";
8
8
  //#region src/catalog/pushed-policy.ts
9
9
  const strings = {
@@ -1,4 +1,4 @@
1
- import { E as Policy, Gn as AppObligation, Pn as Grantee, U as WireValidity, d as BreakGlassSpec, o as ApprovalRequirement, rn as SnapshotScope, v as GrantLimit, wr as Condition, y as GrantMeta } from "./policy-types-D-GwfQTc.js";
1
+ import { D as Policy, Er as Condition, In as Grantee, W as WireValidity, b as GrantMeta, f as BreakGlassSpec, in as SnapshotScope, qn as AppObligation, s as ApprovalRequirement, y as GrantLimit } from "./policy-types-BI9C5Sp5.js";
2
2
  import { t as JsonSchemaNode } from "./json-schema-BfXgnRNT.js";
3
3
  //#region src/catalog/pushed-policy.d.ts
4
4
  /**
@@ -1,9 +1,9 @@
1
- import { c as requiredPlans } from "../errors-TpzkEKgJ.js";
2
- import { i as describe } from "../describe-BKtC_8PG.js";
3
- import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, f as ProtectedActionHandle, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-DYeB-_U3.js";
1
+ import { c as requiredPlans } from "../errors-OTE9u4Wk.js";
2
+ import { i as describe } from "../describe-DibQM6g-.js";
3
+ import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, f as ProtectedActionHandle, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-Dpg_fSNQ.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-L9UOwATg.js";
5
- import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-DmbfLu2p.js";
5
+ import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-DnzRZjEu.js";
6
6
  import { t as approvalHeaders } from "../headers-B9jQxjtW.js";
7
- import { a as useAssignableRoles, c as useGate, d as usePermission, f as usePermissions, g as useTenant, h as useSubject, i as useAssignablePermissions, l as useMemberships, m as useRoles, n as Protected, o as useDescribe, p as useRefreshOn, r as useApproval, s as useFilter, t as useProtectedAction, u as usePermDock } from "../protected-action-Ds_EUY8B.js";
8
- import { t as PermDockProvider } from "../provider-OtnIiFWm.js";
7
+ import { a as useAssignableRoles, c as useGate, d as usePermission, f as usePermissions, g as useTenant, h as useSubject, i as useAssignablePermissions, l as useMemberships, m as useRoles, n as Protected, o as useDescribe, p as useRefreshOn, r as useApproval, s as useFilter, t as useProtectedAction, u as usePermDock } from "../protected-action-ua0cx5cW.js";
8
+ import { t as PermDockProvider } from "../provider-D_hgjZRa.js";
9
9
  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 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, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };
@@ -2,7 +2,7 @@
2
2
  import { r as requiredPlans } from "../problem-details-CLDgX1KV.js";
3
3
  import { n as describe } from "../describe-BZAlPHxT.js";
4
4
  import { r as approvalHeaders } from "../protected-action-OpOxtTsN.js";
5
- import { a as eventSourceRefresh, i as broadcastChannelRefresh, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options--zWn48PK.js";
6
- import { a as useAssignableRoles, c as useGate, d as usePermission, f as usePermissions, g as useTenant, h as useSubject, i as useAssignablePermissions, l as useMemberships, m as useRoles, n as Protected, o as useDescribe, p as useRefreshOn, r as useApproval, s as useFilter, t as useProtectedAction, u as usePermDock } from "../protected-action-B40tU3yP.js";
7
- import { t as PermDockProvider } from "../provider-CY4TSSJo.js";
5
+ import { a as eventSourceRefresh, i as broadcastChannelRefresh, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-CDvoX52-.js";
6
+ import { a as useAssignableRoles, c as useGate, d as usePermission, f as usePermissions, g as useTenant, h as useSubject, i as useAssignablePermissions, l as useMemberships, m as useRoles, n as Protected, o as useDescribe, p as useRefreshOn, r as useApproval, s as useFilter, t as useProtectedAction, u as usePermDock } from "../protected-action-CD1HXwQK.js";
7
+ import { t as PermDockProvider } from "../provider-qESIf_C0.js";
8
8
  export { PermDockProvider, Protected, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };
@@ -1,2 +1,2 @@
1
- import { t as PermDockProvider } from "../provider-OtnIiFWm.js";
1
+ import { t as PermDockProvider } from "../provider-D_hgjZRa.js";
2
2
  export { PermDockProvider };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export { t as PermDockProvider } from "../provider-CY4TSSJo.js";
2
+ export { t as PermDockProvider } from "../provider-qESIf_C0.js";
@@ -1,15 +1,15 @@
1
- import { $t as Snapshot, Jt as LocalMembershipRows, Kt as Instant, Qt as LocalSnapshotRows, Xt as LocalRowValue, Yt as LocalRowColumn, Zt as LocalSnapshotManifest, dr as CustomRole, gr as Membership, lt as SnapshotSource } from "../policy-types-D-GwfQTc.js";
1
+ import { $t as LocalSnapshotRows, Qt as LocalSnapshotManifest, Xt as LocalRowColumn, Yt as LocalMembershipRows, Zt as LocalRowValue, en as Snapshot, pr as CustomRole, qt as Instant, ut as SnapshotSource, vr as Membership } from "../policy-types-BI9C5Sp5.js";
2
2
  import { u as Permission } from "../permission-types-CAY-GU7e.js";
3
- import { c as requiredPlans } from "../errors-TpzkEKgJ.js";
4
- import { i as describe } from "../describe-BKtC_8PG.js";
5
- import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-DvjTQNuO.js";
6
- import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, f as ProtectedActionHandle, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, t as ClientStore, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-DYeB-_U3.js";
3
+ import { c as requiredPlans } from "../errors-OTE9u4Wk.js";
4
+ import { i as describe } from "../describe-DibQM6g-.js";
5
+ import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-CE4tgFsj.js";
6
+ import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, f as ProtectedActionHandle, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, t as ClientStore, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-Dpg_fSNQ.js";
7
7
  import { i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, t as AuthzChangeRefresh } from "../refresh-on-L9UOwATg.js";
8
- import { r as ProtectedProps, t as PermDockDefaults } from "../types-DmbfLu2p.js";
8
+ import { r as ProtectedProps, t as PermDockDefaults } from "../types-DnzRZjEu.js";
9
9
  import { t as approvalHeaders } from "../headers-B9jQxjtW.js";
10
- import { a as useAssignableRoles, c as useGate, d as usePermission, f as usePermissions, g as useTenant, h as useSubject, i as useAssignablePermissions, l as useMemberships, m as useRoles, n as Protected, o as useDescribe, r as useApproval, s as useFilter, t as useProtectedAction, u as usePermDock } from "../protected-action-Ds_EUY8B.js";
11
- import { n as RealtimeRefreshClient, t as RealtimeRefreshChannel } from "../client-CH7vzSAY.js";
12
- import { a as SubscribeOnline, i as SubscribeForeground, n as ReactNativePermDockProviderProps, r as SnapshotStorage, t as NativeRevalidate } from "../types-o1vu6Ks3.js";
10
+ import { a as useAssignableRoles, c as useGate, d as usePermission, f as usePermissions, g as useTenant, h as useSubject, i as useAssignablePermissions, l as useMemberships, m as useRoles, n as Protected, o as useDescribe, r as useApproval, s as useFilter, t as useProtectedAction, u as usePermDock } from "../protected-action-ua0cx5cW.js";
11
+ import { n as RealtimeRefreshClient, t as RealtimeRefreshChannel } from "../client-JK504UCq.js";
12
+ import { a as SubscribeOnline, i as SubscribeForeground, n as ReactNativePermDockProviderProps, r as SnapshotStorage, t as NativeRevalidate } from "../types-Drs3OOAy.js";
13
13
  import { ReactElement } from "react";
14
14
  //#region src/react-native/guards.d.ts
15
15
  /**
@@ -120,6 +120,14 @@ type PowerSyncSourceOptions<Q extends string> = {
120
120
  readonly queries?: undefined;
121
121
  readonly read?: undefined;
122
122
  };
123
+ /** A `powerSyncSource`: a snapshot source that also reads the synced version. */
124
+ type PowerSyncSnapshotSource = SnapshotSource & {
125
+ /**
126
+ * The signed-in user's synced `authz_ver`, read from `manifest.rows.version`.
127
+ * `undefined` without `user`, without that table, or before its row syncs.
128
+ */
129
+ readonly authzVersion: () => Promise<number | undefined>;
130
+ };
123
131
  /**
124
132
  * A `localSnapshot` source over a PowerSync database: `get` initially runs
125
133
  * every query with `db.getAll`; watch-triggered reads refresh only fired
@@ -129,10 +137,10 @@ type PowerSyncSourceOptions<Q extends string> = {
129
137
  * content re-renders nothing (`connectSource`). The source takes the database
130
138
  * as an argument; `permdock/react-native` never imports `@powersync/*`.
131
139
  */
132
- export declare function powerSyncSource<Q extends string>(db: PowerSyncWatchable, options: PowerSyncSourceOptions<Q>): SnapshotSource;
140
+ export declare function powerSyncSource<Q extends string>(db: PowerSyncWatchable, options: PowerSyncSourceOptions<Q>): PowerSyncSnapshotSource;
133
141
  /** `powerSyncSource` over one database, memoised per manifest and options. */
134
142
  type PowerSyncSourceCache = {
135
- readonly source: <Q extends string>(options: PowerSyncSourceOptions<Q>) => SnapshotSource;
143
+ readonly source: <Q extends string>(options: PowerSyncSourceOptions<Q>) => PowerSyncSnapshotSource;
136
144
  };
137
145
  /**
138
146
  * A cache of `powerSyncSource` sources over `db`. `source` answers the same
@@ -207,6 +215,12 @@ type NativeRefreshPowerSync<K> = {
207
215
  * a message sent while the app was closed.
208
216
  */
209
217
  readonly manifest?: LocalSnapshotManifest;
218
+ /**
219
+ * The `powerSyncSource` the provider reads. Its `authzVersion()` answers the
220
+ * synced version for the foreground catch-up, in place of a query built from
221
+ * `manifest`.
222
+ */
223
+ readonly source?: Pick<PowerSyncSnapshotSource, "authzVersion">;
210
224
  };
211
225
  type NativeRefreshOptions<C extends RealtimeRefreshChannel = RealtimeRefreshChannel, K = unknown> = {
212
226
  readonly supabase: NativeRefreshSupabase<C>;
@@ -227,8 +241,8 @@ type NativeRefreshOptions<C extends RealtimeRefreshChannel = RealtimeRefreshChan
227
241
  * refreshes the snapshot. Passes run one at a time; signals during a pass fold
228
242
  * into one more. The channel closes in the background and rejoins on
229
243
  * foreground, where one catch-up pass runs: a version check with
230
- * `powersync.manifest`, else a full pass. It never imports `@supabase/*` or
231
- * `@powersync/*`.
244
+ * `powersync.source` or `powersync.manifest`, else a full pass. It never
245
+ * imports `@supabase/*` or `@powersync/*`.
232
246
  */
233
247
  export declare function nativeRefresh<C extends RealtimeRefreshChannel, K = unknown>(options: NativeRefreshOptions<C, K>): RefreshTrigger;
234
248
  //#endregion
@@ -287,4 +301,4 @@ type NativeStoreOptions = Omit<ReactNativePermDockProviderProps, "children" | "h
287
301
  export declare function connectSource(store: ClientStore, source: SnapshotSource, subscribeForeground?: SubscribeForeground): () => void;
288
302
  export declare function nativeStore(options: NativeStoreOptions): ClientStore;
289
303
  //#endregion
290
- export { type ActionResult, type AppStateModule, type ApprovalHandle, type ApprovalState, type AuthzChangeRefresh, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type LocalMembershipRows, type LocalRowColumn, type LocalRowValue, type LocalSnapshotData, type LocalSnapshotManifest, type LocalSnapshotOptions, type LocalSnapshotRows, type MmkvInstance, type NativeRefreshDatabase, type NativeRefreshOptions, type NativeRefreshPowerSync, type NativeRefreshSession, type NativeRefreshSupabase, type NativeRevalidate, type NetInfoModule, type PermDockDefaults, type PermissionSet, type PermissionState, type PowerSyncQuery, type PowerSyncSourceCache, type PowerSyncSourceOptions, type PowerSyncWatchable, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type ReactNativePermDockProviderProps, type RefreshTrigger, type RolesOptions, type SecureStoreModule, type SnapshotSource, type SnapshotStorage, type SubjectView, type SubscribeForeground, type SubscribeOnline, type TenantView, approvalHeaders, authzChangeRefresh, describe, eventSourceRefresh, parseLocalSnapshotManifest, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRoles, useSubject, useTenant };
304
+ export { type ActionResult, type AppStateModule, type ApprovalHandle, type ApprovalState, type AuthzChangeRefresh, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type LocalMembershipRows, type LocalRowColumn, type LocalRowValue, type LocalSnapshotData, type LocalSnapshotManifest, type LocalSnapshotOptions, type LocalSnapshotRows, type MmkvInstance, type NativeRefreshDatabase, type NativeRefreshOptions, type NativeRefreshPowerSync, type NativeRefreshSession, type NativeRefreshSupabase, type NativeRevalidate, type NetInfoModule, type PermDockDefaults, type PermissionSet, type PermissionState, type PowerSyncQuery, type PowerSyncSnapshotSource, type PowerSyncSourceCache, type PowerSyncSourceOptions, type PowerSyncWatchable, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type ReactNativePermDockProviderProps, type RefreshTrigger, type RolesOptions, type SecureStoreModule, type SnapshotSource, type SnapshotStorage, type SubjectView, type SubscribeForeground, type SubscribeOnline, type TenantView, approvalHeaders, authzChangeRefresh, describe, eventSourceRefresh, parseLocalSnapshotManifest, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRoles, useSubject, useTenant };