@decocms/mesh 2.135.0 → 2.136.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-BqSf9XUV.js → AlertCircle-BmterM6-.js} +1 -1
- package/dist/client/assets/{AlignLeft-fmMf4Dhk.js → AlignLeft-D-24Asic.js} +1 -1
- package/dist/client/assets/{ArrowDown-C1XwJGei.js → ArrowDown-DhmtNBCn.js} +1 -1
- package/dist/client/assets/{ArrowLeft-v0wYt8Zz.js → ArrowLeft-BwnRcCxk.js} +1 -1
- package/dist/client/assets/{ArrowUp-D96x2aXm.js → ArrowUp-B2lliNjJ.js} +1 -1
- package/dist/client/assets/{Check-CBQI4sX_.js → Check-Dy5Jwsdl.js} +1 -1
- package/dist/client/assets/{CheckCircle-c8wiOGE1.js → CheckCircle-DCJamcsS.js} +1 -1
- package/dist/client/assets/{CheckDone01-BTaEYg_h.js → CheckDone01-BMlUtSk0.js} +1 -1
- package/dist/client/assets/{CheckVerified02-CPJrheMw.js → CheckVerified02-BEvXxeXZ.js} +1 -1
- package/dist/client/assets/{ChevronDown-sLr8XVsl.js → ChevronDown-B8UJn4iH.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Bb-Z1INZ.js → ChevronLeft-LqDMtl3T.js} +1 -1
- package/dist/client/assets/{ChevronRight-DvHc-b9M.js → ChevronRight-UHmTzu6U.js} +1 -1
- package/dist/client/assets/{Clock-CHIf9oFX.js → Clock-CHKtyQRJ.js} +1 -1
- package/dist/client/assets/{Code01-dJCW2bE8.js → Code01-Ce_GLriH.js} +1 -1
- package/dist/client/assets/{Container-B6Xs6_xK.js → Container-nefPC-Vi.js} +1 -1
- package/dist/client/assets/{Copy01-DZUQRIVw.js → Copy01-DTrKcR-Q.js} +1 -1
- package/dist/client/assets/{Dataflow03-C15CIhqP.js → Dataflow03-DMAzBi98.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-BTto-v_2.js → DotsHorizontal-BmF1jyTg.js} +1 -1
- package/dist/client/assets/{DotsVertical-CJ3pBFjL.js → DotsVertical-N7qtMw5m.js} +1 -1
- package/dist/client/assets/{Download01-BOSik_M0.js → Download01-C8dWfeAI.js} +1 -1
- package/dist/client/assets/{Edit01-Dm0PZjiv.js → Edit01-CMeQdBcS.js} +1 -1
- package/dist/client/assets/{Edit05-DhF5NlD_.js → Edit05-DZ_UN_S5.js} +1 -1
- package/dist/client/assets/{Eye-BR_9-9sx.js → Eye-DxLOh0i-.js} +1 -1
- package/dist/client/assets/{File02-DAE7GGwr.js → File02-vPAwJvd9.js} +1 -1
- package/dist/client/assets/{File06-DNepDitQ.js → File06-CJFI46Rj.js} +1 -1
- package/dist/client/assets/{FilterLines-CQm34GP3.js → FilterLines-BfBD1RVS.js} +1 -1
- package/dist/client/assets/{Globe01-BfbxrBLS.js → Globe01-CFu5KWUK.js} +1 -1
- package/dist/client/assets/{Globe02-DSMumXCe.js → Globe02-KBI1AO62.js} +1 -1
- package/dist/client/assets/{Grid01-DxL3VpUb.js → Grid01-CqnSySeu.js} +1 -1
- package/dist/client/assets/{Hash02-CFuGdZAM.js → Hash02-DJ4pr-VX.js} +1 -1
- package/dist/client/assets/{Home02-BVRQCIR4.js → Home02-Do5D--q6.js} +1 -1
- package/dist/client/assets/{Image01-CHnBumwc.js → Image01-C8E_92eh.js} +1 -1
- package/dist/client/assets/{Inbox01-ImXIGZnT.js → Inbox01-DFatNHSu.js} +1 -1
- package/dist/client/assets/{InfoCircle-C3KOURux.js → InfoCircle-BbDPfNIr.js} +1 -1
- package/dist/client/assets/{Key01-gRJDeefs.js → Key01-5M9GOooO.js} +1 -1
- package/dist/client/assets/{LayersTwo01-D_3HSgdj.js → LayersTwo01-D3z_72X4.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D7CckYm4.js → LayoutLeft-CuouUkb7.js} +1 -1
- package/dist/client/assets/{Link01-dup1fxbM.js → Link01-phTHWMEc.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DSo4qVUo.js → LinkExternal01-3GykVej2.js} +1 -1
- package/dist/client/assets/{List-C6WR2hvg.js → List-C81A8jh_.js} +1 -1
- package/dist/client/assets/{Loading01-9Lg_Mx7W.js → Loading01-BWjBCSBL.js} +1 -1
- package/dist/client/assets/{Lock01-D6q_Pfp1.js → Lock01-BF4OPECE.js} +1 -1
- package/dist/client/assets/{Play-BGC0DAwr.js → Play-CGCsuB7w.js} +1 -1
- package/dist/client/assets/{Plus-BnMd-Nlg.js → Plus-CK3qvOs-.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CzWuABhj.js → RefreshCcw01-DCU1xktc.js} +1 -1
- package/dist/client/assets/{Save01-CPtH6rzJ.js → Save01-sMmuMs88.js} +1 -1
- package/dist/client/assets/{SearchMd-Br2lRaPk.js → SearchMd-CpD1Xdqo.js} +1 -1
- package/dist/client/assets/{Settings01-CjytruXR.js → Settings01-Bhz_Vu7B.js} +1 -1
- package/dist/client/assets/{Shield01-XEBn-es0.js → Shield01-B4VkgvZ4.js} +1 -1
- package/dist/client/assets/{Terminal-CWZ1oaiF.js → Terminal-EynP_hYL.js} +1 -1
- package/dist/client/assets/{Trash01-DTIwE-5T.js → Trash01-p1zJKNMp.js} +1 -1
- package/dist/client/assets/{Upload01-BiL8UuQ_.js → Upload01-CuSBdknv.js} +1 -1
- package/dist/client/assets/{Users03-D9nwvJXd.js → Users03-C4-0uA3w.js} +1 -1
- package/dist/client/assets/{X-B_qRWJ2C.js → X-C0j62Xtl.js} +1 -1
- package/dist/client/assets/{XCircle-B4yxlakR.js → XCircle-BtpMj0Vx.js} +1 -1
- package/dist/client/assets/{XClose-ChV_2xLJ.js → XClose-BoXt6_S8.js} +1 -1
- package/dist/client/assets/{Zap-DywL0ofa.js → Zap-D7Nzarh3.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-CR5wYkAd.js → agent-connections-preview-CHU0g32U.js} +1 -1
- package/dist/client/assets/agent-detail-DURsxgC5.js +2 -0
- package/dist/client/assets/agents-Cl7pGBMM.js +1 -0
- package/dist/client/assets/{alert-dialog-D90wrdGx.js → alert-dialog-D1XudKG9.js} +2 -2
- package/dist/client/assets/{auth-catchall-D2-i9TBI.js → auth-catchall-BgPC7rSe.js} +1 -1
- package/dist/client/assets/{avatar-D4ALUDCI.js → avatar-DNxsCl6r.js} +1 -1
- package/dist/client/assets/{badge-DuS2OMla.js → badge-D8RzvYJ4.js} +1 -1
- package/dist/client/assets/{binder-BCMoHYJm.js → binder-Blih3Yob.js} +1 -1
- package/dist/client/assets/{breadcrumb-g5L8PoZQ.js → breadcrumb-N-YM-0qC.js} +1 -1
- package/dist/client/assets/{card-Cj-GkUHD.js → card-DpIJfsV8.js} +1 -1
- package/dist/client/assets/{chart-Bmp1PhEI.js → chart-ClRGWH0O.js} +1 -1
- package/dist/client/assets/{checkbox-CKtularS.js → checkbox-CUOTkCKW.js} +1 -1
- package/dist/client/assets/{circle-alert-CrasxNEk.js → circle-alert-D8ryfTOx.js} +1 -1
- package/dist/client/assets/{collapsible-Dz2sA23f.js → collapsible-CpgZSwBN.js} +1 -1
- package/dist/client/assets/{collection-detail-B0kCQWSA.js → collection-detail-B3RGhDtS.js} +2 -2
- package/dist/client/assets/collection-display-button-DrtKZPsB.js +1 -0
- package/dist/client/assets/{collection-search-Dslk4ok0.js → collection-search-Cq4rjP0Z.js} +1 -1
- package/dist/client/assets/collection-tab-CDCwjyV8.js +1 -0
- package/dist/client/assets/collection-table-wrapper-CyGYWMWl.js +1 -0
- package/dist/client/assets/{collection-tabs-eMWLSkiq.js → collection-tabs-r7GKXx3H.js} +1 -1
- package/dist/client/assets/{command-RQQRkz7x.js → command-DazlgUs5.js} +1 -1
- package/dist/client/assets/{connect-DEIJWaRW.js → connect-CvX0kEdi.js} +1 -1
- package/dist/client/assets/{connection-card-M2mu32Xr.js → connection-card-BEmi4FHw.js} +1 -1
- package/dist/client/assets/connection-detail-CJDHlEwZ.js +1 -0
- package/dist/client/assets/connections-DZjwaIPT.js +1 -0
- package/dist/client/assets/{constants-CvFlNMMf.js → constants-BLSLjUCX.js} +1 -1
- package/dist/client/assets/constants-D_mJYCD9.js +1 -0
- package/dist/client/assets/{create-organization-dialog-Cy9g6fXy.js → create-organization-dialog-_OZHP19d.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BokLXtCa.js → create-project-dialog-CBSHMrrx.js} +1 -1
- package/dist/client/assets/{danger-BRBu-XbG.js → danger-CPETFW7T.js} +1 -1
- package/dist/client/assets/{danger-zone-CW-YKRlc.js → danger-zone-LxdCiZtW.js} +1 -1
- package/dist/client/assets/{decopilot-events-Bt8Q6ljY.js → decopilot-events-BEPzMc6y.js} +1 -1
- package/dist/client/assets/{dependencies-EgZz5h4q.js → dependencies-Cz-sRh-1.js} +1 -1
- package/dist/client/assets/{dialog-DXvsnaeO.js → dialog-BEh9NHdw.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CgkGkmVE.js → dropdown-menu-BBy53YtY.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Bh-Sy3yI.js → dynamic-plugin-layout-p6ER6wNw.js} +1 -1
- package/dist/client/assets/{editable-task-title-B-3SGsGo.js → editable-task-title-CQx9B12m.js} +1 -1
- package/dist/client/assets/{empty-state-K_49Yi3c.js → empty-state-Cd-Y6dcy.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DtCYaIFM.js → env-vars-editor-CFN3JqN6.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DuIP9X1x.js → extract-connection-data-Bjwt_XIu.js} +1 -1
- package/dist/client/assets/{file-browser-D6y0-s-B.js → file-browser-B3GXvhIi.js} +2 -2
- package/dist/client/assets/{form-BMyUyHR8.js → form-DKOen-4i.js} +1 -1
- package/dist/client/assets/{general-DPne5Rst.js → general-i_n7wxur.js} +1 -1
- package/dist/client/assets/{grid-view-DWY5vx7E.js → grid-view-1tJniq0A.js} +1 -1
- package/dist/client/assets/{home-BLbBKv2q.js → home-B-4A2LlA.js} +1 -1
- package/dist/client/assets/{icon-picker-XNuq6Ojb.js → icon-picker-BXWmqDNl.js} +1 -1
- package/dist/client/assets/{index-BVNGR9tO.js → index-9MR1Aak3.js} +1 -1
- package/dist/client/assets/{index-BVkROdsW.js → index-Bxe5mObN.js} +1 -1
- package/dist/client/assets/{index-Bzupbb1x.js → index-C6W9eJZm.js} +1 -1
- package/dist/client/assets/{index-CpowEWO4.js → index-C79VipEf.js} +1 -1
- package/dist/client/assets/{index-Bk2D_7VR.js → index-CrfXnuko.js} +1 -1
- package/dist/client/assets/{index-YSA_3gRo.js → index-D3pPaynQ.js} +3 -3
- package/dist/client/assets/index-D6E08wfB.css +1 -0
- package/dist/client/assets/{index-BlLYz5FA.js → index-DVmCBhSl.js} +1 -1
- package/dist/client/assets/{index-ChgCwqm9.js → index-DYkmX0JZ.js} +1 -1
- package/dist/client/assets/{index-CgikKIzX.js → index-xQ2t379n.js} +3 -3
- package/dist/client/assets/{infiniteQueryObserver-DsXqsvOO.js → infiniteQueryObserver-bwcxH-lX.js} +1 -1
- package/dist/client/assets/{input-BT1GzEWi.js → input-CquIDQAg.js} +1 -1
- package/dist/client/assets/{integration-icon-B4kJo2_s.js → integration-icon-CyNzGslP.js} +1 -1
- package/dist/client/assets/{label-C45a6iTA.js → label-DgKgIZIr.js} +1 -1
- package/dist/client/assets/{layout-8RHk-XUu.js → layout-BaoRfV41.js} +1 -1
- package/dist/client/assets/{layout-i-b38NBH.js → layout-Dknw5WOk.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DSrv9tDi.js → localstorage-keys-BVjc41qz.js} +1 -1
- package/dist/client/assets/{login-CVyMi6pm.js → login-CbUqOEDM.js} +1 -1
- package/dist/client/assets/{markdown-D5PO6M9Q.js → markdown-Ba8nOSsK.js} +1 -1
- package/dist/client/assets/mcp-app-renderer-DYp1_awD.js +11 -0
- package/dist/client/assets/{mcp-oauth-BlOxWyfu.js → mcp-oauth-BKgRq621.js} +1 -1
- package/dist/client/assets/{mcp-server-card-VOiv-alx.js → mcp-server-card-CpB9f-pn.js} +1 -1
- package/dist/client/assets/mcp-server-detail-CCUSuXBZ.js +2 -0
- package/dist/client/assets/members-C3L37RaV.js +3 -0
- package/dist/client/assets/{monaco-editor-Dr7dUeu1.js → monaco-editor-Bqq988E3.js} +1 -1
- package/dist/client/assets/{monitoring-ByAenRo_.js → monitoring-Cw8c9SQ5.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-Bzo9Gn9E.js → monitoring-dashboard-edit-BMa2OOFc.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-gYXt6fDh.js → monitoring-dashboard-view-CmbMs5N1.js} +1 -1
- package/dist/client/assets/{oauth-callback-sQ2SwOuh.js → oauth-callback-3thxiCVs.js} +1 -1
- package/dist/client/assets/{page-CznSm6bI.js → page-D6s6DLQp.js} +1 -1
- package/dist/client/assets/{page-DbCpTdbi.js → page-DojbxRSJ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-C8aP3uOY.js → plugin-empty-state-CgwqeTLL.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-COcpG8Q-.js → plugin-empty-state-n7cn669C.js} +1 -1
- package/dist/client/assets/{plugin-header-crfuDJWj.js → plugin-header-AGaevBZn.js} +1 -1
- package/dist/client/assets/{plugin-header-DWxvwZb6.js → plugin-header-BxEyDthP.js} +1 -1
- package/dist/client/assets/plugins-DPuuPP05.js +1 -0
- package/dist/client/assets/popover-BGz1EQnh.js +1 -0
- package/dist/client/assets/project-app-view-B5525387.js +1 -0
- package/dist/client/assets/{project-layout-Ns_WJXXt.js → project-layout-DDwGJ0ig.js} +1 -1
- package/dist/client/assets/{project-plugins-CF5_VX1i.js → project-plugins-R_POmKuz.js} +1 -1
- package/dist/client/assets/{projects-list-8MTtLmHN.js → projects-list-DvHzim4C.js} +1 -1
- package/dist/client/assets/{readme-viewer-BJA2EnoQ.js → readme-viewer-CSo2KaPk.js} +1 -1
- package/dist/client/assets/{registry-layout-DOBt_uIJ.js → registry-layout-BRpD6JKO.js} +1 -1
- package/dist/client/assets/{registry-utils-BapNTecL.js → registry-utils-Cjdxmsng.js} +1 -1
- package/dist/client/assets/{reports-layout-DCjyOG8T.js → reports-layout-WypzA6IP.js} +1 -1
- package/dist/client/assets/{reset-password-Bf0C1T_u.js → reset-password-C2yglusd.js} +1 -1
- package/dist/client/assets/{resizable-DasgSTKU.js → resizable-BeoLLDMu.js} +1 -1
- package/dist/client/assets/{save-actions-vRwzyds-.js → save-actions-OW6B8GGT.js} +1 -1
- package/dist/client/assets/{scroll-area-B1PFdc0L.js → scroll-area-BlV5UvCB.js} +1 -1
- package/dist/client/assets/{select-B8htoZV8.js → select-CDsJtNMV.js} +1 -1
- package/dist/client/assets/{shell-layout-DL42jtyU.js → shell-layout-DfbBuM37.js} +2 -2
- package/dist/client/assets/{sidebar-settings-D4yFK0ER.js → sidebar-settings-CYmJoaNT.js} +1 -1
- package/dist/client/assets/{skeleton-DO02PARZ.js → skeleton-Ct9swv0n.js} +1 -1
- package/dist/client/assets/{spinner-BpG7RgTa.js → spinner-DfUcLZCl.js} +1 -1
- package/dist/client/assets/{store-invite-BFsXYhOH.js → store-invite-ZCHtOCWs.js} +1 -1
- package/dist/client/assets/{switch-Ci3hf_qU.js → switch-a3WrSRQb.js} +1 -1
- package/dist/client/assets/{table-7t3Ngqct.js → table-BCfVNRpI.js} +1 -1
- package/dist/client/assets/{tabs-CfY-0viT.js → tabs-DN8uQx_4.js} +1 -1
- package/dist/client/assets/tasks-Bgtg3aZ6.js +1 -0
- package/dist/client/assets/{tasks-panel-JfkvqYp-.js → tasks-panel-Bcd4i-z8.js} +1 -1
- package/dist/client/assets/{textarea-C9UUVIil.js → textarea-BvEkv28R.js} +1 -1
- package/dist/client/assets/{time-range-picker-0Iclb7jG.js → time-range-picker-CTYo_Gy_.js} +1 -1
- package/dist/client/assets/{toggle-group-BVdBhpTO.js → toggle-group-BuwLTYBs.js} +1 -1
- package/dist/client/assets/tools-list-DKmevE2X.js +1 -0
- package/dist/client/assets/{tooltip-iSvWdfhX.js → tooltip-B6yKYOIf.js} +1 -1
- package/dist/client/assets/{topbar-portal-TVMhcJUX.js → topbar-portal-CUBonFlI.js} +1 -1
- package/dist/client/assets/{types-DA9O3-4Z.js → types-CnPYT6I7.js} +1 -1
- package/dist/client/assets/{use-binding-BrV6OHbU.js → use-binding-BSjPQ0Be.js} +1 -1
- package/dist/client/assets/{use-connection-0uAZ0JSW.js → use-connection-Dtj63U01.js} +1 -1
- package/dist/client/assets/{use-copy-B9seMJvp.js → use-copy-oq5GkYwB.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DYC0dnj3.js → use-create-virtual-mcp-COKyzJBE.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-CuIrTAAm.js → use-install-from-registry-DD_AL_1f.js} +1 -1
- package/dist/client/assets/{use-list-state-BywHZDup.js → use-list-state-DhRtf36X.js} +1 -1
- package/dist/client/assets/{use-llm-lqRff0qp.js → use-llm-5n5wwCT_.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-CgAaDxBc.js → use-mcp-resources-B792gs6l.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BN8bfZn3.js → use-mcp-tools-DScmBuoc.js} +1 -1
- package/dist/client/assets/{use-members-BnEfwka5.js → use-members-Chfn3LoP.js} +1 -1
- package/dist/client/assets/{use-mobile-CePuocbs.js → use-mobile-CZlm25dt.js} +1 -1
- package/dist/client/assets/{use-project-BCpZSYEH.js → use-project-BUsmU3t_.js} +1 -1
- package/dist/client/assets/{use-settings-modal-BhxNgsgy.js → use-settings-modal-D18j_l44.js} +1 -1
- package/dist/client/assets/{use-view-mode-C4bMLQky.js → use-view-mode-5Lt8g0uo.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-XCW3W4C9.js → use-virtual-mcp-COkdNvVv.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-fRddscS9.js +1 -0
- package/dist/client/assets/{useMutation-CspL2qBT.js → useMutation-tQLZk7P3.js} +1 -1
- package/dist/client/assets/useQuery-BLe-0FCm.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-D0p_NlPn.js +1 -0
- package/dist/client/assets/{user-BHCtEUxl.js → user-CI081yAV.js} +1 -1
- package/dist/client/assets/workflow-Bu6-o0iD.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +3 -3
- package/dist/server/migrate.js +3 -3
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/agent-detail-B0zz3Unf.js +0 -2
- package/dist/client/assets/agents-C11f5XN0.js +0 -1
- package/dist/client/assets/collection-tab-Bjsr3KyB.js +0 -1
- package/dist/client/assets/collection-table-wrapper-1X3tw2a2.js +0 -1
- package/dist/client/assets/connection-detail-CyhxKizj.js +0 -1
- package/dist/client/assets/connections-RcVdNIqa.js +0 -1
- package/dist/client/assets/constants-Cc2ACrvf.js +0 -1
- package/dist/client/assets/index-Cr3FYIgR.css +0 -1
- package/dist/client/assets/mcp-app-renderer-Bzzuvi2c.js +0 -11
- package/dist/client/assets/mcp-server-detail-C1SyJ2Ed.js +0 -2
- package/dist/client/assets/members-Lw-_oafM.js +0 -3
- package/dist/client/assets/plugins-BhX8dVGK.js +0 -1
- package/dist/client/assets/popover-ew-AFjK-.js +0 -1
- package/dist/client/assets/project-app-view-XMflyzaA.js +0 -1
- package/dist/client/assets/tasks-B7PtG_GW.js +0 -1
- package/dist/client/assets/tools-list-DNBJLnHb.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Bp_AF-J9.js +0 -1
- package/dist/client/assets/useQuery-BEiGk_96.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bqpp4FtC.js +0 -1
- package/dist/client/assets/workflow-DiR4gKq6.js +0 -1
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as _,c as k,j as t,E as fe,B as J,v as ae,_ as Ze,u as de,V as Qe,s as Xe,t as ce,b as et,e as tt,O as Ge,l as st,k as lt,aD as ot,q as Me}from"./index-CgikKIzX.js";import{b as Ae,i as nt,c as it,u as rt,C as at,d as ct}from"./collapsible-Dz2sA23f.js";import{C as dt,E as mt}from"./collection-search-Dslk4ok0.js";import{I as ut}from"./icon-picker-XNuq6Ojb.js";import{I as Oe}from"./integration-icon-B4kJo2_s.js";import{u as ft}from"./index-CpowEWO4.js";import{B as $e}from"./badge-DuS2OMla.js";import{I as Ve}from"./input-BT1GzEWi.js";import{S as pt}from"./switch-Ci3hf_qU.js";import{T as xt}from"./textarea-C9UUVIil.js";import{a as pe,c as ve,T as xe,b as he}from"./tooltip-iSvWdfhX.js";import{h as ht,f as gt}from"./use-connection-0uAZ0JSW.js";import{u as jt,a as bt}from"./use-virtual-mcp-XCW3W4C9.js";import{i as He}from"./ChevronRight-DvHc-b9M.js";import{n as Nt}from"./select-B8htoZV8.js";import{i as De}from"./File02-DAE7GGwr.js";import{i as Le}from"./Loading01-9Lg_Mx7W.js";import{i as vt}from"./Play-BGC0DAwr.js";import{s as Be}from"./Plus-BnMd-Nlg.js";import{t as yt}from"./Users03-D9nwvJXd.js";import{B as Ct,a as _t,b as Fe,d as St,e as Tt,c as kt}from"./breadcrumb-g5L8PoZQ.js";import{a as wt,V as Et}from"./layout-8RHk-XUu.js";import{S as It}from"./save-actions-vRwzyds-.js";import{a as At}from"./tools-list-DNBJLnHb.js";import{C as ze}from"./checkbox-CKtularS.js";import{e as Ot,a as Ue,D as Ke,b as $t,c as Dt}from"./dialog-DXvsnaeO.js";import{T as ye,a as Lt,b as Ce,c as zt}from"./tabs-CfY-0viT.js";import{u as ge,a as Rt}from"./constants-CvFlNMMf.js";import{c as Pt}from"./use-mcp-tools-BN8bfZn3.js";import{a as Mt}from"./use-mcp-resources-CgAaDxBc.js";import{u as Vt}from"./decopilot-events-Bt8Q6ljY.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{I as Bt,R as Ft,a as Gt}from"./index-BlLYz5FA.js";import{i as je}from"./Check-CBQI4sX_.js";import{i as Ht}from"./Code01-dJCW2bE8.js";import{a as Re}from"./Copy01-DZUQRIVw.js";import{i as _e}from"./InfoCircle-C3KOURux.js";import{i as Ut}from"./Key01-gRJDeefs.js";import{A as Kt}from"./agent-connections-preview-CR5wYkAd.js";import"./use-llm-lqRff0qp.js";import"./use-binding-BrV6OHbU.js";import"./binder-BCMoHYJm.js";import"./useQuery-BEiGk_96.js";import"./localstorage-keys-DSrv9tDi.js";import"./useMutation-CspL2qBT.js";import"./skeleton-DO02PARZ.js";import"./AlignLeft-fmMf4Dhk.js";import"./ArrowLeft-v0wYt8Zz.js";import"./ChevronDown-sLr8XVsl.js";import"./Image01-CHnBumwc.js";import"./RefreshCcw01-CzWuABhj.js";import"./SearchMd-Br2lRaPk.js";import"./Settings01-CjytruXR.js";import"./useSuspenseInfiniteQuery-Bqpp4FtC.js";import"./infiniteQueryObserver-DsXqsvOO.js";import"./popover-ew-AFjK-.js";import"./scroll-area-B1PFdc0L.js";import"./Container-B6Xs6_xK.js";import"./Edit05-DhF5NlD_.js";import"./Link01-dup1fxbM.js";import"./XClose-ChV_2xLJ.js";import"./index-Bk2D_7VR.js";import"./Save01-CPtH6rzJ.js";import"./collection-table-wrapper-1X3tw2a2.js";import"./dropdown-menu-CgkGkmVE.js";import"./ArrowDown-C1XwJGei.js";import"./ArrowUp-D96x2aXm.js";import"./Grid01-DxL3VpUb.js";import"./List-C6WR2hvg.js";import"./table-7t3Ngqct.js";import"./card-Cj-GkUHD.js";import"./types-DA9O3-4Z.js";import"./Eye-BR_9-9sx.js";import"./Globe02-DSMumXCe.js";import"./LayersTwo01-D_3HSgdj.js";import"./X-B_qRWJ2C.js";const Ye=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Ye.displayName="Circle";const be=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m9.75 20.75 1.473.818c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l1.473-.818m-9-2.5-1.427-.793c-.3-.166-.45-.25-.558-.368a1 1 0 0 1-.215-.364C3 16.573 3 16.401 3 16.06V14.5m0-5V7.942c0-.343 0-.514.05-.667a1 1 0 0 1 .215-.364c.109-.119.258-.202.558-.368L5.25 5.75m4.5-2.5 1.473-.818c.284-.158.425-.237.576-.267a1 1 0 0 1 .402 0c.15.03.292.11.576.267l1.473.818m4.5 2.5 1.427.793c.3.166.45.25.558.368a1 1 0 0 1 .215.364c.05.153.05.324.05.667V9.5m0 5v1.559c0 .342 0 .514-.05.666a.999.999 0 0 1-.215.364c-.109.119-.258.202-.558.368l-1.427.793m-9-7.5L12 12m0 0 2.25-1.25M12 12v2.5M3 7l2.25 1.25m13.5 0L21 7m-9 12.5V22"}));be.displayName="CubeOutline";const qe=({size:o=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m12 5.5-4.638 6.747c-.28.406-.42.609-.41.778a.5.5 0 0 0 .195.373c.135.102.38.102.874.102H12v5l4.638-6.747c.28-.406.42-.609.41-.778a.5.5 0 0 0-.195-.373c-.135-.102-.38-.102-.874-.102H12v-5Z"}),_.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));qe.displayName="ZapCircle";function Se(o){return o===null?"all":o?.length??0}function Wt(o,e){const s=o[e];if(!s)return"";const n=[];return s.tools===null?n.push("all tools"):s.tools&&s.tools.length>0&&n.push(`${s.tools.length} tools`),s.resources===null?n.push("all resources"):s.resources&&s.resources.length>0&&n.push(`${s.resources.length} resources`),s.prompts===null?n.push("all prompts"):s.prompts&&s.prompts.length>0&&n.push(`${s.prompts.length} prompts`),n.join(", ")}function Yt(o,e){const s=o[e];return s?!((s.tools===void 0||s.tools!==null&&s.tools.length===0)&&(s.resources===void 0||s.resources!==null&&s.resources.length===0)&&(s.prompts===void 0||s.prompts!==null&&s.prompts.length===0)):!1}const qt={tools:null,resources:null,prompts:null};function Te(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Le,{className:"animate-spin text-muted-foreground",size:24})}),o[0]=e):e=o[0],e}function ke(o){return({error:e})=>e?.message?.includes("Method not found")||e?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:o})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ze,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:e?.message?e.message.length>200?`${e.message.slice(0,200)}...`:e.message:"An unexpected error occurred"})]})]})}function Jt(o){const e=k.c(23),{item:s,isSelected:n,onToggle:l,disabled:i}=o,d=i?"cursor-not-allowed opacity-50":"cursor-pointer",a=n?"bg-accent/25":"hover:bg-muted/50";let r;e[0]!==d||e[1]!==a?(r=ae("flex items-start gap-3 p-4 rounded-lg transition-colors",d,a),e[0]=d,e[1]=a,e[2]=r):r=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=e[4];let x;e[5]!==s.tags?(x=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=x):x=e[6];let g;e[7]!==c||e[8]!==x?(g=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,x]}),e[7]=c,e[8]=x,e[9]=g):g=e[9];let p;e[10]!==s.description?(p=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=p):p=e[11];let h;e[12]!==g||e[13]!==p?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[g,p]}),e[12]=g,e[13]=p,e[14]=h):h=e[14];let u;e[15]!==i||e[16]!==n||e[17]!==l?(u=t.jsx(ze,{checked:n,onCheckedChange:l,disabled:i,className:"mt-0.5"}),e[15]=i,e[16]=n,e[17]=l,e[18]=u):u=e[18];let f;return e[19]!==r||e[20]!==h||e[21]!==u?(f=t.jsxs("label",{className:r,children:[h,u]}),e[19]=r,e[20]=h,e[21]=u,e[22]=f):f=e[22],f}function Pe(o){const e=k.c(32),{items:s,selections:n,onToggle:l,onToggleAll:i,emptyMessage:d,disabled:a}=o;let r,c,x,g,p;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==l||e[4]!==i||e[5]!==n){p=Symbol.for("react.early_return_sentinel");e:{const f=s.map(Zt);if(s.length===0){let y;e[11]!==d?(y=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:d})}),e[11]=d,e[12]=y):y=e[12],p=y;break e}x="flex flex-col h-full";const b=a?"cursor-not-allowed opacity-50":"cursor-pointer";let m;e[13]!==b?(m=ae("flex items-start gap-3 p-4",b),e[13]=b,e[14]=m):m=e[14];let j;e[15]!==s.length?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("span",{className:"text-sm font-medium",children:["Select All (",s.length,")"]})}),e[15]=s.length,e[16]=j):j=e[16];const v=n===null;let C;e[17]!==a||e[18]!==i||e[19]!==v?(C=t.jsx(ze,{checked:v,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[17]=a,e[18]=i,e[19]=v,e[20]=C):C=e[20],e[21]!==C||e[22]!==m||e[23]!==j?(g=t.jsx("div",{className:"px-4 border-b border-border shrink-0",children:t.jsxs("label",{className:m,children:[j,C]})}),e[21]=C,e[22]=m,e[23]=j,e[24]=g):g=e[24],r="flex-1 overflow-auto px-4 py-3 space-y-1",c=s.map(y=>t.jsx(Jt,{item:y,isSelected:n===null||n?.includes(y.id),onToggle:()=>l(y.id,f),disabled:a},y.id))}e[0]=a,e[1]=d,e[2]=s,e[3]=l,e[4]=i,e[5]=n,e[6]=r,e[7]=c,e[8]=x,e[9]=g,e[10]=p}else r=e[6],c=e[7],x=e[8],g=e[9],p=e[10];if(p!==Symbol.for("react.early_return_sentinel"))return p;let h;e[25]!==r||e[26]!==c?(h=t.jsx("div",{className:r,children:c}),e[25]=r,e[26]=c,e[27]=h):h=e[27];let u;return e[28]!==x||e[29]!==g||e[30]!==h?(u=t.jsxs("div",{className:x,children:[g,h]}),e[28]=x,e[29]=g,e[30]=h,e[31]=u):u=e[31],u}function Zt(o){return o.id}function Qt(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Pt(x);let p;e[5]!==g.tools?(p=g.tools.map(Xt),e[5]=g.tools,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No tools available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function Xt(o){return{id:o.name,name:o.name,description:o.description,tags:t.jsx(At,{annotations:o.annotations,_meta:o._meta})}}function es(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Mt(x);let p;e[5]!==g.resources?(p=g.resources.map(ts),e[5]=g.resources,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No resources available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function ts(o){return{id:o.name||o.uri,name:o.name||o.uri,description:o.description}}function ss(o){const e=k.c(13),{connectionId:s,selections:n,onToggle:l,onToggleAll:i,disabled:d}=o,{org:a}=de();let r;e[0]!==s||e[1]!==a.id?(r={connectionId:s,orgId:a.id},e[0]=s,e[1]=a.id,e[2]=r):r=e[2];const c=ge(r);let x;e[3]!==c?(x={client:c},e[3]=c,e[4]=x):x=e[4];const{data:g}=Vt(x);let p;e[5]!==g.prompts?(p=g.prompts.map(ls),e[5]=g.prompts,e[6]=p):p=e[6];const h=p;let u;return e[7]!==d||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==n?(u=t.jsx(Pe,{items:h,selections:n,onToggle:l,onToggleAll:i,emptyMessage:"No prompts available",disabled:d}),e[7]=d,e[8]=h,e[9]=l,e[10]=i,e[11]=n,e[12]=u):u=e[12],u}function ls(o){return{id:o.name,name:o.name,description:o.description}}function os(o){const e=k.c(24),{connection:s,isSelected:n,hasSelections:l,summary:i,onClick:d,onToggleAll:a,disabled:r}=o,c=r?"cursor-not-allowed opacity-50":"cursor-pointer",x=n?"bg-accent":"hover:bg-muted/50";let g;e[0]!==c||e[1]!==x?(g=ae("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",c,x),e[0]=c,e[1]=x,e[2]=g):g=e[2];const p=r?void 0:d;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(Oe,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[3]=s.icon,e[4]=s.title,e[5]=h):h=e[5];let u;e[6]!==s.title?(u=t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=u):u=e[7];let f;e[8]!==l||e[9]!==i?(f=l&&i&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[8]=l,e[9]=i,e[10]=f):f=e[10];let b;e[11]!==u||e[12]!==f?(b=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[u,f]}),e[11]=u,e[12]=f,e[13]=b):b=e[13];let m;e[14]!==r||e[15]!==l||e[16]!==a?(m=t.jsx(ze,{checked:l,onCheckedChange:a,onClick:ns,disabled:r,className:"shrink-0"}),e[14]=r,e[15]=l,e[16]=a,e[17]=m):m=e[17];let j;return e[18]!==g||e[19]!==p||e[20]!==h||e[21]!==b||e[22]!==m?(j=t.jsxs("div",{className:g,onClick:p,children:[h,b,m]}),e[18]=g,e[19]=p,e[20]=h,e[21]=b,e[22]=m,e[23]=j):j=e[23],j}function ns(o){return o.stopPropagation()}function is(o){const e=k.c(22),{allConnections:s,searchTerm:n,selectedId:l,hasSelections:i,getSelectionSummary:d,onConnectionClick:a,onToggleAll:r,disabled:c}=o;let x;e[0]!==s||e[1]!==n?(x=n?s.filter(u=>u.title.toLowerCase().includes(n.toLowerCase())||u.description?.toLowerCase().includes(n.toLowerCase())):s,e[0]=s,e[1]=n,e[2]=x):x=e[2];const g=x;if(g.length===0){const u=n?"No connections found":"No connections available";let f;return e[3]!==u?(f=t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4",children:u}),e[3]=u,e[4]=f):f=e[4],f}let p;if(e[5]!==c||e[6]!==g||e[7]!==d||e[8]!==i||e[9]!==a||e[10]!==r||e[11]!==l){let u;e[13]!==c||e[14]!==d||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==l?(u=f=>t.jsx(os,{connection:f,isSelected:l===f.id,hasSelections:i(f.id),summary:d(f.id),onClick:()=>a(f.id),onToggleAll:()=>r(f.id),disabled:c},f.id),e[13]=c,e[14]=d,e[15]=i,e[16]=a,e[17]=r,e[18]=l,e[19]=u):u=e[19],p=g.map(u),e[5]=c,e[6]=g,e[7]=d,e[8]=i,e[9]=a,e[10]=r,e[11]=l,e[12]=p}else p=e[12];let h;return e[20]!==p?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:p}),e[20]=p,e[21]=h):h=e[21],h}function rs(o){const e=k.c(75),{currentConnection:s,activeTab:n,selectedId:l,formData:i,toggleTool:d,toggleResource:a,togglePrompt:r,toggleAllTools:c,toggleAllResources:x,toggleAllPrompts:g,onTabChange:p}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(Oe,{icon:s.icon,name:s.title,size:"md",className:"shrink-0"}),e[0]=s.icon,e[1]=s.title,e[2]=h):h=e[2];let u;e[3]!==s.title?(u=t.jsx("h2",{className:"text-lg font-semibold truncate",children:s.title}),e[3]=s.title,e[4]=u):u=e[4];let f;e[5]!==s.description?(f=s.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description}),e[5]=s.description,e[6]=f):f=e[6];let b;e[7]!==u||e[8]!==f?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[u,f]}),e[7]=u,e[8]=f,e[9]=b):b=e[9];let m;e[10]!==h||e[11]!==b?(m=t.jsx("div",{className:"p-6 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[h,b]})}),e[10]=h,e[11]=b,e[12]=m):m=e[12];let j;e[13]!==p?(j=M=>p(M),e[13]=p,e[14]=j):j=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs(ye,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Ae,{size:16}),"Tools"]}),e[15]=v):v=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(ye,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(be,{size:16}),"Resources"]}),e[16]=C):C=e[16];let y;e[17]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(Lt,{variant:"underline",className:"shrink-0 px-6",children:[v,C,t.jsxs(ye,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx(De,{size:16}),"Prompts"]})]}),e[17]=y):y=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=ke("Tools not supported by this server"),e[18]=V):V=e[18];let R;e[19]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Te,{}),e[19]=R):R=e[19];let T;e[20]!==i||e[21]!==l?(T=i[l]?i[l].tools:[],e[20]=i,e[21]=l,e[22]=T):T=e[22];let O;e[23]!==l||e[24]!==d?(O=(M,q)=>d(l,M,q),e[23]=l,e[24]=d,e[25]=O):O=e[25];let S;e[26]!==l||e[27]!==c?(S=()=>c(l),e[26]=l,e[27]=c,e[28]=S):S=e[28];let w;e[29]!==l||e[30]!==T||e[31]!==O||e[32]!==S?(w=t.jsx(Ce,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:V,children:t.jsx(_.Suspense,{fallback:R,children:t.jsx(Qt,{connectionId:l,selections:T,onToggle:O,onToggleAll:S})})})}),e[29]=l,e[30]=T,e[31]=O,e[32]=S,e[33]=w):w=e[33];let z;e[34]===Symbol.for("react.memo_cache_sentinel")?(z=ke("Resources not supported by this server"),e[34]=z):z=e[34];let $;e[35]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Te,{}),e[35]=$):$=e[35];let I;e[36]!==i||e[37]!==l?(I=i[l]?i[l].resources:[],e[36]=i,e[37]=l,e[38]=I):I=e[38];let D;e[39]!==l||e[40]!==a?(D=(M,q)=>a(l,M,q),e[39]=l,e[40]=a,e[41]=D):D=e[41];let A;e[42]!==l||e[43]!==x?(A=()=>x(l),e[42]=l,e[43]=x,e[44]=A):A=e[44];let E;e[45]!==l||e[46]!==I||e[47]!==D||e[48]!==A?(E=t.jsx(Ce,{value:"resources",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:z,children:t.jsx(_.Suspense,{fallback:$,children:t.jsx(es,{connectionId:l,selections:I,onToggle:D,onToggleAll:A})})})}),e[45]=l,e[46]=I,e[47]=D,e[48]=A,e[49]=E):E=e[49];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=ke("Prompts not supported by this server"),e[50]=B):B=e[50];let P;e[51]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Te,{}),e[51]=P):P=e[51];let K;e[52]!==i||e[53]!==l?(K=i[l]?i[l].prompts:[],e[52]=i,e[53]=l,e[54]=K):K=e[54];let H;e[55]!==l||e[56]!==r?(H=(M,q)=>r(l,M,q),e[55]=l,e[56]=r,e[57]=H):H=e[57];let W;e[58]!==l||e[59]!==g?(W=()=>g(l),e[58]=l,e[59]=g,e[60]=W):W=e[60];let U;e[61]!==l||e[62]!==K||e[63]!==H||e[64]!==W?(U=t.jsx(Ce,{value:"prompts",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:B,children:t.jsx(_.Suspense,{fallback:P,children:t.jsx(ss,{connectionId:l,selections:K,onToggle:H,onToggleAll:W})})})}),e[61]=l,e[62]=K,e[63]=H,e[64]=W,e[65]=U):U=e[65];let Y;e[66]!==n||e[67]!==w||e[68]!==E||e[69]!==U||e[70]!==j?(Y=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:t.jsxs(zt,{value:n,onValueChange:j,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[y,w,E,U]})}),e[66]=n,e[67]=w,e[68]=E,e[69]=U,e[70]=j,e[71]=Y):Y=e[71];let Z;return e[72]!==Y||e[73]!==m?(Z=t.jsxs(t.Fragment,{children:[m,Y]}),e[72]=Y,e[73]=m,e[74]=Z):Z=e[74],Z}function as(o){const e={};for(const s of o)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function we(o){return Object.entries(o).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function cs(o,e){switch(e.type){case"SET_SEARCH_TERM":return{...o,searchTerm:e.payload};case"SET_SELECTED":return{...o,selectedId:e.payload};case"SET_ACTIVE_TAB":return{...o,activeTab:e.payload};case"RESET":return{searchTerm:"",selectedId:e.payload.selectedId??e.payload.firstConnectionId??null,activeTab:"tools"};case"SELECT_CONNECTION":return{...o,selectedId:e.payload,activeTab:"tools"};default:return o}}const ds=(o,e)=>o.find(s=>s.id===e)??o[0];function ms(o){const e=k.c(77),{open:s,onOpenChange:n,selectedId:l,form:i,connections:d}=o;let a;e[0]!==l?(a={activeTab:"tools",searchTerm:"",selectedId:l},e[0]=l,e[1]=a):a=e[1];const[r,c]=_.useReducer(cs,a),x=_.useDeferredValue(r.searchTerm);let g;e[2]!==x?(g={searchTerm:x},e[2]=x,e[3]=g):g=e[3];const p=ht(g);let h;e[4]!==d?(h=d??[],e[4]=d,e[5]=h):h=e[5];let u;e[6]!==h?(u=as(h),e[6]=h,e[7]=u):u=e[7];const f=u;let b;e[8]!==p||e[9]!==r.selectedId?(b=ds(p,r.selectedId),e[8]=p,e[9]=r.selectedId,e[10]=b):b=e[10];const m=b,j=m?.id??null;let v;e[11]!==f?(v=N=>Yt(f,N),e[11]=f,e[12]=v):v=e[12];const C=v;let y;e[13]!==f?(y=N=>Wt(f,N),e[13]=f,e[14]=y):y=e[14];const V=y;let R;e[15]!==i||e[16]!==f?(R=(N,L,F,Q)=>{const ie=f[N]?.[L];let G;ie===null?G=Q.filter(Ne=>Ne!==F):ie?.includes(F)?G=ie.filter(Ne=>Ne!==F):(G=[...ie??[],F],G.length===Q.length&&(G=null));const re={...f};re[N]?re[N]={...re[N]}:re[N]={tools:null,resources:null,prompts:null},re[N][L]=G,i.setValue("connections",we(re),{shouldDirty:!0,shouldTouch:!0})},e[15]=i,e[16]=f,e[17]=R):R=e[17];const T=R;let O;e[18]!==i||e[19]!==f?(O=(N,L)=>{const ie=f[N]?.[L]===null?[]:null,G={...f};G[N]?G[N]={...G[N]}:G[N]={tools:null,resources:null,prompts:null},G[N][L]=ie,i.setValue("connections",we(G),{shouldDirty:!0,shouldTouch:!0})},e[18]=i,e[19]=f,e[20]=O):O=e[20];const S=O;let w;e[21]!==T?(w=(N,L,F)=>T(N,"tools",L,F),e[21]=T,e[22]=w):w=e[22];const z=w;let $;e[23]!==T?($=(N,L,F)=>T(N,"resources",L,F),e[23]=T,e[24]=$):$=e[24];const I=$;let D;e[25]!==T?(D=(N,L,F)=>T(N,"prompts",L,F),e[25]=T,e[26]=D):D=e[26];const A=D;let E;e[27]!==S?(E=N=>S(N,"tools"),e[27]=S,e[28]=E):E=e[28];const B=E;let P;e[29]!==S?(P=N=>S(N,"resources"),e[29]=S,e[30]=P):P=e[30];const K=P;let H;e[31]!==S?(H=N=>S(N,"prompts"),e[31]=S,e[32]=H):H=e[32];const W=H;let U;e[33]!==i||e[34]!==f?(U=N=>{const L=f[N],F=L&&L.tools===null&&L.resources===null&&L.prompts===null,Q={...f};F?delete Q[N]:Q[N]=qt,i.setValue("connections",we(Q),{shouldDirty:!0,shouldTouch:!0})},e[33]=i,e[34]=f,e[35]=U):U=e[35];const Y=U;let Z;e[36]!==p||e[37]!==n||e[38]!==l?(Z=N=>{N&&c({type:"RESET",payload:{selectedId:l,firstConnectionId:p[0]?.id??null}}),n(N)},e[36]=p,e[37]=n,e[38]=l,e[39]=Z):Z=e[39];const M=Z;let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=N=>{c({type:"SELECT_CONNECTION",payload:N})},e[40]=q):q=e[40];const Je=q;let me;e[41]===Symbol.for("react.memo_cache_sentinel")?(me=N=>c({type:"SET_SEARCH_TERM",payload:N}),e[41]=me):me=e[41];let X;e[42]!==r.searchTerm?(X=t.jsx(dt,{value:r.searchTerm,onChange:me,placeholder:"Search connections..."}),e[42]=r.searchTerm,e[43]=X):X=e[43];let ee;e[44]!==p||e[45]!==r.searchTerm||e[46]!==j||e[47]!==V||e[48]!==C||e[49]!==Y?(ee=t.jsx("div",{className:"flex-1 overflow-auto p-2",children:t.jsx(is,{allConnections:p,searchTerm:r.searchTerm,selectedId:j,hasSelections:C,getSelectionSummary:V,onConnectionClick:Je,onToggleAll:Y})}),e[44]=p,e[45]=r.searchTerm,e[46]=j,e[47]=V,e[48]=C,e[49]=Y,e[50]=ee):ee=e[50];let te;e[51]!==X||e[52]!==ee?(te=t.jsxs("div",{className:"w-full sm:w-72 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[X,ee]}),e[51]=X,e[52]=ee,e[53]=te):te=e[53];let se;e[54]!==m||e[55]!==r.activeTab||e[56]!==j||e[57]!==f||e[58]!==W||e[59]!==K||e[60]!==B||e[61]!==A||e[62]!==I||e[63]!==z?(se=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:m&&j?t.jsx(rs,{currentConnection:m,activeTab:r.activeTab,selectedId:j,formData:f,toggleTool:z,toggleResource:I,togglePrompt:A,toggleAllTools:B,toggleAllResources:K,toggleAllPrompts:W,onTabChange:N=>c({type:"SET_ACTIVE_TAB",payload:N})},j):t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Select a connection to view its tools, resources, and prompts"})}),e[54]=m,e[55]=r.activeTab,e[56]=j,e[57]=f,e[58]=W,e[59]=K,e[60]=B,e[61]=A,e[62]=I,e[63]=z,e[64]=se):se=e[64];let le;e[65]!==te||e[66]!==se?(le=t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[te,se]}),e[65]=te,e[66]=se,e[67]=le):le=e[67];let oe;e[68]!==M?(oe=t.jsx(Ot,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(J,{variant:"outline",onClick:()=>M(!1),children:"Done"})}),e[68]=M,e[69]=oe):oe=e[69];let ne;e[70]!==le||e[71]!==oe?(ne=t.jsxs(Ue,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[le,oe]}),e[70]=le,e[71]=oe,e[72]=ne):ne=e[72];let ue;return e[73]!==M||e[74]!==s||e[75]!==ne?(ue=t.jsx(Ke,{open:s,onOpenChange:M,children:ne}),e[73]=M,e[74]=s,e[75]=ne,e[76]=ue):ue=e[76],ue}const us=Qe.pick({title:!0,description:!0,icon:!0,status:!0,metadata:!0,connections:!0}).extend({title:Xe().min(1,"Name is required").max(255)});function fs(o){const e=k.c(8);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=ae("grid gap-3",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==l?(i=t.jsx(Ft,{"data-slot":"radio-group",className:l,...n}),e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function Ee(o){const e=k.c(9);let s,n;e[0]!==o?({className:s,...n}=o,e[0]=o,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let l;e[3]!==s?(l=ae("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 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-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Gt,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Ye,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=i):i=e[5];let d;return e[6]!==n||e[7]!==l?(d=t.jsx(Bt,{"data-slot":"radio-group-item",className:l,...n,children:i}),e[6]=n,e[7]=l,e[8]=d):d=e[8],d}function ps(o){const s=new TextEncoder().encode(o),n=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(n)}function xs(o){const e=k.c(10),{url:s}=o,[n,l]=_.useState(!1);let i;e[0]!==s?(i=async()=>{await navigator.clipboard.writeText(s),l(!0),ce.success("Agent URL copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[0]=s,e[1]=i):i=e[1];const d=i;let a;e[2]!==n?(a=n?t.jsx(je,{size:20,className:"text-green-600"}):t.jsx(Re,{size:20}),e[2]=n,e[3]=a):a=e[3];const r=n?"Copied!":"Copy URL";let c;e[4]!==r?(c=t.jsx("span",{className:"text-xs font-medium",children:r}),e[4]=r,e[5]=c):c=e[5];let x;return e[6]!==d||e[7]!==a||e[8]!==c?(x=t.jsxs(J,{type:"button",variant:"outline",onClick:d,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[6]=d,e[7]=a,e[8]=c,e[9]=x):x=e[9],x}function hs(o){const e=k.c(7),{url:s,serverName:n}=o;let l;e[0]!==n||e[1]!==s?(l=()=>{const c=We(n),g=ps(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),p=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(g)}`;window.open(p,"_blank"),ce.success("Opening Cursor...")},e[0]=n,e[1]=s,e[2]=l):l=e[2];const i=l;let d,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),a=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=d,e[4]=a):(d=e[3],a=e[4]);let r;return e[5]!==i?(r=t.jsxs(J,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[d,a]}),e[5]=i,e[6]=r):r=e[6],r}function gs(o){const e=k.c(11),{url:s,serverName:n}=o,[l,i]=_.useState(!1);let d;e[0]!==n||e[1]!==s?(d=async()=>{const p=We(n),u=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),f=`claude mcp add-json "${p}" '${u.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(f),i(!0),ce.success("Claude Code command copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=n,e[1]=s,e[2]=d):d=e[2];const a=d;let r;e[3]!==l?(r=l?t.jsx(je,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=l,e[4]=r):r=e[4];const c=l?"Copied!":"Install on Claude";let x;e[5]!==c?(x=t.jsx("span",{className:"text-xs font-medium",children:c}),e[5]=c,e[6]=x):x=e[6];let g;return e[7]!==a||e[8]!==r||e[9]!==x?(g=t.jsxs(J,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[r,x]}),e[7]=a,e[8]=r,e[9]=x,e[10]=g):g=e[10],g}function js({virtualMcp:o}){const{org:e}=de(),s=ge({connectionId:Rt,orgId:e.id}),[n,l]=_.useState(null),[i,d]=_.useState(!1),[a,r]=_.useState(!1),c=o.id,x=o.title||`agent-${c.slice(0,8)}`,g=n?`bunx @decocms/typegen@latest --mcp ${c} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,p=async()=>{d(!0);try{const f=(await s.callTool({name:"API_KEY_CREATE",arguments:{name:`typegen-${x}`,permissions:{[c]:["*"]}}})).structuredContent?.key;if(!f)throw new Error("No key in response");l(f)}catch{ce.error("Failed to generate API key")}finally{d(!1)}},h=async()=>{await navigator.clipboard.writeText(g),r(!0),ce.success("Command copied to clipboard"),setTimeout(()=>r(!1),2e3)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Generate typed client"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Introspects this agent and writes a typed"," ",t.jsx("code",{className:"font-mono",children:"client.ts"})," you can import directly."]})]}),!n&&t.jsxs(J,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:p,disabled:i,children:[i?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(Ut,{size:14}),t.jsx("span",{children:i?"Generating…":"Generate API key"})]})]}),n&&t.jsx("p",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-700",children:"Store this key securely — it won't be shown again."}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Generate client"}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:g}),t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:h,children:a?t.jsx(je,{size:12,className:"text-green-600"}):t.jsx(Re,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Runtime variables"}),t.jsx(bs,{apiKey:n})]})}function bs(o){const e=k.c(19),{apiKey:s}=o,[n,l]=_.useState(!1),i=window.location.origin,d=s?`MESH_API_KEY=${s}`:"MESH_API_KEY=<api-key>",a=`MESH_BASE_URL=${i}`,r=`${d}
|
|
2
|
-
${a}`;let c;e[0]!==r?(c=async()=>{await navigator.clipboard.writeText(r),l(!0),setTimeout(()=>l(!1),2e3)},e[0]=r,e[1]=c):c=e[1];const x=c,g=!s;let p;e[2]!==g?(p=ae({"opacity-50":g}),e[2]=g,e[3]=p):p=e[3];let h;e[4]!==d||e[5]!==p?(h=t.jsx("span",{className:p,children:d}),e[4]=d,e[5]=p,e[6]=h):h=e[6];let u,f;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("br",{}),f=t.jsx("span",{children:a}),e[7]=u,e[8]=f):(u=e[7],f=e[8]);let b;e[9]!==h?(b=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[h,u,f]}),e[9]=h,e[10]=b):b=e[10];let m;e[11]!==n?(m=n?t.jsx(je,{size:12,className:"text-green-600"}):t.jsx(Re,{size:12}),e[11]=n,e[12]=m):m=e[12];let j;e[13]!==x||e[14]!==m?(j=t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:x,children:m}),e[13]=x,e[14]=m,e[15]=j):j=e[15];let v;return e[16]!==b||e[17]!==j?(v=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[b,j]})}),e[16]=b,e[17]=j,e[18]=v):v=e[18],v}function Ns(o){const e=k.c(3),{virtualMcp:s}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let l;return e[1]!==s?(l=t.jsx(_.Suspense,{fallback:n,children:t.jsx(js,{virtualMcp:s})}),e[1]=s,e[2]=l):l=e[2],l}function vs(o){const e=k.c(44),{open:s,onOpenChange:n,virtualMcp:l}=o,[i,d]=_.useState("code_execution");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=P=>{(P==="passthrough"||P==="smart_tool_selection"||P==="code_execution")&&d(P)},e[0]=a):a=e[0];const r=a;let c;e[1]!==i||e[2]!==l.id?(c=new URL(`/mcp/virtual-mcp/${l.id}`,window.location.origin),c.searchParams.set("mode",i),e[1]=i,e[2]=l.id,e[3]=c):c=e[3];let x;e[4]!==l.id||e[5]!==l.title?(x=l.title||`agent-${l.id?.slice(0,8)??"default"}`,e[4]=l.id,e[5]=l.title,e[6]=x):x=e[6];const g=x;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx($t,{children:t.jsx(Dt,{children:"Connect"})}),e[7]=p):p=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=h):h=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(nt,{className:"size-5 text-muted-foreground"})}),e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=f):f=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[11]=b):b=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[u,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[f,t.jsx(ve,{children:t.jsxs(xe,{children:[b,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Ee,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=m):m=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(it,{className:"size-5 text-muted-foreground"})}),e[13]=j):j=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=v):v=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[15]=C):C=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[j,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[v,t.jsx(ve,{children:t.jsxs(xe,{children:[C,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Ee,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=y):y=e[16];let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ht,{className:"size-5 text-muted-foreground"})}),e[17]=V):V=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=R):R=e[18];let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(pe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[19]=T):T=e[19];let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[V,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[R,t.jsx(ve,{children:t.jsxs(xe,{children:[T,t.jsx(he,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Ee,{id:"mode-code",value:"code_execution"}),t.jsx($e,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=O):O=e[20];let S;e[21]!==i?(S=t.jsxs("div",{className:"flex flex-col gap-3",children:[h,t.jsxs(fs,{value:i,onValueChange:r,className:"flex flex-col gap-4.5",children:[m,y,O]})]}),e[21]=i,e[22]=S):S=e[22];let w;e[23]!==c.href?(w=t.jsx(xs,{url:c.href}),e[23]=c.href,e[24]=w):w=e[24];let z,$;e[25]!==g||e[26]!==c.href?(z=t.jsx(hs,{url:c.href,serverName:g}),$=t.jsx(gs,{url:c.href,serverName:g}),e[25]=g,e[26]=c.href,e[27]=z,e[28]=$):(z=e[27],$=e[28]);let I;e[29]!==w||e[30]!==z||e[31]!==$?(I=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[w,z,$]})}),e[29]=w,e[30]=z,e[31]=$,e[32]=I):I=e[32];let D;e[33]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{className:"border-t border-border"}),e[33]=D):D=e[33];let A;e[34]!==l?(A=t.jsx(Ns,{virtualMcp:l}),e[34]=l,e[35]=A):A=e[35];let E;e[36]!==S||e[37]!==I||e[38]!==A?(E=t.jsxs(Ue,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[p,t.jsxs("div",{className:"flex flex-col gap-6",children:[S,I,D,A]})]}),e[36]=S,e[37]=I,e[38]=A,e[39]=E):E=e[39];let B;return e[40]!==n||e[41]!==s||e[42]!==E?(B=t.jsx(Ke,{open:s,onOpenChange:n,children:E}),e[40]=n,e[41]=s,e[42]=E,e[43]=B):B=e[43],B}function ys(o,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...o,shareDialogOpen:e.payload};case"SET_CONNECTION_DIALOG_OPEN":return{...o,connectionDialogOpen:e.payload};case"SET_EDITING_CONNECTION_ID":return{...o,editingConnectionId:e.payload};case"SET_SKILLS_OPEN":return{...o,skillsOpen:e.payload};default:return o}}function Ie(o){const e=k.c(27),{connection_id:s,selected_tools:n,selected_resources:l,selected_prompts:i,onClick:d}=o,a=gt(s);if(!a)return null;let r;e[0]!==n?(r=Se(n),e[0]=n,e[1]=r):r=e[1];const c=r;let x;e[2]!==l?(x=Se(l),e[2]=l,e[3]=x):x=e[3];const g=x;let p;e[4]!==i?(p=Se(i),e[4]=i,e[5]=p):p=e[5];const h=p;let u;e[6]!==a.icon||e[7]!==a.title?(u=t.jsx(Oe,{icon:a.icon,name:a.title,size:"xs"}),e[6]=a.icon,e[7]=a.title,e[8]=u):u=e[8];let f;e[9]!==a.title?(f=t.jsx("p",{className:"flex-1 text-sm font-normal text-foreground truncate",children:a.title}),e[9]=a.title,e[10]=f):f=e[10];let b;e[11]!==c?(b=c!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:c==="all"?"all":c}),t.jsx(Ae,{size:12})]}),e[11]=c,e[12]=b):b=e[12];let m;e[13]!==g?(m=g!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:g==="all"?"all":g}),t.jsx(be,{size:12})]}),e[13]=g,e[14]=m):m=e[14];let j;e[15]!==h?(j=h!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:h==="all"?"all":h}),t.jsx(De,{size:12})]}),e[15]=h,e[16]=j):j=e[16];let v;e[17]!==b||e[18]!==m||e[19]!==j?(v=t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[b,m,j]}),e[17]=b,e[18]=m,e[19]=j,e[20]=v):v=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(He,{size:16,className:"text-muted-foreground shrink-0"}),e[21]=C):C=e[21];let y;return e[22]!==d||e[23]!==u||e[24]!==f||e[25]!==v?(y=t.jsxs("div",{onClick:d,className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",children:[u,f,v,C]}),e[22]=d,e[23]=u,e[24]=f,e[25]=v,e[26]=y):y=e[26],y}Ie.Fallback=function(){return t.jsxs("div",{className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border",children:[t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"flex-1 h-4 rounded bg-muted animate-pulse"}),t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Ae,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(be,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(De,{size:12})]})]}),t.jsx(He,{size:16,className:"text-muted-foreground shrink-0"})]})};function Cs({virtualMcp:o}){const{org:e}=de(),s=bt(),n=st({resolver:lt(us),defaultValues:o}),l=n.watch("connections"),[i,d]=_.useReducer(ys,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,a]=ft(),{setVirtualMcpId:r}=rt();_.useEffect(()=>{a(!0),r(o.id)},[o.id]);const c=()=>{r(o.id),a(!0)},x=n.formState.isDirty,g=async()=>{const m=n.getValues(),j=await s.update.mutateAsync({id:o.id,data:m});n.reset(j)},p=()=>{n.reset(o)},h=()=>{d({type:"SET_EDITING_CONNECTION_ID",payload:null}),d({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},u=m=>{d({type:"SET_EDITING_CONNECTION_ID",payload:m}),d({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},f=s.update.isPending,b=t.jsx(Ct,{children:t.jsxs(_t,{children:[t.jsx(Fe,{children:t.jsx(St,{asChild:!0,children:t.jsx(ot,{to:"/$org/$project/agents",params:{org:e.slug,project:Ge},children:"Agents"})})}),t.jsx(Tt,{}),t.jsx(Fe,{children:t.jsx(kt,{children:o.title})})]})});return t.jsxs(wt,{breadcrumb:b,children:[t.jsxs(Et,{children:[t.jsx(It,{onSave:g,onUndo:p,isDirty:x,isSaving:f}),t.jsxs(xe,{delayDuration:0,children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:c,"aria-label":"Test Agent",children:[t.jsx(vt,{size:14}),"Test Agent"]})})}),t.jsx(he,{side:"bottom",children:"Test this agent in chat"})]}),t.jsxs(J,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:()=>d({type:"SET_SHARE_DIALOG_OPEN",payload:!0}),children:[t.jsx(qe,{size:14}),"Connect"]})]}),t.jsx("div",{className:"flex h-full w-full bg-background overflow-auto",children:t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 p-6 shrink-0",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx(Me,{control:n.control,name:"icon",render:({field:m})=>t.jsx(ut,{value:m.value,onChange:m.onChange,name:n.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(yt,{})})}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsx(Ve,{...n.register("title"),className:"h-auto py-0.5 text-lg! font-medium leading-7 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Agent Name"}),t.jsx(Ve,{...n.register("description"),className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(pt,{checked:n.watch("status")==="active",onCheckedChange:m=>n.setValue("status",m?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(at,{open:i.skillsOpen,onOpenChange:m=>d({type:"SET_SKILLS_OPEN",payload:m}),className:"border-t border-border shrink-0 max-h-[400px] overflow-hidden flex flex-col",children:[l.length===0?t.jsxs("button",{type:"button",onClick:h,className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"h-7 px-2 inline-flex items-center justify-center gap-1 rounded-md text-sm text-muted-foreground",children:[t.jsx(Be,{size:14}),"Add"]})]}):t.jsx(ct,{asChild:!0,children:t.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"ease-(--ease-out-expo)",style:{width:i.skillsOpen?0:"auto",marginRight:i.skillsOpen?0:4,opacity:i.skillsOpen?0:1,pointerEvents:i.skillsOpen?"none":"auto",transitionProperty:"all",transitionDuration:i.skillsOpen?"0ms":"200ms"},children:t.jsx(Kt,{connectionIds:l.map(m=>m.connection_id),maxVisibleIcons:2})}),t.jsxs("div",{role:"button",tabIndex:0,className:"h-7 inline-flex items-center justify-center rounded-md text-sm text-muted-foreground overflow-hidden transition-all duration-200 ease-(--ease-out-expo) hover:bg-accent hover:text-accent-foreground",style:{width:i.skillsOpen?"auto":28,paddingLeft:i.skillsOpen?8:0,paddingRight:i.skillsOpen?8:0,gap:i.skillsOpen?4:0},onPointerDown:m=>{m.stopPropagation()},onClick:m=>{m.stopPropagation(),m.preventDefault(),h()},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.stopPropagation(),m.preventDefault(),h())},children:[t.jsx(Be,{size:14,className:"shrink-0"}),t.jsx("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?"auto":0,opacity:i.skillsOpen?1:0},children:"Add"})]}),t.jsx("div",{className:"h-7 inline-flex items-center justify-center overflow-hidden transition-all duration-200 ease-(--ease-out-expo)",style:{width:i.skillsOpen?28:0,opacity:i.skillsOpen?1:0},children:t.jsx(Nt,{size:16,className:"shrink-0"})})]})]})}),t.jsx("div",{className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-(--ease-out-expo)",style:{gridTemplateRows:i.skillsOpen?"1fr":"0fr"},children:t.jsx("div",{className:"min-h-0 overflow-hidden",children:t.jsx("div",{className:"overflow-y-auto max-h-[300px] mask-[linear-gradient(to_bottom,black_calc(100%-40px),transparent_100%)]",children:t.jsx("div",{className:"flex flex-col gap-2 px-6 pb-4 pt-2",children:l.map(m=>t.jsx(_.Suspense,{fallback:t.jsx(Ie.Fallback,{}),children:t.jsx(Ie,{connection_id:m.connection_id,selected_tools:m.selected_tools,selected_resources:m.selected_resources,selected_prompts:m.selected_prompts,onClick:()=>u(m.connection_id)})},m.connection_id))})})})})]}),t.jsxs("div",{className:"flex flex-col flex-1 p-6 border-t border-border overflow-auto",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Instructions"}),t.jsx(Me,{name:"metadata.instructions",control:n.control,render:({field:m})=>t.jsx(xt,{...m,value:m.value??"",placeholder:"Write instructions here...",className:"min-h-[200px] resize-none text-sm placeholder:text-muted-foreground/50 leading-relaxed border-0 rounded-none shadow-none px-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:border-0 bg-transparent"})})]})]})}),t.jsx(ms,{open:i.connectionDialogOpen,onOpenChange:m=>d({type:"SET_CONNECTION_DIALOG_OPEN",payload:m}),selectedId:i.editingConnectionId,form:n,connections:l}),t.jsx(vs,{open:i.shareDialogOpen,onOpenChange:m=>d({type:"SET_SHARE_DIALOG_OPEN",payload:m}),virtualMcp:o})]})}function _s(){const o=k.c(6),e=et();let s;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/$project/agents/$agentId"},o[0]=s):s=o[0];const n=tt(s),{org:l,agentId:i}=n,d=jt(i);if(!d){let r;return o[1]!==e||o[2]!==l?(r=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(mt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>e({to:"/$org/$project/agents",params:{org:l,project:Ge}}),children:"Back to agents"})})}),o[1]=e,o[2]=l,o[3]=r):r=o[3],r}let a;return o[4]!==d?(a=t.jsx(Cs,{virtualMcp:d}),o[4]=d,o[5]=a):a=o[5],a}function Wl(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(fe,{children:t.jsx(_.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_s,{})})}),o[0]=e):e=o[0],e}export{Wl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ie,j as t,E as ne,r as X,u as ae,b as le,B as q,O as V}from"./index-CgikKIzX.js";import{C as ce,a as de}from"./collection-table-wrapper-1X3tw2a2.js";import{C as me,E as Q}from"./collection-search-Dslk4ok0.js";import{P as j}from"./index-CpowEWO4.js";import{B as pe,a as ue,b as ge,c as he}from"./breadcrumb-g5L8PoZQ.js";import{C as fe}from"./connection-card-M2mu32Xr.js";import{I as xe}from"./integration-icon-B4kJo2_s.js";import{u as je}from"./use-list-state-BywHZDup.js";import{u as Ce}from"./use-create-virtual-mcp-DYC0dnj3.js";import{i as be}from"./constants-CvFlNMMf.js";import{b as ye,a as we}from"./use-virtual-mcp-XCW3W4C9.js";import{c as Ne,b as De,d as Se,A as _e,e as ke,h as ve,a as Ae,f as Ie}from"./alert-dialog-D90wrdGx.js";import{D as Y,a as Z,b as ee,c as R}from"./dropdown-menu-CgkGkmVE.js";import{i as te}from"./DotsVertical-CJ3pBFjL.js";import{s as se}from"./Eye-BR_9-9sx.js";import{i as Pe}from"./Loading01-9Lg_Mx7W.js";import{s as oe}from"./Trash01-DTIwE-5T.js";import{t as C}from"./Users03-D9nwvJXd.js";import{U as $e}from"./user-BHCtEUxl.js";import{A as re}from"./agent-connections-preview-CR5wYkAd.js";import{f as ze}from"./format-time-CMKyl-GC.js";import"./ArrowDown-C1XwJGei.js";import"./ArrowUp-D96x2aXm.js";import"./Check-CBQI4sX_.js";import"./Grid01-DxL3VpUb.js";import"./List-C6WR2hvg.js";import"./tooltip-iSvWdfhX.js";import"./index-Bk2D_7VR.js";import"./table-7t3Ngqct.js";import"./SearchMd-Br2lRaPk.js";import"./input-BT1GzEWi.js";import"./localstorage-keys-DSrv9tDi.js";import"./useQuery-BEiGk_96.js";import"./useMutation-CspL2qBT.js";import"./ChevronRight-DvHc-b9M.js";import"./card-Cj-GkUHD.js";import"./Container-B6Xs6_xK.js";import"./use-view-mode-C4bMLQky.js";import"./use-mobile-CePuocbs.js";import"./use-connection-0uAZ0JSW.js";import"./avatar-D4ALUDCI.js";import"./differenceInSeconds-NQ4PDo0z.js";function Me(e,r){switch(r.type){case"delete":return{mode:"deleting",virtualMcp:r.virtualMcp};case"close":return{mode:"idle"}}}function Be(){const e=ie.c(65),{org:r}=ae(),n=le();let b;e[0]!==r.slug?(b={namespace:r.slug,resource:"agents"},e[0]=r.slug,e[1]=b):b=e[1];const s=je(b),x=ye(s);let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y={navigateOnCreate:!0},e[2]=y):y=e[2];const{createVirtualMCP:T,isCreating:w}=Ce(y),U=we();let N;e[3]===Symbol.for("react.memo_cache_sentinel")?(N={mode:"idle"},e[3]=N):N=e[3];const[i,D]=X.useReducer(Me,N);let S;e[4]!==U||e[5]!==i.mode||e[6]!==i.virtualMcp?(S=async()=>{if(i.mode!=="deleting")return;const o=i.virtualMcp.id;if(D({type:"close"}),!(!o||be(o)))try{await U.delete.mutateAsync(o)}catch{}},e[4]=U,e[5]=i.mode,e[6]=i.virtualMcp,e[7]=S):S=e[7];const L=S;let _,k,v,A,I;e[8]===Symbol.for("react.memo_cache_sentinel")?(_={id:"title",header:"Name",render:Fe,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},k={id:"description",header:"Description",render:He,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},v={id:"connections",header:"Connections",render:Ue,cellClassName:"w-28 shrink-0"},A={id:"updated_by",header:"Updated by",render:Te,cellClassName:"w-32 shrink-0",sortable:!0},I={id:"updated_at",header:"Updated",render:Re,cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},e[8]=_,e[9]=k,e[10]=v,e[11]=A,e[12]=I):(_=e[8],k=e[9],v=e[10],A=e[11],I=e[12]);let P;e[13]!==n||e[14]!==r.slug?(P=[_,k,v,A,I,{id:"actions",header:"",render:o=>t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ve,children:t.jsx(te,{size:20})})}),t.jsxs(ee,{align:"end",onClick:Ke,children:[t.jsxs(R,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}})},children:[t.jsx(se,{size:16}),"Open"]}),t.jsxs(R,{variant:"destructive",onClick:a=>{a.stopPropagation(),D({type:"delete",virtualMcp:o})},children:[t.jsx(oe,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[13]=n,e[14]=r.slug,e[15]=P):P=e[15];const H=P,F=w?"Creating...":"Create Agent";let $;e[16]!==T||e[17]!==w||e[18]!==F?($=t.jsx(q,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:F}),e[16]=T,e[17]=w,e[18]=F,e[19]=$):$=e[19];const G=$,J=i.mode==="deleting";let z;e[20]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&D({type:"close"}),e[20]=z):z=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Ne,{children:"Delete Agent?"}),e[21]=M):M=e[21];const W=i.mode==="deleting"&&i.virtualMcp.title;let l;e[22]!==W?(l=t.jsxs(De,{children:[M,t.jsxs(Se,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[22]=W,e[23]=l):l=e[23];let B;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(_e,{children:"Cancel"}),e[24]=B):B=e[24];let c;e[25]!==L?(c=t.jsxs(ke,{children:[B,t.jsx(ve,{onClick:L,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[25]=L,e[26]=c):c=e[26];let d;e[27]!==l||e[28]!==c?(d=t.jsxs(Ae,{children:[l,c]}),e[27]=l,e[28]=c,e[29]=d):d=e[29];let m;e[30]!==J||e[31]!==d?(m=t.jsx(Ie,{open:J,onOpenChange:z,children:d}),e[30]=J,e[31]=d,e[32]=m):m=e[32];let O;e[33]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(j.Header.Left,{children:t.jsx(pe,{children:t.jsx(ue,{children:t.jsx(ge,{children:t.jsx(he,{children:"Agents"})})})})}),e[33]=O):O=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],e[34]=E):E=e[34];let p;e[35]!==s.handleSort||e[36]!==s.setViewMode||e[37]!==s.sortDirection||e[38]!==s.sortKey||e[39]!==s.viewMode?(p=t.jsx(ce,{viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:E}),e[35]=s.handleSort,e[36]=s.setViewMode,e[37]=s.sortDirection,e[38]=s.sortKey,e[39]=s.viewMode,e[40]=p):p=e[40];let u;e[41]!==G||e[42]!==p?(u=t.jsxs(j.Header,{children:[O,t.jsxs(j.Header.Right,{children:[p,G]})]}),e[41]=G,e[42]=p,e[43]=u):u=e[43];let g;e[44]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[44]=s,e[45]=g):g=e[45];let h;e[46]!==s.search||e[47]!==s.setSearch||e[48]!==g?(h=t.jsx(me,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:g}),e[46]=s.search,e[47]=s.setSearch,e[48]=g,e[49]=h):h=e[49];let f;e[50]!==H||e[51]!==s.handleSort||e[52]!==s.search||e[53]!==s.sortDirection||e[54]!==s.sortKey||e[55]!==s.viewMode||e[56]!==n||e[57]!==r.slug||e[58]!==x?(f=t.jsx(j.Content,{children:s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:x.map(o=>t.jsx(fe,{connection:{id:o.id??"",title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(C,{}),onClick:()=>n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}}),footer:t.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]})}),headerActions:t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ee,children:t.jsx(te,{size:20})})}),t.jsxs(ee,{align:"end",onClick:Oe,children:[t.jsxs(R,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}})},children:[t.jsx(se,{size:16}),"Open"]}),t.jsxs(R,{variant:"destructive",onClick:a=>{a.stopPropagation(),D({type:"delete",virtualMcp:o})},children:[t.jsx(oe,{size:16}),"Delete"]})]})]})},o.id??"default"))})}):t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:t.jsx(de,{columns:H,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/$project/agents/$agentId",params:{org:r.slug,project:V,agentId:o.id}}),emptyState:s.search?t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(Q,{image:t.jsx(C,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})})})}),e[50]=H,e[51]=s.handleSort,e[52]=s.search,e[53]=s.sortDirection,e[54]=s.sortKey,e[55]=s.viewMode,e[56]=n,e[57]=r.slug,e[58]=x,e[59]=f):f=e[59];let K;return e[60]!==m||e[61]!==u||e[62]!==h||e[63]!==f?(K=t.jsxs(j,{children:[m,u,h,f]}),e[60]=m,e[61]=u,e[62]=h,e[63]=f,e[64]=K):K=e[64],K}function Oe(e){return e.stopPropagation()}function Ee(e){return e.stopPropagation()}function Ke(e){return e.stopPropagation()}function Ve(e){return e.stopPropagation()}function Re(e){return t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:e.updated_at?ze(new Date(e.updated_at)):"—"})}function Te(e){return t.jsx($e,{id:e.updated_by??e.created_by,size:"3xs"})}function Ue(e){return t.jsx(X.Suspense,{fallback:t.jsx(re.Fallback,{}),children:t.jsx(re,{connectionIds:e.connections.map(Le),maxVisibleIcons:2})})}function Le(e){return e.connection_id}function He(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Fe(e){return t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(xe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(C,{size:16})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})]})}function Mt(){const e=ie.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ne,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Be,{})})}),e[0]=r):r=e[0],r}export{Mt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Ae,j as t,B as Ie,b as Ye,d as Ze,u as et,r as tt,O as $e,t as st}from"./index-CgikKIzX.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{a as ot,C as Fe}from"./collection-table-wrapper-1X3tw2a2.js";import{C as it,E as nt}from"./collection-search-Dslk4ok0.js";import{C as rt}from"./card-Cj-GkUHD.js";import{I as ke}from"./integration-icon-B4kJo2_s.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-CgkGkmVE.js";import{a as Be}from"./Copy01-DZUQRIVw.js";import{i as Re}from"./DotsVertical-CJ3pBFjL.js";import{i as Ve}from"./Edit01-Dm0PZjiv.js";import{s as Ge}from"./Eye-BR_9-9sx.js";import{s as Je}from"./Trash01-DTIwE-5T.js";import{E as ze}from"./empty-state-K_49Yi3c.js";import{n as Ee}from"./Inbox01-ImXIGZnT.js";import{U as lt}from"./user-BHCtEUxl.js";import{u as at}from"./use-list-state-BywHZDup.js";import{B as ct}from"./constants-Cc2ACrvf.js";import{A as dt,h as pt,c as mt,b as ut,d as ft,e as ht,a as xt,f as gt}from"./alert-dialog-D90wrdGx.js";import{u as jt,e as Ct}from"./use-connection-0uAZ0JSW.js";import{u as vt}from"./constants-CvFlNMMf.js";import{s as bt}from"./Plus-BnMd-Nlg.js";import{V as yt}from"./layout-8RHk-XUu.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(ke,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(rt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?zt:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(ot,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Me)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(lt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function cs(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:f}=Ze.useSession(),d=f?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=at(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=We(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(it,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(nt,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ut,{children:[de,t.jsxs(ft,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(pt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{cs as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as I,c as P,v as y,j as s,B as oe}from"./index-CgikKIzX.js";import{c as ne,a as ie,D as le,b as re}from"./dropdown-menu-CgkGkmVE.js";import{n as Y}from"./ArrowDown-C1XwJGei.js";import{i as Z}from"./ArrowUp-D96x2aXm.js";import{i as ae}from"./Check-CBQI4sX_.js";import{c as ce}from"./Grid01-DxL3VpUb.js";import{i as de}from"./List-C6WR2hvg.js";import{c as ue,T as fe,a as me,b as xe}from"./tooltip-iSvWdfhX.js";import{T as pe,a as he,b as X,c as ge,d as be,e as ve}from"./table-7t3Ngqct.js";const ee=({size:C=24,color:e="currentColor",...o})=>I.createElement("svg",{viewBox:"0 0 24 24",width:C,height:C,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},I.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));ee.displayName="Sliders01";const je={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function we(C){const e=P.c(66),{value:o,onValueChange:a,options:t,size:f,fullWidth:d,className:r}=C,m=f===void 0?"sm":f,c=d===void 0?!1:d,b=I.useRef(null),u=I.useRef(null);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:0,width:0,opacity:0},e[0]=l):l=e[0];const[i,h]=I.useState(l);let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=K=>{if(!K.current)return;const{offsetLeft:te,offsetWidth:se}=K.current;h({left:te,width:se,opacity:1})},e[1]=x):x=e[1];const j=x;let v;e[2]!==t[0].value||e[3]!==o?(v=()=>{const K=o===t[0].value?b:u;j(K)},e[2]=t[0].value,e[3]=o,e[4]=v):v=e[4];let p;e[5]!==t||e[6]!==o?(p=[o,t],e[5]=t,e[6]=o,e[7]=p):p=e[7],I.useEffect(v,p);const n=je[m];let g;e[8]!==r?(g=y("relative flex gap-0 bg-muted rounded-lg",r),e[8]=r,e[9]=g):g=e[9];let w;e[10]!==a||e[11]!==t[0].value?(w=()=>a(t[0].value),e[10]=a,e[11]=t[0].value,e[12]=w):w=e[12];const N=c?"flex-1 h-12 px-4":n.button,O=!c&&t[0].label?"px-3":"";let z;e[13]!==O||e[14]!==N?(z=y("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",N,O),e[13]=O,e[14]=N,e[15]=z):z=e[15];const A=o===t[0].value?"text-foreground":"text-muted-foreground";let k;e[16]!==n.icon||e[17]!==A?(k=y("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,A),e[16]=n.icon,e[17]=A,e[18]=k):k=e[18];let S;e[19]!==t[0].icon||e[20]!==k?(S=s.jsx("span",{className:k,children:t[0].icon}),e[19]=t[0].icon,e[20]=k,e[21]=S):S=e[21];let T;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(T=t[0].label&&s.jsx("span",{className:y("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=T):T=e[25];let D;e[26]!==z||e[27]!==S||e[28]!==T||e[29]!==w?(D=s.jsxs("button",{ref:b,type:"button",onClick:w,className:z,children:[S,T]}),e[26]=z,e[27]=S,e[28]=T,e[29]=w,e[30]=D):D=e[30];let M;e[31]!==a||e[32]!==t[1].value?(M=()=>a(t[1].value),e[31]=a,e[32]=t[1].value,e[33]=M):M=e[33];const q=c?"flex-1 h-12 px-4":n.button,F=!c&&t[1].label?"px-3":"";let R;e[34]!==q||e[35]!==F?(R=y("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",q,F),e[34]=q,e[35]=F,e[36]=R):R=e[36];const G=o===t[1].value?"text-foreground":"text-muted-foreground";let $;e[37]!==n.icon||e[38]!==G?($=y("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,G),e[37]=n.icon,e[38]=G,e[39]=$):$=e[39];let V;e[40]!==t[1].icon||e[41]!==$?(V=s.jsx("span",{className:$,children:t[1].icon}),e[40]=t[1].icon,e[41]=$,e[42]=V):V=e[42];let _;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(_=t[1].label&&s.jsx("span",{className:y("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=_):_=e[46];let L;e[47]!==M||e[48]!==R||e[49]!==V||e[50]!==_?(L=s.jsxs("button",{ref:u,type:"button",onClick:M,className:R,children:[V,_]}),e[47]=M,e[48]=R,e[49]=V,e[50]=_,e[51]=L):L=e[51];const J=c?"h-12":n.button;let E;e[52]!==J?(E=y("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",J),e[52]=J,e[53]=E):E=e[53];const Q=`${i.left}px`,U=`${i.width}px`;let W;e[54]!==i.opacity||e[55]!==Q||e[56]!==U?(W={left:Q,width:U,opacity:i.opacity},e[54]=i.opacity,e[55]=Q,e[56]=U,e[57]=W):W=e[57];let B;e[58]!==E||e[59]!==W?(B=s.jsx("div",{className:E,style:W}),e[58]=E,e[59]=W,e[60]=B):B=e[60];let H;return e[61]!==D||e[62]!==L||e[63]!==B||e[64]!==g?(H=s.jsxs("div",{className:g,children:[D,L,B]}),e[61]=D,e[62]=L,e[63]=B,e[64]=g,e[65]=H):H=e[65],H}function $e(C){const e=P.c(16),{viewMode:o,onViewModeChange:a,sortKey:t,sortDirection:f,onSort:d,sortOptions:r}=C;let m;e[0]!==r?(m=r===void 0?[]:r,e[0]=r,e[1]=m):m=e[1];const c=m;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ue,{children:s.jsxs(fe,{children:[s.jsx(me,{asChild:!0,children:s.jsx(ie,{asChild:!0,children:s.jsx(oe,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(ee,{size:16})})})}),s.jsx(xe,{children:"Search filters"})]})}),e[2]=b):b=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={value:"table",icon:s.jsx(de,{})},e[3]=u):u=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=[u,{value:"cards",icon:s.jsx(ce,{})}],e[4]=l):l=e[4];let i;e[5]!==a||e[6]!==o?(i=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(we,{value:o,onValueChange:a,fullWidth:!0,options:l})}),e[5]=a,e[6]=o,e[7]=i):i=e[7];let h;e[8]!==d||e[9]!==f||e[10]!==t||e[11]!==c?(h=c.length>0&&d&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),c.map(j=>{const v=t===j.id;return s.jsx(ne,{onClick:()=>d(j.id),className:y("h-8 px-2 py-0 cursor-pointer",v&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[v&&s.jsx(ae,{size:16,className:"text-foreground shrink-0"}),!v&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),v&&f&&(f==="asc"?s.jsx(Z,{size:16,className:"text-foreground shrink-0"}):s.jsx(Y,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=d,e[9]=f,e[10]=t,e[11]=c,e[12]=h):h=e[12];let x;return e[13]!==i||e[14]!==h?(x=s.jsxs(le,{children:[b,s.jsxs(re,{align:"end",className:"w-[200px] p-0 gap-0",children:[i,h]})]}),e[13]=i,e[14]=h,e[15]=x):x=e[15],x}function Ne(C){const e=P.c(29),{columns:o,data:a,sortKey:t,sortDirection:f,onSort:d,onRowClick:r,rowClassName:m}=C;let c;e[0]!==f?(c=function(n,g){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:g&&f&&(f==="asc"?s.jsx(Z,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(Y,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=f,e[1]=c):c=e[1];const b=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=function(n,g){let w="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return n===g-1&&(w="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),w},e[2]=u):u=e[2];const l=u;let i;if(e[3]!==o||e[4]!==d||e[5]!==b||e[6]!==t){let p;e[8]!==o.length||e[9]!==d||e[10]!==b||e[11]!==t?(p=(n,g)=>{const w=t===n.id;return s.jsx(pe,{className:y(l(g,o.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&d?()=>d(n.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&b(n.id,w)]})},n.id)},e[8]=o.length,e[9]=d,e[10]=b,e[11]=t,e[12]=p):p=e[12],i=o.map(p),e[3]=o,e[4]=d,e[5]=b,e[6]=t,e[7]=i}else i=e[7];let h;e[13]!==i?(h=s.jsx(he,{className:"border-b-0",children:s.jsx(X,{className:"h-9 hover:bg-transparent border-b border-border",children:i})}),e[13]=i,e[14]=h):h=e[14];let x;if(e[15]!==o||e[16]!==a||e[17]!==r||e[18]!==m){let p;e[20]!==o||e[21]!==r||e[22]!==m?(p=(n,g)=>{const w=m?.(n);return s.jsx(X,{"data-row-index":g,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",r?"cursor-pointer":"",w),onClick:r?()=>r(n):void 0,children:o.map(N=>s.jsx(ge,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",N.cellClassName,N.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:y(N.wrap?"w-full":"min-w-0 w-full",!N.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:N.render?N.render(n):N.accessor?N.accessor(n):null})},N.id))},g)},e[20]=o,e[21]=r,e[22]=m,e[23]=p):p=e[23],x=a.map(p),e[15]=o,e[16]=a,e[17]=r,e[18]=m,e[19]=x}else x=e[19];let j;e[24]!==x?(j=s.jsx(be,{children:x}),e[24]=x,e[25]=j):j=e[25];let v;return e[26]!==h||e[27]!==j?(v=s.jsxs(ve,{className:"w-full border-collapse",children:[h,j]}),e[26]=h,e[27]=j,e[28]=v):v=e[28],v}function Ve(C){const e=P.c(12),{columns:o,data:a,isLoading:t,sortKey:f,sortDirection:d,onSort:r,onRowClick:m,emptyState:c}=C;if(t===void 0?!1:t){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=l):l=e[0],l}if(a.length===0){let l;e[1]!==c?(l=c||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=c,e[2]=l):l=e[2];let i;return e[3]!==l?(i=s.jsx("div",{className:"flex items-center justify-center h-full",children:l}),e[3]=l,e[4]=i):i=e[4],i}let u;return e[5]!==o||e[6]!==a||e[7]!==m||e[8]!==r||e[9]!==d||e[10]!==f?(u=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ne,{columns:o,data:a,sortKey:f,sortDirection:d,onSort:r,onRowClick:m})}),e[5]=o,e[6]=a,e[7]=m,e[8]=r,e[9]=d,e[10]=f,e[11]=u):u=e[11],u}export{$e as C,we as V,Ve as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as U,j as t,b as Ne,B as Ue,O as ge,aD as it,u as Be,q as gt,c0 as Qe,aB as jt,p as bt,r as X,o as at,bI as vt,bQ as Nt,s as z,aF as Ge,aG as yt,E as ct,e as _t,a as Ct,n as St,k as wt,l as Tt,i as kt,t as ve,K as Je}from"./index-CgikKIzX.js";import{E as Z,C as ze}from"./collection-search-Dslk4ok0.js";import{E as Pt,r as It,e as lt}from"./env-vars-editor-DtCYaIFM.js";import{g as Ke}from"./types-DA9O3-4Z.js";import{S as $t}from"./save-actions-vRwzyds-.js";import{b as At,a as Vt}from"./use-binding-BrV6OHbU.js";import{u as Mt,S as Dt}from"./index-BVNGR9tO.js";import{f as Ot,g as dt}from"./use-connection-0uAZ0JSW.js";import{u as mt}from"./constants-CvFlNMMf.js";import{d as Rt}from"./use-mcp-tools-BN8bfZn3.js";import{b as Et}from"./use-mcp-resources-CgAaDxBc.js";import{a as Lt}from"./decopilot-events-Bt8Q6ljY.js";import{a as Ut}from"./mcp-oauth-BlOxWyfu.js";import{b as Ye,c as Ft,d as Bt,e as zt,B as Kt,a as Xt}from"./breadcrumb-g5L8PoZQ.js";import{C as qt}from"./collection-tabs-eMWLSkiq.js";import{i as Oe}from"./Loading01-9Lg_Mx7W.js";import{V as Xe,a as Ht}from"./layout-8RHk-XUu.js";import{C as Wt}from"./collection-tab-Bjsr3KyB.js";import{I as Qt}from"./icon-picker-XNuq6Ojb.js";import{I as Re}from"./integration-icon-B4kJo2_s.js";import{B as Fe}from"./badge-DuS2OMla.js";import{D as Gt,a as Jt,b as Yt,c as Ze}from"./dropdown-menu-CgkGkmVE.js";import{F as H,a as Zt,b as W,d as K,f as Q,c as Y,e as es}from"./form-BMyUyHR8.js";import{I as G}from"./input-BT1GzEWi.js";import{S as et,a as tt,b as st,c as nt,d as q}from"./select-B8htoZV8.js";import{i as ut}from"./CheckCircle-c8wiOGE1.js";import{t as ts}from"./ChevronDown-sLr8XVsl.js";import{n as ss}from"./Container-B6Xs6_xK.js";import{s as De}from"./Globe02-DSMumXCe.js";import{s as ns}from"./RefreshCcw01-CzWuABhj.js";import{i as os}from"./Terminal-CWZ1oaiF.js";import{s as rs}from"./Trash01-DTIwE-5T.js";import{t as qe}from"./Users03-D9nwvJXd.js";import{s as is}from"./XClose-ChV_2xLJ.js";import{U as as}from"./user-BHCtEUxl.js";import{b as cs,a as ls}from"./use-virtual-mcp-XCW3W4C9.js";import{i as ds}from"./ChevronRight-DvHc-b9M.js";import{s as ms}from"./Plus-BnMd-Nlg.js";import{f as us}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as pt,C as ft}from"./collection-table-wrapper-1X3tw2a2.js";import{C as He}from"./card-Cj-GkUHD.js";import{R as ps}from"./readme-viewer-BJA2EnoQ.js";import{T as fs,a as xs}from"./tools-list-DNBJLnHb.js";import{M as hs}from"./mcp-app-renderer-Bzzuvi2c.js";import"./SearchMd-Br2lRaPk.js";import"./Save01-CPtH6rzJ.js";import"./binder-BCMoHYJm.js";import"./File06-DNepDitQ.js";import"./Key01-gRJDeefs.js";import"./constants-Cc2ACrvf.js";import"./registry-utils-BapNTecL.js";import"./extract-connection-data-DuIP9X1x.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-CuIrTAAm.js";import"./index-ChgCwqm9.js";import"./circle-alert-CrasxNEk.js";import"./index-BlLYz5FA.js";import"./index-BVkROdsW.js";import"./index-YSA_3gRo.js";import"./collapsible-Dz2sA23f.js";import"./use-llm-lqRff0qp.js";import"./useQuery-BEiGk_96.js";import"./localstorage-keys-DSrv9tDi.js";import"./useMutation-CspL2qBT.js";import"./tabs-CfY-0viT.js";import"./checkbox-CKtularS.js";import"./Check-CBQI4sX_.js";import"./dialog-DXvsnaeO.js";import"./X-B_qRWJ2C.js";import"./skeleton-DO02PARZ.js";import"./AlignLeft-fmMf4Dhk.js";import"./ArrowLeft-v0wYt8Zz.js";import"./Image01-CHnBumwc.js";import"./Settings01-CjytruXR.js";import"./useSuspenseInfiniteQuery-Bqpp4FtC.js";import"./infiniteQueryObserver-DsXqsvOO.js";import"./popover-ew-AFjK-.js";import"./spinner-BpG7RgTa.js";import"./tooltip-iSvWdfhX.js";import"./index-Bk2D_7VR.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-D96x2aXm.js";import"./Edit01-Dm0PZjiv.js";import"./XCircle-B4yxlakR.js";import"./AlertCircle-BqSf9XUV.js";import"./use-copy-B9seMJvp.js";import"./Code01-dJCW2bE8.js";import"./use-create-virtual-mcp-DYC0dnj3.js";import"./Copy01-DZUQRIVw.js";import"./marked.esm-BaswSlok.js";import"./markdown-D5PO6M9Q.js";import"./Eye-BR_9-9sx.js";import"./LayersTwo01-D_3HSgdj.js";import"./index-CpowEWO4.js";import"./Clock-CHIf9oFX.js";import"./DotsVertical-CJ3pBFjL.js";import"./empty-state-K_49Yi3c.js";import"./Inbox01-ImXIGZnT.js";import"./use-list-state-BywHZDup.js";import"./use-view-mode-C4bMLQky.js";import"./use-mobile-CePuocbs.js";import"./alert-dialog-D90wrdGx.js";import"./scroll-area-B1PFdc0L.js";import"./Edit05-DhF5NlD_.js";import"./Link01-dup1fxbM.js";import"./label-C45a6iTA.js";import"./avatar-D4ALUDCI.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-C1XwJGei.js";import"./Grid01-DxL3VpUb.js";import"./List-C6WR2hvg.js";import"./table-7t3Ngqct.js";function gs(s){const e=U.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(qe,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let j;e[7]!==n.title?(j=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ds,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==j?(m=t.jsxs(it,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,j,f]}),e[10]=i,e[11]=l,e[12]=j,e[13]=m):m=e[13],m}function ot(s){const e=U.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=Ne(),m=ls();let x;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==l?(x=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:l,project:ge,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=l,e[7]=x):x=e[7];const c=x;if(j){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Oe,{size:16,className:"animate-spin"}):t.jsx(ms,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ue,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(qe,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ue,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function js(s){const e=U.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let j;e[0]!==n?(j={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=j):j=e[1];const f=cs(j);if(!(f.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=b):b=e[8],b}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==f){let u;e[19]!==l?(u=b=>t.jsx(gs,{virtualMcp:b,org:l},b.id),e[19]=l,e[20]=u):u=e[20],r=f.map(u),e[16]=l,e[17]=f,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function bs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Qe({control:s.control,name:"ui_type"}),l=Qe({control:s.control,name:"connection_url"}),{stdioEnabled:j}=jt(),f=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=j||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",c=x?bt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",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(qe,{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."})]}),c&&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:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(H,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsxs(tt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(q,{value:"HTTP",children:"HTTP"}),t.jsx(q,{value:"SSE",children:"SSE"}),t.jsx(q,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:"NPX Package"}),t.jsx(q,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(H,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(W,{className:"flex-1 min-w-0",children:t.jsx(K,{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(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(K,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(os,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Q,{})]})}),a==="NPX"&&t.jsx(H,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(K,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(H,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(K,{children:t.jsx(G,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(H,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(K,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Q,{})]})})]}),t.jsx(H,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(K,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(H,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(K,{children:t.jsx(Pt,{value:r.value??[],onChange:r.onChange})}),t.jsx(Q,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(H,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Gt,{children:[t.jsx(Jt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(ts,{size:12})]})})}),t.jsxs(Yt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ns,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(rs,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.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:()=>r.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(is,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsx(G,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(es,{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(Q,{})]})})]})}function vs(s){const e=U.c(45),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=Be();let m;e[0]!==o.app_name||e[1]!==o.icon||e[2]!==o.title||e[3]!==n.control?(m=o.app_name&&o.icon?t.jsx(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}):t.jsx(gt,{control:n.control,name:"icon",render:k=>{const{field:I}=k;return t.jsx(Qt,{value:I.value,onChange:I.onChange,name:o.title,size:"lg",className:"shadow-sm"})}}),e[0]=o.app_name,e[1]=o.icon,e[2]=o.title,e[3]=n.control,e[4]=m):m=e[4];let x;e[5]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(H,{control:n.control,name:"title",render:ys}),t.jsx(H,{control:n.control,name:"description",render:Ns})]}),e[5]=n.control,e[6]=x):x=e[6];let c;e[7]!==m||e[8]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,x]}),e[7]=m,e[8]=x,e[9]=c):c=e[9];let r;e[10]!==o||e[11]!==n||e[12]!==a||e[13]!==l||e[14]!==j?(r=t.jsx(bs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}),e[10]=o,e[11]=n,e[12]=a,e[13]=l,e[14]=j,e[15]=r):r=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[16]=h):h=e[16];let d;e[17]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[17]=i,e[18]=d):d=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[19]=u):u=e[19];let b;e[20]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(as,{id:o.created_by,size:"2xs"})]}),e[20]=o.created_by,e[21]=b):b=e[21];let v;e[22]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[22]=v):v=e[22];let _;e[23]!==o.updated_at?(_=o.updated_at?us(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[23]=o.updated_at,e[24]=_):_=e[24];let S;e[25]!==_?(S=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[25]=_,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==d||e[29]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,S]}),e[27]=S,e[28]=d,e[29]=b,e[30]=p):p=e[30];let C;e[31]!==o.description||e[32]!==o.icon||e[33]!==o.id||e[34]!==o.title||e[35]!==f.slug?(C=t.jsx(js,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[31]=o.description,e[32]=o.icon,e[33]=o.id,e[34]=o.title,e[35]=f.slug,e[36]=C):C=e[36];let w;e[37]!==p||e[38]!==C||e[39]!==c||e[40]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,C]}),e[37]=p,e[38]=C,e[39]=c,e[40]=r,e[41]=w):w=e[41];let g;return e[42]!==n||e[43]!==w?(g=t.jsx(Zt,{...n,children:w}),e[42]=n,e[43]=w,e[44]=g):g=e[44],g}function Ns(s){const{field:e}=s;return t.jsxs(W,{className:"w-full space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Q,{})]})}function ys(s){const{field:e}=s;return t.jsxs(W,{className:"flex-1 space-y-0",children:[t.jsx(K,{children:t.jsx(G,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Q,{})]})}function _s(s){const e=U.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:j}=s,f=l===void 0?!0:l,m=j===void 0?"This connection doesn't have any prompts yet.":j,x=Ne(),[c,r]=X.useState(""),[h,d]=X.useState("table"),[u,b]=X.useState("name"),[v,_]=X.useState("asc");let S;e[0]!==v||e[1]!==u?(S=T=>{u===T?(_(ks),v==="desc"&&b(void 0)):(b(T),_("asc"))},e[0]=v,e[1]=u,e[2]=S):S=e[2];const p=S;let C;e[3]!==o||e[4]!==x||e[5]!==a||e[6]!==i?(C=T=>{a?a(T):o&&i&&x({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=x,e[5]=a,e[6]=i,e[7]=C):C=e[7];const w=C;let g;if(e[8]!==n||e[9]!==c||e[10]!==v||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const F=c.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(F)||B.description&&B.description.toLowerCase().includes(F))})():n;g=!u||!v?T:[...T].sort((F,B)=>{const je=F[u]||"",ee=B[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=g}else g=e[12];const k=g;let I;e[13]===Symbol.for("react.memo_cache_sentinel")?(I=[{id:"name",header:"Name",render:Ts,sortable:!0},{id:"description",header:"Description",render:ws,cellClassName:"flex-1",sortable:!0}],e[13]=I):I=e[13];const V=I;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=V.filter(Ss).map(Cs),e[14]=M):M=e[14];const L=M;let y;e[15]!==p||e[16]!==f||e[17]!==v||e[18]!==u||e[19]!==h?(y=f&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=v,e[18]=u,e[19]=h,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{T.key==="Escape"&&(r(""),T.target.blur())},e[21]=R):R=e[21];let D;e[22]!==c?(D=t.jsx(ze,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=D):D=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==k||e[31]!==h?(N=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:k.map(T=>t.jsx(He,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(pt,{columns:V,data:k,isLoading:!1,sortKey:u,sortDirection:v,onSort:p,onRowClick:T=>w(T),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=v,e[29]=u,e[30]=k,e[31]=h,e[32]=N):N=e[32];let A;e[33]!==D||e[34]!==N?(A=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,N]}),e[33]=D,e[34]=N,e[35]=A):A=e[35];let $;return e[36]!==A||e[37]!==y?($=t.jsxs(t.Fragment,{children:[y,A]}),e[36]=A,e[37]=y,e[38]=$):$=e[38],$}function Cs(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Ss(s){return s.sortable}function ws(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ts(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ks(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ps(s){const e=U.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(_s,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function Is(s){const e=U.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ps,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function $s(s){const e=U.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,j=a===void 0?"This connection doesn't have any resources yet.":a,[f,m]=X.useState(""),[x,c]=X.useState("table"),[r,h]=X.useState("name"),[d,u]=X.useState("asc");let b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Es),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},e[3]=o,e[4]=_):_=e[4];const S=_;let p;if(e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==r){const N=!n||n.length===0?[]:f.trim()?(()=>{const A=f.toLowerCase();return n.filter($=>$.uri.toLowerCase().includes(A)||$.name&&$.name.toLowerCase().includes(A)||$.description&&$.description.toLowerCase().includes(A))})():n;p=!r||!d?N:[...N].sort((A,$)=>{const T=A[r]||"",F=$[r]||"",B=String(T).localeCompare(String(F));return d==="asc"?B:-B}),e[5]=n,e[6]=f,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const C=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Rs,sortable:!0},{id:"uri",header:"URI",render:Os,sortable:!0},{id:"description",header:"Description",render:Ds,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ms,sortable:!0}],e[10]=w):w=e[10];const g=w;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=g.filter(Vs).map(As),e[11]=k):k=e[11];const I=k;let V;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(V=l&&t.jsx(Xe,{children:t.jsx(ft,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:I})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=V):V=e[17];let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=M):M=e[18];let L;e[19]!==f?(L=t.jsx(ze,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:M}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==v||e[24]!==f||e[25]!==d||e[26]!==r||e[27]!==C||e[28]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:C.length===0?t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:C.map(N=>t.jsx(He,{className:"cursor-pointer transition-colors",onClick:()=>S(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(pt,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>S(N),emptyState:t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j})}),e[21]=j,e[22]=S,e[23]=v,e[24]=f,e[25]=d,e[26]=r,e[27]=C,e[28]=x,e[29]=y):y=e[29];let R;e[30]!==L||e[31]!==y?(R=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,y]}),e[30]=L,e[31]=y,e[32]=R):R=e[32];let D;return e[33]!==R||e[34]!==V?(D=t.jsxs(t.Fragment,{children:[V,R]}),e[33]=R,e[34]=V,e[35]=D):D=e[35],D}function As(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Vs(s){return s.sortable}function Ms(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Os(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Rs(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Es(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ls(s){const e=U.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx($s,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Us=at({key:z().min(1,"Key is required"),value:z()}),Fs=at({title:z().min(1,"Name is required"),description:z().nullable().optional(),icon:z().nullable().optional(),ui_type:yt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:z().optional(),connection_token:z().nullable().optional(),npx_package:z().optional(),stdio_command:z().optional(),stdio_args:z().optional(),stdio_cwd:z().optional(),env_vars:Ge(Us).optional(),configuration_scopes:Ge(z()).nullable().optional(),configuration_state:vt(z(),Nt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Bs(s){const e=U.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(fs,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function zs(s){const e=U.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=Be();let j;e[0]!==o||e[1]!==l.id?(j={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=j):j=e[2];const f=mt(j),[m,x]=X.useState("");let c,r,h,d;if(e[3]!==f||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const v=(n??[]).filter(Ks),_=m.toLowerCase().trim(),S=_?v.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):v;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=g=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const C=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=g=>{g.key==="Escape"&&(x(""),g.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(ze,{value:m,onChange:x,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=S.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"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:S.map(g=>{const k=Ke(g._meta);return t.jsxs(He,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>C(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(hs,{resourceURI:k,toolName:g.name,displayMode:"inline",minHeight:200,maxHeight:200,client:f})}),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:g.name}),t.jsx(xs,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[3]=f,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function Ks(s){return!!Ke(s._meta)}function Xs(s){return s.command==="npx"}function qs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Hs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ws(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Qs(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(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"&&kt(s.connection_headers)){const o=s.connection_headers,i=It(o.envVars);if(Xs(o)){const l=qs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=Hs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}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 Gs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Ws(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Qs(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...o&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Js(s){const e=U.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:j,isUpdating:f,prompts:m,resources:x,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=Ne(h),u=St(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Mt(v),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let C;e[3]!==n?(C={connections:[n],binding:"MCP"},e[3]=n,e[4]=C):C=e[4];const g=Vt(C).length>0,k=n?.metadata?.repository,I=!!k?.url;let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=wt(Fs),e[5]=V):V=e[5];let M;e[6]!==n?(M=rt(n),e[6]=n,e[7]=M):M=e[7];let L;e[8]!==M?(L={resolver:V,values:M},e[8]=M,e[9]=L):L=e[9];const y=Tt(L),R=y.formState.isDirty;let D;e[10]!==y||e[11]!==j?(D=async()=>{if(!await y.trigger())return;const E=y.getValues(),he=Gs(E);await j(he),y.reset(E)},e[10]=y,e[11]=j,e[12]=D):D=e[12];const N=D;let A;e[13]!==n||e[14]!==y?(A=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=A):A=e[15];const $=A;let T;e[16]!==n.id||e[17]!==b||e[18]!==u?(T=async()=>{const{token:P,tokenInfo:E,error:he}=await Ut({connectionId:n.id});if(he||!P){ve.error(`Authentication failed: ${he}`);return}if(E)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:P}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(We){console.warn("Failed to refresh connection tools after OAuth:",We)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:P}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:P}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=T):T=e[19];const F=T;let B;e[20]!==n.id||e[21]!==u?(B=async()=>{try{const P=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!P.ok){const he=await P.text();ve.error(`Failed to remove OAuth: ${he}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(E.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(P){console.error("Error removing OAuth token:",P),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=B):B=e[22];const je=B,ee=c.length,J=m.length,ye=x.length;let _e;e[23]!==c?(_e=c.filter(en),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==I||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let P;e[48]!==I?(P=I?[{id:"readme",label:"README"}]:[],e[48]=I,e[49]=P):P=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Zs):[],...P],e[40]=l,e[41]=I,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Ys)?"tools":"settings",O=be.some(P=>P.id===a)?a:xt;let Te;e[50]!==d?(Te=P=>{d({search:E=>({...E,tab:P}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==O||e[55]!==ie){let P;e[57]!==O?(P=E=>E.name===O,e[57]=O,e[58]=P):P=e[58],ke=ie.find(P),e[54]=O,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(Bt,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(zt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ft,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(Kt,{children:t.jsxs(Xt,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==$||e[69]!==R||e[70]!==f?(le=t.jsx(Xe,{children:t.jsx($t,{onSave:N,onUndo:$,isDirty:R,isSaving:f})}),e[67]=N,e[68]=$,e[69]=R,e[70]=f,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==F||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(vs,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=F,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==O||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(qt,{tabs:be,activeTab:O,onTabChange:re,className:"flex-1"})}),e[79]=O,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==O||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==F||e[92]!==re||e[93]!==g||e[94]!==I||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==k||e[100]!==x||e[101]!==c?(ue=t.jsx(X.Suspense,{fallback:Ae,children:O==="tools"?t.jsx(Bs,{tools:c,connectionId:o,org:i,isLoading:r}):O==="ui"?t.jsx(zs,{tools:c,connectionId:o,org:i}):O==="prompts"?t.jsx(Ps,{prompts:m,connectionId:o,org:i}):O==="resources"?t.jsx(Ls,{resources:x,connectionId:o,org:i}):O==="settings"?t.jsx(Dt,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:F,onViewReadme:I?()=>re("readme"):void 0}):O==="readme"&&I?t.jsx(Is,{repository:k}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},O):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=O,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=F,e[92]=re,e[93]=g,e[94]=I,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=k,e[100]=x,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==O||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},O)}),e[103]=O,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(Ht,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Ys(s){return s.id==="tools"}function Zs(s){return{id:s.name,label:s.displayName}}function en(s){return!!Ke(s._meta)}function tn(){const s=U.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ne(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:i,org:a}=_t(o),{org:l}=Be();let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=j):j=s[2];const m=Ct(j).tab??"",x=Ot(i),c=dt(),r=At(x??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Lt(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Et(v),S=x?.connection_type==="VIRTUAL";let p;s[10]!==d||s[11]!==S?(p={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=p):p=s[12];const{data:C,isLoading:w}=Rt(p);let g;s[13]!==b?.prompts?(g=b?.prompts??[],s[13]=b?.prompts,s[14]=g):g=s[14];let k;s[15]!==g?(k=g.map(on),s[15]=g,s[16]=k):k=s[16];const I=k;let V;s[17]!==_?.resources?(V=_?.resources??[],s[17]=_?.resources,s[18]=V):V=s[18];let M;s[19]!==V?(M=V.map(nn),s[19]=V,s[20]=M):M=s[20];const L=M;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(sn):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let D;s[25]!==c.update||s[26]!==i?(D=async $=>{await c.update.mutateAsync({id:i,data:$})},s[25]=c.update,s[26]=i,s[27]=D):D=s[27];const N=D;if(!x){let $;return s[28]!==n||s[29]!==a?($=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=$):$=s[30],$}let A;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==N||s[36]!==w||s[37]!==a||s[38]!==I||s[39]!==m||s[40]!==L||s[41]!==R?(A=t.jsx(Js,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:N,isUpdating:c.update.isPending,prompts:I,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=N,s[36]=w,s[37]=a,s[38]=I,s[39]=m,s[40]=L,s[41]=R,s[42]=A):A=s[42],A}function sn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function nn(s){return{uri:s.uri,name:s.name,description:s.description}}function on(s){return{name:s.name,description:s.description}}function rn(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),s[0]=e):e=s[0],e}function fr(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(rn,{}),s[0]=e):e=s[0],e}export{fr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as be,j as e,E as Fe,r as X,u as Be,n as Ue,b as He,a as Le,d as Me,aB as ze,l as Re,k as Xe,i as We,B as S,O as f,t as D,o as ke,aF as Ke,s as g,aG as Ge}from"./index-CgikKIzX.js";import{g as qe}from"./generate-id-Dyweu44Y.js";import{C as Qe,a as Je}from"./collection-table-wrapper-1X3tw2a2.js";import{C as Ye,E as L}from"./collection-search-Dslk4ok0.js";import{C as Ze}from"./connection-card-M2mu32Xr.js";import{B as M}from"./badge-DuS2OMla.js";import{i as et}from"./AlertCircle-BqSf9XUV.js";import{i as tt}from"./CheckCircle-c8wiOGE1.js";import{I as nt}from"./integration-icon-B4kJo2_s.js";import{P as E}from"./index-CpowEWO4.js";import{U as re}from"./user-BHCtEUxl.js";import{u as st}from"./use-binding-BrV6OHbU.js";import{u as ot}from"./use-list-state-BywHZDup.js";import{f as rt,e as it}from"./registry-utils-BapNTecL.js";import{f as ie,a as ae,b as ce,c as le,d as de,e as me,A as ue,h as pe}from"./alert-dialog-D90wrdGx.js";import{B as at,a as ct,b as lt,c as dt}from"./breadcrumb-g5L8PoZQ.js";import{D as mt,a as ut,b as pt,c as xt,d as ht,e as gt}from"./dialog-DXvsnaeO.js";import{D as xe,a as he,b as ge,c as F}from"./dropdown-menu-CgkGkmVE.js";import{a as ft,F as j,b as y,c as v,d as _,f as C}from"./form-BMyUyHR8.js";import{I as T}from"./input-BT1GzEWi.js";import{S as jt,a as yt,b as vt,c as _t,d as $}from"./select-B8htoZV8.js";import{T as Ct}from"./textarea-C9UUVIil.js";import{g as Nt,h as bt}from"./use-connection-0uAZ0JSW.js";import{u as fe,a as kt}from"./constants-CvFlNMMf.js";import{b as wt}from"./use-mcp-tools-BN8bfZn3.js";import{n as z}from"./Container-B6Xs6_xK.js";import{i as je}from"./DotsVertical-CJ3pBFjL.js";import{s as ye}from"./Eye-BR_9-9sx.js";import{s as R}from"./Globe02-DSMumXCe.js";import{i as St}from"./Loading01-9Lg_Mx7W.js";import{i as Tt}from"./Terminal-CWZ1oaiF.js";import{s as ve}from"./Trash01-DTIwE-5T.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as Dt,E as Pt,e as we}from"./env-vars-editor-DtCYaIFM.js";import"./ArrowDown-C1XwJGei.js";import"./ArrowUp-D96x2aXm.js";import"./Check-CBQI4sX_.js";import"./Grid01-DxL3VpUb.js";import"./List-C6WR2hvg.js";import"./tooltip-iSvWdfhX.js";import"./index-Bk2D_7VR.js";import"./table-7t3Ngqct.js";import"./SearchMd-Br2lRaPk.js";import"./card-Cj-GkUHD.js";import"./localstorage-keys-DSrv9tDi.js";import"./useQuery-BEiGk_96.js";import"./useMutation-CspL2qBT.js";import"./avatar-D4ALUDCI.js";import"./binder-BCMoHYJm.js";import"./use-view-mode-C4bMLQky.js";import"./use-mobile-CePuocbs.js";import"./ChevronRight-DvHc-b9M.js";import"./X-B_qRWJ2C.js";import"./label-C45a6iTA.js";import"./ChevronDown-sLr8XVsl.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-BnMd-Nlg.js";function Ce(s){const o=be.c(3),{status:i}=s;if(i==="active"){let c;return o[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(tt,{size:12}),"Active"]}),o[0]=c):c=o[0],c}if(i==="error"){let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(M,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(et,{size:12}),"Error"]}),o[1]=c):c=o[1],c}let m;return o[2]===Symbol.for("react.memo_cache_sentinel")?(m=e.jsx(M,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),o[2]=m):m=o[2],m}const It=ke({key:g(),value:g()}),Et=ke({title:g().min(1,"Name is required"),description:g().nullable().optional(),icon:g().nullable().optional(),ui_type:Ge(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:g().optional(),connection_token:g().nullable().optional(),npx_package:g().optional(),stdio_command:g().optional(),stdio_args:g().optional(),stdio_cwd:g().optional(),env_vars:Ke(It).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function U(s){const o=s.trim();if(!o)return"";try{const i=new URL(o),m=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${m}`}catch{return o.replace(/\/+$/,"")}}function $t(s){const o=s.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=o.slice(1).find(N=>!N.startsWith("-"));return c?{packageName:c}:null}function B(s){const{uiType:o}=s,i=U(s.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===U("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const m=(s.npxPackage??"").trim();return o==="NPX"&&m==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Ne(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const o=U(s.connectionUrl??"");if(!o)return null;const i=s.registryItems.find(N=>(N.server?.remotes??[]).some(O=>U(O.url??"")===o));if(!i)return null;const m=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return m?{id:"registry",title:m,description:c}:null}function Ot(s,o){const i={command:"npx",args:["-y",s]},m=we(o);return Object.keys(m).length>0&&(i.envVars=m),i}function At(s,o,i,m){const c={command:s};o.trim()&&(c.args=o.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const N=we(m);return Object.keys(N).length>0&&(c.envVars=N),c}function Vt(s){return s.command==="npx"}function Ft(s){return s.args?.find(o=>!o.startsWith("-"))??""}function Bt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ut(s,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"force-delete":return{mode:"force-deleting",connection:o.connection,agentNames:o.agentNames};case"close":return{mode:"idle"}}}function Ht(){const{org:s}=Be(),o=Ue(),i=He(),m=Le({strict:!1}),{data:c}=Me.useSession(),{stdioEnabled:N}=ze(),d=ot({namespace:s.slug,resource:"connections"}),O=Nt(),A=bt(d),[u,b]=X.useReducer(Ut,{mode:"idle"}),W=st(A)[0],K=W?.id??"",G=rt(W?.tools),Se=fe({connectionId:K||null,orgId:s.id}),{data:Te}=wt({client:Se,toolName:G,toolArguments:{limit:200},enabled:!!(K&&G),staleTime:3600*1e3,select:t=>t.structuredContent??t}),q=it(Te??[]),Q=m.action==="create",De=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:f},search:{action:"create"}})},J=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:f},search:{}})},r=Re({resolver:Xe(Et),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=r.watch("ui_type"),Y=r.watch("connection_url"),Pe=r.watch("npx_package"),P=B({uiType:p,connectionUrl:Y??"",npxPackage:Pe??""})??Ne({uiType:p,connectionUrl:Y??"",registryItems:q}),l=u.mode==="editing"?u.connection:null;X.useEffect(()=>{if(l){const t=We(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const n=Dt(t.envVars);if(Vt(t)){const a=Ft(t);r.reset({title:l.title,description:l.description,icon:l.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:n})}else{const a=Bt(t);r.reset({title:l.title,description:l.description,icon:l.icon??null,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:n})}}else r.reset({title:l.title,description:l.description,icon:l.icon??null,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const Z=fe({connectionId:kt,orgId:s.id}),ee=()=>{o.invalidateQueries({predicate:t=>{const n=t.queryKey;return n[1]===s.id&&n[3]==="collection"&&n[4]==="CONNECTIONS"}})},te=t=>{const n=t.content;return Array.isArray(n)&&n[0]?.type==="text"&&typeof n[0].text=="string"?n[0].text:"Unknown error"},Ie=async()=>{if(u.mode!=="deleting")return;const t=u.connection;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t.id}});if(n.isError){const a=te(n),k=a.replace(/^Error:\s*/,"");try{const x=JSON.parse(k);if(x.code==="CONNECTION_IN_USE"&&x.agentNames){b({type:"force-delete",connection:t,agentNames:x.agentNames.map(w=>`"${w}"`).join(", ")});return}}catch{}D.error(`Failed to delete connection: ${a}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},Ee=async()=>{if(u.mode!=="force-deleting")return;const t=u.connection.id;b({type:"close"});try{const n=await Z.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:t,force:!0}});if(n.isError){D.error(`Failed to delete connection: ${te(n)}`);return}ee(),D.success("Connection deleted successfully")}catch(n){const a=n instanceof Error?n.message:String(n);D.error(`Failed to delete connection: ${a}`)}},$e=async t=>{let n,a=null,k=null,x=null;if(t.ui_type==="NPX"?(n="STDIO",a="",x=Ot(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(n="STDIO",a="",x=At(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(n=t.ui_type,a=t.connection_url||"",k=t.connection_token||null),l){await O.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,icon:t.icon??null,connection_type:n,connection_url:a,...k&&{connection_token:k},...x&&{connection_headers:x}}}),b({type:"close"}),r.reset();return}const w=qe("conn");await O.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:n,connection_url:a,connection_token:k,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:c?.user?.id||"system",organization_id:s.id,icon:t.icon??null,app_name:null,app_id:null,connection_headers:x,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),J(),r.reset(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:f,connectionId:w}})},ne=t=>{t||(Q?J():b({type:"close"}),r.reset())},V=t=>{const n=t.trim();if(!n)return;const a=!!r.formState.dirtyFields.title,k=!!r.formState.dirtyFields.description,x=!!r.formState.dirtyFields.env_vars,w=h=>{if(h&&(!a&&!r.getValues("title").trim()&&h.title&&r.setValue("title",h.title,{shouldDirty:!1}),!k&&!(r.getValues("description")??"").trim()&&h.description&&r.setValue("description",h.description,{shouldDirty:!1}),!x&&h.envVarKeys?.length)){const se=r.getValues("env_vars")??[],Ve=new Set(se.map(I=>I.key)),oe=h.envVarKeys.filter(I=>!Ve.has(I));oe.length>0&&r.setValue("env_vars",[...se,...oe.map(I=>({key:I,value:""}))],{shouldDirty:!0})}},H=$t(n);if(H&&N){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w(B({uiType:"NPX",npxPackage:H.packageName}));return}if(n.startsWith("http://")||n.startsWith("https://")){const h=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";r.setValue("ui_type",h,{shouldDirty:!0}),r.setValue("connection_url",n,{shouldDirty:!0}),w(B({uiType:h,connectionUrl:n})??Ne({uiType:h,connectionUrl:n,registryItems:q}));return}p==="NPX"&&w(B({uiType:"NPX",npxPackage:n}))},Oe=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(nt,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(Ce,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?_e(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:f,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],Ae=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:f}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(S,{onClick:De,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(E,{children:[e.jsx(mt,{open:Q||u.mode==="editing",onOpenChange:ne,children:e.jsxs(ut,{className:"sm:max-w-[525px]",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:l?"Edit Connection":"Create Connection"}),e.jsx(ht,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ft,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit($e),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(j,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"Type *"}),e.jsxs(jt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(_,{children:e.jsx(yt,{children:e.jsx(vt,{})})}),e.jsxs(_t,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(C,{})]})}),p==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(j,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"NPM Package *"}),e.jsx(_,{children:e.jsx(T,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("npx_package",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(C,{})]})})}),p==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(j,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"Command *"}),e.jsx(_,{children:e.jsx(T,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"Arguments"}),e.jsx(_,{children:e.jsx(T,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(C,{})]})})]}),e.jsx(j,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"Working Directory"}),e.jsx(_,{children:e.jsx(T,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(C,{})]})})]}),(p==="NPX"||p==="STDIO")&&e.jsx(j,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"Environment Variables"}),e.jsx(_,{children:e.jsx(Pt,{value:t.value??[],onChange:t.onChange})}),e.jsx(C,{})]})}),p!=="NPX"&&p!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"URL *"}),e.jsx(_,{children:e.jsx(T,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:n=>{const a=n.clipboardData.getData("text");a&&(n.preventDefault(),r.setValue("connection_url",a.trim(),{shouldDirty:!0}),V(a))},onBlur:n=>{V(n.target.value),t.onBlur()}})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:P?.token?.label??"Token (optional)"}),e.jsx(_,{children:e.jsx(T,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.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"})]})]}),e.jsx(C,{})]})})]}),e.jsx(j,{control:r.control,name:"title",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"Name *"}),e.jsx(_,{children:e.jsx(T,{placeholder:"My Connection",...t})}),e.jsx(C,{})]})}),e.jsx(j,{control:r.control,name:"description",render:({field:t})=>e.jsxs(y,{children:[e.jsx(v,{children:"Description"}),e.jsx(_,{children:e.jsx(Ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(C,{})]})})]}),e.jsxs(gt,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>ne(!1),children:"Cancel"}),e.jsx(S,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ie,{open:u.mode==="deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Delete Connection?"}),e.jsxs(de,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="deleting"&&u.connection.title}),"."]})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ie,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{open:u.mode==="force-deleting",onOpenChange:t=>!t&&b({type:"close"}),children:e.jsxs(ae,{children:[e.jsxs(ce,{children:[e.jsx(le,{children:"Connection Used by Agents"}),e.jsx(de,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{children:["The connection"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.connection.title})," ","is currently used by the following agent(s):"," ",e.jsx("span",{className:"font-medium text-foreground",children:u.mode==="force-deleting"&&u.agentNames}),"."]}),e.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),e.jsxs(me,{children:[e.jsx(ue,{children:"Cancel"}),e.jsx(pe,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),e.jsxs(E.Header,{children:[e.jsx(E.Header.Left,{children:e.jsx(at,{children:e.jsx(ct,{children:e.jsx(lt,{children:e.jsx(dt,{children:"Connections"})})})})}),e.jsxs(E.Header.Right,{children:[e.jsx(Qe,{viewMode:d.viewMode,onViewModeChange:d.setViewMode,sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.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"}]}),Ae]})]}),e.jsx(Ye,{value:d.search,onChange:d.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(d.setSearch(""),t.target.blur())}}),e.jsx(E.Content,{children:d.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:A.length===0?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(d.search,"No Connections found"),description:d.search?`No Connections match "${d.search}"`:"Create a connection to get started.",actions:!d.search&&e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:f}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:A.map(t=>e.jsx(Ze,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:f,connectionId:t.id}}),headerActions:e.jsxs(xe,{children:[e.jsx(he,{asChild:!0,children:e.jsx(S,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:n=>n.stopPropagation(),children:e.jsx(je,{size:20})})}),e.jsxs(ge,{align:"end",onClick:n=>n.stopPropagation(),children:[e.jsxs(F,{onClick:n=>{n.stopPropagation(),i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:f,connectionId:t.id}})},children:[e.jsx(ye,{size:16}),"Open"]}),e.jsxs(F,{variant:"destructive",onClick:n=>{n.stopPropagation(),b({type:"delete",connection:t})},children:[e.jsx(ve,{size:16}),"Delete"]})]})]}),body:e.jsx(Ce,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(re,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?_e(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Je,{columns:Oe,data:A,isLoading:!1,sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,onRowClick:t=>i({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:f,connectionId:t.id}}),emptyState:d.search?e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${d.search}"`}):e.jsx(L,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(S,{variant:"outline",onClick:()=>i({to:"/$org/$project/store",params:{org:s.slug,project:f}}),children:"Browse Store"})})})})})})})]})}function Xn(){const s=be.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Fe,{children:e.jsx(X.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(St,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ht,{})})}),s[0]=o):o=s[0],o}export{Xn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a0 as a,a1 as t}from"./index-CgikKIzX.js";const e=a(t,{target:"draft-7"});export{e as B};
|