decocms 3.11.0 → 3.12.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/client/assets/{AlertCircle-Ctbek2zl.js → AlertCircle-l0Fpo8hU.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CGlPrRsR.js → ArrowUpRight-nFWH1Ez9.js} +1 -1
- package/dist/client/assets/{Check-D-2DMeXR.js → Check-c_jJpxb1.js} +1 -1
- package/dist/client/assets/{CheckCircle-CPLY3iX-.js → CheckCircle-38u06F5f.js} +1 -1
- package/dist/client/assets/{ChevronDown-DUb-OAcF.js → ChevronDown-BD_mAbO2.js} +1 -1
- package/dist/client/assets/{ChevronLeft-IUSMXc7n.js → ChevronLeft-CpIXC6Gs.js} +1 -1
- package/dist/client/assets/{ChevronRight-C6_Bb1P7.js → ChevronRight-DLrAfqVe.js} +1 -1
- package/dist/client/assets/{ChevronUp-mT0kmu5O.js → ChevronUp-CSbcB5D_.js} +1 -1
- package/dist/client/assets/{Container-V3OuMECL.js → Container-DhunwrH9.js} +1 -1
- package/dist/client/assets/{DotsVertical-CYMPhMIv.js → DotsVertical-Drb9z9hu.js} +1 -1
- package/dist/client/assets/{Eye-DLKlw-42.js → Eye-cKsI4OxT.js} +1 -1
- package/dist/client/assets/{FilterLines-B2lLGnWS.js → FilterLines-BiHh13xm.js} +1 -1
- package/dist/client/assets/{Globe01-BSqLqa8H.js → Globe01-BqxI6QZP.js} +1 -1
- package/dist/client/assets/{HardDrive-BFG0b6vP.js → HardDrive-BwbAMrUb.js} +1 -1
- package/dist/client/assets/{Key01-DeIJhm73.js → Key01-qQx1LV2o.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CAachN7j.js → LayoutLeft-CpIWBcma.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C7Ulot5I.js → LinkExternal01-CXoDDgz6.js} +1 -1
- package/dist/client/assets/{Monitor01-RdLthi4L.js → Monitor01-DdJ7wtCm.js} +1 -1
- package/dist/client/assets/{Palette-D1rjO3C7.js → Palette-B-k8xsYD.js} +1 -1
- package/dist/client/assets/{Play-CL1Mgiwf.js → Play-CjnZZCXU.js} +1 -1
- package/dist/client/assets/{Plus-DINfOuqC.js → Plus-DhX2w18y.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DSZXx3HQ.js → RefreshCcw01-COCceFoS.js} +1 -1
- package/dist/client/assets/{SearchMd-Dt4Aj6N4.js → SearchMd-DrKxcX2-.js} +1 -1
- package/dist/client/assets/{Settings02-COHAF-aj.js → Settings02-YFMXLzh7.js} +1 -1
- package/dist/client/assets/{Shield01-Ef5O0H91.js → Shield01-C0lG89zR.js} +1 -1
- package/dist/client/assets/{Star01-DWr_psxV.js → Star01-DSZcWlXz.js} +1 -1
- package/dist/client/assets/{Stars01-CTAt_kJn.js → Stars01-CJvAL1Fd.js} +1 -1
- package/dist/client/assets/{Stars02-7S-x4jsE.js → Stars02-BZvUEwJW.js} +1 -1
- package/dist/client/assets/{Sun-C0yimusT.js → Sun-Bc4Ui5gi.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CdSYnpvh.js → SwitchHorizontal01-Dh0Hb3Cs.js} +1 -1
- package/dist/client/assets/{Tool01-Co9IzxOX.js → Tool01-C6w2kT2d.js} +1 -1
- package/dist/client/assets/{Trash01-m4F91Gbm.js → Trash01-CicwXof9.js} +1 -1
- package/dist/client/assets/{Upload01-BWuva6Fs.js → Upload01-Cjsy_A0C.js} +1 -1
- package/dist/client/assets/{User01-BQ6QP8OL.js → User01-C-Fxjmsz.js} +1 -1
- package/dist/client/assets/{Users01-ByzlIQ3F.js → Users01-Bcdl2fo8.js} +1 -1
- package/dist/client/assets/{Users03-mgRYViRT.js → Users03-BQUStXwY.js} +1 -1
- package/dist/client/assets/{X-D5DAti-0.js → X-BZgcfyxc.js} +1 -1
- package/dist/client/assets/{XCircle-BjeFLJxj.js → XCircle-DZXIRf5B.js} +1 -1
- package/dist/client/assets/{XClose-s3WJPw3-.js → XClose-BJgeWVDy.js} +1 -1
- package/dist/client/assets/{Zap-Z3n8EP6c.js → Zap-DHRMF6hr.js} +1 -1
- package/dist/client/assets/{ZapSquare-By7Cv3Wp.js → ZapSquare-DHYwZGs3.js} +1 -1
- package/dist/client/assets/{ZoomOut-CIHaUyEl.js → ZoomOut-DUCp8Gob.js} +1 -1
- package/dist/client/assets/{access-gate-Duof6cnb.js → access-gate-D3K4mW0p.js} +1 -1
- package/dist/client/assets/accordion-Dczz3n4d.js +1 -0
- package/dist/client/assets/{add-section-modal-DkoTaNoJ.js → add-section-modal-UjRtSYXi.js} +1 -1
- package/dist/client/assets/{agent-capabilities-Ckkw1MUq.js → agent-capabilities-CTp309mj.js} +2 -2
- package/dist/client/assets/{agent-icon-VIqap9Jf.js → agent-icon-BGlV6q8v.js} +1 -1
- package/dist/client/assets/{agent-icons-D05ipmZ4.js → agent-icons-D51QBNe2.js} +1 -1
- package/dist/client/assets/{agents-list-CVx5qLnY.js → agents-list-BDjAtGII.js} +1 -1
- package/dist/client/assets/{ai-providers-BuKKX642.js → ai-providers-C5FRtqVa.js} +1 -1
- package/dist/client/assets/{alert-DlT05Ylq.js → alert-C2SAdiMn.js} +1 -1
- package/dist/client/assets/{alert-dialog-Ci1rMRpl.js → alert-dialog-CfIqXXf0.js} +1 -1
- package/dist/client/assets/app-editor-BtCGiT5R.js +1 -0
- package/dist/client/assets/{auth-catchall-BUCBz8XY.js → auth-catchall-BNIV3K68.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CY6KnHSz.js → auth-split-layout-Ur7ekzLQ.js} +1 -1
- package/dist/client/assets/{automation-list-row-Dg6SIiTL.js → automation-list-row-BI945zvy.js} +1 -1
- package/dist/client/assets/{automation-runs-BmKdgkka.js → automation-runs-BYBNQ-JJ.js} +1 -1
- package/dist/client/assets/{automations-BcxEWxp4.js → automations-BS4h-ogy.js} +1 -1
- package/dist/client/assets/{avatar-B5XGLu28.js → avatar-CV-HskE0.js} +1 -1
- package/dist/client/assets/{badge-BiVWMQaC.js → badge-BIbhtFGp.js} +1 -1
- package/dist/client/assets/{brand-context-DSuk-fkh.js → brand-context-DoHj9jxR.js} +1 -1
- package/dist/client/assets/{buckets-DNim0Oxi.js → buckets-3KyheLMz.js} +1 -1
- package/dist/client/assets/{calendar-D3ybWgKx.js → calendar-anoyFX3_.js} +1 -1
- package/dist/client/assets/{capability-load-error-BoG7ZxlR.js → capability-load-error-5fpCsl-E.js} +1 -1
- package/dist/client/assets/{card-Bs_ZETWd.js → card-clJ4_TXy.js} +1 -1
- package/dist/client/assets/{chat-context-DXMK9LpM.js → chat-context-CMCmhu0x.js} +7 -7
- package/dist/client/assets/{checkbox-CDeLVmoz.js → checkbox-D5ZsgUiL.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DUzSXn1x.js → cli-auth-success-DUs_glfQ.js} +1 -1
- package/dist/client/assets/{collection-detail-B39xBZcf.js → collection-detail-DoORbeIU.js} +1 -1
- package/dist/client/assets/{collection-display-button-LYjUKJyD.js → collection-display-button-BHU3gVjd.js} +1 -1
- package/dist/client/assets/{collection-search-CIGzMvXg.js → collection-search-XnV7IoL4.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CRZ7umIR.js → collection-table-wrapper-Def6_fTh.js} +1 -1
- package/dist/client/assets/{collection-tabs-Cl0Sce7d.js → collection-tabs-BL5EWXFo.js} +1 -1
- package/dist/client/assets/{collections-DsvWgjkq.js → collections-CjrPw-fH.js} +1 -1
- package/dist/client/assets/{command-nIpjgY_C.js → command-xElkUveT.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-D0cwbi62.js → connect-desktop-dialog-z9_d2OMY.js} +1 -1
- package/dist/client/assets/{connection-card-Js2GKnMD.js → connection-card-CdjjPmMy.js} +1 -1
- package/dist/client/assets/connection-detail-CLkds3z5.js +1 -0
- package/dist/client/assets/connection-form-helpers-x6Qv_JQD.js +1 -0
- package/dist/client/assets/{connections-BM65SkyA.js → connections-scTFfwYa.js} +1 -1
- package/dist/client/assets/constants-_NfKPeA7.js +10 -0
- package/dist/client/assets/{decopilot-sse-pool-xYuzxJCG.js → decopilot-sse-pool-uVjHemnd.js} +1 -1
- package/dist/client/assets/{dialog-BDoa-Aig.js → dialog-DAZt_PYz.js} +1 -1
- package/dist/client/assets/{domain-settings-BHKhY4wr.js → domain-settings-BeuJal2Z.js} +1 -1
- package/dist/client/assets/{drawer-DBoqm7Ga.js → drawer-DgVqJYUv.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BuEg85yr.js → dropdown-menu-D8Jq0EXH.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DROpH4YR.js → dynamic-plugin-layout-DfSmXQDS.js} +1 -1
- package/dist/client/assets/{empty-state-Ct_D2Lzo.js → empty-state-ClDtXUcE.js} +1 -1
- package/dist/client/assets/{empty-state-BzUpYoP8.js → empty-state-D2uf8sZL.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C73XSXJg.js → extract-connection-data-CXd7xn8D.js} +1 -1
- package/dist/client/assets/features-D5HpJxEl.js +1 -0
- package/dist/client/assets/{file-explorer-DIE7TBnv.js → file-explorer-0O3gnUbG.js} +1 -1
- package/dist/client/assets/{file-type-icon-CXEAWEt3.js → file-type-icon-CM5FDHHb.js} +1 -1
- package/dist/client/assets/{files-Dk2BQIKH.js → files-CbWK6Oem.js} +1 -1
- package/dist/client/assets/{form-CEHwzUIx.js → form-Bom2oLZH.js} +1 -1
- package/dist/client/assets/{general-D0Ux1V9u.js → general-C1lfdTH5.js} +1 -1
- package/dist/client/assets/{generate-id-DwXNdT-H.js → generate-id-Bloedyht.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CFHmzbdo.js → github-repo-picker-BLseIx3l.js} +2 -2
- package/dist/client/assets/{header-tab-button-Be5qNrZz.js → header-tab-button-HHwdKYUp.js} +3 -3
- package/dist/client/assets/{hover-card-CZKyvEKV.js → hover-card-BbAh8d7J.js} +1 -1
- package/dist/client/assets/{image-field-dhimK8za.js → image-field-A74OnXkk.js} +1 -1
- package/dist/client/assets/{index-CnvExC11.js → index-BztCosFc.js} +12 -12
- package/dist/client/assets/{index-OL8Ldzfm.js → index-CRqPsUNG.js} +12 -12
- package/dist/client/assets/{index-C1oz8tZO.js → index-Cwch4eob.js} +1 -1
- package/dist/client/assets/{index-3RJ1532Y.js → index-DFAITwpu.js} +1 -1
- package/dist/client/assets/{index-DJjaDA78.js → index-DKNjAJFI.js} +1 -1
- package/dist/client/assets/{index-BTP7FdvD.js → index-DNtm0JLi.js} +1 -1
- package/dist/client/assets/{index-fhh9LjnW.js → index-DRh6u24v.js} +1 -1
- package/dist/client/assets/{index-5FdhmN0u.js → index-DV3Yfg7N.js} +1 -1
- package/dist/client/assets/{index-D2E_r2Ga.js → index-DdDGbzVq.js} +1 -1
- package/dist/client/assets/{index-CX7SvFBB.js → index-DlenCt7g.js} +1 -1
- package/dist/client/assets/{index-DhlM3QdF.js → index-DoK0XiUD.js} +1 -1
- package/dist/client/assets/{index-qEEk-G84.js → index-DtS-92Oz.js} +1 -1
- package/dist/client/assets/{index-4cje1k2I.js → index-eZWazEyz.js} +4 -4
- package/dist/client/assets/{index-8Av7_XG5.js → index-kq5yUS_7.js} +30 -30
- package/dist/client/assets/{index-redirect-Cw9_x250.js → index-redirect-BE0FdN2x.js} +1 -1
- package/dist/client/assets/{index-B3HtVn_3.js → index-u752Wts1.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BPAoXqhZ.js → infiniteQueryObserver-BMRPwu0B.js} +1 -1
- package/dist/client/assets/{input-CFgdCIf-.js → input-CwrS-iub.js} +1 -1
- package/dist/client/assets/{integration-icon-ByZrCdpe.js → integration-icon-CpXFY6_W.js} +1 -1
- package/dist/client/assets/{label-D5ze4fbW.js → label-CLJ0AedA.js} +1 -1
- package/dist/client/assets/{layout-BuMBlDfo.js → layout-CRFmyheT.js} +1 -1
- package/dist/client/assets/{login-RbDPhsFB.js → login-ZDQxXAlc.js} +1 -1
- package/dist/client/assets/{members-k2G4ARa8.js → members-CETsRg6c.js} +2 -2
- package/dist/client/assets/{monaco-editor-BAqhsJzm.js → monaco-editor-DqjxL8qC.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DSa7vGTC.js → monitoring-stats-row-BtrtxUC2.js} +1 -1
- package/dist/client/assets/{oauth-callback-CbbBKuCW.js → oauth-callback-DKUIBnJx.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BRZTOWnt.js → oauth-callback-ai-provider-CQsd2o0a.js} +1 -1
- package/dist/client/assets/{onboarding-C6E_j9z8.js → onboarding-Dp9u-AR8.js} +1 -1
- package/dist/client/assets/org-install-B0DdE2Cp.js +1 -0
- package/dist/client/assets/{org-layout-UJeeaSgp.js → org-layout-CbZhwhjC.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BKs5_fCy.js → org-plugin-layout-nvcLwDDm.js} +1 -1
- package/dist/client/assets/{page-seo-form-nusKb5Sb.js → page-seo-form-BfAIN8Sl.js} +1 -1
- package/dist/client/assets/page-seo-sheet-1M0ZQCXy.js +1 -0
- package/dist/client/assets/{pair-B10kI-gZ.js → pair-Ddwa7ge4.js} +5 -5
- package/dist/client/assets/{plugin-empty-state-j4CULS57.js → plugin-empty-state-DIWYp1SI.js} +1 -1
- package/dist/client/assets/{plugin-header-DULj-Y49.js → plugin-header-BK3X79ek.js} +1 -1
- package/dist/client/assets/{plugin-layout-BKWVYVIi.js → plugin-layout-G84GIXAW.js} +1 -1
- package/dist/client/assets/{popover-CusBDsw3.js → popover-DsfanlnP.js} +1 -1
- package/dist/client/assets/{post-editor-DEyWVqiE.js → post-editor-HYnj9aMU.js} +1 -1
- package/dist/client/assets/{primitives-K-Cou-34.js → primitives-h_5eGcD7.js} +1 -1
- package/dist/client/assets/{profile-Cbty-wCE.js → profile-C_EEhrOq.js} +1 -1
- package/dist/client/assets/project-app-view-ClBF_FE1.js +1 -0
- package/dist/client/assets/record-editor-D_XxtmM1.js +1 -0
- package/dist/client/assets/registry-DuikH1Le.js +2 -0
- package/dist/client/assets/registry-layout-ClLggzAs.js +27 -0
- package/dist/client/assets/{require-capability-B58b3LsO.js → require-capability-B9yp1djm.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CLPqu2hV.js → required-auth-layout-BsLlfTDJ.js} +1 -1
- package/dist/client/assets/{reset-password-QvfJzQLt.js → reset-password-C2JTjbtA.js} +1 -1
- package/dist/client/assets/{resizable-DtVYiBv-.js → resizable-Bos_97Hr.js} +1 -1
- package/dist/client/assets/{roles-BJzMRSbv.js → roles-CBUmzMVz.js} +1 -1
- package/dist/client/assets/{save-status-CcrdCZvz.js → save-status-BbK1RQSX.js} +1 -1
- package/dist/client/assets/{schema-form-CLs9R9OM.js → schema-form-CUO9haBq.js} +1 -1
- package/dist/client/assets/{scroll-area-GY_MqX9m.js → scroll-area-Cq2TqSe0.js} +1 -1
- package/dist/client/assets/{search-input-CaIL3--R.js → search-input-W-g6XRjC.js} +1 -1
- package/dist/client/assets/{secrets-CEQKXAz2.js → secrets-BDICEFKM.js} +1 -1
- package/dist/client/assets/{sections-editor-3wx6-GfE.js → sections-editor-BaZsoyW0.js} +1 -1
- package/dist/client/assets/select-ci3BSqp5.js +1 -0
- package/dist/client/assets/{select-model-DV1-Oh57.js → select-model-DHOmXmSc.js} +1 -1
- package/dist/client/assets/{seo-editor-CwuvVAjS.js → seo-editor-BbPcLsSR.js} +1 -1
- package/dist/client/assets/{settings-layout-lPzeLZ6G.js → settings-layout-JiHWSow4.js} +1 -1
- package/dist/client/assets/{settings-section-rywQD1H8.js → settings-section-x9o4zXy4.js} +1 -1
- package/dist/client/assets/{sheet-HD1tdtUP.js → sheet-BwdJHIyp.js} +1 -1
- package/dist/client/assets/{shell-controls-CiR1mOgQ.js → shell-controls-Bk1-5JuX.js} +1 -1
- package/dist/client/assets/shell-layout-BSanGTZR.js +1 -0
- package/dist/client/assets/shell-route-loading-Oji4SthS.js +1 -0
- package/dist/client/assets/{sidebar-BTAYcbpn.js → sidebar-CZfP1p-N.js} +1 -1
- package/dist/client/assets/{skeleton-KPs8aExG.js → skeleton-C868IqtJ.js} +1 -1
- package/dist/client/assets/{sortable.esm-k9dnaUc0.js → sortable.esm-D3VtLwMe.js} +1 -1
- package/dist/client/assets/{spinner-CWHpDgnL.js → spinner-DFgihVtE.js} +1 -1
- package/dist/client/assets/{sso-DCJOVjP-.js → sso-Dd4ntKKA.js} +1 -1
- package/dist/client/assets/{store-QHf4NvZa.js → store-WLHJZJYL.js} +1 -1
- package/dist/client/assets/store-registry-Bipqg_S3.js +2 -0
- package/dist/client/assets/{switch-CCjru8jV.js → switch-dV1jxIo5.js} +1 -1
- package/dist/client/assets/{tab-id-Cj2zAp8p.js → tab-id-DQ11sDJ5.js} +1 -1
- package/dist/client/assets/{table-Dpu-CGxg.js → table-CHKmKoKb.js} +1 -1
- package/dist/client/assets/{tabs-Bsb3WneA.js → tabs-CSjv4io2.js} +1 -1
- package/dist/client/assets/{task-status-Bq8PHYFh.js → task-status-CAwvZzfY.js} +1 -1
- package/dist/client/assets/{textarea-Bw4v_xfm.js → textarea-CSfWC_ri.js} +1 -1
- package/dist/client/assets/{toggle-group-a9DpUbSj.js → toggle-group-D1uW02Dw.js} +1 -1
- package/dist/client/assets/{toolbar-BkMHRO8B.js → toolbar-C_QNuxJc.js} +1 -1
- package/dist/client/assets/{tools-list-CmaWZYdl.js → tools-list-DSls0TxE.js} +1 -1
- package/dist/client/assets/{tooltip-B9p8ywB_.js → tooltip-DjBYlSjK.js} +1 -1
- package/dist/client/assets/{types-5S14a687.js → types-I4bGGmPg.js} +19 -19
- package/dist/client/assets/{use-ai-providers-iJF3uFpo.js → use-ai-providers-BdU26Ah1.js} +1 -1
- package/dist/client/assets/{use-automations-BTipFIOi.js → use-automations-DOs6eBSZ.js} +1 -1
- package/dist/client/assets/{use-capability-CeWdChcL.js → use-capability-Dzq6Bisq.js} +1 -1
- package/dist/client/assets/use-collections-VJ2gqsdi.js +1 -0
- package/dist/client/assets/{use-connection-C2Ef-EqP.js → use-connection-CXK4eJ8D.js} +1 -1
- package/dist/client/assets/{use-copy-DPF-R5Zs.js → use-copy-DNF_xTyk.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-7QQxHiI4.js → use-create-virtual-mcp-YcZkU7UR.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Da4caii8.js → use-debounced-autosave-B3zncsM_.js} +1 -1
- package/dist/client/assets/use-delete-connection-BwHdKngt.js +1 -0
- package/dist/client/assets/{use-file-configs-DWgNRokn.js → use-file-configs-DkyMSTLH.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BaBllFvG.js → use-infinite-scroll-HH8GENKX.js} +1 -1
- package/dist/client/assets/{use-list-state-d80zzrG8.js → use-list-state-DTTdz8wm.js} +1 -1
- package/dist/client/assets/use-mcp-prompts-CVpfcaNj.js +1 -0
- package/dist/client/assets/use-mcp-tools-PoAtDkM2.js +1 -0
- package/dist/client/assets/{use-members-D2U599cF.js → use-members-BtoFg3-I.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C3AzTy7G.js → use-navigate-to-agent-C9nwjmya.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BQe59WMu.js → use-org-auth-client-q5-USMbu.js} +1 -1
- package/dist/client/assets/{use-org-sso-BB-vyF4c.js → use-org-sso-zB87Inuk.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DItwUayG.js → use-organization-roles-Bye-MpK5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B6tWOwuA.js → use-organization-settings--vsQI-Ms.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DIBKm4oO.js → use-registry-connections-BYv9Ob-m.js} +1 -1
- package/dist/client/assets/{use-secrets-BhZyR2Dx.js → use-secrets-uqIdLNLc.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Wb6qMNbl.js → use-status-sounds-DrT-Tr09.js} +1 -1
- package/dist/client/assets/{use-view-mode-BwvjqQMY.js → use-view-mode-Cp1ETvgV.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-z0hFit1f.js +1 -0
- package/dist/client/assets/useInfiniteQuery-JptJrV0H.js +1 -0
- package/dist/client/assets/{useRouterState-BLC1S9ll.js → useRouterState-fo-Z74Ek.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Dg59byu5.js +1 -0
- package/dist/client/assets/{user-BHKPSALf.js → user-DIXNb7DL.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BabF7Sx4.js → view-mode-toggle-BaN0GlRl.js} +1 -1
- package/dist/client/assets/{workflow-BQFoQKwV.js → workflow-CE3SA7F3.js} +1 -1
- package/dist/client/assets/workflow-detail-CL1QoJdW.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +425 -415
- package/dist/server/migrate.js +57 -57
- package/dist/server/server.js +288 -278
- package/package.json +1 -1
- package/dist/client/assets/accordion-B1qqQUiM.js +0 -1
- package/dist/client/assets/app-editor-DNNG7_rJ.js +0 -1
- package/dist/client/assets/connection-detail-Db8Rqnlx.js +0 -1
- package/dist/client/assets/connection-form-helpers-Dkeln3L-.js +0 -1
- package/dist/client/assets/constants-DeFtLUND.js +0 -10
- package/dist/client/assets/features-CG5whIKN.js +0 -1
- package/dist/client/assets/org-install-Dj9o_O_M.js +0 -1
- package/dist/client/assets/page-seo-sheet-BpOn67AY.js +0 -1
- package/dist/client/assets/project-app-view-gakpd8ie.js +0 -1
- package/dist/client/assets/record-editor-BJCIZK6H.js +0 -1
- package/dist/client/assets/registry-IJiacnxJ.js +0 -2
- package/dist/client/assets/registry-layout-1N9kmpom.js +0 -27
- package/dist/client/assets/select-Y4AHPww8.js +0 -1
- package/dist/client/assets/shell-layout-D1gXYOI4.js +0 -1
- package/dist/client/assets/shell-route-loading-BMvdQN97.js +0 -1
- package/dist/client/assets/store-registry-O5u8x-zS.js +0 -2
- package/dist/client/assets/use-collections-CMMaRmVG.js +0 -1
- package/dist/client/assets/use-delete-connection-DaFBaRNm.js +0 -1
- package/dist/client/assets/use-mcp-prompts-1dd1yGOH.js +0 -1
- package/dist/client/assets/use-mcp-tools-C8LW1vg1.js +0 -1
- package/dist/client/assets/use-virtual-mcp-C_vD2kKw.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CQ_UxVw9.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-XoWOrVYw.js +0 -1
- package/dist/client/assets/workflow-detail-CUEl0-_h.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as ce,j as t,E as tt,r as X,l as le,q as ke,f as De,d as nt,b as Ae,u as st,p as ot,L as it,G as at,H as ct,B as M,t as ne,F as rt,c as de,o as W,J as lt,I as dt,K as mt}from"./index-8Av7_XG5.js";import{g as ut}from"./generate-id-DwXNdT-H.js";import{C as pt}from"./collection-display-button-LYjUKJyD.js";import{S as ht}from"./search-input-CaIL3--R.js";import{C as xt}from"./collection-tabs-Cl0Sce7d.js";import{u as gt,a as we,g as ft,C as ve}from"./connection-card-Js2GKnMD.js";import{E as jt}from"./empty-state-Ct_D2Lzo.js";import{I as yt}from"./integration-icon-ByZrCdpe.js";import{P as pe}from"./index-5FdhmN0u.js";import{u as Ct,D as vt}from"./use-delete-connection-DaFBaRNm.js";import{u as Ce}from"./use-capability-CeWdChcL.js";import{u as _t}from"./use-infinite-scroll-BaBllFvG.js";import{u as St}from"./use-list-state-d80zzrG8.js";import{g as Te,a as bt,e as Nt}from"./extract-connection-data-C73XSXJg.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as Ee,a as ze,A as Me}from"./alert-dialog-Ci1rMRpl.js";import{C as Fe}from"./checkbox-CDeLVmoz.js";import{D as Ve,a as Be,b as Re,c as Ue,e as He,d as Ke}from"./dialog-BDoa-Aig.js";import{b as kt,a as Dt,c as At,D as wt,d as Tt,e as It,f as Pt}from"./drawer-DBoqm7Ga.js";import{u as Lt}from"./tooltip-B9p8ywB_.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-BuEg85yr.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as be}from"./form-CEHwzUIx.js";import{I as ie}from"./input-CFgdCIf-.js";import{d as Ot,S as $t,a as Et,b as zt,c as re}from"./select-Y4AHPww8.js";import{T as Mt}from"./textarea-Bw4v_xfm.js";import{b as Ge,u as Ft}from"./use-connection-C2Ef-EqP.js";import{u as Vt,S as Bt}from"./constants-DeFtLUND.js";import{a as Rt}from"./use-virtual-mcp-C_vD2kKw.js";import{R as Ut,a4 as Ht,s as Kt,q as Wt}from"./agent-icon-VIqap9Jf.js";import{n as ge}from"./Container-V3OuMECL.js";import{i as Qe}from"./DotsVertical-CYMPhMIv.js";import{s as Je}from"./Eye-DLKlw-42.js";import{s as ye}from"./Star01-DWr_psxV.js";import{s as Ye}from"./Plus-DINfOuqC.js";import{s as Ze}from"./Trash01-m4F91Gbm.js";import{s as et}from"./XClose-s3WJPw3-.js";import{i as he,a as Ne,E as Xt,c as qt,p as Gt,b as Qt,d as Jt}from"./connection-form-helpers-Dkeln3L-.js";import"./collections-DsvWgjkq.js";import"./SwitchHorizontal01-CdSYnpvh.js";import"./Check-D-2DMeXR.js";import"./view-mode-toggle-BabF7Sx4.js";import"./badge-BiVWMQaC.js";import"./SearchMd-Dt4Aj6N4.js";import"./use-registry-connections-DIBKm4oO.js";import"./use-organization-settings-B6tWOwuA.js";import"./useInfiniteQuery-CQ_UxVw9.js";import"./infiniteQueryObserver-BPAoXqhZ.js";import"./card-Bs_ZETWd.js";import"./sidebar-BTAYcbpn.js";import"./LayoutLeft-CAachN7j.js";import"./sheet-HD1tdtUP.js";import"./X-D5DAti-0.js";import"./use-view-mode-BwvjqQMY.js";import"./ChevronRight-C6_Bb1P7.js";import"./label-D5ze4fbW.js";import"./ChevronDown-DUb-OAcF.js";import"./ChevronUp-mT0kmu5O.js";import"./use-collections-CMMaRmVG.js";import"./AlertCircle-Ctbek2zl.js";import"./Tool01-Co9IzxOX.js";import"./RefreshCcw01-DSZXx3HQ.js";import"./XCircle-BjeFLJxj.js";import"./ArrowUpRight-CGlPrRsR.js";import"./ZapSquare-By7Cv3Wp.js";import"./Users03-mgRYViRT.js";import"./CheckCircle-CPLY3iX-.js";import"./ChevronLeft-IUSMXc7n.js";import"./ZoomOut-CIHaUyEl.js";import"./Globe01-BSqLqa8H.js";import"./FilterLines-B2lLGnWS.js";import"./Palette-D1rjO3C7.js";import"./HardDrive-BFG0b6vP.js";import"./Stars02-7S-x4jsE.js";import"./Key01-DeIJhm73.js";import"./LinkExternal01-C7Ulot5I.js";import"./Monitor01-RdLthi4L.js";import"./Sun-C0yimusT.js";import"./Play-CL1Mgiwf.js";import"./Settings02-COHAF-aj.js";import"./Shield01-Ef5O0H91.js";import"./Stars01-CTAt_kJn.js";import"./Upload01-BWuva6Fs.js";import"./User01-BQ6QP8OL.js";import"./Users01-ByzlIQ3F.js";import"./Zap-Z3n8EP6c.js";function Yt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:c}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,b=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==b?(N={title:n.title,icon:n.icon,description:b},e[10]=n.icon,e[11]=n.title,e[12]=b,e[13]=N):N=e[13];let l;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==c||e[18]!==m||e[19]!==u?(l=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&c(C.id):m.has(C.id)||c(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=c,e[18]=m,e[19]=u,e[20]=l):l=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==c||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&c(C.id):m.has(C.id)||c(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=c,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const R=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==R?(F=de("overflow-hidden transition-all duration-150 ease-out",R),e[32]=R,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:en,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Je,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Zt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:l,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=k,e[50]=B):B=e[50],B}function Zt(v){return v.stopPropagation()}function en(v){return v.stopPropagation()}function tn(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:c,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:b}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==h||e[4]!==c||e[5]!==p?(l=n<p?t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",p,")"]}):t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=c,e[5]=p,e[6]=l):l=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Ye,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(M,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==b?(_=t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:b,children:k}),e[15]=b,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==l||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,j,d,_]})}),e[17]=N,e[18]=l,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function nn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[c,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Re,{children:[t.jsx(Ue,{children:"Add to Agent"}),t.jsx(He,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==c?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",c===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(yt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=c,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let b;e[6]!==p?(b=t.jsx(M,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=b):b=e[7];const N=!c;let l;e[8]!==m||e[9]!==p||e[10]!==c?(l=()=>{c&&(m(c),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=c,e[11]=l):l=e[11];let j;e[12]!==N||e[13]!==l?(j=t.jsx(M,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=j):j=e[14];let d;e[15]!==b||e[16]!==j?(d=t.jsxs(Ke,{children:[b,j]}),e[15]=b,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function sn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,c=u!==1?"s":"";let h;e[0]!==u||e[1]!==c?(h=t.jsxs(Ie,{children:["Delete ",u," connection",c,"?"]}),e[0]=u,e[1]=c,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Oe,{children:"Cancel"}),e[8]=b):b=e[8];const N=u!==1?"s":"";let l;e[9]!==u||e[10]!==m||e[11]!==N?(l=t.jsxs($e,{children:[b,t.jsxs(Ee,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=l):l=e[12];let j;e[13]!==x||e[14]!==l?(j=t.jsxs(ze,{children:[x,l]}),e[13]=x,e[14]=l,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function on(v){return v._registryId?.includes("community-registry")===!0}function an(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:c,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[b,N]=X.useState(null);let l,j;e[0]!==m||e[1]!==n?(l=Te(n)??"",j=m.has(l),e[0]=m,e[1]=n,e[2]=l,e[3]=j):(l=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let R;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(R=n.server?.icons?.[0]?.src||bt(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=R):R=e[6];const F=R;let s;if(e[7]!==u||e[8]!==l){let S;e[10]!==l?(S=se=>se.connection_type!=="VIRTUAL"&&se.app_name===l,e[10]=l,e[11]=S):S=e[11],s=u.filter(S),e[7]=u,e[8]=l,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=on(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const S=A[0];S&&h(S);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==b?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),b==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=b,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let H;e[32]!==$||e[33]!==n._sourceIcon?(H=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=H):H=e[34];let q;e[35]!==p||e[36]!==c||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(M,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:c!==null,onClick:S=>{S.stopPropagation(),L()},children:c===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=c,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==H||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[H,q]}),e[41]=H,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let U;e[49]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Oe,{children:"Cancel"}),e[49]=U):U=e[49];let E;e[50]!==C?(E=t.jsxs(ze,{children:[O,t.jsxs($e,{children:[U,t.jsx(Ee,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=E):E=e[51];let r;e[52]!==y||e[53]!==E?(r=t.jsx(Me,{open:y,onOpenChange:x,children:E}),e[52]=y,e[53]=E,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function cn({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:c}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),b=Ft(v),N=Ct(),{granted:l}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,R]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Rt(),w=b.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=ft(w),B=o=>{k(a=>{const z=new Set(a);return z.has(o)?z.delete(o):z.add(o),z})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,H=_t(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(b.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],U=e==="connected"||f?L:[],E=async o=>{if(!(!c||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=Nt(o,c.id,y.user.id,{remoteIndex:0}),z=a.connection_type==="STDIO",T=!!a.connection_url,G=z&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${c.slug}/mcp/${K}`,window.location.origin),Se=await lt({url:_e.href,token:null,orgId:c.id});if(Se.supportsOAuth&&!Se.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await dt({connectionId:K,orgSlug:c.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${c.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:mt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Vt({connectionId:Bt,orgId:c.id,orgSlug:c.slug}),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===c.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},S=async()=>{R(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const z of o)try{(await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:z,force:!0}})).isError||a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let z=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),z++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${z} connection${z!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a||!r)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const z=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!z.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:o,data:{connections:[...a.connections,...T]}}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===c.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...N}),t.jsx(sn,{open:D,onOpenChange:R,count:d.size,onConfirm:S}),t.jsx(nn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(jt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[U.map(o=>{if(o.type==="group")return t.jsx(Yt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,z=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}}),className:de(z&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:z,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}})},children:[t.jsx(Je,{size:16}),"Open"]}),(l||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),l&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Kt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Wt,{size:16}),"Enable"]})),l&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(an,{item:o,canManage:l,allConnections:b,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}}),onConnect:E},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(tn,{count:d.size,total:w.length,canManage:l,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>R(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function rn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=Lt(),{granted:c}=Ce("connections:manage"),h=St({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[b,N]=X.useState("ALL"),[l,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=gt(),R=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:R}),L=c&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,U=null,E=null;i.ui_type==="NPX"?(f="STDIO",O="",E=Qt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",E=Jt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",U=i.connection_token||null);const r=ut("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:U,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},H=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,U=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,r=S=>{if(S&&(!O&&!s.getValues("title").trim()&&S.title&&s.setValue("title",S.title,{shouldDirty:!1}),!U&&!(s.getValues("description")??"").trim()&&S.description&&s.setValue("description",S.description,{shouldDirty:!1}),!E&&S.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=S.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=Gt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const S=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",S,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:S,connectionUrl:f})??Ne({uiType:S,connectionUrl:f,registryItems:R}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=c?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(M,{variant:"outline",onClick:B,children:[t.jsx(Ye,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",U=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Ot,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx($t,{children:t.jsx(Et,{})})}),t.jsxs(zt,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const S=I.clipboardData.getData("text");S&&(I.preventDefault(),s.setValue("npx_package",S.trim(),{shouldDirty:!0}),H(S))},onBlur:I=>{H(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Xt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const S=I.clipboardData.getData("text");S&&(I.preventDefault(),s.setValue("connection_url",S.trim(),{shouldDirty:!0}),H(S))},onBlur:I=>{H(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(Mt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),E=L;return m?t.jsx(kt,{open:E,onOpenChange:Q,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:i}),t.jsx(Tt,{className:"mt-1",children:f})]}),t.jsx(It,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(be,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:U}),t.jsx(Pt,{children:t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:E,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Re,{children:[t.jsx(Ue,{children:i}),t.jsx(He,{children:f})]}),t.jsx(be,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:U}),t.jsxs(Ke,{children:[t.jsx(M,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ht,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(pt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:b,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(xt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(cn,{listState:h,activeTab:y,typeFilter:b,statusFilter:l,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Bs(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),v[0]=e):e=v[0],e}export{Bs as default};
|
|
1
|
+
import{e as ce,j as t,E as tt,r as X,l as le,q as ke,f as De,d as nt,b as Ae,u as st,p as ot,L as it,H as at,I as ct,B as z,t as ne,G as rt,c as de,o as W,M as lt,J as dt,K as mt}from"./index-kq5yUS_7.js";import{g as ut}from"./generate-id-Bloedyht.js";import{C as pt}from"./collection-display-button-BHU3gVjd.js";import{S as ht}from"./search-input-W-g6XRjC.js";import{C as xt}from"./collection-tabs-BL5EWXFo.js";import{u as gt,a as we,g as ft,C as ve}from"./connection-card-CdjjPmMy.js";import{E as jt}from"./empty-state-ClDtXUcE.js";import{I as yt}from"./integration-icon-CpXFY6_W.js";import{P as pe}from"./index-DV3Yfg7N.js";import{u as Ct,D as vt}from"./use-delete-connection-BwHdKngt.js";import{u as Ce}from"./use-capability-Dzq6Bisq.js";import{u as _t}from"./use-infinite-scroll-HH8GENKX.js";import{u as St}from"./use-list-state-DTTdz8wm.js";import{g as Te,a as bt,e as Nt}from"./extract-connection-data-CXd7xn8D.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as Ee,a as Me,A as ze}from"./alert-dialog-CfIqXXf0.js";import{C as Fe}from"./checkbox-D5ZsgUiL.js";import{D as Ve,a as Be,b as Re,c as Ue,e as He,d as Ke}from"./dialog-DAZt_PYz.js";import{b as kt,a as Dt,c as At,D as wt,d as Tt,e as It,f as Pt}from"./drawer-DgVqJYUv.js";import{u as Lt}from"./tooltip-DjBYlSjK.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-D8Jq0EXH.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as be}from"./form-Bom2oLZH.js";import{I as ie}from"./input-CwrS-iub.js";import{d as Ot,S as $t,a as Et,b as Mt,c as re}from"./select-ci3BSqp5.js";import{T as zt}from"./textarea-CSfWC_ri.js";import{b as Ge,u as Ft}from"./use-connection-CXK4eJ8D.js";import{u as Vt,S as Bt}from"./constants-_NfKPeA7.js";import{a as Rt}from"./use-virtual-mcp-z0hFit1f.js";import{R as Ut,a4 as Ht,s as Kt,q as Wt}from"./agent-icon-BGlV6q8v.js";import{n as ge}from"./Container-DhunwrH9.js";import{i as Qe}from"./DotsVertical-Drb9z9hu.js";import{s as Je}from"./Eye-cKsI4OxT.js";import{s as ye}from"./Star01-DSZcWlXz.js";import{s as Ye}from"./Plus-DhX2w18y.js";import{s as Ze}from"./Trash01-CicwXof9.js";import{s as et}from"./XClose-BJgeWVDy.js";import{i as he,a as Ne,E as Xt,c as qt,p as Gt,b as Qt,d as Jt}from"./connection-form-helpers-x6Qv_JQD.js";import"./collections-CjrPw-fH.js";import"./SwitchHorizontal01-Dh0Hb3Cs.js";import"./Check-c_jJpxb1.js";import"./view-mode-toggle-BaN0GlRl.js";import"./badge-BIbhtFGp.js";import"./SearchMd-DrKxcX2-.js";import"./use-registry-connections-BYv9Ob-m.js";import"./use-organization-settings--vsQI-Ms.js";import"./useInfiniteQuery-JptJrV0H.js";import"./infiniteQueryObserver-BMRPwu0B.js";import"./card-clJ4_TXy.js";import"./sidebar-CZfP1p-N.js";import"./LayoutLeft-CpIWBcma.js";import"./sheet-BwdJHIyp.js";import"./X-BZgcfyxc.js";import"./use-view-mode-Cp1ETvgV.js";import"./ChevronRight-DLrAfqVe.js";import"./label-CLJ0AedA.js";import"./ChevronDown-BD_mAbO2.js";import"./ChevronUp-CSbcB5D_.js";import"./use-collections-VJ2gqsdi.js";import"./AlertCircle-l0Fpo8hU.js";import"./Tool01-C6w2kT2d.js";import"./RefreshCcw01-COCceFoS.js";import"./XCircle-DZXIRf5B.js";import"./ArrowUpRight-nFWH1Ez9.js";import"./ZapSquare-DHYwZGs3.js";import"./Users03-BQUStXwY.js";import"./CheckCircle-38u06F5f.js";import"./ChevronLeft-CpIXC6Gs.js";import"./ZoomOut-DUCp8Gob.js";import"./Globe01-BqxI6QZP.js";import"./FilterLines-BiHh13xm.js";import"./Palette-B-k8xsYD.js";import"./HardDrive-BwbAMrUb.js";import"./Stars02-BZvUEwJW.js";import"./Key01-qQx1LV2o.js";import"./LinkExternal01-CXoDDgz6.js";import"./Monitor01-DdJ7wtCm.js";import"./Sun-Bc4Ui5gi.js";import"./Play-CjnZZCXU.js";import"./Settings02-YFMXLzh7.js";import"./Shield01-C0lG89zR.js";import"./Stars01-CJvAL1Fd.js";import"./Upload01-Cjsy_A0C.js";import"./User01-C-Fxjmsz.js";import"./Users01-Bcdl2fo8.js";import"./Zap-DHRMF6hr.js";function Yt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:c}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,b=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==b?(N={title:n.title,icon:n.icon,description:b},e[10]=n.icon,e[11]=n.title,e[12]=b,e[13]=N):N=e[13];let l;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==c||e[18]!==m||e[19]!==u?(l=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&c(C.id):m.has(C.id)||c(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=c,e[18]=m,e[19]=u,e[20]=l):l=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==c||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&c(C.id):m.has(C.id)||c(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=c,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const R=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==R?(F=de("overflow-hidden transition-all duration-150 ease-out",R),e[32]=R,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:en,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Je,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Zt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:l,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=k,e[50]=B):B=e[50],B}function Zt(v){return v.stopPropagation()}function en(v){return v.stopPropagation()}function tn(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:c,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:b}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==h||e[4]!==c||e[5]!==p?(l=n<p?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:["Select all (",p,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=c,e[5]=p,e[6]=l):l=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Ye,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==b?(_=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:b,children:k}),e[15]=b,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==l||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,j,d,_]})}),e[17]=N,e[18]=l,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function nn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[c,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Re,{children:[t.jsx(Ue,{children:"Add to Agent"}),t.jsx(He,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==c?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",c===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(yt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=c,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let b;e[6]!==p?(b=t.jsx(z,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=b):b=e[7];const N=!c;let l;e[8]!==m||e[9]!==p||e[10]!==c?(l=()=>{c&&(m(c),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=c,e[11]=l):l=e[11];let j;e[12]!==N||e[13]!==l?(j=t.jsx(z,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=j):j=e[14];let d;e[15]!==b||e[16]!==j?(d=t.jsxs(Ke,{children:[b,j]}),e[15]=b,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function sn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,c=u!==1?"s":"";let h;e[0]!==u||e[1]!==c?(h=t.jsxs(Ie,{children:["Delete ",u," connection",c,"?"]}),e[0]=u,e[1]=c,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Oe,{children:"Cancel"}),e[8]=b):b=e[8];const N=u!==1?"s":"";let l;e[9]!==u||e[10]!==m||e[11]!==N?(l=t.jsxs($e,{children:[b,t.jsxs(Ee,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=l):l=e[12];let j;e[13]!==x||e[14]!==l?(j=t.jsxs(Me,{children:[x,l]}),e[13]=x,e[14]=l,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(ze,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function on(v){return v._registryId?.includes("community-registry")===!0}function an(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:c,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[b,N]=X.useState(null);let l,j;e[0]!==m||e[1]!==n?(l=Te(n)??"",j=m.has(l),e[0]=m,e[1]=n,e[2]=l,e[3]=j):(l=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let R;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(R=n.server?.icons?.[0]?.src||bt(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=R):R=e[6];const F=R;let s;if(e[7]!==u||e[8]!==l){let S;e[10]!==l?(S=se=>se.connection_type!=="VIRTUAL"&&se.app_name===l,e[10]=l,e[11]=S):S=e[11],s=u.filter(S),e[7]=u,e[8]=l,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=on(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const S=A[0];S&&h(S);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==b?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),b==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=b,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let H;e[32]!==$||e[33]!==n._sourceIcon?(H=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=H):H=e[34];let q;e[35]!==p||e[36]!==c||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:c!==null,onClick:S=>{S.stopPropagation(),L()},children:c===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=c,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==H||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[H,q]}),e[41]=H,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let U;e[49]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Oe,{children:"Cancel"}),e[49]=U):U=e[49];let E;e[50]!==C?(E=t.jsxs(Me,{children:[O,t.jsxs($e,{children:[U,t.jsx(Ee,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=E):E=e[51];let r;e[52]!==y||e[53]!==E?(r=t.jsx(ze,{open:y,onOpenChange:x,children:E}),e[52]=y,e[53]=E,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function cn({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:c}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),b=Ft(v),N=Ct(),{granted:l}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,R]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Rt(),w=b.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=ft(w),B=o=>{k(a=>{const M=new Set(a);return M.has(o)?M.delete(o):M.add(o),M})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,H=_t(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(b.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],U=e==="connected"||f?L:[],E=async o=>{if(!(!c||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=Nt(o,c.id,y.user.id,{remoteIndex:0}),M=a.connection_type==="STDIO",T=!!a.connection_url,G=M&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${c.slug}/mcp/${K}`,window.location.origin),Se=await lt({url:_e.href,token:null,orgId:c.id});if(Se.supportsOAuth&&!Se.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await dt({connectionId:K,orgSlug:c.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${c.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:mt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Vt({connectionId:Bt,orgId:c.id,orgSlug:c.slug}),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===c.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},S=async()=>{R(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const M of o)try{(await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}})).isError||a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let M=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),M++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${M} connection${M!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a||!r)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const M=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!M.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:o,data:{connections:[...a.connections,...T]}}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===c.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...N}),t.jsx(sn,{open:D,onOpenChange:R,count:d.size,onConfirm:S}),t.jsx(nn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(jt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[U.map(o=>{if(o.type==="group")return t.jsx(Yt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,M=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}}),className:de(M&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:M,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}})},children:[t.jsx(Je,{size:16}),"Open"]}),(l||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),l&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Kt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Wt,{size:16}),"Enable"]})),l&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(an,{item:o,canManage:l,allConnections:b,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:xe(a)}}),onConnect:E},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(tn,{count:d.size,total:w.length,canManage:l,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>R(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function rn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=Lt(),{granted:c}=Ce("connections:manage"),h=St({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[b,N]=X.useState("ALL"),[l,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=gt(),R=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:R}),L=c&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,U=null,E=null;i.ui_type==="NPX"?(f="STDIO",O="",E=Qt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",E=Jt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",U=i.connection_token||null);const r=ut("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:U,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},H=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,U=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,r=S=>{if(S&&(!O&&!s.getValues("title").trim()&&S.title&&s.setValue("title",S.title,{shouldDirty:!1}),!U&&!(s.getValues("description")??"").trim()&&S.description&&s.setValue("description",S.description,{shouldDirty:!1}),!E&&S.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=S.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=Gt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const S=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",S,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:S,connectionUrl:f})??Ne({uiType:S,connectionUrl:f,registryItems:R}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=c?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(z,{variant:"outline",onClick:B,children:[t.jsx(Ye,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",U=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Ot,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx($t,{children:t.jsx(Et,{})})}),t.jsxs(Mt,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const S=I.clipboardData.getData("text");S&&(I.preventDefault(),s.setValue("npx_package",S.trim(),{shouldDirty:!0}),H(S))},onBlur:I=>{H(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Xt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const S=I.clipboardData.getData("text");S&&(I.preventDefault(),s.setValue("connection_url",S.trim(),{shouldDirty:!0}),H(S))},onBlur:I=>{H(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(zt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),E=L;return m?t.jsx(kt,{open:E,onOpenChange:Q,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:i}),t.jsx(Tt,{className:"mt-1",children:f})]}),t.jsx(It,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(be,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:U}),t.jsx(Pt,{children:t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:E,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Re,{children:[t.jsx(Ue,{children:i}),t.jsx(He,{children:f})]}),t.jsx(be,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:U}),t.jsxs(Ke,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ht,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(pt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:b,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(xt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(cn,{listState:h,activeTab:y,typeFilter:b,statusFilter:l,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Bs(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),v[0]=e):e=v[0],e}export{Bs as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{cF as ce,cG as le,cH as ue,c2 as de,cI as he,bH as p,bI as w,cJ as fe,cK as pe,cL as me,cM as M,cN as _e,cO as F,cP as ge,cQ as q,cR as we,cS as U,cT as Te,cU as ye,cV as ke,cW as W,bC as ve,cX as Se,cY as Ce,bZ as X,ca as be,cg as Re,ce as Ie,cZ as Ee,c_ as qe,c$ as Pe,d0 as $,d1 as Ae,d2 as Me,cf as $e,cb as He,cc as Oe,cd as Ne,c9 as xe,d3 as De,d4 as Fe,d5 as Ue,c4 as Le,d6 as je,d7 as Ve,d8 as P,d9 as H,da as z,db as We,ch as x,e as ee,s as te,aO as j}from"./index-kq5yUS_7.js";function N(o){return!!o._zod}function b(o,e){return N(o)?ce(o,e):o.safeParse(e)}function se(o){if(!o)return;let e;if(N(o)?e=o._zod?.def?.shape:e=o.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function ze(o){if(N(o)){const a=o._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const t=o._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=o.value;if(s!==void 0)return s}function R(o){return o==="completed"||o==="failed"||o==="cancelled"}function Q(o){const t=se(o)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=ze(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function G(o,e){const t=b(o,e);if(!t.success)throw t.error;return t.data}const Qe=6e4;class Ge{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const a=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(a,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,m=new p(h.error.code,h.error.message,h.error.data);l(m)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(a,s.sessionId);if(!n)throw new p(w.InvalidParams,`Task not found: ${a}`);if(!R(n.status))return await this._waitForTaskUpdate(a,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(a,s.sessionId);return this._clearTaskQueue(a),{...i,_meta:{...i._meta,[q]:{taskId:a}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:a}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:a,_meta:{}}}catch(r){throw new p(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new p(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new p(w.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const a=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!a)throw new p(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...a}}catch(r){throw r instanceof p?r:new p(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:a,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),p.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=a=>{s?.(a),this._onerror(a)};const r=this._transport?.onmessage;this._transport.onmessage=(a,n)=>{r?.(a,n),M(a)||_e(a)?this._onresponse(a):F(a)?this._onrequest(a,n):ge(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=p.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,a=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=we(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};a&&(h.relatedTask={taskId:a}),await this.notification(l,h)},sendRequest:async(l,h,m)=>{if(n.signal.aborted)throw new p(w.ConnectionClosed,"Request was cancelled");const g={...m,relatedRequestId:e.id};a&&!g.relatedTask&&(g.relatedTask={taskId:a});const y=g.relatedTask?.taskId??a;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:a,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,f)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),a=this._progressHandlers.get(r);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}a(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new p(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let a=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(a=!0,this._taskProgressTokens.set(i.taskId,t))}}if(a||this._progressHandlers.delete(t),M(e))r(e);else{const n=p.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}return}let a;try{const n=await this.request(e,U,s);if(n.task)a=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new p(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:a},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},t,s)}:i.status==="failed"?yield{type:"error",error:new p(w.InternalError,`Task ${a} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new p(w.InternalError,`Task ${a} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:a,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((f,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};s?.onprogress&&(this._progressHandlers.set(m,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(c)}},{relatedRequestId:r,resumptionToken:a,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof p?c:new p(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(m,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Qe,k=()=>y(p.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(m,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(m);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(m),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:a,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(m),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=Q(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,a)=>{const n=G(e,r);return Promise.resolve(t(n,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=Q(e);this._notificationHandlers.set(s,r=>{const a=G(e,r);return Promise.resolve(t(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const a=r.message.id,n=this._requestResolvers.get(a);n?(n(new p(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,a)=>{if(t.aborted){a(new p(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),a(new p(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const a=await s.getTask(r,t);if(!a)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(r,a,n)=>{await s.storeTaskResult(r,a,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,a,n)=>{const i=await s.getTask(r,t);if(!i)throw new p(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new p(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,a,n,t);const u=await s.getTask(r,t);if(u){const f=W.parse({method:"notifications/tasks/status",params:u});await this.notification(f),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function K(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function Ke(o,e){const t={...o};for(const s in e){const r=s,a=e[r];if(a===void 0)continue;const n=t[r];K(n)&&K(a)?t[r]={...n,...a}:t[r]=a}return t}var Je=Se();const Ze=ve(Je);function Ye(){const o=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(o),o}class Be{constructor(e){this._ajv=e??Ye()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class Xe{constructor(e){this._client=e}async*callToolStream(e,t=X,s){const r=this._client,a={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,a),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof p){yield{type:"error",error:l};return}yield{type:"error",error:new p(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function et(o,e,t){if(!o)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!o.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function tt(o,e,t){if(!o)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!o.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!o.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(o,e){if(!(!o||e===null||typeof e!="object")){if(o.type==="object"&&o.properties&&typeof o.properties=="object"){const t=e,s=o.properties;for(const r of Object.keys(s)){const a=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(t[r]=a.default),t[r]!==void 0&&O(a,t[r])}}if(Array.isArray(o.anyOf))for(const t of o.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(o.oneOf))for(const t of o.oneOf)typeof t!="boolean"&&O(t,e)}}function st(o){if(!o)return{supportsFormMode:!1,supportsUrlMode:!1};const e=o.form!==void 0,t=o.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let rt=class extends Ge{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Be,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Xe(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const r=se(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let a;if(N(r)){const i=r;a=i._zod?.def?.value??i.value}else{const i=r;a=i._def?.value??i.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");const n=a;if(n==="elicitation/create"){const i=async(u,f)=>{const l=b(Fe,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:m,supportsUrlMode:g}=st(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new p(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new p(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,f));if(h.task){const c=b(U,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new p(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Ue,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,f)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,m=await Promise.resolve(t(u,f));if(h.task){const k=b(U,m);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new p(w.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?je:Ve,T=b(y,m);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){et(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&tt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},$,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},$,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},$e,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},$,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},$,t)}async callTool(e,t=X,s){if(this.isToolTaskRequired(e.name))throw new p(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),a=this.getToolOutputValidator(e.name);if(a){if(!r.structuredContent&&!r.isError)throw new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=a(r.structuredContent);if(!n.valid)throw new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof p?n:new p(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},xe,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const a=De.safeParse(s);if(!a.success)throw new Error(`Invalid ${e} listChanged options: ${a.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=a.data,{onChanged:u}=s,f=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const m=h instanceof Error?h:new Error(String(h));u(m,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const m=setTimeout(f,i);this._listChangedDebounceTimers.set(e,m)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function L(o){return o?o instanceof Headers?Object.fromEntries(o.entries()):Array.isArray(o)?Object.fromEntries(o):{...o}:{}}function at(o=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return o(t,r)}:o}class J extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,ot=13,I=32;function D(o){}function nt(o){if(typeof o=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=D,onError:t=D,onRetry:s=D,onComment:r}=o,a=[];let n=!0,i,u="",f=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),a.length===0){const v=m(d);v!==""&&a.push(v);return}if(d.indexOf(`
|
|
2
|
+
`)===-1&&d.indexOf("\r")===-1){a.push(d);return}a.push(d);const c=a.join("");a.length=0;const _=m(c);_!==""&&a.push(_)}function m(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
|
|
3
|
+
`,c);for(;_!==-1;){if(c===_){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0,c=_+1,_=d.indexOf(`
|
|
4
|
+
`,c);continue}const v=d.charCodeAt(c);if(Y(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(f===0&&d.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
|
|
5
|
+
`,c);continue}u=f===0?C:`${u}
|
|
6
|
+
${C}`,f++}else B(d,c,v)?l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0:g(d,c,_);c=_+1,_=d.indexOf(`
|
|
7
|
+
`,c)}return d.slice(c)}for(;c<d.length;){const _=d.indexOf("\r",c),v=d.indexOf(`
|
|
8
|
+
`,c);let S=-1;if(_!==-1&&v!==-1?S=_<v?_:v:_!==-1?_===d.length-1?S=-1:S=_:v!==-1&&(S=v),S===-1)break;g(d,c,S),c=S+1,d.charCodeAt(c-1)===ot&&d.charCodeAt(c)===Z&&c++}return d.slice(c)}function g(d,c,_){if(c===_){T();return}const v=d.charCodeAt(c);if(Y(d,c,v)){const E=d.charCodeAt(c+5)===I?c+6:c+5,V=d.slice(E,_);u=f===0?V:`${u}
|
|
9
|
+
${V}`,f++;return}if(B(d,c,v)){l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0;return}if(v===105&&d.charCodeAt(c+1)===100&&d.charCodeAt(c+2)===58){const E=d.slice(d.charCodeAt(c+3)===I?c+4:c+3,_);i=E.includes("\0")?void 0:E;return}if(v===58){if(r){const E=d.slice(c,_);r(E.slice(d.charCodeAt(c+1)===I?2:1))}return}const S=d.slice(c,_),C=S.indexOf(":");if(C===-1){y(S,"",S);return}const oe=S.slice(0,C),ne=S.charCodeAt(C+1)===I?2:1,ie=S.slice(C+ne);y(oe,ie,S)}function y(d,c,_){switch(d){case"event":l=c||void 0;break;case"data":u=f===0?c:`${u}
|
|
10
|
+
${c}`,f++;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?s(parseInt(c,10)):t(new J(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:_}));break;default:t(new J(`Unknown field "${d.length>20?`${d.slice(0,20)}…`:d}"`,{type:"unknown-field",field:d,value:c,line:_}));break}}function T(){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0}function k(d={}){if(d.consume&&a.length>0){const c=a.join("");g(c,0,c.length)}n=!0,i=void 0,u="",f=0,l=void 0,a.length=0}return{feed:h,reset:k}}function Y(o,e,t){return t===100&&o.charCodeAt(e+1)===97&&o.charCodeAt(e+2)===116&&o.charCodeAt(e+3)===97&&o.charCodeAt(e+4)===58}function B(o,e,t){return t===101&&o.charCodeAt(e+1)===118&&o.charCodeAt(e+2)===101&&o.charCodeAt(e+3)===110&&o.charCodeAt(e+4)===116&&o.charCodeAt(e+5)===58}class it extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(a){r=nt({onEvent:n=>{a.enqueue(n)},onError(n){e==="terminate"?a.error(n):typeof e=="function"&&e(n)},onRetry:t,onComment:s})},transform(a){r.feed(a)}})}}const ct={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class A extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let lt=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=at(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??ct}async _authThenStart(){if(!this._authProvider)throw new P("No auth provider");let e;try{e=await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new P;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=L(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),t&&s.set("last-event-id",t);const r=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new A(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(s){throw this.onerror?.(s),s}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(s,e),r)}_scheduleReconnection(e,t=0){const s=this._reconnectionOptions.maxRetries;if(t>=s){this.onerror?.(new Error(`Maximum reconnection attempts (${s}) exceeded.`));return}const r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(a=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${a instanceof Error?a.message:String(a)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,s){if(!e)return;const{onresumptiontoken:r,replayMessageId:a}=t;let n,i=!1,u=!1;(async()=>{try{const l=e.pipeThrough(new TextDecoderStream).pipeThrough(new it({onRetry:g=>{this._serverRetryMs=g}})).getReader();for(;;){const{value:g,done:y}=await l.read();if(y)break;if(g.id&&(n=g.id,i=!0,r?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{const T=x.parse(JSON.parse(g.data));M(T)&&(u=!0,a!==void 0&&(T.id=a)),this.onmessage?.(T)}catch(T){this.onerror?.(T)}}(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:a},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:a},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new P("No auth provider");if(await H(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:s,onresumptiontoken:r}=t||{};if(s){this._startOrAuthSse({resumptionToken:s,replayMessageId:F(e)?e.id:void 0}).catch(m=>this.onerror?.(m));return}const a=await this._commonHeaders();a.set("content-type","application/json"),a.set("accept","application/json, text/event-stream");const n={...this._requestInit,method:"POST",headers:a,body:JSON.stringify(e),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,n),u=i.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!i.ok){const m=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new A(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:g,scope:y}=z(i);if(this._resourceMetadataUrl=g,this._scope=y,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P;return this._hasCompletedAuthFlow=!0,this.send(e)}if(i.status===403&&this._authProvider){const{resourceMetadataUrl:g,scope:y,error:T}=z(i);if(T==="insufficient_scope"){const k=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===k)throw new A(403,"Server returned 403 after trying upscoping");if(y&&(this._scope=y),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=k??void 0,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new P;return this.send(e)}}throw new A(i.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,i.status===202){await i.body?.cancel(),We(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>this.onerror?.(m));return}const l=(Array.isArray(e)?e:[e]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,h=i.headers.get("content-type");if(l)if(h?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(h?.includes("application/json")){const m=await i.json(),g=Array.isArray(m)?m.map(y=>x.parse(y)):[x.parse(m)];for(const y of g)this.onmessage?.(y)}else throw await i.body?.cancel(),new A(-1,`Unexpected content type: ${h}`);else await i.body?.cancel()}catch(s){throw this.onerror?.(s),s}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,t);if(await s.body?.cancel(),!s.ok&&s.status!==405)throw new A(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};class ut extends lt{constructor(e,t){super(e,t)}send(e,t){const s=dt(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function dt(o){const e=o;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const ht={name:"mesh-sdk",version:"1.0.0"};function ft(o,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either meshUrl option or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,a=o?`${r}/mcp/${o}`:`${r}/mcp`;return new URL(a,s).href}async function re({connectionId:o,orgId:e,orgSlug:t,token:s,meshUrl:r}){const a=ft(o,t,r),n=new rt(ht,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),i=new ut(new URL(a),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});await n.connect(i);const u=j.mcpClient(e,o??"self",s??"",r??"");return n.toJSON=()=>`mcp-client:${u.join(":")}`,n}function yt(o){const e=ee.c(14),{connectionId:t,orgId:s,orgSlug:r,token:a,meshUrl:n}=o;let i;e[0]!==t||e[1]!==n||e[2]!==s||e[3]!==a?(i=j.mcpClient(s,t??"self",a??"",n??""),e[0]=t,e[1]=n,e[2]=s,e[3]=a,e[4]=i):i=e[4];const u=i;let f;e[5]!==t||e[6]!==n||e[7]!==s||e[8]!==r||e[9]!==a?(f=()=>re({connectionId:t,orgId:s,orgSlug:r,token:a,meshUrl:n}),e[5]=t,e[6]=n,e[7]=s,e[8]=r,e[9]=a,e[10]=f):f=e[10];let l;e[11]!==u||e[12]!==f?(l={queryKey:u,queryFn:f,staleTime:1/0,gcTime:6e4},e[11]=u,e[12]=f,e[13]=l):l=e[13];const{data:h}=te(l);return h}function kt(o){const e=ee.c(14),{connectionId:t,orgId:s,orgSlug:r,token:a,meshUrl:n}=o;let i;e[0]!==t||e[1]!==n||e[2]!==s||e[3]!==a?(i=t!==void 0?j.mcpClient(s,t??"self",a??"",n??""):["mcp","client","skip",s],e[0]=t,e[1]=n,e[2]=s,e[3]=a,e[4]=i):i=e[4];const u=i;let f;e[5]!==t||e[6]!==n||e[7]!==s||e[8]!==r||e[9]!==a?(f=async()=>t===void 0?null:re({connectionId:t,orgId:s,orgSlug:r,token:a,meshUrl:n}),e[5]=t,e[6]=n,e[7]=s,e[8]=r,e[9]=a,e[10]=f):f=e[10];let l;e[11]!==u||e[12]!==f?(l={queryKey:u,queryFn:f,staleTime:1/0,gcTime:6e4},e[11]=u,e[12]=f,e[13]=l):l=e[13];const{data:h}=te(l);return h??null}const vt={SELF:o=>`${o}_self`,REGISTRY:o=>`${o}_registry`,COMMUNITY_REGISTRY:o=>`${o}_community-registry`,DEV_ASSETS:o=>`${o}_dev-assets`,SITE_DIAGNOSTICS:o=>`site-diagnostics_${o}`},St="self";function pt(o){return{is(e){return!e||!e.startsWith(o)?null:e.slice(o.length)||null},get(e){return`${o}${e}`}}}function mt(o){return{id:o.id,organization_id:o.organizationId,title:o.title,description:o.description,icon:o.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:o.instructions??null},pinned:!1,connections:[]}}const ae=pt("decopilot_"),Ct=ae.is,_t=ae.get;function bt(o){return mt({id:_t(o),organizationId:o,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"})}const Rt={AGENT_MANAGER:o=>`studio-agent-manager_${o}`,AUTOMATION_MANAGER:o=>`studio-automation-manager_${o}`,CONNECTION_MANAGER:o=>`studio-connection-manager_${o}`,STORE_MANAGER:o=>`studio-store-manager_${o}`,BRAND_MANAGER:o=>`studio-brand-manager_${o}`,USAGE_MANAGER:o=>`studio-usage-manager_${o}`};function It(o){return o?o.startsWith("studio-agent-manager_")||o.startsWith("studio-automation-manager_")||o.startsWith("studio-connection-manager_")||o.startsWith("studio-store-manager_")||o.startsWith("studio-brand-manager_")||o.startsWith("studio-usage-manager_"):!1}export{Ze as A,rt as C,Ge as P,St as S,vt as W,Rt as a,It as b,re as c,nt as d,at as e,lt as f,bt as g,_t as h,Ct as i,kt as j,L as n,yt as u};
|
package/dist/client/assets/{decopilot-sse-pool-xYuzxJCG.js → decopilot-sse-pool-uVjHemnd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-kq5yUS_7.js";import{c as s}from"./create-sse-subscription-BS5983N4.js";const c={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},t=Object.values(c),n=s({buildUrl:o=>{const e=t.join(",");return`/api/${encodeURIComponent(o)}/watch?types=${e}`},eventTypes:[...t]});export{c as D,n as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,j as i,
|
|
1
|
+
import{e as n,j as i,cx as u,c,bE as m,dc as x,dd as j,cy as N,cz as b,de as g,df as D}from"./index-kq5yUS_7.js";import{i as h}from"./X-BZgcfyxc.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{_ as D,T as a,E as b,B as c,R as d,O as e,w as f,v as g,y as h,k as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as B,q as U,b as $,
|
|
1
|
+
import{e as B,q as U,b as $,G as Y,K as J,n as H,a as G,j as s,B as L,t as p,o as A}from"./index-kq5yUS_7.js";import{u as M}from"./unwrap-tool-result-BYXdCQMg.js";import{S as V,u as W}from"./constants-_NfKPeA7.js";import{S as X}from"./switch-dV1jxIo5.js";import{S as ii,a as k,b as P}from"./settings-section-x9o4zXy4.js";function si(){const i=B.c(62),{org:t}=U(),{data:K}=$.useSession(),R=Y();let z;i[0]!==t.id||i[1]!==t.slug?(z={connectionId:V,orgId:t.id,orgSlug:t.slug},i[0]=t.id,i[1]=t.slug,i[2]=z):z=i[2];const a=W(z);let r;i[3]!==t.id?(r=J.organizationDomain(t.id),i[3]=t.id,i[4]=r):r=i[4];let d;i[5]!==a?(d=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return M(e)},i[5]=a,i[6]=d):d=i[6];let h;i[7]!==r||i[8]!==d?(h={queryKey:r,queryFn:d},i[7]=r,i[8]=d,i[9]=h):h=i[9];const{data:q,isPending:Z}=H(h),b=K?.user?.email??"";let I;i[10]!==b?(I=b.split("@")[1]?.toLowerCase()??"",i[10]=b,i[11]=I):I=i[11];const o=I,n=q?.domain??null,F=q?.autoJoinEnabled??!1,v=o&&o!==n;let x;i[12]!==t.id||i[13]!==R?(x=()=>R.invalidateQueries({queryKey:J.organizationDomain(t.id)}),i[12]=t.id,i[13]=R,i[14]=x):x=i[14];const l=x;let c;i[15]!==a||i[16]!==o?(c=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:o,autoJoinEnabled:!1}});return M(e)},i[15]=a,i[16]=o,i[17]=c):c=i[17];let m;i[18]!==l||i[19]!==t.id||i[20]!==o?(m=()=>{p("organization_domain_claimed",{organization_id:t.id,email_domain:o}),l(),A.success("Domain claimed")},i[18]=l,i[19]=t.id,i[20]=o,i[21]=m):m=i[21];let u;i[22]!==t.id||i[23]!==o?(u=e=>{p("organization_domain_claim_failed",{organization_id:t.id,email_domain:o,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to claim domain")},i[22]=t.id,i[23]=o,i[24]=u):u=i[24];let D;i[25]!==c||i[26]!==m||i[27]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[25]=c,i[26]=m,i[27]=u,i[28]=D):D=i[28];const C=G(D);let g;i[29]!==a?(g=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return M(e)},i[29]=a,i[30]=g):g=i[30];let f;i[31]!==n||i[32]!==l||i[33]!==t.id?(f=()=>{p("organization_domain_cleared",{organization_id:t.id,email_domain:n}),l(),A.success("Domain removed")},i[31]=n,i[32]=l,i[33]=t.id,i[34]=f):f=i[34];let _;i[35]!==n||i[36]!==t.id?(_=e=>{p("organization_domain_clear_failed",{organization_id:t.id,email_domain:n,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to remove domain")},i[35]=n,i[36]=t.id,i[37]=_):_=i[37];let y;i[38]!==g||i[39]!==f||i[40]!==_?(y={mutationFn:g,onSuccess:f,onError:_},i[38]=g,i[39]=f,i[40]=_,i[41]=y):y=i[41];const N=G(y);let E;i[42]!==a||i[43]!==n||i[44]!==t.id?(E=async e=>{if(!n)return;p("organization_auto_join_toggled",{organization_id:t.id,enabled:e});const Q=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:e}});return M(Q)},i[42]=a,i[43]=n,i[44]=t.id,i[45]=E):E=i[45];let S;i[46]!==l?(S=()=>{l(),A.success("Auto-join setting updated")},i[46]=l,i[47]=S):S=i[47];let j;i[48]!==t.id?(j=e=>{p("organization_auto_join_toggle_failed",{organization_id:t.id,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to update auto-join")},i[48]=t.id,i[49]=j):j=i[49];let w;i[50]!==E||i[51]!==S||i[52]!==j?(w={mutationFn:E,onSuccess:S,onError:j},i[50]=E,i[51]=S,i[52]=j,i[53]=w):w=i[53];const O=G(w);if(Z)return null;let T;return i[54]!==F||i[55]!==v||i[56]!==N||i[57]!==n||i[58]!==C||i[59]!==O||i[60]!==o?(T=s.jsx(ii,{title:"Email domain",children:n?s.jsxs(k,{children:[s.jsx(P,{title:n,description:"Claimed domain",action:s.jsx(L,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(P,{title:"Auto-join",description:`Users with @${n} emails will automatically join this organization on signup.`,action:s.jsx(X,{checked:F,onCheckedChange:e=>O.mutate(e),disabled:O.isPending})})]}):v?s.jsx(k,{children:s.jsx(P,{title:o,description:"Let new users with matching emails auto-join this org.",action:s.jsx(L,{size:"sm",onClick:()=>C.mutate(),disabled:C.isPending,children:C.isPending?"Claiming...":"Claim domain"})})}):s.jsx(k,{children:s.jsx(P,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[54]=F,i[55]=v,i[56]=N,i[57]=n,i[58]=C,i[59]=O,i[60]=o,i[61]=T):T=i[61],T}export{si as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,j as s,
|
|
1
|
+
import{e as d,j as s,cm as i,c}from"./index-kq5yUS_7.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(w,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(m,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c,j as i,
|
|
1
|
+
import{e as c,j as i,dG as f,dH as m,c as u,dI as g,dJ as x,dK as v,dL as b,dM as h,dN as w,dO as j,dP as N,dQ as z,dR as _,dS as y,dT as p}from"./index-kq5yUS_7.js";import{i as $}from"./Check-c_jJpxb1.js";import{i as D}from"./ChevronRight-DLrAfqVe.js";import{a as M}from"./DotsVertical-Drb9z9hu.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function G(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function L(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function O(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function H(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function J(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function K(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function Q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function q(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,G as b,L as c,J as d,K as e,Q as f,q as g,H as h,E as i,P as j,O as k};
|
package/dist/client/assets/{dynamic-plugin-layout-DROpH4YR.js → dynamic-plugin-layout-DfSmXQDS.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,g as p,
|
|
1
|
+
import{e as d,g as p,ck as l,j as s,O as u}from"./index-kq5yUS_7.js";import{P as c}from"./plugin-layout-G84GIXAW.js";import"./use-connection-CXK4eJ8D.js";import"./use-collections-VJ2gqsdi.js";import"./constants-_NfKPeA7.js";import"./Settings02-YFMXLzh7.js";import"./index-DV3Yfg7N.js";import"./sidebar-CZfP1p-N.js";import"./LayoutLeft-CpIWBcma.js";import"./tooltip-DjBYlSjK.js";import"./sheet-BwdJHIyp.js";import"./X-BZgcfyxc.js";function _(){const e=d.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=p(n);let i;e[1]!==a?(i=l.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as v,c as N,j as t}from"./index-
|
|
1
|
+
import{e as v,c as N,j as t}from"./index-kq5yUS_7.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as b,c as h,j as t,B as g}from"./index-
|
|
1
|
+
import{e as b,c as h,j as t,B as g}from"./index-kq5yUS_7.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as O}from"./generate-id-
|
|
1
|
+
import{g as O}from"./generate-id-Bloedyht.js";import"./index-kq5yUS_7.js";import{W as T,c as x}from"./constants-_NfKPeA7.js";const U="mcp.mesh";function H(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function L(e){const t=H(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function Y(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return Y(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(e){return e?D[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[U],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||L(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{L as a,B as b,J as c,Q as e,q as f,j as g,F as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as b,q as k,G as q,ck as P,j as n,cl as E,b7 as R,K as S,o as K}from"./index-kq5yUS_7.js";import{P as j}from"./index-DV3Yfg7N.js";import{d as _}from"./use-organization-settings--vsQI-Ms.js";import{S as I}from"./switch-dV1jxIo5.js";import{n as Q}from"./Container-DhunwrH9.js";import{b as w,S as z,a as F,c as N}from"./settings-section-x9o4zXy4.js";import{R as T}from"./require-capability-B9yp1djm.js";import"./sidebar-CZfP1p-N.js";import"./LayoutLeft-CpIWBcma.js";import"./tooltip-DjBYlSjK.js";import"./sheet-BwdJHIyp.js";import"./X-BZgcfyxc.js";import"./constants-_NfKPeA7.js";import"./card-clJ4_TXy.js";import"./ArrowUpRight-nFWH1Ez9.js";import"./use-capability-Dzq6Bisq.js";import"./access-gate-D3K4mW0p.js";import"./capability-load-error-5fpCsl-E.js";function U(){const e=b.c(17),{org:t,project:s}=k(),r=q();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:G})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(P.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=P.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(w,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(Q,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(I,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(z,{children:n.jsx(F,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return P.find(s=>s.id===e)?.description??null}function D(e){const t=E.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=R.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function G(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function M(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function ae(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(M,{})}),e[0]=t):t=e[0],t}export{ae as default};
|