decocms 2.172.0 → 2.172.1
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-BvnCc6-D.js → AlertCircle-DBHSxle0.js} +1 -1
- package/dist/client/assets/{AlignLeft-Du0NczL1.js → AlignLeft-BZi0b3qg.js} +1 -1
- package/dist/client/assets/{ArrowDown-C_8n0unK.js → ArrowDown-J5qOTRoA.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BQgzcaok.js → ArrowLeft-Cke1NjsZ.js} +1 -1
- package/dist/client/assets/{ArrowUp-o0gFtaSp.js → ArrowUp-aSx0u-5l.js} +1 -1
- package/dist/client/assets/{Check-BxC8tao2.js → Check-B8ndkg7T.js} +1 -1
- package/dist/client/assets/{CheckCircle-D_nIOFVe.js → CheckCircle-DAXfTEK-.js} +1 -1
- package/dist/client/assets/{CheckDone01-CakzFmCS.js → CheckDone01-CKxo2Bt7.js} +1 -1
- package/dist/client/assets/{CheckVerified02-B0-uBz5z.js → CheckVerified02-3DuNYJZt.js} +1 -1
- package/dist/client/assets/{ChevronDown-B6clHAxQ.js → ChevronDown-D9wVK5bH.js} +1 -1
- package/dist/client/assets/{ChevronLeft-ByevmkD8.js → ChevronLeft-DcNKgEQb.js} +1 -1
- package/dist/client/assets/{ChevronRight-BZWqxnWE.js → ChevronRight-BWpUvEdI.js} +1 -1
- package/dist/client/assets/{ChevronUp-DxXRh85A.js → ChevronUp-pA-2UtBp.js} +1 -1
- package/dist/client/assets/{Clock-aoVUv0E3.js → Clock-Bp-LAqbC.js} +1 -1
- package/dist/client/assets/{Code01-BfCMg42R.js → Code01-ChPYGYfB.js} +1 -1
- package/dist/client/assets/{Coins01-CRttGRCL.js → Coins01-CEldpOw2.js} +1 -1
- package/dist/client/assets/{Container-CHE6pZ9r.js → Container-CLsUjxhY.js} +1 -1
- package/dist/client/assets/{Copy01-Wuk9LRR2.js → Copy01-CgG_OJP6.js} +1 -1
- package/dist/client/assets/{Dataflow03-DheawpLZ.js → Dataflow03-DUfN03Mp.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-D5nivPvW.js → DotsHorizontal-COn1MVBJ.js} +1 -1
- package/dist/client/assets/{DotsVertical-CgdYQJ7U.js → DotsVertical-B6C_2FFD.js} +1 -1
- package/dist/client/assets/{Download01-DTYQtrJQ.js → Download01-BgosRgo9.js} +1 -1
- package/dist/client/assets/{Edit01-BKkVXIhK.js → Edit01-BYoLi1wi.js} +1 -1
- package/dist/client/assets/{Edit05-BvgGPrtV.js → Edit05-CXzMSTEE.js} +1 -1
- package/dist/client/assets/{Eye-geJ1dSoO.js → Eye-MtNtMWW5.js} +1 -1
- package/dist/client/assets/{EyeOff-ClRv57XC.js → EyeOff-CY8Gwzvd.js} +1 -1
- package/dist/client/assets/{File02-C3A15tgy.js → File02-CBJOSTF8.js} +1 -1
- package/dist/client/assets/{File06-CJDVZeqU.js → File06-021s902A.js} +1 -1
- package/dist/client/assets/{FilterLines-DABMr8G9.js → FilterLines-zxDuDuuJ.js} +1 -1
- package/dist/client/assets/{Globe01-7vtf7Y1x.js → Globe01-BrfugmTH.js} +1 -1
- package/dist/client/assets/{Globe02-zQio7SJP.js → Globe02-D4GwpBVP.js} +1 -1
- package/dist/client/assets/{Grid01-CgI0fqut.js → Grid01-Cx4wu3Y9.js} +1 -1
- package/dist/client/assets/{Hash02-Bng1Hle8.js → Hash02-hnhH9Jxc.js} +1 -1
- package/dist/client/assets/{Home02-D1KSrO9o.js → Home02-DyHu25ax.js} +1 -1
- package/dist/client/assets/{Image01-BLsRmD6t.js → Image01-T3g4Xdvf.js} +1 -1
- package/dist/client/assets/{Inbox01-DGQRZkXS.js → Inbox01-BXbJXxyv.js} +1 -1
- package/dist/client/assets/{InfoCircle-DvSUioPF.js → InfoCircle-Da_z8Szm.js} +1 -1
- package/dist/client/assets/{Key01-Dib7ammN.js → Key01-4NZitUKS.js} +1 -1
- package/dist/client/assets/{LayersTwo01-BmzCQYk2.js → LayersTwo01-670JTIpk.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CWuWCiNa.js → LayoutLeft-CIpulo-e.js} +1 -1
- package/dist/client/assets/{Link01-DwbGnCZ-.js → Link01-BXmFSJRd.js} +1 -1
- package/dist/client/assets/{LinkExternal01-3ULSi1GW.js → LinkExternal01-Bq8XeN8a.js} +1 -1
- package/dist/client/assets/{List-3zjBAIRS.js → List-B0bmeecJ.js} +1 -1
- package/dist/client/assets/{Loading01-BbnQsfMx.js → Loading01-B87VIClz.js} +1 -1
- package/dist/client/assets/{Lock01-ClyjUTBv.js → Lock01-BdaMZYNr.js} +1 -1
- package/dist/client/assets/{Play-p1Z3ioGY.js → Play-DBH8t0rX.js} +1 -1
- package/dist/client/assets/{Plus-BJUL5Wvq.js → Plus-CDc4R7NF.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Dfcp2VAx.js → RefreshCcw01-CiW1ymIS.js} +1 -1
- package/dist/client/assets/{Save01-BNoezVOP.js → Save01-SGB22t4q.js} +1 -1
- package/dist/client/assets/{SearchMd-BJkDuyJ3.js → SearchMd-DEv7e_hZ.js} +1 -1
- package/dist/client/assets/{Settings01-k8tDFeX4.js → Settings01-ovVBguWq.js} +1 -1
- package/dist/client/assets/{Shield01-XMvdJvy8.js → Shield01-D18ahoYD.js} +1 -1
- package/dist/client/assets/{Terminal-Bq1nd15g.js → Terminal-DNbN4GE7.js} +1 -1
- package/dist/client/assets/{Trash01-BEjbK4f6.js → Trash01-DC96NOta.js} +1 -1
- package/dist/client/assets/{Upload01-r0pGX4kR.js → Upload01-BW9BwfoA.js} +1 -1
- package/dist/client/assets/{Users03-DTCxnqPZ.js → Users03-cvM2Ndk1.js} +1 -1
- package/dist/client/assets/{X-CEnrrbAn.js → X-C5okAsgi.js} +1 -1
- package/dist/client/assets/{XCircle-BKAmr_f6.js → XCircle-CFDOKqbE.js} +1 -1
- package/dist/client/assets/{XClose-CRDqusrl.js → XClose-BHPDEFB2.js} +1 -1
- package/dist/client/assets/{Zap-CNayKvai.js → Zap-CkD-kOX3.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-DWjxgkFC.js → agent-connections-preview-BlJ035nM.js} +1 -1
- package/dist/client/assets/{agent-detail-qPTQbHAB.js → agent-detail-NABTJfFm.js} +1 -1
- package/dist/client/assets/{agents-De8iH2o7.js → agents-CK1zn3pf.js} +1 -1
- package/dist/client/assets/{alert-dialog-B77zp5_9.js → alert-dialog-BQU839b3.js} +1 -1
- package/dist/client/assets/{auth-catchall-ajIqzmLh.js → auth-catchall-CuvA1tS7.js} +1 -1
- package/dist/client/assets/{automation-detail-l1ds4Esy.js → automation-detail-BnVlIGOj.js} +1 -1
- package/dist/client/assets/{automations-D-ICSDP7.js → automations-9UyxTFnE.js} +1 -1
- package/dist/client/assets/{avatar-DUHTdDSS.js → avatar-BzF6Jb9Z.js} +1 -1
- package/dist/client/assets/{badge-B33icYfV.js → badge-DSBNODR5.js} +1 -1
- package/dist/client/assets/{binder-C4RsQP3G.js → binder-Df6Go4wZ.js} +1 -1
- package/dist/client/assets/{breadcrumb-C11JDZLD.js → breadcrumb-C0C7xCxQ.js} +1 -1
- package/dist/client/assets/{card-Bfa3ZJIC.js → card-3wGXs2xF.js} +1 -1
- package/dist/client/assets/{chart-BLla5WT3.js → chart-DpmD8a68.js} +1 -1
- package/dist/client/assets/{checkbox-BuLFRc1C.js → checkbox-B3Rpe7-l.js} +1 -1
- package/dist/client/assets/{collapsible-DDvEBvNF.js → collapsible-Df2r9Beq.js} +1 -1
- package/dist/client/assets/{collection-detail-Bi5TVIvY.js → collection-detail-Bx2S4wNW.js} +1 -1
- package/dist/client/assets/{collection-display-button-CB65ibr7.js → collection-display-button-Dbmpw-3P.js} +1 -1
- package/dist/client/assets/{collection-search-C-DUGZUN.js → collection-search-Bl8CXpst.js} +1 -1
- package/dist/client/assets/{collection-tab-dHFGyC1m.js → collection-tab-Zi-tIaoO.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CNWTcnzH.js → collection-table-wrapper-CWpzycma.js} +1 -1
- package/dist/client/assets/{collection-tabs-hNcG012s.js → collection-tabs-XXmKF6cf.js} +1 -1
- package/dist/client/assets/{command-B_9ik1cM.js → command-DsOv8SIr.js} +1 -1
- package/dist/client/assets/{connect-DfuwjHHd.js → connect-DHGLggyX.js} +1 -1
- package/dist/client/assets/{connection-card-zeX_VYK4.js → connection-card-N3Tx1qhb.js} +1 -1
- package/dist/client/assets/{connection-detail-jw7eh9PA.js → connection-detail-D3Kdf77j.js} +1 -1
- package/dist/client/assets/{connection-status-DFBDMZAF.js → connection-status-BzysCDJU.js} +1 -1
- package/dist/client/assets/{connections-B6AcPhdJ.js → connections-CZhVovQk.js} +1 -1
- package/dist/client/assets/{constants-uVLQN0jY.js → constants-B4i933q7.js} +1 -1
- package/dist/client/assets/constants-BLiDtBGA.js +1 -0
- package/dist/client/assets/{context-ClCBXQoI.js → context-vne_tDFm.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-D_k6cEfv.js → create-organization-dialog-BhY0HdLQ.js} +1 -1
- package/dist/client/assets/{create-project-dialog-F0Ewm4t_.js → create-project-dialog-BLIvPVWr.js} +1 -1
- package/dist/client/assets/{danger-oup6oh4U.js → danger-lReiiLi3.js} +1 -1
- package/dist/client/assets/{danger-zone-vsCYRE0x.js → danger-zone-B5x8MB5G.js} +1 -1
- package/dist/client/assets/{dependencies-CACLYIk-.js → dependencies-6FYvuL0W.js} +1 -1
- package/dist/client/assets/{dialog-CvddUtOS.js → dialog-CflsNx8x.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CNJ1rfC3.js → dropdown-menu-DcNTx9lg.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Cl4-VlSa.js → dynamic-plugin-layout-t1gg8oRt.js} +1 -1
- package/dist/client/assets/{editable-task-title-BGawVgqA.js → editable-task-title-DD2nEqgz.js} +1 -1
- package/dist/client/assets/{empty-state-CpzrK9g6.js → empty-state-BJQVSVey.js} +1 -1
- package/dist/client/assets/{empty-state-CP4jllwU.js → empty-state-XvkhVm2a.js} +1 -1
- package/dist/client/assets/{env-vars-editor-CchFdE5U.js → env-vars-editor-D0IVO2-N.js} +1 -1
- package/dist/client/assets/{extract-connection-data-_6Kh3We4.js → extract-connection-data-Dcq9_d1D.js} +1 -1
- package/dist/client/assets/{file-browser-DnLypKL_.js → file-browser-B7VwaOBu.js} +2 -2
- package/dist/client/assets/{form-DmTtx5UX.js → form-t-VTqwHW.js} +1 -1
- package/dist/client/assets/{general-W7HUJ0d1.js → general-CHmY6WCR.js} +1 -1
- package/dist/client/assets/{grid-view-DcSLIihL.js → grid-view-CObD1ODK.js} +1 -1
- package/dist/client/assets/{home-CrqfmLIg.js → home-DAdz-q5X.js} +1 -1
- package/dist/client/assets/{icon-picker-DHh5HlMd.js → icon-picker-CXAPe9ug.js} +1 -1
- package/dist/client/assets/{index-MC5fCcRU.js → index-BPNTL7B5.js} +1 -1
- package/dist/client/assets/{index-BJ81Vsww.js → index-BUP2j-VZ.js} +3 -3
- package/dist/client/assets/{index-Cv3zhjFc.js → index-C1_svsm9.js} +1 -1
- package/dist/client/assets/{index-BKYpmcE7.js → index-CRVyuFS0.js} +1 -1
- package/dist/client/assets/{index-RAS9JMxX.js → index-CZ74MLAU.js} +1 -1
- package/dist/client/assets/{index-BvJY4WDC.js → index-CgdCtkSt.js} +1 -1
- package/dist/client/assets/{index-XiB7e0AL.js → index-D-cm4gF6.js} +1 -1
- package/dist/client/assets/{index-BX8jl6GF.js → index-D2ROEW_j.js} +1 -1
- package/dist/client/assets/{index-Bb9MktBE.js → index-D9ujiDbX.js} +1 -1
- package/dist/client/assets/{index-BYvtYdJ1.js → index-iDNDhzRC.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DyqlIjS8.js → infiniteQueryObserver-ueKf4rCa.js} +1 -1
- package/dist/client/assets/{input-95A3RU7n.js → input-OS0sGs_c.js} +1 -1
- package/dist/client/assets/{integration-icon-DKPtAPgu.js → integration-icon-DhNWPq_0.js} +1 -1
- package/dist/client/assets/{label-CKi_xgKG.js → label-Cj5QTzyK.js} +1 -1
- package/dist/client/assets/{layout-KmDEzVfx.js → layout-BjgZH_LK.js} +1 -1
- package/dist/client/assets/{layout-CacZ9vAP.js → layout-CunxSw7b.js} +1 -1
- package/dist/client/assets/login-BF9hcIwR.js +1 -0
- package/dist/client/assets/{logo-upload-aOk9IMA5.js → logo-upload-dZtFly9d.js} +1 -1
- package/dist/client/assets/{markdown-DrAh7zaw.js → markdown-BEHkpiAe.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CeIZPzvW.js → mcp-app-renderer-CqfIV03X.js} +1 -1
- package/dist/client/assets/{mcp-server-card-CZA2yTqZ.js → mcp-server-card-DnXtIYiQ.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Cjp4DUbD.js → mcp-server-detail-B5_9wNbY.js} +2 -2
- package/dist/client/assets/{members-dxBgS07V.js → members-BeuYhjqH.js} +1 -1
- package/dist/client/assets/{monaco-editor-BmHelGDg.js → monaco-editor-CjYCKOTC.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-C0T1_3ja.js → monitoring-dashboard-edit-DvViNUXq.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-CDX0iyhB.js → monitoring-dashboard-view-CcuLeEOc.js} +1 -1
- package/dist/client/assets/{monitoring-Dygm51vZ.js → monitoring-hEPUjgsC.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cb1hCxgk.js → oauth-callback-BhMmtwfn.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-lIzsTYGK.js → oauth-callback-ai-provider-DdW8Ak96.js} +1 -1
- package/dist/client/assets/{org-ai-providers-CoYprATW.js → org-ai-providers-BRKDGo95.js} +1 -1
- package/dist/client/assets/{page-Cu7gHbt4.js → page-4HZ9ZSA4.js} +1 -1
- package/dist/client/assets/{page-DL6abyDO.js → page-DEXUji1V.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-cFVUXsMw.js → plugin-empty-state-6gk92Qyl.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DwzoJyko.js → plugin-empty-state-CXlis9nm.js} +1 -1
- package/dist/client/assets/{plugin-header-rHEUUeKT.js → plugin-header-Dne9u3jl.js} +1 -1
- package/dist/client/assets/{plugin-header-BhPYkg2t.js → plugin-header-kfwiBpJ4.js} +1 -1
- package/dist/client/assets/plugins-Ca0nbE2z.js +1 -0
- package/dist/client/assets/{popover-DAiH8HrC.js → popover-DFyjfZbz.js} +1 -1
- package/dist/client/assets/{project-app-view-C8IeiPWh.js → project-app-view-D8C1RwhY.js} +1 -1
- package/dist/client/assets/{project-layout-D1sK3RsI.js → project-layout-DoW61RN5.js} +1 -1
- package/dist/client/assets/{project-plugins-CLJvpqWA.js → project-plugins-CoTSSvm2.js} +1 -1
- package/dist/client/assets/{projects-list-D0-piP6V.js → projects-list-CDkYXY0c.js} +1 -1
- package/dist/client/assets/{readme-viewer-Cw2zVTtx.js → readme-viewer-2DAqsNDi.js} +1 -1
- package/dist/client/assets/{registry-layout-CQk4V9Fy.js → registry-layout-OLjzUiGm.js} +1 -1
- package/dist/client/assets/{registry-utils-BQ0EUN1b.js → registry-utils-DQ3Yz0aq.js} +1 -1
- package/dist/client/assets/{reports-layout-V83nUDoJ.js → reports-layout-CATRzkgZ.js} +1 -1
- package/dist/client/assets/{reset-password-DcRv69F2.js → reset-password-CBi8fGal.js} +1 -1
- package/dist/client/assets/{resizable-BRcjlpb9.js → resizable-5ZSV72uv.js} +1 -1
- package/dist/client/assets/{save-actions-Br5EOuh1.js → save-actions-BMwCSEwb.js} +1 -1
- package/dist/client/assets/{scroll-area-B93RC88a.js → scroll-area-D61RAolI.js} +1 -1
- package/dist/client/assets/{select-Iosam4nc.js → select-D2hoe72R.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-B55ZVK2k.js → select-virtual-mcp-DbjwN01X.js} +1 -1
- package/dist/client/assets/{shell-layout-BEtMdNiu.js → shell-layout-C1SmF7Hv.js} +2 -2
- package/dist/client/assets/{sidebar-settings-Zh3CDrTB.js → sidebar-settings-ZGimo8zw.js} +1 -1
- package/dist/client/assets/{skeleton-f9h0kyuC.js → skeleton-DnYWqER_.js} +1 -1
- package/dist/client/assets/{spinner-ClMTbKWw.js → spinner-CABex48W.js} +1 -1
- package/dist/client/assets/{store-invite-DQ0eTfXv.js → store-invite-BFE_gQ55.js} +1 -1
- package/dist/client/assets/{switch-2e_OzSa-.js → switch-CAcWD1sq.js} +1 -1
- package/dist/client/assets/{table-Dr847bjN.js → table-Cxzf-FHD.js} +1 -1
- package/dist/client/assets/{tabs-BlAwR39Z.js → tabs-D57oGoRB.js} +1 -1
- package/dist/client/assets/{task-status-myNxZFI-.js → task-status-D43Cwt6l.js} +1 -1
- package/dist/client/assets/tasks-BCjx4cWT.js +1 -0
- package/dist/client/assets/{tasks-panel-X0AV2-Sn.js → tasks-panel-CG3BQMOl.js} +1 -1
- package/dist/client/assets/{textarea-XcCjv61M.js → textarea-BHHzOaro.js} +1 -1
- package/dist/client/assets/{time-range-picker-_owYVo_t.js → time-range-picker-WMggaRPG.js} +1 -1
- package/dist/client/assets/{toggle-group-C_4VG-JK.js → toggle-group-BIoAHYZJ.js} +1 -1
- package/dist/client/assets/{tools-list-D9ljaQOJ.js → tools-list-x8d6J887.js} +1 -1
- package/dist/client/assets/{tooltip-DjLTvHpz.js → tooltip-CYJcicRO.js} +1 -1
- package/dist/client/assets/{topbar-portal-Bt-7uOLT.js → topbar-portal-f4GfspVt.js} +1 -1
- package/dist/client/assets/{types-B4Gd-u-3.js → types-BvJtOINP.js} +1 -1
- package/dist/client/assets/{use-automations-BeuGbjZ-.js → use-automations-BZqwiEM_.js} +1 -1
- package/dist/client/assets/{use-binding-BEPf7Gie.js → use-binding-DKk5_N9r.js} +1 -1
- package/dist/client/assets/{use-collections-BLzG3bJp.js → use-collections-DMxCeq8b.js} +1 -1
- package/dist/client/assets/{use-connection-D_u6jBgP.js → use-connection-ez0pyFtP.js} +1 -1
- package/dist/client/assets/{use-copy-8HTCCusQ.js → use-copy-CiJz8oao.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CCZ9ZXv4.js → use-create-virtual-mcp-B8asQT4w.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-B5invNZ7.js → use-install-from-registry-CfygxUq4.js} +1 -1
- package/dist/client/assets/{use-list-state-ByEy7Osm.js → use-list-state-CSB_h2rv.js} +1 -1
- package/dist/client/assets/{use-llm-VA4dgcLv.js → use-llm-76KQxHJG.js} +1 -1
- package/dist/client/assets/{use-local-storage-LMzJlC-M.js → use-local-storage-Do7hPFcT.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BQwPUsA-.js → use-mcp-prompts-Dejjnovy.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-e1qXr7bA.js → use-mcp-resources-C2GVZGS8.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CCtN3o9e.js → use-mcp-tools-JJSno6Er.js} +1 -1
- package/dist/client/assets/{use-members-C3PUprae.js → use-members-D4TXNlgc.js} +1 -1
- package/dist/client/assets/{use-mobile-DXK-sBip.js → use-mobile-Dc15vEtL.js} +1 -1
- package/dist/client/assets/{use-project-D1gauJR3.js → use-project-fmhu7bPh.js} +1 -1
- package/dist/client/assets/{use-view-mode-DThyKTt5.js → use-view-mode-DmTBDQfD.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-dbqVkjzK.js → use-virtual-mcp-94OtcwcB.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CATkeJqj.js +1 -0
- package/dist/client/assets/{useMutation-D0WkcqTd.js → useMutation-7d0bWCn1.js} +1 -1
- package/dist/client/assets/useQuery-CN1pzVoX.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BD0TGQFj.js +1 -0
- package/dist/client/assets/{user-LylUdoHD.js → user-CztLlDB5.js} +1 -1
- package/dist/client/assets/{workflow-CA1DIkk0.js → workflow-BdfJ6OoL.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/node_modules/pg-cloudflare/LICENSE +21 -0
- package/dist/server/node_modules/pg-cloudflare/README.md +112 -0
- package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +2 -0
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js +6 -0
- package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +1 -0
- package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +31 -0
- package/dist/server/node_modules/pg-cloudflare/dist/index.js +152 -0
- package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +1 -0
- package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +3 -0
- package/dist/server/node_modules/pg-cloudflare/package.json +39 -0
- package/dist/server/node_modules/pg-cloudflare/src/empty.ts +3 -0
- package/dist/server/node_modules/pg-cloudflare/src/index.ts +166 -0
- package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +25 -0
- package/dist/server/node_modules/pg-connection-string/LICENSE +21 -0
- package/dist/server/node_modules/pg-connection-string/README.md +105 -0
- package/dist/server/node_modules/pg-connection-string/esm/index.mjs +8 -0
- package/dist/server/node_modules/pg-connection-string/index.d.ts +36 -0
- package/dist/server/node_modules/pg-connection-string/index.js +231 -0
- package/dist/server/node_modules/pg-connection-string/package.json +52 -0
- package/dist/server/node_modules/pg-pool/LICENSE +21 -0
- package/dist/server/node_modules/pg-pool/README.md +357 -0
- package/dist/server/node_modules/pg-pool/esm/index.mjs +5 -0
- package/dist/server/node_modules/pg-pool/index.js +517 -0
- package/dist/server/node_modules/pg-pool/package.json +51 -0
- package/dist/server/node_modules/pg-protocol/LICENSE +21 -0
- package/dist/server/node_modules/pg-protocol/README.md +3 -0
- package/dist/server/node_modules/pg-protocol/dist/b.d.ts +1 -0
- package/dist/server/node_modules/pg-protocol/dist/b.js +23 -0
- package/dist/server/node_modules/pg-protocol/dist/b.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.d.ts +15 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.d.ts +16 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js +81 -0
- package/dist/server/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +1 -0
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js +530 -0
- package/dist/server/node_modules/pg-protocol/dist/inbound-parser.test.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/index.d.ts +6 -0
- package/dist/server/node_modules/pg-protocol/dist/index.js +15 -0
- package/dist/server/node_modules/pg-protocol/dist/index.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/messages.d.ts +162 -0
- package/dist/server/node_modules/pg-protocol/dist/messages.js +160 -0
- package/dist/server/node_modules/pg-protocol/dist/messages.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +1 -0
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js +252 -0
- package/dist/server/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/parser.d.ts +24 -0
- package/dist/server/node_modules/pg-protocol/dist/parser.js +324 -0
- package/dist/server/node_modules/pg-protocol/dist/parser.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/dist/serializer.d.ts +42 -0
- package/dist/server/node_modules/pg-protocol/dist/serializer.js +189 -0
- package/dist/server/node_modules/pg-protocol/dist/serializer.js.map +1 -0
- package/dist/server/node_modules/pg-protocol/esm/index.js +11 -0
- package/dist/server/node_modules/pg-protocol/package.json +45 -0
- package/dist/server/node_modules/pg-protocol/src/b.ts +25 -0
- package/dist/server/node_modules/pg-protocol/src/buffer-reader.ts +58 -0
- package/dist/server/node_modules/pg-protocol/src/buffer-writer.ts +85 -0
- package/dist/server/node_modules/pg-protocol/src/inbound-parser.test.ts +575 -0
- package/dist/server/node_modules/pg-protocol/src/index.ts +11 -0
- package/dist/server/node_modules/pg-protocol/src/messages.ts +262 -0
- package/dist/server/node_modules/pg-protocol/src/outbound-serializer.test.ts +276 -0
- package/dist/server/node_modules/pg-protocol/src/parser.ts +413 -0
- package/dist/server/node_modules/pg-protocol/src/serializer.ts +274 -0
- package/dist/server/node_modules/pg-protocol/src/testing/buffer-list.ts +67 -0
- package/dist/server/node_modules/pg-protocol/src/testing/test-buffers.ts +166 -0
- package/dist/server/node_modules/pg-protocol/src/types/chunky.d.ts +1 -0
- package/dist/server/node_modules/pg-types/.travis.yml +7 -0
- package/dist/server/node_modules/pg-types/Makefile +14 -0
- package/dist/server/node_modules/pg-types/README.md +75 -0
- package/dist/server/node_modules/pg-types/index.d.ts +137 -0
- package/dist/server/node_modules/pg-types/index.js +47 -0
- package/dist/server/node_modules/pg-types/index.test-d.ts +21 -0
- package/dist/server/node_modules/pg-types/lib/arrayParser.js +11 -0
- package/dist/server/node_modules/pg-types/lib/binaryParsers.js +257 -0
- package/dist/server/node_modules/pg-types/lib/builtins.js +73 -0
- package/dist/server/node_modules/pg-types/lib/textParsers.js +215 -0
- package/dist/server/node_modules/pg-types/package.json +42 -0
- package/dist/server/node_modules/pg-types/test/index.js +24 -0
- package/dist/server/node_modules/pg-types/test/types.js +597 -0
- package/dist/server/node_modules/pgpass/README.md +74 -0
- package/dist/server/node_modules/pgpass/lib/helper.js +233 -0
- package/dist/server/node_modules/pgpass/lib/index.js +23 -0
- package/dist/server/node_modules/pgpass/package.json +41 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/postgres-bytea/license +21 -0
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/xtend/LICENSE +20 -0
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/package.json +1 -1
- package/dist/client/assets/constants-Dxc17JqT.js +0 -1
- package/dist/client/assets/login-jzlEVf-H.js +0 -1
- package/dist/client/assets/plugins-D8nN3ns-.js +0 -1
- package/dist/client/assets/tasks-Cg_ykzKa.js +0 -1
- package/dist/client/assets/useInfiniteQuery-6ok0NRM6.js +0 -1
- package/dist/client/assets/useQuery-DMs04NaY.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-xBbNB0pB.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as S,c as k,j as t,E as fe,B as J,z as ae,af as Je,u as de,V as Ze,n as Qe,w as ce,e as Xe,g as et,O as Ge,t as tt,q as st,F as lt,G as Me}from"./index-BJ81Vsww.js";import{u as ot}from"./context-ClCBXQoI.js";import{E as nt}from"./empty-state-CpzrK9g6.js";import{I as it}from"./icon-picker-DHh5HlMd.js";import{I as Ae}from"./integration-icon-DKPtAPgu.js";import{u as rt}from"./index-BKYpmcE7.js";import{B as Oe}from"./badge-B33icYfV.js";import{i as at,a as ct,C as dt,b as mt}from"./collapsible-DDvEBvNF.js";import{I as Ve}from"./input-95A3RU7n.js";import{S as ut}from"./switch-2e_OzSa-.js";import{T as ft}from"./textarea-XcCjv61M.js";import{a as xe,b as ye,c as pe,T as he}from"./tooltip-DjLTvHpz.js";import{b as xt,u as pt}from"./use-connection-D_u6jBgP.js";import{u as ht,a as gt}from"./use-virtual-mcp-dbqVkjzK.js";import{i as He}from"./ChevronRight-BZWqxnWE.js";import{n as jt}from"./ChevronUp-DxXRh85A.js";import{i as $e}from"./File02-C3A15tgy.js";import{i as De}from"./Loading01-BbnQsfMx.js";import{i as bt}from"./Play-p1Z3ioGY.js";import{s as Be}from"./Plus-BJUL5Wvq.js";import{b as Le}from"./index-XiB7e0AL.js";import{t as Nt}from"./Users03-DTCxnqPZ.js";import{B as yt,a as vt,b as Fe,d as Ct,e as _t,c as St}from"./breadcrumb-C11JDZLD.js";import{a as Tt,V as kt}from"./layout-KmDEzVfx.js";import{S as wt}from"./save-actions-Br5EOuh1.js";import{C as Et}from"./collection-search-C-DUGZUN.js";import{T as It}from"./tools-list-D9ljaQOJ.js";import{C as ze}from"./checkbox-BuLFRc1C.js";import{e as At,a as Ue,D as Ke,b as Ot,c as $t}from"./dialog-CvddUtOS.js";import{T as ve,a as Dt,b as Ce,c as Lt}from"./tabs-BlAwR39Z.js";import{u as ge,a as zt}from"./constants-uVLQN0jY.js";import{c as Rt}from"./use-mcp-tools-CCtN3o9e.js";import{a as Pt}from"./use-mcp-resources-e1qXr7bA.js";import{u as Mt}from"./use-mcp-prompts-BQwPUsA-.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{I as Vt,R as Bt,a as Ft}from"./index-RAS9JMxX.js";import{k as Gt}from"./dropdown-menu-CNJ1rfC3.js";import{i as je}from"./Check-BxC8tao2.js";import{i as Ht}from"./Code01-BfCMg42R.js";import{a as Re}from"./Copy01-Wuk9LRR2.js";import{i as _e}from"./InfoCircle-DvSUioPF.js";import{i as Ut}from"./Key01-Dib7ammN.js";import{A as Kt}from"./agent-connections-preview-DWjxgkFC.js";import"./decopilot-events-Brt4gAR6.js";import"./popover-DAiH8HrC.js";import"./scroll-area-B93RC88a.js";import"./Container-CHE6pZ9r.js";import"./Edit05-BvgGPrtV.js";import"./Link01-DwbGnCZ-.js";import"./XClose-CRDqusrl.js";import"./use-local-storage-LMzJlC-M.js";import"./useQuery-DMs04NaY.js";import"./useMutation-D0WkcqTd.js";import"./index-MC5fCcRU.js";import"./use-collections-BLzG3bJp.js";import"./Save01-BNoezVOP.js";import"./SearchMd-BJkDuyJ3.js";import"./collection-display-button-CB65ibr7.js";import"./ArrowDown-C_8n0unK.js";import"./ArrowUp-o0gFtaSp.js";import"./Grid01-CgI0fqut.js";import"./List-3zjBAIRS.js";import"./collection-table-wrapper-CNWTcnzH.js";import"./table-Dr847bjN.js";import"./card-Bfa3ZJIC.js";import"./types-B4Gd-u-3.js";import"./Eye-geJ1dSoO.js";import"./Globe02-zQio7SJP.js";import"./LayersTwo01-BmzCQYk2.js";import"./X-CEnrrbAn.js";const be=({size:o=24,color:e="currentColor",...s})=>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},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 Ye=({size:o=24,color:e="currentColor",...s})=>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},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"}),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="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(De,{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(Je,{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 p;e[5]!==s.tags?(p=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=p):p=e[6];let g;e[7]!==c||e[8]!==p?(g=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,p]}),e[7]=c,e[8]=p,e[9]=g):g=e[9];let x;e[10]!==s.description?(x=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=x):x=e[11];let h;e[12]!==g||e[13]!==x?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[g,x]}),e[12]=g,e[13]=x,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,p,g,x;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==l||e[4]!==i||e[5]!==n){x=Symbol.for("react.early_return_sentinel");e:{const f=s.map(Zt);if(s.length===0){let v;e[11]!==d?(v=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]=v):v=e[12],x=v;break e}p="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 y=n===null;let C;e[17]!==a||e[18]!==i||e[19]!==y?(C=t.jsx(ze,{checked:y,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[17]=a,e[18]=i,e[19]=y,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(v=>t.jsx(Jt,{item:v,isSelected:n===null||n?.includes(v.id),onToggle:()=>l(v.id,f),disabled:a},v.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]=p,e[9]=g,e[10]=x}else r=e[6],c=e[7],p=e[8],g=e[9],x=e[10];if(x!==Symbol.for("react.early_return_sentinel"))return x;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]!==p||e[29]!==g||e[30]!==h?(u=t.jsxs("div",{className:p,children:[g,h]}),e[28]=p,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 p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Rt(p);let x;e[5]!==g.tools?(x=g.tools.map(Xt),e[5]=g.tools,e[6]=x):x=e[6];const h=x;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(It,{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 p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Pt(p);let x;e[5]!==g.resources?(x=g.resources.map(ts),e[5]=g.resources,e[6]=x):x=e[6];const h=x;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 p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Mt(p);let x;e[5]!==g.prompts?(x=g.prompts.map(ls),e[5]=g.prompts,e[6]=x):x=e[6];const h=x;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",p=n?"bg-accent":"hover:bg-muted/50";let g;e[0]!==c||e[1]!==p?(g=ae("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",c,p),e[0]=c,e[1]=p,e[2]=g):g=e[2];const x=r?void 0:d;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(Ae,{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]!==x||e[20]!==h||e[21]!==b||e[22]!==m?(j=t.jsxs("div",{className:g,onClick:x,children:[h,b,m]}),e[18]=g,e[19]=x,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 p;e[0]!==s||e[1]!==n?(p=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]=p):p=e[2];const g=p;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 x;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],x=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]=x}else x=e[12];let h;return e[20]!==x?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:x}),e[20]=x,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:p,toggleAllPrompts:g,onTabChange:x}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(Ae,{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]!==x?(j=M=>x(M),e[13]=x,e[14]=j):j=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(ve,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Le,{size:16}),"Tools"]}),e[15]=y):y=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(ve,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(be,{size:16}),"Resources"]}),e[16]=C):C=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs(Dt,{variant:"underline",className:"shrink-0 px-6",children:[y,C,t.jsxs(ve,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx($e,{size:16}),"Prompts"]})]}),e[17]=v):v=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 _;e[26]!==l||e[27]!==c?(_=()=>c(l),e[26]=l,e[27]=c,e[28]=_):_=e[28];let w;e[29]!==l||e[30]!==T||e[31]!==O||e[32]!==_?(w=t.jsx(Ce,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:V,children:t.jsx(S.Suspense,{fallback:R,children:t.jsx(Qt,{connectionId:l,selections:T,onToggle:O,onToggleAll:_})})})}),e[29]=l,e[30]=T,e[31]=O,e[32]=_,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]!==p?(A=()=>p(l),e[42]=l,e[43]=p,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(S.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(S.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(Lt,{value:n,onValueChange:j,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[v,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]=S.useReducer(cs,a),p=S.useDeferredValue(r.searchTerm);let g;e[2]!==p?(g={searchTerm:p},e[2]=p,e[3]=g):g=e[3];const x=xt(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]!==x||e[9]!==r.selectedId?(b=ds(x,r.selectedId),e[8]=x,e[9]=r.selectedId,e[10]=b):b=e[10];const m=b,j=m?.id??null;let y;e[11]!==f?(y=N=>Yt(f,N),e[11]=f,e[12]=y):y=e[12];const C=y;let v;e[13]!==f?(v=N=>Wt(f,N),e[13]=f,e[14]=v):v=e[14];const V=v;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 _=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]!==_?(E=N=>_(N,"tools"),e[27]=_,e[28]=E):E=e[28];const B=E;let P;e[29]!==_?(P=N=>_(N,"resources"),e[29]=_,e[30]=P):P=e[30];const K=P;let H;e[31]!==_?(H=N=>_(N,"prompts"),e[31]=_,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]!==x||e[37]!==n||e[38]!==l?(Z=N=>{N&&c({type:"RESET",payload:{selectedId:l,firstConnectionId:x[0]?.id??null}}),n(N)},e[36]=x,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 qe=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(Et,{value:r.searchTerm,onChange:me,placeholder:"Search connections..."}),e[42]=r.searchTerm,e[43]=X):X=e[43];let ee;e[44]!==x||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:x,searchTerm:r.searchTerm,selectedId:j,hasSelections:C,getSelectionSummary:V,onConnectionClick:qe,onToggleAll:Y})}),e[44]=x,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(At,{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=Ze.pick({title:!0,description:!0,icon:!0,status:!0,metadata:!0,connections:!0}).extend({title:Qe().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(Bt,{"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(Ft,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Gt,{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(Vt,{"data-slot":"radio-group-item",className:l,...n,children:i}),e[6]=n,e[7]=l,e[8]=d):d=e[8],d}function xs(o){const s=new TextEncoder().encode(o),n=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(n)}function ps(o){const e=k.c(10),{url:s}=o,[n,l]=S.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 p;return e[6]!==d||e[7]!==a||e[8]!==c?(p=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]=p):p=e[9],p}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=xs(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(g)}`;window.open(x,"_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]=S.useState(!1);let d;e[0]!==n||e[1]!==s?(d=async()=>{const x=We(n),u=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),f=`claude mcp add-json "${x}" '${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 p;e[5]!==c?(p=t.jsx("span",{className:"text-xs font-medium",children:c}),e[5]=c,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==r||e[9]!==p?(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,p]}),e[7]=a,e[8]=r,e[9]=p,e[10]=g):g=e[10],g}function js({virtualMcp:o}){const{org:e}=de(),s=ge({connectionId:zt,orgId:e.id}),[n,l]=S.useState(null),[i,d]=S.useState(!1),[a,r]=S.useState(!1),c=o.id,p=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`,x=async()=>{d(!0);try{const f=(await s.callTool({name:"API_KEY_CREATE",arguments:{name:`typegen-${p}`,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:x,disabled:i,children:[i?t.jsx(De,{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]=S.useState(!1),i=window.location.origin,d=s?`MESH_API_KEY=${s}`:"MESH_API_KEY=<api-key>",a=`MESH_BASE_URL=${i}`,r=`${d}
|
|
1
|
+
import{r as S,c as k,j as t,E as fe,B as J,z as ae,af as Je,u as de,V as Ze,n as Qe,w as ce,e as Xe,g as et,O as Ge,t as tt,q as st,F as lt,G as Me}from"./index-BUP2j-VZ.js";import{u as ot}from"./context-vne_tDFm.js";import{E as nt}from"./empty-state-BJQVSVey.js";import{I as it}from"./icon-picker-CXAPe9ug.js";import{I as Ae}from"./integration-icon-DhNWPq_0.js";import{u as rt}from"./index-CRVyuFS0.js";import{B as Oe}from"./badge-DSBNODR5.js";import{i as at,a as ct,C as dt,b as mt}from"./collapsible-Df2r9Beq.js";import{I as Ve}from"./input-OS0sGs_c.js";import{S as ut}from"./switch-CAcWD1sq.js";import{T as ft}from"./textarea-BHHzOaro.js";import{a as xe,b as ye,c as pe,T as he}from"./tooltip-CYJcicRO.js";import{b as xt,u as pt}from"./use-connection-ez0pyFtP.js";import{u as ht,a as gt}from"./use-virtual-mcp-94OtcwcB.js";import{i as He}from"./ChevronRight-BWpUvEdI.js";import{n as jt}from"./ChevronUp-pA-2UtBp.js";import{i as $e}from"./File02-CBJOSTF8.js";import{i as De}from"./Loading01-B87VIClz.js";import{i as bt}from"./Play-DBH8t0rX.js";import{s as Be}from"./Plus-CDc4R7NF.js";import{b as Le}from"./index-D-cm4gF6.js";import{t as Nt}from"./Users03-cvM2Ndk1.js";import{B as yt,a as vt,b as Fe,d as Ct,e as _t,c as St}from"./breadcrumb-C0C7xCxQ.js";import{a as Tt,V as kt}from"./layout-BjgZH_LK.js";import{S as wt}from"./save-actions-BMwCSEwb.js";import{C as Et}from"./collection-search-Bl8CXpst.js";import{T as It}from"./tools-list-x8d6J887.js";import{C as ze}from"./checkbox-B3Rpe7-l.js";import{e as At,a as Ue,D as Ke,b as Ot,c as $t}from"./dialog-CflsNx8x.js";import{T as ve,a as Dt,b as Ce,c as Lt}from"./tabs-D57oGoRB.js";import{u as ge,a as zt}from"./constants-B4i933q7.js";import{c as Rt}from"./use-mcp-tools-JJSno6Er.js";import{a as Pt}from"./use-mcp-resources-C2GVZGS8.js";import{u as Mt}from"./use-mcp-prompts-Dejjnovy.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{I as Vt,R as Bt,a as Ft}from"./index-CZ74MLAU.js";import{k as Gt}from"./dropdown-menu-DcNTx9lg.js";import{i as je}from"./Check-B8ndkg7T.js";import{i as Ht}from"./Code01-ChPYGYfB.js";import{a as Re}from"./Copy01-CgG_OJP6.js";import{i as _e}from"./InfoCircle-Da_z8Szm.js";import{i as Ut}from"./Key01-4NZitUKS.js";import{A as Kt}from"./agent-connections-preview-BlJ035nM.js";import"./decopilot-events-Brt4gAR6.js";import"./popover-DFyjfZbz.js";import"./scroll-area-D61RAolI.js";import"./Container-CLsUjxhY.js";import"./Edit05-CXzMSTEE.js";import"./Link01-BXmFSJRd.js";import"./XClose-BHPDEFB2.js";import"./use-local-storage-Do7hPFcT.js";import"./useQuery-CN1pzVoX.js";import"./useMutation-7d0bWCn1.js";import"./index-BPNTL7B5.js";import"./use-collections-DMxCeq8b.js";import"./Save01-SGB22t4q.js";import"./SearchMd-DEv7e_hZ.js";import"./collection-display-button-Dbmpw-3P.js";import"./ArrowDown-J5qOTRoA.js";import"./ArrowUp-aSx0u-5l.js";import"./Grid01-Cx4wu3Y9.js";import"./List-B0bmeecJ.js";import"./collection-table-wrapper-CWpzycma.js";import"./table-Cxzf-FHD.js";import"./card-3wGXs2xF.js";import"./types-BvJtOINP.js";import"./Eye-MtNtMWW5.js";import"./Globe02-D4GwpBVP.js";import"./LayersTwo01-670JTIpk.js";import"./X-C5okAsgi.js";const be=({size:o=24,color:e="currentColor",...s})=>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},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 Ye=({size:o=24,color:e="currentColor",...s})=>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},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"}),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="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(De,{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(Je,{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 p;e[5]!==s.tags?(p=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=p):p=e[6];let g;e[7]!==c||e[8]!==p?(g=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,p]}),e[7]=c,e[8]=p,e[9]=g):g=e[9];let x;e[10]!==s.description?(x=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=x):x=e[11];let h;e[12]!==g||e[13]!==x?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[g,x]}),e[12]=g,e[13]=x,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,p,g,x;if(e[0]!==a||e[1]!==d||e[2]!==s||e[3]!==l||e[4]!==i||e[5]!==n){x=Symbol.for("react.early_return_sentinel");e:{const f=s.map(Zt);if(s.length===0){let v;e[11]!==d?(v=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]=v):v=e[12],x=v;break e}p="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 y=n===null;let C;e[17]!==a||e[18]!==i||e[19]!==y?(C=t.jsx(ze,{checked:y,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[17]=a,e[18]=i,e[19]=y,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(v=>t.jsx(Jt,{item:v,isSelected:n===null||n?.includes(v.id),onToggle:()=>l(v.id,f),disabled:a},v.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]=p,e[9]=g,e[10]=x}else r=e[6],c=e[7],p=e[8],g=e[9],x=e[10];if(x!==Symbol.for("react.early_return_sentinel"))return x;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]!==p||e[29]!==g||e[30]!==h?(u=t.jsxs("div",{className:p,children:[g,h]}),e[28]=p,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 p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Rt(p);let x;e[5]!==g.tools?(x=g.tools.map(Xt),e[5]=g.tools,e[6]=x):x=e[6];const h=x;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(It,{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 p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Pt(p);let x;e[5]!==g.resources?(x=g.resources.map(ts),e[5]=g.resources,e[6]=x):x=e[6];const h=x;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 p;e[3]!==c?(p={client:c},e[3]=c,e[4]=p):p=e[4];const{data:g}=Mt(p);let x;e[5]!==g.prompts?(x=g.prompts.map(ls),e[5]=g.prompts,e[6]=x):x=e[6];const h=x;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",p=n?"bg-accent":"hover:bg-muted/50";let g;e[0]!==c||e[1]!==p?(g=ae("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",c,p),e[0]=c,e[1]=p,e[2]=g):g=e[2];const x=r?void 0:d;let h;e[3]!==s.icon||e[4]!==s.title?(h=t.jsx(Ae,{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]!==x||e[20]!==h||e[21]!==b||e[22]!==m?(j=t.jsxs("div",{className:g,onClick:x,children:[h,b,m]}),e[18]=g,e[19]=x,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 p;e[0]!==s||e[1]!==n?(p=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]=p):p=e[2];const g=p;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 x;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],x=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]=x}else x=e[12];let h;return e[20]!==x?(h=t.jsx("div",{className:"flex flex-col gap-0.5",children:x}),e[20]=x,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:p,toggleAllPrompts:g,onTabChange:x}=o;let h;e[0]!==s.icon||e[1]!==s.title?(h=t.jsx(Ae,{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]!==x?(j=M=>x(M),e[13]=x,e[14]=j):j=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(ve,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(Le,{size:16}),"Tools"]}),e[15]=y):y=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(ve,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(be,{size:16}),"Resources"]}),e[16]=C):C=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsxs(Dt,{variant:"underline",className:"shrink-0 px-6",children:[y,C,t.jsxs(ve,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx($e,{size:16}),"Prompts"]})]}),e[17]=v):v=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 _;e[26]!==l||e[27]!==c?(_=()=>c(l),e[26]=l,e[27]=c,e[28]=_):_=e[28];let w;e[29]!==l||e[30]!==T||e[31]!==O||e[32]!==_?(w=t.jsx(Ce,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(fe,{fallback:V,children:t.jsx(S.Suspense,{fallback:R,children:t.jsx(Qt,{connectionId:l,selections:T,onToggle:O,onToggleAll:_})})})}),e[29]=l,e[30]=T,e[31]=O,e[32]=_,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]!==p?(A=()=>p(l),e[42]=l,e[43]=p,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(S.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(S.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(Lt,{value:n,onValueChange:j,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[v,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]=S.useReducer(cs,a),p=S.useDeferredValue(r.searchTerm);let g;e[2]!==p?(g={searchTerm:p},e[2]=p,e[3]=g):g=e[3];const x=xt(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]!==x||e[9]!==r.selectedId?(b=ds(x,r.selectedId),e[8]=x,e[9]=r.selectedId,e[10]=b):b=e[10];const m=b,j=m?.id??null;let y;e[11]!==f?(y=N=>Yt(f,N),e[11]=f,e[12]=y):y=e[12];const C=y;let v;e[13]!==f?(v=N=>Wt(f,N),e[13]=f,e[14]=v):v=e[14];const V=v;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 _=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]!==_?(E=N=>_(N,"tools"),e[27]=_,e[28]=E):E=e[28];const B=E;let P;e[29]!==_?(P=N=>_(N,"resources"),e[29]=_,e[30]=P):P=e[30];const K=P;let H;e[31]!==_?(H=N=>_(N,"prompts"),e[31]=_,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]!==x||e[37]!==n||e[38]!==l?(Z=N=>{N&&c({type:"RESET",payload:{selectedId:l,firstConnectionId:x[0]?.id??null}}),n(N)},e[36]=x,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 qe=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(Et,{value:r.searchTerm,onChange:me,placeholder:"Search connections..."}),e[42]=r.searchTerm,e[43]=X):X=e[43];let ee;e[44]!==x||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:x,searchTerm:r.searchTerm,selectedId:j,hasSelections:C,getSelectionSummary:V,onConnectionClick:qe,onToggleAll:Y})}),e[44]=x,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(At,{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=Ze.pick({title:!0,description:!0,icon:!0,status:!0,metadata:!0,connections:!0}).extend({title:Qe().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(Bt,{"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(Ft,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Gt,{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(Vt,{"data-slot":"radio-group-item",className:l,...n,children:i}),e[6]=n,e[7]=l,e[8]=d):d=e[8],d}function xs(o){const s=new TextEncoder().encode(o),n=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(n)}function ps(o){const e=k.c(10),{url:s}=o,[n,l]=S.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 p;return e[6]!==d||e[7]!==a||e[8]!==c?(p=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]=p):p=e[9],p}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=xs(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(g)}`;window.open(x,"_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]=S.useState(!1);let d;e[0]!==n||e[1]!==s?(d=async()=>{const x=We(n),u=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),f=`claude mcp add-json "${x}" '${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 p;e[5]!==c?(p=t.jsx("span",{className:"text-xs font-medium",children:c}),e[5]=c,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==r||e[9]!==p?(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,p]}),e[7]=a,e[8]=r,e[9]=p,e[10]=g):g=e[10],g}function js({virtualMcp:o}){const{org:e}=de(),s=ge({connectionId:zt,orgId:e.id}),[n,l]=S.useState(null),[i,d]=S.useState(!1),[a,r]=S.useState(!1),c=o.id,p=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`,x=async()=>{d(!0);try{const f=(await s.callTool({name:"API_KEY_CREATE",arguments:{name:`typegen-${p}`,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:x,disabled:i,children:[i?t.jsx(De,{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]=S.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
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 p=c,g=!s;let x;e[2]!==g?(x=ae({"opacity-50":g}),e[2]=g,e[3]=x):x=e[3];let h;e[4]!==d||e[5]!==x?(h=t.jsx("span",{className:x,children:d}),e[4]=d,e[5]=x,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]!==p||e[14]!==m?(j=t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:p,children:m}),e[13]=p,e[14]=m,e[15]=j):j=e[15];let y;return e[16]!==b||e[17]!==j?(y=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]=y):y=e[18],y}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(S.Suspense,{fallback:n,children:t.jsx(js,{virtualMcp:s})}),e[1]=s,e[2]=l):l=e[2],l}function ys(o){const e=k.c(44),{open:s,onOpenChange:n,virtualMcp:l}=o,[i,d]=S.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 p;e[4]!==l.id||e[5]!==l.title?(p=l.title||`agent-${l.id?.slice(0,8)??"default"}`,e[4]=l.id,e[5]=l.title,e[6]=p):p=e[6];const g=p;let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ot,{children:t.jsx($t,{children:"Connect"})}),e[7]=x):x=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(at,{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(xe,{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(ye,{children:t.jsxs(pe,{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(ct,{className:"size-5 text-muted-foreground"})}),e[13]=j):j=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=y):y=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(xe,{asChild:!0,children:t.jsx(_e,{className:"size-3.5 text-muted-foreground"})}),e[15]=C):C=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=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:[y,t.jsx(ye,{children:t.jsxs(pe,{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]=v):v=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(xe,{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(ye,{children:t.jsxs(pe,{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(Oe,{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 _;e[21]!==i?(_=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,v,O]})]}),e[21]=i,e[22]=_):_=e[22];let w;e[23]!==c.href?(w=t.jsx(ps,{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]!==_||e[37]!==I||e[38]!==A?(E=t.jsxs(Ue,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[x,t.jsxs("div",{className:"flex flex-col gap-6",children:[_,I,D,A]})]}),e[36]=_,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 vs(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=pt(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 p;e[2]!==l?(p=Se(l),e[2]=l,e[3]=p):p=e[3];const g=p;let x;e[4]!==i?(x=Se(i),e[4]=i,e[5]=x):x=e[5];const h=x;let u;e[6]!==a.icon||e[7]!==a.title?(u=t.jsx(Ae,{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(Le,{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($e,{size:12})]}),e[15]=h,e[16]=j):j=e[16];let y;e[17]!==b||e[18]!==m||e[19]!==j?(y=t.jsxs(Oe,{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]=y):y=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 v;return e[22]!==d||e[23]!==u||e[24]!==f||e[25]!==y?(v=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,y,C]}),e[22]=d,e[23]=u,e[24]=f,e[25]=y,e[26]=v):v=e[26],v}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(Oe,{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(Le,{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($e,{size:12})]})]}),t.jsx(He,{size:16,className:"text-muted-foreground shrink-0"})]})};function Cs({virtualMcp:o}){const{org:e}=de(),s=gt(),n=tt({resolver:st(us),defaultValues:o}),l=n.watch("connections"),[i,d]=S.useReducer(vs,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,a]=rt(),{setVirtualMcpId:r}=ot();S.useEffect(()=>{a(!0),r(o.id)},[o.id]);const c=()=>{r(o.id),a(!0)},p=n.formState.isDirty,g=async()=>{const m=n.getValues(),j=await s.update.mutateAsync({id:o.id,data:m});n.reset(j)},x=()=>{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(yt,{children:t.jsxs(vt,{children:[t.jsx(Fe,{children:t.jsx(Ct,{asChild:!0,children:t.jsx(lt,{to:"/$org/$project/agents",params:{org:e.slug,project:Ge},children:"Agents"})})}),t.jsx(_t,{}),t.jsx(Fe,{children:t.jsx(St,{children:o.title})})]})});return t.jsxs(Tt,{breadcrumb:b,children:[t.jsxs(kt,{children:[t.jsx(wt,{onSave:g,onUndo:x,isDirty:p,isSaving:f}),t.jsxs(pe,{delayDuration:0,children:[t.jsx(xe,{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(bt,{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(Ye,{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(it,{value:m.value,onChange:m.onChange,name:n.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(Nt,{})})}),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(ut,{checked:n.watch("status")==="active",onCheckedChange:m=>n.setValue("status",m?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(dt,{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(mt,{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(jt,{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(S.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(ft,{...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(ys,{open:i.shareDialogOpen,onOpenChange:m=>d({type:"SET_SHARE_DIALOG_OPEN",payload:m}),virtualMcp:o})]})}function _s(){const o=k.c(6),e=Xe();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=et(s),{org:l,agentId:i}=n,d=ht(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(nt,{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 Bl(){const o=k.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(fe,{children:t.jsx(S.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(De,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_s,{})})}),o[0]=e):e=o[0],e}export{Bl as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as we,j as s,E as vt,r as J,u as Nt,e as Ct,B as Q,z as X,w as yt,O as wt}from"./index-BJ81Vsww.js";import{C as St}from"./collection-display-button-CB65ibr7.js";import{C as kt}from"./collection-search-C-DUGZUN.js";import{P as ve}from"./index-BKYpmcE7.js";import{B as _t,a as Dt,b as zt,c as At}from"./breadcrumb-C11JDZLD.js";import{C as xt}from"./connection-card-zeX_VYK4.js";import{C as He,i as Mt}from"./connection-status-DFBDMZAF.js";import{E as Ze}from"./empty-state-CpzrK9g6.js";import{I as Ge}from"./integration-icon-DKPtAPgu.js";import{u as Tt}from"./use-list-state-ByEy7Osm.js";import{u as $t}from"./use-create-virtual-mcp-CCZ9ZXv4.js";import{i as Ne}from"./constants-uVLQN0jY.js";import{b as Pt,a as It}from"./use-virtual-mcp-dbqVkjzK.js";import{c as at,b as rt,d as ot,A as ct,e as dt,h as mt,a as ft,f as ut}from"./alert-dialog-B77zp5_9.js";import{B as et}from"./badge-B33icYfV.js";import{C as Ue}from"./checkbox-BuLFRc1C.js";import{c as Ot,d as Bt,b as Lt,a as Rt,D as Et}from"./dialog-CvddUtOS.js";import{T as Kt,a as Vt,b as Ve,c as se,d as Gt,e as Ut}from"./table-Dr847bjN.js";import{D as tt,a as st,b as nt,c as je}from"./dropdown-menu-CNJ1rfC3.js";import{n as Ft}from"./ArrowDown-C_8n0unK.js";import{i as Ht}from"./ArrowUp-o0gFtaSp.js";import{t as qt}from"./ChevronDown-B6clHAxQ.js";import{i as it}from"./DotsVertical-CgdYQJ7U.js";import{s as lt}from"./Eye-geJ1dSoO.js";import{i as Jt}from"./Loading01-BbnQsfMx.js";import{s as Fe}from"./Trash01-BEjbK4f6.js";import{t as Y}from"./Users03-DTCxnqPZ.js";import{s as gt}from"./XClose-CRDqusrl.js";import{U as Ce}from"./user-LylUdoHD.js";import{A as ht}from"./agent-connections-preview-DWjxgkFC.js";import{f as ye}from"./format-time-CMKyl-GC.js";import"./Check-BxC8tao2.js";import"./Grid01-CgI0fqut.js";import"./List-3zjBAIRS.js";import"./tooltip-DjLTvHpz.js";import"./index-MC5fCcRU.js";import"./SearchMd-BJkDuyJ3.js";import"./input-95A3RU7n.js";import"./use-local-storage-LMzJlC-M.js";import"./useQuery-DMs04NaY.js";import"./useMutation-D0WkcqTd.js";import"./ChevronRight-BZWqxnWE.js";import"./card-Bfa3ZJIC.js";import"./AlertCircle-BvnCc6-D.js";import"./CheckCircle-D_nIOFVe.js";import"./Container-CHE6pZ9r.js";import"./use-view-mode-DThyKTt5.js";import"./use-mobile-DXK-sBip.js";import"./use-collections-BLzG3bJp.js";import"./X-CEnrrbAn.js";import"./avatar-DUHTdDSS.js";import"./use-connection-D_u6jBgP.js";import"./differenceInSeconds-NQ4PDo0z.js";function pt(t){return t.title.trim().replace(/\s+\(\d+\)$/,"")}function Qt(t){const e=new Map;for(const i of t){const a=pt(i),l=e.get(a);l?l.push(i):e.set(a,[i])}const n=[],d=new Set;for(const i of t){const a=pt(i);if(d.has(a))continue;d.add(a);const l=e.get(a),x=l[0];l.length===1?n.push({type:"single",agent:x}):n.push({type:"group",key:a,icon:x.icon,title:x.title.replace(/\s*\(\d+\)\s*$/,""),agents:l})}return n}function jt(t){const e=new Set,n=[];for(const d of t)d.created_by&&!e.has(d.created_by)&&(e.add(d.created_by),n.push(d.created_by));return n}function Wt(t,e){switch(e.type){case"delete":return{mode:"deleting",virtualMcp:e.virtualMcp};case"close":return{mode:"idle"}}}function Xt(t){const e=we.c(107),{group:n,onNavigate:d,onDelete:i,selectionMode:a,selectedIds:l,onToggleSelect:x}=t,[N,g]=J.useState(!1);let w;if(e[0]!==n.agents||e[1]!==l){let y;e[3]!==l?(y=_=>l.has(_.id),e[3]=l,e[4]=y):y=e[4],w=n.agents.every(y),e[0]=n.agents,e[1]=l,e[2]=w}else w=e[2];const m=w;let D;if(e[5]!==n.agents||e[6]!==l){let y;e[8]!==l?(y=_=>l.has(_.id),e[8]=l,e[9]=y):y=e[9],D=n.agents.some(y),e[5]=n.agents,e[6]=l,e[7]=D}else D=e[7];const o=D;let O,S,c,C,z,P,k,I,A,f,j;if(e[10]!==m||e[11]!==n.agents||e[12]!==n.icon||e[13]!==n.title||e[14]!==x||e[15]!==l||e[16]!==a||e[17]!==o){const y=jt(n.agents),_=n.agents.reduce(ts,n.agents[0]),W=_.updated_at??_.created_at;O=xt;const Z=`${n.agents.length} instances`;e[29]!==n.icon||e[30]!==n.title||e[31]!==Z?(A={title:n.title,icon:n.icon,description:Z},e[29]=n.icon,e[30]=n.title,e[31]=Z,e[32]=A):A=e[32],e[33]!==m||e[34]!==n.agents||e[35]!==x||e[36]!==l||e[37]!==a?(f=()=>a?(()=>{for(const R of n.agents)m?l.has(R.id)&&x(R.id):l.has(R.id)||x(R.id)})():g(!0),e[33]=m,e[34]=n.agents,e[35]=x,e[36]=l,e[37]=a,e[38]=f):f=e[38];const H=a&&m&&"ring-2 ring-primary",ee=a&&o&&!m&&"ring-1 ring-primary/50";e[39]!==H||e[40]!==ee?(j=X(H,ee),e[39]=H,e[40]=ee,e[41]=j):j=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Y,{}),e[42]=S):S=e[42],e[43]!==m||e[44]!==n.agents||e[45]!==x||e[46]!==l||e[47]!==a||e[48]!==o?(c=a?s.jsx(Ue,{checked:m?!0:o?"indeterminate":!1,onCheckedChange:()=>{for(const R of n.agents)m?l.has(R.id)&&x(R.id):l.has(R.id)||x(R.id)}}):s.jsxs(et,{variant:"secondary",className:"text-xs tabular-nums",children:["x",n.agents.length]}),e[43]=m,e[44]=n.agents,e[45]=x,e[46]=l,e[47]=a,e[48]=o,e[49]=c):c=e[49];let q;e[50]!==n.agents?(q=n.agents.slice(0,6).map(es),e[50]=n.agents,e[51]=q):q=e[51],e[52]!==q?(C=s.jsx("div",{className:"flex items-center gap-1",children:q}),e[52]=q,e[53]=C):C=e[53],k="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const te=y.map(R=>s.jsx(Ce,{id:R,size:"3xs",avatarOnly:y.length>1},R));e[54]!==te?(I=s.jsx("div",{className:"flex items-center -space-x-1.5",children:te}),e[54]=te,e[55]=I):I=e[55],z="shrink-0 ml-2",P=W?ye(new Date(W)):"—",e[10]=m,e[11]=n.agents,e[12]=n.icon,e[13]=n.title,e[14]=x,e[15]=l,e[16]=a,e[17]=o,e[18]=O,e[19]=S,e[20]=c,e[21]=C,e[22]=z,e[23]=P,e[24]=k,e[25]=I,e[26]=A,e[27]=f,e[28]=j}else O=e[18],S=e[19],c=e[20],C=e[21],z=e[22],P=e[23],k=e[24],I=e[25],A=e[26],f=e[27],j=e[28];let p;e[56]!==z||e[57]!==P?(p=s.jsx("span",{className:z,children:P}),e[56]=z,e[57]=P,e[58]=p):p=e[58];let M;e[59]!==p||e[60]!==k||e[61]!==I?(M=s.jsxs("div",{className:k,children:[I,p]}),e[59]=p,e[60]=k,e[61]=I,e[62]=M):M=e[62];let T;e[63]!==O||e[64]!==S||e[65]!==c||e[66]!==C||e[67]!==M||e[68]!==A||e[69]!==f||e[70]!==j?(T=s.jsx(O,{connection:A,onClick:f,className:j,fallbackIcon:S,headerActions:c,body:C,footer:M}),e[63]=O,e[64]=S,e[65]=c,e[66]=C,e[67]=M,e[68]=A,e[69]=f,e[70]=j,e[71]=T):T=e[71];let B;e[72]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Y,{}),e[72]=B):B=e[72];let $;e[73]!==n.icon||e[74]!==n.title?($=s.jsx(Ge,{icon:n.icon,name:n.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:B}),e[73]=n.icon,e[74]=n.title,e[75]=$):$=e[75];let L;e[76]!==n.agents.length?(L=s.jsxs(et,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.agents.length]}),e[76]=n.agents.length,e[77]=L):L=e[77];let r;e[78]!==n.title||e[79]!==L?(r=s.jsxs(Ot,{children:[n.title,L]}),e[78]=n.title,e[79]=L,e[80]=r):r=e[80];let u;e[81]!==n.agents.length?(u=s.jsxs(Bt,{children:[n.agents.length," instances"]}),e[81]=n.agents.length,e[82]=u):u=e[82];let b;e[83]!==r||e[84]!==u?(b=s.jsxs("div",{children:[r,u]}),e[83]=r,e[84]=u,e[85]=b):b=e[85];let K;e[86]!==$||e[87]!==b?(K=s.jsx(Lt,{className:"px-6 pt-6 pb-4",children:s.jsxs("div",{className:"flex items-center gap-3",children:[$,b]})}),e[86]=$,e[87]=b,e[88]=K):K=e[88];let V;if(e[89]!==n.agents||e[90]!==i||e[91]!==d){let y;e[93]!==i||e[94]!==d?(y=_=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{g(!1),d(_.id)},children:[s.jsx(Ge,{icon:_.icon,name:_.title,size:"sm",className:"shrink-0",fallbackIcon:s.jsx(Y,{})}),s.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:_.title}),s.jsx(He,{status:_.status})]}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[s.jsx(Ce,{id:_.created_by,size:"3xs"}),s.jsx("span",{children:_.created_at?ye(new Date(_.created_at)):"—"})]}),s.jsxs(tt,{children:[s.jsx(st,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:Zt,children:s.jsx(it,{size:16})})}),s.jsxs(nt,{align:"end",onClick:Yt,children:[s.jsxs(je,{onClick:()=>{g(!1),d(_.id)},children:[s.jsx(lt,{size:16}),"Open"]}),!Ne(_.id)&&s.jsxs(je,{variant:"destructive",onClick:()=>i(_),children:[s.jsx(Fe,{size:16}),"Delete"]})]})]})]},_.id),e[93]=i,e[94]=d,e[95]=y):y=e[95],V=n.agents.map(y),e[89]=n.agents,e[90]=i,e[91]=d,e[92]=V}else V=e[92];let G;e[96]!==V?(G=s.jsx("div",{className:"divide-y max-h-80 overflow-auto",children:V}),e[96]=V,e[97]=G):G=e[97];let E;e[98]!==K||e[99]!==G?(E=s.jsxs(Rt,{className:"sm:max-w-lg p-0 gap-0",children:[K,G]}),e[98]=K,e[99]=G,e[100]=E):E=e[100];let U;e[101]!==N||e[102]!==E?(U=s.jsx(Et,{open:N,onOpenChange:g,children:E}),e[101]=N,e[102]=E,e[103]=U):U=e[103];let F;return e[104]!==T||e[105]!==U?(F=s.jsxs(s.Fragment,{children:[T,U]}),e[104]=T,e[105]=U,e[106]=F):F=e[106],F}function Yt(t){return t.stopPropagation()}function Zt(t){return t.stopPropagation()}function es(t){return s.jsx(He,{status:t.status},t.id)}function ts(t,e){const n=e.updated_at??e.created_at,d=t.updated_at??t.created_at;return n?d?new Date(n)>new Date(d)?e:t:e:t}function ss(t){const e=we.c(21),{count:n,total:d,onSelectAll:i,onDeselectAll:a,onDelete:l,onCancel:x}=t;if(n===0)return null;let N;e[0]!==n?(N=s.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"h-4 w-px bg-border"}),e[2]=g):g=e[2];let w;e[3]!==n||e[4]!==a||e[5]!==i||e[6]!==d?(w=n<d?s.jsxs(Q,{variant:"ghost",size:"sm",onClick:i,children:["Select all (",d,")"]}):s.jsx(Q,{variant:"ghost",size:"sm",onClick:a,children:"Clear selection"}),e[3]=n,e[4]=a,e[5]=i,e[6]=d,e[7]=w):w=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"h-4 w-px bg-border"}),e[8]=m):m=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Fe,{size:14}),e[9]=D):D=e[9];let o;e[10]!==l?(o=s.jsxs(Q,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:l,children:[D,"Delete"]}),e[10]=l,e[11]=o):o=e[11];let O;e[12]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"h-4 w-px bg-border"}),e[12]=O):O=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(gt,{size:14}),e[13]=S):S=e[13];let c;e[14]!==x?(c=s.jsxs(Q,{variant:"ghost",size:"sm",onClick:x,children:[S,"Cancel"]}),e[14]=x,e[15]=c):c=e[15];let C;return e[16]!==N||e[17]!==w||e[18]!==o||e[19]!==c?(C=s.jsxs("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2 flex items-center gap-3 rounded-xl border border-border bg-background/95 backdrop-blur px-4 py-2.5 shadow-lg",children:[N,g,w,m,o,O,c]}),e[16]=N,e[17]=w,e[18]=o,e[19]=c,e[20]=C):C=e[20],C}function ns(t){const e=we.c(37),{columns:n,grouped:d,sortKey:i,sortDirection:a,onSort:l,onRowClick:x,selectionMode:N,selectedIds:g,onToggleSelect:w,emptyState:m}=t;let D;e[0]===Symbol.for("react.memo_cache_sentinel")?(D=new Set,e[0]=D):D=e[0];const[o,O]=J.useState(D);let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=f=>{O(j=>{const p=new Set(j);return p.has(f)?p.delete(f):p.add(f),p})},e[1]=S):S=e[1];const c=S;if(d.length===0&&m){let f;return e[2]!==m?(f=s.jsx("div",{className:"flex items-center justify-center h-full",children:m}),e[2]=m,e[3]=f):f=e[3],f}const C=n.length;let z;if(e[4]!==C||e[5]!==n||e[6]!==l||e[7]!==a||e[8]!==i){let f;e[10]!==C||e[11]!==l||e[12]!==a||e[13]!==i?(f=(j,p)=>{const M=i===j.id,T=p===C-1;return s.jsx(Kt,{className:X("px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider",T&&"w-8","group transition-colors select-none",j.sortable&&"hover:bg-accent cursor-pointer",j.cellClassName),onClick:j.sortable&&l?()=>l(j.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[j.header,j.sortable&&s.jsx("span",{className:"w-4 flex items-center justify-center",children:M&&a&&(a==="asc"?s.jsx(Ht,{size:16,className:"text-muted-foreground"}):s.jsx(Ft,{size:16,className:"text-muted-foreground"}))})]})},j.id)},e[10]=C,e[11]=l,e[12]=a,e[13]=i,e[14]=f):f=e[14],z=n.map(f),e[4]=C,e[5]=n,e[6]=l,e[7]=a,e[8]=i,e[9]=z}else z=e[9];let P;e[15]!==z?(P=s.jsx(Vt,{className:"border-b-0",children:s.jsx(Ve,{className:"h-9 hover:bg-transparent border-b border-border",children:z})}),e[15]=z,e[16]=P):P=e[16];let k;if(e[17]!==n||e[18]!==o||e[19]!==d||e[20]!==x||e[21]!==w||e[22]!==g||e[23]!==N){let f;e[25]!==n||e[26]!==o||e[27]!==x||e[28]!==w||e[29]!==g||e[30]!==N?(f=j=>{if(j.type==="single"){const r=j.agent;return s.jsx(Ve,{className:X("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",N&&g.has(r.id)&&"bg-primary/5"),onClick:()=>x(r),children:n.map(u=>s.jsx(se,{className:X("px-5 py-4 h-16 align-middle text-sm text-foreground",u.cellClassName),children:s.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:u.render?u.render(r):null})},u.id))},r.id)}const p=j,M=o.has(p.key),T=p.agents.every(r=>g.has(r.id)),B=p.agents.some(r=>g.has(r.id)),$=jt(p.agents),L=p.agents.reduce(ls,p.agents[0]);return s.jsxs(J.Fragment,{children:[s.jsx(Ve,{className:"border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>c(p.key),children:n.map(r=>{const u=X("px-5 py-3 h-14 align-middle text-sm",r.cellClassName);if(r.id==="select")return s.jsx(se,{className:u,children:s.jsx(Ue,{checked:T?!0:B?"indeterminate":!1,onCheckedChange:()=>{for(const b of p.agents)T?g.has(b.id)&&w(b.id):g.has(b.id)||w(b.id)},onClick:is})},r.id);if(r.id==="title")return s.jsx(se,{className:u,children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Ge,{icon:p.icon,name:p.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:s.jsx(Y,{size:16})}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:p.title}),s.jsxs(et,{variant:"secondary",className:"text-xs tabular-nums",children:["x",p.agents.length]})]})},r.id);if(r.id==="updated_by")return s.jsx(se,{className:u,children:s.jsx("div",{className:"flex items-center -space-x-1.5",children:$.map(b=>s.jsx(Ce,{id:b,size:"3xs",avatarOnly:$.length>1},b))})},r.id);if(r.id==="updated_at"){const b=L.updated_at??L.created_at;return s.jsx(se,{className:u,children:s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b?ye(new Date(b)):"—"})},r.id)}return r.id==="actions"?s.jsx(se,{className:u,children:s.jsx(qt,{size:16,className:X("text-muted-foreground transition-transform",M&&"rotate-180")})},r.id):s.jsx(se,{className:u},r.id)})}),M&&p.agents.map(r=>s.jsx(Ve,{className:X("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",N&&g.has(r.id)&&"bg-primary/5"),onClick:()=>x(r),children:n.map(u=>s.jsx(se,{className:X("px-5 py-3 h-14 align-middle text-sm text-foreground",u.cellClassName,u.id==="title"&&"pl-12"),children:s.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:u.render?u.render(r):null})},u.id))},r.id))]},p.key)},e[25]=n,e[26]=o,e[27]=x,e[28]=w,e[29]=g,e[30]=N,e[31]=f):f=e[31],k=d.map(f),e[17]=n,e[18]=o,e[19]=d,e[20]=x,e[21]=w,e[22]=g,e[23]=N,e[24]=k}else k=e[24];let I;e[32]!==k?(I=s.jsx(Gt,{children:k}),e[32]=k,e[33]=I):I=e[33];let A;return e[34]!==P||e[35]!==I?(A=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsxs(Ut,{className:"w-full border-collapse",children:[P,I]})}),e[34]=P,e[35]=I,e[36]=A):A=e[36],A}function is(t){return t.stopPropagation()}function ls(t,e){const n=e.updated_at??e.created_at,d=t.updated_at??t.created_at;return n?d?new Date(n)>new Date(d)?e:t:e:t}function as(){const t=we.c(138),{org:e}=Nt(),n=Ct();let d;t[0]!==e.slug?(d={namespace:e.slug,resource:"agents"},t[0]=e.slug,t[1]=d):d=t[1];const i=Tt(d),a=Pt(i);let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l={navigateOnCreate:!0},t[2]=l):l=t[2];const{createVirtualMCP:x,isCreating:N}=$t(l),g=It();let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w={mode:"idle"},t[3]=w):w=t[3];const[m,D]=J.useReducer(Wt,w),[o,O]=J.useState(!1);let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=new Set,t[4]=S):S=t[4];const[c,C]=J.useState(S),[z,P]=J.useState(!1),[k,I]=J.useState("ALL");let A;t[5]===Symbol.for("react.memo_cache_sentinel")?(A=E=>{C(U=>{const F=new Set(U);return F.has(E)?F.delete(E):F.add(E),F})},t[5]=A):A=t[5];const f=A;let j;t[6]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{O(!1),C(new Set)},t[6]=j):j=t[6];const p=j;let M,T,B,$,L,r,u,b;if(t[7]!==g||t[8]!==z||t[9]!==x||t[10]!==m.mode||t[11]!==m.virtualMcp||t[12]!==N||t[13]!==i||t[14]!==n||t[15]!==e.slug||t[16]!==c||t[17]!==o||t[18]!==k||t[19]!==a){let E;t[28]!==k?(E=h=>!(k!=="ALL"&&h.status!==k),t[28]=k,t[29]=E):E=t[29],B=a.filter(E);const U=Qt(B),F=a.length;let y;t[30]!==a?(y=a.filter(Ns),t[30]=a,t[31]=y):y=t[31];const _=y.length;let W;t[32]!==a?(W=a.filter(vs),t[32]=a,t[33]=W):W=t[33];let Z;t[34]!==y.length||t[35]!==W.length||t[36]!==a.length?(Z={total:F,active:_,inactive:W.length},t[34]=y.length,t[35]=W.length,t[36]=a.length,t[37]=Z):Z=t[37];const H=Z;let ee;t[38]!==g||t[39]!==m.mode||t[40]!==m.virtualMcp?(ee=async()=>{if(m.mode!=="deleting")return;const h=m.virtualMcp.id;if(D({type:"close"}),!(!h||Ne(h)))try{await g.delete.mutateAsync(h)}catch{}},t[38]=g,t[39]=m.mode,t[40]=m.virtualMcp,t[41]=ee):ee=t[41];const q=ee;let te;t[42]!==g||t[43]!==c?(te=async()=>{P(!1);let h=0;for(const v of c)if(!Ne(v))try{await g.delete.mutateAsync(v),h++}catch{}yt.success(`Deleted ${h} agent${h!==1?"s":""}`),p()},t[42]=g,t[43]=c,t[44]=te):te=t[44];const R=te;let Se;t[45]!==n||t[46]!==e.slug||t[47]!==o?(Se=h=>{if(o){f(h);return}n({to:"/$org/$project/agents/$agentId",params:{org:e.slug,project:wt,agentId:h}})},t[45]=n,t[46]=e.slug,t[47]=o,t[48]=Se):Se=t[48];const ne=Se;let ie;t[49]!==c||t[50]!==o?(ie=o?[{id:"select",header:"",render:h=>s.jsx(Ue,{checked:c.has(h.id),onCheckedChange:()=>f(h.id),onClick:bs}),cellClassName:"w-10 shrink-0"}]:[],t[49]=c,t[50]=o,t[51]=ie):ie=t[51];let ke,_e,De,ze,Ae,Me;t[52]===Symbol.for("react.memo_cache_sentinel")?(ke={id:"title",header:"Name",render:js,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_e={id:"description",header:"Description",render:gs,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},De={id:"connections",header:"Connections",render:ps,cellClassName:"w-28 shrink-0"},ze={id:"status",header:"Status",render:hs,cellClassName:"w-24 shrink-0"},Ae={id:"updated_by",header:"Updated by",render:us,cellClassName:"w-32 shrink-0",sortable:!0},Me={id:"updated_at",header:"Updated",render:fs,cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},t[52]=ke,t[53]=_e,t[54]=De,t[55]=ze,t[56]=Ae,t[57]=Me):(ke=t[52],_e=t[53],De=t[54],ze=t[55],Ae=t[56],Me=t[57]);let le;t[58]!==ne?(le={id:"actions",header:"",render:h=>s.jsxs(tt,{children:[s.jsx(st,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ms,children:s.jsx(it,{size:20})})}),s.jsxs(nt,{align:"end",onClick:ds,children:[s.jsxs(je,{onClick:v=>{v.stopPropagation(),ne(h.id)},children:[s.jsx(lt,{size:16}),"Open"]}),!Ne(h.id)&&s.jsxs(je,{variant:"destructive",onClick:v=>{v.stopPropagation(),D({type:"delete",virtualMcp:h})},children:[s.jsx(Fe,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"},t[58]=ne,t[59]=le):le=t[59];let Te;t[60]!==ie||t[61]!==le?(Te=[...ie,ke,_e,De,ze,Ae,Me,le],t[60]=ie,t[61]=le,t[62]=Te):Te=t[62];const bt=Te;let $e;t[63]!==x||t[64]!==N||t[65]!==o?($e=s.jsx("div",{className:"flex items-center gap-2",children:o?s.jsxs(Q,{variant:"ghost",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:p,children:[s.jsx(gt,{size:14}),"Cancel"]}):s.jsxs(s.Fragment,{children:[s.jsxs(Q,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:()=>O(!0),children:[s.jsx(Mt,{size:14}),"Select"]}),s.jsx(Q,{onClick:x,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:N,children:N?"Creating...":"Create Agent"})]})}),t[63]=x,t[64]=N,t[65]=o,t[66]=$e):$e=t[66];const qe=$e;T=ve;const Je=m.mode==="deleting";let Pe;t[67]===Symbol.for("react.memo_cache_sentinel")?(Pe=h=>!h&&D({type:"close"}),t[67]=Pe):Pe=t[67];let Ie;t[68]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(at,{children:"Delete Agent?"}),t[68]=Ie):Ie=t[68];const Qe=m.mode==="deleting"&&m.virtualMcp.title;let ae;t[69]!==Qe?(ae=s.jsxs(rt,{children:[Ie,s.jsxs(ot,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:Qe}),"."]})]}),t[69]=Qe,t[70]=ae):ae=t[70];let Oe;t[71]===Symbol.for("react.memo_cache_sentinel")?(Oe=s.jsx(ct,{children:"Cancel"}),t[71]=Oe):Oe=t[71];let re;t[72]!==q?(re=s.jsxs(dt,{children:[Oe,s.jsx(mt,{onClick:q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[72]=q,t[73]=re):re=t[73];let oe;t[74]!==ae||t[75]!==re?(oe=s.jsxs(ft,{children:[ae,re]}),t[74]=ae,t[75]=re,t[76]=oe):oe=t[76],t[77]!==Je||t[78]!==oe?(r=s.jsx(ut,{open:Je,onOpenChange:Pe,children:oe}),t[77]=Je,t[78]=oe,t[79]=r):r=t[79];const We=c.size!==1?"s":"";let ce;t[80]!==c.size||t[81]!==We?(ce=s.jsxs(at,{children:["Delete ",c.size," agent",We,"?"]}),t[80]=c.size,t[81]=We,t[82]=ce):ce=t[82];let Be;t[83]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsx(ot,{children:"This action cannot be undone. This will permanently delete the selected agents."}),t[83]=Be):Be=t[83];let de;t[84]!==ce?(de=s.jsxs(rt,{children:[ce,Be]}),t[84]=ce,t[85]=de):de=t[85];let Le;t[86]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(ct,{children:"Cancel"}),t[86]=Le):Le=t[86];let me;t[87]!==R?(me=s.jsxs(dt,{children:[Le,s.jsx(mt,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[87]=R,t[88]=me):me=t[88];let fe;t[89]!==de||t[90]!==me?(fe=s.jsxs(ft,{children:[de,me]}),t[89]=de,t[90]=me,t[91]=fe):fe=t[91],t[92]!==z||t[93]!==fe?(u=s.jsx(ut,{open:z,onOpenChange:P,children:fe}),t[92]=z,t[93]=fe,t[94]=u):u=t[94];const Xe=H.active>0&&` · ${H.active} active`,Ye=H.inactive>0&&` · ${H.inactive} inactive`;let ue;t[95]!==H.total||t[96]!==Xe||t[97]!==Ye?(ue=s.jsx(ve.Header.Left,{children:s.jsx(_t,{children:s.jsx(Dt,{children:s.jsx(zt,{children:s.jsxs(At,{className:"flex items-center gap-2",children:["Agents",s.jsxs("span",{className:"text-xs font-normal text-muted-foreground tabular-nums",children:[H.total," total",Xe,Ye]})]})})})})}),t[95]=H.total,t[96]=Xe,t[97]=Ye,t[98]=ue):ue=t[98];let Re;t[99]===Symbol.for("react.memo_cache_sentinel")?(Re=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],t[99]=Re):Re=t[99];let Ee,Ke;t[100]===Symbol.for("react.memo_cache_sentinel")?(Ee=h=>I(h||"ALL"),Ke=[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"}],t[100]=Ee,t[101]=Ke):(Ee=t[100],Ke=t[101]);let he;t[102]!==k?(he=[{label:"Status",value:k,onChange:Ee,options:Ke}],t[102]=k,t[103]=he):he=t[103];let pe;t[104]!==i.handleSort||t[105]!==i.setViewMode||t[106]!==i.sortDirection||t[107]!==i.sortKey||t[108]!==i.viewMode||t[109]!==he?(pe=s.jsx(St,{viewMode:i.viewMode,onViewModeChange:i.setViewMode,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:Re,filters:he}),t[104]=i.handleSort,t[105]=i.setViewMode,t[106]=i.sortDirection,t[107]=i.sortKey,t[108]=i.viewMode,t[109]=he,t[110]=pe):pe=t[110];let xe;t[111]!==qe||t[112]!==pe?(xe=s.jsxs(ve.Header.Right,{children:[pe,qe]}),t[111]=qe,t[112]=pe,t[113]=xe):xe=t[113],t[114]!==ue||t[115]!==xe?(b=s.jsxs(ve.Header,{children:[ue,xe]}),t[114]=ue,t[115]=xe,t[116]=b):b=t[116];let ge;t[117]!==i?(ge=h=>{h.key==="Escape"&&(i.setSearch(""),h.target.blur())},t[117]=i,t[118]=ge):ge=t[118],t[119]!==i.search||t[120]!==i.setSearch||t[121]!==ge?($=s.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:s.jsx("div",{className:"flex-1",children:s.jsx(kt,{value:i.search,onChange:i.setSearch,placeholder:"Search for an agent...",onKeyDown:ge})})}),t[119]=i.search,t[120]=i.setSearch,t[121]=ge,t[122]=$):$=t[122],M=ve.Content,L=i.viewMode==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:B.length===0?s.jsx(Ze,{image:s.jsx(Y,{size:36,className:"text-muted-foreground"}),title:i.search?"No agents found":"No agents yet",description:i.search?`No agents match "${i.search}"`:"Create an agent to aggregate tools from multiple Connections."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:U.map(h=>{if(h.type==="group")return s.jsx(Xt,{group:h,onNavigate:ne,onDelete:be=>D({type:"delete",virtualMcp:be}),selectionMode:o,selectedIds:c,onToggleSelect:f},h.key);const v=h.agent;return s.jsxs("div",{className:"relative",children:[o&&s.jsx("div",{className:"absolute top-3 left-3 z-10",children:s.jsx(Ue,{checked:c.has(v.id),onCheckedChange:()=>f(v.id)})}),s.jsx(xt,{connection:{id:v.id??"",title:v.title,description:v.description,icon:v.icon,status:v.status},fallbackIcon:s.jsx(Y,{}),onClick:()=>ne(v.id),className:X(o&&c.has(v.id)&&"ring-2 ring-primary"),body:s.jsx(He,{status:v.status}),footer:s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Ce,{id:v.updated_by??v.created_by,size:"3xs"})}),s.jsx("span",{className:"shrink-0 ml-2",children:v.updated_at?ye(new Date(v.updated_at)):"—"})]}),headerActions:o?void 0:s.jsxs(tt,{children:[s.jsx(st,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:cs,children:s.jsx(it,{size:20})})}),s.jsxs(nt,{align:"end",onClick:os,children:[s.jsxs(je,{onClick:be=>{be.stopPropagation(),ne(v.id)},children:[s.jsx(lt,{size:16}),"Open"]}),!Ne(v.id)&&s.jsxs(je,{variant:"destructive",onClick:be=>{be.stopPropagation(),D({type:"delete",virtualMcp:v})},children:[s.jsx(Fe,{size:16}),"Delete"]})]})]})})]},v.id)})})}):s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:s.jsx("div",{className:"min-w-[1000px]",children:s.jsx(ns,{columns:bt,grouped:U,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,onRowClick:h=>ne(h.id),selectionMode:o,selectedIds:c,onToggleSelect:f,emptyState:i.search?s.jsx(Ze,{image:s.jsx(Y,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${i.search}"`}):s.jsx(Ze,{image:s.jsx(Y,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})})})})}),t[7]=g,t[8]=z,t[9]=x,t[10]=m.mode,t[11]=m.virtualMcp,t[12]=N,t[13]=i,t[14]=n,t[15]=e.slug,t[16]=c,t[17]=o,t[18]=k,t[19]=a,t[20]=M,t[21]=T,t[22]=B,t[23]=$,t[24]=L,t[25]=r,t[26]=u,t[27]=b}else M=t[20],T=t[21],B=t[22],$=t[23],L=t[24],r=t[25],u=t[26],b=t[27];let K;t[123]!==M||t[124]!==L?(K=s.jsx(M,{children:L}),t[123]=M,t[124]=L,t[125]=K):K=t[125];let V;t[126]!==B||t[127]!==c.size||t[128]!==o?(V=o&&s.jsx(ss,{count:c.size,total:B.length,onSelectAll:()=>C(new Set(B.map(rs))),onDeselectAll:()=>C(new Set),onDelete:()=>P(!0),onCancel:p}),t[126]=B,t[127]=c.size,t[128]=o,t[129]=V):V=t[129];let G;return t[130]!==T||t[131]!==$||t[132]!==K||t[133]!==V||t[134]!==r||t[135]!==u||t[136]!==b?(G=s.jsxs(T,{children:[r,u,b,$,K,V]}),t[130]=T,t[131]=$,t[132]=K,t[133]=V,t[134]=r,t[135]=u,t[136]=b,t[137]=G):G=t[137],G}function rs(t){return t.id}function os(t){return t.stopPropagation()}function cs(t){return t.stopPropagation()}function ds(t){return t.stopPropagation()}function ms(t){return t.stopPropagation()}function fs(t){return s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ye(new Date(t.updated_at)):"—"})}function us(t){return s.jsx(Ce,{id:t.updated_by??t.created_by,size:"3xs"})}function hs(t){return s.jsx(He,{status:t.status})}function ps(t){return s.jsx(J.Suspense,{fallback:s.jsx(ht.Fallback,{}),children:s.jsx(ht,{connectionIds:t.connections.map(xs),maxVisibleIcons:2})})}function xs(t){return t.connection_id}function gs(t){return s.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"})}function js(t){return s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Ge,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:s.jsx(Y,{size:16})}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.title})]})}function bs(t){return t.stopPropagation()}function vs(t){return t.status==="inactive"}function Ns(t){return t.status==="active"}function Cn(){const t=we.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vt,{children:s.jsx(J.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Jt,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(as,{})})}),t[0]=e):e=t[0],e}export{Cn as default};
|
|
1
|
+
import{c as we,j as s,E as vt,r as J,u as Nt,e as Ct,B as Q,z as X,w as yt,O as wt}from"./index-BUP2j-VZ.js";import{C as St}from"./collection-display-button-Dbmpw-3P.js";import{C as kt}from"./collection-search-Bl8CXpst.js";import{P as ve}from"./index-CRVyuFS0.js";import{B as _t,a as Dt,b as zt,c as At}from"./breadcrumb-C0C7xCxQ.js";import{C as xt}from"./connection-card-N3Tx1qhb.js";import{C as He,i as Mt}from"./connection-status-BzysCDJU.js";import{E as Ze}from"./empty-state-BJQVSVey.js";import{I as Ge}from"./integration-icon-DhNWPq_0.js";import{u as Tt}from"./use-list-state-CSB_h2rv.js";import{u as $t}from"./use-create-virtual-mcp-B8asQT4w.js";import{i as Ne}from"./constants-B4i933q7.js";import{b as Pt,a as It}from"./use-virtual-mcp-94OtcwcB.js";import{c as at,b as rt,d as ot,A as ct,e as dt,h as mt,a as ft,f as ut}from"./alert-dialog-BQU839b3.js";import{B as et}from"./badge-DSBNODR5.js";import{C as Ue}from"./checkbox-B3Rpe7-l.js";import{c as Ot,d as Bt,b as Lt,a as Rt,D as Et}from"./dialog-CflsNx8x.js";import{T as Kt,a as Vt,b as Ve,c as se,d as Gt,e as Ut}from"./table-Cxzf-FHD.js";import{D as tt,a as st,b as nt,c as je}from"./dropdown-menu-DcNTx9lg.js";import{n as Ft}from"./ArrowDown-J5qOTRoA.js";import{i as Ht}from"./ArrowUp-aSx0u-5l.js";import{t as qt}from"./ChevronDown-D9wVK5bH.js";import{i as it}from"./DotsVertical-B6C_2FFD.js";import{s as lt}from"./Eye-MtNtMWW5.js";import{i as Jt}from"./Loading01-B87VIClz.js";import{s as Fe}from"./Trash01-DC96NOta.js";import{t as Y}from"./Users03-cvM2Ndk1.js";import{s as gt}from"./XClose-BHPDEFB2.js";import{U as Ce}from"./user-CztLlDB5.js";import{A as ht}from"./agent-connections-preview-BlJ035nM.js";import{f as ye}from"./format-time-CMKyl-GC.js";import"./Check-B8ndkg7T.js";import"./Grid01-Cx4wu3Y9.js";import"./List-B0bmeecJ.js";import"./tooltip-CYJcicRO.js";import"./index-BPNTL7B5.js";import"./SearchMd-DEv7e_hZ.js";import"./input-OS0sGs_c.js";import"./use-local-storage-Do7hPFcT.js";import"./useQuery-CN1pzVoX.js";import"./useMutation-7d0bWCn1.js";import"./ChevronRight-BWpUvEdI.js";import"./card-3wGXs2xF.js";import"./AlertCircle-DBHSxle0.js";import"./CheckCircle-DAXfTEK-.js";import"./Container-CLsUjxhY.js";import"./use-view-mode-DmTBDQfD.js";import"./use-mobile-Dc15vEtL.js";import"./use-collections-DMxCeq8b.js";import"./X-C5okAsgi.js";import"./avatar-BzF6Jb9Z.js";import"./use-connection-ez0pyFtP.js";import"./differenceInSeconds-NQ4PDo0z.js";function pt(t){return t.title.trim().replace(/\s+\(\d+\)$/,"")}function Qt(t){const e=new Map;for(const i of t){const a=pt(i),l=e.get(a);l?l.push(i):e.set(a,[i])}const n=[],d=new Set;for(const i of t){const a=pt(i);if(d.has(a))continue;d.add(a);const l=e.get(a),x=l[0];l.length===1?n.push({type:"single",agent:x}):n.push({type:"group",key:a,icon:x.icon,title:x.title.replace(/\s*\(\d+\)\s*$/,""),agents:l})}return n}function jt(t){const e=new Set,n=[];for(const d of t)d.created_by&&!e.has(d.created_by)&&(e.add(d.created_by),n.push(d.created_by));return n}function Wt(t,e){switch(e.type){case"delete":return{mode:"deleting",virtualMcp:e.virtualMcp};case"close":return{mode:"idle"}}}function Xt(t){const e=we.c(107),{group:n,onNavigate:d,onDelete:i,selectionMode:a,selectedIds:l,onToggleSelect:x}=t,[N,g]=J.useState(!1);let w;if(e[0]!==n.agents||e[1]!==l){let y;e[3]!==l?(y=_=>l.has(_.id),e[3]=l,e[4]=y):y=e[4],w=n.agents.every(y),e[0]=n.agents,e[1]=l,e[2]=w}else w=e[2];const m=w;let D;if(e[5]!==n.agents||e[6]!==l){let y;e[8]!==l?(y=_=>l.has(_.id),e[8]=l,e[9]=y):y=e[9],D=n.agents.some(y),e[5]=n.agents,e[6]=l,e[7]=D}else D=e[7];const o=D;let O,S,c,C,z,P,k,I,A,f,j;if(e[10]!==m||e[11]!==n.agents||e[12]!==n.icon||e[13]!==n.title||e[14]!==x||e[15]!==l||e[16]!==a||e[17]!==o){const y=jt(n.agents),_=n.agents.reduce(ts,n.agents[0]),W=_.updated_at??_.created_at;O=xt;const Z=`${n.agents.length} instances`;e[29]!==n.icon||e[30]!==n.title||e[31]!==Z?(A={title:n.title,icon:n.icon,description:Z},e[29]=n.icon,e[30]=n.title,e[31]=Z,e[32]=A):A=e[32],e[33]!==m||e[34]!==n.agents||e[35]!==x||e[36]!==l||e[37]!==a?(f=()=>a?(()=>{for(const R of n.agents)m?l.has(R.id)&&x(R.id):l.has(R.id)||x(R.id)})():g(!0),e[33]=m,e[34]=n.agents,e[35]=x,e[36]=l,e[37]=a,e[38]=f):f=e[38];const H=a&&m&&"ring-2 ring-primary",ee=a&&o&&!m&&"ring-1 ring-primary/50";e[39]!==H||e[40]!==ee?(j=X(H,ee),e[39]=H,e[40]=ee,e[41]=j):j=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Y,{}),e[42]=S):S=e[42],e[43]!==m||e[44]!==n.agents||e[45]!==x||e[46]!==l||e[47]!==a||e[48]!==o?(c=a?s.jsx(Ue,{checked:m?!0:o?"indeterminate":!1,onCheckedChange:()=>{for(const R of n.agents)m?l.has(R.id)&&x(R.id):l.has(R.id)||x(R.id)}}):s.jsxs(et,{variant:"secondary",className:"text-xs tabular-nums",children:["x",n.agents.length]}),e[43]=m,e[44]=n.agents,e[45]=x,e[46]=l,e[47]=a,e[48]=o,e[49]=c):c=e[49];let q;e[50]!==n.agents?(q=n.agents.slice(0,6).map(es),e[50]=n.agents,e[51]=q):q=e[51],e[52]!==q?(C=s.jsx("div",{className:"flex items-center gap-1",children:q}),e[52]=q,e[53]=C):C=e[53],k="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const te=y.map(R=>s.jsx(Ce,{id:R,size:"3xs",avatarOnly:y.length>1},R));e[54]!==te?(I=s.jsx("div",{className:"flex items-center -space-x-1.5",children:te}),e[54]=te,e[55]=I):I=e[55],z="shrink-0 ml-2",P=W?ye(new Date(W)):"—",e[10]=m,e[11]=n.agents,e[12]=n.icon,e[13]=n.title,e[14]=x,e[15]=l,e[16]=a,e[17]=o,e[18]=O,e[19]=S,e[20]=c,e[21]=C,e[22]=z,e[23]=P,e[24]=k,e[25]=I,e[26]=A,e[27]=f,e[28]=j}else O=e[18],S=e[19],c=e[20],C=e[21],z=e[22],P=e[23],k=e[24],I=e[25],A=e[26],f=e[27],j=e[28];let p;e[56]!==z||e[57]!==P?(p=s.jsx("span",{className:z,children:P}),e[56]=z,e[57]=P,e[58]=p):p=e[58];let M;e[59]!==p||e[60]!==k||e[61]!==I?(M=s.jsxs("div",{className:k,children:[I,p]}),e[59]=p,e[60]=k,e[61]=I,e[62]=M):M=e[62];let T;e[63]!==O||e[64]!==S||e[65]!==c||e[66]!==C||e[67]!==M||e[68]!==A||e[69]!==f||e[70]!==j?(T=s.jsx(O,{connection:A,onClick:f,className:j,fallbackIcon:S,headerActions:c,body:C,footer:M}),e[63]=O,e[64]=S,e[65]=c,e[66]=C,e[67]=M,e[68]=A,e[69]=f,e[70]=j,e[71]=T):T=e[71];let B;e[72]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Y,{}),e[72]=B):B=e[72];let $;e[73]!==n.icon||e[74]!==n.title?($=s.jsx(Ge,{icon:n.icon,name:n.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:B}),e[73]=n.icon,e[74]=n.title,e[75]=$):$=e[75];let L;e[76]!==n.agents.length?(L=s.jsxs(et,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.agents.length]}),e[76]=n.agents.length,e[77]=L):L=e[77];let r;e[78]!==n.title||e[79]!==L?(r=s.jsxs(Ot,{children:[n.title,L]}),e[78]=n.title,e[79]=L,e[80]=r):r=e[80];let u;e[81]!==n.agents.length?(u=s.jsxs(Bt,{children:[n.agents.length," instances"]}),e[81]=n.agents.length,e[82]=u):u=e[82];let b;e[83]!==r||e[84]!==u?(b=s.jsxs("div",{children:[r,u]}),e[83]=r,e[84]=u,e[85]=b):b=e[85];let K;e[86]!==$||e[87]!==b?(K=s.jsx(Lt,{className:"px-6 pt-6 pb-4",children:s.jsxs("div",{className:"flex items-center gap-3",children:[$,b]})}),e[86]=$,e[87]=b,e[88]=K):K=e[88];let V;if(e[89]!==n.agents||e[90]!==i||e[91]!==d){let y;e[93]!==i||e[94]!==d?(y=_=>s.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{g(!1),d(_.id)},children:[s.jsx(Ge,{icon:_.icon,name:_.title,size:"sm",className:"shrink-0",fallbackIcon:s.jsx(Y,{})}),s.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:_.title}),s.jsx(He,{status:_.status})]}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[s.jsx(Ce,{id:_.created_by,size:"3xs"}),s.jsx("span",{children:_.created_at?ye(new Date(_.created_at)):"—"})]}),s.jsxs(tt,{children:[s.jsx(st,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:Zt,children:s.jsx(it,{size:16})})}),s.jsxs(nt,{align:"end",onClick:Yt,children:[s.jsxs(je,{onClick:()=>{g(!1),d(_.id)},children:[s.jsx(lt,{size:16}),"Open"]}),!Ne(_.id)&&s.jsxs(je,{variant:"destructive",onClick:()=>i(_),children:[s.jsx(Fe,{size:16}),"Delete"]})]})]})]},_.id),e[93]=i,e[94]=d,e[95]=y):y=e[95],V=n.agents.map(y),e[89]=n.agents,e[90]=i,e[91]=d,e[92]=V}else V=e[92];let G;e[96]!==V?(G=s.jsx("div",{className:"divide-y max-h-80 overflow-auto",children:V}),e[96]=V,e[97]=G):G=e[97];let E;e[98]!==K||e[99]!==G?(E=s.jsxs(Rt,{className:"sm:max-w-lg p-0 gap-0",children:[K,G]}),e[98]=K,e[99]=G,e[100]=E):E=e[100];let U;e[101]!==N||e[102]!==E?(U=s.jsx(Et,{open:N,onOpenChange:g,children:E}),e[101]=N,e[102]=E,e[103]=U):U=e[103];let F;return e[104]!==T||e[105]!==U?(F=s.jsxs(s.Fragment,{children:[T,U]}),e[104]=T,e[105]=U,e[106]=F):F=e[106],F}function Yt(t){return t.stopPropagation()}function Zt(t){return t.stopPropagation()}function es(t){return s.jsx(He,{status:t.status},t.id)}function ts(t,e){const n=e.updated_at??e.created_at,d=t.updated_at??t.created_at;return n?d?new Date(n)>new Date(d)?e:t:e:t}function ss(t){const e=we.c(21),{count:n,total:d,onSelectAll:i,onDeselectAll:a,onDelete:l,onCancel:x}=t;if(n===0)return null;let N;e[0]!==n?(N=s.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"h-4 w-px bg-border"}),e[2]=g):g=e[2];let w;e[3]!==n||e[4]!==a||e[5]!==i||e[6]!==d?(w=n<d?s.jsxs(Q,{variant:"ghost",size:"sm",onClick:i,children:["Select all (",d,")"]}):s.jsx(Q,{variant:"ghost",size:"sm",onClick:a,children:"Clear selection"}),e[3]=n,e[4]=a,e[5]=i,e[6]=d,e[7]=w):w=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"h-4 w-px bg-border"}),e[8]=m):m=e[8];let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Fe,{size:14}),e[9]=D):D=e[9];let o;e[10]!==l?(o=s.jsxs(Q,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:l,children:[D,"Delete"]}),e[10]=l,e[11]=o):o=e[11];let O;e[12]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"h-4 w-px bg-border"}),e[12]=O):O=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(gt,{size:14}),e[13]=S):S=e[13];let c;e[14]!==x?(c=s.jsxs(Q,{variant:"ghost",size:"sm",onClick:x,children:[S,"Cancel"]}),e[14]=x,e[15]=c):c=e[15];let C;return e[16]!==N||e[17]!==w||e[18]!==o||e[19]!==c?(C=s.jsxs("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2 flex items-center gap-3 rounded-xl border border-border bg-background/95 backdrop-blur px-4 py-2.5 shadow-lg",children:[N,g,w,m,o,O,c]}),e[16]=N,e[17]=w,e[18]=o,e[19]=c,e[20]=C):C=e[20],C}function ns(t){const e=we.c(37),{columns:n,grouped:d,sortKey:i,sortDirection:a,onSort:l,onRowClick:x,selectionMode:N,selectedIds:g,onToggleSelect:w,emptyState:m}=t;let D;e[0]===Symbol.for("react.memo_cache_sentinel")?(D=new Set,e[0]=D):D=e[0];const[o,O]=J.useState(D);let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=f=>{O(j=>{const p=new Set(j);return p.has(f)?p.delete(f):p.add(f),p})},e[1]=S):S=e[1];const c=S;if(d.length===0&&m){let f;return e[2]!==m?(f=s.jsx("div",{className:"flex items-center justify-center h-full",children:m}),e[2]=m,e[3]=f):f=e[3],f}const C=n.length;let z;if(e[4]!==C||e[5]!==n||e[6]!==l||e[7]!==a||e[8]!==i){let f;e[10]!==C||e[11]!==l||e[12]!==a||e[13]!==i?(f=(j,p)=>{const M=i===j.id,T=p===C-1;return s.jsx(Kt,{className:X("px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider",T&&"w-8","group transition-colors select-none",j.sortable&&"hover:bg-accent cursor-pointer",j.cellClassName),onClick:j.sortable&&l?()=>l(j.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[j.header,j.sortable&&s.jsx("span",{className:"w-4 flex items-center justify-center",children:M&&a&&(a==="asc"?s.jsx(Ht,{size:16,className:"text-muted-foreground"}):s.jsx(Ft,{size:16,className:"text-muted-foreground"}))})]})},j.id)},e[10]=C,e[11]=l,e[12]=a,e[13]=i,e[14]=f):f=e[14],z=n.map(f),e[4]=C,e[5]=n,e[6]=l,e[7]=a,e[8]=i,e[9]=z}else z=e[9];let P;e[15]!==z?(P=s.jsx(Vt,{className:"border-b-0",children:s.jsx(Ve,{className:"h-9 hover:bg-transparent border-b border-border",children:z})}),e[15]=z,e[16]=P):P=e[16];let k;if(e[17]!==n||e[18]!==o||e[19]!==d||e[20]!==x||e[21]!==w||e[22]!==g||e[23]!==N){let f;e[25]!==n||e[26]!==o||e[27]!==x||e[28]!==w||e[29]!==g||e[30]!==N?(f=j=>{if(j.type==="single"){const r=j.agent;return s.jsx(Ve,{className:X("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",N&&g.has(r.id)&&"bg-primary/5"),onClick:()=>x(r),children:n.map(u=>s.jsx(se,{className:X("px-5 py-4 h-16 align-middle text-sm text-foreground",u.cellClassName),children:s.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:u.render?u.render(r):null})},u.id))},r.id)}const p=j,M=o.has(p.key),T=p.agents.every(r=>g.has(r.id)),B=p.agents.some(r=>g.has(r.id)),$=jt(p.agents),L=p.agents.reduce(ls,p.agents[0]);return s.jsxs(J.Fragment,{children:[s.jsx(Ve,{className:"border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>c(p.key),children:n.map(r=>{const u=X("px-5 py-3 h-14 align-middle text-sm",r.cellClassName);if(r.id==="select")return s.jsx(se,{className:u,children:s.jsx(Ue,{checked:T?!0:B?"indeterminate":!1,onCheckedChange:()=>{for(const b of p.agents)T?g.has(b.id)&&w(b.id):g.has(b.id)||w(b.id)},onClick:is})},r.id);if(r.id==="title")return s.jsx(se,{className:u,children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Ge,{icon:p.icon,name:p.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:s.jsx(Y,{size:16})}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:p.title}),s.jsxs(et,{variant:"secondary",className:"text-xs tabular-nums",children:["x",p.agents.length]})]})},r.id);if(r.id==="updated_by")return s.jsx(se,{className:u,children:s.jsx("div",{className:"flex items-center -space-x-1.5",children:$.map(b=>s.jsx(Ce,{id:b,size:"3xs",avatarOnly:$.length>1},b))})},r.id);if(r.id==="updated_at"){const b=L.updated_at??L.created_at;return s.jsx(se,{className:u,children:s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b?ye(new Date(b)):"—"})},r.id)}return r.id==="actions"?s.jsx(se,{className:u,children:s.jsx(qt,{size:16,className:X("text-muted-foreground transition-transform",M&&"rotate-180")})},r.id):s.jsx(se,{className:u},r.id)})}),M&&p.agents.map(r=>s.jsx(Ve,{className:X("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",N&&g.has(r.id)&&"bg-primary/5"),onClick:()=>x(r),children:n.map(u=>s.jsx(se,{className:X("px-5 py-3 h-14 align-middle text-sm text-foreground",u.cellClassName,u.id==="title"&&"pl-12"),children:s.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:u.render?u.render(r):null})},u.id))},r.id))]},p.key)},e[25]=n,e[26]=o,e[27]=x,e[28]=w,e[29]=g,e[30]=N,e[31]=f):f=e[31],k=d.map(f),e[17]=n,e[18]=o,e[19]=d,e[20]=x,e[21]=w,e[22]=g,e[23]=N,e[24]=k}else k=e[24];let I;e[32]!==k?(I=s.jsx(Gt,{children:k}),e[32]=k,e[33]=I):I=e[33];let A;return e[34]!==P||e[35]!==I?(A=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsxs(Ut,{className:"w-full border-collapse",children:[P,I]})}),e[34]=P,e[35]=I,e[36]=A):A=e[36],A}function is(t){return t.stopPropagation()}function ls(t,e){const n=e.updated_at??e.created_at,d=t.updated_at??t.created_at;return n?d?new Date(n)>new Date(d)?e:t:e:t}function as(){const t=we.c(138),{org:e}=Nt(),n=Ct();let d;t[0]!==e.slug?(d={namespace:e.slug,resource:"agents"},t[0]=e.slug,t[1]=d):d=t[1];const i=Tt(d),a=Pt(i);let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l={navigateOnCreate:!0},t[2]=l):l=t[2];const{createVirtualMCP:x,isCreating:N}=$t(l),g=It();let w;t[3]===Symbol.for("react.memo_cache_sentinel")?(w={mode:"idle"},t[3]=w):w=t[3];const[m,D]=J.useReducer(Wt,w),[o,O]=J.useState(!1);let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=new Set,t[4]=S):S=t[4];const[c,C]=J.useState(S),[z,P]=J.useState(!1),[k,I]=J.useState("ALL");let A;t[5]===Symbol.for("react.memo_cache_sentinel")?(A=E=>{C(U=>{const F=new Set(U);return F.has(E)?F.delete(E):F.add(E),F})},t[5]=A):A=t[5];const f=A;let j;t[6]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{O(!1),C(new Set)},t[6]=j):j=t[6];const p=j;let M,T,B,$,L,r,u,b;if(t[7]!==g||t[8]!==z||t[9]!==x||t[10]!==m.mode||t[11]!==m.virtualMcp||t[12]!==N||t[13]!==i||t[14]!==n||t[15]!==e.slug||t[16]!==c||t[17]!==o||t[18]!==k||t[19]!==a){let E;t[28]!==k?(E=h=>!(k!=="ALL"&&h.status!==k),t[28]=k,t[29]=E):E=t[29],B=a.filter(E);const U=Qt(B),F=a.length;let y;t[30]!==a?(y=a.filter(Ns),t[30]=a,t[31]=y):y=t[31];const _=y.length;let W;t[32]!==a?(W=a.filter(vs),t[32]=a,t[33]=W):W=t[33];let Z;t[34]!==y.length||t[35]!==W.length||t[36]!==a.length?(Z={total:F,active:_,inactive:W.length},t[34]=y.length,t[35]=W.length,t[36]=a.length,t[37]=Z):Z=t[37];const H=Z;let ee;t[38]!==g||t[39]!==m.mode||t[40]!==m.virtualMcp?(ee=async()=>{if(m.mode!=="deleting")return;const h=m.virtualMcp.id;if(D({type:"close"}),!(!h||Ne(h)))try{await g.delete.mutateAsync(h)}catch{}},t[38]=g,t[39]=m.mode,t[40]=m.virtualMcp,t[41]=ee):ee=t[41];const q=ee;let te;t[42]!==g||t[43]!==c?(te=async()=>{P(!1);let h=0;for(const v of c)if(!Ne(v))try{await g.delete.mutateAsync(v),h++}catch{}yt.success(`Deleted ${h} agent${h!==1?"s":""}`),p()},t[42]=g,t[43]=c,t[44]=te):te=t[44];const R=te;let Se;t[45]!==n||t[46]!==e.slug||t[47]!==o?(Se=h=>{if(o){f(h);return}n({to:"/$org/$project/agents/$agentId",params:{org:e.slug,project:wt,agentId:h}})},t[45]=n,t[46]=e.slug,t[47]=o,t[48]=Se):Se=t[48];const ne=Se;let ie;t[49]!==c||t[50]!==o?(ie=o?[{id:"select",header:"",render:h=>s.jsx(Ue,{checked:c.has(h.id),onCheckedChange:()=>f(h.id),onClick:bs}),cellClassName:"w-10 shrink-0"}]:[],t[49]=c,t[50]=o,t[51]=ie):ie=t[51];let ke,_e,De,ze,Ae,Me;t[52]===Symbol.for("react.memo_cache_sentinel")?(ke={id:"title",header:"Name",render:js,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_e={id:"description",header:"Description",render:gs,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},De={id:"connections",header:"Connections",render:ps,cellClassName:"w-28 shrink-0"},ze={id:"status",header:"Status",render:hs,cellClassName:"w-24 shrink-0"},Ae={id:"updated_by",header:"Updated by",render:us,cellClassName:"w-32 shrink-0",sortable:!0},Me={id:"updated_at",header:"Updated",render:fs,cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},t[52]=ke,t[53]=_e,t[54]=De,t[55]=ze,t[56]=Ae,t[57]=Me):(ke=t[52],_e=t[53],De=t[54],ze=t[55],Ae=t[56],Me=t[57]);let le;t[58]!==ne?(le={id:"actions",header:"",render:h=>s.jsxs(tt,{children:[s.jsx(st,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ms,children:s.jsx(it,{size:20})})}),s.jsxs(nt,{align:"end",onClick:ds,children:[s.jsxs(je,{onClick:v=>{v.stopPropagation(),ne(h.id)},children:[s.jsx(lt,{size:16}),"Open"]}),!Ne(h.id)&&s.jsxs(je,{variant:"destructive",onClick:v=>{v.stopPropagation(),D({type:"delete",virtualMcp:h})},children:[s.jsx(Fe,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"},t[58]=ne,t[59]=le):le=t[59];let Te;t[60]!==ie||t[61]!==le?(Te=[...ie,ke,_e,De,ze,Ae,Me,le],t[60]=ie,t[61]=le,t[62]=Te):Te=t[62];const bt=Te;let $e;t[63]!==x||t[64]!==N||t[65]!==o?($e=s.jsx("div",{className:"flex items-center gap-2",children:o?s.jsxs(Q,{variant:"ghost",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:p,children:[s.jsx(gt,{size:14}),"Cancel"]}):s.jsxs(s.Fragment,{children:[s.jsxs(Q,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:()=>O(!0),children:[s.jsx(Mt,{size:14}),"Select"]}),s.jsx(Q,{onClick:x,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:N,children:N?"Creating...":"Create Agent"})]})}),t[63]=x,t[64]=N,t[65]=o,t[66]=$e):$e=t[66];const qe=$e;T=ve;const Je=m.mode==="deleting";let Pe;t[67]===Symbol.for("react.memo_cache_sentinel")?(Pe=h=>!h&&D({type:"close"}),t[67]=Pe):Pe=t[67];let Ie;t[68]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(at,{children:"Delete Agent?"}),t[68]=Ie):Ie=t[68];const Qe=m.mode==="deleting"&&m.virtualMcp.title;let ae;t[69]!==Qe?(ae=s.jsxs(rt,{children:[Ie,s.jsxs(ot,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:Qe}),"."]})]}),t[69]=Qe,t[70]=ae):ae=t[70];let Oe;t[71]===Symbol.for("react.memo_cache_sentinel")?(Oe=s.jsx(ct,{children:"Cancel"}),t[71]=Oe):Oe=t[71];let re;t[72]!==q?(re=s.jsxs(dt,{children:[Oe,s.jsx(mt,{onClick:q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[72]=q,t[73]=re):re=t[73];let oe;t[74]!==ae||t[75]!==re?(oe=s.jsxs(ft,{children:[ae,re]}),t[74]=ae,t[75]=re,t[76]=oe):oe=t[76],t[77]!==Je||t[78]!==oe?(r=s.jsx(ut,{open:Je,onOpenChange:Pe,children:oe}),t[77]=Je,t[78]=oe,t[79]=r):r=t[79];const We=c.size!==1?"s":"";let ce;t[80]!==c.size||t[81]!==We?(ce=s.jsxs(at,{children:["Delete ",c.size," agent",We,"?"]}),t[80]=c.size,t[81]=We,t[82]=ce):ce=t[82];let Be;t[83]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsx(ot,{children:"This action cannot be undone. This will permanently delete the selected agents."}),t[83]=Be):Be=t[83];let de;t[84]!==ce?(de=s.jsxs(rt,{children:[ce,Be]}),t[84]=ce,t[85]=de):de=t[85];let Le;t[86]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(ct,{children:"Cancel"}),t[86]=Le):Le=t[86];let me;t[87]!==R?(me=s.jsxs(dt,{children:[Le,s.jsx(mt,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[87]=R,t[88]=me):me=t[88];let fe;t[89]!==de||t[90]!==me?(fe=s.jsxs(ft,{children:[de,me]}),t[89]=de,t[90]=me,t[91]=fe):fe=t[91],t[92]!==z||t[93]!==fe?(u=s.jsx(ut,{open:z,onOpenChange:P,children:fe}),t[92]=z,t[93]=fe,t[94]=u):u=t[94];const Xe=H.active>0&&` · ${H.active} active`,Ye=H.inactive>0&&` · ${H.inactive} inactive`;let ue;t[95]!==H.total||t[96]!==Xe||t[97]!==Ye?(ue=s.jsx(ve.Header.Left,{children:s.jsx(_t,{children:s.jsx(Dt,{children:s.jsx(zt,{children:s.jsxs(At,{className:"flex items-center gap-2",children:["Agents",s.jsxs("span",{className:"text-xs font-normal text-muted-foreground tabular-nums",children:[H.total," total",Xe,Ye]})]})})})})}),t[95]=H.total,t[96]=Xe,t[97]=Ye,t[98]=ue):ue=t[98];let Re;t[99]===Symbol.for("react.memo_cache_sentinel")?(Re=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],t[99]=Re):Re=t[99];let Ee,Ke;t[100]===Symbol.for("react.memo_cache_sentinel")?(Ee=h=>I(h||"ALL"),Ke=[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"}],t[100]=Ee,t[101]=Ke):(Ee=t[100],Ke=t[101]);let he;t[102]!==k?(he=[{label:"Status",value:k,onChange:Ee,options:Ke}],t[102]=k,t[103]=he):he=t[103];let pe;t[104]!==i.handleSort||t[105]!==i.setViewMode||t[106]!==i.sortDirection||t[107]!==i.sortKey||t[108]!==i.viewMode||t[109]!==he?(pe=s.jsx(St,{viewMode:i.viewMode,onViewModeChange:i.setViewMode,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:Re,filters:he}),t[104]=i.handleSort,t[105]=i.setViewMode,t[106]=i.sortDirection,t[107]=i.sortKey,t[108]=i.viewMode,t[109]=he,t[110]=pe):pe=t[110];let xe;t[111]!==qe||t[112]!==pe?(xe=s.jsxs(ve.Header.Right,{children:[pe,qe]}),t[111]=qe,t[112]=pe,t[113]=xe):xe=t[113],t[114]!==ue||t[115]!==xe?(b=s.jsxs(ve.Header,{children:[ue,xe]}),t[114]=ue,t[115]=xe,t[116]=b):b=t[116];let ge;t[117]!==i?(ge=h=>{h.key==="Escape"&&(i.setSearch(""),h.target.blur())},t[117]=i,t[118]=ge):ge=t[118],t[119]!==i.search||t[120]!==i.setSearch||t[121]!==ge?($=s.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:s.jsx("div",{className:"flex-1",children:s.jsx(kt,{value:i.search,onChange:i.setSearch,placeholder:"Search for an agent...",onKeyDown:ge})})}),t[119]=i.search,t[120]=i.setSearch,t[121]=ge,t[122]=$):$=t[122],M=ve.Content,L=i.viewMode==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:B.length===0?s.jsx(Ze,{image:s.jsx(Y,{size:36,className:"text-muted-foreground"}),title:i.search?"No agents found":"No agents yet",description:i.search?`No agents match "${i.search}"`:"Create an agent to aggregate tools from multiple Connections."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:U.map(h=>{if(h.type==="group")return s.jsx(Xt,{group:h,onNavigate:ne,onDelete:be=>D({type:"delete",virtualMcp:be}),selectionMode:o,selectedIds:c,onToggleSelect:f},h.key);const v=h.agent;return s.jsxs("div",{className:"relative",children:[o&&s.jsx("div",{className:"absolute top-3 left-3 z-10",children:s.jsx(Ue,{checked:c.has(v.id),onCheckedChange:()=>f(v.id)})}),s.jsx(xt,{connection:{id:v.id??"",title:v.title,description:v.description,icon:v.icon,status:v.status},fallbackIcon:s.jsx(Y,{}),onClick:()=>ne(v.id),className:X(o&&c.has(v.id)&&"ring-2 ring-primary"),body:s.jsx(He,{status:v.status}),footer:s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Ce,{id:v.updated_by??v.created_by,size:"3xs"})}),s.jsx("span",{className:"shrink-0 ml-2",children:v.updated_at?ye(new Date(v.updated_at)):"—"})]}),headerActions:o?void 0:s.jsxs(tt,{children:[s.jsx(st,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:cs,children:s.jsx(it,{size:20})})}),s.jsxs(nt,{align:"end",onClick:os,children:[s.jsxs(je,{onClick:be=>{be.stopPropagation(),ne(v.id)},children:[s.jsx(lt,{size:16}),"Open"]}),!Ne(v.id)&&s.jsxs(je,{variant:"destructive",onClick:be=>{be.stopPropagation(),D({type:"delete",virtualMcp:v})},children:[s.jsx(Fe,{size:16}),"Delete"]})]})]})})]},v.id)})})}):s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:s.jsx("div",{className:"min-w-[1000px]",children:s.jsx(ns,{columns:bt,grouped:U,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,onRowClick:h=>ne(h.id),selectionMode:o,selectedIds:c,onToggleSelect:f,emptyState:i.search?s.jsx(Ze,{image:s.jsx(Y,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${i.search}"`}):s.jsx(Ze,{image:s.jsx(Y,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})})})})}),t[7]=g,t[8]=z,t[9]=x,t[10]=m.mode,t[11]=m.virtualMcp,t[12]=N,t[13]=i,t[14]=n,t[15]=e.slug,t[16]=c,t[17]=o,t[18]=k,t[19]=a,t[20]=M,t[21]=T,t[22]=B,t[23]=$,t[24]=L,t[25]=r,t[26]=u,t[27]=b}else M=t[20],T=t[21],B=t[22],$=t[23],L=t[24],r=t[25],u=t[26],b=t[27];let K;t[123]!==M||t[124]!==L?(K=s.jsx(M,{children:L}),t[123]=M,t[124]=L,t[125]=K):K=t[125];let V;t[126]!==B||t[127]!==c.size||t[128]!==o?(V=o&&s.jsx(ss,{count:c.size,total:B.length,onSelectAll:()=>C(new Set(B.map(rs))),onDeselectAll:()=>C(new Set),onDelete:()=>P(!0),onCancel:p}),t[126]=B,t[127]=c.size,t[128]=o,t[129]=V):V=t[129];let G;return t[130]!==T||t[131]!==$||t[132]!==K||t[133]!==V||t[134]!==r||t[135]!==u||t[136]!==b?(G=s.jsxs(T,{children:[r,u,b,$,K,V]}),t[130]=T,t[131]=$,t[132]=K,t[133]=V,t[134]=r,t[135]=u,t[136]=b,t[137]=G):G=t[137],G}function rs(t){return t.id}function os(t){return t.stopPropagation()}function cs(t){return t.stopPropagation()}function ds(t){return t.stopPropagation()}function ms(t){return t.stopPropagation()}function fs(t){return s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ye(new Date(t.updated_at)):"—"})}function us(t){return s.jsx(Ce,{id:t.updated_by??t.created_by,size:"3xs"})}function hs(t){return s.jsx(He,{status:t.status})}function ps(t){return s.jsx(J.Suspense,{fallback:s.jsx(ht.Fallback,{}),children:s.jsx(ht,{connectionIds:t.connections.map(xs),maxVisibleIcons:2})})}function xs(t){return t.connection_id}function gs(t){return s.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"})}function js(t){return s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Ge,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:s.jsx(Y,{size:16})}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.title})]})}function bs(t){return t.stopPropagation()}function vs(t){return t.status==="inactive"}function Ns(t){return t.status==="active"}function Cn(){const t=we.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vt,{children:s.jsx(J.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Jt,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(as,{})})}),t[0]=e):e=t[0],e}export{Cn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r,W as w,r as n,ak as m,ba as O,X as M,am as I,Y as z,Z as F,a1 as A,bb as D,$ as L,b0 as k,ap as G,a2 as W,a0 as Y,c as i,z as p,bc as v}from"./index-
|
|
1
|
+
import{j as r,W as w,r as n,ak as m,ba as O,X as M,am as I,Y as z,Z as F,a1 as A,bb as D,$ as L,b0 as k,ap as G,a2 as W,a0 as Y,c as i,z as p,bc as v}from"./index-BUP2j-VZ.js";var x="AlertDialog",[H]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var V="AlertDialogTrigger",y=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(W,{...o,...a,ref:e})});y.displayName=V;var q="AlertDialogPortal",j=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t})};j.displayName=q;var B="AlertDialogOverlay",_=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(Y,{...o,...a,ref:e})});_.displayName=B;var g="AlertDialogContent",[X,Z]=H(g),J=k("AlertDialogContent"),b=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=n.useRef(null),T=m(e,c),u=n.useRef(null);return r.jsx(O,{contentName:g,titleName:h,docsSlug:"alert-dialog",children:r.jsx(X,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:T,onOpenAutoFocus:I(o.onOpenAutoFocus,f=>{f.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[r.jsx(J,{children:a}),r.jsx(Q,{contentRef:c})]})})})});b.displayName=g;var h="AlertDialogTitle",$=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});$.displayName=h;var E="AlertDialogDescription",R=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(F,{...o,...a,ref:e})});R.displayName=E;var K="AlertDialogAction",C=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=K;var S="AlertDialogCancel",P=n.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=Z(S,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});P.displayName=S;var Q=({contentRef:l})=>{const e=`\`${g}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${g}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,g as m,j as t,A as f,S as h,k as x,l as r,m as p,N as u}from"./index-
|
|
1
|
+
import{c as l,g as m,j as t,A as f,S as h,k as x,l as r,m as p,N as u}from"./index-BUP2j-VZ.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B,g as be,e as _e,u as le,r as M,j as t,F as Ce,O as Z,w as T,B as U,t as Ne,G as Se,x as we,K as Q}from"./index-BJ81Vsww.js";import{E as ce}from"./empty-state-CpzrK9g6.js";import{V as de,a as ke}from"./layout-KmDEzVfx.js";import{S as De}from"./save-actions-Br5EOuh1.js";import{u as Ae}from"./use-llm-VA4dgcLv.js";import{T as Ie,a as Me,M as Te,S as ee}from"./task-status-myNxZFI-.js";import{V as te}from"./select-virtual-mcp-B55ZVK2k.js";import{I as Ee}from"./integration-icon-DKPtAPgu.js";import{U as $e}from"./user-LylUdoHD.js";import{c as ze,b as Oe,d as Re,e as J,f as Pe}from"./use-automations-BeuGbjZ-.js";import{u as me}from"./index-BKYpmcE7.js";import{b as ue,d as pe,c as fe,A as xe,e as he,h as ge,a as ye,f as je}from"./alert-dialog-B77zp5_9.js";import{b as se,d as Ve,c as Fe,e as Le,B as Ue,a as Be}from"./breadcrumb-C11JDZLD.js";import{I as He}from"./input-95A3RU7n.js";import{c as re,a as Ke,d as Ge,e as We,f as qe,b as Qe,D as Je}from"./dropdown-menu-CNJ1rfC3.js";import{P as ne,a as oe,b as ie}from"./popover-DAiH8HrC.js";import{S as Ye}from"./switch-2e_OzSa-.js";import{u as Xe}from"./useQuery-DMs04NaY.js";import{i as Ze,u as et,a as tt}from"./constants-uVLQN0jY.js";import{b as st}from"./use-virtual-mcp-dbqVkjzK.js";import{i as rt}from"./ArrowUp-o0gFtaSp.js";import{s as H}from"./Clock-aoVUv0E3.js";import{i as nt}from"./Edit01-BKkVXIhK.js";import{i as q}from"./Loading01-BbnQsfMx.js";import{s as ot}from"./Plus-BJUL5Wvq.js";import{s as it}from"./Trash01-BEjbK4f6.js";import{t as ae}from"./Users03-DTCxnqPZ.js";import{s as Y}from"./XClose-CRDqusrl.js";import{a as ve,t as at,b as lt}from"./context-ClCBXQoI.js";import{f as ct}from"./formatDistanceToNow-Cb2QZZJn.js";import"./Save01-BNoezVOP.js";import"./skeleton-f9h0kyuC.js";import"./spinner-ClMTbKWw.js";import"./tooltip-DjLTvHpz.js";import"./index-MC5fCcRU.js";import"./use-mcp-prompts-BQwPUsA-.js";import"./dialog-CvddUtOS.js";import"./X-CEnrrbAn.js";import"./form-DmTtx5UX.js";import"./label-CKi_xgKG.js";import"./index-Cv3zhjFc.js";import"./usage-BtJ0yb4g.js";import"./ChevronDown-B6clHAxQ.js";import"./Lock01-ClyjUTBv.js";import"./XCircle-BKAmr_f6.js";import"./AlertCircle-BvnCc6-D.js";import"./select-Iosam4nc.js";import"./ChevronUp-DxXRh85A.js";import"./Check-BxC8tao2.js";import"./org-ai-providers-CoYprATW.js";import"./use-local-storage-LMzJlC-M.js";import"./useMutation-D0WkcqTd.js";import"./EyeOff-ClRv57XC.js";import"./Eye-geJ1dSoO.js";import"./Key01-Dib7ammN.js";import"./card-Bfa3ZJIC.js";import"./avatar-DUHTdDSS.js";import"./ArrowLeft-BQgzcaok.js";import"./use-copy-8HTCCusQ.js";import"./tabs-BlAwR39Z.js";import"./badge-B33icYfV.js";import"./collapsible-DDvEBvNF.js";import"./index-XiB7e0AL.js";import"./Code01-BfCMg42R.js";import"./checkbox-BuLFRc1C.js";import"./AlignLeft-Du0NczL1.js";import"./Image01-BLsRmD6t.js";import"./RefreshCcw01-Dfcp2VAx.js";import"./SearchMd-BJkDuyJ3.js";import"./Settings01-k8tDFeX4.js";import"./ai-providers-logos-W57Qm-EN.js";import"./use-mcp-resources-e1qXr7bA.js";import"./ChevronRight-BZWqxnWE.js";import"./Copy01-Wuk9LRR2.js";import"./marked.esm-BaswSlok.js";import"./markdown-DrAh7zaw.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CeIZPzvW.js";import"./types-B4Gd-u-3.js";import"./Globe02-zQio7SJP.js";import"./LayersTwo01-BmzCQYk2.js";import"./use-collections-BLzG3bJp.js";import"./useSuspenseInfiniteQuery-xBbNB0pB.js";import"./infiniteQueryObserver-DyqlIjS8.js";import"./CheckCircle-D_nIOFVe.js";import"./use-create-virtual-mcp-CCZ9ZXv4.js";import"./Container-CHE6pZ9r.js";import"./decopilot-events-Brt4gAR6.js";import"./differenceInSeconds-NQ4PDo0z.js";function K(s){const e=s.trim().split(/\s+/);return e.length!==5?!1:e.every(r=>/^[\d*/,\-]+$/.test(r))}function dt(s){if(!s)return"Unknown schedule";const e=s.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return`Every ${r[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const x=parseInt(o[1]??"1");return x%7===0?`Every ${x/7} weeks`:`Every ${x} days`}const a=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(a){const x=(a[2]??"0").padStart(2,"0"),d=(a[1]??"0").padStart(2,"0");return`Every day at ${x}:${d} UTC`}const h=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(h){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(h[3]??"0")]??"day",l=(h[2]??"0").padStart(2,"0"),v=(h[1]??"0").padStart(2,"0");return`Every ${d} at ${l}:${v} UTC`}return s}function mt(s,e){const r=Math.max(1,s);switch(e){case"minutes":return r===1?"* * * * *":`*/${r} * * * *`;case"hours":return r===1?"0 * * * *":`0 */${r} * * *`;case"days":return r===1?"0 0 * * *":`0 0 */${r} * *`;case"weeks":return r===1?"0 0 * * 1":`0 0 */${r*7} * *`}}function ut(s){const e=s.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return{count:parseInt(r[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const a=parseInt(o[1]);return a%7===0?{count:a/7,unit:"weeks"}:{count:a,unit:"days"}}return null}function pt(s,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[s]??s:s}const ft=[{label:"Minute",cron:"* * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function xt(s){const e=B.c(26),{automationId:r,open:n,onOpenChange:o,onCustomSelect:a}=s,h=J(),[x,d]=M.useState(!1),l=n??x;let v;e[0]!==o?(v=C=>{o?o(C):d(C)},e[0]=o,e[1]=v):v=e[1];const f=v;let u;e[2]!==h||e[3]!==r||e[4]!==f?(u=async C=>{try{await h.mutateAsync({automation_id:r,type:"cron",cron_expression:C}),T.success("Starter added"),f(!1)}catch(k){const I=k,D=I instanceof Error?I.message:"Failed to add starter";T.error(D)}},e[2]=h,e[3]=r,e[4]=f,e[5]=u):u=e[5];const N=u;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ke,{asChild:!0,children:t.jsxs(U,{variant:"outline",size:"sm",children:[t.jsx(ot,{size:14}),"Add Starter"]})}),e[6]=m):m=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs(Ge,{className:"gap-2.5",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),e[7]=j):j=e[7];let b;e[8]!==h||e[9]!==N?(b=ft.map(C=>t.jsxs(re,{className:"gap-2.5",onSelect:()=>N(C.cron),disabled:h.isPending,children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",C.label]},C.cron)),e[8]=h,e[9]=N,e[10]=b):b=e[10];let i;e[11]!==b?(i=t.jsxs(We,{children:[j,t.jsx(qe,{className:"w-[160px]",children:b})]}),e[11]=b,e[12]=i):i=e[12];let p;e[13]!==f||e[14]!==a?(p=()=>{f(!1),a?.()},e[13]=f,e[14]=a,e[15]=p):p=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[16]=_):_=e[16];let g;e[17]!==p?(g=t.jsxs(re,{className:"gap-2.5",onSelect:p,children:[_,"Custom (cron)"]}),e[17]=p,e[18]=g):g=e[18];let y;e[19]!==i||e[20]!==g?(y=t.jsxs(Qe,{align:"end",className:"w-[200px]",children:[i,g]}),e[19]=i,e[20]=g,e[21]=y):y=e[21];let S;return e[22]!==f||e[23]!==l||e[24]!==y?(S=t.jsxs(Je,{open:l,onOpenChange:f,children:[m,y]}),e[22]=f,e[23]=l,e[24]=y,e[25]=S):S=e[25],S}function ht(s){const e=B.c(56),{trigger:r,automationId:n}=s,o=Pe(),a=J(),[h,x]=M.useState(!1);let d;e[0]!==r.cron_expression?(d=r.cron_expression?ut(r.cron_expression):null,e[0]=r.cron_expression,e[1]=d):d=e[1];const l=d,[v,f]=M.useState(l?.count??1),[u,N]=M.useState(!1),[m,j]=M.useState(r.cron_expression??""),b=o.isPending||a.isPending,i=r.type==="cron";let p;e[2]!==n||e[3]!==o||e[4]!==r.id?(p=async()=>{try{await o.mutateAsync({trigger_id:r.id,automation_id:n}),T.success("Starter removed")}catch{T.error("Failed to remove starter")}x(!1)},e[2]=n,e[3]=o,e[4]=r.id,e[5]=p):p=e[5];const _=p;let g;e[6]!==a||e[7]!==n||e[8]!==m||e[9]!==o||e[10]!==r.cron_expression||e[11]!==r.id?(g=async()=>{const A=m.trim();if(!A||!K(A)||A===r.cron_expression){N(!1),j(r.cron_expression??"");return}try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:A}),await o.mutateAsync({trigger_id:r.id,automation_id:n}),N(!1)}catch{T.error("Failed to update starter"),j(r.cron_expression??""),N(!1)}},e[6]=a,e[7]=n,e[8]=m,e[9]=o,e[10]=r.cron_expression,e[11]=r.id,e[12]=g):g=e[12];const y=g;let S;e[13]!==a||e[14]!==n||e[15]!==l||e[16]!==o||e[17]!==r.cron_expression||e[18]!==r.id?(S=async A=>{if(!l)return;const G=Math.max(1,A),W=mt(G,l.unit);if(W!==r.cron_expression)try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:W}),await o.mutateAsync({trigger_id:r.id,automation_id:n})}catch{T.error("Failed to update starter"),f(l.count)}},e[13]=a,e[14]=n,e[15]=l,e[16]=o,e[17]=r.cron_expression,e[18]=r.id,e[19]=S):S=e[19];const C=S;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[20]=k):k=e[20];let I;e[21]!==v||e[22]!==m||e[23]!==C||e[24]!==y||e[25]!==l||e[26]!==i||e[27]!==u||e[28]!==b||e[29]!==r.cron_expression||e[30]!==r.event_type?(I=l&&i?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),t.jsx("input",{type:"number",min:1,value:v,onChange:A=>f(parseInt(A.target.value)||1),onBlur:()=>C(v),onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&f(l.count)},disabled:b,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:pt(l.unit,v)})]}):i&&u?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:m,onChange:A=>j(A.target.value),onBlur:y,onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&(N(!1),j(r.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),m&&!K(m)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):t.jsx("span",{className:"text-sm flex-1 font-mono text-xs text-muted-foreground",children:i?dt(r.cron_expression??""):`${r.event_type} event`}),e[21]=v,e[22]=m,e[23]=C,e[24]=y,e[25]=l,e[26]=i,e[27]=u,e[28]=b,e[29]=r.cron_expression,e[30]=r.event_type,e[31]=I):I=e[31];let D;e[32]!==b?(D=b&&t.jsx(q,{size:13,className:"animate-spin text-muted-foreground"}),e[32]=b,e[33]=D):D=e[33];let w;e[34]!==l||e[35]!==i||e[36]!==u||e[37]!==r.cron_expression?(w=i&&!l&&!u&&t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{j(r.cron_expression??""),N(!0)},children:t.jsx(nt,{size:13,className:"text-muted-foreground"})}),e[34]=l,e[35]=i,e[36]=u,e[37]=r.cron_expression,e[38]=w):w=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>x(!0),children:t.jsx(Y,{size:13,className:"text-muted-foreground"})}),e[39]=P):P=e[39];let z;e[40]!==D||e[41]!==w?(z=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[D,w,P]}),e[40]=D,e[41]=w,e[42]=z):z=e[42];let E;e[43]!==z||e[44]!==I?(E=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[k,I,z]}),e[43]=z,e[44]=I,e[45]=E):E=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(ue,{children:[t.jsx(fe,{children:"Remove Starter"}),t.jsx(pe,{children:"Are you sure you want to remove this starter?"})]}),e[46]=V):V=e[46];let F;e[47]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(xe,{children:"Cancel"}),e[47]=F):F=e[47];let O;e[48]!==_?(O=t.jsxs(ye,{children:[V,t.jsxs(he,{children:[F,t.jsx(ge,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[48]=_,e[49]=O):O=e[49];let $;e[50]!==h||e[51]!==O?($=t.jsx(je,{open:h,onOpenChange:x,children:O}),e[50]=h,e[51]=O,e[52]=$):$=e[52];let R;return e[53]!==E||e[54]!==$?(R=t.jsxs(t.Fragment,{children:[E,$]}),e[53]=E,e[54]=$,e[55]=R):R=e[55],R}function gt(s){const e=B.c(41),{selectedId:r,onChange:n}=s,[o,a]=M.useState(!1),h=st();let x,d;e[0]!==h||e[1]!==r?(d=h.filter(yt),x=r?d.find(m=>m.id===r):null,e[0]=h,e[1]=r,e[2]=x,e[3]=d):(x=e[2],d=e[3]);const l=x;if(l){let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ae,{size:16}),e[4]=m):m=e[4];let j;e[5]!==l.icon||e[6]!==l.title?(j=t.jsx(Ee,{icon:l.icon,name:l.title,size:"sm",fallbackIcon:m,className:"rounded-md shrink-0"}),e[5]=l.icon,e[6]=l.title,e[7]=j):j=e[7];let b;e[8]!==l.title?(b=t.jsx("span",{className:"text-sm font-medium truncate",children:l.title}),e[8]=l.title,e[9]=b):b=e[9];let i;e[10]!==j||e[11]!==b?(i=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",children:[j,b]})}),e[10]=j,e[11]=b,e[12]=i):i=e[12];let p;e[13]!==n?(p=I=>{n(I),a(!1)},e[13]=n,e[14]=p):p=e[14];let _;e[15]!==r||e[16]!==p||e[17]!==d?(_=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(te,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:p})}),e[15]=r,e[16]=p,e[17]=d,e[18]=_):_=e[18];let g;e[19]!==o||e[20]!==i||e[21]!==_?(g=t.jsxs(ie,{open:o,onOpenChange:a,children:[i,_]}),e[19]=o,e[20]=i,e[21]=_,e[22]=g):g=e[22];let y;e[23]!==n?(y=()=>n(null),e[23]=n,e[24]=y):y=e[24];let S;e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Y,{size:13}),e[25]=S):S=e[25];let C;e[26]!==y?(C=t.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 size-7 text-muted-foreground hover:text-foreground",onClick:y,title:"Remove agent",children:S}),e[26]=y,e[27]=C):C=e[27];let k;return e[28]!==C||e[29]!==g?(k=t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border bg-background hover:bg-accent/50 transition-colors",children:[g,C]}),e[28]=C,e[29]=g,e[30]=k):k=e[30],k}let v;e[31]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 shrink-0",children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-picker-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-picker-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(ae,{size:16})]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"No agent selected. All connections available."})]})}),e[31]=v):v=e[31];let f;e[32]!==n?(f=m=>{n(m),a(!1)},e[32]=n,e[33]=f):f=e[33];let u;e[34]!==r||e[35]!==f||e[36]!==d?(u=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(te,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:f})}),e[34]=r,e[35]=f,e[36]=d,e[37]=u):u=e[37];let N;return e[38]!==o||e[39]!==u?(N=t.jsxs(ie,{open:o,onOpenChange:a,children:[v,u]}),e[38]=o,e[39]=u,e[40]=N):N=e[40],N}function yt(s){return!s.id||!Ze(s.id)}function jt({automationId:s,automation:e}){const r=Re(),{createTask:n,setVirtualMcpId:o,setSelectedModel:a,setSelectedMode:h,sendMessage:x,credentialId:d,model:l}=ve(),[,v]=me(),f=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[u,N]=M.useState(f),[m,j]=M.useState(f),[b,i]=M.useState(!1),[p,_]=M.useState(!1),[g,y]=M.useState(""),S=J(),C=M.useRef(!1),k=c=>{N(c),C.current||(C.current=!0,f||j(c))},I=e.models?.credentialId||d||"",D=e.models?.thinking?.id||l?.modelId||"",w=Ne({defaultValues:{name:e.name,active:e.active,agent_id:e.agent?.id??"",credential_id:I,model_id:D}}),P=w.watch("active"),z=w.watch("agent_id"),E=w.watch("credential_id"),V=w.watch("model_id"),{models:F,isLoading:O}=Ae(E||void 0),$=F.find(c=>c.modelId===V)??null,R=async()=>{const c=w.getValues();try{const L=c.credential_id&&c.model_id?c.credential_id:"",X=c.credential_id&&c.model_id?c.model_id:"";return await r.mutateAsync({id:s,name:c.name,active:c.active,agent:{id:c.agent_id,mode:"passthrough"},models:{credentialId:L,thinking:{id:X}},messages:at(u),temperature:0}),w.reset({...c,credential_id:L,model_id:X}),j(u),T.success("Automation saved"),!0}catch{return T.error("Failed to save automation"),!1}},A=()=>{w.reset(),k(m)},G=w.formState.isDirty||JSON.stringify(u??null)!==JSON.stringify(m??null),W=async()=>{if(G&&!await R())return;if(!u){T.error("No instructions configured for this automation");return}const c=w.getValues();o(c.agent_id||null),h("passthrough"),$&&E&&a({...$,keyId:E}),v(!0),n(),setTimeout(()=>{x(u,{toolApprovalLevel:"yolo"})},0)};return t.jsxs(t.Fragment,{children:[t.jsx(de,{children:t.jsx(De,{onSave:async()=>{await R()},onUndo:A,isDirty:G,isSaving:r.isPending})}),t.jsxs("div",{className:"max-w-2xl mx-auto w-full px-6 py-6 flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(He,{...w.register("name"),placeholder:"Automation name",className:"border-0 shadow-none px-0 text-2xl md:text-2xl font-semibold h-auto focus-visible:ring-0 bg-transparent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Se,{control:w.control,name:"active",render:({field:c})=>t.jsx(Ye,{checked:c.value,onCheckedChange:c.onChange,className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:P?"Active":"Inactive"}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx($e,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),t.jsx(xt,{automationId:s,open:b,onOpenChange:i,onCustomSelect:()=>{_(!0),y("")}})]}),e.triggers.length===0&&!p?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>i(!0),children:"Add a starter"})," ","to get going."]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(c=>t.jsx(ht,{trigger:c,automationId:s},c.id))}),p&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:g,onChange:c=>y(c.target.value),onBlur:async()=>{const c=g.trim();if(!(!c||!K(c)))try{await S.mutateAsync({automation_id:s,type:"cron",cron_expression:c}),T.success("Starter added"),_(!1),y("")}catch{T.error("Failed to add starter")}},onKeyDown:async c=>{const L=g.trim();c.key==="Enter"&&L&&K(L)&&c.target.blur(),c.key==="Escape"&&(_(!1),y(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),g&&!K(g)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),S.isPending&&t.jsx(q,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{_(!1),y("")},children:t.jsx(Y,{size:13})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Agent"}),t.jsx(gt,{selectedId:z||null,onChange:c=>w.setValue("agent_id",c??"",{shouldDirty:!0})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),t.jsx(Ie,{tiptapDoc:u,setTiptapDoc:k,placeholder:"What should this automation do?",children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Me,{virtualMcpId:z||null}),t.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-2.5",children:[t.jsx(Te,{model:$,isLoading:O,credentialId:E||null,onCredentialChange:c=>{w.setValue("credential_id",c??"",{shouldDirty:!0}),w.setValue("model_id","",{shouldDirty:!0})},onModelChange:c=>w.setValue("model_id",c.modelId,{shouldDirty:!0}),placeholder:"Model"}),t.jsx(U,{type:"button",variant:"default",size:"icon",className:"size-8 rounded-full",onClick:W,title:"Test Automation",children:t.jsx(rt,{size:20})})]})]})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Run History"}),t.jsx(bt,{automationId:s,triggerIds:e.triggers.map(c=>c.id)})]})]})]})}function vt(s,e,r){const n=B.c(13);let o;n[0]!==s?(o={connectionId:tt,orgId:s},n[0]=s,n[1]=o):o=n[1];const a=et(o);let h;n[2]!==e||n[3]!==s||n[4]!==r?(h=Q.automationRuns(s,e,r),n[2]=e,n[3]=s,n[4]=r,n[5]=h):h=n[5];let x;n[6]!==a||n[7]!==r?(x=async()=>{if(!a)throw new Error("MCP client not available");const v=await a.callTool({name:"COLLECTION_THREADS_LIST",arguments:{where:{trigger_ids:r},limit:20}});return(v.structuredContent??v).items??[]},n[6]=a,n[7]=r,n[8]=x):x=n[8];const d=r.length>0;let l;return n[9]!==h||n[10]!==x||n[11]!==d?(l={queryKey:h,queryFn:x,enabled:d},n[9]=h,n[10]=x,n[11]=d,n[12]=l):l=n[12],Xe(l)}function bt(s){const e=B.c(22),{automationId:r,triggerIds:n}=s,{org:o}=le(),{switchToTask:a}=ve(),[,h]=me(),x=we(),{data:d,isLoading:l}=vt(o.id,r,n),v=n.length>0;let f;e[0]!==r||e[1]!==o.id||e[2]!==x||e[3]!==d||e[4]!==n?(f=i=>{const p=i.subject,_=d??[];_.find(y=>y.id===p)?x.setQueryData(Q.automationRuns(o.id,r,n),_.map(y=>y.id===p?{...y,status:i.data.status,updated_at:new Date().toISOString()}:y)):x.invalidateQueries({queryKey:Q.automationRuns(o.id,r,n)})},e[0]=r,e[1]=o.id,e[2]=x,e[3]=d,e[4]=n,e[5]=f):f=e[5];let u;if(e[6]!==o.id||e[7]!==v||e[8]!==f?(u={orgId:o.id,enabled:v,onTaskStatus:f},e[6]=o.id,e[7]=v,e[8]=f,e[9]=u):u=e[9],lt(u),l){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(q,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=i):i=e[10],i}if(!d||d.length===0){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ce,{image:null,className:"mt-6",title:"No run history",description:"Run history will appear here when the automation has been triggered."}),e[11]=i):i=e[11],i}let N;e[12]!==h||e[13]!==a?(N=async i=>{await a(i),h(!0)},e[12]=h,e[13]=a,e[14]=N):N=e[14];const m=N;let j;if(e[15]!==m||e[16]!==d){let i;e[18]!==m?(i=p=>{const _=ee[p.status]??ee.completed,g=_.icon;return t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-1 py-2.5 text-left hover:bg-accent/50 transition-colors cursor-pointer rounded-sm",onClick:()=>m(p.id),children:[t.jsx(g,{size:16,className:_.iconClassName}),t.jsx("span",{className:"flex-1 min-w-0 text-sm truncate",children:p.title}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ct(new Date(p.updated_at),{addSuffix:!0})})]},p.id)},e[18]=m,e[19]=i):i=e[19],j=d.map(i),e[15]=m,e[16]=d,e[17]=j}else j=e[17];let b;return e[20]!==j?(b=t.jsx("div",{className:"flex flex-col divide-y divide-border",children:j}),e[20]=j,e[21]=b):b=e[21],b}function rr(){const s=B.c(36);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{automationId:r}=be(e),n=_e(),{org:o}=le(),{data:a,isLoading:h}=ze(r),x=Oe(),[d,l]=M.useState(!1);let v;s[1]!==r||s[2]!==x||s[3]!==n||s[4]!==o?(v=async()=>{try{await x.mutateAsync(r),T.success("Automation deleted"),n({to:"/$org/$project/automations",params:{org:o.slug,project:Z}})}catch{T.error("Failed to delete automation")}l(!1)},s[1]=r,s[2]=x,s[3]=n,s[4]=o,s[5]=v):v=s[5];const f=v;if(h){let D;return s[6]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(q,{size:24,className:"animate-spin text-muted-foreground"})}),s[6]=D):D=s[6],D}if(!a){let D;return s[7]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ce,{title:"Automation not found",description:"This automation may have been deleted."}),s[7]=D):D=s[7],D}let u;s[8]!==o.slug?(u=t.jsx(se,{children:t.jsx(Ve,{asChild:!0,children:t.jsx(Ce,{to:"/$org/$project/automations",params:{org:o.slug,project:Z},children:"Automations"})})}),s[8]=o.slug,s[9]=u):u=s[9];let N;s[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Le,{}),s[10]=N):N=s[10];let m;s[11]!==a.name?(m=t.jsx(se,{children:t.jsx(Fe,{children:a.name})}),s[11]=a.name,s[12]=m):m=s[12];let j;s[13]!==u||s[14]!==m?(j=t.jsx(Ue,{children:t.jsxs(Be,{children:[u,N,m]})}),s[13]=u,s[14]=m,s[15]=j):j=s[15];const b=j;let i;s[16]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(de,{children:t.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",onClick:()=>l(!0),children:[t.jsx(it,{size:14}),"Delete"]})}),s[16]=i):i=s[16];let p;s[17]!==a||s[18]!==r?(p=t.jsx(jt,{automationId:r,automation:a},r),s[17]=a,s[18]=r,s[19]=p):p=s[19];let _;s[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(fe,{children:"Delete Automation"}),s[20]=_):_=s[20];let g;s[21]!==a.name?(g=t.jsxs(ue,{children:[_,t.jsxs(pe,{children:['Are you sure you want to delete "',a.name,'"? This action cannot be undone.']})]}),s[21]=a.name,s[22]=g):g=s[22];let y;s[23]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(xe,{children:"Cancel"}),s[23]=y):y=s[23];let S;s[24]!==f?(S=t.jsxs(he,{children:[y,t.jsx(ge,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),s[24]=f,s[25]=S):S=s[25];let C;s[26]!==S||s[27]!==g?(C=t.jsxs(ye,{children:[g,S]}),s[26]=S,s[27]=g,s[28]=C):C=s[28];let k;s[29]!==d||s[30]!==C?(k=t.jsx(je,{open:d,onOpenChange:l,children:C}),s[29]=d,s[30]=C,s[31]=k):k=s[31];let I;return s[32]!==b||s[33]!==k||s[34]!==p?(I=t.jsxs(ke,{breadcrumb:b,children:[i,p,k]}),s[32]=b,s[33]=k,s[34]=p,s[35]=I):I=s[35],I}export{rr as default};
|
|
1
|
+
import{c as B,g as be,e as _e,u as le,r as M,j as t,F as Ce,O as Z,w as T,B as U,t as Ne,G as Se,x as we,K as Q}from"./index-BUP2j-VZ.js";import{E as ce}from"./empty-state-BJQVSVey.js";import{V as de,a as ke}from"./layout-BjgZH_LK.js";import{S as De}from"./save-actions-BMwCSEwb.js";import{u as Ae}from"./use-llm-76KQxHJG.js";import{T as Ie,a as Me,M as Te,S as ee}from"./task-status-D43Cwt6l.js";import{V as te}from"./select-virtual-mcp-DbjwN01X.js";import{I as Ee}from"./integration-icon-DhNWPq_0.js";import{U as $e}from"./user-CztLlDB5.js";import{c as ze,b as Oe,d as Re,e as J,f as Pe}from"./use-automations-BZqwiEM_.js";import{u as me}from"./index-CRVyuFS0.js";import{b as ue,d as pe,c as fe,A as xe,e as he,h as ge,a as ye,f as je}from"./alert-dialog-BQU839b3.js";import{b as se,d as Ve,c as Fe,e as Le,B as Ue,a as Be}from"./breadcrumb-C0C7xCxQ.js";import{I as He}from"./input-OS0sGs_c.js";import{c as re,a as Ke,d as Ge,e as We,f as qe,b as Qe,D as Je}from"./dropdown-menu-DcNTx9lg.js";import{P as ne,a as oe,b as ie}from"./popover-DFyjfZbz.js";import{S as Ye}from"./switch-CAcWD1sq.js";import{u as Xe}from"./useQuery-CN1pzVoX.js";import{i as Ze,u as et,a as tt}from"./constants-B4i933q7.js";import{b as st}from"./use-virtual-mcp-94OtcwcB.js";import{i as rt}from"./ArrowUp-aSx0u-5l.js";import{s as H}from"./Clock-Bp-LAqbC.js";import{i as nt}from"./Edit01-BYoLi1wi.js";import{i as q}from"./Loading01-B87VIClz.js";import{s as ot}from"./Plus-CDc4R7NF.js";import{s as it}from"./Trash01-DC96NOta.js";import{t as ae}from"./Users03-cvM2Ndk1.js";import{s as Y}from"./XClose-BHPDEFB2.js";import{a as ve,t as at,b as lt}from"./context-vne_tDFm.js";import{f as ct}from"./formatDistanceToNow-Cb2QZZJn.js";import"./Save01-SGB22t4q.js";import"./skeleton-DnYWqER_.js";import"./spinner-CABex48W.js";import"./tooltip-CYJcicRO.js";import"./index-BPNTL7B5.js";import"./use-mcp-prompts-Dejjnovy.js";import"./dialog-CflsNx8x.js";import"./X-C5okAsgi.js";import"./form-t-VTqwHW.js";import"./label-Cj5QTzyK.js";import"./index-C1_svsm9.js";import"./usage-BtJ0yb4g.js";import"./ChevronDown-D9wVK5bH.js";import"./Lock01-BdaMZYNr.js";import"./XCircle-CFDOKqbE.js";import"./AlertCircle-DBHSxle0.js";import"./select-D2hoe72R.js";import"./ChevronUp-pA-2UtBp.js";import"./Check-B8ndkg7T.js";import"./org-ai-providers-BRKDGo95.js";import"./use-local-storage-Do7hPFcT.js";import"./useMutation-7d0bWCn1.js";import"./EyeOff-CY8Gwzvd.js";import"./Eye-MtNtMWW5.js";import"./Key01-4NZitUKS.js";import"./card-3wGXs2xF.js";import"./avatar-BzF6Jb9Z.js";import"./ArrowLeft-Cke1NjsZ.js";import"./use-copy-CiJz8oao.js";import"./tabs-D57oGoRB.js";import"./badge-DSBNODR5.js";import"./collapsible-Df2r9Beq.js";import"./index-D-cm4gF6.js";import"./Code01-ChPYGYfB.js";import"./checkbox-B3Rpe7-l.js";import"./AlignLeft-BZi0b3qg.js";import"./Image01-T3g4Xdvf.js";import"./RefreshCcw01-CiW1ymIS.js";import"./SearchMd-DEv7e_hZ.js";import"./Settings01-ovVBguWq.js";import"./ai-providers-logos-W57Qm-EN.js";import"./use-mcp-resources-C2GVZGS8.js";import"./ChevronRight-BWpUvEdI.js";import"./Copy01-CgG_OJP6.js";import"./marked.esm-BaswSlok.js";import"./markdown-BEHkpiAe.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CqfIV03X.js";import"./types-BvJtOINP.js";import"./Globe02-D4GwpBVP.js";import"./LayersTwo01-670JTIpk.js";import"./use-collections-DMxCeq8b.js";import"./useSuspenseInfiniteQuery-BD0TGQFj.js";import"./infiniteQueryObserver-ueKf4rCa.js";import"./CheckCircle-DAXfTEK-.js";import"./use-create-virtual-mcp-B8asQT4w.js";import"./Container-CLsUjxhY.js";import"./decopilot-events-Brt4gAR6.js";import"./differenceInSeconds-NQ4PDo0z.js";function K(s){const e=s.trim().split(/\s+/);return e.length!==5?!1:e.every(r=>/^[\d*/,\-]+$/.test(r))}function dt(s){if(!s)return"Unknown schedule";const e=s.trim();if(e==="* * * * *")return"Every minute";if(e==="0 * * * *")return"Every hour";if(e==="0 0 * * *")return"Every day";if(e==="0 0 * * 1")return"Every week";const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return`Every ${r[1]} minutes`;const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return`Every ${n[1]} hours`;const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const x=parseInt(o[1]??"1");return x%7===0?`Every ${x/7} weeks`:`Every ${x} days`}const a=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+\*$/);if(a){const x=(a[2]??"0").padStart(2,"0"),d=(a[1]??"0").padStart(2,"0");return`Every day at ${x}:${d} UTC`}const h=e.match(/^(\d+)\s+(\d+)\s+\*\s+\*\s+(\d)$/);if(h){const d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][parseInt(h[3]??"0")]??"day",l=(h[2]??"0").padStart(2,"0"),v=(h[1]??"0").padStart(2,"0");return`Every ${d} at ${l}:${v} UTC`}return s}function mt(s,e){const r=Math.max(1,s);switch(e){case"minutes":return r===1?"* * * * *":`*/${r} * * * *`;case"hours":return r===1?"0 * * * *":`0 */${r} * * *`;case"days":return r===1?"0 0 * * *":`0 0 */${r} * *`;case"weeks":return r===1?"0 0 * * 1":`0 0 */${r*7} * *`}}function ut(s){const e=s.trim();if(e==="* * * * *")return{count:1,unit:"minutes"};if(e==="0 * * * *")return{count:1,unit:"hours"};if(e==="0 0 * * *")return{count:1,unit:"days"};if(e==="0 0 * * 1")return{count:1,unit:"weeks"};const r=e.match(/^\*\/(\d+)\s+\*\s+\*\s+\*\s+\*$/);if(r)return{count:parseInt(r[1]),unit:"minutes"};const n=e.match(/^0\s+\*\/(\d+)\s+\*\s+\*\s+\*$/);if(n)return{count:parseInt(n[1]),unit:"hours"};const o=e.match(/^0\s+0\s+\*\/(\d+)\s+\*\s+\*$/);if(o){const a=parseInt(o[1]);return a%7===0?{count:a/7,unit:"weeks"}:{count:a,unit:"days"}}return null}function pt(s,e){return e===1?{minutes:"minute",hours:"hour",days:"day",weeks:"week"}[s]??s:s}const ft=[{label:"Minute",cron:"* * * * *"},{label:"Hour",cron:"0 * * * *"},{label:"Day",cron:"0 0 * * *"},{label:"Week",cron:"0 0 * * 1"}];function xt(s){const e=B.c(26),{automationId:r,open:n,onOpenChange:o,onCustomSelect:a}=s,h=J(),[x,d]=M.useState(!1),l=n??x;let v;e[0]!==o?(v=C=>{o?o(C):d(C)},e[0]=o,e[1]=v):v=e[1];const f=v;let u;e[2]!==h||e[3]!==r||e[4]!==f?(u=async C=>{try{await h.mutateAsync({automation_id:r,type:"cron",cron_expression:C}),T.success("Starter added"),f(!1)}catch(k){const I=k,D=I instanceof Error?I.message:"Failed to add starter";T.error(D)}},e[2]=h,e[3]=r,e[4]=f,e[5]=u):u=e[5];const N=u;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ke,{asChild:!0,children:t.jsxs(U,{variant:"outline",size:"sm",children:[t.jsx(ot,{size:14}),"Add Starter"]})}),e[6]=m):m=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs(Ge,{className:"gap-2.5",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every..."]}),e[7]=j):j=e[7];let b;e[8]!==h||e[9]!==N?(b=ft.map(C=>t.jsxs(re,{className:"gap-2.5",onSelect:()=>N(C.cron),disabled:h.isPending,children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),"Every ",C.label]},C.cron)),e[8]=h,e[9]=N,e[10]=b):b=e[10];let i;e[11]!==b?(i=t.jsxs(We,{children:[j,t.jsx(qe,{className:"w-[160px]",children:b})]}),e[11]=b,e[12]=i):i=e[12];let p;e[13]!==f||e[14]!==a?(p=()=>{f(!1),a?.()},e[13]=f,e[14]=a,e[15]=p):p=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[16]=_):_=e[16];let g;e[17]!==p?(g=t.jsxs(re,{className:"gap-2.5",onSelect:p,children:[_,"Custom (cron)"]}),e[17]=p,e[18]=g):g=e[18];let y;e[19]!==i||e[20]!==g?(y=t.jsxs(Qe,{align:"end",className:"w-[200px]",children:[i,g]}),e[19]=i,e[20]=g,e[21]=y):y=e[21];let S;return e[22]!==f||e[23]!==l||e[24]!==y?(S=t.jsxs(Je,{open:l,onOpenChange:f,children:[m,y]}),e[22]=f,e[23]=l,e[24]=y,e[25]=S):S=e[25],S}function ht(s){const e=B.c(56),{trigger:r,automationId:n}=s,o=Pe(),a=J(),[h,x]=M.useState(!1);let d;e[0]!==r.cron_expression?(d=r.cron_expression?ut(r.cron_expression):null,e[0]=r.cron_expression,e[1]=d):d=e[1];const l=d,[v,f]=M.useState(l?.count??1),[u,N]=M.useState(!1),[m,j]=M.useState(r.cron_expression??""),b=o.isPending||a.isPending,i=r.type==="cron";let p;e[2]!==n||e[3]!==o||e[4]!==r.id?(p=async()=>{try{await o.mutateAsync({trigger_id:r.id,automation_id:n}),T.success("Starter removed")}catch{T.error("Failed to remove starter")}x(!1)},e[2]=n,e[3]=o,e[4]=r.id,e[5]=p):p=e[5];const _=p;let g;e[6]!==a||e[7]!==n||e[8]!==m||e[9]!==o||e[10]!==r.cron_expression||e[11]!==r.id?(g=async()=>{const A=m.trim();if(!A||!K(A)||A===r.cron_expression){N(!1),j(r.cron_expression??"");return}try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:A}),await o.mutateAsync({trigger_id:r.id,automation_id:n}),N(!1)}catch{T.error("Failed to update starter"),j(r.cron_expression??""),N(!1)}},e[6]=a,e[7]=n,e[8]=m,e[9]=o,e[10]=r.cron_expression,e[11]=r.id,e[12]=g):g=e[12];const y=g;let S;e[13]!==a||e[14]!==n||e[15]!==l||e[16]!==o||e[17]!==r.cron_expression||e[18]!==r.id?(S=async A=>{if(!l)return;const G=Math.max(1,A),W=mt(G,l.unit);if(W!==r.cron_expression)try{await a.mutateAsync({automation_id:n,type:"cron",cron_expression:W}),await o.mutateAsync({trigger_id:r.id,automation_id:n})}catch{T.error("Failed to update starter"),f(l.count)}},e[13]=a,e[14]=n,e[15]=l,e[16]=o,e[17]=r.cron_expression,e[18]=r.id,e[19]=S):S=e[19];const C=S;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),e[20]=k):k=e[20];let I;e[21]!==v||e[22]!==m||e[23]!==C||e[24]!==y||e[25]!==l||e[26]!==i||e[27]!==u||e[28]!==b||e[29]!==r.cron_expression||e[30]!==r.event_type?(I=l&&i?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:"Every"}),t.jsx("input",{type:"number",min:1,value:v,onChange:A=>f(parseInt(A.target.value)||1),onBlur:()=>C(v),onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&f(l.count)},disabled:b,className:"w-12 text-center text-sm h-7 border border-border rounded-md bg-background px-1 focus:outline-none focus:ring-1 focus:ring-ring"}),t.jsx("span",{className:"text-sm",children:pt(l.unit,v)})]}):i&&u?t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:m,onChange:A=>j(A.target.value),onBlur:y,onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&(N(!1),j(r.cron_expression??""))},className:"flex-1 text-sm font-mono bg-transparent outline-none",autoFocus:!0}),m&&!K(m)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"})]}):t.jsx("span",{className:"text-sm flex-1 font-mono text-xs text-muted-foreground",children:i?dt(r.cron_expression??""):`${r.event_type} event`}),e[21]=v,e[22]=m,e[23]=C,e[24]=y,e[25]=l,e[26]=i,e[27]=u,e[28]=b,e[29]=r.cron_expression,e[30]=r.event_type,e[31]=I):I=e[31];let D;e[32]!==b?(D=b&&t.jsx(q,{size:13,className:"animate-spin text-muted-foreground"}),e[32]=b,e[33]=D):D=e[33];let w;e[34]!==l||e[35]!==i||e[36]!==u||e[37]!==r.cron_expression?(w=i&&!l&&!u&&t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{j(r.cron_expression??""),N(!0)},children:t.jsx(nt,{size:13,className:"text-muted-foreground"})}),e[34]=l,e[35]=i,e[36]=u,e[37]=r.cron_expression,e[38]=w):w=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>x(!0),children:t.jsx(Y,{size:13,className:"text-muted-foreground"})}),e[39]=P):P=e[39];let z;e[40]!==D||e[41]!==w?(z=t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[D,w,P]}),e[40]=D,e[41]=w,e[42]=z):z=e[42];let E;e[43]!==z||e[44]!==I?(E=t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[k,I,z]}),e[43]=z,e[44]=I,e[45]=E):E=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(ue,{children:[t.jsx(fe,{children:"Remove Starter"}),t.jsx(pe,{children:"Are you sure you want to remove this starter?"})]}),e[46]=V):V=e[46];let F;e[47]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(xe,{children:"Cancel"}),e[47]=F):F=e[47];let O;e[48]!==_?(O=t.jsxs(ye,{children:[V,t.jsxs(he,{children:[F,t.jsx(ge,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),e[48]=_,e[49]=O):O=e[49];let $;e[50]!==h||e[51]!==O?($=t.jsx(je,{open:h,onOpenChange:x,children:O}),e[50]=h,e[51]=O,e[52]=$):$=e[52];let R;return e[53]!==E||e[54]!==$?(R=t.jsxs(t.Fragment,{children:[E,$]}),e[53]=E,e[54]=$,e[55]=R):R=e[55],R}function gt(s){const e=B.c(41),{selectedId:r,onChange:n}=s,[o,a]=M.useState(!1),h=st();let x,d;e[0]!==h||e[1]!==r?(d=h.filter(yt),x=r?d.find(m=>m.id===r):null,e[0]=h,e[1]=r,e[2]=x,e[3]=d):(x=e[2],d=e[3]);const l=x;if(l){let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ae,{size:16}),e[4]=m):m=e[4];let j;e[5]!==l.icon||e[6]!==l.title?(j=t.jsx(Ee,{icon:l.icon,name:l.title,size:"sm",fallbackIcon:m,className:"rounded-md shrink-0"}),e[5]=l.icon,e[6]=l.title,e[7]=j):j=e[7];let b;e[8]!==l.title?(b=t.jsx("span",{className:"text-sm font-medium truncate",children:l.title}),e[8]=l.title,e[9]=b):b=e[9];let i;e[10]!==j||e[11]!==b?(i=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 flex-1 min-w-0 text-left cursor-pointer",children:[j,b]})}),e[10]=j,e[11]=b,e[12]=i):i=e[12];let p;e[13]!==n?(p=I=>{n(I),a(!1)},e[13]=n,e[14]=p):p=e[14];let _;e[15]!==r||e[16]!==p||e[17]!==d?(_=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(te,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:p})}),e[15]=r,e[16]=p,e[17]=d,e[18]=_):_=e[18];let g;e[19]!==o||e[20]!==i||e[21]!==_?(g=t.jsxs(ie,{open:o,onOpenChange:a,children:[i,_]}),e[19]=o,e[20]=i,e[21]=_,e[22]=g):g=e[22];let y;e[23]!==n?(y=()=>n(null),e[23]=n,e[24]=y):y=e[24];let S;e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Y,{size:13}),e[25]=S):S=e[25];let C;e[26]!==y?(C=t.jsx(U,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 size-7 text-muted-foreground hover:text-foreground",onClick:y,title:"Remove agent",children:S}),e[26]=y,e[27]=C):C=e[27];let k;return e[28]!==C||e[29]!==g?(k=t.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border bg-background hover:bg-accent/50 transition-colors",children:[g,C]}),e[28]=C,e[29]=g,e[30]=k):k=e[30],k}let v;e[31]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(ne,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsxs("div",{className:"relative flex items-center justify-center size-8 rounded-md text-muted-foreground/75 shrink-0",children:[t.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[t.jsx("defs",{children:t.jsxs("linearGradient",{id:"agent-picker-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[t.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),t.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),t.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),t.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"5.5",stroke:"url(#agent-picker-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),t.jsx(ae,{size:16})]}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"No agent selected. All connections available."})]})}),e[31]=v):v=e[31];let f;e[32]!==n?(f=m=>{n(m),a(!1)},e[32]=n,e[33]=f):f=e[33];let u;e[34]!==r||e[35]!==f||e[36]!==d?(u=t.jsx(oe,{className:"w-[550px] p-0 overflow-hidden",align:"start",sideOffset:8,children:t.jsx(te,{virtualMcps:d,selectedVirtualMcpId:r,onVirtualMcpChange:f})}),e[34]=r,e[35]=f,e[36]=d,e[37]=u):u=e[37];let N;return e[38]!==o||e[39]!==u?(N=t.jsxs(ie,{open:o,onOpenChange:a,children:[v,u]}),e[38]=o,e[39]=u,e[40]=N):N=e[40],N}function yt(s){return!s.id||!Ze(s.id)}function jt({automationId:s,automation:e}){const r=Re(),{createTask:n,setVirtualMcpId:o,setSelectedModel:a,setSelectedMode:h,sendMessage:x,credentialId:d,model:l}=ve(),[,v]=me(),f=e.messages?.[0]?.metadata?.tiptapDoc??void 0,[u,N]=M.useState(f),[m,j]=M.useState(f),[b,i]=M.useState(!1),[p,_]=M.useState(!1),[g,y]=M.useState(""),S=J(),C=M.useRef(!1),k=c=>{N(c),C.current||(C.current=!0,f||j(c))},I=e.models?.credentialId||d||"",D=e.models?.thinking?.id||l?.modelId||"",w=Ne({defaultValues:{name:e.name,active:e.active,agent_id:e.agent?.id??"",credential_id:I,model_id:D}}),P=w.watch("active"),z=w.watch("agent_id"),E=w.watch("credential_id"),V=w.watch("model_id"),{models:F,isLoading:O}=Ae(E||void 0),$=F.find(c=>c.modelId===V)??null,R=async()=>{const c=w.getValues();try{const L=c.credential_id&&c.model_id?c.credential_id:"",X=c.credential_id&&c.model_id?c.model_id:"";return await r.mutateAsync({id:s,name:c.name,active:c.active,agent:{id:c.agent_id,mode:"passthrough"},models:{credentialId:L,thinking:{id:X}},messages:at(u),temperature:0}),w.reset({...c,credential_id:L,model_id:X}),j(u),T.success("Automation saved"),!0}catch{return T.error("Failed to save automation"),!1}},A=()=>{w.reset(),k(m)},G=w.formState.isDirty||JSON.stringify(u??null)!==JSON.stringify(m??null),W=async()=>{if(G&&!await R())return;if(!u){T.error("No instructions configured for this automation");return}const c=w.getValues();o(c.agent_id||null),h("passthrough"),$&&E&&a({...$,keyId:E}),v(!0),n(),setTimeout(()=>{x(u,{toolApprovalLevel:"yolo"})},0)};return t.jsxs(t.Fragment,{children:[t.jsx(de,{children:t.jsx(De,{onSave:async()=>{await R()},onUndo:A,isDirty:G,isSaving:r.isPending})}),t.jsxs("div",{className:"max-w-2xl mx-auto w-full px-6 py-6 flex flex-col gap-8",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(He,{...w.register("name"),placeholder:"Automation name",className:"border-0 shadow-none px-0 text-2xl md:text-2xl font-semibold h-auto focus-visible:ring-0 bg-transparent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Se,{control:w.control,name:"active",render:({field:c})=>t.jsx(Ye,{checked:c.value,onCheckedChange:c.onChange,className:"cursor-pointer"})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:P?"Active":"Inactive"}),t.jsx("span",{className:"text-muted-foreground/50 text-sm",children:"·"}),t.jsx($e,{id:e.created_by,size:"2xs",className:"text-sm text-muted-foreground"})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Starter"}),t.jsx(xt,{automationId:s,open:b,onOpenChange:i,onCustomSelect:()=>{_(!0),y("")}})]}),e.triggers.length===0&&!p?t.jsx("div",{className:"rounded-lg border border-dashed border-border px-4 py-6 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["When should this automation run?"," ",t.jsx("button",{type:"button",className:"text-foreground underline underline-offset-2 cursor-pointer hover:text-foreground/80 transition-colors",onClick:()=>i(!0),children:"Add a starter"})," ","to get going."]})}):t.jsx("div",{className:"flex flex-col gap-2",children:e.triggers.map(c=>t.jsx(ht,{trigger:c,automationId:s},c.id))}),p&&t.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border bg-background group",children:[t.jsx(H,{size:14,className:"text-muted-foreground shrink-0"}),t.jsx("input",{type:"text",value:g,onChange:c=>y(c.target.value),onBlur:async()=>{const c=g.trim();if(!(!c||!K(c)))try{await S.mutateAsync({automation_id:s,type:"cron",cron_expression:c}),T.success("Starter added"),_(!1),y("")}catch{T.error("Failed to add starter")}},onKeyDown:async c=>{const L=g.trim();c.key==="Enter"&&L&&K(L)&&c.target.blur(),c.key==="Escape"&&(_(!1),y(""))},placeholder:"0 9 * * 1-5",className:"flex-1 text-sm font-mono bg-transparent outline-none placeholder:text-muted-foreground/40",autoFocus:!0}),g&&!K(g)&&t.jsx("span",{className:"text-xs text-muted-foreground/60 shrink-0",children:"invalid"}),S.isPending&&t.jsx(q,{size:13,className:"animate-spin text-muted-foreground shrink-0"}),t.jsx("button",{type:"button",className:"shrink-0 p-0.5 rounded text-muted-foreground opacity-0 group-hover:opacity-100 hover:text-foreground transition-opacity",onClick:()=>{_(!1),y("")},children:t.jsx(Y,{size:13})})]})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Agent"}),t.jsx(gt,{selectedId:z||null,onChange:c=>w.setValue("agent_id",c??"",{shouldDirty:!0})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Instructions"}),t.jsx(Ie,{tiptapDoc:u,setTiptapDoc:k,placeholder:"What should this automation do?",children:t.jsxs("div",{className:"rounded-xl border border-border min-h-[120px] flex flex-col",children:[t.jsx(Me,{virtualMcpId:z||null}),t.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-2.5",children:[t.jsx(Te,{model:$,isLoading:O,credentialId:E||null,onCredentialChange:c=>{w.setValue("credential_id",c??"",{shouldDirty:!0}),w.setValue("model_id","",{shouldDirty:!0})},onModelChange:c=>w.setValue("model_id",c.modelId,{shouldDirty:!0}),placeholder:"Model"}),t.jsx(U,{type:"button",variant:"default",size:"icon",className:"size-8 rounded-full",onClick:W,title:"Test Automation",children:t.jsx(rt,{size:20})})]})]})})]}),t.jsxs("div",{className:"flex flex-col gap-2.5",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground/60",children:"Run History"}),t.jsx(bt,{automationId:s,triggerIds:e.triggers.map(c=>c.id)})]})]})]})}function vt(s,e,r){const n=B.c(13);let o;n[0]!==s?(o={connectionId:tt,orgId:s},n[0]=s,n[1]=o):o=n[1];const a=et(o);let h;n[2]!==e||n[3]!==s||n[4]!==r?(h=Q.automationRuns(s,e,r),n[2]=e,n[3]=s,n[4]=r,n[5]=h):h=n[5];let x;n[6]!==a||n[7]!==r?(x=async()=>{if(!a)throw new Error("MCP client not available");const v=await a.callTool({name:"COLLECTION_THREADS_LIST",arguments:{where:{trigger_ids:r},limit:20}});return(v.structuredContent??v).items??[]},n[6]=a,n[7]=r,n[8]=x):x=n[8];const d=r.length>0;let l;return n[9]!==h||n[10]!==x||n[11]!==d?(l={queryKey:h,queryFn:x,enabled:d},n[9]=h,n[10]=x,n[11]=d,n[12]=l):l=n[12],Xe(l)}function bt(s){const e=B.c(22),{automationId:r,triggerIds:n}=s,{org:o}=le(),{switchToTask:a}=ve(),[,h]=me(),x=we(),{data:d,isLoading:l}=vt(o.id,r,n),v=n.length>0;let f;e[0]!==r||e[1]!==o.id||e[2]!==x||e[3]!==d||e[4]!==n?(f=i=>{const p=i.subject,_=d??[];_.find(y=>y.id===p)?x.setQueryData(Q.automationRuns(o.id,r,n),_.map(y=>y.id===p?{...y,status:i.data.status,updated_at:new Date().toISOString()}:y)):x.invalidateQueries({queryKey:Q.automationRuns(o.id,r,n)})},e[0]=r,e[1]=o.id,e[2]=x,e[3]=d,e[4]=n,e[5]=f):f=e[5];let u;if(e[6]!==o.id||e[7]!==v||e[8]!==f?(u={orgId:o.id,enabled:v,onTaskStatus:f},e[6]=o.id,e[7]=v,e[8]=f,e[9]=u):u=e[9],lt(u),l){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(q,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=i):i=e[10],i}if(!d||d.length===0){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ce,{image:null,className:"mt-6",title:"No run history",description:"Run history will appear here when the automation has been triggered."}),e[11]=i):i=e[11],i}let N;e[12]!==h||e[13]!==a?(N=async i=>{await a(i),h(!0)},e[12]=h,e[13]=a,e[14]=N):N=e[14];const m=N;let j;if(e[15]!==m||e[16]!==d){let i;e[18]!==m?(i=p=>{const _=ee[p.status]??ee.completed,g=_.icon;return t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-1 py-2.5 text-left hover:bg-accent/50 transition-colors cursor-pointer rounded-sm",onClick:()=>m(p.id),children:[t.jsx(g,{size:16,className:_.iconClassName}),t.jsx("span",{className:"flex-1 min-w-0 text-sm truncate",children:p.title}),t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ct(new Date(p.updated_at),{addSuffix:!0})})]},p.id)},e[18]=m,e[19]=i):i=e[19],j=d.map(i),e[15]=m,e[16]=d,e[17]=j}else j=e[17];let b;return e[20]!==j?(b=t.jsx("div",{className:"flex flex-col divide-y divide-border",children:j}),e[20]=j,e[21]=b):b=e[21],b}function rr(){const s=B.c(36);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{automationId:r}=be(e),n=_e(),{org:o}=le(),{data:a,isLoading:h}=ze(r),x=Oe(),[d,l]=M.useState(!1);let v;s[1]!==r||s[2]!==x||s[3]!==n||s[4]!==o?(v=async()=>{try{await x.mutateAsync(r),T.success("Automation deleted"),n({to:"/$org/$project/automations",params:{org:o.slug,project:Z}})}catch{T.error("Failed to delete automation")}l(!1)},s[1]=r,s[2]=x,s[3]=n,s[4]=o,s[5]=v):v=s[5];const f=v;if(h){let D;return s[6]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(q,{size:24,className:"animate-spin text-muted-foreground"})}),s[6]=D):D=s[6],D}if(!a){let D;return s[7]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ce,{title:"Automation not found",description:"This automation may have been deleted."}),s[7]=D):D=s[7],D}let u;s[8]!==o.slug?(u=t.jsx(se,{children:t.jsx(Ve,{asChild:!0,children:t.jsx(Ce,{to:"/$org/$project/automations",params:{org:o.slug,project:Z},children:"Automations"})})}),s[8]=o.slug,s[9]=u):u=s[9];let N;s[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Le,{}),s[10]=N):N=s[10];let m;s[11]!==a.name?(m=t.jsx(se,{children:t.jsx(Fe,{children:a.name})}),s[11]=a.name,s[12]=m):m=s[12];let j;s[13]!==u||s[14]!==m?(j=t.jsx(Ue,{children:t.jsxs(Be,{children:[u,N,m]})}),s[13]=u,s[14]=m,s[15]=j):j=s[15];const b=j;let i;s[16]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(de,{children:t.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-destructive hover:text-destructive",onClick:()=>l(!0),children:[t.jsx(it,{size:14}),"Delete"]})}),s[16]=i):i=s[16];let p;s[17]!==a||s[18]!==r?(p=t.jsx(jt,{automationId:r,automation:a},r),s[17]=a,s[18]=r,s[19]=p):p=s[19];let _;s[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(fe,{children:"Delete Automation"}),s[20]=_):_=s[20];let g;s[21]!==a.name?(g=t.jsxs(ue,{children:[_,t.jsxs(pe,{children:['Are you sure you want to delete "',a.name,'"? This action cannot be undone.']})]}),s[21]=a.name,s[22]=g):g=s[22];let y;s[23]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(xe,{children:"Cancel"}),s[23]=y):y=s[23];let S;s[24]!==f?(S=t.jsxs(he,{children:[y,t.jsx(ge,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),s[24]=f,s[25]=S):S=s[25];let C;s[26]!==S||s[27]!==g?(C=t.jsxs(ye,{children:[g,S]}),s[26]=S,s[27]=g,s[28]=C):C=s[28];let k;s[29]!==d||s[30]!==C?(k=t.jsx(je,{open:d,onOpenChange:l,children:C}),s[29]=d,s[30]=C,s[31]=k):k=s[31];let I;return s[32]!==b||s[33]!==k||s[34]!==p?(I=t.jsxs(ke,{breadcrumb:b,children:[i,p,k]}),s[32]=b,s[33]=k,s[34]=p,s[35]=I):I=s[35],I}export{rr as default};
|