decocms 4.255.2 → 4.255.4
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-BckADFTN.js → AlertCircle-rzbi7fmi.js} +1 -1
- package/dist/client/assets/{AreaChart-D3FkaC6Z.js → AreaChart-CuKqt6_P.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CA4nZ19l.js → ArrowLeft-D-nEST6C.js} +1 -1
- package/dist/client/assets/{ArrowUp-8tGgkrEO.js → ArrowUp-BfWB8MD1.js} +1 -1
- package/dist/client/assets/{Check-D4XLgaN4.js → Check-DPWJue1l.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dh96WJYX.js → CheckCircle-CzbHy_NQ.js} +1 -1
- package/dist/client/assets/{ChevronDown-Dm6QJQj5.js → ChevronDown-Bchtg7Ey.js} +1 -1
- package/dist/client/assets/{ChevronRight-Bbyr31or.js → ChevronRight-ywp7R8fi.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BUgf0an-.js → ChevronSelectorVertical-fzOl_PXo.js} +1 -1
- package/dist/client/assets/{ChevronUp-C7jPKNLf.js → ChevronUp-CJaWrIn8.js} +1 -1
- package/dist/client/assets/{Copy01-BqCuDnjV.js → Copy01-C1V4JSjm.js} +1 -1
- package/dist/client/assets/{CreditCard01-CALthygT.js → CreditCard01-BgWLt525.js} +1 -1
- package/dist/client/assets/{DotsVertical-CYMbIa1_.js → DotsVertical-CtCazyXg.js} +1 -1
- package/dist/client/assets/{Download01-C6mH6Z8f.js → Download01-B8eccotb.js} +1 -1
- package/dist/client/assets/{Eye-jMpQ7fBE.js → Eye-CVdFbQPq.js} +1 -1
- package/dist/client/assets/{FilterLines-4Qetm1ho.js → FilterLines-CHSA0Ovv.js} +1 -1
- package/dist/client/assets/{Globe01-CkxIxFjV.js → Globe01-C4uOnzpB.js} +1 -1
- package/dist/client/assets/{Globe04-CWbZ_xf0.js → Globe04-4ZySY2dL.js} +1 -1
- package/dist/client/assets/{HardDrive-DqrbzOlI.js → HardDrive-BpDqLmKr.js} +1 -1
- package/dist/client/assets/{Key01-CzBg_w_E.js → Key01-CIlMRmOa.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BYv4_-zq.js → LinkExternal01-BnF74p76.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-BssaZtDy.js → LockUnlocked01-CFo18Geo.js} +1 -1
- package/dist/client/assets/{LogOut01-CE6p7Q73.js → LogOut01-mY61xNf_.js} +1 -1
- package/dist/client/assets/{Monitor01-DUnpXEZF.js → Monitor01-DRcJh9rJ.js} +1 -1
- package/dist/client/assets/{Palette-zSvxc111.js → Palette-Dyv90Vji.js} +1 -1
- package/dist/client/assets/{Play-C9tlPC3I.js → Play-DHTGlq1Y.js} +1 -1
- package/dist/client/assets/{Plus-BBdbmkEC.js → Plus-BBG-uYzF.js} +1 -1
- package/dist/client/assets/{SearchLg-Bg0bWoci.js → SearchLg-3Irji4Em.js} +1 -1
- package/dist/client/assets/{SearchMd-B5LTpCxn.js → SearchMd-BiEg7og4.js} +1 -1
- package/dist/client/assets/{Settings02-DQ6Qx_Qo.js → Settings02-DdRb7E0Q.js} +1 -1
- package/dist/client/assets/{Share07-Di11XO-1.js → Share07-Cx9rW-3h.js} +1 -1
- package/dist/client/assets/{Shield01-FnU_LRxr.js → Shield01-Dj1i5rRJ.js} +1 -1
- package/dist/client/assets/{Stars01-C8fjQPly.js → Stars01-DsEuNQa4.js} +1 -1
- package/dist/client/assets/{Stars02-BC82QMl0.js → Stars02-CQidlt1A.js} +1 -1
- package/dist/client/assets/{Sun-CL5Lwimd.js → Sun-CedAoEhV.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DJAL0oew.js → SwitchHorizontal01-BBS3aq1G.js} +1 -1
- package/dist/client/assets/{Tool01-kIIhzZhw.js → Tool01-DYiLYfEf.js} +1 -1
- package/dist/client/assets/{Tool02-xsTmH7TW.js → Tool02-53gDBxa-.js} +1 -1
- package/dist/client/assets/{Trash01-CISu7ukT.js → Trash01-hrM9uQgS.js} +1 -1
- package/dist/client/assets/{TrendUp01-D54j7eRb.js → TrendUp01-CHalSWAC.js} +1 -1
- package/dist/client/assets/{Upload01-BBFWsedg.js → Upload01-DgdhEYC-.js} +1 -1
- package/dist/client/assets/{User01-Da-P04pG.js → User01-9rQwsqCE.js} +1 -1
- package/dist/client/assets/{UserSquare-DgUtDej9.js → UserSquare-BK8-agqd.js} +1 -1
- package/dist/client/assets/{Users01-CXfWV5oU.js → Users01-CBrs1-WF.js} +1 -1
- package/dist/client/assets/{Users03-BH_DGEIm.js → Users03-Ckv8dpNK.js} +1 -1
- package/dist/client/assets/{XCircle-qOGRhnhp.js → XCircle-VjO5lI8H.js} +1 -1
- package/dist/client/assets/{XClose-DL2O4uTC.js → XClose-BivECxO7.js} +1 -1
- package/dist/client/assets/{YAxis-DyE5fkIu.js → YAxis-BUFR5b9Q.js} +1 -1
- package/dist/client/assets/{Zap-DYtDBHNd.js → Zap-Cnsys2Wq.js} +1 -1
- package/dist/client/assets/{ZapSquare-CGgQRKSq.js → ZapSquare-CSYRxph5.js} +1 -1
- package/dist/client/assets/{access-gate-bxw6GJBM.js → access-gate-C37vr7HM.js} +1 -1
- package/dist/client/assets/{agent-icon-RO_lY7mQ.js → agent-icon-BUsh3oGt.js} +1 -1
- package/dist/client/assets/agents-list-BSXmKvPI.js +1 -0
- package/dist/client/assets/{ai-providers-_bAZfhEo.js → ai-providers-ByCNS5tk.js} +2 -2
- package/dist/client/assets/{alert-DS_4c1g8.js → alert-BqDinRfy.js} +1 -1
- package/dist/client/assets/{alert-dialog-B3eneGBp.js → alert-dialog-hhGN1kzx.js} +1 -1
- package/dist/client/assets/{api-keys-Cn1MTRia.js → api-keys-DHBiaV_r.js} +1 -1
- package/dist/client/assets/app-editor-C0hCGxtl.js +1 -0
- package/dist/client/assets/{auth-DeQHSbj0.js → auth-BbVa1hsz.js} +1 -1
- package/dist/client/assets/{auth-catchall-BWmr3lOz.js → auth-catchall-CFKvepKy.js} +1 -1
- package/dist/client/assets/{auth-entry-B3nspDeT.js → auth-entry-BXkmPqvH.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DH603Yyd.js → auth-split-layout-CQECvTjT.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DaDpqCGj.js → authenticate-and-persist-oauth-BW7lPmR8.js} +1 -1
- package/dist/client/assets/{automation-list-row-GJXCE3Ep.js → automation-list-row-6SRFf-_b.js} +1 -1
- package/dist/client/assets/{automation-runs-CggJDo1C.js → automation-runs-BQ0Iu53B.js} +1 -1
- package/dist/client/assets/automations-DXRcT17e.js +1 -0
- package/dist/client/assets/{avatar-t8xMECgD.js → avatar-CffKfcxD.js} +1 -1
- package/dist/client/assets/{badge-3w-z2q_R.js → badge-DdvBiEJO.js} +1 -1
- package/dist/client/assets/{block-document-DBAOy7rM.js → block-document-Dp95KQeN.js} +1 -1
- package/dist/client/assets/{buckets-C6KeDFl_.js → buckets-C-YB4kjm.js} +1 -1
- package/dist/client/assets/bulk-category-panel-xdEU6TlG.js +1 -0
- package/dist/client/assets/{capability-load-error-CrnDuhrP.js → capability-load-error-DifEo2uP.js} +1 -1
- package/dist/client/assets/{cards-B116B10c.js → cards-BImfAb5p.js} +1 -1
- package/dist/client/assets/category-editor-BTtM_Oym.js +1 -0
- package/dist/client/assets/{chart-B-JWflUf.js → chart-CQDerfwb.js} +1 -1
- package/dist/client/assets/chat-context-BSlnS4lO.js +35 -0
- package/dist/client/assets/{checkbox-CTK-987j.js → checkbox-DvnU-G5n.js} +1 -1
- package/dist/client/assets/{choose-editor-BiIbar5e.js → choose-editor-DDZWpEEU.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CWZIlaAu.js → cli-auth-success-BKkBveK7.js} +1 -1
- package/dist/client/assets/collection-detail-i2uJ3G4p.js +1 -0
- package/dist/client/assets/{collection-display-button-RvJk_3kM.js → collection-display-button-DUWiE5Mh.js} +1 -1
- package/dist/client/assets/{collection-search-TDcC3qnQ.js → collection-search-D5bU0Mny.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-AH8YyxhL.js → collection-table-wrapper-6LuinD6M.js} +1 -1
- package/dist/client/assets/{collection-tabs-mTx4dyj7.js → collection-tabs-DSNouQYO.js} +1 -1
- package/dist/client/assets/{command-BmhGhCGW.js → command-DO658f9K.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DDSFZSw4.js → commerce-onboarding-DTgTL1Sa.js} +1 -1
- package/dist/client/assets/{connect-BRqyUKct.js → connect-Bo1Gdnm2.js} +1 -1
- package/dist/client/assets/{connection-DPcqqUpI.js → connection-BMZxDUto.js} +1 -1
- package/dist/client/assets/{connection-card-Dg2tFKYT.js → connection-card-BxOv_0Pb.js} +1 -1
- package/dist/client/assets/connection-detail-Ceqi_UkX.js +1 -0
- package/dist/client/assets/{connection-form-helpers-BiSqyE70.js → connection-form-helpers-DwrLlCes.js} +1 -1
- package/dist/client/assets/{connections-BRZcZzvE.js → connections-sw9Pef3f.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cn3-H_-J.js → decopilot-sse-pool-CnQZuU8U.js} +1 -1
- package/dist/client/assets/{dialog-CaTBZV_d.js → dialog-CRgUvUGD.js} +1 -1
- package/dist/client/assets/{domain-settings-DSiUt4s6.js → domain-settings-BHqc8jTd.js} +1 -1
- package/dist/client/assets/{drawer-CMaDObPV.js → drawer-B5fFyIgX.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BRNNpXcy.js → dropdown-menu-C0p1X71u.js} +1 -1
- package/dist/client/assets/{empty-state-Dx5RvteD.js → empty-state-nAEi4fmW.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DDL06q4h.js → extract-connection-data-D3s8EYsm.js} +1 -1
- package/dist/client/assets/file-explorer-C3wPz2g1.js +2 -0
- package/dist/client/assets/{file-type-icon-C2ALTS96.js → file-type-icon-BxCMRXC7.js} +1 -1
- package/dist/client/assets/{form-C1Z3Pgy9.js → form-CkF9Gll6.js} +1 -1
- package/dist/client/assets/{general-wKChpaKt.js → general-Bvd3m1q-.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CghdTD4a.js → github-repo-picker-uCh44L_P.js} +1 -1
- package/dist/client/assets/{hooks-BjFStmIb.js → hooks-BMvgJI-g.js} +10 -10
- package/dist/client/assets/index-BxFod4ty.js +1 -0
- package/dist/client/assets/{index-k4eNrclM.js → index-C7yUTQLC.js} +1 -1
- package/dist/client/assets/{index-DXHENisy.js → index-CRX5z-Jb.js} +1 -1
- package/dist/client/assets/{index-Bv7SAPra.js → index-CWPBMaeR.js} +2 -2
- package/dist/client/assets/{index-xiyjF2ia.js → index-CxD2n68d.js} +1 -1
- package/dist/client/assets/index-CxZcM7iI.js +743 -0
- package/dist/client/assets/{index-C-3fd8Ck.js → index-D5JaHC8m.js} +1 -1
- package/dist/client/assets/{index-DnfUq0Re.js → index-DGbNQLI2.js} +1 -1
- package/dist/client/assets/index-dzFuJh3g.js +1 -0
- package/dist/client/assets/{index-DLiSt-zY.js → index-eMuSvnay.js} +5 -5
- package/dist/client/assets/{index-redirect-Q-uzQ1ZR.js → index-redirect-CSQT7dVz.js} +1 -1
- package/dist/client/assets/{infra-billing-C8apIzey.js → infra-billing-D1_-S4Iu.js} +1 -1
- package/dist/client/assets/{input-CY_6SiUS.js → input-CzXHUUzJ.js} +1 -1
- package/dist/client/assets/{integration-icon-CGhJSgDA.js → integration-icon-UAHcQu3Y.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-B2p8Tm3P.js → invite-member-dialog-a03LtCNI.js} +1 -1
- package/dist/client/assets/{label-CIfNh86q.js → label-C-f36Ery.js} +1 -1
- package/dist/client/assets/{layout-BCjUdMcW.js → layout-ExdNCowx.js} +1 -1
- package/dist/client/assets/{login-Dy6oLdg_.js → login-BoUiAbPR.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DImoLDws.js → mcp-oauth-EpOxhfnN.js} +1 -1
- package/dist/client/assets/{members-BeZb8rdR.js → members-DRacrCiw.js} +1 -1
- package/dist/client/assets/{monaco-editor-ZUjofCql.js → monaco-editor-DXWGpYdI.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CwawUUDQ.js → monitoring-stats-row-CStChSPF.js} +1 -1
- package/dist/client/assets/{multi-select-BasuLjyg.js → multi-select-V9DJTmBZ.js} +1 -1
- package/dist/client/assets/{oauth-callback-CkV2aSCc.js → oauth-callback-CvsRTDAl.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DQzrQ2ZW.js → oauth-callback-ai-provider-BTZRnTS3.js} +1 -1
- package/dist/client/assets/{onboarding-ZjEXHRqc.js → onboarding-og3I_xVV.js} +1 -1
- package/dist/client/assets/{org-layout-BFuYj0lq.js → org-layout-QWnp58dZ.js} +1 -1
- package/dist/client/assets/{organization-choice-CNLElHVj.js → organization-choice-DurkooFh.js} +1 -1
- package/dist/client/assets/{orgs-DY4SjhQN.js → orgs-jsXpwgtJ.js} +1 -1
- package/dist/client/assets/{page-seo-form-DwRi_S8N.js → page-seo-form-CKaXssEk.js} +1 -1
- package/dist/client/assets/{popover-lX6wGPom.js → popover-OOnmalBV.js} +1 -1
- package/dist/client/assets/post-editor-CFCYmhEe.js +1 -0
- package/dist/client/assets/{primitives-BAE6y0ZV.js → primitives-BhZ-HVLG.js} +1 -1
- package/dist/client/assets/{profile-CMoih80z.js → profile-BRSzqaGC.js} +1 -1
- package/dist/client/assets/project-app-view-C5juFf3y.js +1 -0
- package/dist/client/assets/record-editor-BGJ3Uxr9.js +1 -0
- package/dist/client/assets/redirect-editor-BgmzxDxm.js +1 -0
- package/dist/client/assets/registry-Us39sPL5.js +2 -0
- package/dist/client/assets/{registry-layout-7bL7SAGE.js → registry-layout-CaPQ8D3m.js} +1 -1
- package/dist/client/assets/{reports-BkJ5gkYi.js → reports-CZRAYZND.js} +1 -1
- package/dist/client/assets/{require-capability-CLTXzK08.js → require-capability-CDs1Pl6o.js} +1 -1
- package/dist/client/assets/{required-auth-layout-v7tDA1sl.js → required-auth-layout-D7eBvpct.js} +1 -1
- package/dist/client/assets/{reset-password-BKBz_Aon.js → reset-password-DDPC0WP5.js} +1 -1
- package/dist/client/assets/reusable-new-chat-CzvRy4Pe.js +1 -0
- package/dist/client/assets/{roles-qVXSbIQj.js → roles-qcaRRwf8.js} +1 -1
- package/dist/client/assets/{search-input-4YJ4nTbO.js → search-input-Dv3_1Uvp.js} +1 -1
- package/dist/client/assets/{secrets-D-r8Fhcp.js → secrets-DcwYYhlg.js} +1 -1
- package/dist/client/assets/sections-editor-DNihJe6v.js +2 -0
- package/dist/client/assets/{select-BwLC9-0c.js → select-Cf3o4e13.js} +1 -1
- package/dist/client/assets/{select-model-DpD5UXaD.js → select-model-B7Rf8Feb.js} +1 -1
- package/dist/client/assets/{self-tool-result-BeRzbQuP.js → self-tool-result-BawREriG.js} +1 -1
- package/dist/client/assets/seo-editor-D_IRi8v_.js +1 -0
- package/dist/client/assets/session-runtime-wVXsCwcJ.js +1 -0
- package/dist/client/assets/{settings-layout-DTqIuCHt.js → settings-layout-BgcGIDRi.js} +1 -1
- package/dist/client/assets/{shell-controls-vM7eX0ni.js → shell-controls-BkJPCi4L.js} +1 -1
- package/dist/client/assets/{shell-layout-DEMtIHgw.js → shell-layout-DPDTGLA3.js} +1 -1
- package/dist/client/assets/{spinner-Dpvz3p80.js → spinner-CeAynGXW.js} +1 -1
- package/dist/client/assets/{sso-BxyVr7dm.js → sso-BlKU6Kgb.js} +1 -1
- package/dist/client/assets/{store-CEc4rXka.js → store-BYS_aOKm.js} +1 -1
- package/dist/client/assets/store-registry-BPg2BhqF.js +2 -0
- package/dist/client/assets/{switch-DBiih54-.js → switch-EyKGbAqJ.js} +1 -1
- package/dist/client/assets/synced-repos-BUf8qMc_.js +1 -0
- package/dist/client/assets/{tab-id-DrwxksV4.js → tab-id-BupMUSAp.js} +1 -1
- package/dist/client/assets/{table-BM3FdIaA.js → table-ByGDNySe.js} +1 -1
- package/dist/client/assets/{tabs-C49oMc7W.js → tabs-YXze6Pex.js} +1 -1
- package/dist/client/assets/{task-key-2XocQivt.js → task-key-D6-3eaXs.js} +1 -1
- package/dist/client/assets/{tasks-DIZudm73.js → tasks-CjQzsFHS.js} +1 -1
- package/dist/client/assets/{textarea-BYMb5MM5.js → textarea-BUU8Uzj2.js} +1 -1
- package/dist/client/assets/{toggle-group-DmafBxKV.js → toggle-group-5udoaIQ7.js} +1 -1
- package/dist/client/assets/{toolbar-BOPj8b0I.js → toolbar-jStDQiC9.js} +1 -1
- package/dist/client/assets/{track-Fq5TqDMp.js → track-x1Ue_gqj.js} +1 -1
- package/dist/client/assets/{types-7z_oxg9w.js → types-CWfqP-B-.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Ck06PFGE.js → use-ai-providers-BJFNFBW8.js} +1 -1
- package/dist/client/assets/{use-api-keys-yafBkhyf.js → use-api-keys-zvnJANCI.js} +1 -1
- package/dist/client/assets/{use-automations-BrFXzBSZ.js → use-automations-CJu_L57g.js} +1 -1
- package/dist/client/assets/{use-autosave-DzyEelZn.js → use-autosave-xiJNpL3o.js} +1 -1
- package/dist/client/assets/{use-clock-tick-anNRVc0o.js → use-clock-tick-BY6Y0vZc.js} +1 -1
- package/dist/client/assets/use-commerce-diagnostic-DogDSREs.js +1 -0
- package/dist/client/assets/{use-connection-r6ziU6lR.js → use-connection-CrWZq_Ri.js} +1 -1
- package/dist/client/assets/{use-copy-BeCWcJQD.js → use-copy-X4stx05l.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CRJnDKdI.js → use-create-virtual-mcp-DnKX51Fm.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B4C2TeP_.js → use-debounced-autosave-C2GBWe-g.js} +1 -1
- package/dist/client/assets/{use-debounced-value-cAUV3o-a.js → use-debounced-value-pQUbNH4F.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DZOEgHZF.js → use-decopilot-events-DS-28zR1.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Dkclv4mQ.js → use-delete-connection-B9dJVi18.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BNiRhHXk.js → use-deployment-admin-CzS4BgDQ.js} +1 -1
- package/dist/client/assets/{use-file-configs-DGfh8vOd.js → use-file-configs-bqn0DQl-.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DsDG7oFh.js → use-infinite-scroll-DING_ypo.js} +1 -1
- package/dist/client/assets/use-join-requests-COAIroPq.js +1 -0
- package/dist/client/assets/{use-mcp-client-BsB3UQx0.js → use-mcp-client-DMgRONuR.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D7WtkO_a.js → use-mcp-tools-CrszPH3e.js} +1 -1
- package/dist/client/assets/{use-members-DZPpmeBy.js → use-members-D74i7CK7.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-D-PAXyxX.js +1 -0
- package/dist/client/assets/{use-org-auth-client-CR2NXIGs.js → use-org-auth-client-DGlgRRC_.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-B1gYKpB8.js → use-org-repo-syncs-L_Q9jn6Z.js} +1 -1
- package/dist/client/assets/{use-org-sso-BhfC5bai.js → use-org-sso-DIKj2vIX.js} +1 -1
- package/dist/client/assets/{use-organization-roles-g149SJyR.js → use-organization-roles-CW54FQjL.js} +1 -1
- package/dist/client/assets/{use-organization-settings-WfyIMnA9.js → use-organization-settings-KBGKqIJR.js} +1 -1
- package/dist/client/assets/{use-registry-connections-WDHdHLId.js → use-registry-connections-B0WaaMcP.js} +1 -1
- package/dist/client/assets/{use-secrets-MMdltV8V.js → use-secrets-Cv3PcVUL.js} +1 -1
- package/dist/client/assets/use-section-preview-base-BItk4_Sy.js +1 -0
- package/dist/client/assets/{use-status-sounds-IuSNJ3uy.js → use-status-sounds-CTsRBUIT.js} +1 -1
- package/dist/client/assets/{use-tags-DN3Y1Fjc.js → use-tags-DB9UyYAF.js} +1 -1
- package/dist/client/assets/{use-view-mode-Cecw-Bk2.js → use-view-mode-jGpQ2LaX.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DkibxhFn.js → use-virtual-mcp-M6mi7VuQ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BUqQM02C.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DtiiRZ-l.js +1 -0
- package/dist/client/assets/{users-3pVvJjVm.js → users-Csrapr9p.js} +1 -1
- package/dist/client/assets/variant-calendar-BEGxTpND.js +1 -0
- package/dist/client/assets/{view-mode-toggle-3Ft6ZtrM.js → view-mode-toggle-CemYbpmR.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +520 -519
- package/dist/server/server.js +366 -365
- package/package.json +1 -1
- package/dist/client/assets/agents-list-DEVfy7bO.js +0 -1
- package/dist/client/assets/app-editor-CwurZ13A.js +0 -1
- package/dist/client/assets/automations-BU9EygDS.js +0 -1
- package/dist/client/assets/bulk-category-panel-q0gXcv7r.js +0 -1
- package/dist/client/assets/category-editor-J3ebsbj7.js +0 -1
- package/dist/client/assets/chat-context-DzbskOkq.js +0 -35
- package/dist/client/assets/collection-detail-DosMB9QP.js +0 -1
- package/dist/client/assets/connection-detail-BecsUn3M.js +0 -1
- package/dist/client/assets/deco-site-production-url-BjY4ZYd-.js +0 -1
- package/dist/client/assets/file-explorer-JPclp_ri.js +0 -2
- package/dist/client/assets/index-C5dcfsKv.js +0 -1
- package/dist/client/assets/index-CErG4sP_.js +0 -743
- package/dist/client/assets/index-_2waRVYp.js +0 -1
- package/dist/client/assets/post-editor-CHtqUuEA.js +0 -1
- package/dist/client/assets/project-app-view-DZkY6r-W.js +0 -1
- package/dist/client/assets/record-editor-BHVAEIpq.js +0 -1
- package/dist/client/assets/redirect-editor-DfoPFWBF.js +0 -1
- package/dist/client/assets/registry-C7_sqj0C.js +0 -2
- package/dist/client/assets/reusable-new-chat-CouMjkYR.js +0 -1
- package/dist/client/assets/sections-editor-DCdYW5bN.js +0 -2
- package/dist/client/assets/seo-editor-BPRdm9p8.js +0 -1
- package/dist/client/assets/store-registry-DVE1XJgw.js +0 -2
- package/dist/client/assets/synced-repos-DL_Fe1n5.js +0 -1
- package/dist/client/assets/use-commerce-diagnostic-spCFF13q.js +0 -1
- package/dist/client/assets/use-join-requests-B_O58DBS.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-D_YtZ8Nf.js +0 -1
- package/dist/client/assets/use-section-preview-base-WS8WDR0j.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Tdf3vSzC.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Dgd9ebpu.js +0 -1
- package/dist/client/assets/variant-calendar-Na_TE_QI.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ge,b as me,j as o,x as Ae,aR as De,t as le,B as ne,aT as Ie,H as ye,p as Le,a as Te,r as X,o as Ee,K as de,e as Fe,q as V,I as ke,n as Me,P as ce}from"./index-DLiSt-zY.js";import{a as re,b as we,D as ue,c as pe}from"./dropdown-menu-BRNNpXcy.js";import{a as Pe}from"./Users03-BH_DGEIm.js";import{G as Se,b as Ge,a as Oe}from"./github-repo-picker-CghdTD4a.js";import{u as ze,b as Be,c as Ue}from"./use-virtual-mcp-DkibxhFn.js";import{a as Re}from"./DotsVertical-CYMbIa1_.js";import{A as $e,f as fe,b1 as He}from"./agent-icon-RO_lY7mQ.js";import{a as Ve}from"./Settings02-DQ6Qx_Qo.js";import{s as Ke}from"./Trash01-CISu7ukT.js";import{p as qe,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-D_YtZ8Nf.js";import{f as Qe,i as Je}from"./use-organization-settings-WfyIMnA9.js";import{E as Ye}from"./empty-state-Dx5RvteD.js";import{u as We}from"./use-create-virtual-mcp-CRJnDKdI.js";import{u as Xe}from"./use-connection-r6ziU6lR.js";import{u as xe}from"./use-mcp-client-BsB3UQx0.js";import{S as Ze}from"./constants-_08zpzmT.js";import{p as et,a as je}from"./deco-site-production-url-BjY4ZYd-.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-CaTBZV_d.js";import{i as dt}from"./ArrowLeft-CA4nZ19l.js";import{C as ut}from"./collection-search-TDcC3qnQ.js";import{c as pt,d as gt,b as ft,f as ht,g as xt,e as jt,a as Ct,A as bt}from"./alert-dialog-B3eneGBp.js";import{S as Dt}from"./search-input-4YJ4nTbO.js";import{s as Ce}from"./Plus-BBdbmkEC.js";import"./Check-D4XLgaN4.js";import"./ChevronRight-Bbyr31or.js";import"./use-debounced-value-cAUV3o-a.js";import"./authenticate-and-persist-oauth-DaDpqCGj.js";import"./mcp-oauth-DImoLDws.js";import"./auth-DeQHSbj0.js";import"./LinkExternal01-BYv4_-zq.js";import"./LockUnlocked01-BssaZtDy.js";import"./use-mcp-tools-D7WtkO_a.js";import"./extract-connection-data-DDL06q4h.js";import"./metadata-dUsYcpuu.js";import"./AlertCircle-BckADFTN.js";import"./Tool01-kIIhzZhw.js";import"./ArrowUp-8tGgkrEO.js";import"./Tool02-xsTmH7TW.js";import"./XCircle-qOGRhnhp.js";import"./TrendUp01-D54j7eRb.js";import"./ZapSquare-CGgQRKSq.js";import"./CheckCircle-Dh96WJYX.js";import"./ChevronDown-Dm6QJQj5.js";import"./ChevronSelectorVertical-BUgf0an-.js";import"./ChevronUp-C7jPKNLf.js";import"./Stars02-BC82QMl0.js";import"./UserSquare-DgUtDej9.js";import"./Copy01-BqCuDnjV.js";import"./CreditCard01-CALthygT.js";import"./Download01-C6mH6Z8f.js";import"./Eye-jMpQ7fBE.js";import"./FilterLines-4Qetm1ho.js";import"./Share07-Di11XO-1.js";import"./Globe01-CkxIxFjV.js";import"./Globe04-CWbZ_xf0.js";import"./SwitchHorizontal01-DJAL0oew.js";import"./HardDrive-DqrbzOlI.js";import"./Key01-CzBg_w_E.js";import"./LogOut01-CE6p7Q73.js";import"./Monitor01-DUnpXEZF.js";import"./Sun-CL5Lwimd.js";import"./Palette-zSvxc111.js";import"./Play-C9tlPC3I.js";import"./SearchLg-Bg0bWoci.js";import"./SearchMd-B5LTpCxn.js";import"./Shield01-FnU_LRxr.js";import"./Stars01-C8fjQPly.js";import"./Upload01-BBFWsedg.js";import"./User01-Da-P04pG.js";import"./Users01-CXfWV5oU.js";import"./XClose-DL2O4uTC.js";import"./Zap-DYtDBHNd.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-BjFStmIb.js";import"./decopilot-sse-pool-Cn3-H_-J.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:M,showBetaBadge:x}=t,P=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Pe,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Se,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==P||e[23]!==M||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(we,{side:M,align:P,className:"w-48",children:[D,l,w]}),e[22]=P,e[23]=M,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=_e(),c=me(),[M]=Ae(),x=M.language==="pt-BR"?qe:void 0,{mainAgentId:P}=Qe(),d=Je(),{granted:T}=De("org:manage"),m=P===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx($e,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Re,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(Ve,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ke,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(we,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let S;e[33]!==z||e[34]!==l?(S=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=S):S=e[35];let v;e[36]!==i.title?(v=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=v):v=e[37];let N;e[38]!==m||e[39]!==c?(N=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=N):N=e[40];let G;e[41]!==v||e[42]!==N?(G=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,N]}),e[41]=v,e[42]=N,e[43]=G):G=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==G||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[G,s]}),e[46]=G,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==S||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[S,p]}),e[49]=S,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let _;e[57]!==b?(_=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=_):_=e[58];let A;e[59]!==g||e[60]!==_?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,_]}),e[59]=g,e[60]=_,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Ie,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function St(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function _t(t,e){const i=e?St(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function vt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ve(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function Nt(t){return ve(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=ye(),f=_e(),c=Le(),{data:M}=Te.useSession(),[x,P]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Ge({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Ee({queryKey:de.decoSites(M?.user?.email),queryFn:()=>Nt(r.slug),enabled:t&&!!M?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],v=s=>{s||(P(null),T(null),D("")),e(s)},N=S.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),G=!x||N.some(s=>s.name===x),F=Fe({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=S.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=_t(s,g.metadata),_=st(p,b.owner);if(!_)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const J=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await ve(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),R=B.connId;if(!R)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=R;const{childConnectionId:$,reused:Y}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:_.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=Y?null:$;const K=B.icon??null,Z=vt(s),W=s.toLowerCase(),q=et(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:q,productionUrl:q,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:_.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:R,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:R},{connection_id:$}]}}}),U=Q.structuredContent??Q;if(!U.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=U.item.id,{slug:Z,virtualMcpId:U.item.id,connId:R,item:U.item}}catch(B){throw await J(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const _=b.queryKey;return _[1]===r.id&&_[3]==="collection"&&_[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),v(!1),localStorage.setItem(ke.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:v,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&S.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[N.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),N.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>P(s.name),className:Me("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>v(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!G||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ss(){const t=ge.c(77),e=me(),{org:i}=ye(),n=ze(),r=Be(),[f,c]=X.useState("");let M;t[0]===Symbol.for("react.memo_cache_sentinel")?(M={navigateOnCreate:!0},t[0]=M):M=t[0];const{createVirtualMCP:x,isCreating:P}=We(M),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=De("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Ue(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:Ne}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ne}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let S;t[5]!==e?(S=e("routes.agentsList.title"),t[5]=e,t[6]=S):S=t[6];let v;t[7]!==S?(v=o.jsx(ce.Title,{children:S}),t[7]=S,t[8]=v):v=t[8];let N;t[9]!==e?(N=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=N):N=t[10];let G;t[11]===Symbol.for("react.memo_cache_sentinel")?(G=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=G):G=t[11];let F;t[12]!==f||t[13]!==N?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:N,className:"w-full md:w-[375px]",onKeyDown:G}),t[12]=f,t[13]=N,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==P||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:P,align:"end"})]}),t[15]=a,t[16]=x,t[17]=P,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==v?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,p]}),t[23]=p,t[24]=v,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx(He,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:P,align:"center",showBetaBadge:!0})]})})}),_=h.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==_||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,_]}),t[26]=g,t[27]=b,t[28]=_,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Oe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=t[37];const B=!!d;let R;t[38]===Symbol.for("react.memo_cache_sentinel")?(R=L=>!L&&T(null),t[38]=R):R=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let Y;t[41]!==$?(Y=o.jsx(pt,{children:$}),t[41]=$,t[42]=Y):Y=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let W;t[45]!==Z?(W=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=W):W=t[46];let q;t[47]!==K||t[48]!==W?(q=o.jsxs(gt,{children:[K," ",W,"."]}),t[47]=K,t[48]=W,t[49]=q):q=t[49];let Q;t[50]!==Y||t[51]!==q?(Q=o.jsxs(ft,{children:[Y,q]}),t[50]=Y,t[51]=q,t[52]=Q):Q=t[52];let U;t[53]!==e?(U=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=U):U=t[54];let H;t[55]!==U?(H=o.jsx(ht,{children:U}),t[55]=U,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==Q||t[66]!==oe?(se=o.jsxs(Ct,{children:[Q,oe]}),t[65]=Q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:R,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,J,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ss as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Bt,b as kt,r as A,j as o,n as jt,k as _t,t as xt}from"./index-DLiSt-zY.js";import{i as wt}from"./ChevronRight-Bbyr31or.js";import{B as At}from"./automation-runs-CggJDo1C.js";import{u as Et,A as Nt}from"./use-section-preview-base-WS8WDR0j.js";import{A as Rt,B as Ct,C as Kt,D as Tt,F as Ft,G as Pt,H as $t,S as Ut,I as Ot,J as zt}from"./index-CErG4sP_.js";import"./select-BwLC9-0c.js";import"./Check-D4XLgaN4.js";import"./ChevronDown-Dm6QJQj5.js";import"./ChevronUp-C7jPKNLf.js";import"./agent-icon-RO_lY7mQ.js";import"./AlertCircle-BckADFTN.js";import"./Tool01-kIIhzZhw.js";import"./ArrowUp-8tGgkrEO.js";import"./ArrowLeft-CA4nZ19l.js";import"./Tool02-xsTmH7TW.js";import"./XCircle-qOGRhnhp.js";import"./TrendUp01-D54j7eRb.js";import"./ZapSquare-CGgQRKSq.js";import"./Users03-BH_DGEIm.js";import"./CheckCircle-Dh96WJYX.js";import"./ChevronSelectorVertical-BUgf0an-.js";import"./DotsVertical-CYMbIa1_.js";import"./Stars02-BC82QMl0.js";import"./UserSquare-DgUtDej9.js";import"./Copy01-BqCuDnjV.js";import"./CreditCard01-CALthygT.js";import"./Download01-C6mH6Z8f.js";import"./Settings02-DQ6Qx_Qo.js";import"./Eye-jMpQ7fBE.js";import"./FilterLines-4Qetm1ho.js";import"./Share07-Di11XO-1.js";import"./Globe01-CkxIxFjV.js";import"./Globe04-CWbZ_xf0.js";import"./SwitchHorizontal01-DJAL0oew.js";import"./HardDrive-DqrbzOlI.js";import"./Key01-CzBg_w_E.js";import"./LinkExternal01-BYv4_-zq.js";import"./LockUnlocked01-BssaZtDy.js";import"./LogOut01-CE6p7Q73.js";import"./Monitor01-DUnpXEZF.js";import"./Sun-CL5Lwimd.js";import"./Palette-zSvxc111.js";import"./Play-C9tlPC3I.js";import"./Plus-BBdbmkEC.js";import"./SearchLg-Bg0bWoci.js";import"./SearchMd-B5LTpCxn.js";import"./Shield01-FnU_LRxr.js";import"./Stars01-C8fjQPly.js";import"./Trash01-CISu7ukT.js";import"./Upload01-BBFWsedg.js";import"./User01-Da-P04pG.js";import"./Users01-CXfWV5oU.js";import"./XClose-DL2O4uTC.js";import"./Zap-DYtDBHNd.js";import"./useInfiniteQuery-Tdf3vSzC.js";import"./use-infinite-scroll-DsDG7oFh.js";import"./use-connection-r6ziU6lR.js";import"./use-mcp-client-BsB3UQx0.js";import"./constants-_08zpzmT.js";import"./auth-DeQHSbj0.js";import"./use-virtual-mcp-DkibxhFn.js";import"./table-BM3FdIaA.js";import"./empty-state-Dx5RvteD.js";import"./use-members-DZPpmeBy.js";import"./use-org-auth-client-CR2NXIGs.js";import"./use-clock-tick-anNRVc0o.js";import"./use-automations-BrFXzBSZ.js";import"./useSuspenseInfiniteQuery-Dgd9ebpu.js";import"./avatar-t8xMECgD.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BeCWcJQD.js";import"./dialog-CaTBZV_d.js";import"./tab-id-DrwxksV4.js";import"./hooks-BjFStmIb.js";import"./decopilot-sse-pool-Cn3-H_-J.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-DzbskOkq.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-Ck06PFGE.js";import"./use-decopilot-events-DZOEgHZF.js";import"./use-organization-settings-WfyIMnA9.js";import"./monaco-editor-ZUjofCql.js";import"./spinner-Dpvz3p80.js";import"./types-7z_oxg9w.js";import"./shell-layout-DEMtIHgw.js";import"./required-auth-layout-v7tDA1sl.js";import"./use-org-sso-BhfC5bai.js";import"./integration-icon-CGhJSgDA.js";import"./use-navigate-to-agent-D_YtZ8Nf.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-B-JWflUf.js";import"./index-DXHENisy.js";import"./form-C1Z3Pgy9.js";import"./label-CIfNh86q.js";import"./input-CY_6SiUS.js";import"./file-type-icon-C2ALTS96.js";import"./drawer-CMaDObPV.js";import"./collection-search-TDcC3qnQ.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-C49oMc7W.js";import"./toggle-group-DmafBxKV.js";import"./use-commerce-diagnostic-spCFF13q.js";import"./popover-lX6wGPom.js";import"./self-tool-result-BeRzbQuP.js";import"./alert-dialog-B3eneGBp.js";import"./extract-connection-data-DDL06q4h.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-cAUV3o-a.js";import"./authenticate-and-persist-oauth-DaDpqCGj.js";import"./mcp-oauth-DImoLDws.js";import"./track-Fq5TqDMp.js";import"./toolbar-BOPj8b0I.js";import"./github-repo-picker-CghdTD4a.js";import"./use-mcp-tools-D7WtkO_a.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-Dg2tFKYT.js";import"./use-registry-connections-WDHdHLId.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BYMb5MM5.js";import"./connection-form-helpers-BiSqyE70.js";import"./collection-tabs-mTx4dyj7.js";import"./badge-3w-z2q_R.js";import"./command-BmhGhCGW.js";import"./index-DnfUq0Re.js";import"./select-model-DpD5UXaD.js";import"./checkbox-CTK-987j.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-B116B10c.js";import"./dropdown-menu-BRNNpXcy.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-IuSNJ3uy.js";import"./use-file-configs-DGfh8vOd.js";import"./pt-BR-CLy76QW2.js";import"./switch-DBiih54-.js";import"./use-debounced-autosave-B4C2TeP_.js";import"./search-input-4YJ4nTbO.js";import"./index-k4eNrclM.js";import"./use-secrets-MMdltV8V.js";import"./AreaChart-D3FkaC6Z.js";import"./task-key-2XocQivt.js";import"./use-tags-DN3Y1Fjc.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-GJXCE3Ep.js";import"./use-org-repo-syncs-B1gYKpB8.js";function It(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Rt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function Rr(n){const t=Bt.c(78),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:ht,excludeFields:H,schemaPending:nt,previewBaseUrl:lt}=n,M=nt===void 0?!1:nt,Z=lt===void 0?null:lt,c=kt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Et(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Ct(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const G=C,ct=ht??(x?Kt(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:J,isPending:Q}=Tt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const W=Ft(T);let F;t[17]!==S?(F=Ot((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const X=F,[bt,vt]=A.useState(p),[Y,dt]=A.useState(null),[tt,ut]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,ft]=A.useState(P),[et,d]=A.useState(!1),$=A.useRef(null);bt!==p&&(vt(p),dt(null),ut(Vt),ft([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const ot=U;let y;t[22]!==Y?(y=Y??{},t[22]=Y,t[23]=y):y=t[23];let O;t[24]!==ot||t[25]!==y?(O={...ot,...y},t[24]=ot,t[25]=y,t[26]=O):O=t[26];const rt=O;let z;t[27]!==p||t[28]!==v||t[29]!==S?(z=e=>{const r=e;dt(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=z):z=t[30];const it=z;let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{ft(e)},t[31]=I):I=t[31];const E=I;let L;t[32]!==l||t[33]!==J||t[34]!==W||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=It(e,l);await W.mutateAsync({blockKey:u,data:f}),xt.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),J()}catch(u){const f=u,yt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw xt.error(yt),f}},t[32]=l,t[33]=J,t[34]=W,t[35]=c,t[36]=L):L=t[36];const B=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==B||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await B(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=B,t[40]=d,t[41]=q):q=t[41];const mt=q,pt=g.length>0?[ct,...g]:[],St="flex h-full flex-col",gt="flex h-12 shrink-0 items-center justify-between border-b px-6",at=pt.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:pt.map((e,r)=>{const u=r===pt.length-1,f=Pt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ut(Lt)},title:f,className:jt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:ct});let k;t[42]!==Q?(k=o.jsx(zt,{isPending:Q,isError:!1}),t[42]=Q,t[43]=k):k=t[43];let j;t[44]!==at||t[45]!==k?(j=o.jsxs("div",{className:gt,children:[at,k]}),t[44]=at,t[45]=k,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==rt||t[52]!==tt||t[53]!==B||t[54]!==E||t[55]!==it||t[56]!==st||t[57]!==G||t[58]!==a||t[59]!==s||t[60]!==X||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==i?(_=o.jsx(At,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:G?o.jsx(Ut,{schema:b,value:rt,onChange:it,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:X,previewBaseUrl:h,onAddSectionItem:B,onRequestAddSection:st,sandbox:{orgSlug:s,virtualMcpId:i,branch:m}},`${p}:${tt}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=rt,t[52]=tt,t[53]=B,t[54]=E,t[55]=it,t[56]=st,t[57]=G,t[58]=a,t[59]=s,t[60]=X,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=i,t[66]=_):_=t[66];let w;t[67]!==et||t[68]!==l||t[69]!==mt||t[70]!==a||t[71]!==h||t[72]!==d?(w=h&&o.jsx(Nt,{open:et,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{mt(e)}}),t[67]=et,t[68]=l,t[69]=mt,t[70]=a,t[71]=h,t[72]=d,t[73]=w):w=t[73];let D;return t[74]!==j||t[75]!==_||t[76]!==w?(D=o.jsxs("div",{className:St,children:[j,_,w]}),t[74]=j,t[75]=_,t[76]=w,t[77]=D):D=t[77],D}function Lt(n){return n+1}function Vt(n){return n+1}export{Rr as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as B,j as o,b as D,H as M,d as $,r as q,P as d,B as H,q as R}from"./index-DLiSt-zY.js";import{s as V}from"./Plus-BBdbmkEC.js";import{i as S}from"./Zap-DYtDBHNd.js";import{S as F}from"./search-input-4YJ4nTbO.js";import{E as T}from"./empty-state-Dx5RvteD.js";import{c as G}from"./use-automations-BrFXzBSZ.js";import{c as J}from"./use-navigate-to-agent-D_YtZ8Nf.js";import{A as K}from"./automation-list-row-GJXCE3Ep.js";import{l as O}from"./constants-_08zpzmT.js";import{u as Q}from"./use-virtual-mcp-DkibxhFn.js";import{R as U}from"./require-capability-CLTXzK08.js";import"./SearchMd-B5LTpCxn.js";import"./use-mcp-client-BsB3UQx0.js";import"./auth-DeQHSbj0.js";import"./hooks-BjFStmIb.js";import"./decopilot-sse-pool-Cn3-H_-J.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-B3eneGBp.js";import"./dropdown-menu-BRNNpXcy.js";import"./Check-D4XLgaN4.js";import"./ChevronRight-Bbyr31or.js";import"./DotsVertical-CYMbIa1_.js";import"./Stars02-BC82QMl0.js";import"./Trash01-CISu7ukT.js";import"./agent-icon-RO_lY7mQ.js";import"./AlertCircle-BckADFTN.js";import"./Tool01-kIIhzZhw.js";import"./ArrowUp-8tGgkrEO.js";import"./ArrowLeft-CA4nZ19l.js";import"./Tool02-xsTmH7TW.js";import"./XCircle-qOGRhnhp.js";import"./TrendUp01-D54j7eRb.js";import"./ZapSquare-CGgQRKSq.js";import"./Users03-BH_DGEIm.js";import"./CheckCircle-Dh96WJYX.js";import"./ChevronDown-Dm6QJQj5.js";import"./ChevronSelectorVertical-BUgf0an-.js";import"./ChevronUp-C7jPKNLf.js";import"./UserSquare-DgUtDej9.js";import"./Copy01-BqCuDnjV.js";import"./CreditCard01-CALthygT.js";import"./Download01-C6mH6Z8f.js";import"./Settings02-DQ6Qx_Qo.js";import"./Eye-jMpQ7fBE.js";import"./FilterLines-4Qetm1ho.js";import"./Share07-Di11XO-1.js";import"./Globe01-CkxIxFjV.js";import"./Globe04-CWbZ_xf0.js";import"./SwitchHorizontal01-DJAL0oew.js";import"./HardDrive-DqrbzOlI.js";import"./Key01-CzBg_w_E.js";import"./LinkExternal01-BYv4_-zq.js";import"./LockUnlocked01-BssaZtDy.js";import"./LogOut01-CE6p7Q73.js";import"./Monitor01-DUnpXEZF.js";import"./Sun-CL5Lwimd.js";import"./Palette-zSvxc111.js";import"./Play-C9tlPC3I.js";import"./SearchLg-Bg0bWoci.js";import"./Shield01-FnU_LRxr.js";import"./Stars01-C8fjQPly.js";import"./Upload01-BBFWsedg.js";import"./User01-Da-P04pG.js";import"./Users01-CXfWV5oU.js";import"./XClose-DL2O4uTC.js";import"./access-gate-bxw6GJBM.js";import"./capability-load-error-CrnDuhrP.js";function W(){const t=B.c(20),e=D(),{org:l}=M(),{data:C}=G(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=$(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+i}})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(F,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(H,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function uo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{uo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as he,b as je,r as de,j as t,k as ye,aj as Ne,a8 as ke,B as ne,a9 as Ce,ab as Pe}from"./index-DLiSt-zY.js";import{B as ue}from"./agent-icon-RO_lY7mQ.js";import{L as ce}from"./label-CIfNh86q.js";import{ap as xe,aq as Se}from"./index-CErG4sP_.js";import{S as ve,a as _e,b as Te,c as we,d as Be}from"./select-BwLC9-0c.js";import"./AlertCircle-BckADFTN.js";import"./Tool01-kIIhzZhw.js";import"./ArrowUp-8tGgkrEO.js";import"./ArrowLeft-CA4nZ19l.js";import"./Tool02-xsTmH7TW.js";import"./XCircle-qOGRhnhp.js";import"./TrendUp01-D54j7eRb.js";import"./ZapSquare-CGgQRKSq.js";import"./Users03-BH_DGEIm.js";import"./CheckCircle-Dh96WJYX.js";import"./Check-D4XLgaN4.js";import"./ChevronDown-Dm6QJQj5.js";import"./ChevronRight-Bbyr31or.js";import"./ChevronSelectorVertical-BUgf0an-.js";import"./ChevronUp-C7jPKNLf.js";import"./DotsVertical-CYMbIa1_.js";import"./Stars02-BC82QMl0.js";import"./UserSquare-DgUtDej9.js";import"./Copy01-BqCuDnjV.js";import"./CreditCard01-CALthygT.js";import"./Download01-C6mH6Z8f.js";import"./Settings02-DQ6Qx_Qo.js";import"./Eye-jMpQ7fBE.js";import"./FilterLines-4Qetm1ho.js";import"./Share07-Di11XO-1.js";import"./Globe01-CkxIxFjV.js";import"./Globe04-CWbZ_xf0.js";import"./SwitchHorizontal01-DJAL0oew.js";import"./HardDrive-DqrbzOlI.js";import"./Key01-CzBg_w_E.js";import"./LinkExternal01-BYv4_-zq.js";import"./LockUnlocked01-BssaZtDy.js";import"./LogOut01-CE6p7Q73.js";import"./Monitor01-DUnpXEZF.js";import"./Sun-CL5Lwimd.js";import"./Palette-zSvxc111.js";import"./Play-C9tlPC3I.js";import"./Plus-BBdbmkEC.js";import"./SearchLg-Bg0bWoci.js";import"./SearchMd-B5LTpCxn.js";import"./Shield01-FnU_LRxr.js";import"./Stars01-C8fjQPly.js";import"./Trash01-CISu7ukT.js";import"./Upload01-BBFWsedg.js";import"./User01-Da-P04pG.js";import"./Users01-CXfWV5oU.js";import"./XClose-DL2O4uTC.js";import"./Zap-DYtDBHNd.js";import"./chat-context-DzbskOkq.js";import"./tab-id-DrwxksV4.js";import"./dialog-CaTBZV_d.js";import"./hooks-BjFStmIb.js";import"./use-mcp-client-BsB3UQx0.js";import"./constants-_08zpzmT.js";import"./auth-DeQHSbj0.js";import"./decopilot-sse-pool-Cn3-H_-J.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DkibxhFn.js";import"./use-ai-providers-Ck06PFGE.js";import"./use-decopilot-events-DZOEgHZF.js";import"./use-organization-settings-WfyIMnA9.js";import"./automation-runs-CggJDo1C.js";import"./useInfiniteQuery-Tdf3vSzC.js";import"./use-infinite-scroll-DsDG7oFh.js";import"./use-connection-r6ziU6lR.js";import"./table-BM3FdIaA.js";import"./empty-state-Dx5RvteD.js";import"./use-members-DZPpmeBy.js";import"./use-org-auth-client-CR2NXIGs.js";import"./use-clock-tick-anNRVc0o.js";import"./use-automations-BrFXzBSZ.js";import"./useSuspenseInfiniteQuery-Dgd9ebpu.js";import"./avatar-t8xMECgD.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BeCWcJQD.js";import"./monaco-editor-ZUjofCql.js";import"./spinner-Dpvz3p80.js";import"./types-7z_oxg9w.js";import"./shell-layout-DEMtIHgw.js";import"./required-auth-layout-v7tDA1sl.js";import"./use-org-sso-BhfC5bai.js";import"./integration-icon-CGhJSgDA.js";import"./use-navigate-to-agent-D_YtZ8Nf.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-B-JWflUf.js";import"./index-DXHENisy.js";import"./form-C1Z3Pgy9.js";import"./input-CY_6SiUS.js";import"./file-type-icon-C2ALTS96.js";import"./drawer-CMaDObPV.js";import"./collection-search-TDcC3qnQ.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-C49oMc7W.js";import"./toggle-group-DmafBxKV.js";import"./use-commerce-diagnostic-spCFF13q.js";import"./popover-lX6wGPom.js";import"./self-tool-result-BeRzbQuP.js";import"./alert-dialog-B3eneGBp.js";import"./extract-connection-data-DDL06q4h.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-cAUV3o-a.js";import"./authenticate-and-persist-oauth-DaDpqCGj.js";import"./mcp-oauth-DImoLDws.js";import"./track-Fq5TqDMp.js";import"./toolbar-BOPj8b0I.js";import"./github-repo-picker-CghdTD4a.js";import"./use-mcp-tools-D7WtkO_a.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-Dg2tFKYT.js";import"./use-registry-connections-WDHdHLId.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BYMb5MM5.js";import"./connection-form-helpers-BiSqyE70.js";import"./collection-tabs-mTx4dyj7.js";import"./badge-3w-z2q_R.js";import"./command-BmhGhCGW.js";import"./index-DnfUq0Re.js";import"./select-model-DpD5UXaD.js";import"./checkbox-CTK-987j.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-B116B10c.js";import"./dropdown-menu-BRNNpXcy.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-IuSNJ3uy.js";import"./use-file-configs-DGfh8vOd.js";import"./pt-BR-CLy76QW2.js";import"./switch-DBiih54-.js";import"./use-debounced-autosave-B4C2TeP_.js";import"./search-input-4YJ4nTbO.js";import"./index-k4eNrclM.js";import"./use-secrets-MMdltV8V.js";import"./AreaChart-D3FkaC6Z.js";import"./task-key-2XocQivt.js";import"./use-tags-DN3Y1Fjc.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-GJXCE3Ep.js";import"./use-org-repo-syncs-B1gYKpB8.js";function ji(i){const e=he.c(121),{posts:X,categories:r,initialSlug:le,isPending:s,onApply:re,onClose:p}=i,o=je(),[m,fe]=de.useState(le&&r.some(a=>a.slug===le)?le:r[0]?.slug??""),[n,be]=de.useState("add");let Y;if(e[0]!==r||e[1]!==m){let a;e[3]!==m?(a=ge=>ge.slug===m,e[3]=m,e[4]=a):a=e[4],Y=r.find(a),e[0]=r,e[1]=m,e[2]=Y}else Y=e[2];const c=Y,l=X.length,me=String(l);let d;e[5]!==o||e[6]!==me?(d=o("sandbox.bulkCategoryPanel.selectedCount",{count:me}),e[5]=o,e[6]=me,e[7]=d):d=e[7];let x;e[8]!==d?(x=t.jsx("span",{className:"truncate text-sm font-medium",children:d}),e[8]=d,e[9]=x):x=e[9];let u;e[10]!==o?(u=o("sandbox.bulkCategoryPanel.exitSelection"),e[10]=o,e[11]=u):u=e[11];let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(Ne,{size:14}),e[12]=Z):Z=e[12];let f;e[13]!==s||e[14]!==p||e[15]!==u?(f=t.jsx(ke,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon",disabled:s,onClick:p,"aria-label":u,children:Z})}),e[13]=s,e[14]=p,e[15]=u,e[16]=f):f=e[16];let b;e[17]!==o?(b=o("sandbox.bulkCategoryPanel.exitSelection"),e[17]=o,e[18]=b):b=e[18];let g;e[19]!==b?(g=t.jsx(Ce,{side:"bottom",children:b}),e[19]=b,e[20]=g):g=e[20];let h;e[21]!==f||e[22]!==g?(h=t.jsxs(Pe,{children:[f,g]}),e[21]=f,e[22]=g,e[23]=h):h=e[23];let j;e[24]!==h||e[25]!==x?(j=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[x,h]}),e[24]=h,e[25]=x,e[26]=j):j=e[26];let y;e[27]!==o?(y=o("sandbox.bulkCategoryPanel.title"),e[27]=o,e[28]=y):y=e[28];let N;e[29]!==y?(N=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:y}),e[29]=y,e[30]=N):N=e[30];let k;e[31]!==l||e[32]!==o?(k=l===0?o("sandbox.bulkCategoryPanel.descriptionEmpty"):o("sandbox.bulkCategoryPanel.descriptionWithCount",{count:String(l)}),e[31]=l,e[32]=o,e[33]=k):k=e[33];let C;e[34]!==k?(C=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:k}),e[34]=k,e[35]=C):C=e[35];let P;e[36]!==o?(P=o("sandbox.bulkCategoryPanel.categoryLabel"),e[36]=o,e[37]=P):P=e[37];let S;e[38]!==P?(S=t.jsx(ce,{children:P}),e[38]=P,e[39]=S):S=e[39];let v;e[40]!==r||e[41]!==m||e[42]!==o?(v=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noCategoriesMessage")}):t.jsxs(ve,{value:m,onValueChange:fe,children:[t.jsx(_e,{className:"w-full",children:t.jsx(Te,{placeholder:o("sandbox.bulkCategoryPanel.selectCategoryPlaceholder")})}),t.jsx(we,{children:r.map(ze)})]}),e[40]=r,e[41]=m,e[42]=o,e[43]=v):v=e[43];let _;e[44]!==S||e[45]!==v?(_=t.jsxs("div",{className:"space-y-2",children:[S,v]}),e[44]=S,e[45]=v,e[46]=_):_=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=a=>be(a),e[47]=ee):ee=e[47];let te;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx(xe,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[48]=te):te=e[48];let T;e[49]!==o?(T=o("sandbox.bulkCategoryPanel.modeAddTitle"),e[49]=o,e[50]=T):T=e[50];let w;e[51]!==T?(w=t.jsx("span",{className:"block text-sm font-medium",children:T}),e[51]=T,e[52]=w):w=e[52];let B;e[53]!==o?(B=o("sandbox.bulkCategoryPanel.modeAddDescription"),e[53]=o,e[54]=B):B=e[54];let R;e[55]!==B?(R=t.jsx("span",{className:"block text-xs text-muted-foreground",children:B}),e[55]=B,e[56]=R):R=e[56];let z;e[57]!==w||e[58]!==R?(z=t.jsxs(ce,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[te,t.jsxs("span",{className:"space-y-0.5",children:[w,R]})]}),e[57]=w,e[58]=R,e[59]=z):z=e[59];let oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(xe,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[60]=oe):oe=e[60];let E;e[61]!==o?(E=o("sandbox.bulkCategoryPanel.modeReplaceTitle"),e[61]=o,e[62]=E):E=e[62];let L;e[63]!==E?(L=t.jsx("span",{className:"block text-sm font-medium",children:E}),e[63]=E,e[64]=L):L=e[64];let A;e[65]!==o?(A=o("sandbox.bulkCategoryPanel.modeReplaceDescription"),e[65]=o,e[66]=A):A=e[66];let F;e[67]!==A?(F=t.jsx("span",{className:"block text-xs text-muted-foreground",children:A}),e[67]=A,e[68]=F):F=e[68];let M;e[69]!==L||e[70]!==F?(M=t.jsxs(ce,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[oe,t.jsxs("span",{className:"space-y-0.5",children:[L,F]})]}),e[69]=L,e[70]=F,e[71]=M):M=e[71];let V;e[72]!==n||e[73]!==z||e[74]!==M?(V=t.jsxs(Se,{value:n,onValueChange:ee,className:"gap-2",children:[z,M]}),e[72]=n,e[73]=z,e[74]=M,e[75]=V):V=e[75];let $;e[76]!==o?($=o("sandbox.bulkCategoryPanel.cancelButton"),e[76]=o,e[77]=$):$=e[77];let D;e[78]!==s||e[79]!==p||e[80]!==$?(D=t.jsx(ne,{type:"button",variant:"outline",onClick:p,disabled:s,children:$}),e[78]=s,e[79]=p,e[80]=$,e[81]=D):D=e[81];const ae=!c||s||l===0;let G;e[82]!==n||e[83]!==re||e[84]!==c?(G=()=>c&&re(n,{name:c.name,slug:c.slug}),e[82]=n,e[83]=re,e[84]=c,e[85]=G):G=e[85];let I;e[86]!==s||e[87]!==o?(I=s?t.jsxs(t.Fragment,{children:[t.jsx(ye,{size:14,className:"animate-spin"}),o("sandbox.bulkCategoryPanel.updatingButton")]}):o("sandbox.bulkCategoryPanel.applyButton"),e[86]=s,e[87]=o,e[88]=I):I=e[88];let q;e[89]!==ae||e[90]!==G||e[91]!==I?(q=t.jsx(ne,{type:"button",disabled:ae,onClick:G,children:I}),e[89]=ae,e[90]=G,e[91]=I,e[92]=q):q=e[92];let W;e[93]!==D||e[94]!==q?(W=t.jsxs("div",{className:"flex justify-end gap-2",children:[D,q]}),e[93]=D,e[94]=q,e[95]=W):W=e[95];let H;e[96]!==_||e[97]!==V||e[98]!==W?(H=t.jsxs("div",{className:"mt-6 space-y-4",children:[_,V,W]}),e[96]=_,e[97]=V,e[98]=W,e[99]=H):H=e[99];let ie;e[100]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(ue,{size:16,className:"shrink-0 text-muted-foreground"}),e[100]=ie):ie=e[100];const pe=String(l);let J;e[101]!==o||e[102]!==pe?(J=o("sandbox.bulkCategoryPanel.selectedPostsLabel",{count:pe}),e[101]=o,e[102]=pe,e[103]=J):J=e[103];let K;e[104]!==J?(K=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[ie,t.jsx("span",{className:"text-sm",children:J})]}),e[104]=J,e[105]=K):K=e[105];let O;e[106]!==l||e[107]!==X||e[108]!==o?(O=l===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:o("sandbox.bulkCategoryPanel.noPostsSelectedMessage")}):t.jsx("ul",{className:"divide-y border-t bg-background",children:X.map(Re)}),e[106]=l,e[107]=X,e[108]=o,e[109]=O):O=e[109];let Q;e[110]!==K||e[111]!==O?(Q=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[K,O]}),e[110]=K,e[111]=O,e[112]=Q):Q=e[112];let U;e[113]!==N||e[114]!==C||e[115]!==H||e[116]!==Q?(U=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[N,C,H,Q]})}),e[113]=N,e[114]=C,e[115]=H,e[116]=Q,e[117]=U):U=e[117];let se;return e[118]!==j||e[119]!==U?(se=t.jsxs("div",{className:"flex h-full flex-col",children:[j,U]}),e[118]=j,e[119]=U,e[120]=se):se=e[120],se}function Re(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(ue,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function ze(i){return t.jsx(Be,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{ji as BulkCategoryPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Q,r as k,n as X,j as t,b as Y,B as I,k as Z,t as W}from"./index-DLiSt-zY.js";import{i as _}from"./XCircle-qOGRhnhp.js";import{b4 as K,B as U}from"./agent-icon-RO_lY7mQ.js";import{n as tt}from"./LinkExternal01-BYv4_-zq.js";import{A as ot,a as et,b as rt,c as it,d as st,e as at,f as nt,g as mt}from"./alert-dialog-B3eneGBp.js";import{I as H}from"./input-CY_6SiUS.js";import{L as J}from"./label-CIfNh86q.js";import{F as lt,R as pt,T as ct,an as dt,J as ut,V as A,_ as gt,ao as xt,W as ft}from"./index-CErG4sP_.js";import{c as ht,B as yt,a as bt}from"./block-document-DBAOy7rM.js";import{u as jt}from"./use-autosave-DzyEelZn.js";import{t as vt}from"./ChevronDown-Dm6QJQj5.js";import{a7 as Et,a8 as Nt,a9 as Ct}from"./automation-runs-CggJDo1C.js";import{s as j,E as St}from"./primitives-BAE6y0ZV.js";import"./AlertCircle-BckADFTN.js";import"./Tool01-kIIhzZhw.js";import"./ArrowUp-8tGgkrEO.js";import"./ArrowLeft-CA4nZ19l.js";import"./Tool02-xsTmH7TW.js";import"./TrendUp01-D54j7eRb.js";import"./ZapSquare-CGgQRKSq.js";import"./Users03-BH_DGEIm.js";import"./CheckCircle-Dh96WJYX.js";import"./Check-D4XLgaN4.js";import"./ChevronRight-Bbyr31or.js";import"./ChevronSelectorVertical-BUgf0an-.js";import"./ChevronUp-C7jPKNLf.js";import"./DotsVertical-CYMbIa1_.js";import"./Stars02-BC82QMl0.js";import"./UserSquare-DgUtDej9.js";import"./Copy01-BqCuDnjV.js";import"./CreditCard01-CALthygT.js";import"./Download01-C6mH6Z8f.js";import"./Settings02-DQ6Qx_Qo.js";import"./Eye-jMpQ7fBE.js";import"./FilterLines-4Qetm1ho.js";import"./Share07-Di11XO-1.js";import"./Globe01-CkxIxFjV.js";import"./Globe04-CWbZ_xf0.js";import"./SwitchHorizontal01-DJAL0oew.js";import"./HardDrive-DqrbzOlI.js";import"./Key01-CzBg_w_E.js";import"./LockUnlocked01-BssaZtDy.js";import"./LogOut01-CE6p7Q73.js";import"./Monitor01-DUnpXEZF.js";import"./Sun-CL5Lwimd.js";import"./Palette-zSvxc111.js";import"./Play-C9tlPC3I.js";import"./Plus-BBdbmkEC.js";import"./SearchLg-Bg0bWoci.js";import"./SearchMd-B5LTpCxn.js";import"./Shield01-FnU_LRxr.js";import"./Stars01-C8fjQPly.js";import"./Trash01-CISu7ukT.js";import"./Upload01-BBFWsedg.js";import"./User01-Da-P04pG.js";import"./Users01-CXfWV5oU.js";import"./XClose-DL2O4uTC.js";import"./Zap-DYtDBHNd.js";import"./chat-context-DzbskOkq.js";import"./tab-id-DrwxksV4.js";import"./dialog-CaTBZV_d.js";import"./hooks-BjFStmIb.js";import"./use-mcp-client-BsB3UQx0.js";import"./constants-_08zpzmT.js";import"./auth-DeQHSbj0.js";import"./decopilot-sse-pool-Cn3-H_-J.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DkibxhFn.js";import"./use-ai-providers-Ck06PFGE.js";import"./use-decopilot-events-DZOEgHZF.js";import"./use-organization-settings-WfyIMnA9.js";import"./spinner-Dpvz3p80.js";import"./drawer-CMaDObPV.js";import"./collection-search-TDcC3qnQ.js";import"./chart-B-JWflUf.js";import"./index-DXHENisy.js";import"./shell-layout-DEMtIHgw.js";import"./avatar-t8xMECgD.js";import"./required-auth-layout-v7tDA1sl.js";import"./use-org-sso-BhfC5bai.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./form-C1Z3Pgy9.js";import"./select-BwLC9-0c.js";import"./tabs-C49oMc7W.js";import"./toggle-group-DmafBxKV.js";import"./use-commerce-diagnostic-spCFF13q.js";import"./popover-lX6wGPom.js";import"./self-tool-result-BeRzbQuP.js";import"./integration-icon-CGhJSgDA.js";import"./extract-connection-data-DDL06q4h.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-cAUV3o-a.js";import"./authenticate-and-persist-oauth-DaDpqCGj.js";import"./mcp-oauth-DImoLDws.js";import"./track-Fq5TqDMp.js";import"./toolbar-BOPj8b0I.js";import"./github-repo-picker-CghdTD4a.js";import"./use-connection-r6ziU6lR.js";import"./use-mcp-tools-D7WtkO_a.js";import"./use-navigate-to-agent-D_YtZ8Nf.js";import"./reusable-new-chat-CouMjkYR.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-Dg2tFKYT.js";import"./use-registry-connections-WDHdHLId.js";import"./useInfiniteQuery-Tdf3vSzC.js";import"./use-infinite-scroll-DsDG7oFh.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BYMb5MM5.js";import"./connection-form-helpers-BiSqyE70.js";import"./collection-tabs-mTx4dyj7.js";import"./badge-3w-z2q_R.js";import"./useSuspenseInfiniteQuery-Dgd9ebpu.js";import"./command-BmhGhCGW.js";import"./index-DnfUq0Re.js";import"./use-clock-tick-anNRVc0o.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./select-model-DpD5UXaD.js";import"./checkbox-CTK-987j.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-B116B10c.js";import"./dropdown-menu-BRNNpXcy.js";import"./file-type-icon-C2ALTS96.js";import"./question-004-sINsf4GQ.js";import"./use-members-DZPpmeBy.js";import"./use-org-auth-client-CR2NXIGs.js";import"./use-status-sounds-IuSNJ3uy.js";import"./empty-state-Dx5RvteD.js";import"./types-7z_oxg9w.js";import"./use-file-configs-DGfh8vOd.js";import"./monaco-editor-ZUjofCql.js";import"./pt-BR-CLy76QW2.js";import"./switch-DBiih54-.js";import"./use-debounced-autosave-B4C2TeP_.js";import"./search-input-4YJ4nTbO.js";import"./index-k4eNrclM.js";import"./use-secrets-MMdltV8V.js";import"./AreaChart-D3FkaC6Z.js";import"./task-key-2XocQivt.js";import"./use-copy-BeCWcJQD.js";import"./use-tags-DN3Y1Fjc.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-BrFXzBSZ.js";import"./automation-list-row-GJXCE3Ep.js";import"./use-org-repo-syncs-B1gYKpB8.js";import"./table-BM3FdIaA.js";function wt(y){const o=Q.c(18),{icon:u,title:n,defaultOpen:v,children:g}=y,P=v===void 0?!1:v,[x,D]=k.useState(P);let m;o[0]!==u?(m=t.jsx(u,{size:15}),o[0]=u,o[1]=m):m=o[1];let r;o[2]!==n?(r=t.jsx("span",{className:"flex-1 text-left",children:n}),o[2]=n,o[3]=r):r=o[3];const a=x&&"rotate-180";let l;o[4]!==a?(l=X("transition-transform",a),o[4]=a,o[5]=l):l=o[5];let p;o[6]!==l?(p=t.jsx(vt,{size:15,className:l}),o[6]=l,o[7]=p):p=o[7];let i;o[8]!==m||o[9]!==r||o[10]!==p?(i=t.jsx(Et,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[m,r,p]})}),o[8]=m,o[9]=r,o[10]=p,o[11]=i):i=o[11];let c;o[12]!==g?(c=t.jsx(Nt,{className:"px-2 pt-4",children:g}),o[12]=g,o[13]=c):c=o[13];let f;return o[14]!==x||o[15]!==i||o[16]!==c?(f=t.jsxs(Ct,{open:x,onOpenChange:D,className:"mt-4",children:[i,c]}),o[14]=x,o[15]=i,o[16]=c,o[17]=f):f=o[17],f}function fr({orgSlug:y,virtualMcpId:o,branch:u,blockKey:n,block:v,decofile:g,meta:P,onManagePosts:x,onOpenPost:D,previewBaseUrl:m}){const r=Y(),a=lt({orgSlug:y,virtualMcpId:o,branch:u}),l=pt({orgSlug:y,virtualMcpId:o,branch:u}),p=ct(v,"categories"),[i,c,f]=jt(p,e=>{a.mutate({blockKey:n,data:A(n,"categories",e)})}),E=(e,w)=>c({...i,[e]:w}),T=ht({decofile:g,category:i,previewBaseUrl:m,draftPointer:l}),s=j(i.slug),[B,b]=k.useState(s),[d,N]=k.useState(null),[C,z]=k.useState(!1),F=s?dt(g).filter(e=>e.categorySlugs.includes(s)):[],S=F.length,M=e=>E("slug",e),V=async(e,w)=>{const G=j(i.name);z(!0);try{let h=0;for(const{key:O,payload:L}of gt(g,"posts")){const $=xt(L,e,{name:G,slug:w});$!==L&&(await a.mutateAsync({blockKey:O,data:A(O,"posts",ft($))}),h+=1)}const R={...i,slug:w};await a.mutateAsync({blockKey:n,data:A(n,"categories",R)}),f(R),W.success(h>0?r("sandbox.categoryEditor.renameSuccessWithPosts",{count:String(h)}):r("sandbox.categoryEditor.renameSuccessNoPosts")),N(null)}catch(h){b(e),N(null),W.error(h instanceof Error?h.message:r("sandbox.categoryEditor.renameFailed"))}finally{z(!1)}},q=()=>{const e=B.trim();if(e===s){B!==e&&b(e);return}if(!e){b(s);return}if(S===0){M(e);return}N({oldSlug:s,newSlug:e,count:S})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:j(i.name)||r("sandbox.categoryEditor.untitledCategory")}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(ut,{isPending:a.isPending,isError:a.isError}),T&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:r("sandbox.categoryEditor.previewTooltip"),onClick:()=>window.open(T,"_blank","noopener,noreferrer"),children:[t.jsx(tt,{size:14}),r("sandbox.categoryEditor.seeCategoryPreview")]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(St,{value:j(i.name),onChange:e=>E("name",e),placeholder:r("sandbox.categoryEditor.categoryNamePlaceholder"),className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(J,{htmlFor:"category-slug",children:r("sandbox.categoryEditor.slugLabel")}),t.jsx(H,{id:"category-slug",value:B,onChange:e=>b(e.target.value),onBlur:q,placeholder:r("sandbox.categoryEditor.slugPlaceholder"),className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(J,{htmlFor:"category-description",children:r("sandbox.categoryEditor.descriptionLabel")}),t.jsx(H,{id:"category-description",value:j(i.description),onChange:e=>E("description",e.target.value),placeholder:r("sandbox.categoryEditor.descriptionPlaceholder"),className:"h-10"})]}),t.jsx(wt,{icon:K,title:r("sandbox.categoryEditor.contentTitle"),defaultOpen:!0,children:t.jsx(yt,{value:bt(i.sections),onChange:e=>E("sections",e),meta:P,sandboxRef:{orgSlug:y,virtualMcpId:o,branch:u},emptyMessage:r("sandbox.categoryEditor.noContentEmpty")})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(U,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:r("sandbox.categoryEditor.postsInCategory",{count:String(S)})})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!s,title:r(s?"sandbox.categoryEditor.pickPostsTooltip":"sandbox.categoryEditor.setSlugTooltip"),onClick:()=>x(s),children:[r("sandbox.categoryEditor.addPostsButton"),t.jsx(_,{size:14})]})]}),S>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:F.map(e=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(e.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(U,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:e.title||r("sandbox.categoryEditor.untitledPost")}),e.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:e.slug})]})]})},e.key))})]})]})})]}),t.jsx(ot,{open:!!d,onOpenChange:e=>{e||C||(b(s),N(null))},children:t.jsxs(et,{children:[t.jsxs(rt,{children:[t.jsx(it,{children:r("sandbox.categoryEditor.renameDialogTitle")}),t.jsx(st,{children:d?r("sandbox.categoryEditor.renameDialogDescription",{oldSlug:d.oldSlug,newSlug:d.newSlug,count:String(d.count)}):null})]}),t.jsxs(at,{children:[t.jsx(nt,{disabled:C,children:r("sandbox.categoryEditor.cancelButton")}),t.jsx(mt,{onClick:e=>{e.preventDefault(),d&&V(d.oldSlug,d.newSlug)},disabled:C,children:C?t.jsxs(t.Fragment,{children:[t.jsx(Z,{size:14,className:"animate-spin"}),r("sandbox.categoryEditor.renamingLabel")]}):r("sandbox.categoryEditor.renameActionButton")})]})]})})]})}export{fr as CategoryEditor};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{ak as S,al as C,ar as ee,am as i,an as he,aq as Ie,bl as Ce,de as It,bX as qe,bL as dt,c as le,a4 as ut,u as Ve,p as Be,H as te,K as pe,t as ue,R as ge,I as ye,d as pt,f as Mt,r as v,o as Tt,av as Ct,e as At,aQ as Pt,j as Me,b as De,a as _t,x as Rt,aw as Et,q as Dt}from"./index-DLiSt-zY.js";import{e as $t,t as Ut,A as ht,u as Ot,v as Lt,q as Nt,w as Ft}from"./tab-id-DrwxksV4.js";import{S as qt,s as jt,c as Ht,f as Vt,i as Bt,a as Kt}from"./hooks-BjFStmIb.js";import{u as Qt}from"./use-is-desktop-app-BNujXJc_.js";import{u as Wt}from"./use-mcp-client-BsB3UQx0.js";import{a as zt,S as Gt}from"./constants-_08zpzmT.js";import{a as Xt}from"./use-virtual-mcp-DkibxhFn.js";import{u as mt,p as Zt,b as xe,i as Yt,c as Jt}from"./use-ai-providers-Ck06PFGE.js";import{u as en}from"./use-decopilot-events-DZOEgHZF.js";import{c as tn}from"./use-organization-settings-WfyIMnA9.js";const we=S({connection_id:i().describe("Connection ID"),selected_tools:C(i()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:C(i()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:C(i()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),ft=we.extend({selected_tools:we.shape.selected_tools.optional(),selected_resources:we.shape.selected_resources.optional(),selected_prompts:we.shape.selected_prompts.optional()}),nn=S({connectionId:i(),toolName:i(),label:i(),icon:i().nullable().optional()}),sn=S({id:i().describe("Stable id; used as React key and ?tab= value"),title:i().describe("Tab label"),icon:i().optional().describe("Optional lucide icon name"),view:S({type:qe("ext-app"),appId:i(),args:Ie(i(),dt()).optional()})}),on=S({defaultMainView:S({type:i(),id:i().optional(),toolName:i().optional()}).nullable().optional(),chatDefaultOpen:ee().nullable().optional(),cmsDefaultOpen:ee().nullable().optional(),tabs:C(sn).optional()}),ot=S({tileId:i().optional(),connectionId:i().optional().describe("Connection that owns the resource — the host opens a direct MCP client to this connection so the iframe can call tools by their bare names."),resourceUri:i().describe("ui:// resource URI exposed by `connectionId`. Read on the home page and rendered via MCPAppRenderer."),toolName:i().optional().describe("Tool name — identifies which tool's inputSchema to display when editing tile props."),toolInput:Ie(i(),dt()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:Ce().int().positive().optional(),maxHeight:Ce().int().positive().optional()}),Ke=S({banner:i().nullable().optional(),bannerColor:i().nullable().optional(),icon:i().nullable().optional(),themeColor:i().nullable().optional(),pinnedViews:C(nn).nullable().optional(),layout:on.nullable().optional(),homeTile:ot.nullable().optional(),homeTiles:C(ot).nullable().optional(),homePrompts:C(i()).nullable().optional()});function fs(t){const e=t?.homeTiles;if(Array.isArray(e)&&e.length>0)return e;const n=t?.homeTile;return n?[n]:[]}const an=/^[A-Za-z_][A-Za-z0-9_]*$/,at=i().min(1).regex(an,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),rn=It("kind",[S({key:at,kind:qe("literal"),value:i()}),S({key:at,kind:qe("secret"),secretId:i().min(1)})]),ln=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/,cn=S({host:i().min(1).regex(ln).describe("Submodule host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:i().min(1).describe("Vault secret id holding the PAT used to fetch this host.")}),Qe=S({selected:i().nullable().optional().describe("User-selected package manager (npm | pnpm | yarn | bun | deno). Null/absent means autodetect on next SANDBOX_START."),port:i().nullable().optional().describe("User-selected dev server port as a string (allows '' / null for unset). Null/absent means autodetect."),path:i().nullable().optional().describe("Optional path (relative to repo root) to the directory containing package.json. Null/absent means repo root. Forwarded as `application.packageManager.path` to the daemon config."),env:C(rn).nullable().optional().describe("Env vars injected on every SANDBOX_START. Literal entries inline their value; secret entries store a secretId that Studio resolves via the credential vault before posting /_sandbox/config."),submoduleCredentials:C(cn).nullable().optional().describe("Git submodule credentials injected on every SANDBOX_START. Each entry maps a host to a vault secret (PAT) that Studio resolves before posting /_sandbox/config; the daemon uses it to authenticate `git submodule update` for submodules on that host.")}),We=S({url:i().describe("GitHub repository URL"),owner:i().describe("Repository owner"),name:i().describe("Repository name"),installationId:Ce().optional().describe("GitHub App installation ID. Absent when the repo was linked without a GitHub connection (public-clone mode)."),connectionId:i().optional().describe("ID of the mcp-github connection used for authentication. Absent for public repos cloned without credentials.")}),dn=he(["agent-sandbox","user-desktop"]),un=he(["agent-sandbox","user-desktop","cluster"]);function ze(t){return t==="cluster"?"agent-sandbox":t}const bt={sandboxHandle:i().describe("Provider-specific handle"),previewUrl:i().nullable().describe("URL where the sandbox's iframe-proxied UI is served, or null when the sandbox has no dev server (blank / tool sandboxes)."),sandboxApiUrl:i().nullable().optional().describe("Daemon's public URL — what cluster→daemon RPCs target. Equal to previewUrl for user-desktop; null/absent for the agent-sandbox provider (routes through hosted ingress)."),sandboxProviderKind:dn.optional(),createdAt:Ce().optional().describe("Epoch ms the entry was first written by SANDBOX_START. Used by the booting overlay to show a stable elapsed timer that survives browser reloads. Optional for backward compatibility with entries written before this field existed."),startedWith:S({packageManager:i().nullable().optional().describe("metadata.runtime.selected at the time of SANDBOX_START"),port:i().nullable().optional().describe("metadata.runtime.port at the time of SANDBOX_START"),path:i().nullable().optional().describe("metadata.runtime.path at the time of SANDBOX_START")}).optional().describe("Snapshot of metadata.runtime fields (selected/port/path) used at SANDBOX_START. The Preview tab compares the live metadata.runtime against this to decide if a restart is required to apply changes.")},gt=S(bt),pn=S({...bt,sandboxProviderKind:un.optional()});function hn(t){const e=pn.parse(t);return gt.parse({...e,sandboxProviderKind:e.sandboxProviderKind?ze(e.sandboxProviderKind):void 0})}function bs(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const e=t,n={};for(const[s,o]of Object.entries(e)){if(!o||typeof o!="object"||s!=="cluster"&&s!=="agent-sandbox"&&s!=="user-desktop")continue;const a=ze(s);try{if(s==="cluster"&&n[a])continue;n[a]=hn(o)}catch{}}return n}const Ge=Ie(i().describe("userId"),Ie(i().describe("branch"),Ie(i().describe("sandboxProviderKind"),gt))),mn=S({id:i().describe("Stable identifier for this knowledge file"),name:i().describe("File name shown in the UI"),kind:he(["file","skill"]).optional().describe("'file' (a single document) or 'skill' (a Claude Code skill folder containing SKILL.md). Defaults to 'file'."),volume:i().describe("Org filesystem (Library) volume the file lives in"),path:i().describe("Path within the volume"),url:i().describe("Same-origin URL to read the file (display/download)"),contentType:i().nullable().optional().describe("MIME type, used to decide whether to inline the content"),size:Ce().nullable().optional().describe("File size in bytes"),addedAt:i().describe("ISO timestamp when the file was attached")}),Xe=C(mn).nullable().optional().describe("Files attached to the agent as reference knowledge. Surfaced in the system prompt: small text documents are inlined, others are listed as retrievable references."),fn=he(["smart","code-review","open"]),Ze=fn.nullable().optional().describe("Controls when this code agent's changes may be published directly vs. requiring PR review. 'smart' (default) uses AI to judge per change; 'code-review' requires review for any code; 'open' allows direct publish always."),Ye=ee().nullable().optional().describe("Enable Fast Preview (sandbox-less): render the draft instantly on the preview server's own page via a ?__draft pointer, with reads/writes served by the decofile API against GitHub. Requires previewServerUrl (or legacy productionUrl) to be set to take effect."),Je=i().nullable().optional().describe("Preview server URL — the deployment the CMS preview renders against (often the live site, e.g. https://acme.com). Painted in the preview iframe, and the render target for Fast Preview drafts. Supersedes the legacy productionUrl key."),gs=S({id:i().describe("Unique identifier"),title:i().describe("Human-readable name"),description:i().nullable().describe("Description"),icon:i().nullable().describe("Icon URL"),created_at:i().describe("Creation timestamp"),updated_at:i().describe("Last update timestamp"),created_by:i().describe("User ID who created this item"),updated_by:i().optional().describe("User ID who last updated this item"),organization_id:i().describe("Organization ID this item belongs to"),status:he(["active","inactive"]).describe("Current status"),pinned:ee().describe("Whether this space is pinned to the sidebar"),metadata:S({instructions:i().nullable().describe("Instructions also used as system prompt"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Ke.nullable().optional().describe("UI customization settings"),githubRepo:We.nullable().optional().describe("Linked GitHub repository"),runtime:Qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ge.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Xe,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Ze,previewServerUrl:Je,productionUrl:i().nullable().optional().describe("Legacy key for previewServerUrl — still read as a fallback. New writes use previewServerUrl."),fieldDescriptionTooltips:ee().nullable().optional().describe("Blocks form: opt in to showing a field's schema description as a hover tooltip on its title, instead of the default inline text below the title."),fastPreview:Ye}).loose().describe("Metadata"),connections:C(we).describe("Connections with their selected tools, resources, and prompts")}),yt=S({title:i().min(1).max(120).describe("Short label shown on the chip"),description:i().max(280).optional().describe("One-line subtitle shown under the title"),text:i().min(1).describe("The message sent to the agent when the prompt is clicked")});S({title:i().min(1).max(255).describe("Name for the virtual MCP"),description:i().nullable().optional().describe("Optional description"),icon:i().nullish().describe("Optional icon URL"),status:he(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:ee().optional().default(!1).describe("Pin to sidebar"),metadata:S({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Ke.nullable().optional().describe("UI customization settings"),githubRepo:We.nullable().optional().describe("Linked GitHub repository"),runtime:Qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ge.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Xe,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Ze,previewServerUrl:Je,productionUrl:i().nullable().optional().describe("Legacy key for previewServerUrl — still read as a fallback. New writes use previewServerUrl."),fieldDescriptionTooltips:ee().nullable().optional().describe("Blocks form: opt in to showing a field's schema description as a hover tooltip on its title, instead of the default inline text below the title."),fastPreview:Ye}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(ft).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:C(yt).optional().describe("Optional kickstart prompts to seed on the agent. Each becomes a clickable conversation starter (icebreaker) on the agent. Author them from the agent's role and the tools it will have so they're coherent and immediately useful.")});S({title:i().min(1).max(255).optional().describe("New name"),description:i().nullable().optional().describe("New description (null to clear)"),icon:i().nullish().describe("New icon URL"),status:he(["active","inactive"]).optional().describe("New status"),pinned:ee().optional().describe("Pin/unpin from sidebar"),metadata:S({instructions:i().nullable().optional().describe("MCP server instructions"),enabled_plugins:C(i()).nullable().optional().describe("List of enabled plugin IDs"),subAgents:C(i()).nullable().optional().describe("Allowlist of Virtual MCP (agent) or concrete MCP connection IDs this agent may delegate to via subtask. Concrete connections create ephemeral subagents. null/absent = all active org targets; empty array = itself only."),liveAgentId:i().nullable().optional().describe("ID of the live agent this (dev) agent develops. Set only on dev agents; powers the Develop/Live toggle. A dev agent is hidden from the sidebar (reached via the toggle on its live counterpart)."),ui:Ke.nullable().optional().describe("UI customization settings"),githubRepo:We.nullable().optional().describe("Linked GitHub repository"),runtime:Qe.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:Ge.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Xe,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:Ze,previewServerUrl:Je,productionUrl:i().nullable().optional().describe("Legacy key for previewServerUrl — still read as a fallback. New writes use previewServerUrl."),fieldDescriptionTooltips:ee().nullable().optional().describe("Blocks form: opt in to showing a field's schema description as a hover tooltip on its title, instead of the default inline text below the title."),fastPreview:Ye}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(ft).optional().describe("New connections (replaces existing)"),prompts:C(yt).optional().describe("Replace the agent's kickstart prompts with this full set. Omit to leave them unchanged; pass an empty array to remove all. Each becomes a clickable conversation starter (icebreaker).")});function bn(t,e=[]){return t==="stop"?"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const je={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"},"opencode-desktop":{harness:"opencode",sandbox:"user-desktop"}};function gn(t,e){if(!t)return null;const n=e?ze(e):null;if(t==="decopilot"&&(n===null||n==="user-desktop"))return"decopilot";for(const[s,o]of Object.entries(je))if(o.harness===t&&o.sandbox===n)return s;return null}function yn({pendingOption:t,lockedHarness:e}){return e==="claude-code"?"claude-code-desktop":e==="codex"?"codex-desktop":e==="opencode"?"opencode-desktop":t==="claude-code-desktop"||t==="codex-desktop"||t==="opencode-desktop"?t:null}function vn(t){return t.thread?.harness_id!=null?{}:{harnessId:"decopilot",sandboxProviderKind:"agent-sandbox",branch:t.globals.branch??null}}const Sn="home",kn=new Set(["output","upload","public","home"]),xn=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function ys(t){return kn.has(t)||!xn.test(t)?"home":t}function wn(t){const e=t?t.split("/").filter(Boolean):[],n=e[0]==="public",s=n?e[1]??null:null,o=n?s?`public-${s}`:null:e[0]??null,a=(n?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:o,dirPath:a,isPublic:n,publicSet:s,readOnly:n,isHomeRoot:o===Sn&&a===""}}function vs(t){return t==="public"?"skills":t}function Ss(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const it="public-";function vt(t){return t.startsWith(it)?t.slice(it.length):null}function ks(t,e){const n=vt(t);return n?`public/${n}/${e}`:`${t}/${e}`}function In(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function Mn(t){const{volume:e,dirPath:n}=wn(t);if(!e)return null;let s;if(e==="home")s="org/home";else if(e==="outputs")s="org/.outputs";else if(e==="uploads")s="org/.uploads";else{const o=vt(e);s=o?`org/public/${o}`:`org/${e}`}return n?`${s}/${n}`:s}function Tn(t){const e=le.c(21);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=ut(n);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const a=Ve(o);let l;e[2]!==a.brand||e[3]!==a.main||e[4]!==a.preview||e[5]!==a.skill?(l=(typeof a.main=="string"?$t(a.main)?.path:void 0)??a.preview??a.skill??a.brand??null,e[2]=a.brand,e[3]=a.main,e[4]=a.preview,e[5]=a.skill,e[6]=l):l=e[6];const c=l;let h;if(e[7]!==s?.params.appSlug||e[8]!==s?.params.collectionName||e[9]!==s?.params.itemId||e[10]!==c||e[11]!==t){if(h=[],t&&h.push(`### Selected Agent
|
|
2
|
-
- ID: ${t}`),c){let f;e[13]!==c?(f=Mn(c),e[13]=c,e[14]=f):f=e[14];const k=f;let M;e[15]!==c?(M=In(c),e[15]=c,e[16]=M):M=e[16],h.push(`### Currently Open File
|
|
3
|
-
The user has this file open in the Library and is most likely referring to it:
|
|
4
|
-
- Name: ${M}
|
|
5
|
-
- Library path: ${c}${k?`
|
|
6
|
-
- Read/edit it with your file tools at: \`${k}\``:""}
|
|
7
|
-
|
|
8
|
-
When a request is ambiguous about which file or resource it targets (e.g. "change the h1", "fix this", "what's in this file", "update the title"), assume it means this file unless the user clearly indicates otherwise.`)}let m;e[17]!==s?.params.appSlug||e[18]!==s?.params.collectionName||e[19]!==s?.params.itemId?(m=[],s?.params.appSlug&&m.push(`- Connection ID: ${s?.params.appSlug}`),s?.params.collectionName&&m.push(`- Collection: ${s?.params.collectionName}`),s?.params.itemId&&m.push(`- Item ID: ${s?.params.itemId}`),e[17]=s?.params.appSlug,e[18]=s?.params.collectionName,e[19]=s?.params.itemId,e[20]=m):m=e[20],m.length>0&&h.push(`### Current Resource
|
|
9
|
-
The user is viewing the following resource:
|
|
10
|
-
${m.join(`
|
|
11
|
-
`)}
|
|
12
|
-
|
|
13
|
-
Help the user understand and work with this resource.`),e[7]=s?.params.appSlug,e[8]=s?.params.collectionName,e[9]=s?.params.itemId,e[10]=c,e[11]=t,e[12]=h}else h=e[12];return h.join(`
|
|
14
|
-
|
|
15
|
-
`)}function Cn(){const t=le.c(5),e=Be(),{org:n}=te();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const o=ut(s);let a;return t[1]!==o?.params||t[2]!==n||t[3]!==e?(a=l=>{const h=l.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!h||!h[1])return;const m=h[1],f=o?.params.appSlug;if(!f)return;e.invalidateQueries({queryKey:pe.collection(n.slug,f,m)});const k=m.toLowerCase().replace(/_/g," ");ue.success(`${k} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function An(){const t=le.c(4),{org:e,project:n}=te(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=ye.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=ge(o,Pn);let l;return t[2]!==a?(l={markTaskRead:h=>{a(m=>({...m,[h]:new Date().toISOString()}))}},t[2]=a,t[3]=l):l=t[3],l}function Pn(t){return t??{}}function St(){const t=pt(),{org:e}=te(),n=Ve({strict:!1}),s=Mt({strict:!1}),o=n.virtualmcpid??zt(e.id).id,a=(h,m)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:h},search:f=>{const k={},M=m?.virtualMcpId??f.virtualmcpid;M&&(k.virtualmcpid=M);const p=f.main;return p&&typeof p=="string"&&!Ut(p)&&(k.main=p),(f.sidepanel==="chat"||f.sidepanel===0)&&(k.sidepanel=f.sidepanel),m?.autosend&&(k.autosend=ht),k}})},l=v.useRef(crypto.randomUUID()),c=s.taskId??l.current;return{virtualMcpId:o,taskId:c,navigateToTask:a}}function _n(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const o=new TextDecoder().decode(Uint8Array.from(atob(s),a=>a.charCodeAt(0)));return[{type:"text",text:`${e}
|
|
16
|
-
${o}`}]}catch(o){console.error("Failed to decode text file:",o)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function rt(t,e){const n=[];for(const s of t)!s||typeof s!="object"||("text"in s&&s.text?n.push({type:"text",text:`[${e}]
|
|
17
|
-
${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)}));return n}function Rn(t,e){const n=(t.files??[]).filter(l=>l.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const o=n.map(l=>`<skill-file path="${l.relPath}">
|
|
18
|
-
${l.content.trim()}
|
|
19
|
-
</skill-file>`).join(`
|
|
20
|
-
|
|
21
|
-
`),a=s.length>0?`
|
|
22
|
-
|
|
23
|
-
Other files in \`${t.sandboxPath}/\`: ${s.join(", ")}`:"";return[{type:"text",text:`[${e}]
|
|
24
|
-
${o}${a}`}]}function En(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const o=Array.isArray(s.content)?s.content:[s.content];for(const a of o)switch(a.type){case"text":{const l=a.text?.trim();if(!l)continue;n.push({type:"text",text:`[${e}]
|
|
25
|
-
${l}`});break}case"image":case"audio":{if(!a.data||!a.mimeType)continue;n.push({type:"file",url:`data:${a.mimeType};base64,${a.data}`,mediaType:a.mimeType});break}case"resource":{const l=a.resource;if(!l||!l.mimeType)continue;l&&("text"in l&&l.text?n.push({type:"text",text:`[${e}]
|
|
26
|
-
${l.text}`}):"blob"in l&&l.blob&&l.mimeType&&n.push({type:"file",url:`data:${l.mimeType};base64,${l.blob}`,filename:String(l.uri),mediaType:String(l.mimeType)}));break}}}return n}function kt(t){if(!t)return[];const e=[];let n="";const s=o=>{if(o){if(o.type==="text"&&"text"in o&&typeof o.text=="string")n+=o.text;else if(o.type==="mention"&&o.attrs){const a=o.attrs.char??"/",l=`${a}${o.attrs.name}`;if(o.attrs.kind==="task"){const c=o.attrs.metadata,h=c?.title??o.attrs.name??"",m=c?.context?.trim()||[h,c?.description?.trim()].filter(Boolean).join(`
|
|
27
|
-
|
|
28
|
-
`);m&&e.push({type:"text",text:m});return}if(n+=l,a==="@"){const c=o.attrs.metadata;c&&typeof c=="object"&&!Array.isArray(c)&&"agentId"in c?e.push({type:"text",text:`[DELEGATE TO AGENT: ${c.title??o.attrs.name} (agent_id: ${c.agentId})]
|
|
29
|
-
Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(c)&&e.push(...rt(c,l))}else if(o.attrs.kind==="skill"){const c=o.attrs.metadata;c&&!Array.isArray(c)&&Array.isArray(c.files)&&e.push(...Rn(c,l))}else{const c=o.attrs.metadata||o.attrs.prompts||[];Array.isArray(c)&&c.length>0&&typeof c[0]=="object"&&c[0]!==null&&"role"in c[0]?e.push(...En(c,l)):Array.isArray(c)&&e.push(...rt(c,l))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,l=`[file:://${encodeURIComponent(a.name)}]`;n+=l,e.push(..._n(a,l))}if("content"in o&&Array.isArray(o.content))for(const a of o.content)s(a)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function xs(t){const e=kt(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function ws(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Dn(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function Is(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function $n(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Un(t,e){return t.filter(n=>n.messageId!==e)}const re=new Map,On=200;function Ln(t){if(re.size<On||re.has(t))return;const e=re.keys().next().value;if(e!==void 0){re.delete(e),$e.delete(e);for(const n of ve.keys())n.startsWith(`${e}:`)&&ve.delete(n)}}const $e=new Set;function Nn(t){$e.add(t)}function Fn(t){return $e.has(t)}function qn(t){$e.delete(t)}function Ae(t){const e=re.get(t);if(e)return re.delete(t),re.set(t,e),e;Ln(t);const n=new qt([]);return re.set(t,n),n}function xt(t,e){Ae(t).update(n=>$n(n,e))}function He(t,e){Ae(t).update(n=>Un(n,e))}function jn(t,e){Ae(t).set(e)}const ve=new Map;function Hn(t,e){ve.set(`${t}:${e.id}`,e)}function Vn(t,e){const n=`${t}:${e}`,s=ve.get(n);return ve.delete(n),s}function lt(t,e){ve.delete(`${t}:${e}`)}async function ie(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();jn(e,s.items??[])}catch{}}function Ms(t){const e=le.c(2);let n;e[0]!==t?(n=Ae(t),e[0]=t,e[1]=n):n=e[1];const s=n;return v.useSyncExternalStore(s.subscribe,s.get,s.get)}function Bn(){const{org:t}=te();return{enqueue:xt,refresh:e=>ie(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;He(e,n);try{const o=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!o.ok&&o.status!==404)throw new Error(`Cancel failed: ${o.status}`);return!0}catch(o){return ue.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await ie(t.slug,e)}}}}function Ee(t,e){return t.find(n=>n!=null&&e.has(n.keyId))??null}function Kn(t,e,n){const s=o=>Ee([o],n);return{tiers:{fast:Ee([e.tiers.fast,t.tiers.fast],n),smart:Ee([e.tiers.smart,t.tiers.smart],n),thinking:Ee([e.tiers.thinking,t.tiers.thinking],n),image:s(t.tiers.image),web_search:s(t.tiers.web_search),deep_research:s(t.tiers.deep_research)}}}const Te={tiers:{}};function Qn(){const t=le.c(7),{org:e}=te();let n;t[0]!==e.id?(n=pe.userModelPreferences(e.id),t[0]=e.id,t[1]=n):n=t[1];let s;t[2]!==e.slug?(s=async()=>{const a=await Pt(e.slug,"USER_MODEL_PREFERENCES_GET",{});return a?.tiers?a:Te},t[2]=e.slug,t[3]=s):s=t[3];let o;return t[4]!==n||t[5]!==s?(o={queryKey:n,queryFn:s,staleTime:6e4},t[4]=n,t[5]=s,t[6]=o):o=t[6],Tt(o)}function Wn(){return Qn().data??Te}function Ts(){const t=le.c(19),{org:e}=te(),n=Ct(),s=Be();let o;t[0]!==e.id?(o=pe.userModelPreferences(e.id),t[0]=e.id,t[1]=o):o=t[1];const a=o;let l;t[2]!==a||t[3]!==s||t[4]!==n?(l=async M=>{const p=s.getQueryData(a)??Te;return await n.call("USER_MODEL_PREFERENCES_UPDATE",p)??p},t[2]=a,t[3]=s,t[4]=n,t[5]=l):l=t[5];let c,h,m,f;t[6]!==a||t[7]!==s?(c=M=>{const{tier:p,slot:A}=M,q=s.getQueryData(a),j=q??Te;return s.setQueryData(a,{tiers:{...j.tiers,[p]:A}}),{prev:q}},h=(M,p,A)=>{s.setQueryData(a,A?.prev??Te)},m=M=>{s.setQueryData(a,M)},f=()=>{s.isMutating({mutationKey:a})===1&&s.invalidateQueries({queryKey:a})},t[6]=a,t[7]=s,t[8]=c,t[9]=h,t[10]=m,t[11]=f):(c=t[8],h=t[9],m=t[10],f=t[11]);let k;return t[12]!==a||t[13]!==l||t[14]!==c||t[15]!==h||t[16]!==m||t[17]!==f?(k={mutationKey:a,mutationFn:l,onMutate:c,onError:h,onSuccess:m,onSettled:f},t[12]=a,t[13]=l,t[14]=c,t[15]=h,t[16]=m,t[17]=f,t[18]=k):k=t[18],At(k)}function zn(){const t=le.c(4),e=tn(),n=Wn(),s=mt();let o;return t[0]!==s||t[1]!==e||t[2]!==n?(o=Kn(e,n,new Set(s.map(Gn))),t[0]=s,t[1]=e,t[2]=n,t[3]=o):o=t[3],o}function Gn(t){return t.id}function de(t,e,n,s){if(!t)return null;const o=e.find(l=>l.id===t.keyId);if(!o)return null;const a=n.find(l=>l.modelId===t.modelId);return a?{...a,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:o.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function Xn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Zn(t,e,n,s){if(!n||s.length===0)return null;const o=e.find(h=>h.id===n);if(!o)return null;const a=Zt([o],{[n]:s}),l=t==="fast"?a.chat.fast:t==="thinking"?a.chat.thinking:a.chat.smart;if(!l)return null;const c=s.find(h=>h.modelId===l.modelId);return c?{...c,keyId:n}:null}const ct=new Set,ae=new Set;function be(t){return v.useSyncExternalStore(t.subscribe,t.get,t.get)}function Yn(t){return t.kind==="loading"?"ready":t.kind}const Jn=1e4,es=10,et=v.createContext(null),tt=v.createContext(null),nt=v.createContext(null),wt=v.createContext(null);function ts({children:t}){const{locator:e}=te(),{virtualMcpId:n}=St(),[s,o]=ge(ye.chatSelectedImageModel(e),null),[a,l]=ge(ye.chatSelectedWebSearchModel(e),null),[c,h]=ge(ye.chatSelectedDeepResearchModel(e),null),[m,f]=v.useState(null),[k,M]=v.useState("default"),p=zn(),[A,q]=ge(ye.chatSimpleModeTier(e),null),j=Xn(A),x=mt(),T=p.tiers[j],H=x.some(r=>r.id===T?.keyId)?T?.keyId:void 0,W=m&&x.some(r=>r.id===m)?m:H??x[0]?.id??null,{models:V,isLoading:P}=xe(W??void 0),{models:G}=xe(H),L=x.some(r=>r.id===p.tiers.image?.keyId)?p.tiers.image?.keyId:void 0,{models:ne}=xe(L),B=x.some(r=>r.id===p.tiers.web_search?.keyId)?p.tiers.web_search?.keyId:void 0,{models:K}=xe(B),se=x.some(r=>r.id===p.tiers.deep_research?.keyId)?p.tiers.deep_research?.keyId:void 0,{models:Q}=xe(se),z=de(T,x,G,T?.title)??Zn(j,x,W,V),oe=P,X=V.filter(r=>r.capabilities?.includes("image")),b=de(s,x,X),D=de(p.tiers.image,x,ne,p.tiers.image?.title)??b??X[0]??null,N=V.filter(Yt),_=de(a,x,N),R=N.find(r=>r.modelId==="perplexity/sonar")??N[0]??null,Z=de(p.tiers.web_search,x,K,p.tiers.web_search?.title)??_??R,Y=V.filter(Jt),F=de(c,x,Y),Se=Y.find(r=>r.modelId==="perplexity/deep-research")??Y.find(r=>r.asyncResearch===!0)??Y[0]??null,Ue=de(p.tiers.deep_research,x,Q,p.tiers.deep_research?.title)??F??Se,Le=Xt(n)??{id:n,title:"",description:null,icon:null},[Pe,ke]=v.useState({}),_e=(r,g)=>{const O=[];for(const I of g.content??[])I.type==="text"&&I.text?.trim()&&O.push(I.text.trim());const E=O.join(`
|
|
30
|
-
`);if(!E){ce(r);return}new TextEncoder().encode(E).length>Jn||ke(I=>Object.keys(I).length>=es&&!(r in I)?I:{...I,[r]:E})},ce=r=>{ke(g=>{const{[r]:O,...E}=g;return E})},[Ne,Fe]=ge(ye.chatLastAgentOption(e),r=>r&&r in je?r:null),J=os(),st=J?.isThreadLocked&&J.lockedHarness!=null?gn(J.lockedHarness,J.lockedSandbox):null;yn({pendingOption:Ne,lockedHarness:J?.isThreadLocked?J.lockedHarness:null});const me=J?.isThreadLocked?st:"decopilot",Re=me?je[me]:null,d=Re?.harness??null,u=Re?.sandbox??null,[$,U]=v.useState(void 0),y=v.useRef($);y.current=$;const w={selectedModel:z,setModel:()=>{},credentialId:W,setCredentialId:f,allModelsConnections:x,isModelsLoading:oe,selectedVirtualMcp:Le,imageModel:D,setImageModel:r=>{o(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},webSearchModel:Z,setWebSearchModel:r=>{l(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},deepResearchModel:Ue,setDeepResearchModel:r=>{h(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},chatMode:k,setChatMode:M,appContexts:Pe,setAppContext:_e,clearAppContext:ce,tiptapDoc:$,setTiptapDoc:U,tiptapDocRef:y,resetInteraction:()=>{},simpleModeTier:j,setSimpleModeTier:r=>q(r),pendingAgentOption:me,setPendingAgentOption:Fe,pendingHarnessId:d,pendingSandboxProviderKind:u};return Me.jsx(nt.Provider,{value:w,children:t})}function Cs(t){const e=le.c(41),{virtualMcpId:n,task:s,children:o}=t,{locator:a}=te(),{data:l}=_t.useSession(),c=l?.user??null,{taskId:h,virtualMcpId:m,navigateToTask:f}=St(),[k]=Rt(),{markTaskRead:M}=An(),p=Kt(),A=h,q=m,j=Tn(q);let x;e[0]!==M||e[1]!==f?(x=(_,R)=>{M(_),f(_,{virtualMcpId:R?.virtualMcpId,autosend:R?.autosend})},e[0]=M,e[1]=f,e[2]=x):x=e[2];const T=x,H=A&&s?.id===A?s:null,W=H?.harness_id??null,V=H?.sandbox_provider_kind??null,P=H?.branch??null,G=W!=null,L=P;let ne;e[3]!==L||e[4]!==T||e[5]!==p||e[6]!==n?(ne=_=>{const R=crypto.randomUUID(),Z=_?.branch??L;return p.create({id:R,virtual_mcp_id:n,...Z?{branch:Z}:{},..._?.runtime?{runtime:_.runtime}:{}}).then(()=>T(R)).catch(()=>{T(R)}),R},e[3]=L,e[4]=T,e[5]=p,e[6]=n,e[7]=ne):ne=e[7];const B=ne;let K;e[8]!==L||e[9]!==a||e[10]!==T||e[11]!==p||e[12]!==n?(K=_=>{const R=crypto.randomUUID(),Z=_.virtualMcpId??n,Y=Z===n?L:null;Ft(sessionStorage,a,R,_.message),p.create({id:R,virtual_mcp_id:Z,...Y?{branch:Y}:{}}).then(()=>T(R,{virtualMcpId:_.virtualMcpId,autosend:!0})).catch(()=>{T(R,{virtualMcpId:_.virtualMcpId,autosend:!0})})},e[8]=L,e[9]=a,e[10]=T,e[11]=p,e[12]=n,e[13]=K):K=e[13];const se=K;let Q;e[14]!==A||e[15]!==p?(Q=_=>{A&&p.setBranch(A,_)},e[14]=A,e[15]=p,e[16]=Q):Q=e[16];let z;e[17]!==H||e[18]!==B||e[19]!==se||e[20]!==L||e[21]!==A||e[22]!==q||e[23]!==G||e[24]!==P||e[25]!==W||e[26]!==V||e[27]!==T||e[28]!==Q?(z={virtualMcpId:q,taskId:A,openTask:T,createTask:B,createTaskWithMessage:se,activeTask:H,isThreadLocked:G,lockedHarness:W,lockedSandbox:V,lockedBranch:P,currentBranch:L,setCurrentTaskBranch:Q},e[17]=H,e[18]=B,e[19]=se,e[20]=L,e[21]=A,e[22]=q,e[23]=G,e[24]=P,e[25]=W,e[26]=V,e[27]=T,e[28]=Q,e[29]=z):z=e[29];const oe=z;let X;e[30]!==j||e[31]!==k||e[32]!==f||e[33]!==c?(X={user:c,contextPrompt:j,preferences:k,rawNavigateToTask:f},e[30]=j,e[31]=k,e[32]=f,e[33]=c,e[34]=X):X=e[34];const b=X;let D;e[35]!==o||e[36]!==b?(D=Me.jsx(ts,{children:Me.jsx(wt.Provider,{value:b,children:o})}),e[35]=o,e[36]=b,e[37]=D):D=e[37];let N;return e[38]!==D||e[39]!==oe?(N=Me.jsx(tt.Provider,{value:oe,children:D}),e[38]=D,e[39]=oe,e[40]=N):N=e[40],N}function As({taskId:t,children:e}){const n=De(),s=Qt(),{virtualMcpId:o,activeTask:a,currentBranch:l}=ns(),c=jt({isDesktopApp:s,harnessId:a?.harness_id,sandboxProviderKind:a?.sandbox_provider_kind}),h=n("chat.input.codingAgentRequiresDesktop");t&&!ct.has(t)&&(ct.add(t),Dt("chat_opened",{thread_id:t}));const{imageModel:m,webSearchModel:f,deepResearchModel:k,chatMode:M,setChatMode:p,appContexts:A,setTiptapDoc:q,simpleModeTier:j}=ss(),x=v.useContext(wt);if(!x)throw new Error(n("chat.chatContext.activeTaskProviderMissingContext"));const{user:T,contextPrompt:H,preferences:W,rawNavigateToTask:V}=x,{org:P,locator:G}=te(),L=Bn(),[ne,B]=v.useState(null),K=()=>{B(new Error(h))},se=Cn(),Q=Be(),z=Ht(),oe=pt(),X=Wt({connectionId:Gt,orgId:P.id,orgSlug:P.slug}),b=Vt(P.slug,t,{client:X,batch:Bt(a?.harness_id)});v.use(b.ready);const D=be(b.messages),N=be(b.status),_=be(b.finishReason),R=be(b.runStatusStage),Z=be(b.hasMoreOlder),Y=be(b.isFetchingOlder),F=v.useRef({onToolCall:se,queryClient:Q,rawNavigateToTask:V,taskId:t,manager:z,navigate:oe,orgId:P.id,orgSlug:P.slug});F.current={onToolCall:se,queryClient:Q,rawNavigateToTask:V,taskId:t,manager:z,navigate:oe,orgId:P.id,orgSlug:P.slug},en({orgSlug:P.slug,taskId:t,onTaskStatus:d=>{const u=F.current,$=d.data.message_id;if(d.data.status==="in_progress"&&$){He(u.taskId,$);const U=Vn(u.taskId,$);U&&b.applyLocalMessage(U),ie(u.orgSlug,u.taskId)}Fn(u.taskId)&&(async()=>(await ie(u.orgSlug,u.taskId),await b.reconcileFromServer()&&Ae(u.taskId).get().length===0&&qn(u.taskId)))()}}),v.useEffect(()=>{const d={onData:y=>{if(y.type==="data-thread-title"){const w=y.data;if(!w?.title)return;const r=F.current;if(!r.taskId)return;r.manager.patchThread({id:r.taskId,title:w.title,updated_at:new Date().toISOString()});return}if(y.type==="data-deck-updated"){const w=y.data;if(!w?.path)return;const r=w.path,g=F.current;g.queryClient.invalidateQueries({queryKey:pe.orgFsStat(g.orgId,"home",r)}),g.queryClient.invalidateQueries({queryKey:pe.orgFsRecent(g.orgId)}),g.navigate({to:".",search:O=>({...O,main:Nt(r)}),replace:!0});return}if(y.type==="data-open-preview"){const w=y.data,r=F.current,g=r.taskId;if(g){const O=r.manager.threads.get().find(E=>E.id===g);r.manager.patchThread({id:g,...w?.branch?{branch:w.branch}:{},...w?.sandboxProviderKind?{sandbox_provider_kind:w.sandboxProviderKind}:{},metadata:{...O?.metadata??{},...w?.githubRepo?{githubRepo:w.githubRepo}:{},...w?.sandboxMap?{sandboxMap:w.sandboxMap}:{}}})}r.navigate({to:".",search:O=>({...O,main:"preview"}),replace:!0});return}},onFinish:(y,w,r)=>{const g=F.current;g.taskId&&ie(g.orgSlug,g.taskId),g.taskId&&g.manager.patchThread({id:g.taskId,status:bn(r,y.parts),updated_at:new Date().toISOString()});const O=y.parts?.some(I=>{const fe=I;return(fe.type==="tool-share_with_user"||fe.type==="tool-bash"||fe.type==="tool-write")&&fe.state==="output-available"});if(g.taskId&&O){const I=pe.threadOutputs(g.taskId);for(const fe of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{g.queryClient.invalidateQueries({queryKey:I})},fe)}g.queryClient.invalidateQueries({queryKey:pe.homeNextActions(g.orgSlug)});const E=y.metadata?.thread_id;E&&E!==g.taskId&&g.rawNavigateToTask(E)},onError:y=>{B(y),console.error("[chat] Error",y)},onToolCall:y=>F.current.onToolCall(y)};b.observer=d,ie(F.current.orgSlug,F.current.taskId);const u=y=>y==="submitted"||y==="streaming";let $=u(b.status.get().kind);const U=b.status.subscribe(()=>{const y=u(b.status.get().kind);if(y===$)return;$=y;const w=F.current;ie(w.orgSlug,w.taskId)});return()=>{b.observer===d&&(b.observer=null),U()}},[b]);const Se=N.kind==="submitted"||N.kind==="streaming",Ue=D.length===0,Oe=D.at(-1),Le=!Se&&Oe?.role==="assistant"&&Oe.parts.some(d=>"state"in d&&d.state==="approval-requested"),Pe=a,ke=(Pe?.status==="in_progress"||Pe?.status==="expired")&&N.kind==="ready"&&D.length>0;async function _e(d){const u=t,$=o;if(c)return K(),ae.delete(u),!1;const U=Object.entries(A),y=U.length>0?U.map(([E,I])=>`### App Context: ${E}
|
|
31
|
-
${I}`).join(`
|
|
32
|
-
|
|
33
|
-
`):"",w=[H,y].filter(Boolean).join(`
|
|
34
|
-
|
|
35
|
-
`);let r=M;r==="gen-image"&&!m&&(r="default"),r==="web-search"&&!f&&(r="default"),r==="deep-research"&&!k&&(r="default"),(r==="web-search"||r==="deep-research")&&p("default");const g=vn({thread:a?{harness_id:a.harness_id??null,sandbox_provider_kind:a.sandbox_provider_kind??null,branch:a.branch??null}:null,globals:{branch:l}});a?.harness_id||z.patchThread({id:u,harness_id:g.harnessId??"decopilot",updated_at:new Date().toISOString()});const O={tier:j,mode:r,toolApprovalLevel:W.toolApprovalLevel??Et(),system:w||void 0,agent:{id:$},thread_id:u,...g};try{if(Se||ke){let E=!0;try{Hn(u,d),await b.enqueue(d,O),xt(u,{workflowId:`thread-run:${u}:${d.id}`,messageId:d.id,text:Dn(d.parts),hasAttachments:d.parts.some(I=>I.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Nn(u)}catch(I){E=!1,lt(u,d.id),He(u,d.id),B(I instanceof Error?I:new Error(String(I))),ue.error(I instanceof Error?I.message:n("chat.chatContext.failedToQueueMessage"))}return ie(P.slug,u),E}return await b.submit({kind:"message",message:d},O),!0}finally{ae.delete(u)}}async function ce(d){const u=d.parts??kt(d.tiptapDoc);if(u.length===0||ae.has(t))return;ae.add(t),B(null),q(void 0);const $={tiptapDoc:d.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:T?.image??void 0,name:T?.name??"you"}},U={id:crypto.randomUUID(),role:"user",parts:u,metadata:$};await _e(U)}async function Ne(d,u){if(c)return K(),!1;if(ae.has(t))return ue.info(n("chat.chatContext.stillSendingPreviousMessage")),!1;if(ae.add(t),!await L.cancel(t,d))return ae.delete(t),ue.error(n("chat.chatContext.couldNotRemoveOriginalMessage")),!1;lt(t,d),b.removeLocalMessage(d);const U={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:u}],metadata:{created_at:new Date().toISOString(),user:{avatar:T?.image??void 0,name:T?.name??"you"}}};try{return await _e(U)}catch(y){return ue.error(y instanceof Error?y.message:n("chat.chatContext.failedToSendEditedMessage")),!1}}const Fe=async()=>{b.stop();try{const d=await fetch(`/api/${P.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(d.status===404)return;if(!d.ok){const u=await d.json().catch(()=>({}));throw new Error(u.message??n("chat.chatContext.cancelFailedStatus",{status:d.status}))}}catch(d){const u=d instanceof Error?d.message:n("chat.chatContext.failedToCancel");ue.error(u),console.error("[chat] cancelRun",d)}},J=d=>d&&typeof d=="object"&&"type"in d?ce({tiptapDoc:d}):ce(d),me=Ve({strict:!1}).autosend===ht;v.useEffect(()=>{if(!me||D.length>0||c)return;const d=Ot(sessionStorage,G,t);d&&ce(d.message).then(()=>{Lt(sessionStorage,G,t)})},[me,D.length,c,G,t,ce]);const Re={messages:D,status:Yn(N),sendMessage:J,editQueuedMessage:Ne,stop:()=>{if(c){K();return}Fe()},submit:async(d,u)=>{if(c){K();return}await b.submit(d,u)},removeLocalMessage:d=>b.removeLocalMessage(d),isSendInFlight:()=>ae.has(t),error:ne,clearError:()=>B(null),finishReason:_,runStatusStage:R,clearFinishReason:()=>b.finishReason.set(null),isStreaming:Se,isChatEmpty:Ue,isWaitingForApprovals:Le??!1,isRunInProgress:ke,hasMoreOlder:Z,isFetchingOlder:Y,fetchOlderMessages:b.fetchOlderMessages.bind(b)};return Me.jsx(et.Provider,{value:Re,children:e})}function Ps(){const t=De(),e=v.useContext(et);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function _s(){return v.useContext(et)}function ns(){const t=De(),e=v.useContext(tt);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function ss(){const t=De(),e=v.useContext(nt);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function Rs(){return v.useContext(nt)}function os(){return v.useContext(tt)}export{As as A,St as B,ts as C,Rs as D,an as E,Sn as H,ln as S,gs as V,Ps as a,os as b,ns as c,Ms as d,Bn as e,lt as f,Ee as g,Qn as h,Ts as i,zn as j,_s as k,Cs as l,ws as m,fs as n,kt as o,bs as p,wn as q,In as r,Is as s,xs as t,ss as u,vs as v,ys as w,Ss as x,vt as y,ks as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,j as t,B as K,k as oe,ak as Ge,am as re,b as W,E as Re,r as R,H as fe,bP as Xe,bQ as Ee,ao as Ze,n as Q,bR as et,u as tt,L as te,aa as st,ab as ye,a8 as we,a9 as Ce,t as lt,f as he,bS as Oe}from"./index-DLiSt-zY.js";import{E as ze}from"./empty-state-Dx5RvteD.js";import{u as ge}from"./use-mcp-client-BsB3UQx0.js";import{d as ae,F as ot,a as ce,b as de}from"./form-C1Z3Pgy9.js";import{I as pe}from"./input-CY_6SiUS.js";import{T as xe}from"./textarea-BYMb5MM5.js";import{a as nt,b as it,V as je,O as rt,M as at}from"./index-C-3fd8Ck.js";import{aP as ct,T as dt,aQ as mt,al as ut,an as pt,aR as xt,r as Ie}from"./agent-icon-RO_lY7mQ.js";import{g as ft,M as ht,a as $e}from"./types-7z_oxg9w.js";import{A as gt,a as jt,b as bt}from"./alert-DS_4c1g8.js";import{S as Te,a as Pe,b as ke,c as Ae,d as me}from"./select-BwLC9-0c.js";import{i as Nt}from"./AlertCircle-BckADFTN.js";import{s as vt}from"./Stars02-BC82QMl0.js";import{a as St}from"./Copy01-BqCuDnjV.js";import{i as yt}from"./Play-C9tlPC3I.js";import{i as wt}from"./ChevronRight-Bbyr31or.js";import{g as Ct}from"./connection-slug-eyAPH6o3.js";import{u as It,T as $t}from"./index-k4eNrclM.js";import{a as Fe,u as Me}from"./use-connection-r6ziU6lR.js";import{a as Tt}from"./use-mcp-tools-D7WtkO_a.js";import{M as Pt,c as kt}from"./monaco-editor-ZUjofCql.js";import{I as De}from"./integration-icon-CGhJSgDA.js";import{k as At,D as Dt}from"./chat-context-DzbskOkq.js";import{u as Rt}from"./shell-layout-DEMtIHgw.js";import{n as Et}from"./Tool02-xsTmH7TW.js";import"./constants-_08zpzmT.js";import"./auth-DeQHSbj0.js";import"./label-CIfNh86q.js";import"./Key01-CzBg_w_E.js";import"./extract-connection-data-DDL06q4h.js";import"./metadata-dUsYcpuu.js";import"./use-registry-connections-WDHdHLId.js";import"./use-organization-settings-WfyIMnA9.js";import"./Plus-BBdbmkEC.js";import"./index-DXHENisy.js";import"./index-DnfUq0Re.js";import"./popover-lX6wGPom.js";import"./use-virtual-mcp-DkibxhFn.js";import"./Check-D4XLgaN4.js";import"./SearchMd-B5LTpCxn.js";import"./Users03-BH_DGEIm.js";import"./use-create-virtual-mcp-CRJnDKdI.js";import"./use-navigate-to-agent-D_YtZ8Nf.js";import"./hooks-BjFStmIb.js";import"./decopilot-sse-pool-Cn3-H_-J.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-kIIhzZhw.js";import"./ArrowUp-8tGgkrEO.js";import"./ArrowLeft-CA4nZ19l.js";import"./XCircle-qOGRhnhp.js";import"./TrendUp01-D54j7eRb.js";import"./ZapSquare-CGgQRKSq.js";import"./CheckCircle-Dh96WJYX.js";import"./ChevronDown-Dm6QJQj5.js";import"./ChevronSelectorVertical-BUgf0an-.js";import"./ChevronUp-C7jPKNLf.js";import"./DotsVertical-CYMbIa1_.js";import"./UserSquare-DgUtDej9.js";import"./CreditCard01-CALthygT.js";import"./Download01-C6mH6Z8f.js";import"./Settings02-DQ6Qx_Qo.js";import"./Eye-jMpQ7fBE.js";import"./FilterLines-4Qetm1ho.js";import"./Share07-Di11XO-1.js";import"./Globe01-CkxIxFjV.js";import"./Globe04-CWbZ_xf0.js";import"./SwitchHorizontal01-DJAL0oew.js";import"./HardDrive-DqrbzOlI.js";import"./LinkExternal01-BYv4_-zq.js";import"./LockUnlocked01-BssaZtDy.js";import"./LogOut01-CE6p7Q73.js";import"./Monitor01-DUnpXEZF.js";import"./Sun-CL5Lwimd.js";import"./Palette-zSvxc111.js";import"./SearchLg-Bg0bWoci.js";import"./Shield01-FnU_LRxr.js";import"./Stars01-C8fjQPly.js";import"./Trash01-CISu7ukT.js";import"./Upload01-BBFWsedg.js";import"./User01-Da-P04pG.js";import"./Users01-CXfWV5oU.js";import"./XClose-DL2O4uTC.js";import"./Zap-DYtDBHNd.js";import"./badge-3w-z2q_R.js";import"./mcp-oauth-DImoLDws.js";import"./spinner-Dpvz3p80.js";import"./tab-id-DrwxksV4.js";import"./dialog-CaTBZV_d.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-Ck06PFGE.js";import"./use-decopilot-events-DZOEgHZF.js";import"./avatar-t8xMECgD.js";import"./required-auth-layout-v7tDA1sl.js";import"./use-org-sso-BhfC5bai.js";function Ot(s){const e=k.c(15),{onSave:n,onUndo:l,isDirty:o,isSaving:i,saveLabel:r,undoLabel:c}=s,d=r===void 0?"Save":r,a=c===void 0?"Undo":c;if(!o)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ct,{size:14}),e[0]=x):x=e[0];let h;e[1]!==i||e[2]!==l||e[3]!==a?(h=t.jsxs(K,{variant:"outline",size:"sm",onClick:l,disabled:i,"aria-label":a,children:[x,a]}),e[1]=i,e[2]=l,e[3]=a,e[4]=h):h=e[4];let m;e[5]!==i?(m=i?t.jsx(oe,{size:14,className:"animate-spin"}):t.jsx(dt,{size:14}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==n||e[9]!==d||e[10]!==m?(f=t.jsxs(K,{variant:"default",size:"sm",onClick:n,disabled:i,"aria-label":d,children:[m,d]}),e[7]=i,e[8]=n,e[9]=d,e[10]=m,e[11]=f):f=e[11];let p;return e[12]!==h||e[13]!==f?(p=t.jsxs(t.Fragment,{children:[h,f]}),e[12]=h,e[13]=f,e[14]=p):p=e[14],p}Ge({title:re().min(1),description:re().nullable(),body:re()});function ue(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function zt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(l=>l==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Ft(s){const e=k.c(43),{form:n}=s,l=W();let o;e[0]!==l?(o=l("details.prompt.details"),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==o?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==l?(r=w=>{const{field:N}=w;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:l("details.prompt.title")}),t.jsx(de,{children:t.jsx(pe,{...N,placeholder:l("details.prompt.titlePlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[4]=l,e[5]=r):r=e[5];let c;e[6]!==n.control||e[7]!==r?(c=t.jsx(ae,{control:n.control,name:"title",render:r}),e[6]=n.control,e[7]=r,e[8]=c):c=e[8];let d;e[9]!==l?(d=w=>{const{field:N}=w;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:l("details.prompt.description")}),t.jsx(de,{children:t.jsx(pe,{...N,value:N.value??"",placeholder:l("details.prompt.descriptionPlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[9]=l,e[10]=d):d=e[10];let a;e[11]!==n.control||e[12]!==d?(a=t.jsx(ae,{control:n.control,name:"description",render:d}),e[11]=n.control,e[12]=d,e[13]=a):a=e[13];let x;e[14]!==c||e[15]!==a?(x=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c,a]}),e[14]=c,e[15]=a,e[16]=x):x=e[16];let h;e[17]!==i||e[18]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-4",children:[i,x]}),e[17]=i,e[18]=x,e[19]=h):h=e[19];let m;e[20]!==l?(m=l("details.prompt.message"),e[20]=l,e[21]=m):m=e[21];let f;e[22]!==m?(f=t.jsx("div",{className:"text-sm font-medium text-foreground",children:m}),e[22]=m,e[23]=f):f=e[23];let p;e[24]!==l?(p=l("details.prompt.messageDescription"),e[24]=l,e[25]=p):p=e[25];let g;e[26]!==p?(g=t.jsx("div",{className:"text-xs text-muted-foreground",children:p}),e[26]=p,e[27]=g):g=e[27];let b;e[28]!==l?(b=w=>{const{field:N}=w;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(xe,{...N,value:N.value??"",placeholder:l("details.prompt.bodyPlaceholder"),className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})},e[28]=l,e[29]=b):b=e[29];let S;e[30]!==n.control||e[31]!==b?(S=t.jsx(ae,{control:n.control,name:"body",render:b}),e[30]=n.control,e[31]=b,e[32]=S):S=e[32];let T;e[33]!==f||e[34]!==g||e[35]!==S?(T=t.jsxs("div",{className:"flex flex-col gap-2",children:[f,g,S]}),e[33]=f,e[34]=g,e[35]=S,e[36]=T):T=e[36];let y;e[37]!==T||e[38]!==h?(y=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[h,T]}),e[37]=T,e[38]=h,e[39]=y):y=e[39];let P;return e[40]!==n||e[41]!==y?(P=t.jsx(ot,{...n,children:y}),e[40]=n,e[41]=y,e[42]=P):P=e[42],P}function Mt(s){const e=k.c(42),{providerId:n,promptId:l}=s,o=W(),{org:i}=fe(),r=n||null;let c;e[0]!==i.id||e[1]!==i.slug||e[2]!==r?(c={connectionId:r,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=r,e[3]=c):c=e[3];const d=ge(c),a=Xe(n,"PROMPT",l,d),x=Ee(n,"PROMPT",d),h=x.update.isPending;let m;e[4]!==a?(m=a?{title:a.title,description:a.description??null,body:ue(a)}:void 0,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==m?(f={values:m},e[6]=m,e[7]=f):f=e[7];const p=Ze(f);let g;e[8]!==p||e[9]!==a?(g=()=>{a&&p.reset({title:a.title,description:a.description??null,body:ue(a)})},e[8]=p,e[9]=a,e[10]=g):g=e[10];const b=g;let S;e[11]!==x.update||e[12]!==p||e[13]!==l?(S=p.handleSubmit(async C=>{const I=await x.update.mutateAsync({id:l,data:{title:C.title,description:C.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:C.body}}]}});p.reset({title:I.title,description:I.description??null,body:ue(I)})}),e[11]=x.update,e[12]=p,e[13]=l,e[14]=S):S=e[14];const T=S;if(!a){let C;e[15]!==o?(C=o("details.prompt.notFoundTitle"),e[15]=o,e[16]=C):C=e[16];let I;e[17]!==o?(I=o("details.prompt.notFoundDescription"),e[17]=o,e[18]=I):I=e[18];let O;return e[19]!==C||e[20]!==I?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ze,{title:C,description:I})}),e[19]=C,e[20]=I,e[21]=O):O=e[21],O}let y;e[22]!==a.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[22]=a.title,e[23]=y):y=e[23];let P;e[24]!==a.description?(P=a.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[24]=a.description,e[25]=P):P=e[25];let w;e[26]!==y||e[27]!==P?(w=t.jsx(it,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,P]})}),e[26]=y,e[27]=P,e[28]=w):w=e[28];let N;e[29]!==T?(N=()=>{T()},e[29]=T,e[30]=N):N=e[30];let A;e[31]!==p.formState.isDirty||e[32]!==h||e[33]!==b||e[34]!==N?(A=t.jsx(nt,{children:t.jsx(Ot,{onSave:N,onUndo:b,isDirty:p.formState.isDirty,isSaving:h})}),e[31]=p.formState.isDirty,e[32]=h,e[33]=b,e[34]=N,e[35]=A):A=e[35];let D;e[36]!==p?(D=t.jsx("div",{className:"h-full",children:t.jsx(Ft,{form:p})}),e[36]=p,e[37]=D):D=e[37];let E;return e[38]!==A||e[39]!==D||e[40]!==w?(E=t.jsxs(je,{children:[w,A,D]}),e[38]=A,e[39]=D,e[40]=w,e[41]=E):E=e[41],E}function Lt(s){const e=k.c(10),{itemId:n}=s,l=W();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=zt(),e[0]=o):o=e[0];const i=o;if(!i){let c;e[1]!==l?(c=l("details.prompt.notFoundTitle"),e[1]=l,e[2]=c):c=e[2];let d;e[3]!==l?(d=l("details.prompt.missingConnectionDescription"),e[3]=l,e[4]=d):d=e[4];let a;return e[5]!==c||e[6]!==d?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ze,{title:c,description:d})}),e[5]=c,e[6]=d,e[7]=a):a=e[7],a}let r;return e[8]!==n?(r=t.jsx(Re,{children:t.jsx(R.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:i,promptId:n})})}),e[8]=n,e[9]=r):r=e[9],r}function Le(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=Q("min-w-0 overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function Be(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=Q("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("ol",{"data-slot":"breadcrumb-list",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function G(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=Q("inline-flex items-center gap-1.5 min-w-0",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("li",{"data-slot":"breadcrumb-item",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function se(s){const e=k.c(10);let n,l,o;e[0]!==s?({asChild:n,className:l,...o}=s,e[0]=s,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);const i=n?et:"a";let r;e[4]!==l?(r=Q("hover:text-foreground transition-colors truncate",l),e[4]=l,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==o||e[8]!==r?(c=t.jsx(i,{"data-slot":"breadcrumb-link",className:r,...o}),e[6]=i,e[7]=o,e[8]=r,e[9]=c):c=e[9],c}function Ue(s){const e=k.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=Q("text-foreground font-medium truncate",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function le(s){const e=k.c(12);let n,l,o;e[0]!==s?({children:n,className:l,...o}=s,e[0]=s,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);let i;e[4]!==l?(i=Q("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",l),e[4]=l,e[5]=i):i=e[5];let r;e[6]!==n?(r=n??t.jsx(wt,{}),e[6]=n,e[7]=r):r=e[7];let c;return e[8]!==o||e[9]!==i||e[10]!==r?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:i,...o,children:r}),e[8]=o,e[9]=i,e[10]=r,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=k.c(12),{toolName:n,connectionId:l,siblings:o,onSelectInstance:i,onBack:r}=s,c=W();let d;e[0]!==l?(d={connectionId:l},e[0]=l,e[1]=d):d=e[1];const a=It(d);if(!a.isAuthenticated){let m;return e[2]!==a.supportsOAuth||e[3]!==r||e[4]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?t.jsx(rt,{onAuthenticate:()=>r(),buttonText:c("details.tool.goBackToAuthenticate")}):t.jsx(at,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=r,e[4]=c,e[5]=m):m=e[5],m}const x=`${l}:${n}`;let h;return e[6]!==l||e[7]!==i||e[8]!==o||e[9]!==x||e[10]!==n?(h=t.jsx(Vt,{toolName:n,connectionId:l,siblings:o,onSelectInstance:i},x),e[6]=l,e[7]=i,e[8]=o,e[9]=x,e[10]=n,e[11]=h):h=e[11],h}function Vt({toolName:s,connectionId:e,siblings:n,onSelectInstance:l}){const o=W(),{replayId:i}=tt({strict:!1}),r=(()=>{if(!i)return null;const u=`replay-${i}`,j=sessionStorage.getItem(u);if(!j)return null;sessionStorage.removeItem(u);try{return JSON.parse(j)}catch{return null}})(),c=(()=>{if(!r)return null;const u={};for(const[j,$]of Object.entries(r))$!==null&&typeof $=="object"?u[j]=JSON.stringify($,null,2):u[j]=$;return u})(),[d,a]=R.useState(c??{}),[x,h]=R.useState(r?JSON.stringify(r,null,2):"{}"),[m,f]=R.useState(null),[p,g]=R.useState(null),[b,S]=R.useState(null),[T,y]=R.useState(null),[P,w]=R.useState(!1),[N,A]=R.useState(null),{org:D}=fe(),E=Fe(e),C=At(),I=Dt(),{openSidePanel:O}=Rt(),U=`${e}:${s}`,F=ge({connectionId:e,orgId:D.id,orgSlug:D.slug}),V=Tt({client:F}),v=V.data?.tools?.find(u=>u.name===s),z=ft(v?._meta),J=u=>{if(!C)return;const j=kt(u.content);j.content.length>0&&(O("chat"),C.sendMessage({tiptapDoc:j}))},[M,L]=R.useState("json"),[q,Y]=R.useState(!1);z&&!q&&(L("ui"),Y(!0));const _=v?.inputSchema?.properties,be=_?Object.keys(_):[],X=be.length>0,Z={};if(X&&v?.inputSchema?.properties)for(const u of be)Z[u]=v.inputSchema.required?.includes(u)?"":void 0;const ne=u=>Object.prototype.hasOwnProperty.call(d,u),Ve=async()=>{w(!0),y(null),f(null),g(null),S(null),A(null);const u=performance.now();try{if(!F)throw new Error("MCP client is not available");const j=X?{...Z,...d}:(()=>{const B=x.trim();if(!B)return{};const H=JSON.parse(B);if(H&&typeof H=="object")return H;throw new Error("Raw JSON input must be an object.")})();X&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([B,H])=>{if((H.type==="object"||H.type==="array")&&typeof j[B]=="string")try{j[B]=JSON.parse(j[B])}catch{}else if((H.type==="number"||H.type==="integer")&&typeof j[B]=="string"&&j[B]!==""){const Se=Number(j[B]);Number.isNaN(Se)||(j[B]=Se)}});const $=await F.callTool({name:s,arguments:j}),ee=$.structuredContent??$,Qe=performance.now(),We=Math.round(Qe-u);f(ee),g($),S(j);const Ye=JSON.stringify(ee),ve=new TextEncoder().encode(Ye).length;A({duration:`${We}ms`,bytes:`${ve} bytes`,tokens:`~${Math.ceil(ve/4)} tokens`,cost:"$0.0000"})}catch(j){const $=j instanceof Error?j.message:String(j);y($||"Unknown error occurred");const ee=performance.now();A({duration:`${Math.round(ee-u)}ms`})}finally{w(!1)}},ie=(u,j)=>{a($=>({...$,[u]:j}))},_e=()=>{f(null),g(null),S(null),y(null),A(null)},Je=v?.name??Bt(s),qe=t.jsx(Le,{children:t.jsxs(Be,{children:[t.jsx(G,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:D.slug},children:o("details.tool.connections")})})}),t.jsx(le,{}),E&&t.jsxs(t.Fragment,{children:[t.jsx(G,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:D.slug,appSlug:Ct(E)},search:{tab:"tools"},children:E.title})})}),t.jsx(le,{})]}),t.jsx(G,{children:t.jsx(Ue,{children:Je})})]})}),Ne=n.length>1&&t.jsxs(Te,{value:e,onValueChange:l,children:[t.jsx(Pe,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ke,{})}),t.jsx(Ae,{children:n.map(u=>t.jsx(me,{value:u.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(De,{icon:u.icon,name:u.title,size:"xs",className:"shrink-0"}),u.title]})},u.id))})]}),He=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:o("details.tool.parameters")}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," ",o("details.tool.required")]})]}),t.jsx("div",{className:"space-y-4",children:X&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([u,j])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[u,v.inputSchema?.required?.includes(u)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:j.type})]}),j.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:j.description}),j.type==="object"||j.type==="array"?t.jsx(xe,{className:"font-mono text-xs",value:ne(u)?d[u]??"":Z[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enterAsJson",{key:u}),rows:3}):j.type==="boolean"?t.jsxs(Te,{value:ne(u)?String(d[u]??""):"",onValueChange:$=>ie(u,$==="true"),children:[t.jsx(Pe,{children:t.jsx(ke,{placeholder:o("details.tool.selectTrueOrFalse")})}),t.jsxs(Ae,{children:[t.jsx(me,{value:"true",children:"true"}),t.jsx(me,{value:"false",children:"false"})]})]}):t.jsx(pe,{value:ne(u)?d[u]??"":Z[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enter",{key:u})})]},u)):v?.inputSchema&&!X?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:o("details.tool.rawJsonInput")}),t.jsx(xe,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:u=>h(u.target.value),placeholder:o("details.tool.rawJsonExample")})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o("details.tool.noParametersRequired")})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:P?t.jsxs(K,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:_e,children:[t.jsx(mt,{className:"h-3.5 w-3.5"}),o("details.tool.cancel")]}):t.jsxs(K,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ve,children:[t.jsx(yt,{className:"h-3.5 w-3.5 fill-current"}),o("details.tool.executeTool")]})})]}),Ke=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:o("details.tool.result")}),t.jsxs("div",{className:"flex items-center gap-3",children:[N&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(vt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.duration})]}),N.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ut,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.tokens})]}),N.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.bytes})]}),N.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:N.cost})})]}),z&&t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(K,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("ui"),children:t.jsx(xt,{size:14})})}),t.jsx(Ce,{children:o("details.tool.interactiveView")})]}),t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(K,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:o("details.tool.jsonView")})]})]})})]})]}),T&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(gt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Nt,{className:"h-4 w-4"}),t.jsx(jt,{className:"mb-0",children:o("details.tool.executionFailed")})]}),t.jsx(bt,{className:"text-xs text-destructive",children:T})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:z&&M==="ui"&&F?t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:o("details.tool.loadingApp")})]})}),children:t.jsx(ht,{resourceURI:z,toolInfo:v?{tool:v}:void 0,toolInput:b??void 0,toolResult:p??void 0,displayMode:"fullscreen",minHeight:$e.view.minHeight,maxHeight:$e.view.maxHeight,client:F,onMessage:J,onUpdateModelContext:u=>I?.setAppContext(U,u),onTeardown:()=>I?.clearAppContext(U),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(K,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),lt.success(o("details.tool.copiedToClipboard"))},children:t.jsx(St,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(Ie,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:o("details.tool.runToolToSeeResults")})]})})]});return t.jsx(je,{breadcrumb:qe,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(De,{icon:E?.icon||null,name:E?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[V.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):V.isLoading?t.jsx(oe,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:V.isSuccess?"ready":V.isLoading?"connecting":"error"})]}),t.jsx($t,{annotations:v?.annotations,_meta:v?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:Ne})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]}),n.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:o("details.tool.instance")}),Ne]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:He}),Ke]})})]})})}function _t(s){const e=k.c(20),{itemId:n,siblings:l,onBack:o}=s,i=W(),[r,c]=R.useState(l[0]?.id??"");let d;e[0]!==r||e[1]!==l?(d=l.find(f=>f.id===r)?.id??l[0]?.id??"",e[0]=r,e[1]=l,e[2]=d):d=e[2];const a=d;if(!Fe(a||void 0)||!a){let f;e[3]!==i?(f=i("details.tool.connectionNotFound"),e[3]=i,e[4]=f):f=e[4];let p;e[5]!==f?(p=t.jsx("h3",{className:"text-lg font-semibold",children:f}),e[5]=f,e[6]=p):p=e[6];let g;e[7]!==i?(g=i("details.tool.connectionNotFoundMessage"),e[7]=i,e[8]=g):g=e[8];let b;e[9]!==g?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[9]=g,e[10]=b):b=e[10];let S;return e[11]!==p||e[12]!==b?(S=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p,b]})}),e[11]=p,e[12]=b,e[13]=S):S=e[13],S}let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[14]=h):h=e[14];let m;return e[15]!==a||e[16]!==o||e[17]!==l||e[18]!==n?(m=t.jsx(R.Suspense,{fallback:h,children:t.jsx(Ut,{toolName:n,connectionId:a,siblings:l,onSelectInstance:c,onBack:o})}),e[15]=a,e[16]=o,e[17]=l,e[18]=n,e[19]=m):m=e[19],m}function Jt(s){const e=k.c(21),{icon:n,illustration:l,title:o,description:i,buttonProps:r,buttonComponent:c,className:d,children:a}=s;let x;e[0]!==d?(x=Q("flex flex-col items-center justify-center py-16 text-center",d),e[0]=d,e[1]=x):x=e[1];let h;e[2]!==n||e[3]!==l?(h=l?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:l}):n?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:n}):null,e[2]=n,e[3]=l,e[4]=h):h=e[4];let m;e[5]!==o?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o}),e[5]=o,e[6]=m):m=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[m,f]}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;e[12]!==c||e[13]!==r?(g=(c??r)&&t.jsx("div",{className:"mt-4",children:c??(r&&t.jsx(K,{size:"sm",className:Q(r?.className),...r}))}),e[12]=c,e[13]=r,e[14]=g):g=e[14];let b;return e[15]!==a||e[16]!==x||e[17]!==h||e[18]!==p||e[19]!==g?(b=t.jsxs("div",{className:x,children:[h,p,g,a]}),e[15]=a,e[16]=x,e[17]=h,e[18]=p,e[19]=g,e[20]=b):b=e[20],b}const qt={prompt:Lt};function Ht(){const s=k.c(9),e=Oe();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const l=he(n),o=decodeURIComponent(l.itemId);let i;s[1]!==l.appSlug?(i={slug:l.appSlug},s[1]=l.appSlug,s[2]=i):i=s[2];const r=Me(i);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const d=c,a=Kt;let x;return s[5]!==d||s[6]!==o||s[7]!==r?(x=t.jsx(_t,{itemId:o,siblings:r,onBack:d,onUpdate:a}),s[5]=d,s[6]=o,s[7]=r,s[8]=x):x=s[8],x}async function Kt(s){return Promise.resolve()}function Qt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Wt(){const s=k.c(52),e=Oe();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const l=he(n),o=W(),i=decodeURIComponent(l.collectionName),r=decodeURIComponent(l.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:a}=fe();let x;s[3]!==l.appSlug?(x={slug:l.appSlug},s[3]=l.appSlug,s[4]=x):x=s[4];const m=Me(x)[0]??null,f=m?.id??"",p=f||"no-connection",g=f??null;let b;s[5]!==a.id||s[6]!==a.slug||s[7]!==g?(b={connectionId:g,orgId:a.id,orgSlug:a.slug},s[5]=a.id,s[6]=a.slug,s[7]=g,s[8]=b):b=s[8];const S=ge(b),T=Ee(p,i,S);let y;s[9]!==T||s[10]!==r?(y=async _=>{r&&await T.update.mutateAsync({id:r,data:_})},s[9]=T,s[10]=r,s[11]=y):y=s[11];const P=y;let w;s[12]!==i?(w=i?.toLowerCase(),s[12]=i,s[13]=w):w=s[13];const N=w,A=N&&qt[N];let D;s[14]!==i?(D=Qt(i),s[14]=i,s[15]=D):D=s[15];const E=D;let C;s[16]!==a.slug?(C=t.jsx(G,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:a.slug},children:"Connections"})})}),s[16]=a.slug,s[17]=C):C=s[17];let I;s[18]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(le,{}),s[18]=I):I=s[18];let O;s[19]!==i||s[20]!==m||s[21]!==a.slug||s[22]!==l.appSlug?(O=m&&t.jsxs(t.Fragment,{children:[t.jsx(G,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:l.appSlug},search:{tab:i},children:m.title})})}),t.jsx(le,{})]}),s[19]=i,s[20]=m,s[21]=a.slug,s[22]=l.appSlug,s[23]=O):O=s[23];let U;s[24]!==E?(U=t.jsx(G,{children:t.jsx(Ue,{children:E})}),s[24]=E,s[25]=U):U=s[25];let F;s[26]!==O||s[27]!==U||s[28]!==C?(F=t.jsx(Le,{children:t.jsxs(Be,{children:[C,I,O,U]})}),s[26]=O,s[27]=U,s[28]=C,s[29]=F):F=s[29];const V=F;if(A){let _;return s[30]!==A||s[31]!==d||s[32]!==P||s[33]!==r?(_=t.jsx(A,{itemId:r,onBack:d,onUpdate:P}),s[30]=A,s[31]=d,s[32]=P,s[33]=r,s[34]=_):_=s[34],_}let v;s[35]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[35]=v):v=s[35];let z;s[36]!==o?(z=o("orgs.collectionDetail.noComponentDefinedTitle"),s[36]=o,s[37]=z):z=s[37];let J;s[38]!==o?(J=o("orgs.collectionDetail.noComponentDefinedDescription"),s[38]=o,s[39]=J):J=s[39];let M;s[40]!==o?(M=o("orgs.collectionDetail.goBackButton"),s[40]=o,s[41]=M):M=s[41];let L;s[42]!==d||s[43]!==M?(L={onClick:d,children:M},s[42]=d,s[43]=M,s[44]=L):L=s[44];let q;s[45]!==z||s[46]!==J||s[47]!==L?(q=t.jsx(Jt,{icon:v,title:z,description:J,buttonProps:L}),s[45]=z,s[46]=J,s[47]=L,s[48]=q):q=s[48];let Y;return s[49]!==V||s[50]!==q?(Y=t.jsx(je,{breadcrumb:V,children:q}),s[49]=V,s[50]=q,s[51]=Y):Y=s[51],Y}function Yt(){const s=k.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const n=he(e);if(decodeURIComponent(n.collectionName)==="tools"){let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ht,{}),s[1]=r):r=s[1],r}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{}),s[2]=i):i=s[2],i}function Ll(){const s=k.c(7),e=W();let n;s[0]!==e?(n=e("orgs.collectionDetail.loadingAriaLabel"),s[0]=e,s[1]=n):n=s[1];let l;s[2]!==n?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground","aria-label":n})}),s[2]=n,s[3]=l):l=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Yt,{}),s[4]=o):o=s[4];let i;return s[5]!==l?(i=t.jsx(Re,{children:t.jsx(R.Suspense,{fallback:l,children:o})}),s[5]=l,s[6]=i):i=s[6],i}export{Ll as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ak as be,aq as $e,bL as De,am as me,al as Oe,c as R,b as H,j as t,k as ve,B,r as Z,n as Ne,H as te,av as Me,z as ze,K as ae,d as se,aT as Ee,aV as ue,G as Ue,E as Re,f as Ve,bM as Fe,p as Le,ao as Be,ap as He,b1 as qe,b0 as Ge,a$ as Ke,aZ as Qe,a_ as Xe,t as Y}from"./index-DLiSt-zY.js";import{g as We}from"./extract-connection-data-DDL06q4h.js";import{E as Se}from"./empty-state-Dx5RvteD.js";import{E as Je,c as Ye,r as Ze,b as et,d as tt}from"./connection-form-helpers-BiSqyE70.js";import{c as st,S as nt,V as it}from"./index-C-3fd8Ck.js";import{u as ye,T as ot}from"./index-k4eNrclM.js";import{a as at}from"./use-members-DZPpmeBy.js";import{A as lt}from"./avatar-t8xMECgD.js";import{a as Ce,b as _e,u as rt}from"./use-connection-r6ziU6lR.js";import{u as we}from"./use-mcp-client-BsB3UQx0.js";import{a as ct}from"./use-mcp-tools-D7WtkO_a.js";import{b as dt,C as mt,a as ut,c as xt}from"./chart-B-JWflUf.js";import{i as pt,a as ft}from"./mcp-oauth-DImoLDws.js";import{I as le}from"./integration-icon-CGhJSgDA.js";import{s as ht}from"./Plus-BBdbmkEC.js";import{R as gt,S as jt,p as bt,aO as vt,s as ne,aC as Nt}from"./agent-icon-RO_lY7mQ.js";import{a as ke,s as St}from"./Settings02-DQ6Qx_Qo.js";import{s as ce}from"./Trash01-CISu7ukT.js";import{d as K,a as Q,e as X,b as L,c as W,f as yt,F as Ct}from"./form-C1Z3Pgy9.js";import{I as J}from"./input-CY_6SiUS.js";import{u as _t,D as wt}from"./use-delete-connection-Dkclv4mQ.js";import{c as kt,B as It,a as Tt,C as At}from"./monitoring-stats-row-CwawUUDQ.js";import{u as Pt}from"./use-virtual-mcp-DkibxhFn.js";import{i as Ie}from"./ChevronRight-Bbyr31or.js";import{a as Te}from"./Users03-BH_DGEIm.js";import{b as ie,c as $t,T as oe,a as Dt}from"./tabs-C49oMc7W.js";import{g as Ae}from"./connection-slug-eyAPH6o3.js";import{c as Ot}from"./Tool01-kIIhzZhw.js";import{g as de,M as Mt}from"./types-7z_oxg9w.js";import{C as zt}from"./collection-search-TDcC3qnQ.js";import{B as Et}from"./badge-3w-z2q_R.js";import{c as Ut,D as Rt,b as Vt,a as xe}from"./dropdown-menu-BRNNpXcy.js";import{S as pe,a as fe,b as he,c as ge,d as G}from"./select-BwLC9-0c.js";import{i as Ft}from"./CheckCircle-Dh96WJYX.js";import{t as Lt}from"./ChevronDown-Dm6QJQj5.js";import{n as Bt}from"./Tool02-xsTmH7TW.js";import{s as Ht}from"./XClose-DL2O4uTC.js";import{p as qt,i as Gt}from"./connection-DPcqqUpI.js";import"./metadata-dUsYcpuu.js";import"./constants-_08zpzmT.js";import"./Key01-CzBg_w_E.js";import"./auth-DeQHSbj0.js";import"./use-registry-connections-WDHdHLId.js";import"./use-organization-settings-WfyIMnA9.js";import"./index-DXHENisy.js";import"./index-DnfUq0Re.js";import"./popover-lX6wGPom.js";import"./Check-D4XLgaN4.js";import"./SearchMd-B5LTpCxn.js";import"./use-create-virtual-mcp-CRJnDKdI.js";import"./use-navigate-to-agent-D_YtZ8Nf.js";import"./hooks-BjFStmIb.js";import"./decopilot-sse-pool-Cn3-H_-J.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-jMpQ7fBE.js";import"./use-org-auth-client-CR2NXIGs.js";import"./User01-Da-P04pG.js";import"./AlertCircle-BckADFTN.js";import"./ArrowUp-8tGgkrEO.js";import"./ArrowLeft-CA4nZ19l.js";import"./XCircle-qOGRhnhp.js";import"./TrendUp01-D54j7eRb.js";import"./ZapSquare-CGgQRKSq.js";import"./ChevronSelectorVertical-BUgf0an-.js";import"./ChevronUp-C7jPKNLf.js";import"./DotsVertical-CYMbIa1_.js";import"./Stars02-BC82QMl0.js";import"./UserSquare-DgUtDej9.js";import"./Copy01-BqCuDnjV.js";import"./CreditCard01-CALthygT.js";import"./Download01-C6mH6Z8f.js";import"./FilterLines-4Qetm1ho.js";import"./Share07-Di11XO-1.js";import"./Globe01-CkxIxFjV.js";import"./Globe04-CWbZ_xf0.js";import"./SwitchHorizontal01-DJAL0oew.js";import"./HardDrive-DqrbzOlI.js";import"./LinkExternal01-BYv4_-zq.js";import"./LockUnlocked01-BssaZtDy.js";import"./LogOut01-CE6p7Q73.js";import"./Monitor01-DUnpXEZF.js";import"./Sun-CL5Lwimd.js";import"./Palette-zSvxc111.js";import"./Play-C9tlPC3I.js";import"./SearchLg-Bg0bWoci.js";import"./Shield01-FnU_LRxr.js";import"./Stars01-C8fjQPly.js";import"./Upload01-BBFWsedg.js";import"./Users01-CXfWV5oU.js";import"./Zap-DYtDBHNd.js";import"./label-CIfNh86q.js";import"./alert-dialog-B3eneGBp.js";import"./YAxis-DyE5fkIu.js";import"./AreaChart-D3FkaC6Z.js";const Kt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Qt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Kt}];function Xt(s){const e=R.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=H();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let N;e[7]!==n.title?(N=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=N):N=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==o?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=d,e[12]=o,e[13]=S):S=e[13];let b;e[14]!==N||e[15]!==S?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[N,S]}),e[14]=N,e[15]=S,e[16]=b):b=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==a||e[20]!==o?(y=d&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=d,e[19]=a,e[20]=o,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==o?(P=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(gt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(jt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=o,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==o?(_=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=_):_=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let j;e[44]!==o?(j=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==j?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":j,children:E}),e[47]=I,e[48]=v,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==b?(A=t.jsxs("div",{className:h,children:[g,b,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=b,e[60]=A):A=e[60],A}function Wt(s){const e=R.c(21),{instance:n,onConfigure:c}=s,a=H();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let m;e[10]!==a?(m=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=m):m=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ke,{size:13}),e[12]=p):p=e[12];let d;e[13]!==o||e[14]!==r||e[15]!==m?(d=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":m,children:p})}),e[13]=o,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Jt(s){const e=R.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,m=H();if(n.length===0)return null;let p;e[0]!==n.length||e[1]!==m?(p=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=p):p=e[2];let d;e[3]!==p?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:p}),e[3]=p,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{size:13,className:"animate-spin"}):t.jsx(ht,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==u?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[f,u]}),e[9]=r,e[10]=o,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let N;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Wt,{instance:P,onConfigure:c}),children:t.jsx(Xt,{instance:P,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},P.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],N=n.map(y),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=N}else N=e[22];let S;e[28]!==N?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:N}),e[28]=N,e[29]=S):S=e[29];let b;return e[30]!==g||e[31]!==S?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=b):b=e[32],b}function Yt(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=H(),l=Me(),o=es(a),{data:r}=ze({queryKey:ae.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),m=kt(r?.logs??[],o),p=m.data,d=m.totalCalls>0,f=Yt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(dt,{config:ts,className:"h-16 w-full",children:t.jsxs(It,{data:p,barCategoryGap:"4%",children:[t.jsx(mt,{content:t.jsx(ut,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(Tt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),f.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function is(s,e){return t.jsx(At,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=R.c(19),{connectionId:n}=s,c=H(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let m;e[4]!==a?(m=Zt.map(g=>t.jsx("button",{type:"button",onClick:()=>i(g.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===g.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:g.label},g.value)),e[4]=a,e[5]=m):m=e[5];let p;e[6]!==m?(p=t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==p?(d=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,p]}),e[8]=r,e[9]=p,e[10]=d):d=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{}),e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==l.id||e[14]!==a?(u=t.jsx(Z.Suspense,{fallback:f,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:a})}),e[12]=n,e[13]=l.id,e[14]=a,e[15]=u):u=e[15];let h;return e[16]!==d||e[17]!==u?(h=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[16]=d,e[17]=u,e[18]=h):h=e[18],h}function rs(s){const e=R.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Te,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let p;return e[11]!==i||e[12]!==o||e[13]!==r?(p=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,m]}),e[11]=i,e[12]=o,e[13]=r,e[14]=p):p=e[14],p}function cs(s){const e=R.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(rs,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function ds(s){const e=R.c(7),{connection:n}=s,{org:c}=te();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const i=Pt(a);if(!(i.length>0)){let m;return e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(t.Fragment,{}),e[2]=m):m=e[2],m}let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=o):o=e[3];let r;return e[4]!==c.slug||e[5]!==i?(r=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:i,org:c.slug})})]}),e[4]=c.slug,e[5]=i,e[6]=r):r=e[6],r}function ms(s){const e=R.c(35),{tools:n,connectionId:c,org:a}=s,i=H(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const m=we(r),p=Ce(c);let d;e[4]!==p||e[5]!==c?(d=p?Ae(p):c,e[4]=p,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,N,S,b;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==a?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=a,e[21]=T):T=e[21];const D=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=v):v=e[24],e[25]!==u||e[26]!==I?(b=t.jsx(zt,{value:u,onChange:h,placeholder:I,onKeyDown:v}),e[25]=u,e[26]=I,e[27]=b):b=e[27],g="flex-1 overflow-auto p-5",N=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(Ee,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Mt,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.annotations?.title??j.name}),t.jsx(ot,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=N,e[16]=S,e[17]=b}else g=e[14],N=e[15],S=e[16],b=e[17];let y;e[28]!==g||e[29]!==N?(y=t.jsx("div",{className:g,children:N}),e[28]=g,e[29]=N,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==b||e[33]!==y?(P=t.jsxs("div",{className:S,children:[b,y]}),e[31]=S,e[32]=b,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function re(s){const e=R.c(5),{label:n}=s,c=H();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function xs(s){const e=R.c(72),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s;let o;e[0]!==c?(o=c===void 0?[]:c,e[0]=c,e[1]=o):o=e[1];const r=o;let m;e[2]!==a?(m=a===void 0?[]:a,e[2]=a,e[3]=m):m=e[3];const p=m,d=H(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let N;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(N=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=N):N=e[11];const S=N;let b;e[12]!==i||e[13]!==l||e[14]!==n?(b=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=b):b=e[15];const y=b;if(n.length+r.length+p.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let q;e[20]!==d?(q=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=q):q=e[21];let F;e[22]!==q?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:q}),e[22]=q,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ie,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=M):M=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ie,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let v;e[41]!==I?(v=t.jsx(ie,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=v):v=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==v||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs($t,{variant:"underline",className:"gap-1",children:[_,M,D,v]})}),e[43]=M,e[44]=D,e[45]=v,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>S(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Ot,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let x;e[62]!==p?(x=p.length>0?p.map(ps):t.jsx(re,{label:"resources"}),e[62]=p,e[63]=x):x=e[63];let w;e[64]!==x?(w=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:x})}),e[64]=x,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Dt,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(bt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(le,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=H(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ue(),m=(()=>{if(typeof o!="string"||!o)return!1;try{const u=new URL(o);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?qt(e.connection_url):null;return d?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(K,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),p&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(K,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(Q,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Nt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(K,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(K,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(K,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(K,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(K,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:u.value??[],onChange:u.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(K,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ut,{children:[t.jsx(Rt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Et,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Lt,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(St,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(yt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Gt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(bs(c)){const l=vs(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Ns(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=H(),m=se({from:"/$org/settings/connections/$appSlug"}),p=Le(),d=_e(),{org:f}=te(),u=_t({onSuccess:()=>{o.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[N,S]=Z.useState(!1),b=ye({connectionId:e}),{data:y}=at(),P=y?.data?.members??[],$=h??s,_=P.find(x=>x.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||b.isAuthenticated,D={...s,tools:a},I=st(D,Qt),v=Be({resolver:He(Ye),values:je(h??s)}),j=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const w=v.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),v.reset(w)},z=()=>{v.reset(je(h??s))},k=async x=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await ft({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:x,data:{connection_token:O}});else try{await d.update.mutateAsync({id:x,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:x,data:{connection_token:O}})}else await d.update.mutateAsync({id:x,data:{connection_token:O}});const q=new URL(`/api/${f.slug}/mcp/${x}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(q.href,null)}),await p.invalidateQueries({queryKey:ae.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const x=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const O=await x.text();Y.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(x){console.error("Error removing OAuth token:",x),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(wt,{...u}),t.jsx(qe,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(Ge,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ke,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Qe,{className:"text-base",children:h?.title??s.title}),t.jsx(Xe,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(Ct,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(K,{control:v.control,name:"title",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...x})}),t.jsx(W,{})]})}),t.jsx(K,{control:v.control,name:"description",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...x,value:x.value||""})}),t.jsx(W,{})]})})]}),t.jsx(js,{form:v,connection:h??s,hasOAuthToken:b.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:b.supportsOAuth,isServerError:b.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=h??s;g(null),u.requestDelete(x)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const x=o[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Jt,{instances:o,onConfigure:x=>g(x),onAuthenticate:x=>k(x.id),onDelete:x=>u.requestDelete(x),onToggleStatus:async(x,w)=>{try{await d.update.mutateAsync({id:x.id,data:{status:w}}),Y.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:N,onAdd:async()=>{S(!0);try{const x=o[0]??s,w=x.title.replace(/\s*\(\d+\)\s*$/,""),O=o.length+1,C=`${w} (${O})`,V=We("conn");await d.create.mutateAsync({id:V,title:C,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const q=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await pt({url:q.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.c(52),e=H();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=Ve(a),{org:o}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const p=rt(m),d=p[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==u?(h={connectionId:u,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let N;s[8]!==g?(N={client:g},s[8]=g,s[9]=N):N=s[9];const{data:S}=ct(N);let b;if(s[10]!==d?.tools||s[11]!==f||s[12]!==p||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(p.length<=1){b=k;break e}const A=new Set,U=[],x=ks;for(const w of p){const O=w.id===f?k:x(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}b=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=p,s[13]=S,s[14]=b}else b=s[14];const y=b;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=xt(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Fe(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let j;s[25]!==v?(j=v.map(_s),s[25]=v,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let x;s[34]!==e?(x=e("details.connection.backButton"),s[34]=e,s[35]=x):x=s[35];let w;s[36]!==U||s[37]!==x?(w=t.jsx(B,{variant:"outline",onClick:U,children:x}),s[36]=U,s[37]=x,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==p?(z=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:p}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=p,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Re,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function Ni(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{Ni as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function o(r){const t=r?.trim();if(!t)return null;try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n.href}catch{return null}}function i(r){return o(r?.previewServerUrl)??o(r?.productionUrl)}function e(r){return r?.find(t=>t.production)?.domain??r?.[0]?.domain}function u(r){const t=r?.trim();if(!t)return null;const n=/^https?:\/\//i.test(t)?t:`https://${t}`;return o(n)}export{e as a,u as p,i as r,o as s};
|