decocms 4.34.2 → 4.35.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-CWo2w3Rs.js → AlertCircle-f6lhwhwQ.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Bmg39pV9.js → ArrowUpRight-CSFwuCf5.js} +1 -1
- package/dist/client/assets/{Check-DRzA-dpx.js → Check-Aukmu8Un.js} +1 -1
- package/dist/client/assets/{CheckCircle-M6H5ZlJ0.js → CheckCircle-CApzzqD8.js} +1 -1
- package/dist/client/assets/{ChevronDown-CLHpWdSG.js → ChevronDown-B0UKR4Q8.js} +1 -1
- package/dist/client/assets/{ChevronRight-0-moit0s.js → ChevronRight-DBqOeCeL.js} +1 -1
- package/dist/client/assets/{ChevronUp-BfATOATf.js → ChevronUp-GMJj8UiZ.js} +1 -1
- package/dist/client/assets/{Circle-BbviKruX.js → Circle-YviPro1s.js} +1 -1
- package/dist/client/assets/{Copy01-0cR9vc8q.js → Copy01-DE6jIX1d.js} +1 -1
- package/dist/client/assets/{DotsVertical-BYgPyTRF.js → DotsVertical-CRXCtL95.js} +1 -1
- package/dist/client/assets/{Eye-C3PjUbDk.js → Eye-DkKR2sGU.js} +1 -1
- package/dist/client/assets/{FilterLines-AcRSKyYZ.js → FilterLines-zo9nIazW.js} +1 -1
- package/dist/client/assets/{Globe01-UNsFBAF6.js → Globe01-9ubWRIn8.js} +1 -1
- package/dist/client/assets/{Globe04-Cvug-N8n.js → Globe04-BQ8V1DCS.js} +1 -1
- package/dist/client/assets/{HardDrive-hN1jZwmH.js → HardDrive-inNtB34T.js} +1 -1
- package/dist/client/assets/{Key01-_uA23D4r.js → Key01-Ce61Bgp4.js} +1 -1
- package/dist/client/assets/{LayoutLeft-P3T11G8U.js → LayoutLeft-C4Pounbz.js} +1 -1
- package/dist/client/assets/{LinkExternal01-yVpYk0TA.js → LinkExternal01-C2NXvx3_.js} +1 -1
- package/dist/client/assets/{List-BDtpMLbg.js → List-CoWwn-yg.js} +1 -1
- package/dist/client/assets/{Loading02-BtqTcbc-.js → Loading02-DuE9feUL.js} +1 -1
- package/dist/client/assets/{Monitor01-Ca-mpyh5.js → Monitor01-DzUUK9ht.js} +1 -1
- package/dist/client/assets/{Palette-DoccA0gP.js → Palette-Do-v2l7i.js} +1 -1
- package/dist/client/assets/{Play-DamNmHjz.js → Play-Ca8SpLNV.js} +1 -1
- package/dist/client/assets/{Plus-DOMy9gvN.js → Plus-D321yWS2.js} +1 -1
- package/dist/client/assets/{SearchLg-CgRpLS5P.js → SearchLg-BcZgwDj6.js} +1 -1
- package/dist/client/assets/{SearchMd-aI0z5N9j.js → SearchMd-DJS38wH4.js} +1 -1
- package/dist/client/assets/{Settings02-BJM4-roS.js → Settings02-CkTsdbF0.js} +1 -1
- package/dist/client/assets/{Shield01-DUr3YuOr.js → Shield01-Bn8V09Ru.js} +1 -1
- package/dist/client/assets/{Star01-CezMYimm.js → Star01-DuQha8zt.js} +1 -1
- package/dist/client/assets/{Stars01-c5pA30a9.js → Stars01-B6X8tGbZ.js} +1 -1
- package/dist/client/assets/{Stars02-mQKhQQrM.js → Stars02-DeVTmo8z.js} +1 -1
- package/dist/client/assets/{Sun-4EkFOfwd.js → Sun-huCAsUzO.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BMtwwLBl.js → SwitchHorizontal01-1_z_hHyc.js} +1 -1
- package/dist/client/assets/{Tool01-CbCiOrgD.js → Tool01-D1RRR1kw.js} +1 -1
- package/dist/client/assets/{Trash01-BPtww6NG.js → Trash01-BhSSOFCl.js} +1 -1
- package/dist/client/assets/{Upload01-Bv5V53rT.js → Upload01-pw6m16iV.js} +1 -1
- package/dist/client/assets/{User01-BYDmkbvV.js → User01-D3gcuea5.js} +1 -1
- package/dist/client/assets/{Users01-CbN3qRM8.js → Users01-hYhuhjvL.js} +1 -1
- package/dist/client/assets/{Users03-BflqY5Bb.js → Users03-BW7WVd7l.js} +1 -1
- package/dist/client/assets/{X-Cb1IaFkf.js → X-B4-7qG-5.js} +1 -1
- package/dist/client/assets/{XCircle-DYs03cv5.js → XCircle-DNMYfZsu.js} +1 -1
- package/dist/client/assets/{XClose-D5jBGhZu.js → XClose-LQHYvxls.js} +1 -1
- package/dist/client/assets/{Zap-_LBawPer.js → Zap-D3B4NAio.js} +1 -1
- package/dist/client/assets/{ZapSquare-D3nXDwPD.js → ZapSquare-CDjZJq8r.js} +1 -1
- package/dist/client/assets/{ZoomOut-CoQZkFi6.js → ZoomOut-CdYifXao.js} +1 -1
- package/dist/client/assets/{access-gate-CWzEQUbt.js → access-gate-76tQHldY.js} +1 -1
- package/dist/client/assets/add-section-modal-BqLvsQKS.js +1 -0
- package/dist/client/assets/{agent-capabilities-Beg1Tahi.js → agent-capabilities-CncqCO43.js} +1 -1
- package/dist/client/assets/{agent-icon-Jbiz_GlE.js → agent-icon-Clq9aKDI.js} +1 -1
- package/dist/client/assets/{agents-list-DRLCMy9G.js → agents-list-BoRmbdnw.js} +1 -1
- package/dist/client/assets/{ai-providers-DYQcR6sR.js → ai-providers-CS4_9q5y.js} +1 -1
- package/dist/client/assets/{alert-DRQSEKDE.js → alert-CfLzySTP.js} +1 -1
- package/dist/client/assets/{alert-dialog-A1BqEuAN.js → alert-dialog-OcKuMvkx.js} +3 -3
- package/dist/client/assets/app-editor-SJHuM8DT.js +1 -0
- package/dist/client/assets/{auth-sGPw4pzN.js → auth-BSVfrU7T.js} +1 -1
- package/dist/client/assets/{auth-catchall-D6AiaVai.js → auth-catchall-Bq1TEeYt.js} +1 -1
- package/dist/client/assets/{auth-entry-BZp32rjz.js → auth-entry-Bbfzs0A9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BOSD21G1.js → auth-split-layout-VhDB5Kjd.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C9K-Bn9S.js → authenticate-and-persist-oauth-pSYfuzK6.js} +1 -1
- package/dist/client/assets/{automation-list-row-DX0hA2e6.js → automation-list-row-Cv1Lpo76.js} +1 -1
- package/dist/client/assets/{automation-runs-2FK11Uq8.js → automation-runs-DEj3paI_.js} +2 -2
- package/dist/client/assets/{automations-OF6KHsxv.js → automations-BUrB7Xnv.js} +1 -1
- package/dist/client/assets/{autosend-DRXerSlp.js → autosend-gxaMEvDD.js} +1 -1
- package/dist/client/assets/{avatar-DCYC0Ovl.js → avatar-Dv4V-x92.js} +1 -1
- package/dist/client/assets/{badge-zW2D6RON.js → badge-C262yjLA.js} +1 -1
- package/dist/client/assets/{block-document-CPKTmWKi.js → block-document-mTd4QaWg.js} +3 -3
- package/dist/client/assets/{brand-context-CS8dzOEw.js → brand-context-C6Mk4Tdt.js} +1 -1
- package/dist/client/assets/{breadcrumb-Cn_dCiaB.js → breadcrumb-CvS5tec8.js} +1 -1
- package/dist/client/assets/{buckets-DJAm9tU3.js → buckets-BicnOVQW.js} +1 -1
- package/dist/client/assets/bulk-category-panel-5446BaH7.js +1 -0
- package/dist/client/assets/{calendar-BUXe1qGD.js → calendar-D4t7kX9Q.js} +1 -1
- package/dist/client/assets/{capability-load-error-CBZKpTsj.js → capability-load-error-C6l-t9OR.js} +1 -1
- package/dist/client/assets/{card-w-ZXXB57.js → card-D8Vz3jG6.js} +1 -1
- package/dist/client/assets/category-editor--ln76tIo.js +1 -0
- package/dist/client/assets/{chat-context-BE6mo9bu.js → chat-context-CBVCBl_J.js} +1 -1
- package/dist/client/assets/{checkbox-DtrpBIFz.js → checkbox-CchykYiZ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C3LANAtT.js → cli-auth-success-BnByk5x5.js} +1 -1
- package/dist/client/assets/collection-detail-ND7d2Eyq.js +1 -0
- package/dist/client/assets/{collection-display-button-DQpkHuY5.js → collection-display-button-DxqFoVRY.js} +1 -1
- package/dist/client/assets/{collection-search-BwSp_Aw4.js → collection-search-CltfDlpo.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cn8zRCRJ.js → collection-table-wrapper-DLnmSfmE.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bm-3WSlA.js → collection-tabs-CTi5oTnQ.js} +1 -1
- package/dist/client/assets/{command-BO3Cnpvg.js → command-BAIXwHHL.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-prtwFO2s.js → commerce-onboarding-CMjqlg8E.js} +1 -1
- package/dist/client/assets/connect-desktop-dialog-CAF33mXR.js +1 -0
- package/dist/client/assets/{connection-card-4bm-y1Gd.js → connection-card-CO1XcaEL.js} +1 -1
- package/dist/client/assets/connection-detail-BlmkUd9p.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Dvg-sl5J.js → connection-form-helpers-XaWP2G3x.js} +1 -1
- package/dist/client/assets/connections-DnCGVu9g.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-H5PWohfg.js → decopilot-sse-pool-CDHTEmuK.js} +1 -1
- package/dist/client/assets/{dialog-D4tuLdKg.js → dialog-WEGZiwPy.js} +1 -1
- package/dist/client/assets/{domain-settings-Q64LowCi.js → domain-settings-CRCy8oFu.js} +1 -1
- package/dist/client/assets/{drawer-Cl42OMuR.js → drawer-UuuCah9g.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DnltYtFq.js → dropdown-menu-CksFCj44.js} +1 -1
- package/dist/client/assets/{empty-state-CSfhHKVd.js → empty-state-F_lK3gf_.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DbUbdg9c.js → extract-connection-data-BCgnLdIa.js} +1 -1
- package/dist/client/assets/file-explorer-DA4UKKI7.js +2 -0
- package/dist/client/assets/{file-type-icon-CzWNCoZC.js → file-type-icon-DEYVlVHX.js} +1 -1
- package/dist/client/assets/{files-uyt938FW.js → files-D4agV2id.js} +1 -1
- package/dist/client/assets/{form-V_XI11Kc.js → form-vGQs6GSc.js} +1 -1
- package/dist/client/assets/{general-BB8ctEPw.js → general-SnqMJ_uN.js} +1 -1
- package/dist/client/assets/github-repo-picker-WVoiNLVS.js +1 -0
- package/dist/client/assets/{hooks-CV3ote7A.js → hooks-HnvPO2Fr.js} +1 -1
- package/dist/client/assets/{index-3wANCPRO.js → index-7EDQs4g5.js} +11 -11
- package/dist/client/assets/{index-IJbt2d9X.js → index-B19Gd9cQ.js} +2 -2
- package/dist/client/assets/index-BcHmTSFg.css +1 -0
- package/dist/client/assets/{index-5kHbzeXa.js → index-BvY5YnRL.js} +1 -1
- package/dist/client/assets/{index-BmCtcH0K.js → index-CH3GGxYs.js} +1 -1
- package/dist/client/assets/{index-CnZPkn7R.js → index-CmN7TjST.js} +1 -1
- package/dist/client/assets/{index-D1Il2d7T.js → index-D1g40hAu.js} +3 -3
- package/dist/client/assets/{index-DXiY8k-2.js → index-D4E3XJr2.js} +1 -1
- package/dist/client/assets/{index-DHvUf48S.js → index-Du4ARIfO.js} +1 -1
- package/dist/client/assets/{index-CwathWr_.js → index-NGT6SGng.js} +1 -1
- package/dist/client/assets/{index-nxyUqjSg.js → index-aIln4hKS.js} +1 -1
- package/dist/client/assets/{index-0_QD3N3p.js → index-bSsLqTR8.js} +1 -1
- package/dist/client/assets/{index-CzWF3J4h.js → index-kAuhGsQR.js} +1 -1
- package/dist/client/assets/{index-redirect-Dc2nTn4h.js → index-redirect-BOtvKj4V.js} +1 -1
- package/dist/client/assets/{index-BOw4wVWR.js → index-y_ZN3Csi.js} +1 -1
- package/dist/client/assets/index-zNNbsSbv.js +217 -0
- package/dist/client/assets/{input-NG03AkXE.js → input-AH-zc1xJ.js} +1 -1
- package/dist/client/assets/{integration-icon-CZWFT3DW.js → integration-icon-A9c_bebh.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BKa9UA0S.js → invite-member-dialog-2QbPsKy5.js} +1 -1
- package/dist/client/assets/{label-CoVhr6uF.js → label-CREwZHVz.js} +1 -1
- package/dist/client/assets/{login-BxoaPHkQ.js → login-DK11wo9B.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BnINg_mr.js → mcp-oauth-CUTN_jP_.js} +1 -1
- package/dist/client/assets/{members-DZDoS8_y.js → members-SQ5xbIj_.js} +1 -1
- package/dist/client/assets/{monaco-editor-PvgfmQvG.js → monaco-editor-DcSz2nK4.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-BjJW0hk3.js → monitoring-stats-row-dq67E9g4.js} +1 -1
- package/dist/client/assets/{oauth-callback-BTtzlplc.js → oauth-callback-CyjY2LuB.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-4go1C5IS.js → oauth-callback-ai-provider-D-_MRvoT.js} +1 -1
- package/dist/client/assets/{onboarding-1FMcSqda.js → onboarding-BcNffG2l.js} +1 -1
- package/dist/client/assets/{org-install-6kg2QE41.js → org-install-CZD3yOvZ.js} +1 -1
- package/dist/client/assets/{org-layout-BcGgOe1A.js → org-layout-ChzYwis1.js} +1 -1
- package/dist/client/assets/{organization-choice-BF8evIsb.js → organization-choice-DO3TpN5Q.js} +1 -1
- package/dist/client/assets/page-seo-form-C3ja-AdY.js +1 -0
- package/dist/client/assets/page-seo-sheet-DST-XLP6.js +1 -0
- package/dist/client/assets/{popover-LegBHHPI.js → popover-BXSfQ3ty.js} +1 -1
- package/dist/client/assets/post-editor-B_LetdV2.js +1 -0
- package/dist/client/assets/{primitives-5Bes0H8Y.js → primitives-Dh6y5Vqf.js} +1 -1
- package/dist/client/assets/{profile-e9z16c_H.js → profile-DeWb4RIY.js} +1 -1
- package/dist/client/assets/project-app-view-BifDSljQ.js +1 -0
- package/dist/client/assets/record-editor-DI5MypGG.js +1 -0
- package/dist/client/assets/registry-B1LHfxlX.js +2 -0
- package/dist/client/assets/{registry-layout-BwXFLswk.js → registry-layout-DAKJr0Bp.js} +1 -1
- package/dist/client/assets/{require-capability-BZ-zzVLb.js → require-capability-Cb7N2Oxk.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DjSRL58t.js → required-auth-layout-DRSJiqlk.js} +1 -1
- package/dist/client/assets/{reset-password-DDn1uwC9.js → reset-password-BRHQg6QO.js} +1 -1
- package/dist/client/assets/{roles-BRoTsMVD.js → roles-SdLIIKmd.js} +1 -1
- package/dist/client/assets/{search-input-Ci8tEHW9.js → search-input-BzykC6SX.js} +1 -1
- package/dist/client/assets/{secrets-CN1xu6sV.js → secrets-lP0WJIRf.js} +1 -1
- package/dist/client/assets/sections-editor-CsFcLCt9.js +2 -0
- package/dist/client/assets/{select-DVZc4E4V.js → select-C5NXkaeS.js} +1 -1
- package/dist/client/assets/{select-model-CLhsRP_l.js → select-model-MLc2Y3Qy.js} +1 -1
- package/dist/client/assets/{seo-editor-Cb9iUbPW.js → seo-editor-r_gWolyN.js} +1 -1
- package/dist/client/assets/{settings-layout-DnXr7ygU.js → settings-layout-BRYOw2xs.js} +1 -1
- package/dist/client/assets/{settings-section-CHWS1FIf.js → settings-section-DcnbXr5u.js} +1 -1
- package/dist/client/assets/{shell-controls-B4nD11vf.js → shell-controls-hRJb8y7E.js} +1 -1
- package/dist/client/assets/{shell-layout-Dm40raSF.js → shell-layout-BQHSPqMr.js} +1 -1
- package/dist/client/assets/{sidebar-BbmkzDwj.js → sidebar-DgN5oOpi.js} +1 -1
- package/dist/client/assets/{skeleton-_zr7HJMo.js → skeleton-BNyVbUwG.js} +1 -1
- package/dist/client/assets/{sso-DWDuVYa_.js → sso-wV6U6i7v.js} +1 -1
- package/dist/client/assets/{store-p_qhKfKM.js → store-CoUYwDd1.js} +1 -1
- package/dist/client/assets/store-registry-mRHIDibK.js +2 -0
- package/dist/client/assets/{studio-tools-CTbP1rvS.js → studio-tools-DbeWVKwZ.js} +1 -1
- package/dist/client/assets/{switch-OeBXOHbU.js → switch-D35infLY.js} +1 -1
- package/dist/client/assets/tab-id-DAJ8K7VA.js +1 -0
- package/dist/client/assets/{table-B2Fi-xgN.js → table-CRfKA7NS.js} +1 -1
- package/dist/client/assets/{tabs-D3BMQa5m.js → tabs-D3wed5Bx.js} +1 -1
- package/dist/client/assets/{textarea-5Pf25_as.js → textarea-CEc_7A6V.js} +1 -1
- package/dist/client/assets/{toggle-group-Bp7LVOg4.js → toggle-group-CFbcmDsi.js} +1 -1
- package/dist/client/assets/toolbar-CgIGs2xP.js +1 -0
- package/dist/client/assets/{toolbar-icon-button-K5Db26Ta.js → toolbar-icon-button-CYEe3N0j.js} +1 -1
- package/dist/client/assets/{tools-list-Cj6pWwiB.js → tools-list-DI21LYyh.js} +1 -1
- package/dist/client/assets/{tooltip-CZrkvlI-.js → tooltip-Cjk9PMKc.js} +1 -1
- package/dist/client/assets/{types-CN46hG-C.js → types-DOtTCrPL.js} +3 -3
- package/dist/client/assets/{use-ai-providers-CqbJz7ty.js → use-ai-providers-qucsliq3.js} +1 -1
- package/dist/client/assets/{use-automations-Btrbiz8v.js → use-automations-SOkWBo6W.js} +1 -1
- package/dist/client/assets/{use-capability-56pwQuBl.js → use-capability-DQv1lExQ.js} +1 -1
- package/dist/client/assets/{use-clock-tick-D0StcXXM.js → use-clock-tick-eW5js56x.js} +1 -1
- package/dist/client/assets/{use-collections-C3a6O1Kf.js → use-collections-DXG9rjJ2.js} +1 -1
- package/dist/client/assets/{use-connection-DlA7SbYu.js → use-connection-Cod3M0Uh.js} +1 -1
- package/dist/client/assets/{use-copy-DUBRfsw_.js → use-copy-CGlHMDea.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DuiP1sA2.js → use-create-virtual-mcp-BX6sBt4t.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BcTFLZWq.js → use-debounced-autosave-DiGqeVKG.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DZMfEQVf.js → use-debounced-value-CzaaMzl3.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BRR71e9n.js → use-decopilot-events-uGcsF--z.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DsBRsN5J.js → use-delete-connection-QI_R7sTm.js} +1 -1
- package/dist/client/assets/{use-file-configs-B09v-Tdk.js → use-file-configs-CtmXiAad.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CXObKcMM.js → use-infinite-scroll-Ds-wB394.js} +1 -1
- package/dist/client/assets/{use-join-requests-BVvEnhaf.js → use-join-requests-C53tVE87.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CqQQWnQv.js → use-mcp-client-D-IcrlM1.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-5VgIENjN.js → use-mcp-prompts-CjXlqFii.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BBo1CVh9.js → use-mcp-tools-Dafx8Nf_.js} +1 -1
- package/dist/client/assets/{use-members-DQRLt-ZP.js → use-members-BkrjfZtd.js} +1 -1
- package/dist/client/assets/{use-mobile-DVBpVOpv.js → use-mobile-Cs5uj2B4.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DHQynKWI.js → use-navigate-to-agent-CdzFundu.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-D8i1yzzN.js → use-org-auth-client-CYHJ8zhf.js} +1 -1
- package/dist/client/assets/{use-org-sso-4OxOQasz.js → use-org-sso-ZllsKAXm.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DjenBlf3.js → use-organization-roles-UQbPZOTn.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DXQvxmVp.js → use-organization-settings-BM7m28RI.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CB4pSGdn.js → use-registry-connections-Obrdx90O.js} +1 -1
- package/dist/client/assets/{use-secrets-7z_yVxAY.js → use-secrets-DZyYucb6.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DKcljOhr.js → use-status-sounds-COBLP9-r.js} +1 -1
- package/dist/client/assets/{use-view-mode-2osL2HHr.js → use-view-mode-fgGIj_ax.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DTthhqWL.js → use-virtual-mcp-C70XD2v5.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dul-gPAw.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-0L4EzzOg.js +1 -0
- package/dist/client/assets/{variant-calendar-CrtWA8_Z.js → variant-calendar-BqxsTCCA.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BtNX-3na.js → view-mode-toggle-BEPKlxI2.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +424 -404
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-arZ7Xm3y.js +0 -1
- package/dist/client/assets/app-editor-Bx9ZRBZV.js +0 -1
- package/dist/client/assets/bulk-category-panel-Dv40K6eC.js +0 -1
- package/dist/client/assets/category-editor-Dji6lf8V.js +0 -1
- package/dist/client/assets/collection-detail-D_0lSHjB.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-eXpxo9qL.js +0 -1
- package/dist/client/assets/connection-detail-BoOE1DBL.js +0 -1
- package/dist/client/assets/connections-77MmnIp3.js +0 -1
- package/dist/client/assets/file-explorer-DHXMnboZ.js +0 -2
- package/dist/client/assets/github-repo-picker-D2aJRbrv.js +0 -1
- package/dist/client/assets/index-BNFGcJv4.js +0 -519
- package/dist/client/assets/index-dPmP2Tp4.css +0 -1
- package/dist/client/assets/page-seo-form-3mR99KHZ.js +0 -1
- package/dist/client/assets/page-seo-sheet-BwLPWNV9.js +0 -1
- package/dist/client/assets/post-editor-D1ab7ktC.js +0 -1
- package/dist/client/assets/project-app-view-Jl05SKrY.js +0 -1
- package/dist/client/assets/record-editor-C6jfNsK6.js +0 -1
- package/dist/client/assets/registry-DKZgk7Wa.js +0 -2
- package/dist/client/assets/sections-editor-DAnoJnEa.js +0 -2
- package/dist/client/assets/store-registry-DL8uX3MS.js +0 -2
- package/dist/client/assets/tab-id-DznSzCvK.js +0 -1
- package/dist/client/assets/toolbar-ABPXS5Vo.js +0 -1
- package/dist/client/assets/useInfiniteQuery-WADEvwcp.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-fFFo_5V2.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,r as g,j as r,l as H}from"./index-3wANCPRO.js";import{U as _}from"./agent-icon-Jbiz_GlE.js";import{i as V}from"./SearchMd-aI0z5N9j.js";import{e as X,d as J,a as K,c as Q}from"./dialog-D4tuLdKg.js";import{I as Y}from"./input-NG03AkXE.js";import{az as Z,av as ee,aA as te,aB as G,G as re}from"./index-BNFGcJv4.js";const se=12,U=new Set,z=new Set;function le(){for(const i of z)i()}function oe(i){return U.has(i)?!0:U.size>=se?!1:(U.add(i),!0)}function F(i){U.delete(i)&&le()}function ie(i){return z.add(i),()=>{z.delete(i)}}function ne(i,e){const t=g.useRef(!1),[v,c]=g.useState(!1),n=g.useRef(null),a=g.useRef(null),l=g.useRef(null),s=g.useRef(i);s.current=i;const[x]=g.useState(()=>{const o=()=>{l.current?.(),l.current=null},f=()=>t.current?!0:oe(e)?(t.current=!0,c(!0),o(),!0):!1;return d=>{if(a.current=d,n.current&&(n.current.disconnect(),n.current=null),o(),!d){t.current&&(F(e),t.current=!1,c(!1));return}queueMicrotask(()=>{if(a.current!==d)return;const u=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!f()&&!l.current&&(l.current=ie(()=>{a.current===d&&f()}));return}o(),t.current&&(F(e),t.current=!1,c(!1))},{root:s.current.current,rootMargin:"160px 0px"});u.observe(d),n.current=u})}});return{ref:x,iframeActive:v}}function ce(i){const e=$.c(8),{previewUrl:t,title:v,scrollRootRef:c,slotId:n}=i,{ref:a,iframeActive:l}=ne(c,n),[s,x]=g.useState(!1);let o;e[0]!==l||e[1]!==s||e[2]!==t||e[3]!==v?(o=l?r.jsxs(r.Fragment,{children:[!s&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${v}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>x(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=l,e[1]=s,e[2]=t,e[3]=v,e[4]=o):o=e[4];let f;return e[5]!==a||e[6]!==o?(f=r.jsx("div",{ref:a,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:o}),e[5]=a,e[6]=o,e[7]=f):f=e[7],f}function ae(i){const e=$.c(26),{entry:t,previewUrl:v,scrollRootRef:c,onSelect:n}=i,a=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let l;e[0]!==a?(l=H("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",a),e[0]=a,e[1]=l):l=e[1];let s;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==v||e[5]!==c?(s=r.jsx(ce,{previewUrl:v,title:t.title,scrollRootRef:c,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=v,e[5]=c,e[6]=s):s=e[6];let x;e[7]!==t.isSavedBlock?(x=t.isSavedBlock?{color:re}:void 0,e[7]=t.isSavedBlock,e[8]=x):x=e[8];let o;e[9]!==x?(o=r.jsx(_,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=o):o=e[10];let f;e[11]!==t.title?(f=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=f):f=e[12];let d;e[13]!==t.description?(d=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=d):d=e[14];let u;e[15]!==f||e[16]!==d?(u=r.jsxs("div",{className:"min-w-0 flex-1",children:[f,d]}),e[15]=f,e[16]=d,e[17]=u):u=e[17];let m;e[18]!==o||e[19]!==u?(m=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[o,u]}),e[18]=o,e[19]=u,e[20]=m):m=e[20];let h;return e[21]!==n||e[22]!==l||e[23]!==s||e[24]!==m?(h=r.jsxs("button",{type:"button",onClick:n,className:l,children:[s,m]}),e[21]=n,e[22]=l,e[23]=s,e[24]=m,e[25]=h):h=e[25],h}function xe(i){const e=$.c(41),{open:t,onOpenChange:v,meta:c,decofile:n,previewBaseUrl:a,onSelect:l}=i,[s,x]=g.useState(""),[o,f]=g.useState(t),d=g.useRef(null);t!==o&&(f(t),t&&x(""));let u,m,h,S,b,j,N,y,w,R,C;if(e[0]!==n||e[1]!==c||e[2]!==v||e[3]!==l||e[4]!==t||e[5]!==a||e[6]!==s){const E=t&&c&&n?Z(c,n):[],M=c?ee(c):"",D=n?te(n):void 0,W=new Map;if(t&&M)for(const p of E)W.set(p.resolveType,G(a,M,p.previewBlock,D));const P=s.trim().toLowerCase(),q=P?E.filter(p=>p.title.toLowerCase().includes(P)||p.resolveType.toLowerCase().includes(P)||p.description?.toLowerCase().includes(P)):E;m=X,R=t,C=v,u=J,N="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(K,{children:"Add section"}),e[18]=B):B=e[18];let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(V,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[19]=O):O=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=p=>x(p.target.value),e[20]=k):k=e[20],e[21]!==s?(w=r.jsxs(Q,{className:"shrink-0 border-b px-4 py-3 text-left",children:[B,r.jsxs("div",{className:"relative pt-2",children:[O,r.jsx(Y,{value:s,onChange:k,placeholder:"Search sections...",className:"h-9 pl-8"})]})]}),e[21]=s,e[22]=w):w=e[22],b=d,j="min-h-0 flex-1 overflow-y-auto",h="p-4",S=q.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No sections found."}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:q.map(p=>r.jsx(ae,{entry:p,scrollRootRef:d,previewUrl:W.get(p.resolveType)??G(a,M,p.previewBlock,D),onSelect:()=>l(p)},p.resolveType))}),e[0]=n,e[1]=c,e[2]=v,e[3]=l,e[4]=t,e[5]=a,e[6]=s,e[7]=u,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=y,e[15]=w,e[16]=R,e[17]=C}else u=e[7],m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],y=e[14],w=e[15],R=e[16],C=e[17];let T;e[23]!==h||e[24]!==S?(T=r.jsx("div",{className:h,children:S}),e[23]=h,e[24]=S,e[25]=T):T=e[25];let I;e[26]!==T||e[27]!==b||e[28]!==j?(I=r.jsx("div",{ref:b,className:j,children:T}),e[26]=T,e[27]=b,e[28]=j,e[29]=I):I=e[29];let A;e[30]!==u||e[31]!==I||e[32]!==N||e[33]!==y||e[34]!==w?(A=r.jsxs(u,{closeButtonClassName:N,className:y,children:[w,I]}),e[30]=u,e[31]=I,e[32]=N,e[33]=y,e[34]=w,e[35]=A):A=e[35];let L;return e[36]!==m||e[37]!==A||e[38]!==R||e[39]!==C?(L=r.jsx(m,{open:R,onOpenChange:C,children:A}),e[36]=m,e[37]=A,e[38]=R,e[39]=C,e[40]=L):L=e[40],L}export{xe as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as yt,r as w,j as o,l as gt,t as ut,i as St}from"./index-3wANCPRO.js";import{i as _t}from"./ChevronRight-0-moit0s.js";import{A as jt}from"./automation-runs-2FK11Uq8.js";import{A as kt}from"./add-section-modal-arZ7Xm3y.js";import{aC as Bt,aD as wt,aE as At,x as Nt,y as Ct,aF as Rt,ac as Et,aG as Kt,as as Ft}from"./index-BNFGcJv4.js";import"./select-DVZc4E4V.js";import"./tooltip-CZrkvlI-.js";import"./Check-DRzA-dpx.js";import"./ChevronDown-CLHpWdSG.js";import"./ChevronUp-BfATOATf.js";import"./useInfiniteQuery-WADEvwcp.js";import"./use-infinite-scroll-CXObKcMM.js";import"./use-connection-DlA7SbYu.js";import"./use-collections-C3a6O1Kf.js";import"./use-mcp-client-CqQQWnQv.js";import"./constants-B72Xmt_K.js";import"./auth-sGPw4pzN.js";import"./use-virtual-mcp-DTthhqWL.js";import"./card-w-ZXXB57.js";import"./sidebar-BbmkzDwj.js";import"./LayoutLeft-P3T11G8U.js";import"./use-mobile-DVBpVOpv.js";import"./X-Cb1IaFkf.js";import"./table-B2Fi-xgN.js";import"./empty-state-CSfhHKVd.js";import"./use-members-DQRLt-ZP.js";import"./use-org-auth-client-D8i1yzzN.js";import"./use-clock-tick-D0StcXXM.js";import"./AlertCircle-CWo2w3Rs.js";import"./CheckCircle-M6H5ZlJ0.js";import"./Circle-BbviKruX.js";import"./agent-icon-Jbiz_GlE.js";import"./Tool01-CbCiOrgD.js";import"./SwitchHorizontal01-BMtwwLBl.js";import"./Settings02-BJM4-roS.js";import"./XCircle-DYs03cv5.js";import"./ArrowUpRight-Bmg39pV9.js";import"./ZapSquare-D3nXDwPD.js";import"./Users03-BflqY5Bb.js";import"./Loading02-BtqTcbc-.js";import"./Stars02-mQKhQQrM.js";import"./Copy01-0cR9vc8q.js";import"./ZoomOut-CoQZkFi6.js";import"./DotsVertical-BYgPyTRF.js";import"./Globe01-UNsFBAF6.js";import"./Eye-C3PjUbDk.js";import"./FilterLines-AcRSKyYZ.js";import"./Star01-CezMYimm.js";import"./Globe04-Cvug-N8n.js";import"./HardDrive-hN1jZwmH.js";import"./Key01-_uA23D4r.js";import"./LinkExternal01-yVpYk0TA.js";import"./List-BDtpMLbg.js";import"./Monitor01-Ca-mpyh5.js";import"./Sun-4EkFOfwd.js";import"./Palette-DoccA0gP.js";import"./Play-DamNmHjz.js";import"./Plus-DOMy9gvN.js";import"./SearchLg-CgRpLS5P.js";import"./SearchMd-aI0z5N9j.js";import"./Shield01-DUr3YuOr.js";import"./Stars01-c5pA30a9.js";import"./Trash01-BPtww6NG.js";import"./Upload01-Bv5V53rT.js";import"./User01-BYDmkbvV.js";import"./Users01-CbN3qRM8.js";import"./XClose-D5jBGhZu.js";import"./Zap-_LBawPer.js";import"./use-automations-Btrbiz8v.js";import"./studio-tools-CTbP1rvS.js";import"./useSuspenseInfiniteQuery-fFFo_5V2.js";import"./badge-zW2D6RON.js";import"./checkbox-DtrpBIFz.js";import"./command-BO3Cnpvg.js";import"./index-0_QD3N3p.js";import"./dialog-D4tuLdKg.js";import"./popover-LegBHHPI.js";import"./avatar-DCYC0Ovl.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DUBRfsw_.js";import"./file-type-icon-CzWNCoZC.js";import"./tab-id-DznSzCvK.js";import"./monaco-editor-PvgfmQvG.js";import"./index-D1Il2d7T.js";import"./chat-context-BE6mo9bu.js";import"./autosend-DRXerSlp.js";import"./hooks-CV3ote7A.js";import"./decopilot-sse-pool-H5PWohfg.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CqbJz7ty.js";import"./use-decopilot-events-BRR71e9n.js";import"./use-organization-settings-DXQvxmVp.js";import"./types-CN46hG-C.js";import"./shell-layout-Dm40raSF.js";import"./alert-dialog-A1BqEuAN.js";import"./required-auth-layout-DjSRL58t.js";import"./use-org-sso-4OxOQasz.js";import"./integration-icon-CZWFT3DW.js";import"./use-navigate-to-agent-DHQynKWI.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-5VgIENjN.js";import"./form-V_XI11Kc.js";import"./label-CoVhr6uF.js";import"./input-NG03AkXE.js";import"./drawer-Cl42OMuR.js";import"./collection-search-BwSp_Aw4.js";import"./tabs-D3BMQa5m.js";import"./toggle-group-Bp7LVOg4.js";import"./agent-capabilities-Beg1Tahi.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-4bm-y1Gd.js";import"./use-registry-connections-CB4pSGdn.js";import"./extract-connection-data-DbUbdg9c.js";import"./collection-tabs-Bm-3WSlA.js";import"./textarea-5Pf25_as.js";import"./connection-form-helpers-Dvg-sl5J.js";import"./authenticate-and-persist-oauth-C9K-Bn9S.js";import"./mcp-oauth-BnINg_mr.js";import"./connect-desktop-dialog-eXpxo9qL.js";import"./select-model-CLhsRP_l.js";import"./skeleton-_zr7HJMo.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CHWS1FIf.js";import"./dropdown-menu-DnltYtFq.js";import"./index-IJbt2d9X.js";import"./toolbar-ABPXS5Vo.js";import"./use-debounced-value-DZMfEQVf.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DKcljOhr.js";import"./use-mcp-tools-BBo1CVh9.js";import"./use-capability-56pwQuBl.js";import"./tools-list-Cj6pWwiB.js";import"./switch-OeBXOHbU.js";import"./use-debounced-autosave-BcTFLZWq.js";import"./index-CwathWr_.js";import"./search-input-Ci8tEHW9.js";import"./github-repo-picker-D2aJRbrv.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-7z_yVxAY.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CnZPkn7R.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BUXe1qGD.js";import"./toolbar-icon-button-K5Db26Ta.js";import"./use-file-configs-B09v-Tdk.js";import"./automation-list-row-DX0hA2e6.js";function Tt(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",a=Bt(t,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function kr(l){const t=yt.c(77),{orgSlug:s,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:m,decofile:c,title:Z,excludeFields:G,schemaPending:at,previewBaseUrl:nt}=l,H=at===void 0?!1:at,u=nt===void 0?null:nt,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let C;t[0]!==G||t[1]!==m||t[2]!==x?(C=wt(x,m,G),t[0]=G,t[1]=m,t[2]=x,t[3]=C):C=t[3];const h=C;let R;t[4]!==h?(R=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=R):R=t[5];const J=R;let E;t[6]!==n||t[7]!==i||t[8]!==m||t[9]!==Z?(E=Z??(n?At(i,n,m):i),t[6]=n,t[7]=i,t[8]=m,t[9]=Z,t[10]=E):E=t[10];const v=E;let K;t[11]!==a||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:a},t[11]=a,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let F;t[15]!==a||t[16]!==s||t[17]!==f?(F={orgSlug:s,virtualMcpId:f,branch:a},t[15]=a,t[16]=s,t[17]=f,t[18]=F):F=t[18];const X=Ct(F);let T;t[19]!==b?(T=Et((e,r)=>b(e,r)),t[19]=b,t[20]=T):T=t[20];const Y=T,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=[],t[21]=$):$=t[21];const[p,ft]=w.useState($),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==n?(O=n??{},t[22]=n,t[23]=O):O=t[23];const it=O;let y;t[24]!==tt?(y=tt??{},t[24]=tt,t[25]=y):y=t[25];let z;t[26]!==it||t[27]!==y?(z={...it,...y},t[26]=it,t[27]=y,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=Tt(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const g=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==g?(U=async e=>{const r=P.current;if(r)try{await g(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=g,t[40]=U):U=t[40];const lt=U;let D;t[41]!==p||t[42]!==v?(D=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=D):D=t[43];const A=D;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Rt(p,r)),dt($t)},title:e,className:gt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let _;t[48]!==W?(_=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=_):_=t[49];let j;t[50]!==S||t[51]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,_]}),t[50]=S,t[51]=_,t[52]=j):j=t[52];let k;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==g||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==H?(k=o.jsx(jt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ft,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:g,onRequestAddSection:vt},`${i}:${et}`):H?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=g,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=H,t[66]=k):k=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(kt,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let M;return t[73]!==j||t[74]!==k||t[75]!==B?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,k,B]}),t[73]=j,t[74]=k,t[75]=B,t[76]=M):M=t[76],M}function $t(l){return l+1}function Pt(l){return l+1}export{kr as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Q,l as Y,j as t,r as W,B as J,i as le}from"./index-3wANCPRO.js";import{aa as Z}from"./agent-icon-Jbiz_GlE.js";import{i as ie}from"./X-Cb1IaFkf.js";import{L as O}from"./label-CoVhr6uF.js";import{I as oe,R as ae,a as re}from"./index-DHvUf48S.js";import{i as ce}from"./Circle-BbviKruX.js";import{a as ne,c as me,d as de,S as pe,b as xe}from"./select-DVZc4E4V.js";import{a as fe,b as ue,T as he}from"./tooltip-CZrkvlI-.js";import"./AlertCircle-CWo2w3Rs.js";import"./Tool01-CbCiOrgD.js";import"./SwitchHorizontal01-BMtwwLBl.js";import"./Settings02-BJM4-roS.js";import"./XCircle-DYs03cv5.js";import"./ArrowUpRight-Bmg39pV9.js";import"./ZapSquare-D3nXDwPD.js";import"./Users03-BflqY5Bb.js";import"./Loading02-BtqTcbc-.js";import"./CheckCircle-M6H5ZlJ0.js";import"./Check-DRzA-dpx.js";import"./ChevronDown-CLHpWdSG.js";import"./ChevronRight-0-moit0s.js";import"./ChevronUp-BfATOATf.js";import"./Stars02-mQKhQQrM.js";import"./Copy01-0cR9vc8q.js";import"./ZoomOut-CoQZkFi6.js";import"./DotsVertical-BYgPyTRF.js";import"./Globe01-UNsFBAF6.js";import"./Eye-C3PjUbDk.js";import"./FilterLines-AcRSKyYZ.js";import"./Star01-CezMYimm.js";import"./Globe04-Cvug-N8n.js";import"./HardDrive-hN1jZwmH.js";import"./Key01-_uA23D4r.js";import"./LayoutLeft-P3T11G8U.js";import"./LinkExternal01-yVpYk0TA.js";import"./List-BDtpMLbg.js";import"./Monitor01-Ca-mpyh5.js";import"./Sun-4EkFOfwd.js";import"./Palette-DoccA0gP.js";import"./Play-DamNmHjz.js";import"./Plus-DOMy9gvN.js";import"./SearchLg-CgRpLS5P.js";import"./SearchMd-aI0z5N9j.js";import"./Shield01-DUr3YuOr.js";import"./Stars01-c5pA30a9.js";import"./Trash01-BPtww6NG.js";import"./Upload01-Bv5V53rT.js";import"./User01-BYDmkbvV.js";import"./Users01-CbN3qRM8.js";import"./XClose-D5jBGhZu.js";import"./Zap-_LBawPer.js";function ge(i){const e=Q.c(8);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let a;e[3]!==o?(a=Y("grid gap-3",o),e[3]=o,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=t.jsx(ae,{"data-slot":"radio-group",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}function X(i){const e=Q.c(9);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let a;e[3]!==o?(a=Y("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",o),e[3]=o,e[4]=a):a=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(re,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==a?(c=t.jsx(oe,{"data-slot":"radio-group-item",className:a,...s,children:l}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function gt(i){const e=Q.c(69),{posts:o,categories:s,initialSlug:a,isPending:l,onApply:c,onClose:d}=i,[n,ee]=W.useState(a&&s.some(m=>m.slug===a)?a:s[0]?.slug??""),[p,te]=W.useState("add");let T;if(e[0]!==s||e[1]!==n){let m;e[3]!==n?(m=se=>se.slug===n,e[3]=n,e[4]=m):m=e[4],T=s.find(m),e[0]=s,e[1]=n,e[2]=T}else T=e[2];const x=T,r=o.length,K=r===1?"post":"posts";let f;e[5]!==r||e[6]!==K?(f=t.jsxs("span",{className:"truncate text-sm font-medium",children:[r," ",K," selected"]}),e[5]=r,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ie,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==d?(u=t.jsx(fe,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:d,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=t.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=r===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${r} ${r===1?"post":"posts"}.`;let j;e[19]!==M?(j=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==s||e[23]!==n?(b=t.jsxs("div",{className:"space-y-2",children:[B,s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):t.jsxs(ne,{value:n,onValueChange:ee,children:[t.jsx(me,{className:"w-full",children:t.jsx(de,{placeholder:"Select a category"})}),t.jsx(pe,{children:s.map(be)})]})]}),e[22]=s,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=m=>te(m),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==p?(y=t.jsxs(ge,{value:p,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=p,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==d?(N=t.jsx(J,{type:"button",variant:"outline",onClick:d,disabled:l,children:"Cancel"}),e[32]=l,e[33]=d,e[34]=N):N=e[34];const D=!x||l||r===0;let v;e[35]!==p||e[36]!==c||e[37]!==x?(v=()=>x&&c(p,{name:x.name,slug:x.slug}),e[35]=p,e[36]=c,e[37]=x,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?t.jsxs(t.Fragment,{children:[t.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=t.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=t.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=t.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=r===1?"post":"posts";let w;e[53]!==r||e[54]!==H?(w=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,t.jsxs("span",{className:"text-sm",children:[r," selected ",H]})]}),e[53]=r,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==r||e[57]!==o?(R=r===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):t.jsx("ul",{className:"divide-y border-t bg-background",children:o.map(je)}),e[56]=r,e[57]=o,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function be(i){return t.jsx(xe,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{gt as BulkCategoryPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,r as S,l as Q,j as t,B as I,i as V,t as U}from"./index-3wANCPRO.js";import{i as X}from"./XCircle-DYs03cv5.js";import{aG as Y,aa as T}from"./agent-icon-Jbiz_GlE.js";import{n as Z}from"./LinkExternal01-yVpYk0TA.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-A1BqEuAN.js";import{I as L}from"./input-NG03AkXE.js";import{L as G}from"./label-CoVhr6uF.js";import{aH as at,aI as mt,aR as nt,aG as lt,aJ as B,aL as pt,aS as ct}from"./index-BNFGcJv4.js";import{c as dt,B as ut,a as gt}from"./block-document-CPKTmWKi.js";import{u as xt,s as v,E as ft}from"./primitives-5Bes0H8Y.js";import{t as ht}from"./ChevronDown-CLHpWdSG.js";import{J as jt,K as yt,I as vt}from"./automation-runs-2FK11Uq8.js";import"./AlertCircle-CWo2w3Rs.js";import"./Tool01-CbCiOrgD.js";import"./SwitchHorizontal01-BMtwwLBl.js";import"./Settings02-BJM4-roS.js";import"./ArrowUpRight-Bmg39pV9.js";import"./ZapSquare-D3nXDwPD.js";import"./Users03-BflqY5Bb.js";import"./Loading02-BtqTcbc-.js";import"./CheckCircle-M6H5ZlJ0.js";import"./Check-DRzA-dpx.js";import"./ChevronRight-0-moit0s.js";import"./ChevronUp-BfATOATf.js";import"./Circle-BbviKruX.js";import"./Stars02-mQKhQQrM.js";import"./Copy01-0cR9vc8q.js";import"./ZoomOut-CoQZkFi6.js";import"./DotsVertical-BYgPyTRF.js";import"./Globe01-UNsFBAF6.js";import"./Eye-C3PjUbDk.js";import"./FilterLines-AcRSKyYZ.js";import"./Star01-CezMYimm.js";import"./Globe04-Cvug-N8n.js";import"./HardDrive-hN1jZwmH.js";import"./Key01-_uA23D4r.js";import"./LayoutLeft-P3T11G8U.js";import"./List-BDtpMLbg.js";import"./Monitor01-Ca-mpyh5.js";import"./Sun-4EkFOfwd.js";import"./Palette-DoccA0gP.js";import"./Play-DamNmHjz.js";import"./Plus-DOMy9gvN.js";import"./SearchLg-CgRpLS5P.js";import"./SearchMd-aI0z5N9j.js";import"./Shield01-DUr3YuOr.js";import"./Stars01-c5pA30a9.js";import"./Trash01-BPtww6NG.js";import"./Upload01-Bv5V53rT.js";import"./User01-BYDmkbvV.js";import"./Users01-CbN3qRM8.js";import"./XClose-D5jBGhZu.js";import"./X-Cb1IaFkf.js";import"./Zap-_LBawPer.js";import"./chat-context-BE6mo9bu.js";import"./autosend-DRXerSlp.js";import"./hooks-CV3ote7A.js";import"./use-mcp-client-CqQQWnQv.js";import"./constants-B72Xmt_K.js";import"./auth-sGPw4pzN.js";import"./decopilot-sse-pool-H5PWohfg.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-DTthhqWL.js";import"./use-collections-C3a6O1Kf.js";import"./use-ai-providers-CqbJz7ty.js";import"./studio-tools-CTbP1rvS.js";import"./use-decopilot-events-BRR71e9n.js";import"./tab-id-DznSzCvK.js";import"./use-organization-settings-DXQvxmVp.js";import"./tooltip-CZrkvlI-.js";import"./dialog-D4tuLdKg.js";import"./drawer-Cl42OMuR.js";import"./collection-search-BwSp_Aw4.js";import"./use-mobile-DVBpVOpv.js";import"./use-mcp-prompts-5VgIENjN.js";import"./shell-layout-Dm40raSF.js";import"./avatar-DCYC0Ovl.js";import"./required-auth-layout-DjSRL58t.js";import"./use-org-sso-4OxOQasz.js";import"./form-V_XI11Kc.js";import"./select-DVZc4E4V.js";import"./tabs-D3BMQa5m.js";import"./toggle-group-Bp7LVOg4.js";import"./agent-capabilities-Beg1Tahi.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-4bm-y1Gd.js";import"./use-registry-connections-CB4pSGdn.js";import"./use-connection-DlA7SbYu.js";import"./useInfiniteQuery-WADEvwcp.js";import"./use-infinite-scroll-CXObKcMM.js";import"./extract-connection-data-DbUbdg9c.js";import"./card-w-ZXXB57.js";import"./integration-icon-CZWFT3DW.js";import"./collection-tabs-Bm-3WSlA.js";import"./badge-zW2D6RON.js";import"./textarea-5Pf25_as.js";import"./connection-form-helpers-Dvg-sl5J.js";import"./authenticate-and-persist-oauth-C9K-Bn9S.js";import"./mcp-oauth-BnINg_mr.js";import"./useSuspenseInfiniteQuery-fFFo_5V2.js";import"./connect-desktop-dialog-eXpxo9qL.js";import"./select-model-CLhsRP_l.js";import"./checkbox-DtrpBIFz.js";import"./skeleton-_zr7HJMo.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CHWS1FIf.js";import"./command-BO3Cnpvg.js";import"./index-0_QD3N3p.js";import"./popover-LegBHHPI.js";import"./dropdown-menu-DnltYtFq.js";import"./index-IJbt2d9X.js";import"./file-type-icon-CzWNCoZC.js";import"./toolbar-ABPXS5Vo.js";import"./use-debounced-value-DZMfEQVf.js";import"./index-D1Il2d7T.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DKcljOhr.js";import"./empty-state-CSfhHKVd.js";import"./use-mcp-tools-BBo1CVh9.js";import"./types-CN46hG-C.js";import"./use-capability-56pwQuBl.js";import"./tools-list-Cj6pWwiB.js";import"./switch-OeBXOHbU.js";import"./use-debounced-autosave-BcTFLZWq.js";import"./index-CwathWr_.js";import"./sidebar-BbmkzDwj.js";import"./search-input-Ci8tEHW9.js";import"./github-repo-picker-D2aJRbrv.js";import"./use-navigate-to-agent-DHQynKWI.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-7z_yVxAY.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-DQRLt-ZP.js";import"./use-org-auth-client-D8i1yzzN.js";import"./index-CnZPkn7R.js";import"./get-initials-D-f_fDFw.js";import"./format-time-Cy7tTmZp.js";import"./calendar-BUXe1qGD.js";import"./toolbar-icon-button-K5Db26Ta.js";import"./use-file-configs-B09v-Tdk.js";import"./monaco-editor-PvgfmQvG.js";import"./use-automations-Btrbiz8v.js";import"./automation-list-row-DX0hA2e6.js";import"./table-B2Fi-xgN.js";import"./use-clock-tick-D0StcXXM.js";import"./use-copy-DUBRfsw_.js";function bt(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function pr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=z.length,H=o=>s("slug",o),J=async(o,w)=>{const W=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:W,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:B(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:B(n,"categories",E)}),c(E),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},M=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){H(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:M,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&J(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{pr as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as O,j as t,B as F,i as Y,G as Ge,H as te,P as Pe,r as $,$ as re,J as Qe,u as Ye,a6 as K,t as Xe,l as je,e as le,aW as ke}from"./index-3wANCPRO.js";import{E as Ae}from"./empty-state-CSfhHKVd.js";import{u as Ze,a as Ee}from"./use-collections-C3a6O1Kf.js";import{u as ae}from"./use-mcp-client-CqQQWnQv.js";import{F as se,a as et,b as ce,d as de}from"./form-V_XI11Kc.js";import{I as me}from"./input-NG03AkXE.js";import{T as ie}from"./textarea-5Pf25_as.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-nxyUqjSg.js";import{aq as it,L as rt,am as lt,a0 as at,ad as ct,ar as dt,W as be}from"./agent-icon-Jbiz_GlE.js";import{g as mt,M as ut,a as Ne}from"./types-CN46hG-C.js";import{A as xt,a as pt,b as ft}from"./alert-DRQSEKDE.js";import{a as ve,c as Se,d as ye,S as we,b as ne}from"./select-DVZc4E4V.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-CZrkvlI-.js";import{i as gt}from"./AlertCircle-CWo2w3Rs.js";import{s as jt}from"./Stars02-mQKhQQrM.js";import{a as bt}from"./Copy01-0cR9vc8q.js";import{i as Nt}from"./Play-DamNmHjz.js";import{a as Oe,b as Re,B as V,c as G,d as Q,e as _e}from"./breadcrumb-Cn_dCiaB.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-Cj6pWwiB.js";import{a as De,u as Me}from"./use-connection-DlA7SbYu.js";import{a as wt}from"./use-mcp-tools-BBo1CVh9.js";import{M as Ct,c as It}from"./monaco-editor-PvgfmQvG.js";import{I as Te}from"./integration-icon-CZWFT3DW.js";import{g as $t,l as Tt}from"./chat-context-BE6mo9bu.js";import{u as Pt}from"./shell-layout-Dm40raSF.js";import{n as kt}from"./XCircle-DYs03cv5.js";import"./constants-B72Xmt_K.js";import"./auth-sGPw4pzN.js";import"./label-CoVhr6uF.js";import"./index-CwathWr_.js";import"./sidebar-BbmkzDwj.js";import"./LayoutLeft-P3T11G8U.js";import"./use-mobile-DVBpVOpv.js";import"./X-Cb1IaFkf.js";import"./ZoomOut-CoQZkFi6.js";import"./Key01-_uA23D4r.js";import"./extract-connection-data-DbUbdg9c.js";import"./use-registry-connections-CB4pSGdn.js";import"./use-organization-settings-DXQvxmVp.js";import"./studio-tools-CTbP1rvS.js";import"./Plus-DOMy9gvN.js";import"./index-CzWF3J4h.js";import"./index-DHvUf48S.js";import"./index-0_QD3N3p.js";import"./popover-LegBHHPI.js";import"./use-virtual-mcp-DTthhqWL.js";import"./Check-DRzA-dpx.js";import"./SearchMd-aI0z5N9j.js";import"./Users03-BflqY5Bb.js";import"./use-create-virtual-mcp-DuiP1sA2.js";import"./use-navigate-to-agent-DHQynKWI.js";import"./hooks-CV3ote7A.js";import"./decopilot-sse-pool-H5PWohfg.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-qqWu133U.js";import"./Tool01-CbCiOrgD.js";import"./SwitchHorizontal01-BMtwwLBl.js";import"./Settings02-BJM4-roS.js";import"./ArrowUpRight-Bmg39pV9.js";import"./ZapSquare-D3nXDwPD.js";import"./Loading02-BtqTcbc-.js";import"./CheckCircle-M6H5ZlJ0.js";import"./ChevronDown-CLHpWdSG.js";import"./ChevronRight-0-moit0s.js";import"./ChevronUp-BfATOATf.js";import"./Circle-BbviKruX.js";import"./DotsVertical-BYgPyTRF.js";import"./Globe01-UNsFBAF6.js";import"./Eye-C3PjUbDk.js";import"./FilterLines-AcRSKyYZ.js";import"./Star01-CezMYimm.js";import"./Globe04-Cvug-N8n.js";import"./HardDrive-hN1jZwmH.js";import"./LinkExternal01-yVpYk0TA.js";import"./List-BDtpMLbg.js";import"./Monitor01-Ca-mpyh5.js";import"./Sun-4EkFOfwd.js";import"./Palette-DoccA0gP.js";import"./SearchLg-CgRpLS5P.js";import"./Shield01-DUr3YuOr.js";import"./Stars01-c5pA30a9.js";import"./Trash01-BPtww6NG.js";import"./Upload01-Bv5V53rT.js";import"./User01-BYDmkbvV.js";import"./Users01-CbN3qRM8.js";import"./XClose-D5jBGhZu.js";import"./Zap-_LBawPer.js";import"./mcp-oauth-BnINg_mr.js";import"./badge-zW2D6RON.js";import"./index-D1Il2d7T.js";import"./autosend-DRXerSlp.js";import"./use-ai-providers-CqbJz7ty.js";import"./use-decopilot-events-BRR71e9n.js";import"./tab-id-DznSzCvK.js";import"./avatar-DCYC0Ovl.js";import"./dialog-D4tuLdKg.js";import"./alert-dialog-A1BqEuAN.js";import"./required-auth-layout-DjSRL58t.js";import"./use-org-sso-4OxOQasz.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Dt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Ze(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function zt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const Lt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=De(e),N=$t(),A=Tt(),{setChatOpen:U}=Pt(),z=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),L=wt({client:_}),j=L.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),J=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,X]=$.useState("json"),[ze,Le]=$.useState(!1);E&&!ze&&(X("ui"),Le(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const Z=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const ge=Number(h[M]);Number.isNaN(ge)||(h[M]=ge)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),We=Math.round(He-a);p(W),g(v),C(h);const Ke=JSON.stringify(W),he=new TextEncoder().encode(Ke).length;y({duration:`${We}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const W=performance.now();y({duration:`${Math.round(W-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??Lt(s),Je=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(V,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Ve=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:Z(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:a=>A?.setAppContext(z,a),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Je,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Ve}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!De(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Jt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Vt={prompt:zt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=Me(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=Me(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Vt[b];let w;s[14]!==l?(w=Wt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let z;s[24]!==P?(z=t.jsx(V,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(y){let D;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(D=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Jt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let J;return s[38]!==L||s[39]!==E?(J=t.jsx(ue,{breadcrumb:L,children:E}),s[38]=L,s[39]=E,s[40]=J):J=s[40],J}function Gt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[2]=i):i=s[2],i}function Vn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Vn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as v,$ as w,K as z,k as M,j as s,r as T,B as I,l as L}from"./index-3wANCPRO.js";import{a as S,b as E,c as R,d as D,e as _}from"./dialog-D4tuLdKg.js";import{S as $}from"./chat-context-BE6mo9bu.js";import{i as A}from"./Check-DRzA-dpx.js";import{a as B}from"./Copy01-0cR9vc8q.js";import{u as F}from"./studio-tools-CTbP1rvS.js";const y={online:!1,capabilities:[],ready:!1};function K(a){const e=v.c(9),{org:n}=w(),i=F(),o=a?.fast??!1;let t;e[0]!==n.id?(t=z.currentLink(n.id),e[0]=n.id,e[1]=t):t=e[1];let l;e[2]!==i?(l=async()=>{const u=await i.call("LINK_CURRENT_GET",{});return u?{...u,ready:!0}:{...y,ready:!0}},e[2]=i,e[3]=l):l=e[3];const d=o?1e3:1e4,g=o?2e3:15e3;let r;e[4]!==t||e[5]!==l||e[6]!==d||e[7]!==g?(r={queryKey:t,queryFn:l,staleTime:d,refetchInterval:g,refetchOnWindowFocus:!0},e[4]=t,e[5]=l,e[6]=d,e[7]=g,e[8]=r):r=e[8];const{data:c}=M(r);return c??y}function O(a){const e=v.c(3),{size:n}=a,i=n===void 0?16:n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=o):o=e[0];let t;return e[1]!==i?(t=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o}),e[1]=i,e[2]=t):t=e[2],t}function P(a){const e=v.c(3),{size:n}=a,i=n===void 0?16:n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=o):o=e[0];let t;return e[1]!==i?(t=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:o}),e[1]=i,e[2]=t):t=e[2],t}const N="bunx decocms@latest link",k=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(O,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(P,{size:18})}];function U(a){return k.filter(e=>a.includes(e.capability)).map(e=>e.label)}function J(a){const e=v.c(23),{open:n,onOpenChange:i}=a;let o;e[0]!==n?(o={fast:n},e[0]=n,e[1]=o):o=e[1];const t=K(o),[l,d]=T.useState(!1),g=t.hostname??t.machineId??"Your desktop",r=t.online?`Connected to ${g}`:"Connect your desktop";let c;e[2]!==r?(c=s.jsx(S,{children:r}),e[2]=r,e[3]=c):c=e[3];const u=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let m;e[4]!==u?(m=s.jsx(E,{children:u}),e[4]=u,e[5]=m):m=e[5];let x;e[6]!==c||e[7]!==m?(x=s.jsxs(R,{children:[c,m]}),e[6]=c,e[7]=m,e[8]=x):x=e[8];let f;e[9]!==l||e[10]!==t.online?(f=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:N}),s.jsx(I,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(N),d(!0),setTimeout(()=>d(!1),1500)},children:l?s.jsx(A,{size:14}):s.jsx(B,{size:14})})]}),e[9]=l,e[10]=t.online,e[11]=f):f=e[11];let p;e[12]!==t.capabilities||e[13]!==t.online?(p=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:k.map(b=>{const C=t.capabilities.includes(b.capability);return s.jsxs("div",{className:L("flex items-center gap-3 rounded-md border px-3 py-2",C?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:L("flex size-6 items-center justify-center",C?"text-foreground":"text-muted-foreground"),children:b.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:b.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:C?b.description:"Not detected"})]}),s.jsx("span",{className:L("size-2 rounded-full",C?"bg-success":"bg-muted-foreground/30")})]},b.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx($,{size:"sm"}),"Waiting for desktop…"]}),e[12]=t.capabilities,e[13]=t.online,e[14]=p):p=e[14];let h;e[15]!==x||e[16]!==f||e[17]!==p?(h=s.jsxs(D,{className:"sm:max-w-md",children:[x,f,p]}),e[15]=x,e[16]=f,e[17]=p,e[18]=h):h=e[18];let j;return e[19]!==i||e[20]!==n||e[21]!==h?(j=s.jsx(_,{open:n,onOpenChange:i,children:h}),e[19]=i,e[20]=n,e[21]=h,e[22]=j):j=e[22],j}export{J as C,P as a,O as b,K as u,U as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as he,aa as Ie,a$ as Ae,H as le,a8 as $e,c as P,j as t,i as ge,B as V,r as q,l as je,$ as J,L as De,K as ne,b as Y,aF as ce,W as Pe,b0 as Oe,P as Me,e as ze,b1 as Ee,p as Ve,J as Ue,I as Fe,t as X,b2 as Re}from"./index-3wANCPRO.js";import{a as Le}from"./extract-connection-data-DbUbdg9c.js";import{E as ve}from"./empty-state-CSfhHKVd.js";import{E as He,c as Be,r as We,b as Ge,d as Xe}from"./connection-form-helpers-Dvg-sl5J.js";import{c as qe,S as Ke,V as Qe}from"./index-nxyUqjSg.js";import{u as be,T as Je}from"./tools-list-Cj6pWwiB.js";import{u as Ye}from"./use-members-DQRLt-ZP.js";import{A as Ze}from"./avatar-DCYC0Ovl.js";import{a as Ne,b as ye,u as et}from"./use-connection-DlA7SbYu.js";import{u as _e}from"./use-mcp-client-CqQQWnQv.js";import{a as tt}from"./use-mcp-tools-BBo1CVh9.js";import{a as st}from"./use-mcp-prompts-5VgIENjN.js";import{i as nt,a as ot}from"./mcp-oauth-BnINg_mr.js";import{I as oe}from"./integration-icon-CZWFT3DW.js";import{s as it}from"./Plus-DOMy9gvN.js";import{N as at,O as rt,ap as lt,al as ct}from"./agent-icon-Jbiz_GlE.js";import{a as Ce,s as dt}from"./Settings02-BJM4-roS.js";import{s as ae}from"./Trash01-BPtww6NG.js";import{q as mt,p as ut,o as xt,m as pt,n as ft}from"./sidebar-BbmkzDwj.js";import{F as L,b as H,c as B,d as E,e as W,f as ht,a as gt}from"./form-V_XI11Kc.js";import{I as G}from"./input-NG03AkXE.js";import{u as jt,D as vt}from"./use-delete-connection-DsBRsN5J.js";import{c as bt,C as Nt,B as yt,a as _t,b as Ct,d as St,e as wt}from"./monitoring-stats-row-BjJW0hk3.js";import{u as kt}from"./studio-tools-CTbP1rvS.js";import{a as Tt}from"./use-virtual-mcp-DTthhqWL.js";import{i as Se}from"./ChevronRight-0-moit0s.js";import{a as we}from"./Users03-BflqY5Bb.js";import{b as ee,c as It,T as te,a as At}from"./tabs-D3BMQa5m.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-D3nXDwPD.js";import{d as Dt}from"./Tool01-CbCiOrgD.js";import{g as re,M as Pt}from"./types-CN46hG-C.js";import{C as Ot}from"./collection-search-BwSp_Aw4.js";import{C as Mt}from"./card-w-ZXXB57.js";import{B as zt}from"./badge-zW2D6RON.js";import{D as Et,a as Vt,c as Ut,d as de}from"./dropdown-menu-DnltYtFq.js";import{a as me,c as ue,d as xe,S as pe,b as R}from"./select-DVZc4E4V.js";import{i as Ft}from"./CheckCircle-M6H5ZlJ0.js";import{t as Rt}from"./ChevronDown-CLHpWdSG.js";import{n as Lt}from"./XCircle-DYs03cv5.js";import{s as se}from"./Star01-CezMYimm.js";import{s as Ht}from"./XClose-D5jBGhZu.js";import"./constants-B72Xmt_K.js";import"./index-CwathWr_.js";import"./ZoomOut-CoQZkFi6.js";import"./Key01-_uA23D4r.js";import"./auth-sGPw4pzN.js";import"./use-registry-connections-CB4pSGdn.js";import"./use-organization-settings-DXQvxmVp.js";import"./index-CzWF3J4h.js";import"./index-DHvUf48S.js";import"./index-0_QD3N3p.js";import"./popover-LegBHHPI.js";import"./tooltip-CZrkvlI-.js";import"./Check-DRzA-dpx.js";import"./SearchMd-aI0z5N9j.js";import"./use-mobile-DVBpVOpv.js";import"./use-create-virtual-mcp-DuiP1sA2.js";import"./use-navigate-to-agent-DHQynKWI.js";import"./hooks-CV3ote7A.js";import"./decopilot-sse-pool-H5PWohfg.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-qqWu133U.js";import"./Eye-C3PjUbDk.js";import"./use-org-auth-client-D8i1yzzN.js";import"./User01-BYDmkbvV.js";import"./use-collections-C3a6O1Kf.js";import"./AlertCircle-CWo2w3Rs.js";import"./SwitchHorizontal01-BMtwwLBl.js";import"./ArrowUpRight-Bmg39pV9.js";import"./Loading02-BtqTcbc-.js";import"./ChevronUp-BfATOATf.js";import"./Circle-BbviKruX.js";import"./Stars02-mQKhQQrM.js";import"./Copy01-0cR9vc8q.js";import"./DotsVertical-BYgPyTRF.js";import"./Globe01-UNsFBAF6.js";import"./FilterLines-AcRSKyYZ.js";import"./Globe04-Cvug-N8n.js";import"./HardDrive-hN1jZwmH.js";import"./LayoutLeft-P3T11G8U.js";import"./LinkExternal01-yVpYk0TA.js";import"./List-BDtpMLbg.js";import"./Monitor01-Ca-mpyh5.js";import"./Sun-4EkFOfwd.js";import"./Palette-DoccA0gP.js";import"./Play-DamNmHjz.js";import"./SearchLg-CgRpLS5P.js";import"./Shield01-DUr3YuOr.js";import"./Stars01-c5pA30a9.js";import"./Upload01-Bv5V53rT.js";import"./Users01-CbN3qRM8.js";import"./X-Cb1IaFkf.js";import"./Zap-_LBawPer.js";import"./label-CoVhr6uF.js";import"./alert-dialog-A1BqEuAN.js";const Bt=he({scopes:$e(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Gt(s){const e=P.c(46),{instance:n,onConfigure:i,onAuthenticate:a,onDelete:o,onToggleStatus:r}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=be(d),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==a?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=a,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==r?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>r(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>r(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=r,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==i?(S=()=>i(n),e[24]=n,e[25]=i,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Xt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let a;e[0]!==n.icon||e[1]!==n.title?(a=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=a):a=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let r;e[5]!==n||e[6]!==i?(r=()=>i(n),e[5]=n,e[6]=i,e[7]=r):r=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:13}),e[8]=d):d=e[8];let l;e[9]!==r?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,title:"Configure",children:d})}),e[9]=r,e[10]=l):l=e[10];let u;return e[11]!==a||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[a,o,l]}),e[11]=a,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function qt(s){const e=P.c(27),{instances:n,onConfigure:i,onAuthenticate:a,onDelete:o,onToggleStatus:r,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==x||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,c]}),e[8]=x,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==a||e[13]!==i||e[14]!==o||e[15]!==r){let j;e[17]!==a||e[18]!==i||e[19]!==o||e[20]!==r?(j=N=>t.jsx(q.Suspense,{fallback:t.jsx(Xt,{instance:N,onConfigure:i}),children:t.jsx(Gt,{instance:N,onConfigure:i,onAuthenticate:a,onDelete:o,onToggleStatus:r})},N.id),e[17]=a,e[18]=i,e[19]=o,e[20]=r,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=a,e[13]=i,e[14]=o,e[15]=r,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}function Kt(s,e=3){const n=new Map;for(const i of s){if(!i.isError)continue;const a=(i.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([i,a])=>({message:i,count:a})).sort((i,a)=>a.count-i.count).slice(0,e)}const Qt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Jt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Yt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Zt(s){const e=P.c(1),{connectionId:n,orgId:i,timeframe:a}=s,o=kt(),r=Jt(a),{data:d}=De({queryKey:ne.connectionActivity(n,a,i),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(d?.logs??[],r),u=l.data,x=l.totalCalls>0,p=Kt(d?.logs??[]),c=l.totalCalls>0?Math.round(l.totalErrors/l.totalCalls*100):0;let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=h):h=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),h]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Nt,{config:Yt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(Ct,{labelFormatter:ss}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(ts)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})}),p.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:["Top errors",c>0?` · ${c}% of calls failed`:""]}),t.jsx("ul",{className:"space-y-1.5",children:p.map(es)})]})]})}function es(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ts(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ss(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ns(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function os(s){const e=P.c(13),{connectionId:n}=s,[i,a]=q.useState("14d"),{org:o}=J();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=r):r=e[0];let d;e[1]!==i?(d=Qt.map(c=>t.jsx("button",{type:"button",onClick:()=>a(c.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=i,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ns,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==i?(x=t.jsx(q.Suspense,{fallback:u,children:t.jsx(Zt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function is(s){const e=P.c(15),{virtualMcp:n,org:i}=s,a=Y();let o;e[0]!==a||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{size:16}),e[4]=r):r=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==d||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,u]}),e[11]=o,e[12]=d,e[13]=l,e[14]=x):x=e[14],x}function as(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let a;if(e[0]!==i||e[1]!==n){let r;e[3]!==i?(r=d=>t.jsx(is,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=r):r=e[4],a=n.map(r),e[0]=i,e[1]=n,e[2]=a}else a=e[2];let o;return e[5]!==a?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=o):o=e[6],o}function rs(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const o=Tt(a);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==i.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(as,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=l):l=e[6],l}function ls(s){const e=P.c(31),{tools:n,connectionId:i,org:a}=s,o=Y(),{org:r}=J();let d;e[0]!==i||e[1]!==r.id||e[2]!==r.slug?(d={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=i,e[1]=r.id,e[2]=r.slug,e[3]=d):d=e[3];const l=_e(d),u=Ne(i);let x;e[4]!==u||e[5]!==i?(x=u?ke(u):i,e[4]=u,e[5]=i,e[6]=x):x=e[6];const p=x,[c,h]=q.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==a||e[11]!==c||e[12]!==n){const S=(n??[]).filter(cs),y=c.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==a?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=a,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==c?(j=t.jsx(Ot,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=re(f._meta);return t.jsxs(Mt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=a,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function cs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=r=>r.charAt(0).toUpperCase()+r.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),o=e[e.length-1];return a.length>=2&&o&&i.has(o)?[a.pop(),...a].join(" "):a.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function ds(s){const e=P.c(50),{tools:n,prompts:i,resources:a,connectionId:o,org:r}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const l=d;let u;e[2]!==a?(u=a===void 0?[]:a,e[2]=a,e[3]=u):u=e[3];const x=u,p=Y(),c=Ne(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==r?(v=function($){!o||!r||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=r,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==r||e[14]!==n?(j=o&&r&&n.some(xs),e[12]=o,e[13]=r,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==r||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ls,{tools:n,connectionId:o,org:r})}),e[31]=o,e[32]=N,e[33]=r,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(us):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(ms):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function ms(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function us(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function xs(s){return re(s._meta)}function ps(s){const e=P.c(13),{connection:n,displayTitle:i}=s,a=i??n.title;let o;e[0]!==n.icon||e[1]!==a?(o=t.jsx(oe,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=o):o=e[2];let r;e[3]!==a?(r=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=r):r=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let l;e[7]!==r||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[7]=r,e[8]=d,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function fs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:a}){const o=ce({control:s.control,name:"ui_type"}),r=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof r!="string"||!r)return!1;try{const c=new URL(r);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=d||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(G,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),"Authenticated via OAuth",t.jsx(Rt,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:a,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>c.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(G,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ht,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function hs(s){return s.command==="npx"}function gs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function js(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Re(s.connection_headers)){const i=s.connection_headers,a=We(i.envVars);if(hs(i)){const r=gs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:r,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const o=js(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function vs(s){let e,n=null,i=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Ge(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function bs({connection:s,connectionId:e,org:n,isUpdating:i,tools:a,prompts:o,resources:r,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),c=jt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=q.useState(null),[v,b]=q.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:a},C=qe(k,Wt),f=Ue({resolver:Fe(Be),values:fe(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const $=f.getValues(),D=vs($),F=h?.id??e;await x.update.mutateAsync({id:F,data:D}),f.reset($)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:$,tokenInfo:D,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!$){X.error(`Authentication failed: ${F}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:$}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:$}})}else await x.update.mutateAsync({id:m,data:{connection_token:$}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),X.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const D=await m.text();X.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),X.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),X.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...c}),t.jsx(mt,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ut,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(xt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(pt,{className:"text-base",children:h?.title??s.title}),t.jsx(ft,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(gt,{...f,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(G,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(G,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(fs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||i,className:"flex-1",children:i?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),c.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ps,{connection:s,displayTitle:(()=>{const m=d[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(os,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:d,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>c.requestDelete(m),onToggleStatus:async(m,$)=>{try{await x.update.mutateAsync({id:m.id,data:{status:$}}),X.success($==="active"?"Connection enabled":"Connection disabled")}catch{X.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=d[0]??s,$=m.title.replace(/\s*\(\d+\)\s*$/,""),D=d.length+1,F=`${$} (${D})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await nt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(rs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ds,{tools:a,prompts:o,resources:r,connectionId:e,org:n})})]})})]})})]})}function Ns(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:a,org:o}=ze(i),{org:r}=J(),d=ye();let l;s[2]!==a?(l={slug:a},s[2]=a,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",c=p||null;let h;s[4]!==r.id||s[5]!==r.slug||s[6]!==c?(h={connectionId:c,orgId:r.id,orgSlug:r.slug},s[4]=r.id,s[5]=r.slug,s[6]=c,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(ks):(x?.tools??[]).map(ws);e:{if(u.length<=1){j=A;break e}const z=new Set,U=[],m=Cs;for(const $ of u){const D=$.id===p?A:m($.tools);for(const F of D)z.has(F.name)||(z.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(_s),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(ys),s[25]=f,s[26]=w):w=s[26];const M=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==M||s[37]!==u?(O=t.jsx(bs,{org:o,connection:x,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:C,resources:M,siblings:u}),s[30]=d.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=M,s[37]=u,s[38]=O):O=s[38],O}function ys(s){return{name:s.name,description:s.description,uri:s.uri}}function _s(s){return{name:s.name,description:s.description}}function Cs(s){return(s??[]).map(Ss)}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ks(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ns,{})})}),s[0]=e):e=s[0],e}function bo(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ts,{}),s[0]=e):e=s[0],e}export{bo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as E,c as oe,j as t,P as Ye,i as ce,$ as be,b as _e,u as Ze,a as Ne,W as et,Y as tt,V as nt,J as st,I as ot,B as U,M as te,p as it,l as de,t as W,K as rt}from"./index-3wANCPRO.js";import{a as lt,b as De,g as at,e as ct}from"./extract-connection-data-DbUbdg9c.js";import{C as dt}from"./collection-display-button-DQpkHuY5.js";import{S as mt}from"./search-input-Ci8tEHW9.js";import{C as ut}from"./collection-tabs-Bm-3WSlA.js";import{u as pt,a as ke,g as ht,C as Ce}from"./connection-card-4bm-y1Gd.js";import{E as gt}from"./empty-state-CSfhHKVd.js";import{I as xt}from"./integration-icon-CZWFT3DW.js";import{P as ue}from"./index-CwathWr_.js";import{u as ft,D as jt}from"./use-delete-connection-DsBRsN5J.js";import{u as ye}from"./use-capability-56pwQuBl.js";import{u as yt}from"./use-infinite-scroll-CXObKcMM.js";import{u as Ct}from"./use-view-mode-2osL2HHr.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Le,f as Oe}from"./alert-dialog-A1BqEuAN.js";import{C as Fe}from"./checkbox-DtrpBIFz.js";import{e as Me,d as ze,c as Ve,a as Ee,b as Be,D as Ke}from"./dialog-D4tuLdKg.js";import{D as vt,a as St,c as bt,b as _t,d as Nt,e as Dt,f as kt}from"./drawer-Cl42OMuR.js";import{u as At}from"./use-mobile-DVBpVOpv.js";import{D as Ue,a as Re,c as He,d as re}from"./dropdown-menu-DnltYtFq.js";import{F as Q,b as J,c as Y,d as Z,e as ee,a as ve}from"./form-V_XI11Kc.js";import{I as ie}from"./input-NG03AkXE.js";import{a as wt,c as Tt,d as It,S as Pt,b as ae}from"./select-DVZc4E4V.js";import{T as $t}from"./textarea-5Pf25_as.js";import{b as We,u as Lt}from"./use-connection-DlA7SbYu.js";import{a as Ot}from"./use-virtual-mcp-DTthhqWL.js";import{u as Ft}from"./studio-tools-CTbP1rvS.js";import{al as Mt,ao as zt,O as Vt,N as Et}from"./agent-icon-Jbiz_GlE.js";import{n as ge}from"./XCircle-DYs03cv5.js";import{i as Xe}from"./DotsVertical-BYgPyTRF.js";import{s as qe}from"./Eye-C3PjUbDk.js";import{s as je}from"./Star01-CezMYimm.js";import{s as Ge}from"./Plus-DOMy9gvN.js";import{s as Qe}from"./Trash01-BPtww6NG.js";import{s as Je}from"./XClose-D5jBGhZu.js";import{i as pe,a as Se,E as Bt,c as Kt,p as Ut,b as Rt,d as Ht}from"./connection-form-helpers-Dvg-sl5J.js";import{a as Wt}from"./authenticate-and-persist-oauth-C9K-Bn9S.js";import"./use-mcp-client-CqQQWnQv.js";import"./constants-B72Xmt_K.js";import"./auth-sGPw4pzN.js";import"./SwitchHorizontal01-BMtwwLBl.js";import"./Check-DRzA-dpx.js";import"./List-BDtpMLbg.js";import"./tooltip-CZrkvlI-.js";import"./view-mode-toggle-BtNX-3na.js";import"./badge-zW2D6RON.js";import"./SearchMd-aI0z5N9j.js";import"./use-registry-connections-CB4pSGdn.js";import"./use-organization-settings-DXQvxmVp.js";import"./useInfiniteQuery-WADEvwcp.js";import"./card-w-ZXXB57.js";import"./sidebar-BbmkzDwj.js";import"./LayoutLeft-P3T11G8U.js";import"./X-Cb1IaFkf.js";import"./ChevronRight-0-moit0s.js";import"./Circle-BbviKruX.js";import"./label-CoVhr6uF.js";import"./ChevronDown-CLHpWdSG.js";import"./ChevronUp-BfATOATf.js";import"./use-collections-C3a6O1Kf.js";import"./AlertCircle-CWo2w3Rs.js";import"./Tool01-CbCiOrgD.js";import"./Settings02-BJM4-roS.js";import"./ArrowUpRight-Bmg39pV9.js";import"./ZapSquare-D3nXDwPD.js";import"./Users03-BflqY5Bb.js";import"./Loading02-BtqTcbc-.js";import"./CheckCircle-M6H5ZlJ0.js";import"./Stars02-mQKhQQrM.js";import"./Copy01-0cR9vc8q.js";import"./ZoomOut-CoQZkFi6.js";import"./Globe01-UNsFBAF6.js";import"./FilterLines-AcRSKyYZ.js";import"./Globe04-Cvug-N8n.js";import"./HardDrive-hN1jZwmH.js";import"./Key01-_uA23D4r.js";import"./LinkExternal01-yVpYk0TA.js";import"./Monitor01-Ca-mpyh5.js";import"./Sun-4EkFOfwd.js";import"./Palette-DoccA0gP.js";import"./Play-DamNmHjz.js";import"./SearchLg-CgRpLS5P.js";import"./Shield01-DUr3YuOr.js";import"./Stars01-c5pA30a9.js";import"./Upload01-Bv5V53rT.js";import"./User01-BYDmkbvV.js";import"./Users01-CbN3qRM8.js";import"./Zap-_LBawPer.js";import"./mcp-oauth-BnINg_mr.js";function Xt(f){const e=`deco-filters-${f}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(f){const e=oe.c(7),[n,p]=E.useState(f),[l,o]=E.useState(f?"desc":null);let i;e[0]!==l||e[1]!==n?(i=j=>{n!==j?(p(j),o("asc")):l==="asc"?o("desc"):l==="desc"&&(p(void 0),o(null))},e[0]=l,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==l||e[5]!==n?(h={sortKey:n,sortDirection:l,handleSort:g},e[3]=g,e[4]=l,e[5]=n,e[6]=h):h=e[6],h}function Gt(f){const e=oe.c(20),{namespace:n,resource:p,defaultSortKey:l,defaultViewMode:o}=f,i=l===void 0?"title":l,g=o===void 0?"table":o,[h,j]=E.useState(""),y=E.useDeferredValue(h),N=`${n}-${p}`,[b,a]=Xt(N),x=`mesh-${p}-filter-visible-${n}`;let m;e[0]!==x?(m=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=m):m=e[1];const[v,_]=E.useState(m);let D;e[2]!==x?(D=T=>{_(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=D):D=e[3];const L=D;let O;e[4]!==v||e[5]!==L?(O=()=>{L(!v)},e[4]=v,e[5]=L,e[6]=O):O=e[6];const s=O,[A,F]=Ct(`mesh-${p}-${n}`,g),{sortKey:M,sortDirection:w,handleSort:P}=qt(i),z=M;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==y||e[12]!==L||e[13]!==a||e[14]!==F||e[15]!==w||e[16]!==z||e[17]!==s||e[18]!==A?(C={search:h,searchTerm:y,setSearch:j,filters:b,setFilters:a,filterBarVisible:v,setFilterBarVisible:L,toggleFilterBar:s,viewMode:A,setViewMode:F,sortKey:z,sortDirection:w,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=y,e[12]=L,e[13]=a,e[14]=F,e[15]=w,e[16]=z,e[17]=s,e[18]=A,e[19]=C):C=e[19],C}function Qt(f){const e=oe.c(51),{group:n,onOpen:p,selectionMode:l,selectedIds:o,onToggleSelect:i}=f;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let j;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],j=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=j}else j=e[7];const y=j,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==l?(a=()=>l?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=l,e[20]=a):a=e[20];const x=l&&h&&"ring-2 ring-primary",m=l&&y&&!h&&"ring-1 ring-primary/50";let v;e[21]!==x||e[22]!==m?(v=de(x,m),e[21]=x,e[22]=m,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==l||e[30]!==y?(D=l?t.jsx(Fe,{checked:h?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(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]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=l,e[30]=y,e[31]=D):D=e[31];const L=l?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==L?(O=de("overflow-hidden transition-all duration-150 ease-out",L),e[32]=L,e[33]=O):O=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Yt,children:t.jsx(Xe,{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 F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{size:16}),e[37]=F):F=e[37];let M;e[38]!==A?(M=t.jsxs(Ue,{children:[s,t.jsx(He,{align:"end",onClick:Jt,children:t.jsxs(re,{onClick:A,children:[F,"Open"]})})]}),e[38]=A,e[39]=M):M=e[39];let w;e[40]!==O||e[41]!==M?(w=t.jsx("div",{className:O,children:M}),e[40]=O,e[41]=M,e[42]=w):w=e[42];let P;e[43]!==D||e[44]!==w?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=P):P=e[45];let z;return e[46]!==P||e[47]!==b||e[48]!==a||e[49]!==v?(z=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:b,onClick:a,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=a,e[49]=v,e[50]=z):z=e[50],z}function Jt(f){return f.stopPropagation()}function Yt(f){return f.stopPropagation()}function Zt(f){const e=oe.c(23),{count:n,total:p,canManage:l,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:j,onToggleStatus:y,onCancel:N}=f;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let a;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(a=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=a):a=e[6];let x;e[7]!==o||e[8]!==j?(x=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ge,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=j,e[9]=x):x=e[9];let m;e[10]!==l||e[11]!==h||e[12]!==y?(m=l&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=l,e[11]=h,e[12]=y,e[13]=m):m=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Je,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let D;return e[17]!==b||e[18]!==a||e[19]!==x||e[20]!==m||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:[b,a,x,m,_]})}),e[17]=b,e[18]=a,e[19]=x,e[20]=m,e[21]=_,e[22]=D):D=e[22],D}function en(f){const e=oe.c(25),{open:n,onOpenChange:p,agents:l,onConfirm:o}=f,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ve,{children:[t.jsx(Ee,{children:"Add to Agent"}),t.jsx(Be,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let j;e[1]!==l||e[2]!==i?(j=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(D=>t.jsxs("button",{type:"button",onClick:()=>g(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{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]=l,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let a;e[8]!==o||e[9]!==p||e[10]!==i?(a=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=a):a=e[11];let x;e[12]!==b||e[13]!==a?(x=t.jsx(U,{disabled:b,onClick:a,children:"Add"}),e[12]=b,e[13]=a,e[14]=x):x=e[14];let m;e[15]!==N||e[16]!==x?(m=t.jsxs(Ke,{children:[N,x]}),e[15]=N,e[16]=x,e[17]=m):m=e[17];let v;e[18]!==y||e[19]!==m?(v=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,y,m]}),e[18]=y,e[19]=m,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(Me,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function tn(f){const e=oe.c(20),{open:n,onOpenChange:p,count:l,onConfirm:o}=f,i=l!==1?"s":"";let g;e[0]!==l||e[1]!==i?(g=t.jsxs(Ae,{children:["Delete ",l," connection",i,"?"]}),e[0]=l,e[1]=i,e[2]=g):g=e[2];const h=l!==1?"s":"";let j;e[3]!==h?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=j):j=e[4];let y;e[5]!==g||e[6]!==j?(y=t.jsxs(Te,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=y):y=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ie,{children:"Cancel"}),e[8]=N):N=e[8];const b=l!==1?"s":"";let a;e[9]!==l||e[10]!==o||e[11]!==b?(a=t.jsxs(Pe,{children:[N,t.jsxs($e,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",b]})]}),e[9]=l,e[10]=o,e[11]=b,e[12]=a):a=e[12];let x;e[13]!==y||e[14]!==a?(x=t.jsxs(Le,{children:[y,a]}),e[13]=y,e[14]=a,e[15]=x):x=e[15];let m;return e[16]!==p||e[17]!==n||e[18]!==x?(m=t.jsx(Oe,{open:n,onOpenChange:p,children:x}),e[16]=p,e[17]=n,e[18]=x,e[19]=m):m=e[19],m}function nn(f){return f._registryId?.includes("community-registry")===!0}function sn(f){const e=oe.c(58),{item:n,canManage:p,allConnections:l,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=f,[j,y]=E.useState(!1),[N,b]=E.useState(null);let a,x;e[0]!==o||e[1]!==n?(a=De(n)??"",x=o.has(a),e[0]=o,e[1]=n,e[2]=a,e[3]=x):(a=e[2],x=e[3]);const m=x,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let L;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(L=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=L):L=e[6];const O=L;let s;if(e[7]!==l||e[8]!==a){let k;e[10]!==a?(k=se=>se.connection_type!=="VIRTUAL"&&se.app_name===a,e[10]=a,e[11]=k):k=e[11],s=l.filter(k),e[7]=l,e[8]=a,e[9]=s}else s=e[9];const A=s;let F;e[12]!==n?(F=nn(n),e[12]=n,e[13]=F):F=e[13];const M=F;let w,P;e[14]!==A||e[15]!==p||e[16]!==M||e[17]!==m||e[18]!==n||e[19]!==h||e[20]!==g?(w=()=>{if(m){const k=A[0];k&&g(k);return}p&&P()},P=()=>{M?(b("connect"),y(!0)):h(n)},e[14]=A,e[15]=p,e[16]=M,e[17]=m,e[18]=n,e[19]=h,e[20]=g,e[21]=w,e[22]=P):(w=e[21],P=e[22]);let z;e[23]!==n||e[24]!==h||e[25]!==N?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=z):z=e[26];const C=z;let T;e[27]!==D||e[28]!==O||e[29]!==_?(T={title:_,description:D,icon:O},e[27]=D,e[28]=O,e[29]=_,e[30]=T):T=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ge,{}),e[31]=G):G=e[31];let H;e[32]!==M||e[33]!==n._sourceIcon?(H=M&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=M,e[33]=n._sourceIcon,e[34]=H):H=e[34];let X;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==m||e[39]!==n.id?(X=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:k=>{k.stopPropagation(),P()},children:i===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=m,e[39]=n.id,e[40]=X):X=e[40];let c;e[41]!==H||e[42]!==X?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[41]=H,e[42]=X,e[43]=c):c=e[43];let S;e[44]!==w||e[45]!==c||e[46]!==T?(S=t.jsx(Ce,{connection:T,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:c}),e[44]=w,e[45]=c,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{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]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ie,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Le,{children:[V,t.jsxs(Pe,{children:[R,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let u;e[52]!==j||e[53]!==B?(u=t.jsx(Oe,{open:j,onOpenChange:y,children:B}),e[52]=j,e[53]=B,e[54]=u):u=e[54];let $;return e[55]!==S||e[56]!==u?($=t.jsxs(t.Fragment,{children:[S,u]}),e[55]=S,e[56]=u,e[57]=$):$=e[57],$}function on({listState:f,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:l,enabledRegistries:o}){const{org:i}=be(),g=it(),h=_e(),{data:j}=Ne.useSession(),y=We(),N=Lt(f),b=ft(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[m,v]=E.useState(new Set),_=m.size>0,[D,L]=E.useState(!1),[O,s]=E.useState(!1),[A,F]=E.useState(null),M=Ot(),w=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ht(w),z=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=ke(o,f.searchTerm),G=T.items,H=yt(T.loadMore,T.hasMore,T.isLoadingMore),X=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),c=l==="ALL"||o.some(r=>r.id===l)?l:"ALL",S=f.search.length>0,V=e==="all"||S?G.filter(r=>{if(c!=="ALL"&&r._registryId!==c)return!1;if(S){const d=De(r);if(d&&X.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=ct(r,i.id,j.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,q=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!q){W.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:ne}=await y.create.mutateAsync(d),le=await Wt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await g.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),$(),W.success("Authentication successful")}W.success("Connected successfully")}catch(d){W.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},u=Ft(),$=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},k=async()=>{L(!1);const r=[...m];te("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await u.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}$(),W.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await y.update.mutateAsync({id:r,data:{status:d}}),$(),W.success(d==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},xe=async r=>{const d=[...m];te("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await y.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}$(),W.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},me=async r=>{const d=M.find(q=>q.id===r);if(!d)return;te("connections_bulk_add_to_agent",{agent_id:r,count:m.size});const K=new Set(d.connections.map(q=>q.connection_id)),I=[...m].filter(q=>!K.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){W.info("All selected connections are already in that agent");return}try{await u.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:q=>{const ne=q.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),W.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...b}),t.jsx(tn,{open:D,onOpenChange:L,count:m.size,onConfirm:k}),t.jsx(en,{open:O,onOpenChange:s,agents:M,onConfirm:me}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&w.length===0:e==="all"?V.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:a?"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:[R.map(r=>{if(r.type==="group")return t.jsx(Qt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:m,onToggleSelect:z},r.key);const d=r.connection,K=m.has(d.id);return t.jsx(Ce,{connection:d,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?z(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:K,onCheckedChange:()=>z(d.id),onClick:I=>I.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(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(re,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}})},children:[t.jsx(qe,{size:16}),"Open"]}),(a||x)&&t.jsxs(re,{onClick:I=>{I.stopPropagation(),z(d.id)},children:[t.jsx(zt,{size:16}),"Select"]}),a&&(d.status==="active"?t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Vt,{size:16}),"Disable"]}):t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Et,{size:16}),"Enable"]})),a&&t.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Qe,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(sn,{item:r,canManage:a,allConnections:N,connectedAppNames:X,connectingItemId:A,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Zt,{count:m.size,total:w.length,canManage:a,canManageAgents:x,onSelectAll:()=>{v(new Set(w.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>L(!0),onAddToAgent:()=>s(!0),onToggleStatus:xe,onCancel:C})]})}function rn(){const{org:f}=be(),e=_e(),n=Ze({strict:!1}),{data:p}=Ne.useSession(),{stdioEnabled:l}=et(),o=At(),{granted:i}=ye("connections:manage"),g=Gt({namespace:f.slug,resource:"connections"}),h=We(),[j,y]=tt(nt.connectionsTab(f.slug),c=>n.tab==="all"||n.tab==="connected"?n.tab:c??"all"),[N,b]=E.useState("ALL"),[a,x]=E.useState("ALL"),[m,v]=E.useState("ALL"),_=pt(),L=ke(_,g.searchTerm).items,O=g.search!==g.searchTerm,s=st({resolver:ot(Kt),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"),F=s.watch("connection_url"),M=s.watch("npx_package"),w=pe({uiType:A,connectionUrl:F??"",npxPackage:M??""})??Se({uiType:A,connectionUrl:F??"",registryItems:L}),P=i&&n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},T=async c=>{let S,V=null,R=null,B=null;c.ui_type==="NPX"?(S="STDIO",V="",B=Rt(c.npx_package||"",c.env_vars||[])):c.ui_type==="STDIO"?(S="STDIO",V="",B=Ht(c.stdio_command||"",c.stdio_args||"",c.stdio_cwd,c.env_vars||[])):(S=c.ui_type,V=c.connection_url||"",R=c.connection_token||null);const u=lt("conn");te("connection_custom_created",{connection_type:S,ui_type:c.ui_type}),await h.create.mutateAsync({id:u,title:c.title,description:c.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:c.icon??null,app_name:null,app_id:null,connection_headers:B,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:f.slug,appSlug:he({app_name:null,connection_url:V,title:c.title,id:u})}})},G=c=>{c||(P&&C(),s.reset())},H=c=>{const S=c.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,u=k=>{if(k&&(!V&&!s.getValues("title").trim()&&k.title&&s.setValue("title",k.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&k.description&&s.setValue("description",k.description,{shouldDirty:!1}),!B&&k.envVarKeys?.length)){const se=s.getValues("env_vars")??[],xe=new Set(se.map(r=>r.key)),me=k.envVarKeys.filter(r=>!xe.has(r));me.length>0&&s.setValue("env_vars",[...se,...me.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},$=Ut(S);if($&&l){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",$.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),u(pe({uiType:"NPX",npxPackage:$.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const k=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",k,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),u(pe({uiType:k,connectionUrl:S})??Se({uiType:k,connectionUrl:S,registryItems:L}));return}A==="NPX"&&u(pe({uiType:"NPX",npxPackage:S}))},X=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:z,children:[t.jsx(Ge,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const c="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(wt,{value:u.value,onValueChange:u.onChange,children:[t.jsx(Z,{children:t.jsx(Tt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{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(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),A==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("npx_package",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...u,value:u.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...u,value:u.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:u.value??[],onChange:u.onChange})}),t.jsx(ee,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("connection_url",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:w?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...u,value:u.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(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...u})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx($t,{placeholder:"A brief description of this connection",rows:3,...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),B=P;return o?t.jsx(vt,{open:B,onOpenChange:G,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{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(_t,{children:c}),t.jsx(Nt,{className:"mt-1",children:S})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Je,{size:16})})})]})}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Me,{open:B,onOpenChange:G,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Ve,{children:[t.jsx(Ee,{children:c}),t.jsx(Be,{children:S})]}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ke,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.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(mt,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:c=>{c.key==="Escape"&&(g.setSearch(""),c.target.blur())}}),t.jsx(dt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.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:N,onChange:c=>b(c||"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:a,onChange:c=>x(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:m,onChange:c=>v(c||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(c=>({id:c.id,label:c.id.includes("community-registry")?"Community MCP Registry":c.title}))]}]:[]]})]}),X]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:c=>{const S=c;S!==j&&te("connections_page_tab_changed",{to_tab:S}),y(S)}}),t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:O?.5:1,transition:O?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:O?"none":"auto"},children:t.jsx(on,{listState:g,activeTab:j,typeFilter:N,statusFilter:a,registryFilter:m,enabledRegistries:_})})})]})})})]})})}function Ks(){const f=oe.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),f[0]=e):e=f[0],e}export{Ks as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as Z,r as u,j as r,i as se,B as he,dZ as Mt,aL as Dt,aR as ie,d_ as Rt,d$ as Pt,e0 as Et,e1 as kt,bK as Tt,e2 as Ot,e3 as qe,aN as At,e4 as Lt,e5 as Ft,e6 as It,e7 as $t,e8 as _t,e9 as zt,ea as Wt,eb as Gt,ec as Kt,l as ae,p as Bt,t as W,K as $e}from"./index-3wANCPRO.js";import{F as Vt,l as Ut}from"./index-D1Il2d7T.js";import{i as qt,aC as Qt,aD as Ht,aE as ue,aF as Xt,aa as _e}from"./agent-icon-Jbiz_GlE.js";import{a as Jt}from"./Tool01-CbCiOrgD.js";import{s as Yt}from"./XClose-D5jBGhZu.js";import{A as Zt}from"./automation-runs-2FK11Uq8.js";import{T as ze,a as We,b as Ge}from"./tooltip-CZrkvlI-.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-A1BqEuAN.js";import{a as cn}from"./chat-context-BE6mo9bu.js";import{u as dn}from"./shell-layout-Dm40raSF.js";import{s as fe,a as Ke,f as un}from"./index-BNFGcJv4.js";import{a as fn,b as mn,c as pn,D as xn,d as hn,e as gn}from"./dialog-D4tuLdKg.js";import{I as Be}from"./input-NG03AkXE.js";import{t as vn}from"./ChevronDown-CLHpWdSG.js";import{i as yn}from"./ChevronRight-0-moit0s.js";import{a as Cn}from"./ZoomOut-CoQZkFi6.js";import{E as wn,v as Ve,w as Ce,x as bn,y as jn,z as Nn,A as V,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-IJbt2d9X.js";import"./AlertCircle-CWo2w3Rs.js";import"./SwitchHorizontal01-BMtwwLBl.js";import"./Settings02-BJM4-roS.js";import"./XCircle-DYs03cv5.js";import"./ArrowUpRight-Bmg39pV9.js";import"./ZapSquare-D3nXDwPD.js";import"./Users03-BflqY5Bb.js";import"./Loading02-BtqTcbc-.js";import"./CheckCircle-M6H5ZlJ0.js";import"./Check-DRzA-dpx.js";import"./ChevronUp-BfATOATf.js";import"./Circle-BbviKruX.js";import"./Stars02-mQKhQQrM.js";import"./Copy01-0cR9vc8q.js";import"./DotsVertical-BYgPyTRF.js";import"./Globe01-UNsFBAF6.js";import"./Eye-C3PjUbDk.js";import"./FilterLines-AcRSKyYZ.js";import"./Star01-CezMYimm.js";import"./Globe04-Cvug-N8n.js";import"./HardDrive-hN1jZwmH.js";import"./Key01-_uA23D4r.js";import"./LayoutLeft-P3T11G8U.js";import"./LinkExternal01-yVpYk0TA.js";import"./List-BDtpMLbg.js";import"./Monitor01-Ca-mpyh5.js";import"./Sun-4EkFOfwd.js";import"./Palette-DoccA0gP.js";import"./Play-DamNmHjz.js";import"./Plus-DOMy9gvN.js";import"./SearchLg-CgRpLS5P.js";import"./SearchMd-aI0z5N9j.js";import"./Shield01-DUr3YuOr.js";import"./Stars01-c5pA30a9.js";import"./Trash01-BPtww6NG.js";import"./Upload01-Bv5V53rT.js";import"./User01-BYDmkbvV.js";import"./Users01-CbN3qRM8.js";import"./X-Cb1IaFkf.js";import"./Zap-_LBawPer.js";import"./select-DVZc4E4V.js";import"./useInfiniteQuery-WADEvwcp.js";import"./use-infinite-scroll-CXObKcMM.js";import"./use-connection-DlA7SbYu.js";import"./use-collections-C3a6O1Kf.js";import"./use-mcp-client-CqQQWnQv.js";import"./constants-B72Xmt_K.js";import"./auth-sGPw4pzN.js";import"./use-virtual-mcp-DTthhqWL.js";import"./card-w-ZXXB57.js";import"./sidebar-BbmkzDwj.js";import"./use-mobile-DVBpVOpv.js";import"./table-B2Fi-xgN.js";import"./empty-state-CSfhHKVd.js";import"./use-members-DQRLt-ZP.js";import"./use-org-auth-client-D8i1yzzN.js";import"./use-clock-tick-D0StcXXM.js";import"./use-automations-Btrbiz8v.js";import"./studio-tools-CTbP1rvS.js";import"./useSuspenseInfiniteQuery-fFFo_5V2.js";import"./badge-zW2D6RON.js";import"./checkbox-DtrpBIFz.js";import"./command-BO3Cnpvg.js";import"./index-0_QD3N3p.js";import"./popover-LegBHHPI.js";import"./avatar-DCYC0Ovl.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DUBRfsw_.js";import"./file-type-icon-CzWNCoZC.js";import"./tab-id-DznSzCvK.js";import"./monaco-editor-PvgfmQvG.js";import"./delay-CnY5UFtP.js";import"./types-CN46hG-C.js";import"./hooks-CV3ote7A.js";import"./decopilot-sse-pool-H5PWohfg.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-CZWFT3DW.js";import"./use-navigate-to-agent-DHQynKWI.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-5VgIENjN.js";import"./form-V_XI11Kc.js";import"./label-CoVhr6uF.js";import"./autosend-DRXerSlp.js";import"./use-ai-providers-CqbJz7ty.js";import"./use-decopilot-events-BRR71e9n.js";import"./use-organization-settings-DXQvxmVp.js";import"./required-auth-layout-DjSRL58t.js";import"./use-org-sso-4OxOQasz.js";import"./drawer-Cl42OMuR.js";import"./collection-search-BwSp_Aw4.js";import"./tabs-D3BMQa5m.js";import"./toggle-group-Bp7LVOg4.js";import"./agent-capabilities-Beg1Tahi.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-4bm-y1Gd.js";import"./use-registry-connections-CB4pSGdn.js";import"./extract-connection-data-DbUbdg9c.js";import"./collection-tabs-Bm-3WSlA.js";import"./textarea-5Pf25_as.js";import"./connection-form-helpers-Dvg-sl5J.js";import"./authenticate-and-persist-oauth-C9K-Bn9S.js";import"./mcp-oauth-BnINg_mr.js";import"./connect-desktop-dialog-eXpxo9qL.js";import"./select-model-CLhsRP_l.js";import"./skeleton-_zr7HJMo.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CHWS1FIf.js";import"./dropdown-menu-DnltYtFq.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DKcljOhr.js";import"./toolbar-ABPXS5Vo.js";import"./use-mcp-tools-BBo1CVh9.js";import"./use-capability-56pwQuBl.js";import"./tools-list-Cj6pWwiB.js";import"./switch-OeBXOHbU.js";import"./use-debounced-autosave-BcTFLZWq.js";import"./index-CwathWr_.js";import"./search-input-Ci8tEHW9.js";import"./github-repo-picker-D2aJRbrv.js";import"./use-debounced-value-DZMfEQVf.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-7z_yVxAY.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-CnZPkn7R.js";import"./get-initials-D-f_fDFw.js";import"./calendar-BUXe1qGD.js";import"./toolbar-icon-button-K5Db26Ta.js";import"./use-file-configs-B09v-Tdk.js";import"./automation-list-row-DX0hA2e6.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(i),C=Pn[a];i!==B&&(U(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let T;e[9]!==C.description?(T=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("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-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("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-default items-center gap-2 rounded-sm 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",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:C}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=V(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function es({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{setChatOpen:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:wn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Oe(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||C(n=>[...n,t]),Oe(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_(!0),z({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",V(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[U.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:U.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Vt,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":V(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{es as FileExplorer};
|