permdock 0.18.1 → 0.19.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.
- package/dist/a2a/index.d.ts +4 -4
- package/dist/a2a/index.js +6 -6
- package/dist/{adoption-scan-CxExBYSJ.js → adoption-scan-C_VQ-J2f.js} +1 -1
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +3 -3
- package/dist/ai-sdk/index.js +4 -4
- package/dist/{approval-normalize-CUjgSsOl.js → approval-normalize-hlfO9BJv.js} +8 -1
- package/dist/{approval-policies-oNnckT12.d.ts → approval-policies-CYqdqAob.d.ts} +1 -1
- package/dist/{approval-prompt-Bg7gDSqd.d.ts → approval-prompt-BxYbwOAU.d.ts} +1 -1
- package/dist/approvals/index.d.ts +4 -4
- package/dist/approvals/index.js +3 -3
- package/dist/{approvals-DGId_hgJ.js → approvals-CuXILe52.js} +9 -6
- package/dist/{arazzo--riLuGY0.js → arazzo-4vfaXj0U.js} +2 -2
- package/dist/{arazzo-CEDbb-uM.js → arazzo-Dc969CA2.js} +1 -1
- package/dist/astro/index.d.ts +4 -4
- package/dist/astro/index.js +2 -2
- package/dist/{audience-B4YR9UpV.js → audience-GCXRRAeZ.js} +1 -1
- package/dist/authzen/index.d.ts +5 -5
- package/dist/authzen/index.js +3 -3
- package/dist/{automation-Bfa_wD1h.d.ts → automation-BJiJT_Xr.d.ts} +1 -1
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-auth/index.js +1 -1
- package/dist/better-supabase/index.d.ts +20 -17
- package/dist/better-supabase/index.js +9 -9
- package/dist/{better-supabase-BJtQ-kNf.js → better-supabase-ayun1IKE.js} +38 -4
- package/dist/{bind-B4pMH9bm.js → bind-BnKPWRrE.js} +4 -4
- package/dist/{bind-DR6ku3A9.d.ts → bind-SpRxR213.d.ts} +7 -7
- package/dist/{body-CJQwYVa8.js → body-C9JbIoqb.js} +1 -1
- package/dist/{build-instance-BFMFQdE_.js → build-instance-DrIbZVnm.js} +1 -1
- package/dist/{capability-BZ_veK9o.d.ts → capability-Ci2S8Cdu.d.ts} +1 -1
- package/dist/{casbin-bKC1FpEx.js → casbin-C1TQqWkK.js} +1 -1
- package/dist/{casbin-DCQHkkyj.js → casbin-ChbpgfNR.js} +1 -1
- package/dist/catalog/index.d.ts +5 -5
- package/dist/catalog/index.js +5 -5
- package/dist/catalog-BTPySmbp.js +1 -0
- package/dist/{catalog-zzNuR3sY.js → catalog-DjDc87R2.js} +1 -1
- package/dist/{catalog-doc-C4DGfJCO.js → catalog-doc-nrgfbh8I.js} +2 -1
- package/dist/{catalog-D1fw8qif.js → catalog-s0waIrfY.js} +2 -2
- package/dist/{challenge-B2O2OLEk.js → challenge-D57I5G1k.js} +1 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +2 -2
- package/dist/chat-sdk/index.d.ts +3 -3
- package/dist/claude-agent/index.d.ts +3 -3
- package/dist/claude-agent/index.js +2 -2
- package/dist/clerk/index.d.ts +2 -2
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +5 -5
- package/dist/cli/index.js +3 -3
- package/dist/{client-CH7vzSAY.d.ts → client-JK504UCq.d.ts} +15 -2
- package/dist/cloud/index.d.ts +8 -8
- package/dist/cloud/index.js +2 -2
- package/dist/{cloud-C0vXBmLG.js → cloud-Dgj4FiEG.js} +2 -2
- package/dist/{codemod-C-L0w-u7.js → codemod-DN_fBt43.js} +2 -2
- package/dist/{codemod-eYI1FbeJ.js → codemod-WWxwgM77.js} +1 -1
- package/dist/{collect-CU85z6Ta.js → collect-DMQ6Sxr6.js} +2 -2
- package/dist/{collect-D878zLDP.js → collect-DN_x7hvV.js} +1 -1
- package/dist/collect-eSTXOZDC.js +1 -0
- package/dist/compile/index.d.ts +1 -1
- package/dist/{compile-DBm0ub4p.d.ts → compile-RaRUQhmD.d.ts} +2 -2
- package/dist/{completion-Dauc6pVT.js → completion-DnmUvCw0.js} +1 -1
- package/dist/{config-DWp2PucY.js → config-CmuEoob8.js} +1 -1
- package/dist/{config-COHmivz9.js → config-D2oXUwos.js} +8 -5
- package/dist/{config-report-DKpFm5ID.js → config-report-BVm8Dhbj.js} +2 -2
- package/dist/{config-shape-tsxHx71E.js → config-shape-D9paLhEX.js} +5 -1
- package/dist/{connection-B72dg5Q2.js → connection-QFsv-kbh.js} +1 -1
- package/dist/{context-DeammvFl.js → context-YhyXyqBI.js} +3 -2
- package/dist/convex/index.d.ts +4 -4
- package/dist/convex/index.js +3 -3
- package/dist/{core-D87h2kpR.d.ts → core-DNRWXyj4.d.ts} +2 -2
- package/dist/{core-B8sLve3z.js → core-ZIWZBi6-.js} +5 -5
- package/dist/{create-BzwjZuRS.d.ts → create-0B_bjJc-.d.ts} +7 -7
- package/dist/{create-BrQXL-Wt.d.ts → create-BECB6fns.d.ts} +6 -6
- package/dist/{create-C-tm3KIF.js → create-CAZyXZFC.js} +4 -4
- package/dist/{create-3A7J9KRR.js → create-CegYmYHu.js} +69 -29
- package/dist/{create-CtoT1lIQ.d.ts → create-DJ_5REgN.d.ts} +4 -4
- package/dist/decide-set-DXEPepY1.js +100 -0
- package/dist/{delegation-input-FTxMK3ji.js → delegation-input-DcXhiMkf.js} +1 -1
- package/dist/delivery/index.d.ts +4 -4
- package/dist/delivery/index.js +1 -1
- package/dist/{denied-text-DlIxt8fh.d.ts → denied-text-CF-2h8Vz.d.ts} +1 -1
- package/dist/{describe-BKtC_8PG.d.ts → describe-DyN-HX6o.d.ts} +1 -1
- package/dist/{diff-BnNHqtHj.js → diff-BOU7sSnv.js} +4 -4
- package/dist/{diff-CBCzOTWM.js → diff-BrmvcPXk.js} +1 -1
- package/dist/{doctor-CkYKCuX7.js → doctor-BhhNMkU8.js} +242 -65
- package/dist/{doctor-xUpR5rXg.js → doctor-CL1OigyD.js} +15 -5
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/elysia/index.d.ts +4 -4
- package/dist/elysia/index.js +4 -4
- package/dist/{errors-TpzkEKgJ.d.ts → errors-POWcCXy7.d.ts} +1 -1
- package/dist/{errors-B6R_lg2a.js → errors-ynga1EQy.js} +1 -1
- package/dist/{evaluate-Czbj7thS.js → evaluate-CrKkjgXS.js} +2 -2
- package/dist/{evaluations-CisTTURl.d.ts → evaluations--rkKhMqY.d.ts} +3 -3
- package/dist/{evaluations-h3KoJAPa.js → evaluations-CNMVJVD6.js} +3 -3
- package/dist/eve/index.d.ts +4 -4
- package/dist/eve/index.js +3 -3
- package/dist/express/index.d.ts +4 -4
- package/dist/express/index.js +3 -3
- package/dist/fastify/index.d.ts +4 -4
- package/dist/fastify/index.js +3 -3
- package/dist/{fetch-adapter-DH-NJPbL.js → fetch-adapter-Bm1iZolz.js} +3 -3
- package/dist/{fetch-adapter-BdmfnbJM.d.ts → fetch-adapter-Bq4AB3W2.d.ts} +2 -2
- package/dist/{fields-CrjL6A49.js → fields-COvJbUva.js} +1 -1
- package/dist/{from-snapshot-DMlSSo9b.js → from-snapshot-DHnb8Fh4.js} +2 -2
- package/dist/{gen-mf-MRwVr.js → gen-D0NqzeOP.js} +2 -2
- package/dist/{gen-BEIN-DRM.js → gen-DonXr9Hg.js} +1 -1
- package/dist/h3/index.d.ts +4 -4
- package/dist/h3/index.js +3 -3
- package/dist/{helpers-DmqGy63f.js → helpers-D-MXwkOF.js} +28 -4
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +5 -5
- package/dist/{hosted-BFNXwcjd.d.ts → hosted-H1xp5Dfw.d.ts} +1 -1
- package/dist/{hosted-waouw2V-.js → hosted-iOGBI_ER.js} +4 -3
- package/dist/{import-C1XXpG_m.js → import-C8ffNykt.js} +2 -2
- package/dist/{import-DObwEota.js → import-DNaFHm53.js} +1 -1
- package/dist/{index-CVGio3cH.d.ts → index-B9-ZXNa-.d.ts} +4 -4
- package/dist/{index-BhnOOnp9.d.ts → index-C2pmTzFx.d.ts} +2 -2
- package/dist/{index-Dfv9Toct.d.ts → index-C5Tfpjex.d.ts} +1 -1
- package/dist/{index-CdUTE6qd.d.ts → index-Cm6mHTZ-.d.ts} +16 -10
- package/dist/{index-rFp6X_QP.d.ts → index-DLlWORcK.d.ts} +5 -5
- package/dist/{index-CdMOd-GY.d.ts → index-DZnpRB0q.d.ts} +24 -6
- package/dist/index.d.ts +17 -17
- package/dist/index.js +15 -15
- package/dist/{init-DS3PEsCG.js → init-4aRjat-S.js} +3 -3
- package/dist/{init-CNJ8lLjo.js → init-QfBfkrGu.js} +1 -1
- package/dist/{instance-options-2sFGSdsf.d.ts → instance-options-D6hyIKJF.d.ts} +1 -1
- package/dist/{instance-snapshot-BWa71my8.js → instance-snapshot-DXxcizAb.js} +3 -3
- package/dist/jwt/index.d.ts +4 -4
- package/dist/{kernel-30Z2zM_d.js → kernel-B2UCK36Z.js} +7 -7
- package/dist/kysely/index.d.ts +3 -3
- package/dist/{login-DUVzBLh7.js → login-Cg1la2yJ.js} +3 -3
- package/dist/{login-BgK5Jloo.js → login-lPtJIjbO.js} +1 -1
- package/dist/{manifest-wclLWBVH.js → manifest-CDhdXgf6.js} +38 -37
- package/dist/{map-error-BH16Ah8P.js → map-error-EOhahOVA.js} +3 -3
- package/dist/mcp/index.d.ts +57 -17
- package/dist/mcp/index.js +199 -53
- package/dist/{module-values-B8tNIxdd.js → module-values-BYuNtdK5.js} +1 -1
- package/dist/nest/index.d.ts +4 -4
- package/dist/nest/index.js +5 -5
- package/dist/next/index.d.ts +12 -12
- package/dist/next/index.js +8 -8
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +4 -4
- package/dist/node/index.js +2 -2
- package/dist/openai/index.d.ts +4 -4
- package/dist/openai/index.js +3 -3
- package/dist/openapi/index.d.ts +2 -2
- package/dist/{openapi-C4gFqeRz.js → openapi-C3BIVLTd.js} +2 -2
- package/dist/{openapi-zMEB9qxn.js → openapi-Cr0B3p2h.js} +2 -2
- package/dist/orpc/index.d.ts +21 -17
- package/dist/orpc/index.js +18 -11
- package/dist/otel/index.d.ts +3 -3
- package/dist/{output-BFWLER4r.js → output-DYq_o2dM.js} +1 -1
- package/dist/{ownership-D-mIt-w0.js → ownership-CrmMERZv.js} +1 -1
- package/dist/{parse-UTC-sDrt.js → parse-CXTT7hBq.js} +1 -1
- package/dist/{parse-local-manifest-DvjTQNuO.d.ts → parse-local-manifest-CQjRmzrw.d.ts} +1 -1
- package/dist/{parse-local-manifest-CxcSMQgl.js → parse-local-manifest-Ce2N-Opr.js} +1 -1
- package/dist/pdp/index.d.ts +3 -3
- package/dist/pdp/index.js +2 -2
- package/dist/{permdock-ffY4CMd9.d.ts → permdock-B45vPQb4.d.ts} +4 -4
- package/dist/{permdock-D-_WrdKu.js → permdock-DeOfonuG.js} +6 -6
- package/dist/{permissions-B3ggI88M.js → permissions-Rk9_Gm04.js} +1 -1
- package/dist/{policy-cV_wwPb8.js → policy-DTmkP72P.js} +2 -2
- package/dist/{policy-from-catalog-B68hGC0S.js → policy-from-catalog-Cljh_B5H.js} +6 -6
- package/dist/{policy-BtKSApSt.d.ts → policy-re2Oag8s.d.ts} +1 -1
- package/dist/{policy-types-D-GwfQTc.d.ts → policy-types-Ky7P23CP.d.ts} +24 -2
- package/dist/{postgrest-D84p5dbA.d.ts → postgrest-pwxeaeOW.d.ts} +1 -1
- package/dist/powersync-B96MUB_Q.js +1 -0
- package/dist/{powersync-9PYOE1wt.js → powersync-BoqBik-G.js} +77 -38
- package/dist/{powersync-DStC_g0B.js → powersync-PKC4yT62.js} +2 -2
- package/dist/prisma/index.d.ts +2 -2
- package/dist/{problem-BVLHFK33.js → problem-BWP1l86g.js} +8 -7
- package/dist/{protected-action-B40tU3yP.js → protected-action-CD1HXwQK.js} +2 -2
- package/dist/{protected-action-Ds_EUY8B.d.ts → protected-action-DHPqBLhz.d.ts} +5 -5
- package/dist/{provider-OtnIiFWm.d.ts → provider-C-CbGEii.d.ts} +1 -1
- package/dist/{provider-CY4TSSJo.js → provider-qESIf_C0.js} +5 -2
- package/dist/{provider-store-BQP_pp8s.js → provider-store-BTHGJH9j.js} +3 -2
- package/dist/pull-BjdsS9x1.js +1 -0
- package/dist/{pull-DLP4I1Kl.js → pull-FG0Tf8aF.js} +3 -3
- package/dist/{push-BSb8j1EW.js → push-CI5G7lRS.js} +3 -3
- package/dist/{pushed-policy-Ck3FZcoy.d.ts → pushed-policy-B94r9DlN.d.ts} +1 -1
- package/dist/{pushed-policy-BecMsTtM.js → pushed-policy-DftSiyD3.js} +1 -1
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +3 -3
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +28 -14
- package/dist/react-native/index.js +57 -37
- package/dist/{replay-E5X9E1lC.d.ts → replay-BqmXcP7x.d.ts} +1 -1
- package/dist/{request-context-DM6_jY1n.js → request-context-uvaevbBu.js} +1 -1
- package/dist/resend/index.d.ts +4 -4
- package/dist/resend/index.js +2 -2
- package/dist/{resolve-names-CBl4r4_r.js → resolve-names-Dg8560iu.js} +2 -2
- package/dist/{rls-DGBL-jDY.js → rls-CJbWbxXv.js} +19 -13
- package/dist/{rls-pAHGYgTb.js → rls-DJSczevJ.js} +1 -1
- package/dist/{role-builder-CMW4wWzn.js → role-builder-C_2kWB_x.js} +1 -1
- package/dist/rpc-D7cDHIVE.d.ts +22 -0
- package/dist/{rpc-KwX_Jcxz.js → rpc-m5hPklf-.js} +16 -6
- package/dist/run-4m-TyVTD.js +1 -0
- package/dist/{run-B7lv3NuK.js → run-BigMDvGR.js} +3 -3
- package/dist/{run-ticket-DPaD27_r.d.ts → run-ticket-DRA3POCY.d.ts} +2 -2
- package/dist/{saas-B8H1MsQ3.js → saas-BHeoBqbW.js} +4 -4
- package/dist/{scan-0r3OZqqK.js → scan-BKLwCSVV.js} +1 -1
- package/dist/{schema-CuX70xgH.js → schema-BlnU_TzE.js} +4 -0
- package/dist/{schema-B_9tXrbG.js → schema-CLuBlCCr.js} +1 -1
- package/dist/scim/index.d.ts +1 -1
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +5 -5
- package/dist/{server-types-3OnXjZ2D.d.ts → server-types-CwpJe664.d.ts} +31 -13
- package/dist/{sink-ogbVkyeo.d.ts → sink-7Lrch8dn.d.ts} +2 -2
- package/dist/{skills-B4MPRxQd.js → skills-CyD_3eoi.js} +1 -1
- package/dist/{skills-C9sTD70r.js → skills-D42EyC8G.js} +1 -1
- package/dist/{snapshot-DN_8J27z.js → snapshot-DHPih65J.js} +2 -1
- package/dist/{snapshot-cache-B4YvlGG_.d.ts → snapshot-cache-B9weL8NE.d.ts} +1 -1
- package/dist/solid/index.d.ts +5 -5
- package/dist/solid/index.js +3 -2
- package/dist/solid-start/index.d.ts +4 -4
- package/dist/solid-start/index.js +3 -3
- package/dist/{sources-xdQShLDU.d.ts → sources-4d3fl7cq.d.ts} +1 -1
- package/dist/{src-Brzq_0in.js → src-HDDf9Eum.js} +28 -13
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +2 -2
- package/dist/{standard-webhooks-BfPaZ6T1.d.ts → standard-webhooks-BGi8pUwo.d.ts} +2 -2
- package/dist/{store-DmVqy74I.js → store-CSOsXd5s.js} +8 -6
- package/dist/{store-DYeB-_U3.d.ts → store-CjJaZI_g.d.ts} +31 -4
- package/dist/{store-options--zWn48PK.js → store-options-CDvoX52-.js} +31 -8
- package/dist/{stores-EPul_8MN.d.ts → stores-Cam6GGAV.d.ts} +5 -5
- package/dist/{stores-BYFopOm1.js → stores-PpYVQ5yF.js} +1 -1
- package/dist/{stream-CDvF0sJm.js → stream-DQ3rbO3J.js} +1 -1
- package/dist/supabase/client.d.ts +1 -1
- package/dist/supabase/client.js +32 -4
- package/dist/supabase/index.d.ts +10 -5
- package/dist/supabase/index.js +1 -1
- package/dist/supabase/middleware.d.ts +5 -5
- package/dist/supabase/middleware.js +5 -5
- package/dist/{supabase-BiViJpQ4.js → supabase-CVZuytCC.js} +2 -2
- package/dist/{supabase-CogTyJH2.js → supabase-DBuZK2pP.js} +2 -2
- package/dist/supabase-hook-2M-EpoRp.js +1 -0
- package/dist/{supabase-hook-DX38Hj8h.js → supabase-hook-Btk56XD6.js} +151 -55
- package/dist/{supautils-BGf6zRvM.js → supautils-lwXmXPP_.js} +7 -7
- package/dist/svelte/index.d.ts +5 -5
- package/dist/svelte/index.js +3 -3
- package/dist/svelte/runtime.d.ts +3 -3
- package/dist/svelte/runtime.js +1 -1
- package/dist/svelte/source.d.ts +5 -5
- package/dist/svelte/source.js +2 -2
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +2 -2
- package/dist/{tables-BfOk0ymL.js → tables-B72q9UFD.js} +1 -1
- package/dist/tanstack-start/index.d.ts +4 -4
- package/dist/tanstack-start/index.js +2 -2
- package/dist/terminal/index.d.ts +5 -5
- package/dist/terminal/index.js +4 -4
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.d.ts +1 -1
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/testing/index.d.ts +23 -23
- package/dist/testing/index.js +22 -22
- package/dist/testing/saas/index.d.ts +3 -3
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/trpc/index.d.ts +15 -8
- package/dist/trpc/index.js +23 -19
- package/dist/{type-helpers-i1EJ3Eb1.d.ts → type-helpers-CDxxNswo.d.ts} +1 -1
- package/dist/{types-CqcsNCaN.d.ts → types--HfnkawU.d.ts} +13 -1
- package/dist/{types-NYoj8JBm.d.ts → types-7Vlz1Wi2.d.ts} +1 -0
- package/dist/{types-B8qUkGja.d.ts → types-BVn1w_0o.d.ts} +2 -2
- package/dist/{types-DmbfLu2p.d.ts → types-BlYPxJDR.d.ts} +9 -4
- package/dist/{types-D19MK4t-.d.ts → types-Bwdumeos.d.ts} +3 -3
- package/dist/{types-3Y8UpFkF.d.ts → types-BwuNGQRm.d.ts} +68 -4
- package/dist/{types-D-JO7lh8.d.ts → types-CChFKY10.d.ts} +5 -5
- package/dist/{types-CDVXR6YD.d.ts → types-Do4yihST.d.ts} +1 -1
- package/dist/{types-CCEeSCMB.d.ts → types-Do8qBcRO.d.ts} +3 -3
- package/dist/{types-o1vu6Ks3.d.ts → types-OLSfBLa5.d.ts} +4 -4
- package/dist/{types-DGf_cpKF.d.ts → types-g0Vk9k2c.d.ts} +2 -2
- package/dist/{types-Ck1KOfug.d.ts → types-oaqeYKQu.d.ts} +2 -2
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-DYtRVkcN.js → usage-BLhhEPcZ.js} +1 -1
- package/dist/{usage-DC0UKe6C.js → usage-C-wta3rx.js} +4 -4
- package/dist/usage-Csc_ZRd0.js +1 -0
- package/dist/{validation-error-Dx8PipbO.d.ts → validation-error-AhCHeeff.d.ts} +1 -1
- package/dist/{verify-Bpj0hauG.js → verify-CaaZlnP5.js} +78 -57
- package/dist/{version-cache-DzNKWiI6.d.ts → version-cache-Ddvrfn1R.d.ts} +1 -1
- package/dist/vue/index.d.ts +5 -5
- package/dist/vue/index.js +2 -2
- package/dist/{waiter-NK_UuZbb.d.ts → waiter-CROiWRIP.d.ts} +2 -2
- package/dist/watch-CS69ftMP.js +1 -0
- package/dist/{watch-CBHADqBH.js → watch-Dz2LNM1R.js} +2 -2
- package/dist/webmcp/index.d.ts +1 -1
- package/dist/{where-scope-BKrqUDVk.js → where-scope-BAyOsPQW.js} +1 -1
- package/dist/{who-can-KhVWMxtf.js → who-can-jPfTABf-.js} +1 -1
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +2 -2
- package/dist/workflow-sdk/index.d.ts +4 -4
- package/dist/{wrap-BHGA-SMM.d.ts → wrap-C-4o-Dpy.d.ts} +2 -2
- package/package.json +1 -1
- package/schemas/catalog-v1.json +8 -0
- package/skills/permdock-agents/references/runtimes.md +2 -2
- package/skills/permdock-wire/references/adapters.md +1 -1
- package/dist/catalog-Caqhbdix.js +0 -1
- package/dist/collect-KCtOigxx.js +0 -1
- package/dist/powersync-xNRlC4jN.js +0 -1
- package/dist/pull-UBjDnf4b.js +0 -1
- package/dist/run-UPbacxPg.js +0 -1
- package/dist/stream-W2RuUYly.d.ts +0 -13
- package/dist/supabase-hook-BN46IrVI.js +0 -1
- package/dist/usage-Cl5eb-e1.js +0 -1
- package/dist/watch-OYwAPCzx.js +0 -1
package/dist/mcp/index.js
CHANGED
|
@@ -2,19 +2,20 @@ import { r as isRecord, t as compact } from "../compact-CAf557ZB.js";
|
|
|
2
2
|
import { n as freezeDeep } from "../freeze-jjan0lCv.js";
|
|
3
3
|
import { i as stepUpOf, o as statusProblem } from "../problem-details-CLDgX1KV.js";
|
|
4
4
|
import { n as describe } from "../describe-BZAlPHxT.js";
|
|
5
|
-
import { m as annotationsFor } from "../permission-registry-B8tYxPIt.js";
|
|
5
|
+
import { c as listPermissions, m as annotationsFor } from "../permission-registry-B8tYxPIt.js";
|
|
6
6
|
import { t as actorMayCallTool } from "../delegation-aK4T_5WU.js";
|
|
7
7
|
import { t as anonymousSubject } from "../subject-C7RddW0G.js";
|
|
8
8
|
import { n as resourceRef } from "../resource-ref-CaS9yVPi.js";
|
|
9
|
-
import { i as challengeScope, l as withApp, o as hasScope, s as scopesReaching } from "../permdock-
|
|
9
|
+
import { i as challengeScope, l as withApp, o as hasScope, s as scopesReaching } from "../permdock-DeOfonuG.js";
|
|
10
10
|
import { t as composeWraps } from "../wrap-C5PWzgkq.js";
|
|
11
|
-
import { l as problemResponse, o as methodNotAllowed, r as bearerChallenge, u as protectedResourceMetadataUrl } from "../problem-
|
|
11
|
+
import { l as problemResponse, o as methodNotAllowed, r as bearerChallenge, u as protectedResourceMetadataUrl } from "../problem-BWP1l86g.js";
|
|
12
12
|
import { t as clientNameOf } from "../clients-DYr3U86j.js";
|
|
13
13
|
import { r as mapClaimsToSubject } from "../map-claims-PQwHynxV.js";
|
|
14
|
-
import { r as instanceOptions } from "../build-instance-
|
|
15
|
-
import {
|
|
14
|
+
import { r as instanceOptions } from "../build-instance-DrIbZVnm.js";
|
|
15
|
+
import { t as decideAll } from "../decide-set-DXEPepY1.js";
|
|
16
|
+
import { i as refusalText, n as createAgentKernel } from "../kernel-B2UCK36Z.js";
|
|
16
17
|
import { t as boundedMap } from "../lru-8q4WZjBV.js";
|
|
17
|
-
import {
|
|
18
|
+
import { n as delegationFrom, t as authorizationDetailsOf } from "../delegation-input-DcXhiMkf.js";
|
|
18
19
|
import { n as deniedToolRefusal, r as toolErrorResult, t as approvalToolRefusal } from "../tool-refusal-D4spOJ7I.js";
|
|
19
20
|
//#region src/mcp/mcp-auth.ts
|
|
20
21
|
/**
|
|
@@ -245,8 +246,18 @@ function reachOf(policy, permission, declared) {
|
|
|
245
246
|
function forThisServer(checks, authInfo) {
|
|
246
247
|
return checks.options.resource === void 0 || sameResource(checks.options.resource, authInfo.resource);
|
|
247
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Whether `unscopedTokens: 'subject'` lets the subject alone decide this token:
|
|
251
|
+
* it carries none of the policy's scopes and no `authorization_details`.
|
|
252
|
+
*/
|
|
253
|
+
function decidesOnSubject(options, policyScopes, authInfo) {
|
|
254
|
+
return options.unscopedTokens === "subject" && authorizationDetailsOf(authInfo.extra) === void 0 && !(authInfo.scopes ?? []).some((scope) => policyScopes.has(scope));
|
|
255
|
+
}
|
|
256
|
+
function scoped(checks, authInfo, reach) {
|
|
257
|
+
return hasScope(authInfo.scopes, reach.scopes) || decidesOnSubject(checks.options, checks.policyScopes, authInfo);
|
|
258
|
+
}
|
|
248
259
|
function reachable(checks, authInfo, reach) {
|
|
249
|
-
return authInfo === void 0 ? checks.options.requireAuthInfo !== true : forThisServer(checks, authInfo) &&
|
|
260
|
+
return authInfo === void 0 ? checks.options.requireAuthInfo !== true : forThisServer(checks, authInfo) && scoped(checks, authInfo, reach);
|
|
250
261
|
}
|
|
251
262
|
/**
|
|
252
263
|
* The refusal a token earns before any decision: none, the wrong resource, or a
|
|
@@ -255,7 +266,7 @@ function reachable(checks, authInfo, reach) {
|
|
|
255
266
|
function credentialRefusal(checks, permission, reach, authInfo) {
|
|
256
267
|
if (authInfo === void 0) return checks.options.requireAuthInfo === true ? plainRefusal(permission, "Denied: no verified credentials.", { error: "invalid_token" }) : void 0;
|
|
257
268
|
if (!forThisServer(checks, authInfo)) return plainRefusal(permission, "Denied: the token was not issued for this server.", { error: "invalid_token" });
|
|
258
|
-
if (
|
|
269
|
+
if (scoped(checks, authInfo, reach)) return;
|
|
259
270
|
const resourceMetadata = resourceMetadataOf(authInfo);
|
|
260
271
|
const challenged = reach.challenge;
|
|
261
272
|
return plainRefusal(permission, `Denied: ${permission.key} needs the ${challenged} scope.`, compact({
|
|
@@ -394,21 +405,34 @@ async function checkCall(checks, permission, reach, args, load, context, handler
|
|
|
394
405
|
}
|
|
395
406
|
};
|
|
396
407
|
}
|
|
408
|
+
function single(permission) {
|
|
409
|
+
return permission === void 0 ? void 0 : {
|
|
410
|
+
permissions: [permission],
|
|
411
|
+
anyOf: false
|
|
412
|
+
};
|
|
413
|
+
}
|
|
397
414
|
/**
|
|
398
415
|
* The keys a list shows: unguarded ones, and guarded ones the token reaches and
|
|
399
416
|
* the subject may use. With `tools`, a guarded key is also a tool name an
|
|
400
417
|
* `agent` actor's `tools` list must name.
|
|
401
418
|
*/
|
|
402
|
-
async function visible(checks, context,
|
|
419
|
+
async function visible(checks, context, accessOf, keys, declaredOf = () => void 0, tools = false) {
|
|
403
420
|
const authInfo = context.http?.authInfo;
|
|
404
421
|
const shown = /* @__PURE__ */ new Set();
|
|
405
422
|
const guarded = [];
|
|
406
423
|
for (const key of keys) {
|
|
407
|
-
const
|
|
408
|
-
if (
|
|
409
|
-
|
|
424
|
+
const access = accessOf(key);
|
|
425
|
+
if (access === void 0) {
|
|
426
|
+
shown.add(key);
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
const reached = access.permissions.filter((permission) => reachable(checks, authInfo, reachOf(checks.policy, permission, declaredOf(key))));
|
|
430
|
+
if (access.anyOf ? reached.length > 0 : reached.length === access.permissions.length) guarded.push({
|
|
410
431
|
key,
|
|
411
|
-
|
|
432
|
+
access: {
|
|
433
|
+
...access,
|
|
434
|
+
permissions: reached
|
|
435
|
+
}
|
|
412
436
|
});
|
|
413
437
|
}
|
|
414
438
|
if (guarded.length === 0) return shown;
|
|
@@ -419,14 +443,17 @@ async function visible(checks, context, permissionOf, keys, declaredOf = () => v
|
|
|
419
443
|
if (checks.onError !== void 0) {
|
|
420
444
|
const tenant = await reportedTenant(checks.options.tenant, authInfo);
|
|
421
445
|
for (const entry of guarded) report(checks.onError, error, {
|
|
422
|
-
permission: entry.
|
|
446
|
+
permission: entry.access.permissions[0]?.key ?? null,
|
|
423
447
|
name: entry.key,
|
|
424
448
|
tenant
|
|
425
449
|
});
|
|
426
450
|
}
|
|
427
451
|
return shown;
|
|
428
452
|
}
|
|
429
|
-
for (const entry of guarded)
|
|
453
|
+
for (const entry of guarded) {
|
|
454
|
+
const usable = (permission) => permdock.mayUse(permission);
|
|
455
|
+
if ((!tools || actorMayCallTool(permdock.subject.actor, entry.key)) && (entry.access.anyOf ? entry.access.permissions.some(usable) : entry.access.permissions.every(usable))) shown.add(entry.key);
|
|
456
|
+
}
|
|
430
457
|
return shown;
|
|
431
458
|
}
|
|
432
459
|
/** `handler` behind the call check; a refusal goes to `onRefusal` instead. */
|
|
@@ -452,6 +479,57 @@ function guard(checks, permission, load, handler, dataArgs, onRefusal, extra = {
|
|
|
452
479
|
return result;
|
|
453
480
|
};
|
|
454
481
|
}
|
|
482
|
+
const FROM_DATA = Symbol("permdock.mcp.data");
|
|
483
|
+
/**
|
|
484
|
+
* `handler` behind a check of every permission in `access` (or one, with
|
|
485
|
+
* `anyOf`) over the row `data` loads or every row `rows` loads. Credentials are
|
|
486
|
+
* checked before `rows` runs; a refusal goes to `onRefusal`.
|
|
487
|
+
*/
|
|
488
|
+
function guardSet(checks, access, loaders, handler, dataArgs, onRefusal, extra = {}) {
|
|
489
|
+
const { permissions, anyOf } = access;
|
|
490
|
+
const [lead] = permissions;
|
|
491
|
+
if (lead === void 0) throw new TypeError("permdock/mcp: a guarded tool needs a permission");
|
|
492
|
+
const reachFor = (permission) => reachOf(checks.policy, permission, extra.declared);
|
|
493
|
+
return async (...params) => {
|
|
494
|
+
const raw = params.at(-1);
|
|
495
|
+
const context = contextOf(raw);
|
|
496
|
+
const authInfo = context.http?.authInfo;
|
|
497
|
+
const args = dataArgs(params);
|
|
498
|
+
const tool = extra.tool?.();
|
|
499
|
+
const name = extra.name?.() ?? tool ?? lead.key;
|
|
500
|
+
const refusals = permissions.map((permission) => credentialRefusal(checks, permission, reachFor(permission), authInfo));
|
|
501
|
+
const blocked = anyOf ? refusals.every((refusal) => refusal !== void 0) : refusals.some((refusal) => refusal !== void 0);
|
|
502
|
+
let result;
|
|
503
|
+
const rows = blocked ? [] : await loadRows(checks, loaders, args, authInfo, lead, name);
|
|
504
|
+
const refusal = blocked ? refusals.find((entry) => entry !== void 0) : rows.length === 0 ? plainRefusal(lead, `Denied: ${lead.key} found no rows.`, {}) : await setRefusal(access, rows, (permission, row) => checkCall(checks, permission, reachFor(permission), args, row === FROM_DATA ? loaders.data === void 0 ? void 0 : () => loaders.data?.(...args) : () => row, context, raw, extra.capabilities, void 0, tool, name));
|
|
505
|
+
if (refusal === void 0) result = await handler(...params);
|
|
506
|
+
else result = onRefusal(refusal);
|
|
507
|
+
await extra.after?.(context);
|
|
508
|
+
return result;
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
function isRowList(value) {
|
|
512
|
+
return Array.isArray(value);
|
|
513
|
+
}
|
|
514
|
+
async function loadRows(checks, loaders, args, authInfo, lead, name) {
|
|
515
|
+
if (loaders.rows === void 0) return [FROM_DATA];
|
|
516
|
+
try {
|
|
517
|
+
const rows = await loaders.rows(...args);
|
|
518
|
+
return isRowList(rows) ? rows : [];
|
|
519
|
+
} catch (error) {
|
|
520
|
+
await flush(checks, authInfo, [error], lead.key, name);
|
|
521
|
+
return [];
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
async function setRefusal(access, rows, check) {
|
|
525
|
+
const outcome = await decideAll(access.permissions, rows, access.anyOf, async (permission, batch) => {
|
|
526
|
+
const results = [];
|
|
527
|
+
for (const row of batch) results.push(await check(permission, row));
|
|
528
|
+
return results;
|
|
529
|
+
}, (checked) => checked.ok);
|
|
530
|
+
if (outcome.ok) return;
|
|
531
|
+
return outcome.result === void 0 || outcome.result.ok ? plainRefusal(outcome.permission, `Denied: ${outcome.permission.key}.`, {}) : outcome.result.refusal;
|
|
532
|
+
}
|
|
455
533
|
//#endregion
|
|
456
534
|
//#region src/mcp/protect-server.ts
|
|
457
535
|
const SESSIONS_PER_SERVER = 1e3;
|
|
@@ -460,7 +538,42 @@ function requirePermission(kind, name, config) {
|
|
|
460
538
|
if (!isRecord(permission) || typeof permission["key"] !== "string") throw new TypeError(`permdock/mcp: ${kind} ${name} has no permission; every guarded registration needs one.`);
|
|
461
539
|
return permission;
|
|
462
540
|
}
|
|
541
|
+
/**
|
|
542
|
+
* A tool's access from its `permission`: `null` for a public tool, else one
|
|
543
|
+
* permission or a non-empty list. Anything else throws, so a tool is public
|
|
544
|
+
* only when it says so.
|
|
545
|
+
*/
|
|
546
|
+
function toolAccess(name, permission, anyOf) {
|
|
547
|
+
if (permission === null) return null;
|
|
548
|
+
if (Array.isArray(permission)) {
|
|
549
|
+
if (permission.length === 0) throw new TypeError(`permdock/mcp: tool ${name} has an empty permission list.`);
|
|
550
|
+
return {
|
|
551
|
+
permissions: permission.map((entry) => requirePermission("tool", name, { permission: entry })),
|
|
552
|
+
anyOf
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
return {
|
|
556
|
+
permissions: [requirePermission("tool", name, { permission })],
|
|
557
|
+
anyOf: false
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
/** Annotations every permission of an all-of or any-of list agrees on. */
|
|
561
|
+
function annotationsOf(access) {
|
|
562
|
+
const [only, ...rest] = access.permissions;
|
|
563
|
+
if (only !== void 0 && rest.length === 0) return annotationsFor(only);
|
|
564
|
+
const hints = access.permissions.map(annotationsFor);
|
|
565
|
+
const readOnly = hints.every((hint) => hint.readOnlyHint === true);
|
|
566
|
+
return {
|
|
567
|
+
readOnlyHint: readOnly,
|
|
568
|
+
...!readOnly && hints.some((hint) => hint.destructiveHint === true) ? { destructiveHint: true } : {},
|
|
569
|
+
...hints.every((hint) => hint.idempotentHint === true) ? { idempotentHint: true } : {}
|
|
570
|
+
};
|
|
571
|
+
}
|
|
463
572
|
const UI_SCHEME = "ui://";
|
|
573
|
+
/** A tool handler takes `(args, ctx)`, or only `ctx` without an input schema. */
|
|
574
|
+
function toolArgs(params) {
|
|
575
|
+
return params.length >= 2 ? [params[0]] : [void 0];
|
|
576
|
+
}
|
|
464
577
|
/** The MCP Apps view a tool links through `_meta.ui.resourceUri`. */
|
|
465
578
|
function uiResourceUri(meta) {
|
|
466
579
|
const ui = isRecord(meta) ? meta["ui"] : void 0;
|
|
@@ -488,7 +601,7 @@ function protectServer(checks, server, enforcement) {
|
|
|
488
601
|
const uiLinks = /* @__PURE__ */ new Map();
|
|
489
602
|
const templates = [];
|
|
490
603
|
const lastListed = boundedMap(SESSIONS_PER_SERVER);
|
|
491
|
-
const
|
|
604
|
+
const toolAccessOf = (name) => tools.get(name) ?? void 0;
|
|
492
605
|
const toolDeclared = (name) => toolScopes.get(name);
|
|
493
606
|
const promptPermission = (name) => prompts.get(name);
|
|
494
607
|
const resourcePermission = (uri) => {
|
|
@@ -497,11 +610,11 @@ function protectServer(checks, server, enforcement) {
|
|
|
497
610
|
return templates.find((entry) => entry.template.uriTemplate.match(uri) !== null)?.permission;
|
|
498
611
|
};
|
|
499
612
|
const templatePermission = (uriTemplate) => templates.find((entry) => entry.template.uriTemplate.toString() === uriTemplate)?.permission;
|
|
500
|
-
const listFilter = (field, keyOf,
|
|
613
|
+
const listFilter = (field, keyOf, accessOf, remember, hidden = () => false) => async (result, rawContext) => {
|
|
501
614
|
if (!isRecord(result) || !Array.isArray(result[field])) return result;
|
|
502
615
|
const context = contextOf(rawContext);
|
|
503
616
|
const entries = result[field].filter((entry) => !hidden(keyOf(entry)));
|
|
504
|
-
const shown = await visible(checks, context,
|
|
617
|
+
const shown = await visible(checks, context, accessOf, entries.map(keyOf), remember ? toolDeclared : void 0, remember);
|
|
505
618
|
const kept = entries.filter((entry) => shown.has(keyOf(entry)));
|
|
506
619
|
if (remember) lastListed.set(sessionKey(context), [...shown].toSorted().join(","));
|
|
507
620
|
return definesCacheScope(context) ? {
|
|
@@ -514,10 +627,10 @@ function protectServer(checks, server, enforcement) {
|
|
|
514
627
|
};
|
|
515
628
|
};
|
|
516
629
|
const filters = {
|
|
517
|
-
"tools/list": listFilter("tools", (entry) => entry.name,
|
|
518
|
-
"prompts/list": listFilter("prompts", (entry) => entry.name, promptPermission, false),
|
|
519
|
-
"resources/list": listFilter("resources", (entry) => entry.uri, resourcePermission, false, (uri) => views.has(uri) && resourcePermission(uri) === void 0),
|
|
520
|
-
"resources/templates/list": listFilter("resourceTemplates", (entry) => entry.uriTemplate, templatePermission, false)
|
|
630
|
+
"tools/list": listFilter("tools", (entry) => entry.name, toolAccessOf, true),
|
|
631
|
+
"prompts/list": listFilter("prompts", (entry) => entry.name, (name) => single(promptPermission(name)), false),
|
|
632
|
+
"resources/list": listFilter("resources", (entry) => entry.uri, (uri) => single(resourcePermission(uri)), false, (uri) => views.has(uri) && resourcePermission(uri) === void 0),
|
|
633
|
+
"resources/templates/list": listFilter("resourceTemplates", (entry) => entry.uriTemplate, (uriTemplate) => single(templatePermission(uriTemplate)), false)
|
|
521
634
|
};
|
|
522
635
|
const inner = server.server;
|
|
523
636
|
const capabilities = () => inner.getClientCapabilities?.();
|
|
@@ -542,67 +655,98 @@ function protectServer(checks, server, enforcement) {
|
|
|
542
655
|
const key = sessionKey(context);
|
|
543
656
|
const before = lastListed.get(key);
|
|
544
657
|
if (before === void 0) return;
|
|
545
|
-
const after = [...await visible(checks, context,
|
|
658
|
+
const after = [...await visible(checks, context, toolAccessOf, [...tools.keys()], toolDeclared, true)].toSorted().join(",");
|
|
546
659
|
if (after === before) return;
|
|
547
660
|
lastListed.set(key, after);
|
|
548
661
|
try {
|
|
549
662
|
await (context.mcpReq?.notify?.({ method: "notifications/tools/list_changed" }) ?? inner.sendToolListChanged?.());
|
|
550
663
|
} catch {}
|
|
551
664
|
};
|
|
552
|
-
const guardTool = (tool,
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
665
|
+
const guardTool = (tool, access, reach, declared, loaders, handler, longRunning) => {
|
|
666
|
+
const [only, ...rest] = access.permissions;
|
|
667
|
+
const extra = {
|
|
668
|
+
after: announce,
|
|
669
|
+
capabilities,
|
|
670
|
+
tool,
|
|
671
|
+
name: tool
|
|
672
|
+
};
|
|
673
|
+
if (only !== void 0 && rest.length === 0 && loaders.rows === void 0) return guard(checks, only, loaders.data, handler, toolArgs, toolRefusal, {
|
|
674
|
+
...extra,
|
|
675
|
+
longRunning,
|
|
676
|
+
reach
|
|
677
|
+
});
|
|
678
|
+
return guardSet(checks, access, loaders, handler, toolArgs, toolRefusal, {
|
|
679
|
+
...extra,
|
|
680
|
+
declared
|
|
681
|
+
});
|
|
682
|
+
};
|
|
560
683
|
const originalTool = server.registerTool.bind(server);
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
684
|
+
const toolAccessFor = (name, config) => {
|
|
685
|
+
const fields = [
|
|
686
|
+
"data",
|
|
687
|
+
"rows",
|
|
688
|
+
"longRunning",
|
|
689
|
+
"anyOf"
|
|
690
|
+
];
|
|
691
|
+
if (enforcement !== void 0) {
|
|
692
|
+
for (const field of fields) if (config[field] !== void 0) throw new TypeError(`permdock/mcp: tool ${name} sets ${field}, but with enforce: 'procedure' its procedure decides.`);
|
|
693
|
+
return toolAccess(name, config["permission"] === void 0 ? enforcement.permissionFor(name) : config["permission"], true);
|
|
694
|
+
}
|
|
695
|
+
if (!Object.hasOwn(config, "permission")) requirePermission("tool", name, config);
|
|
696
|
+
const access = toolAccess(name, config["permission"], config["anyOf"] === true);
|
|
697
|
+
const given = fields.filter((field) => config[field] !== void 0);
|
|
698
|
+
if (access === null && given.length > 0) throw new TypeError(`permdock/mcp: tool ${name} is public (permission: null) but sets ${given.join(", ")}.`);
|
|
699
|
+
if (config["data"] !== void 0 && config["rows"] !== void 0) throw new TypeError(`permdock/mcp: tool ${name} sets both data and rows; rows loads every row.`);
|
|
700
|
+
if (config["longRunning"] === true && (config["rows"] !== void 0 || (access?.permissions.length ?? 0) > 1)) throw new TypeError(`permdock/mcp: tool ${name} sets longRunning, which takes one permission and no rows.`);
|
|
701
|
+
return access;
|
|
565
702
|
};
|
|
566
703
|
/**
|
|
567
704
|
* With `enforce: 'procedure'` the handler runs undecided: the procedure it
|
|
568
|
-
* calls decides.
|
|
705
|
+
* calls decides. A public tool runs undecided too.
|
|
569
706
|
*/
|
|
570
|
-
const wrapTool = (tool,
|
|
707
|
+
const wrapTool = (tool, access, reach, declared, loaders, handler, longRunning) => enforcement === void 0 && access !== null && reach !== void 0 ? guardTool(tool, access, reach, declared, loaders, handler, longRunning) : async (...params) => {
|
|
571
708
|
const result = await handler(...params);
|
|
572
709
|
await announce(contextOf(params.at(-1)));
|
|
573
710
|
return result;
|
|
574
711
|
};
|
|
575
712
|
const registerTool = (name, config, handler) => {
|
|
576
|
-
const
|
|
713
|
+
const access = toolAccessFor(name, config);
|
|
714
|
+
const [lead, ...others] = access?.permissions ?? [];
|
|
715
|
+
const permission = others.length === 0 ? lead : void 0;
|
|
577
716
|
const view = uiResourceUri(config["_meta"]);
|
|
578
717
|
const linked = view === void 0 ? void 0 : uiLinks.get(view);
|
|
579
|
-
if (view !== void 0 && linked !== void 0 && linked.permission.key !== permission
|
|
580
|
-
const { permission: _permission, data, scopeChallenge, longRunning: rawLongRunning, oauthScopes: rawScopes, ...passthrough } = config;
|
|
581
|
-
const
|
|
718
|
+
if (view !== void 0 && linked !== void 0 && linked.permission.key !== permission?.key) throw new TypeError(`permdock/mcp: tools ${linked.tool} and ${name} link ${view} under different permissions; give the resource its own permission.`);
|
|
719
|
+
const { permission: _permission, anyOf: _anyOf, data, rows, scopeChallenge, longRunning: rawLongRunning, oauthScopes: rawScopes, ...passthrough } = config;
|
|
720
|
+
const loaders = {
|
|
721
|
+
data,
|
|
722
|
+
rows
|
|
723
|
+
};
|
|
582
724
|
const longRunning = rawLongRunning === true;
|
|
583
725
|
const declared = declaredScopes(name, rawScopes === void 0 ? enforcement?.oauthScopesFor?.(name) : rawScopes);
|
|
584
|
-
const reach = reachOf(checks.policy,
|
|
726
|
+
const reach = lead === void 0 ? void 0 : reachOf(checks.policy, lead, declared);
|
|
585
727
|
let current = name;
|
|
586
728
|
const tool = () => current;
|
|
587
|
-
const
|
|
729
|
+
const ownAnnotations = passthrough["annotations"];
|
|
730
|
+
const ownChallenge = scopeChallenge;
|
|
731
|
+
const registered = originalTool(name, compact({
|
|
588
732
|
...passthrough,
|
|
589
|
-
annotations: {
|
|
590
|
-
...
|
|
591
|
-
...
|
|
733
|
+
annotations: access === null ? ownAnnotations : {
|
|
734
|
+
...annotationsOf(access),
|
|
735
|
+
...ownAnnotations
|
|
592
736
|
},
|
|
593
|
-
scopeChallenge: challengeFor(
|
|
594
|
-
}, wrapTool(tool,
|
|
595
|
-
tools.set(name,
|
|
737
|
+
scopeChallenge: reach === void 0 ? ownChallenge : challengeFor(ownChallenge, reach.scopes, reach.challenge)
|
|
738
|
+
}), wrapTool(tool, access, reach, declared, loaders, handler, longRunning));
|
|
739
|
+
tools.set(name, access);
|
|
596
740
|
if (declared !== void 0) toolScopes.set(name, declared);
|
|
597
|
-
if (view !== void 0 && linked === void 0) uiLinks.set(view, {
|
|
741
|
+
if (view !== void 0 && linked === void 0 && permission !== void 0) uiLinks.set(view, {
|
|
598
742
|
tool: name,
|
|
599
743
|
permission
|
|
600
744
|
});
|
|
601
|
-
guardUpdates(registered, (callback) => wrapTool(tool,
|
|
745
|
+
guardUpdates(registered, (callback) => wrapTool(tool, access, reach, declared, loaders, callback, longRunning), (from, to) => {
|
|
602
746
|
tools.delete(from);
|
|
603
747
|
toolScopes.delete(from);
|
|
604
748
|
if (to !== null) {
|
|
605
|
-
tools.set(to,
|
|
749
|
+
tools.set(to, access);
|
|
606
750
|
if (declared !== void 0) toolScopes.set(to, declared);
|
|
607
751
|
current = to;
|
|
608
752
|
}
|
|
@@ -718,9 +862,11 @@ function createPermDock(policy, given) {
|
|
|
718
862
|
const options = withApp(policy, given);
|
|
719
863
|
const actorKind = mcpActorKind(options.actorKind);
|
|
720
864
|
if (actorKind === void 0) throw new TypeError("permdock/mcp: actorKind must be a non-empty string");
|
|
865
|
+
const policyScopes = new Set(listPermissions(policy.permissions).flatMap((permission) => scopesReaching(policy, permission)));
|
|
721
866
|
const checks = {
|
|
722
867
|
policy,
|
|
723
868
|
options,
|
|
869
|
+
policyScopes,
|
|
724
870
|
kernel: createAgentKernel(policy, compact({
|
|
725
871
|
subject: (call) => options.subject(call.authInfo ?? {}),
|
|
726
872
|
actor: (call) => {
|
|
@@ -734,7 +880,7 @@ function createPermDock(policy, given) {
|
|
|
734
880
|
},
|
|
735
881
|
delegation: (call) => {
|
|
736
882
|
if (options.delegation !== void 0) return options.delegation(call.authInfo ?? {});
|
|
737
|
-
return call.authInfo === void 0 ? void 0 : delegationFrom(call.authInfo.scopes, call.authInfo.extra);
|
|
883
|
+
return call.authInfo === void 0 || decidesOnSubject(options, policyScopes, call.authInfo) ? void 0 : delegationFrom(call.authInfo.scopes, call.authInfo.extra);
|
|
738
884
|
},
|
|
739
885
|
tenant: tenantOf(options.tenant),
|
|
740
886
|
store: options.store,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as listPermissions } from "./permission-registry-B8tYxPIt.js";
|
|
2
2
|
import { i as configError } from "./errors-BhRkoNS7.js";
|
|
3
3
|
import { a as loadModule, s as pickNamed, t as asPermissionTree } from "./load-BaEamml-.js";
|
|
4
|
-
import { i as isModuleKey, n as MODULE_KEYS } from "./config-shape-
|
|
4
|
+
import { i as isModuleKey, n as MODULE_KEYS } from "./config-shape-D9paLhEX.js";
|
|
5
5
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
6
6
|
import { dirname, relative, resolve } from "node:path";
|
|
7
7
|
import { parseSync } from "oxc-parser";
|
package/dist/nest/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as Policy, yr as Principal } from "../policy-types-Ky7P23CP.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
-
import { a as PermDock } from "../permdock-
|
|
3
|
+
import { a as PermDock } from "../permdock-B45vPQb4.js";
|
|
4
4
|
import { n as RevocationFeed } from "../revocations-BaUXHM1N.js";
|
|
5
|
-
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-
|
|
6
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
5
|
+
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CwpJe664.js";
|
|
6
|
+
import { t as ServerAdapterOptions } from "../bind-SpRxR213.js";
|
|
7
7
|
import { r as sendResponse, t as NodeRequest } from "../http-B_LphE5Y.js";
|
|
8
8
|
import { CanActivate, DynamicModule, ExceptionFilter, ExecutionContext, Type } from "@nestjs/common";
|
|
9
9
|
//#region src/nest/http.d.ts
|
package/dist/nest/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { n as PermDockValidationError } from "../validation-error-CYg2kJEw.js";
|
|
3
|
-
import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "../errors-
|
|
3
|
+
import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "../errors-ynga1EQy.js";
|
|
4
4
|
import { c as writeReply, r as hasCredentials } from "../http-DKLXrFGk.js";
|
|
5
|
-
import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-
|
|
6
|
-
import { t as problemFromError } from "../map-error-
|
|
7
|
-
import { a as socketConnection, r as bindKernel } from "../bind-
|
|
8
|
-
import { a as onRevoked, n as closeReason, t as POLICY_VIOLATION } from "../stream-
|
|
5
|
+
import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-CNMVJVD6.js";
|
|
6
|
+
import { t as problemFromError } from "../map-error-EOhahOVA.js";
|
|
7
|
+
import { a as socketConnection, r as bindKernel } from "../bind-BnKPWRrE.js";
|
|
8
|
+
import { a as onRevoked, n as closeReason, t as POLICY_VIOLATION } from "../stream-DQ3rbO3J.js";
|
|
9
9
|
import { n as sendResponse, r as toRequest$1, t as isServerResponse } from "../http-DH94eh6f.js";
|
|
10
10
|
import { Catch, Controller, Get, Inject, Injectable, Module, Post, Req, Res, createParamDecorator } from "@nestjs/common";
|
|
11
11
|
import { APP_FILTER, APP_GUARD, Reflector } from "@nestjs/core";
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as Policy, N as PolicyVocabulary, Q as Intent, Qn as DenialReason, Yn as Decision, an as SnapshotTenants, en as Snapshot, xr as Subject, yr as Principal } from "../policy-types-Ky7P23CP.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
-
import { A as PermissionState, a as PermDock, d as UncheckedData, k as PermissionCheck, s as RowData } from "../permdock-
|
|
4
|
-
import { m as ApprovalStore } from "../types
|
|
5
|
-
import { t as InstanceOptions } from "../instance-options-
|
|
6
|
-
import { n as PermDockWrap } from "../wrap-
|
|
7
|
-
import { o as OtelWrap } from "../types-
|
|
8
|
-
import { n as DescribeMessages } from "../describe-
|
|
9
|
-
import { a as snapshotHeaders, i as cacheLifeFor, n as SnapshotHeaders, o as snapshotKey, r as SnapshotHeadersOptions, s as snapshotTag, t as CacheLifeForOptions } from "../snapshot-cache-
|
|
10
|
-
import { v as ActionResult, y as ProtectedAction } from "../store-
|
|
11
|
-
import { n as PermDockProviderProps } from "../types-
|
|
3
|
+
import { A as PermissionState, a as PermDock, d as UncheckedData, k as PermissionCheck, s as RowData } from "../permdock-B45vPQb4.js";
|
|
4
|
+
import { m as ApprovalStore } from "../types--HfnkawU.js";
|
|
5
|
+
import { t as InstanceOptions } from "../instance-options-D6hyIKJF.js";
|
|
6
|
+
import { n as PermDockWrap } from "../wrap-C-4o-Dpy.js";
|
|
7
|
+
import { o as OtelWrap } from "../types-g0Vk9k2c.js";
|
|
8
|
+
import { n as DescribeMessages } from "../describe-DyN-HX6o.js";
|
|
9
|
+
import { a as snapshotHeaders, i as cacheLifeFor, n as SnapshotHeaders, o as snapshotKey, r as SnapshotHeadersOptions, s as snapshotTag, t as CacheLifeForOptions } from "../snapshot-cache-B9weL8NE.js";
|
|
10
|
+
import { v as ActionResult, y as ProtectedAction } from "../store-CjJaZI_g.js";
|
|
11
|
+
import { n as PermDockProviderProps } from "../types-BlYPxJDR.js";
|
|
12
12
|
import { ReactElement, ReactNode } from "react";
|
|
13
13
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
14
14
|
//#region src/next/types.d.ts
|
|
@@ -60,7 +60,7 @@ type GetSnapshotQuery = GetPermDockQuery & {
|
|
|
60
60
|
readonly include?: readonly (Permission | {
|
|
61
61
|
readonly [key: string]: unknown;
|
|
62
62
|
})[];
|
|
63
|
-
readonly tenants?:
|
|
63
|
+
readonly tenants?: SnapshotTenants;
|
|
64
64
|
/**
|
|
65
65
|
* Tags added next to `snapshotTag(sub)`, such as the app's own organisation
|
|
66
66
|
* tag.
|
|
@@ -99,7 +99,7 @@ type NextPermDockProviderProps = NextPermDockProviderDisplay & ({
|
|
|
99
99
|
readonly include?: readonly (Permission | {
|
|
100
100
|
readonly [key: string]: unknown;
|
|
101
101
|
})[];
|
|
102
|
-
readonly tenants?:
|
|
102
|
+
readonly tenants?: SnapshotTenants;
|
|
103
103
|
});
|
|
104
104
|
/**
|
|
105
105
|
* Function props of the React provider: a Server Component cannot pass them to
|
package/dist/next/index.js
CHANGED
|
@@ -4,14 +4,14 @@ import { o as statusProblem, t as notFoundDetails } from "../problem-details-CLD
|
|
|
4
4
|
import { n as isThenable } from "../thenable-BNSM1U2R.js";
|
|
5
5
|
import { n as resourceRef } from "../resource-ref-CaS9yVPi.js";
|
|
6
6
|
import { a as permissionStates } from "../checks-fyDOhcz0.js";
|
|
7
|
-
import { l as withApp } from "../permdock-
|
|
7
|
+
import { l as withApp } from "../permdock-DeOfonuG.js";
|
|
8
8
|
import { n as wrapPermDock } from "../wrap-C5PWzgkq.js";
|
|
9
|
-
import { i as decisionProblem } from "../problem-
|
|
10
|
-
import { s as resumeDecision } from "../helpers-
|
|
9
|
+
import { i as decisionProblem } from "../problem-BWP1l86g.js";
|
|
10
|
+
import { s as resumeDecision } from "../helpers-D-MXwkOF.js";
|
|
11
11
|
import { i as snapshotTag, n as snapshotHeaders, r as snapshotKey, t as cacheLifeFor } from "../snapshot-cache-B66h7FBK.js";
|
|
12
|
-
import { n as resolveOrNull, t as buildInstance } from "../build-instance-
|
|
12
|
+
import { n as resolveOrNull, t as buildInstance } from "../build-instance-DrIbZVnm.js";
|
|
13
13
|
import { n as NO_GRANT, t as LOAD_FAILED } from "../decision-CaG5_eNJ.js";
|
|
14
|
-
import { o as evaluationsHandler } from "../evaluations-
|
|
14
|
+
import { o as evaluationsHandler } from "../evaluations-CNMVJVD6.js";
|
|
15
15
|
import { cache } from "react";
|
|
16
16
|
import { jsx } from "react/jsx-runtime";
|
|
17
17
|
import { forbidden, unauthorized, unstable_rethrow } from "#next/navigation";
|
|
@@ -71,14 +71,14 @@ function protectActionOf(deps) {
|
|
|
71
71
|
}));
|
|
72
72
|
} catch (error) {
|
|
73
73
|
deps.rethrow(error);
|
|
74
|
-
return refused(decisionProblem(NO_GRANT, permission
|
|
74
|
+
return refused(decisionProblem(NO_GRANT, permission));
|
|
75
75
|
}
|
|
76
76
|
if (options.data !== void 0) {
|
|
77
77
|
try {
|
|
78
78
|
data = await options.data(input) ?? void 0;
|
|
79
79
|
} catch (error) {
|
|
80
80
|
deps.rethrow(error);
|
|
81
|
-
return refused(decisionProblem(LOAD_FAILED, permission
|
|
81
|
+
return refused(decisionProblem(LOAD_FAILED, permission));
|
|
82
82
|
}
|
|
83
83
|
if (data === void 0) return refused(notFoundDetails());
|
|
84
84
|
}
|
|
@@ -96,7 +96,7 @@ function protectActionOf(deps) {
|
|
|
96
96
|
adapter: "next",
|
|
97
97
|
token: call?.approval
|
|
98
98
|
});
|
|
99
|
-
if (decision.outcome !== "granted") return refused(decisionProblem(decision, permission,
|
|
99
|
+
if (decision.outcome !== "granted") return refused(decisionProblem(decision, permission, compact({ disclosure: data === void 0 ? void 0 : deps.policy.resources.get(permission.resource)?.disclosure })));
|
|
100
100
|
try {
|
|
101
101
|
return {
|
|
102
102
|
ok: true,
|
package/dist/next/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as PermDockPluginOptions } from "../types-
|
|
1
|
+
import { s as PermDockPluginOptions } from "../types-BwuNGQRm.js";
|
|
2
2
|
//#region src/cli/plugin.d.ts
|
|
3
3
|
/** Any object: Next's `NextConfig` is an interface, so no index signature. */
|
|
4
4
|
type NextConfigLike = object;
|
package/dist/next/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as describeError } from "../errors-BhRkoNS7.js";
|
|
2
|
-
import { n as createCollectScheduler, r as report, t as collectOnce } from "../watch-
|
|
2
|
+
import { n as createCollectScheduler, r as report, t as collectOnce } from "../watch-Dz2LNM1R.js";
|
|
3
3
|
//#region src/cli/plugin.ts
|
|
4
4
|
const PHASE_BUILD = "phase-production-build";
|
|
5
5
|
const PHASE_DEV = "phase-development-server";
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as Policy, N as PolicyVocabulary, yr as Principal } from "../policy-types-Ky7P23CP.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
-
import { a as PermDock } from "../permdock-
|
|
4
|
-
import { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, r as Guard, s as ScopeGuard, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-
|
|
5
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
3
|
+
import { a as PermDock } from "../permdock-B45vPQb4.js";
|
|
4
|
+
import { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, r as Guard, s as ScopeGuard, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CwpJe664.js";
|
|
5
|
+
import { t as ServerAdapterOptions } from "../bind-SpRxR213.js";
|
|
6
6
|
import { i as toRequest, n as isServerResponse, r as sendResponse, t as NodeRequest } from "../http-B_LphE5Y.js";
|
|
7
7
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
8
8
|
//#region src/node/create.d.ts
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-
|
|
2
|
-
import { r as bindKernel } from "../bind-
|
|
1
|
+
import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-CNMVJVD6.js";
|
|
2
|
+
import { r as bindKernel } from "../bind-BnKPWRrE.js";
|
|
3
3
|
import { n as sendResponse, r as toRequest, t as isServerResponse } from "../http-DH94eh6f.js";
|
|
4
4
|
//#region src/node/create.ts
|
|
5
5
|
const nodeRequest = (req) => req;
|
package/dist/openai/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as Policy, N as PolicyVocabulary, yr as Principal } from "../policy-types-Ky7P23CP.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
-
import { a as PermDock } from "../permdock-
|
|
4
|
-
import { u as ApprovalRequest } from "../types
|
|
5
|
-
import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-
|
|
3
|
+
import { a as PermDock } from "../permdock-B45vPQb4.js";
|
|
4
|
+
import { u as ApprovalRequest } from "../types--HfnkawU.js";
|
|
5
|
+
import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-0B_bjJc-.js";
|
|
6
6
|
//#region src/openai/create.d.ts
|
|
7
7
|
/** The app context passed to `run(agent, input, { context })`. */
|
|
8
8
|
type OpenAiContext = {
|
package/dist/openai/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
|
-
import { l as withApp } from "../permdock-
|
|
3
|
-
import { t as approvalTokenOf } from "../kernel-
|
|
4
|
-
import { t as agentRuntime } from "../create-
|
|
2
|
+
import { l as withApp } from "../permdock-DeOfonuG.js";
|
|
3
|
+
import { t as approvalTokenOf } from "../kernel-B2UCK36Z.js";
|
|
4
|
+
import { t as agentRuntime } from "../create-CAZyXZFC.js";
|
|
5
5
|
//#region src/openai/create.ts
|
|
6
6
|
function appContext(runContext) {
|
|
7
7
|
const context = runContext?.context;
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as Policy, Er as Condition, yr as Principal } from "../policy-types-Ky7P23CP.js";
|
|
2
2
|
import { f as PermissionTree, u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
-
import { a as ProblemDetails } from "../errors-
|
|
3
|
+
import { a as ProblemDetails } from "../errors-POWcCXy7.js";
|
|
4
4
|
import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
5
|
//#region src/openapi/types.d.ts
|
|
6
6
|
type OpenApiTarget = "3.1" | "3.2" | "3.3";
|
|
@@ -80,7 +80,7 @@ const emit = defineLeaf({
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
async run(ctx, { flags }) {
|
|
83
|
-
return (await import("./openapi-
|
|
83
|
+
return (await import("./openapi-Cr0B3p2h.js")).runOpenapi({
|
|
84
84
|
cwd: ctx.cwd,
|
|
85
85
|
config: ctx.config,
|
|
86
86
|
rest: ["emit"],
|
|
@@ -122,7 +122,7 @@ const importDocument = defineLeaf({
|
|
|
122
122
|
async run(ctx, { flags }) {
|
|
123
123
|
const doc = given(flags.doc);
|
|
124
124
|
if (doc === void 0) throw missingInput("openapi import", ["--doc"], "the OpenAPI document to import");
|
|
125
|
-
return (await import("./import-
|
|
125
|
+
return (await import("./import-DNaFHm53.js")).runOpenapiImport({
|
|
126
126
|
cwd: ctx.cwd,
|
|
127
127
|
doc,
|
|
128
128
|
out: fileOut("openapi import", flags.out),
|