decocms 4.177.3 → 4.178.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CT1Vda1-.js → AlertCircle-D9uHwqc5.js} +1 -1
- package/dist/client/assets/{AreaChart-CiJy3yHG.js → AreaChart-CY2qHV4A.js} +1 -1
- package/dist/client/assets/{ArrowUp-BW8m6yuk.js → ArrowUp-BQRm2Uv8.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CfZYO-uI.js → ArrowUpRight-G_nbl7UV.js} +1 -1
- package/dist/client/assets/{Check-DKSVtPgB.js → Check-vW8VHz1A.js} +1 -1
- package/dist/client/assets/{CheckCircle-B2Ham_Ku.js → CheckCircle-zK_N5rnF.js} +1 -1
- package/dist/client/assets/{ChevronDown-XduUmQT8.js → ChevronDown-CRQomgMu.js} +1 -1
- package/dist/client/assets/{ChevronRight-CNAPLLgl.js → ChevronRight-DBw4IM3u.js} +1 -1
- package/dist/client/assets/{ChevronUp-CmwEFUkY.js → ChevronUp-C7LOcCbv.js} +1 -1
- package/dist/client/assets/{Copy01-MHFArsKW.js → Copy01-BZCYA_Z8.js} +1 -1
- package/dist/client/assets/{CpuChip01-DaWYaD2O.js → CpuChip01-BL6nZGQL.js} +1 -1
- package/dist/client/assets/{DotsVertical-D7_z7rxq.js → DotsVertical-DsTEZRmy.js} +1 -1
- package/dist/client/assets/{Eye-C--UGYIN.js → Eye-BpFsiUbt.js} +1 -1
- package/dist/client/assets/{FilterLines-AuQ7dcpe.js → FilterLines-C6e0IQl3.js} +1 -1
- package/dist/client/assets/{HardDrive-GPfm6kn5.js → HardDrive-B9eBfVHX.js} +1 -1
- package/dist/client/assets/{Key01-B-2R1ZuS.js → Key01-DyU_3rXK.js} +1 -1
- package/dist/client/assets/{LayoutLeft-M_0PEtZB.js → LayoutLeft-Cjy0F7Hh.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CYlScGIe.js → LinkExternal01-UVIelwEK.js} +1 -1
- package/dist/client/assets/{LogOut01-BP509aaC.js → LogOut01-Bu5hEk6R.js} +1 -1
- package/dist/client/assets/{Monitor01-B_mbAV5l.js → Monitor01-DgPPHEkG.js} +1 -1
- package/dist/client/assets/{Palette-Dfz37bMR.js → Palette-XHPuDq0W.js} +1 -1
- package/dist/client/assets/{Play-CDYSljWl.js → Play-BDeCPGxr.js} +1 -1
- package/dist/client/assets/{Plus-B8Fp-uPP.js → Plus-BdE9rLDg.js} +1 -1
- package/dist/client/assets/{SearchLg-DSNE_kzb.js → SearchLg-DPjbe-vm.js} +1 -1
- package/dist/client/assets/{SearchMd-TCQIcUNv.js → SearchMd-DeN6UCjw.js} +1 -1
- package/dist/client/assets/{Settings02-DpOYWrho.js → Settings02-BWn_9YDz.js} +1 -1
- package/dist/client/assets/{Shield01-pA5IS0Gy.js → Shield01-YHDMy7Ys.js} +1 -1
- package/dist/client/assets/{Star01-DCrAYCg2.js → Star01-CSMbZxdJ.js} +1 -1
- package/dist/client/assets/{Stars01-CDw3ILjF.js → Stars01-DnDprhxC.js} +1 -1
- package/dist/client/assets/{Stars02-HqPdqjox.js → Stars02-CsbdD4K-.js} +1 -1
- package/dist/client/assets/{Sun-Bp4LoN0q.js → Sun-DJSkuVBf.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DbwoldJG.js → SwitchHorizontal01-B5P5nPgR.js} +1 -1
- package/dist/client/assets/{Tool01-DrekBx2F.js → Tool01-DLth5skg.js} +1 -1
- package/dist/client/assets/{Tool02-f4cggfek.js → Tool02-lzcjn4LG.js} +1 -1
- package/dist/client/assets/{Trash01-DrdtrRyV.js → Trash01-BtncXbAR.js} +1 -1
- package/dist/client/assets/{TrendUp01-BY9xhAkx.js → TrendUp01-C9p5DdqF.js} +1 -1
- package/dist/client/assets/{Upload01-MfdrmtQ1.js → Upload01-CBODYIfA.js} +1 -1
- package/dist/client/assets/{User01-BiNLMs3u.js → User01-DK9q3yXr.js} +1 -1
- package/dist/client/assets/{Users01-CUKHhGDQ.js → Users01-DUK0BQeb.js} +1 -1
- package/dist/client/assets/{Users03-Cubz8plF.js → Users03-Db_OQ233.js} +1 -1
- package/dist/client/assets/{X-Bio89LMx.js → X-BFvwTTQf.js} +1 -1
- package/dist/client/assets/{XCircle-BNbdsBJE.js → XCircle-DWCY-N7M.js} +1 -1
- package/dist/client/assets/{XClose-DfxPXTPd.js → XClose-DjcjRter.js} +1 -1
- package/dist/client/assets/{Zap-D8gG88Mb.js → Zap-BiBkZv_w.js} +1 -1
- package/dist/client/assets/{ZapSquare-B0F44YUx.js → ZapSquare-DhECgZ5U.js} +1 -1
- package/dist/client/assets/{access-gate-CUFvUhV3.js → access-gate-DoVvp_y_.js} +1 -1
- package/dist/client/assets/{add-section-modal-CzpujuNm.js → add-section-modal-DPuxd9Xd.js} +1 -1
- package/dist/client/assets/{agent-icon-6PN48eXB.js → agent-icon-CnahVhUu.js} +1 -1
- package/dist/client/assets/{agents-list-BFphIGX8.js → agents-list-BK0rLCav.js} +1 -1
- package/dist/client/assets/{ai-providers-wW6cQoBR.js → ai-providers-DnxGpZ-3.js} +1 -1
- package/dist/client/assets/{alert-Bl68LDwF.js → alert-BZ9HPSE4.js} +1 -1
- package/dist/client/assets/{alert-dialog-CkaJnSQD.js → alert-dialog-B8mUahQd.js} +1 -1
- package/dist/client/assets/app-editor-Tajbau1C.js +1 -0
- package/dist/client/assets/{auth-0oxc70vP.js → auth-Bk8ndSX6.js} +1 -1
- package/dist/client/assets/{auth-catchall-DaMbN32_.js → auth-catchall-DZNfjEKE.js} +1 -1
- package/dist/client/assets/{auth-entry-C4UEWOj1.js → auth-entry-BRdj8e3z.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BCLOWR-Z.js → auth-split-layout-DRXziakp.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CnnloxGX.js → authenticate-and-persist-oauth-Dqg0bcxT.js} +1 -1
- package/dist/client/assets/{automation-list-row-CtNuBGQb.js → automation-list-row-CWcRH7ir.js} +1 -1
- package/dist/client/assets/{automation-runs-D4o6uJsl.js → automation-runs-DtBsEs9z.js} +1 -1
- package/dist/client/assets/{automations-Db_pwYIk.js → automations-D44FGNJ2.js} +1 -1
- package/dist/client/assets/{avatar-nAUbnUE8.js → avatar-QaZaQJTp.js} +1 -1
- package/dist/client/assets/{badge-C7TPZgd1.js → badge-C821sRRK.js} +1 -1
- package/dist/client/assets/{block-document-BS9DfxSM.js → block-document-DaaoqSNh.js} +1 -1
- package/dist/client/assets/{brand-context-DjQrLdhf.js → brand-context-DAzeTivH.js} +1 -1
- package/dist/client/assets/{buckets-aldTCdtO.js → buckets-CeTA3qnx.js} +1 -1
- package/dist/client/assets/bulk-category-panel-XXG-hf3D.js +1 -0
- package/dist/client/assets/{calendar-DflxrfDH.js → calendar-B8ZpA7PZ.js} +1 -1
- package/dist/client/assets/{capability-load-error-DNoCiyAu.js → capability-load-error-piCoAFOy.js} +1 -1
- package/dist/client/assets/{card-CxST7PR_.js → card-Coe8qnj7.js} +1 -1
- package/dist/client/assets/category-editor-Cog_Pg0c.js +1 -0
- package/dist/client/assets/chat-context-BAAbS0PQ.js +35 -0
- package/dist/client/assets/{checkbox-OoJa9LkI.js → checkbox-EFHxWxXd.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BYKePOx3.js → cli-auth-success-XkWvi782.js} +1 -1
- package/dist/client/assets/collection-detail-DiSvxdhF.js +1 -0
- package/dist/client/assets/{collection-display-button-D6ypnnjp.js → collection-display-button-DDv8w1og.js} +1 -1
- package/dist/client/assets/{collection-search-BAdFeMaK.js → collection-search-6bjYSZRR.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B4I0-5WS.js → collection-table-wrapper-n36Uk4Ja.js} +1 -1
- package/dist/client/assets/{collection-tabs-BwVPtFSB.js → collection-tabs-6m1xviQW.js} +1 -1
- package/dist/client/assets/{command-DdkloL5q.js → command-BAn5knYL.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DRzY44TU.js → commerce-onboarding-B7YfZI5j.js} +1 -1
- package/dist/client/assets/{companions-core-CrqyIrvA.js → companions-core-ByhDYacE.js} +1 -1
- package/dist/client/assets/{connect-CSdc79Yf.js → connect-DfFomoRt.js} +1 -1
- package/dist/client/assets/{connection-Co_z0yly.js → connection-BjZ7UN9B.js} +1 -1
- package/dist/client/assets/{connection-card-DIyBBD3g.js → connection-card-BuhPAIW5.js} +1 -1
- package/dist/client/assets/connection-detail-4pw7e_yt.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CNpigz6y.js → connection-form-helpers-Bog8E7r4.js} +1 -1
- package/dist/client/assets/{connections-CCzyFU4r.js → connections-BcXmjH5m.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DxdJdhNu.js → decopilot-sse-pool-CoccSc9t.js} +1 -1
- package/dist/client/assets/{dialog-h-UdyNtv.js → dialog-BFI7aZZJ.js} +1 -1
- package/dist/client/assets/{domain-settings-PeAKTUu8.js → domain-settings-y6VsXuhq.js} +1 -1
- package/dist/client/assets/{drawer-EdmUkKNT.js → drawer-C6pZrMmk.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CPRYVx7l.js → dropdown-menu-C439GYXv.js} +1 -1
- package/dist/client/assets/{empty-state-owKXC3o8.js → empty-state-N39XgXjw.js} +1 -1
- package/dist/client/assets/{extract-connection-data-RBeNwZod.js → extract-connection-data-CusilIX5.js} +1 -1
- package/dist/client/assets/file-explorer-ChpX36nf.js +2 -0
- package/dist/client/assets/{form-DeWN8q_1.js → form-C9fxNHKw.js} +1 -1
- package/dist/client/assets/{general-9C5c-SSG.js → general-BcFUt1P1.js} +1 -1
- package/dist/client/assets/{github-repo-picker-o8v5oAL0.js → github-repo-picker-DTfFLFoE.js} +1 -1
- package/dist/client/assets/{hooks-Dk1fYF5C.js → hooks-DUyp9B2j.js} +1 -1
- package/dist/client/assets/index-1WLJw4ky.js +663 -0
- package/dist/client/assets/{index-CEdLDEAA.js → index-B3uS6cZp.js} +4 -4
- package/dist/client/assets/index-BYjC3p48.js +1 -0
- package/dist/client/assets/{index-BhH-15Yq.js → index-Bkb9DnXn.js} +1 -1
- package/dist/client/assets/{index-DIGPBsN_.js → index-CBXqZn2R.js} +1 -1
- package/dist/client/assets/{index-CyEg7Qqe.js → index-CCzooiz1.js} +1 -1
- package/dist/client/assets/{index-BJrgK5Rl.js → index-CWTb0cI4.js} +1 -1
- package/dist/client/assets/{index-DRptYtgv.js → index-CX_6qzhv.js} +1 -1
- package/dist/client/assets/{index-BXLlcUzd.js → index-D-G4Kqkf.js} +1 -1
- package/dist/client/assets/{index-CcxifCya.js → index-DTar_aIL.js} +12 -12
- package/dist/client/assets/{index-BbSeHWzc.js → index-n-NrDzRn.js} +1 -1
- package/dist/client/assets/{index-redirect-BB2wJbwu.js → index-redirect-MvEewwMS.js} +1 -1
- package/dist/client/assets/{index-ChdUcdcZ.js → index-vU795bnC.js} +1 -1
- package/dist/client/assets/{input-HNtx0Zqc.js → input-DWJcMub1.js} +1 -1
- package/dist/client/assets/{integration-icon-DZAQT7b4.js → integration-icon-BPgH2EG9.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-5pasrYWO.js → invite-member-dialog-BCuXxXUv.js} +1 -1
- package/dist/client/assets/{label-C_6cjt6L.js → label-D8M_1FwP.js} +1 -1
- package/dist/client/assets/{layout-BWRl2DCx.js → layout-roF64HrE.js} +1 -1
- package/dist/client/assets/{login-BzSIDTTG.js → login-Cq3WjdgM.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BMYIe3Z0.js → mcp-oauth-CnoYDVlY.js} +1 -1
- package/dist/client/assets/{members-D_xhEboE.js → members-CduR6gM2.js} +1 -1
- package/dist/client/assets/{monaco-editor-DxOyQFTd.js → monaco-editor-DajXliMA.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-tt2cqmHS.js → monitoring-stats-row-BQ8ZrXWD.js} +1 -1
- package/dist/client/assets/{multi-select-CCXbOb6R.js → multi-select-DnGTX_mr.js} +1 -1
- package/dist/client/assets/{oauth-callback-CinXezwD.js → oauth-callback-BP_6MoMZ.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DMHHoktI.js → oauth-callback-ai-provider-PKELOuBS.js} +1 -1
- package/dist/client/assets/{onboarding-CkdyFN-L.js → onboarding-Bu3TOYa_.js} +1 -1
- package/dist/client/assets/{org-layout-ByLjdA5Z.js → org-layout-Cm2_j50t.js} +1 -1
- package/dist/client/assets/{organization-choice-ohtrab3v.js → organization-choice-BteKkA1Q.js} +1 -1
- package/dist/client/assets/{orgs-C_Ce9CJ_.js → orgs-CUIRzX_y.js} +1 -1
- package/dist/client/assets/{page-seo-form-mldXZpSZ.js → page-seo-form-DngsnMu_.js} +1 -1
- package/dist/client/assets/{popover-aywGfvt3.js → popover-B8sBJjLQ.js} +1 -1
- package/dist/client/assets/post-editor-C70eLzlD.js +1 -0
- package/dist/client/assets/{primitives-DCrmJi5C.js → primitives-CvxB4KdQ.js} +1 -1
- package/dist/client/assets/{profile-CZXYKCT-.js → profile-NNFBSb8Q.js} +1 -1
- package/dist/client/assets/project-app-view-5evKFhYV.js +1 -0
- package/dist/client/assets/record-editor-B_g05x5s.js +1 -0
- package/dist/client/assets/redirect-editor-BZWo9ekm.js +1 -0
- package/dist/client/assets/registry-Dg4EdaRM.js +2 -0
- package/dist/client/assets/{registry-layout-BMBDLltQ.js → registry-layout-D2sH1Rwe.js} +1 -1
- package/dist/client/assets/{reports-CNZ3SSPS.js → reports-RVDe4dxc.js} +1 -1
- package/dist/client/assets/{require-capability-afXIMgbz.js → require-capability-CgZ9W600.js} +1 -1
- package/dist/client/assets/{required-auth-layout-A8YhZ8Bt.js → required-auth-layout-B680VyOo.js} +1 -1
- package/dist/client/assets/{reset-password-D-hJKScc.js → reset-password-BgsPziTi.js} +1 -1
- package/dist/client/assets/{roles-C-JFzbxO.js → roles-OQSHKa7X.js} +1 -1
- package/dist/client/assets/{search-input-Kzdqefxt.js → search-input-CuYQCCbZ.js} +1 -1
- package/dist/client/assets/{secrets-p2_l8RU0.js → secrets-Cn-rXrMq.js} +1 -1
- package/dist/client/assets/{sections-editor-BDYzTYXH.js → sections-editor-CUtiPloY.js} +1 -1
- package/dist/client/assets/{select-model-DXu1robt.js → select-model-C8BemsPZ.js} +1 -1
- package/dist/client/assets/{select-CS7LSkMB.js → select-zBSVIVGk.js} +1 -1
- package/dist/client/assets/{self-tool-result-BP7OTLhS.js → self-tool-result-DgRjsk_r.js} +1 -1
- package/dist/client/assets/seo-editor-DzghLWtc.js +1 -0
- package/dist/client/assets/{settings-layout-Rism6SPg.js → settings-layout-CNwOEAgS.js} +1 -1
- package/dist/client/assets/{settings-section-CymQlmfF.js → settings-section-6vfEIK-M.js} +1 -1
- package/dist/client/assets/{shell-controls-4cIGOW6R.js → shell-controls-DcO4yed-.js} +1 -1
- package/dist/client/assets/{shell-layout-IrSF4vBc.js → shell-layout-B1Yc-JiE.js} +1 -1
- package/dist/client/assets/{sidebar-CxqL3ymz.js → sidebar-C3YElpZU.js} +1 -1
- package/dist/client/assets/{skeleton-D6YbAWwm.js → skeleton-TF2QYozs.js} +1 -1
- package/dist/client/assets/{spinner-DlE_5plH.js → spinner-Dh1WfnLT.js} +1 -1
- package/dist/client/assets/{sso-Cxyj_V0_.js → sso-Dvx75pYe.js} +1 -1
- package/dist/client/assets/{store-o0fAPq6Y.js → store-CobFwluj.js} +1 -1
- package/dist/client/assets/store-registry-DG3-Udb_.js +2 -0
- package/dist/client/assets/{studio-tools-GPb7OAbs.js → studio-tools-C0zZJFiv.js} +1 -1
- package/dist/client/assets/{switch-LoEIjRNg.js → switch-B8KjR9g5.js} +1 -1
- package/dist/client/assets/{tab-id-BPlSueXP.js → tab-id-OVDUKaFL.js} +1 -1
- package/dist/client/assets/{table-yMd-ysMj.js → table-fd5LoZHv.js} +1 -1
- package/dist/client/assets/{tabs-BI5AKYPo.js → tabs-CF2Sd6RN.js} +1 -1
- package/dist/client/assets/{textarea-DCPrBM2_.js → textarea-CMxPtmQy.js} +1 -1
- package/dist/client/assets/{toggle-group-B1yWxSP3.js → toggle-group-BNPiQayN.js} +1 -1
- package/dist/client/assets/{toolbar-D-16WLmG.js → toolbar-DnIs0Kll.js} +1 -1
- package/dist/client/assets/{tooltip-D58aKtt6.js → tooltip-ChzhG7Wy.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CMg1asW3.js → use-ai-providers-CwDdRldm.js} +1 -1
- package/dist/client/assets/{use-automations-sK4gm0lB.js → use-automations-BRi5qCsV.js} +1 -1
- package/dist/client/assets/{use-autosave-aYVhSq_y.js → use-autosave-D4Q-SvL1.js} +1 -1
- package/dist/client/assets/{use-capability-uyk0FDWU.js → use-capability-BvC-xlOV.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CI08Mmp8.js → use-clock-tick-CtrwX3Sr.js} +1 -1
- package/dist/client/assets/{use-connection-DqlBxSxU.js → use-connection--sUGKZt-.js} +1 -1
- package/dist/client/assets/{use-copy-Dc2zEVVx.js → use-copy-DVlbAAZv.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-h29MWxLI.js → use-create-virtual-mcp-Bw-wrS5K.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D2OSHXg-.js → use-debounced-autosave-D3IvRCdG.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CXIGbeRl.js → use-debounced-value-sGmMvbGh.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BH2bg0UO.js → use-deco-credits-B7NeejYZ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CRPJ09kV.js → use-decopilot-events-s-p9dYXb.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BuY4wFY1.js → use-delete-connection-CFQ47p3j.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BD4nSSKS.js → use-deployment-admin-raFQIn_S.js} +1 -1
- package/dist/client/assets/{use-file-configs-DqAW69yO.js → use-file-configs-XzHtoQGT.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B6f2rvDK.js → use-infinite-scroll-CRFvcnKa.js} +1 -1
- package/dist/client/assets/{use-join-requests-C8ViZwEC.js → use-join-requests-CcPZOB8m.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CbH6VRGA.js → use-mcp-client-C1MRTBf0.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CvYorOot.js → use-mcp-tools-EvFbJLXD.js} +1 -1
- package/dist/client/assets/{use-members-Cc8G0stB.js → use-members-SNcHg3Ow.js} +1 -1
- package/dist/client/assets/{use-mobile-Ba5JGjny.js → use-mobile-kByb3NA-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-v_msuRK8.js → use-navigate-to-agent-BwvjTpfZ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-FK00uheF.js → use-org-auth-client-D6lf5Zov.js} +1 -1
- package/dist/client/assets/{use-org-sso-GGzUcbSy.js → use-org-sso-DMaw4WTV.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Dfmewvip.js → use-organization-roles-CvfyrSwF.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Dy5ifd9c.js → use-organization-settings-Vw44R_Ue.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BQ-qHpvw.js → use-registry-connections-Cs5bIgvX.js} +1 -1
- package/dist/client/assets/{use-secrets-C0VtSmLk.js → use-secrets-DUVjgF15.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CsGyaN7B.js → use-status-sounds-4gjAMVDH.js} +1 -1
- package/dist/client/assets/{use-tags-DeZcjykM.js → use-tags-D6XVXQUm.js} +1 -1
- package/dist/client/assets/{use-view-mode-CMLWq1e6.js → use-view-mode-1y76BoJ6.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Ffm9narY.js → use-virtual-mcp-C-OIBSH4.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CK3sFTpc.js +1 -0
- package/dist/client/assets/{useQueries-ChfVENok.js → useQueries-BTgQu1Ty.js} +1 -1
- package/dist/client/assets/{useRouterState-BlwG-7hZ.js → useRouterState-CVO1q44x.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BebDgnhn.js +1 -0
- package/dist/client/assets/{users-D-haqlfF.js → users-DT91YP2P.js} +1 -1
- package/dist/client/assets/{variant-calendar-rlagL8F_.js → variant-calendar-HUskyIcr.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D2auzotI.js → view-mode-toggle-CacpG1H2.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +410 -410
- package/dist/server/server.js +291 -291
- package/package.json +1 -1
- package/dist/client/assets/app-editor-BCUIlUTp.js +0 -1
- package/dist/client/assets/bulk-category-panel-CgNEdJEt.js +0 -1
- package/dist/client/assets/category-editor-D-E7RoFp.js +0 -1
- package/dist/client/assets/chat-context-DSVU-Wdj.js +0 -35
- package/dist/client/assets/collection-detail-yYKCr_Vv.js +0 -1
- package/dist/client/assets/connection-detail-CKvj3zRa.js +0 -1
- package/dist/client/assets/file-explorer-GtTsAxbY.js +0 -2
- package/dist/client/assets/index-DxLBfYsO.js +0 -663
- package/dist/client/assets/post-editor-a4D889ya.js +0 -1
- package/dist/client/assets/project-app-view-CUwf6Bwu.js +0 -1
- package/dist/client/assets/record-editor-DBuUMkKE.js +0 -1
- package/dist/client/assets/redirect-editor-CGamvm49.js +0 -1
- package/dist/client/assets/registry-Cz68uufJ.js +0 -2
- package/dist/client/assets/seo-editor-gi75UGhK.js +0 -1
- package/dist/client/assets/store-registry-DWYoU24n.js +0 -2
- package/dist/client/assets/use-mcp-auth-status-C-OW2Sh9.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CIdU8zaX.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CRyCnL_Q.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-CEdLDEAA.js";import{i as jt}from"./ChevronRight-CNAPLLgl.js";import{l as Bt}from"./automation-runs-D4o6uJsl.js";import{A as At}from"./add-section-modal-CzpujuNm.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-DxLBfYsO.js";import"./select-CS7LSkMB.js";import"./tooltip-D58aKtt6.js";import"./Check-DKSVtPgB.js";import"./ChevronDown-XduUmQT8.js";import"./ChevronUp-CmwEFUkY.js";import"./useInfiniteQuery-CIdU8zaX.js";import"./use-infinite-scroll-B6f2rvDK.js";import"./use-connection-DqlBxSxU.js";import"./use-mcp-client-CbH6VRGA.js";import"./auth-0oxc70vP.js";import"./use-virtual-mcp-Ffm9narY.js";import"./card-CxST7PR_.js";import"./sidebar-CxqL3ymz.js";import"./LayoutLeft-M_0PEtZB.js";import"./use-mobile-Ba5JGjny.js";import"./X-Bio89LMx.js";import"./table-yMd-ysMj.js";import"./empty-state-owKXC3o8.js";import"./use-members-Cc8G0stB.js";import"./use-org-auth-client-FK00uheF.js";import"./use-clock-tick-CI08Mmp8.js";import"./AlertCircle-CT1Vda1-.js";import"./CheckCircle-B2Ham_Ku.js";import"./DotsVertical-D7_z7rxq.js";import"./agent-icon-6PN48eXB.js";import"./Tool01-DrekBx2F.js";import"./ArrowUp-BW8m6yuk.js";import"./Settings02-DpOYWrho.js";import"./Tool02-f4cggfek.js";import"./XCircle-BNbdsBJE.js";import"./ArrowUpRight-CfZYO-uI.js";import"./TrendUp01-BY9xhAkx.js";import"./ZapSquare-B0F44YUx.js";import"./Users03-Cubz8plF.js";import"./Stars02-HqPdqjox.js";import"./Copy01-MHFArsKW.js";import"./CpuChip01-DaWYaD2O.js";import"./Eye-C--UGYIN.js";import"./FilterLines-AuQ7dcpe.js";import"./Star01-DCrAYCg2.js";import"./Palette-Dfz37bMR.js";import"./SwitchHorizontal01-DbwoldJG.js";import"./HardDrive-GPfm6kn5.js";import"./Key01-B-2R1ZuS.js";import"./LinkExternal01-CYlScGIe.js";import"./LogOut01-BP509aaC.js";import"./Monitor01-B_mbAV5l.js";import"./Sun-Bp4LoN0q.js";import"./Play-CDYSljWl.js";import"./Plus-B8Fp-uPP.js";import"./SearchLg-DSNE_kzb.js";import"./SearchMd-TCQIcUNv.js";import"./Shield01-pA5IS0Gy.js";import"./Stars01-CDw3ILjF.js";import"./Trash01-DrdtrRyV.js";import"./Upload01-MfdrmtQ1.js";import"./User01-BiNLMs3u.js";import"./Users01-CUKHhGDQ.js";import"./XClose-DfxPXTPd.js";import"./Zap-D8gG88Mb.js";import"./use-automations-sK4gm0lB.js";import"./studio-tools-GPb7OAbs.js";import"./useSuspenseInfiniteQuery-CRyCnL_Q.js";import"./avatar-nAUbnUE8.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dc2zEVVx.js";import"./calendar-DflxrfDH.js";import"./dialog-h-UdyNtv.js";import"./tab-id-BPlSueXP.js";import"./hooks-Dk1fYF5C.js";import"./decopilot-sse-pool-DxdJdhNu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-DSVU-Wdj.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CMg1asW3.js";import"./use-decopilot-events-CRPJ09kV.js";import"./use-organization-settings-Dy5ifd9c.js";import"./monaco-editor-DxOyQFTd.js";import"./spinner-DlE_5plH.js";import"./index-DIGPBsN_.js";import"./shell-layout-IrSF4vBc.js";import"./required-auth-layout-A8YhZ8Bt.js";import"./use-org-sso-GGzUcbSy.js";import"./integration-icon-DZAQT7b4.js";import"./use-navigate-to-agent-v_msuRK8.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CiJy3yHG.js";import"./form-DeWN8q_1.js";import"./label-C_6cjt6L.js";import"./input-HNtx0Zqc.js";import"./drawer-EdmUkKNT.js";import"./collection-search-BAdFeMaK.js";import"./index-CcxifCya.js";import"./get-initials-D-f_fDFw.js";import"./popover-aywGfvt3.js";import"./dropdown-menu-CPRYVx7l.js";import"./github-repo-picker-o8v5oAL0.js";import"./use-debounced-value-CXIGbeRl.js";import"./authenticate-and-persist-oauth-CnnloxGX.js";import"./mcp-oauth-BMYIe3Z0.js";import"./use-mcp-tools-CvYorOot.js";import"./extract-connection-data-RBeNwZod.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./use-tags-DeZcjykM.js";import"./skeleton-D6YbAWwm.js";import"./command-DdkloL5q.js";import"./index-BhH-15Yq.js";import"./companions-core-CrqyIrvA.js";import"./tabs-BI5AKYPo.js";import"./toggle-group-B1yWxSP3.js";import"./use-deco-credits-BH2bg0UO.js";import"./alert-dialog-CkaJnSQD.js";import"./toolbar-D-16WLmG.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DIyBBD3g.js";import"./use-registry-connections-BQ-qHpvw.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DCPrBM2_.js";import"./connection-form-helpers-CNpigz6y.js";import"./collection-tabs-BwVPtFSB.js";import"./badge-C7TPZgd1.js";import"./select-model-DXu1robt.js";import"./checkbox-OoJa9LkI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CymQlmfF.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CsGyaN7B.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-uyk0FDWU.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-C-OW2Sh9.js";import"./use-debounced-autosave-D2OSHXg-.js";import"./index-BbSeHWzc.js";import"./search-input-Kzdqefxt.js";import"./switch-LoEIjRNg.js";import"./use-secrets-C0VtSmLk.js";import"./useQueries-ChfVENok.js";import"./use-file-configs-DqAW69yO.js";import"./automation-list-row-CtNuBGQb.js";function Pt(c,t){const i=(c.title||c.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),a=/^[A-Za-z]/.test(i)&&i.length>0?i:"Section",s=wt(t,a);return{blockKey:s,data:{__resolveType:c.resolveType,name:s}}}function Ar(c){const t=gt.c(83),{orgSlug:i,virtualMcpId:a,branch:s,blockKey:m,block:d,meta:p,decofile:f,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=c,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,l=yt(),b=typeof d?.__resolveType=="string"?d.__resolveType:"";let R;t[0]!==G||t[1]!==p||t[2]!==b?(R=Et(b,p,G),t[0]=G,t[1]=p,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==d||t[7]!==m||t[8]!==p||t[9]!==Z?(K=Z??(d?Nt(m,d,p):m),t[6]=d,t[7]=m,t[8]=p,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==s||t[12]!==i||t[13]!==a?(T={orgSlug:i,virtualMcpId:a,branch:s},t[11]=s,t[12]=i,t[13]=a,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==s||t[16]!==i||t[17]!==a?(F={orgSlug:i,virtualMcpId:a,branch:s},t[15]=s,t[16]=i,t[17]=a,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(m),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[n,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==m&&(bt(m),dt(null),ft(zt),ut([]));let z;t[22]!==d?(z=d??{},t[22]=d,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==m||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(m,{...r,__resolveType:b})},t[29]=m,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==f||t[35]!==W||t[36]!==Y||t[37]!==l?(L=async(e,r)=>{try{const{blockKey:u,data:N}=Pt(e,f);await Y.mutateAsync({blockKey:u,data:N}),xt.success(l("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),W()}catch(u){const N=u,St=N instanceof Error?N.message:l("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=f,t[35]=W,t[36]=Y,t[37]=l,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,u=>{r(u),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==n||t[43]!==v?(H=n.length>0?[v,...n]:[],t[42]=n,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==n||t[46]!==E||t[47]!==l||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":l("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const u=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(n,r)),ft(Ot)},title:e,className:kt("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:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=n,t[46]=E,t[47]=l,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==m||t[56]!==s||t[57]!==n||t[58]!==f||t[59]!==st||t[60]!==ot||t[61]!==y||t[62]!==pt||t[63]!==Q||t[64]!==p||t[65]!==i||t[66]!==x||t[67]!==tt||t[68]!==h||t[69]!==J||t[70]!==l||t[71]!==a?(B=o.jsx(Bt,{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:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:n,onBreadcrumbChange:at,decofile:f,meta:p,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt,sandbox:{orgSlug:i,virtualMcpId:a,branch:s}},`${m}:${ot}`):J?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"}),l("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:l("sandbox.appEditor.noEditableSchema")})})})}),t[55]=m,t[56]=s,t[57]=n,t[58]=f,t[59]=st,t[60]=ot,t[61]=y,t[62]=pt,t[63]=Q,t[64]=p,t[65]=i,t[66]=x,t[67]=tt,t[68]=h,t[69]=J,t[70]=l,t[71]=a,t[72]=B):B=t[72];let A;t[73]!==rt||t[74]!==f||t[75]!==lt||t[76]!==p||t[77]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:p,decofile:f,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[73]=rt,t[74]=f,t[75]=lt,t[76]=p,t[77]=x,t[78]=A):A=t[78];let M;return t[79]!==j||t[80]!==B||t[81]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[79]=j,t[80]=B,t[81]=A,t[82]=M):M=t[82],M}function Ot(c){return c+1}function zt(c){return c+1}export{Ar as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as he,b as je,r as de,j as t,k as ye,B as ne}from"./index-CEdLDEAA.js";import{B as ue}from"./agent-icon-6PN48eXB.js";import{i as Ne}from"./X-Bio89LMx.js";import{L as ce}from"./label-C_6cjt6L.js";import{a4 as xe,a5 as ke}from"./index-DxLBfYsO.js";import{S as Ce,a as Pe,b as Se,c as ve,d as _e}from"./select-CS7LSkMB.js";import{T as Te,a as we,c as Be}from"./tooltip-D58aKtt6.js";import"./AlertCircle-CT1Vda1-.js";import"./Tool01-DrekBx2F.js";import"./ArrowUp-BW8m6yuk.js";import"./Settings02-DpOYWrho.js";import"./Tool02-f4cggfek.js";import"./XCircle-BNbdsBJE.js";import"./ArrowUpRight-CfZYO-uI.js";import"./TrendUp01-BY9xhAkx.js";import"./ZapSquare-B0F44YUx.js";import"./Users03-Cubz8plF.js";import"./CheckCircle-B2Ham_Ku.js";import"./Check-DKSVtPgB.js";import"./ChevronDown-XduUmQT8.js";import"./ChevronRight-CNAPLLgl.js";import"./ChevronUp-CmwEFUkY.js";import"./DotsVertical-D7_z7rxq.js";import"./Stars02-HqPdqjox.js";import"./Copy01-MHFArsKW.js";import"./CpuChip01-DaWYaD2O.js";import"./Eye-C--UGYIN.js";import"./FilterLines-AuQ7dcpe.js";import"./Star01-DCrAYCg2.js";import"./Palette-Dfz37bMR.js";import"./SwitchHorizontal01-DbwoldJG.js";import"./HardDrive-GPfm6kn5.js";import"./Key01-B-2R1ZuS.js";import"./LayoutLeft-M_0PEtZB.js";import"./LinkExternal01-CYlScGIe.js";import"./LogOut01-BP509aaC.js";import"./Monitor01-B_mbAV5l.js";import"./Sun-Bp4LoN0q.js";import"./Play-CDYSljWl.js";import"./Plus-B8Fp-uPP.js";import"./SearchLg-DSNE_kzb.js";import"./SearchMd-TCQIcUNv.js";import"./Shield01-pA5IS0Gy.js";import"./Stars01-CDw3ILjF.js";import"./Trash01-DrdtrRyV.js";import"./Upload01-MfdrmtQ1.js";import"./User01-BiNLMs3u.js";import"./Users01-CUKHhGDQ.js";import"./XClose-DfxPXTPd.js";import"./Zap-D8gG88Mb.js";import"./chat-context-DSVU-Wdj.js";import"./tab-id-BPlSueXP.js";import"./dialog-h-UdyNtv.js";import"./hooks-Dk1fYF5C.js";import"./use-mcp-client-CbH6VRGA.js";import"./auth-0oxc70vP.js";import"./decopilot-sse-pool-DxdJdhNu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Ffm9narY.js";import"./use-ai-providers-CMg1asW3.js";import"./studio-tools-GPb7OAbs.js";import"./use-decopilot-events-CRPJ09kV.js";import"./use-organization-settings-Dy5ifd9c.js";import"./automation-runs-D4o6uJsl.js";import"./useInfiniteQuery-CIdU8zaX.js";import"./use-infinite-scroll-B6f2rvDK.js";import"./use-connection-DqlBxSxU.js";import"./card-CxST7PR_.js";import"./sidebar-CxqL3ymz.js";import"./use-mobile-Ba5JGjny.js";import"./table-yMd-ysMj.js";import"./empty-state-owKXC3o8.js";import"./use-members-Cc8G0stB.js";import"./use-org-auth-client-FK00uheF.js";import"./use-clock-tick-CI08Mmp8.js";import"./use-automations-sK4gm0lB.js";import"./useSuspenseInfiniteQuery-CRyCnL_Q.js";import"./avatar-nAUbnUE8.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dc2zEVVx.js";import"./calendar-DflxrfDH.js";import"./monaco-editor-DxOyQFTd.js";import"./spinner-DlE_5plH.js";import"./index-DIGPBsN_.js";import"./shell-layout-IrSF4vBc.js";import"./required-auth-layout-A8YhZ8Bt.js";import"./use-org-sso-GGzUcbSy.js";import"./integration-icon-DZAQT7b4.js";import"./use-navigate-to-agent-v_msuRK8.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CiJy3yHG.js";import"./form-DeWN8q_1.js";import"./input-HNtx0Zqc.js";import"./drawer-EdmUkKNT.js";import"./collection-search-BAdFeMaK.js";import"./index-CcxifCya.js";import"./get-initials-D-f_fDFw.js";import"./popover-aywGfvt3.js";import"./dropdown-menu-CPRYVx7l.js";import"./github-repo-picker-o8v5oAL0.js";import"./use-debounced-value-CXIGbeRl.js";import"./authenticate-and-persist-oauth-CnnloxGX.js";import"./mcp-oauth-BMYIe3Z0.js";import"./use-mcp-tools-CvYorOot.js";import"./extract-connection-data-RBeNwZod.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./use-tags-DeZcjykM.js";import"./skeleton-D6YbAWwm.js";import"./command-DdkloL5q.js";import"./index-BhH-15Yq.js";import"./companions-core-CrqyIrvA.js";import"./tabs-BI5AKYPo.js";import"./toggle-group-B1yWxSP3.js";import"./use-deco-credits-BH2bg0UO.js";import"./alert-dialog-CkaJnSQD.js";import"./toolbar-D-16WLmG.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DIyBBD3g.js";import"./use-registry-connections-BQ-qHpvw.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DCPrBM2_.js";import"./connection-form-helpers-CNpigz6y.js";import"./collection-tabs-BwVPtFSB.js";import"./badge-C7TPZgd1.js";import"./select-model-DXu1robt.js";import"./checkbox-OoJa9LkI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CymQlmfF.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CsGyaN7B.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-uyk0FDWU.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-C-OW2Sh9.js";import"./use-debounced-autosave-D2OSHXg-.js";import"./index-BbSeHWzc.js";import"./search-input-Kzdqefxt.js";import"./switch-LoEIjRNg.js";import"./use-secrets-C0VtSmLk.js";import"./useQueries-ChfVENok.js";import"./use-file-configs-DqAW69yO.js";import"./automation-list-row-CtNuBGQb.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,ge]=de.useState("add");let Y;if(e[0]!==r||e[1]!==m){let a;e[3]!==m?(a=be=>be.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(Te,{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 g;e[17]!==o?(g=o("sandbox.bulkCategoryPanel.exitSelection"),e[17]=o,e[18]=g):g=e[18];let b;e[19]!==g?(b=t.jsx(we,{side:"bottom",children:g}),e[19]=g,e[20]=b):b=e[20];let h;e[21]!==f||e[22]!==b?(h=t.jsxs(Be,{children:[f,b]}),e[21]=f,e[22]=b,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(Ce,{value:m,onValueChange:fe,children:[t.jsx(Pe,{className:"w-full",children:t.jsx(Se,{placeholder:o("sandbox.bulkCategoryPanel.selectCategoryPlaceholder")})}),t.jsx(ve,{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=>ge(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(ke,{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 W;e[89]!==ae||e[90]!==G||e[91]!==I?(W=t.jsx(ne,{type:"button",disabled:ae,onClick:G,children:I}),e[89]=ae,e[90]=G,e[91]=I,e[92]=W):W=e[92];let q;e[93]!==D||e[94]!==W?(q=t.jsxs("div",{className:"flex justify-end gap-2",children:[D,W]}),e[93]=D,e[94]=W,e[95]=q):q=e[95];let H;e[96]!==_||e[97]!==V||e[98]!==q?(H=t.jsxs("div",{className:"mt-6 space-y-4",children:[_,V,q]}),e[96]=_,e[97]=V,e[98]=q,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(_e,{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 J,r as k,m as V,j as t,b as X,B as I,k as Y,t as $}from"./index-CEdLDEAA.js";import{i as Z}from"./XCircle-BNbdsBJE.js";import{b0 as _,B as U}from"./agent-icon-6PN48eXB.js";import{n as K}from"./LinkExternal01-CYlScGIe.js";import{g as tt,f as ot,b as et,A as rt,a as it,e as st,c as at,d as nt}from"./alert-dialog-CkaJnSQD.js";import{I as W}from"./input-HNtx0Zqc.js";import{L as H}from"./label-C_6cjt6L.js";import{P as mt,O as lt,Q as pt,a2 as ct,I as dt,T as D,W as gt,a3 as ut,U as xt}from"./index-DxLBfYsO.js";import{c as ft,B as ht,a as yt}from"./block-document-BS9DfxSM.js";import{u as bt}from"./use-autosave-aYVhSq_y.js";import{t as jt}from"./ChevronDown-XduUmQT8.js";import{o as vt,p as Et,n as Nt}from"./automation-runs-D4o6uJsl.js";import{s as b,E as Ct}from"./primitives-DCrmJi5C.js";import"./AlertCircle-CT1Vda1-.js";import"./Tool01-DrekBx2F.js";import"./ArrowUp-BW8m6yuk.js";import"./Settings02-DpOYWrho.js";import"./Tool02-f4cggfek.js";import"./ArrowUpRight-CfZYO-uI.js";import"./TrendUp01-BY9xhAkx.js";import"./ZapSquare-B0F44YUx.js";import"./Users03-Cubz8plF.js";import"./CheckCircle-B2Ham_Ku.js";import"./Check-DKSVtPgB.js";import"./ChevronRight-CNAPLLgl.js";import"./ChevronUp-CmwEFUkY.js";import"./DotsVertical-D7_z7rxq.js";import"./Stars02-HqPdqjox.js";import"./Copy01-MHFArsKW.js";import"./CpuChip01-DaWYaD2O.js";import"./Eye-C--UGYIN.js";import"./FilterLines-AuQ7dcpe.js";import"./Star01-DCrAYCg2.js";import"./Palette-Dfz37bMR.js";import"./SwitchHorizontal01-DbwoldJG.js";import"./HardDrive-GPfm6kn5.js";import"./Key01-B-2R1ZuS.js";import"./LayoutLeft-M_0PEtZB.js";import"./LogOut01-BP509aaC.js";import"./Monitor01-B_mbAV5l.js";import"./Sun-Bp4LoN0q.js";import"./Play-CDYSljWl.js";import"./Plus-B8Fp-uPP.js";import"./SearchLg-DSNE_kzb.js";import"./SearchMd-TCQIcUNv.js";import"./Shield01-pA5IS0Gy.js";import"./Stars01-CDw3ILjF.js";import"./Trash01-DrdtrRyV.js";import"./Upload01-MfdrmtQ1.js";import"./User01-BiNLMs3u.js";import"./Users01-CUKHhGDQ.js";import"./XClose-DfxPXTPd.js";import"./X-Bio89LMx.js";import"./Zap-D8gG88Mb.js";import"./chat-context-DSVU-Wdj.js";import"./tab-id-BPlSueXP.js";import"./dialog-h-UdyNtv.js";import"./hooks-Dk1fYF5C.js";import"./use-mcp-client-CbH6VRGA.js";import"./auth-0oxc70vP.js";import"./decopilot-sse-pool-DxdJdhNu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Ffm9narY.js";import"./use-ai-providers-CMg1asW3.js";import"./studio-tools-GPb7OAbs.js";import"./use-decopilot-events-CRPJ09kV.js";import"./use-organization-settings-Dy5ifd9c.js";import"./spinner-DlE_5plH.js";import"./tooltip-D58aKtt6.js";import"./drawer-EdmUkKNT.js";import"./collection-search-BAdFeMaK.js";import"./use-mobile-Ba5JGjny.js";import"./AreaChart-CiJy3yHG.js";import"./index-DIGPBsN_.js";import"./calendar-DflxrfDH.js";import"./shell-layout-IrSF4vBc.js";import"./avatar-nAUbnUE8.js";import"./required-auth-layout-A8YhZ8Bt.js";import"./use-org-sso-GGzUcbSy.js";import"./index-CcxifCya.js";import"./get-initials-D-f_fDFw.js";import"./popover-aywGfvt3.js";import"./dropdown-menu-CPRYVx7l.js";import"./github-repo-picker-o8v5oAL0.js";import"./use-debounced-value-CXIGbeRl.js";import"./use-connection-DqlBxSxU.js";import"./authenticate-and-persist-oauth-CnnloxGX.js";import"./mcp-oauth-BMYIe3Z0.js";import"./use-mcp-tools-CvYorOot.js";import"./extract-connection-data-RBeNwZod.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-v_msuRK8.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./use-members-Cc8G0stB.js";import"./use-org-auth-client-FK00uheF.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-tags-DeZcjykM.js";import"./skeleton-D6YbAWwm.js";import"./use-copy-Dc2zEVVx.js";import"./command-DdkloL5q.js";import"./index-BhH-15Yq.js";import"./companions-core-CrqyIrvA.js";import"./form-DeWN8q_1.js";import"./select-CS7LSkMB.js";import"./tabs-BI5AKYPo.js";import"./toggle-group-B1yWxSP3.js";import"./use-deco-credits-BH2bg0UO.js";import"./sidebar-CxqL3ymz.js";import"./toolbar-D-16WLmG.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DIyBBD3g.js";import"./use-registry-connections-BQ-qHpvw.js";import"./useInfiniteQuery-CIdU8zaX.js";import"./use-infinite-scroll-B6f2rvDK.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CxST7PR_.js";import"./integration-icon-DZAQT7b4.js";import"./textarea-DCPrBM2_.js";import"./connection-form-helpers-CNpigz6y.js";import"./collection-tabs-BwVPtFSB.js";import"./badge-C7TPZgd1.js";import"./useSuspenseInfiniteQuery-CRyCnL_Q.js";import"./select-model-DXu1robt.js";import"./checkbox-OoJa9LkI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CymQlmfF.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CsGyaN7B.js";import"./empty-state-owKXC3o8.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-uyk0FDWU.js";import"./monaco-editor-DxOyQFTd.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-C-OW2Sh9.js";import"./use-debounced-autosave-D2OSHXg-.js";import"./index-BbSeHWzc.js";import"./search-input-Kzdqefxt.js";import"./switch-LoEIjRNg.js";import"./use-secrets-C0VtSmLk.js";import"./useQueries-ChfVENok.js";import"./use-file-configs-DqAW69yO.js";import"./use-automations-sK4gm0lB.js";import"./automation-list-row-CtNuBGQb.js";import"./table-yMd-ysMj.js";import"./use-clock-tick-CI08Mmp8.js";function St(j){const o=J.c(18),{icon:x,title:m,defaultOpen:v,children:u}=j,w=v===void 0?!1:v,[f,P]=k.useState(w);let l;o[0]!==x?(l=t.jsx(x,{size:15}),o[0]=x,o[1]=l):l=o[1];let r;o[2]!==m?(r=t.jsx("span",{className:"flex-1 text-left",children:m}),o[2]=m,o[3]=r):r=o[3];const a=f&&"rotate-180";let p;o[4]!==a?(p=V("transition-transform",a),o[4]=a,o[5]=p):p=o[5];let i;o[6]!==p?(i=t.jsx(jt,{size:15,className:p}),o[6]=p,o[7]=i):i=o[7];let c;o[8]!==l||o[9]!==r||o[10]!==i?(c=t.jsx(vt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,r,i]})}),o[8]=l,o[9]=r,o[10]=i,o[11]=c):c=o[11];let d;o[12]!==u?(d=t.jsx(Et,{className:"px-2 pt-4",children:u}),o[12]=u,o[13]=d):d=o[13];let n;return o[14]!==f||o[15]!==c||o[16]!==d?(n=t.jsxs(Nt,{open:f,onOpenChange:P,className:"mt-4",children:[c,d]}),o[14]=f,o[15]=c,o[16]=d,o[17]=n):n=o[17],n}function xr({orgSlug:j,virtualMcpId:o,branch:x,blockKey:m,block:v,decofile:u,meta:w,onManagePosts:f,onOpenPost:P,previewBaseUrl:l}){const r=X(),a=mt({orgSlug:j,virtualMcpId:o,branch:x,packagePath:lt(o)}),p=pt(v,"categories"),[i,c,d]=bt(p,e=>{a.mutate({blockKey:m,data:D(m,"categories",e)})}),n=(e,S)=>c({...i,[e]:S}),A=ft({decofile:u,category:i,previewBaseUrl:l}),s=b(i.slug),[B,y]=k.useState(s),[g,E]=k.useState(null),[N,T]=k.useState(!1),z=s?ct(u).filter(e=>e.categorySlugs.includes(s)):[],C=z.length,M=e=>n("slug",e),Q=async(e,S)=>{const G=b(i.name);T(!0);try{let h=0;for(const{key:O,payload:R}of gt(u,"posts")){const L=ut(R,e,{name:G,slug:S});L!==R&&(await a.mutateAsync({blockKey:O,data:D(O,"posts",xt(L))}),h+=1)}const F={...i,slug:S};await a.mutateAsync({blockKey:m,data:D(m,"categories",F)}),d(F),$.success(h>0?r("sandbox.categoryEditor.renameSuccessWithPosts",{count:String(h)}):r("sandbox.categoryEditor.renameSuccessNoPosts")),E(null)}catch(h){y(e),E(null),$.error(h instanceof Error?h.message:r("sandbox.categoryEditor.renameFailed"))}finally{T(!1)}},q=()=>{const e=B.trim();if(e===s){B!==e&&y(e);return}if(!e){y(s);return}if(C===0){M(e);return}E({oldSlug:s,newSlug:e,count:C})};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:b(i.name)||r("sandbox.categoryEditor.untitledCategory")}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(dt,{isPending:a.isPending,isError:a.isError}),A&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:r("sandbox.categoryEditor.previewTooltip"),onClick:()=>window.open(A,"_blank","noopener,noreferrer"),children:[t.jsx(K,{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(Ct,{value:b(i.name),onChange:e=>n("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(H,{htmlFor:"category-slug",children:r("sandbox.categoryEditor.slugLabel")}),t.jsx(W,{id:"category-slug",value:B,onChange:e=>y(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(H,{htmlFor:"category-description",children:r("sandbox.categoryEditor.descriptionLabel")}),t.jsx(W,{id:"category-description",value:b(i.description),onChange:e=>n("description",e.target.value),placeholder:r("sandbox.categoryEditor.descriptionPlaceholder"),className:"h-10"})]}),t.jsx(St,{icon:_,title:r("sandbox.categoryEditor.contentTitle"),defaultOpen:!0,children:t.jsx(ht,{value:yt(i.sections),onChange:e=>n("sections",e),meta:w,sandboxRef:{orgSlug:j,virtualMcpId:o,branch:x},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(C)})})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!s,title:r(s?"sandbox.categoryEditor.pickPostsTooltip":"sandbox.categoryEditor.setSlugTooltip"),onClick:()=>f(s),children:[r("sandbox.categoryEditor.addPostsButton"),t.jsx(Z,{size:14})]})]}),C>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(e=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>P(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(tt,{open:!!g,onOpenChange:e=>{e||N||(y(s),E(null))},children:t.jsxs(ot,{children:[t.jsxs(et,{children:[t.jsx(rt,{children:r("sandbox.categoryEditor.renameDialogTitle")}),t.jsx(it,{children:g?r("sandbox.categoryEditor.renameDialogDescription",{oldSlug:g.oldSlug,newSlug:g.newSlug,count:String(g.count)}):null})]}),t.jsxs(st,{children:[t.jsx(at,{disabled:N,children:r("sandbox.categoryEditor.cancelButton")}),t.jsx(nt,{onClick:e=>{e.preventDefault(),g&&Q(g.oldSlug,g.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:14,className:"animate-spin"}),r("sandbox.categoryEditor.renamingLabel")]}):r("sandbox.categoryEditor.renameActionButton")})]})]})})]})}export{xr as CategoryEditor};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{Y as S,a3 as C,a6 as ae,Z as i,a4 as ue,a5 as xe,aH as Me,cw as xt,bj as Ne,b8 as lt,c as ie,J as ct,u as je,o as Ve,F as J,K as de,t as ce,I as be,G as ge,d as dt,f as It,r as v,n as wt,e as Mt,j as Ie,b as Ee,a as Tt,v as Ct,aa as At,p as Pt}from"./index-CEdLDEAA.js";import{d as _t,s as Rt,A as ut,t as Et,u as Dt,o as $t,w as Ut}from"./tab-id-BPlSueXP.js";import{S as Ot,s as Lt,u as Nt,f as Ft,i as qt,b as jt}from"./hooks-Dk1fYF5C.js";import{u as Vt}from"./use-is-desktop-app-BNujXJc_.js";import{a as Bt,u as Ht,S as Kt}from"./use-mcp-client-CbH6VRGA.js";import{u as Qt}from"./use-virtual-mcp-Ffm9narY.js";import{u as pt,p as Wt,b as Se,i as Gt,c as zt}from"./use-ai-providers-CMg1asW3.js";import{u as Xt}from"./use-decopilot-events-CRPJ09kV.js";import{u as Zt,c as Yt}from"./studio-tools-GPb7OAbs.js";import{b as Jt}from"./use-organization-settings-Dy5ifd9c.js";const ke=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")}),ht=ke.extend({selected_tools:ke.shape.selected_tools.optional(),selected_resources:ke.shape.selected_resources.optional(),selected_prompts:ke.shape.selected_prompts.optional()}),en=S({connectionId:i(),toolName:i(),label:i(),icon:i().nullable().optional()}),tn=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:Ne("ext-app"),appId:i(),args:xe(i(),lt()).optional()})}),nn=S({defaultMainView:S({type:i(),id:i().optional(),toolName:i().optional()}).nullable().optional(),chatDefaultOpen:ae().nullable().optional(),cmsDefaultOpen:ae().nullable().optional(),tabs:C(tn).optional()}),tt=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:xe(i(),lt()).optional().describe("User-configured input props passed to MCPAppRenderer when rendering the tile."),minHeight:Me().int().positive().optional(),maxHeight:Me().int().positive().optional()}),Be=S({banner:i().nullable().optional(),bannerColor:i().nullable().optional(),icon:i().nullable().optional(),themeColor:i().nullable().optional(),pinnedViews:C(en).nullable().optional(),layout:nn.nullable().optional(),homeTile:tt.nullable().optional(),homeTiles:C(tt).nullable().optional(),homePrompts:C(i()).nullable().optional()});function us(t){const e=t?.homeTiles;if(Array.isArray(e)&&e.length>0)return e;const n=t?.homeTile;return n?[n]:[]}const sn=/^[A-Za-z_][A-Za-z0-9_]*$/,nt=i().min(1).regex(sn,{message:"Env var key must start with a letter or underscore and contain only letters, digits, and underscores."}),on=xt("kind",[S({key:nt,kind:Ne("literal"),value:i()}),S({key:nt,kind:Ne("secret"),secretId:i().min(1)})]),an=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/,rn=S({host:i().min(1).regex(an).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.")}),He=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(on).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(rn).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.")}),Ke=S({url:i().describe("GitHub repository URL"),owner:i().describe("Repository owner"),name:i().describe("Repository name"),installationId:Me().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.")}),ln=ue(["agent-sandbox","user-desktop"]),cn=ue(["agent-sandbox","user-desktop","cluster"]);function Qe(t){return t==="cluster"?"agent-sandbox":t}const mt={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:ln.optional(),createdAt:Me().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.")},ft=S(mt),dn=S({...mt,sandboxProviderKind:cn.optional()});function un(t){const e=dn.parse(t);return ft.parse({...e,sandboxProviderKind:e.sandboxProviderKind?Qe(e.sandboxProviderKind):void 0})}function ps(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=Qe(s);try{if(s==="cluster"&&n[a])continue;n[a]=un(o)}catch{}}return n}const We=xe(i().describe("userId"),xe(i().describe("branch"),xe(i().describe("sandboxProviderKind"),ft))),pn=S({id:i().describe("Stable identifier for this knowledge file"),name:i().describe("File name shown in the UI"),kind:ue(["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:Me().nullable().optional().describe("File size in bytes"),addedAt:i().describe("ISO timestamp when the file was attached")}),Ge=C(pn).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."),hn=ue(["smart","code-review","open"]),ze=hn.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."),hs=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:ue(["active","inactive"]).describe("Current status"),pinned:ae().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:Be.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:He.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:We.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Ge,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:ze,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking."),fieldDescriptionTooltips:ae().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.")}).loose().describe("Metadata"),connections:C(ke).describe("Connections with their selected tools, resources, and prompts")}),bt=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:ue(["active","inactive"]).optional().default("active").describe("Initial status"),pinned:ae().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:Be.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:He.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:We.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Ge,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:ze,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking."),fieldDescriptionTooltips:ae().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.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(ht).describe("Connections to include/exclude (can be empty for exclusion mode)"),prompts:C(bt).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:ue(["active","inactive"]).optional().describe("New status"),pinned:ae().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:Be.nullable().optional().describe("UI customization settings"),githubRepo:Ke.nullable().optional().describe("Linked GitHub repository"),runtime:He.nullable().optional().describe("User-pinned runtime config (package manager, dev port). Empty fields = autodetect."),sandboxMap:We.optional().describe("Per-user, per-branch sandbox mapping: sandboxMap[userId][branch] -> { sandboxHandle, previewUrl }"),knowledge:Ge,siteSlug:i().nullable().optional().describe("Linked asset site slug (managed storage tenancy)"),publishPolicy:ze,productionUrl:i().nullable().optional().describe("Live production URL of the linked site (e.g. https://acme.com). Painted in the preview iframe while the sandbox dev server is waking."),fieldDescriptionTooltips:ae().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.")}).loose().nullable().optional().describe("Additional metadata including MCP server instructions"),connections:C(ht).optional().describe("New connections (replaces existing)"),prompts:C(bt).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 mn(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 Fe={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 fn(t,e){if(!t)return null;const n=e?Qe(e):null;if(t==="decopilot"&&(n===null||n==="user-desktop"))return"decopilot";for(const[s,o]of Object.entries(Fe))if(o.harness===t&&o.sandbox===n)return s;return null}function bn({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 gn(t){return t.thread?.harness_id!=null?{}:{harnessId:"decopilot",sandboxProviderKind:"agent-sandbox",branch:t.globals.branch??null}}const yn="home",vn=new Set(["output","upload","public","home"]),Sn=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function ms(t){return vn.has(t)||!Sn.test(t)?"home":t}function kn(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===yn&&a===""}}function fs(t){return t==="public"?"skills":t}function bs(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const st="public-";function gt(t){return t.startsWith(st)?t.slice(st.length):null}function gs(t,e){const n=gt(t);return n?`public/${n}/${e}`:`${t}/${e}`}function xn(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function In(t){const{volume:e,dirPath:n}=kn(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=gt(e);s=o?`org/public/${o}`:`org/${e}`}return n?`${s}/${n}`:s}function wn(t){const e=ie.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=ct(n);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const a=je(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=In(c),e[13]=c,e[14]=f):f=e[14];const k=f;let M;e[15]!==c?(M=xn(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 Mn(){const t=ie.c(5),e=Ve(),{org:n}=J();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=ct(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:de.collection(n.slug,f,m)});const k=m.toLowerCase().replace(/_/g," ");ce.success(`${k} updated`)},t[1]=o?.params,t[2]=n,t[3]=e,t[4]=a):a=t[4],a}function Tn(){const t=ie.c(4),{org:e,project:n}=J(),s=`${e.id}/${n.id}`;let o;t[0]!==s?(o=ge.taskLastViewed(s),t[0]=s,t[1]=o):o=t[1];const[,a]=be(o,Cn);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 Cn(t){return t??{}}function yt(){const t=dt(),{org:e}=J(),n=je({strict:!1}),s=It({strict:!1}),o=n.virtualmcpid??Bt(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"&&!Rt(p)&&(k.main=p),(f.sidepanel==="chat"||f.sidepanel===0)&&(k.sidepanel=f.sidepanel),m?.autosend&&(k.autosend=ut),k}})},l=v.useRef(crypto.randomUUID()),c=s.taskId??l.current;return{virtualMcpId:o,taskId:c,navigateToTask:a}}function An(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 ot(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 Pn(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 _n(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 vt(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(...ot(c,l))}else if(o.attrs.kind==="skill"){const c=o.attrs.metadata;c&&!Array.isArray(c)&&Array.isArray(c.files)&&e.push(...Pn(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(..._n(c,l)):Array.isArray(c)&&e.push(...ot(c,l))}}else if(o.type==="file"&&o.attrs){const a=o.attrs,l=`[file:://${encodeURIComponent(a.name)}]`;n+=l,e.push(...An(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 ys(t){const e=vt(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function vs(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Rn(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function Ss(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function En(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Dn(t,e){return t.filter(n=>n.messageId!==e)}const at=new Map,Xe=new Set;function $n(t){Xe.add(t)}function Un(t){return Xe.has(t)}function On(t){Xe.delete(t)}function Te(t){let e=at.get(t);return e||(e=new Ot([]),at.set(t,e)),e}function St(t,e){Te(t).update(n=>En(n,e))}function qe(t,e){Te(t).update(n=>Dn(n,e))}function Ln(t,e){Te(t).set(e)}const Re=new Map;function Nn(t,e){Re.set(`${t}:${e.id}`,e)}function Fn(t,e){const n=`${t}:${e}`,s=Re.get(n);return Re.delete(n),s}function it(t,e){Re.delete(`${t}:${e}`)}async function oe(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();Ln(e,s.items??[])}catch{}}function ks(t){const e=ie.c(2);let n;e[0]!==t?(n=Te(t),e[0]=t,e[1]=n):n=e[1];const s=n;return v.useSyncExternalStore(s.subscribe,s.get,s.get)}function qn(){const{org:t}=J();return{enqueue:St,refresh:e=>oe(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;qe(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 ce.error(o instanceof Error?o.message:"Failed to cancel"),!1}finally{await oe(t.slug,e)}}}}function _e(t,e){return t.find(n=>n!=null&&e.has(n.keyId))??null}function jn(t,e,n){const s=o=>_e([o],n);return{tiers:{fast:_e([e.tiers.fast,t.tiers.fast],n),smart:_e([e.tiers.smart,t.tiers.smart],n),thinking:_e([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 we={tiers:{}};function Vn(){const t=ie.c(7),{org:e}=J();let n;t[0]!==e.id?(n=de.userModelPreferences(e.id),t[0]=e.id,t[1]=n):n=t[1];let s;t[2]!==e.slug?(s=async()=>{const a=await Yt(e.slug,"USER_MODEL_PREFERENCES_GET",{});return a?.tiers?a:we},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],wt(o)}function Bn(){return Vn().data??we}function xs(){const t=ie.c(19),{org:e}=J(),n=Zt(),s=Ve();let o;t[0]!==e.id?(o=de.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)??we;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,F=s.getQueryData(a),q=F??we;return s.setQueryData(a,{tiers:{...q.tiers,[p]:A}}),{prev:F}},h=(M,p,A)=>{s.setQueryData(a,A?.prev??we)},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],Mt(k)}function Hn(){const t=ie.c(4),e=Jt(),n=Bn(),s=pt();let o;return t[0]!==s||t[1]!==e||t[2]!==n?(o=jn(e,n,new Set(s.map(Kn))),t[0]=s,t[1]=e,t[2]=n,t[3]=o):o=t[3],o}function Kn(t){return t.id}function le(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 Qn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function Wn(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=Wt([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 rt=new Set,se=new Set;function fe(t){return v.useSyncExternalStore(t.subscribe,t.get,t.get)}function Gn(t){return t.kind==="loading"?"ready":t.kind}const zn=1e4,Xn=10,Ze=v.createContext(null),Ye=v.createContext(null),Je=v.createContext(null),kt=v.createContext(null);function Zn({children:t}){const{locator:e}=J(),{virtualMcpId:n}=yt(),[s,o]=be(ge.chatSelectedImageModel(e),null),[a,l]=be(ge.chatSelectedWebSearchModel(e),null),[c,h]=be(ge.chatSelectedDeepResearchModel(e),null),[m,f]=v.useState(null),[k,M]=v.useState("default"),p=Hn(),[A,F]=be(ge.chatSimpleModeTier(e),null),q=Qn(A),x=pt(),T=p.tiers[q],j=x.some(r=>r.id===T?.keyId)?T?.keyId:void 0,W=m&&x.some(r=>r.id===m)?m:j??x[0]?.id??null,{models:V,isLoading:_}=Se(W??void 0),{models:z}=Se(j),$=x.some(r=>r.id===p.tiers.image?.keyId)?p.tiers.image?.keyId:void 0,{models:ee}=Se($),B=x.some(r=>r.id===p.tiers.web_search?.keyId)?p.tiers.web_search?.keyId:void 0,{models:H}=Se(B),te=x.some(r=>r.id===p.tiers.deep_research?.keyId)?p.tiers.deep_research?.keyId:void 0,{models:K}=Se(te),G=le(T,x,z,T?.title)??Wn(q,x,W,V),ne=_,X=V.filter(r=>r.capabilities?.includes("image")),b=le(s,x,X),E=le(p.tiers.image,x,ee,p.tiers.image?.title)??b??X[0]??null,L=V.filter(Gt),P=le(a,x,L),Q=L.find(r=>r.modelId==="perplexity/sonar")??L[0]??null,pe=le(p.tiers.web_search,x,H,p.tiers.web_search?.title)??P??Q,Z=V.filter(zt),N=le(c,x,Z),ye=Z.find(r=>r.modelId==="perplexity/deep-research")??Z.find(r=>r.asyncResearch===!0)??Z[0]??null,De=le(p.tiers.deep_research,x,K,p.tiers.deep_research?.title)??N??ye,Ue=Qt(n)??{id:n,title:"",description:null,icon:null},[Ce,ve]=v.useState({}),Ae=(r,g)=>{const O=[];for(const w of g.content??[])w.type==="text"&&w.text?.trim()&&O.push(w.text.trim());const R=O.join(`
|
|
30
|
-
`);if(!R){re(r);return}new TextEncoder().encode(R).length>zn||ve(w=>Object.keys(w).length>=Xn&&!(r in w)?w:{...w,[r]:R})},re=r=>{ve(g=>{const{[r]:O,...R}=g;return R})},[Oe,Le]=be(ge.chatLastAgentOption(e),r=>r&&r in Fe?r:null),Y=es(),et=Y?.isThreadLocked&&Y.lockedHarness!=null?fn(Y.lockedHarness,Y.lockedSandbox):null;bn({pendingOption:Oe,lockedHarness:Y?.isThreadLocked?Y.lockedHarness:null});const he=Y?.isThreadLocked?et:"decopilot",Pe=he?Fe[he]:null,d=Pe?.harness??null,u=Pe?.sandbox??null,[D,U]=v.useState(void 0),y=v.useRef(D);y.current=D;const I={selectedModel:G,setModel:()=>{},credentialId:W,setCredentialId:f,allModelsConnections:x,isModelsLoading:ne,selectedVirtualMcp:Ue,imageModel:E,setImageModel:r=>{o(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},webSearchModel:pe,setWebSearchModel:r=>{l(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},deepResearchModel:De,setDeepResearchModel:r=>{h(r?.keyId?{keyId:r.keyId,modelId:r.modelId}:null)},chatMode:k,setChatMode:M,appContexts:Ce,setAppContext:Ae,clearAppContext:re,tiptapDoc:D,setTiptapDoc:U,tiptapDocRef:y,resetInteraction:()=>{},simpleModeTier:q,setSimpleModeTier:r=>F(r),pendingAgentOption:he,setPendingAgentOption:Le,pendingHarnessId:d,pendingSandboxProviderKind:u};return Ie.jsx(Je.Provider,{value:I,children:t})}function Is(t){const e=ie.c(41),{virtualMcpId:n,task:s,children:o}=t,{locator:a}=J(),{data:l}=Tt.useSession(),c=l?.user??null,{taskId:h,virtualMcpId:m,navigateToTask:f}=yt(),[k]=Ct(),{markTaskRead:M}=Tn(),p=jt(),A=h,F=m,q=wn(F);let x;e[0]!==M||e[1]!==f?(x=(P,Q)=>{M(P),f(P,{virtualMcpId:Q?.virtualMcpId,autosend:Q?.autosend})},e[0]=M,e[1]=f,e[2]=x):x=e[2];const T=x,j=A&&s?.id===A?s:null,W=j?.harness_id??null,V=j?.sandbox_provider_kind??null,_=j?.branch??null,z=W!=null,$=_;let ee;e[3]!==$||e[4]!==T||e[5]!==p||e[6]!==n?(ee=()=>{const P=crypto.randomUUID();return p.create({id:P,virtual_mcp_id:n,...$?{branch:$}:{}}).then(()=>T(P)).catch(()=>{T(P)}),P},e[3]=$,e[4]=T,e[5]=p,e[6]=n,e[7]=ee):ee=e[7];const B=ee;let H;e[8]!==$||e[9]!==a||e[10]!==T||e[11]!==p||e[12]!==n?(H=P=>{const Q=crypto.randomUUID(),pe=P.virtualMcpId??n,Z=pe===n?$:null;Ut(sessionStorage,a,Q,P.message),p.create({id:Q,virtual_mcp_id:pe,...Z?{branch:Z}:{}}).then(()=>T(Q,{virtualMcpId:P.virtualMcpId,autosend:!0})).catch(()=>{T(Q,{virtualMcpId:P.virtualMcpId,autosend:!0})})},e[8]=$,e[9]=a,e[10]=T,e[11]=p,e[12]=n,e[13]=H):H=e[13];const te=H;let K;e[14]!==A||e[15]!==p?(K=P=>{A&&p.setBranch(A,P)},e[14]=A,e[15]=p,e[16]=K):K=e[16];let G;e[17]!==j||e[18]!==B||e[19]!==te||e[20]!==$||e[21]!==A||e[22]!==F||e[23]!==z||e[24]!==_||e[25]!==W||e[26]!==V||e[27]!==T||e[28]!==K?(G={virtualMcpId:F,taskId:A,openTask:T,createTask:B,createTaskWithMessage:te,activeTask:j,isThreadLocked:z,lockedHarness:W,lockedSandbox:V,lockedBranch:_,currentBranch:$,setCurrentTaskBranch:K},e[17]=j,e[18]=B,e[19]=te,e[20]=$,e[21]=A,e[22]=F,e[23]=z,e[24]=_,e[25]=W,e[26]=V,e[27]=T,e[28]=K,e[29]=G):G=e[29];const ne=G;let X;e[30]!==q||e[31]!==k||e[32]!==f||e[33]!==c?(X={user:c,contextPrompt:q,preferences:k,rawNavigateToTask:f},e[30]=q,e[31]=k,e[32]=f,e[33]=c,e[34]=X):X=e[34];const b=X;let E;e[35]!==o||e[36]!==b?(E=Ie.jsx(Zn,{children:Ie.jsx(kt.Provider,{value:b,children:o})}),e[35]=o,e[36]=b,e[37]=E):E=e[37];let L;return e[38]!==E||e[39]!==ne?(L=Ie.jsx(Ye.Provider,{value:ne,children:E}),e[38]=E,e[39]=ne,e[40]=L):L=e[40],L}function ws({taskId:t,children:e}){const n=Ee(),s=Vt(),{virtualMcpId:o,activeTask:a,currentBranch:l}=Yn(),c=Lt({isDesktopApp:s,harnessId:a?.harness_id,sandboxProviderKind:a?.sandbox_provider_kind}),h=n("chat.input.codingAgentRequiresDesktop");t&&!rt.has(t)&&(rt.add(t),Pt("chat_opened",{thread_id:t}));const{imageModel:m,webSearchModel:f,deepResearchModel:k,chatMode:M,setChatMode:p,appContexts:A,setTiptapDoc:F,simpleModeTier:q}=Jn(),x=v.useContext(kt);if(!x)throw new Error(n("chat.chatContext.activeTaskProviderMissingContext"));const{user:T,contextPrompt:j,preferences:W,rawNavigateToTask:V}=x,{org:_,locator:z}=J(),$=qn(),[ee,B]=v.useState(null),H=()=>{B(new Error(h))},te=Mn(),K=Ve(),G=Nt(),ne=dt(),X=Ht({connectionId:Kt,orgId:_.id,orgSlug:_.slug}),b=Ft(_.slug,t,{client:X,batch:qt(a?.harness_id)});v.use(b.ready);const E=fe(b.messages),L=fe(b.status),P=fe(b.finishReason),Q=fe(b.runStatusStage),pe=fe(b.hasMoreOlder),Z=fe(b.isFetchingOlder),N=v.useRef({onToolCall:te,queryClient:K,rawNavigateToTask:V,taskId:t,manager:G,navigate:ne,orgId:_.id,orgSlug:_.slug});N.current={onToolCall:te,queryClient:K,rawNavigateToTask:V,taskId:t,manager:G,navigate:ne,orgId:_.id,orgSlug:_.slug},Xt({orgSlug:_.slug,taskId:t,onTaskStatus:d=>{const u=N.current,D=d.data.message_id;if(d.data.status==="in_progress"&&D){qe(u.taskId,D);const U=Fn(u.taskId,D);U&&b.applyLocalMessage(U),oe(u.orgSlug,u.taskId)}Un(u.taskId)&&(async()=>(await oe(u.orgSlug,u.taskId),await b.reconcileFromServer()&&Te(u.taskId).get().length===0&&On(u.taskId)))()}}),v.useEffect(()=>{const d={onData:y=>{if(y.type==="data-thread-title"){const I=y.data;if(!I?.title)return;const r=N.current;if(!r.taskId)return;r.manager.patchThread({id:r.taskId,title:I.title,updated_at:new Date().toISOString()});return}if(y.type==="data-deck-updated"){const I=y.data;if(!I?.path)return;const r=I.path,g=N.current;g.queryClient.invalidateQueries({queryKey:de.orgFsStat(g.orgId,"home",r)}),g.queryClient.invalidateQueries({queryKey:de.orgFsRecent(g.orgId)}),g.navigate({to:".",search:O=>({...O,main:$t(r)}),replace:!0});return}if(y.type==="data-open-preview"){const I=y.data,r=N.current,g=r.taskId;if(g){const O=r.manager.threads.get().find(R=>R.id===g);r.manager.patchThread({id:g,...I?.branch?{branch:I.branch}:{},...I?.sandboxProviderKind?{sandbox_provider_kind:I.sandboxProviderKind}:{},metadata:{...O?.metadata??{},...I?.githubRepo?{githubRepo:I.githubRepo}:{},...I?.sandboxMap?{sandboxMap:I.sandboxMap}:{}}})}r.navigate({to:".",search:O=>({...O,main:"preview"}),replace:!0});return}},onFinish:(y,I,r)=>{const g=N.current;g.taskId&&oe(g.orgSlug,g.taskId),g.taskId&&g.manager.patchThread({id:g.taskId,status:mn(r,y.parts),updated_at:new Date().toISOString()});const O=y.parts?.some(w=>{const me=w;return(me.type==="tool-share_with_user"||me.type==="tool-bash"||me.type==="tool-write")&&me.state==="output-available"});if(g.taskId&&O){const w=de.threadOutputs(g.taskId);for(const me of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{g.queryClient.invalidateQueries({queryKey:w})},me)}g.queryClient.invalidateQueries({queryKey:de.homeNextActions(g.orgSlug)});const R=y.metadata?.thread_id;R&&R!==g.taskId&&g.rawNavigateToTask(R)},onError:y=>{B(y),console.error("[chat] Error",y)},onToolCall:y=>N.current.onToolCall(y)};b.observer=d,oe(N.current.orgSlug,N.current.taskId);const u=y=>y==="submitted"||y==="streaming";let D=u(b.status.get().kind);const U=b.status.subscribe(()=>{const y=u(b.status.get().kind);if(y===D)return;D=y;const I=N.current;oe(I.orgSlug,I.taskId)});return()=>{b.observer===d&&(b.observer=null),U()}},[b]);const ye=L.kind==="submitted"||L.kind==="streaming",De=E.length===0,$e=E.at(-1),Ue=!ye&&$e?.role==="assistant"&&$e.parts.some(d=>"state"in d&&d.state==="approval-requested"),Ce=a,ve=(Ce?.status==="in_progress"||Ce?.status==="expired")&&L.kind==="ready"&&E.length>0;async function Ae(d){const u=t,D=o;if(c)return H(),se.delete(u),!1;const U=Object.entries(A),y=U.length>0?U.map(([R,w])=>`### App Context: ${R}
|
|
31
|
-
${w}`).join(`
|
|
32
|
-
|
|
33
|
-
`):"",I=[j,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=gn({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||G.patchThread({id:u,harness_id:g.harnessId??"decopilot",updated_at:new Date().toISOString()});const O={tier:q,mode:r,toolApprovalLevel:W.toolApprovalLevel??At(),system:I||void 0,agent:{id:D},thread_id:u,...g};try{if(ye||ve){let R=!0;try{Nn(u,d),await b.enqueue(d,O),St(u,{workflowId:`thread-run:${u}:${d.id}`,messageId:d.id,text:Rn(d.parts),hasAttachments:d.parts.some(w=>w.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),$n(u)}catch(w){R=!1,it(u,d.id),qe(u,d.id),B(w instanceof Error?w:new Error(String(w))),ce.error(w instanceof Error?w.message:n("chat.chatContext.failedToQueueMessage"))}return oe(_.slug,u),R}return await b.submit({kind:"message",message:d},O),!0}finally{se.delete(u)}}async function re(d){const u=d.parts??vt(d.tiptapDoc);if(u.length===0||se.has(t))return;se.add(t),B(null),F(void 0);const D={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:D};await Ae(U)}async function Oe(d,u){if(c)return H(),!1;if(se.has(t))return ce.info(n("chat.chatContext.stillSendingPreviousMessage")),!1;if(se.add(t),!await $.cancel(t,d))return se.delete(t),ce.error(n("chat.chatContext.couldNotRemoveOriginalMessage")),!1;it(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 Ae(U)}catch(y){return ce.error(y instanceof Error?y.message:n("chat.chatContext.failedToSendEditedMessage")),!1}}const Le=async()=>{b.stop();try{const d=await fetch(`/api/${_.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");ce.error(u),console.error("[chat] cancelRun",d)}},Y=d=>d&&typeof d=="object"&&"type"in d?re({tiptapDoc:d}):re(d),he=je({strict:!1}).autosend===ut;v.useEffect(()=>{if(!he||E.length>0||c)return;const d=Et(sessionStorage,z,t);d&&re(d.message).then(()=>{Dt(sessionStorage,z,t)})},[he,E.length,c,z,t,re]);const Pe={messages:E,status:Gn(L),sendMessage:Y,editQueuedMessage:Oe,stop:()=>{if(c){H();return}Le()},submit:async(d,u)=>{if(c){H();return}await b.submit(d,u)},removeLocalMessage:d=>b.removeLocalMessage(d),isSendInFlight:()=>se.has(t),error:ee,clearError:()=>B(null),finishReason:P,runStatusStage:Q,clearFinishReason:()=>b.finishReason.set(null),isStreaming:ye,isChatEmpty:De,isWaitingForApprovals:Ue??!1,isRunInProgress:ve,hasMoreOlder:pe,isFetchingOlder:Z,fetchOlderMessages:b.fetchOlderMessages.bind(b)};return Ie.jsx(Ze.Provider,{value:Pe,children:e})}function Ms(){const t=Ee(),e=v.useContext(Ze);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function Ts(){return v.useContext(Ze)}function Yn(){const t=Ee(),e=v.useContext(Ye);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function Jn(){const t=Ee(),e=v.useContext(Je);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function Cs(){return v.useContext(Je)}function es(){return v.useContext(Ye)}export{ws as A,yt as B,Zn as C,Cs as D,sn as E,yn as H,an as S,hs as V,Ms as a,Yn as b,ks as c,qn as d,it as e,_e as f,Vn as g,xs as h,Hn as i,Ts as j,es as k,Is as l,vs as m,us as n,vt as o,ps as p,kn as q,xn as r,Ss as s,ys as t,Jn as u,fs as v,ms as w,bs as x,gt as y,gs as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,j as t,B as K,k as oe,Y as Ze,Z as re,b as Q,E as Ee,r as E,F as fe,bc as Ge,bd as Oe,$ as Xe,m as W,be as et,u as tt,L as te,t as st,f as he,b3 as Re}from"./index-CEdLDEAA.js";import{E as Fe}from"./empty-state-owKXC3o8.js";import{u as ge}from"./use-mcp-client-CbH6VRGA.js";import{F as ae,a as lt,b as ce,d as de}from"./form-DeWN8q_1.js";import{I as pe}from"./input-HNtx0Zqc.js";import{T as xe}from"./textarea-DCPrBM2_.js";import{a as ot,b as nt,V as je,O as it,M as rt}from"./index-BXLlcUzd.js";import{aK as at,V as ct,aL as dt,a1 as mt,ad as ut,aM as pt,a6 as ye}from"./agent-icon-6PN48eXB.js";import{g as xt,M as ft,a as we}from"./index-DIGPBsN_.js";import{A as ht,a as gt,b as jt}from"./alert-Bl68LDwF.js";import{S as Ce,a as Ie,b as $e,c as Te,d as me}from"./select-CS7LSkMB.js";import{b as bt,c as Pe,T as ke,a as Ae}from"./tooltip-D58aKtt6.js";import{i as Nt}from"./AlertCircle-CT1Vda1-.js";import{s as vt}from"./Stars02-HqPdqjox.js";import{a as St}from"./Copy01-MHFArsKW.js";import{i as yt}from"./Play-CDYSljWl.js";import{i as wt}from"./ChevronRight-CNAPLLgl.js";import{g as Ct}from"./connection-slug-eyAPH6o3.js";import{u as It,T as $t}from"./use-mcp-auth-status-C-OW2Sh9.js";import{a as Me,u as ze}from"./use-connection-DqlBxSxU.js";import{a as Tt}from"./use-mcp-tools-CvYorOot.js";import{M as Pt,c as kt}from"./monaco-editor-DxOyQFTd.js";import{I as De}from"./integration-icon-DZAQT7b4.js";import{j as At,D as Dt}from"./chat-context-DSVU-Wdj.js";import{u as Et}from"./shell-layout-IrSF4vBc.js";import{a as Ot}from"./Tool02-f4cggfek.js";import"./auth-0oxc70vP.js";import"./label-C_6cjt6L.js";import"./index-BbSeHWzc.js";import"./sidebar-CxqL3ymz.js";import"./LayoutLeft-M_0PEtZB.js";import"./use-mobile-Ba5JGjny.js";import"./X-Bio89LMx.js";import"./Key01-B-2R1ZuS.js";import"./extract-connection-data-RBeNwZod.js";import"./metadata-dUsYcpuu.js";import"./use-registry-connections-BQ-qHpvw.js";import"./use-organization-settings-Dy5ifd9c.js";import"./studio-tools-GPb7OAbs.js";import"./Plus-B8Fp-uPP.js";import"./index-BhH-15Yq.js";import"./popover-aywGfvt3.js";import"./use-virtual-mcp-Ffm9narY.js";import"./Check-DKSVtPgB.js";import"./SearchMd-TCQIcUNv.js";import"./Users03-Cubz8plF.js";import"./use-create-virtual-mcp-h29MWxLI.js";import"./use-navigate-to-agent-v_msuRK8.js";import"./hooks-Dk1fYF5C.js";import"./decopilot-sse-pool-DxdJdhNu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-DrekBx2F.js";import"./ArrowUp-BW8m6yuk.js";import"./Settings02-DpOYWrho.js";import"./XCircle-BNbdsBJE.js";import"./ArrowUpRight-CfZYO-uI.js";import"./TrendUp01-BY9xhAkx.js";import"./ZapSquare-B0F44YUx.js";import"./CheckCircle-B2Ham_Ku.js";import"./ChevronDown-XduUmQT8.js";import"./ChevronUp-CmwEFUkY.js";import"./DotsVertical-D7_z7rxq.js";import"./CpuChip01-DaWYaD2O.js";import"./Eye-C--UGYIN.js";import"./FilterLines-AuQ7dcpe.js";import"./Star01-DCrAYCg2.js";import"./Palette-Dfz37bMR.js";import"./SwitchHorizontal01-DbwoldJG.js";import"./HardDrive-GPfm6kn5.js";import"./LinkExternal01-CYlScGIe.js";import"./LogOut01-BP509aaC.js";import"./Monitor01-B_mbAV5l.js";import"./Sun-Bp4LoN0q.js";import"./SearchLg-DSNE_kzb.js";import"./Shield01-pA5IS0Gy.js";import"./Stars01-CDw3ILjF.js";import"./Trash01-DrdtrRyV.js";import"./Upload01-MfdrmtQ1.js";import"./User01-BiNLMs3u.js";import"./Users01-CUKHhGDQ.js";import"./XClose-DfxPXTPd.js";import"./Zap-D8gG88Mb.js";import"./badge-C7TPZgd1.js";import"./mcp-oauth-BMYIe3Z0.js";import"./spinner-DlE_5plH.js";import"./tab-id-BPlSueXP.js";import"./dialog-h-UdyNtv.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CMg1asW3.js";import"./use-decopilot-events-CRPJ09kV.js";import"./avatar-nAUbnUE8.js";import"./required-auth-layout-A8YhZ8Bt.js";import"./use-org-sso-GGzUcbSy.js";function Rt(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(at,{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(ct,{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}Ze({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 Ft(){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 Mt(s){const e=k.c(43),{form:n}=s,l=Q();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(lt,{...n,children:y}),e[40]=n,e[41]=y,e[42]=P):P=e[42],P}function zt(s){const e=k.c(42),{providerId:n,promptId:l}=s,o=Q(),{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=Ge(n,"PROMPT",l,d),x=Oe(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=Xe(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 R;return e[19]!==C||e[20]!==I?(R=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Fe,{title:C,description:I})}),e[19]=C,e[20]=I,e[21]=R):R=e[21],R}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(nt,{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(ot,{children:t.jsx(Rt,{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(Mt,{form:p})}),e[36]=p,e[37]=D):D=e[37];let O;return e[38]!==A||e[39]!==D||e[40]!==w?(O=t.jsxs(je,{children:[w,A,D]}),e[38]=A,e[39]=D,e[40]=w,e[41]=O):O=e[41],O}function Lt(s){const e=k.c(10),{itemId:n}=s,l=Q();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Ft(),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(Fe,{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(Ee,{children:t.jsx(E.Suspense,{fallback:null,children:t.jsx(zt,{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=W("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=W("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 Z(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=W("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=W("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=W("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=W("[&>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=Q();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(it,{onAuthenticate:()=>r(),buttonText:c("details.tool.goBackToAuthenticate")}):t.jsx(rt,{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=Q(),{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]=E.useState(c??{}),[x,h]=E.useState(r?JSON.stringify(r,null,2):"{}"),[m,f]=E.useState(null),[p,g]=E.useState(null),[b,S]=E.useState(null),[T,y]=E.useState(null),[P,w]=E.useState(!1),[N,A]=E.useState(null),{org:D}=fe(),O=Me(e),C=At(),I=Dt(),{openSidePanel:R}=Et(),U=`${e}:${s}`,M=ge({connectionId:e,orgId:D.id,orgSlug:D.slug}),V=Tt({client:M}),v=V.data?.tools?.find(u=>u.name===s),F=xt(v?._meta),J=u=>{if(!C)return;const j=kt(u.content);j.content.length>0&&(R("chat"),C.sendMessage({tiptapDoc:j}))},[z,L]=E.useState("json"),[q,Y]=E.useState(!1);F&&!q&&(L("ui"),Y(!0));const _=v?.inputSchema?.properties,be=_?Object.keys(_):[],G=be.length>0,X={};if(G&&v?.inputSchema?.properties)for(const u of be)X[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(!M)throw new Error("MCP client is not available");const j=G?{...X,...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.")})();G&&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 M.callTool({name:s,arguments:j}),ee=$.structuredContent??$,We=performance.now(),Qe=Math.round(We-u);f(ee),g($),S(j);const Ye=JSON.stringify(ee),ve=new TextEncoder().encode(Ye).length;A({duration:`${Qe}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(Z,{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,{}),O&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:D.slug,appSlug:Ct(O)},search:{tab:"tools"},children:O.title})})}),t.jsx(le,{})]}),t.jsx(Z,{children:t.jsx(Ue,{children:Je})})]})}),Ne=n.length>1&&t.jsxs(Ce,{value:e,onValueChange:l,children:[t.jsx(Ie,{className:"h-8 w-auto min-w-[200px]",children:t.jsx($e,{})}),t.jsx(Te,{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:G&&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]??"":X[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enterAsJson",{key:u}),rows:3}):j.type==="boolean"?t.jsxs(Ce,{value:ne(u)?String(d[u]??""):"",onValueChange:$=>ie(u,$==="true"),children:[t.jsx(Ie,{children:t.jsx($e,{placeholder:o("details.tool.selectTrueOrFalse")})}),t.jsxs(Te,{children:[t.jsx(me,{value:"true",children:"true"}),t.jsx(me,{value:"false",children:"false"})]})]}):t.jsx(pe,{value:ne(u)?d[u]??"":X[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enter",{key:u})})]},u)):v?.inputSchema&&!G?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(dt,{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(mt,{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(ut,{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})})]}),F&&t.jsx(bt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Pe,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(K,{size:"icon",variant:z==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("ui"),children:t.jsx(pt,{size:14})})}),t.jsx(Ae,{children:o("details.tool.interactiveView")})]}),t.jsxs(Pe,{children:[t.jsx(ke,{asChild:!0,children:t.jsx(K,{size:"icon",variant:z==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("json"),children:t.jsx(ye,{size:14})})}),t.jsx(Ae,{children:o("details.tool.jsonView")})]})]})})]})]}),T&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(ht,{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(gt,{className:"mb-0",children:o("details.tool.executionFailed")})]}),t.jsx(jt,{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:F&&z==="ui"&&M?t.jsx(E.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(ft,{resourceURI:F,toolInfo:v?{tool:v}:void 0,toolInput:b??void 0,toolResult:p??void 0,displayMode:"fullscreen",minHeight:we.view.minHeight,maxHeight:we.view.maxHeight,client:M,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)),st.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(ye,{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:O?.icon||null,name:O?.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=Q(),[r,c]=E.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(!Me(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(E.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=W("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:W(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=Re();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=ze(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 Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=k.c(52),e=Re();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=Q(),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=ze(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=Oe(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=Wt(i),s[14]=i,s[15]=D):D=s[15];const O=D;let C;s[16]!==a.slug?(C=t.jsx(Z,{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 R;s[19]!==i||s[20]!==m||s[21]!==a.slug||s[22]!==l.appSlug?(R=m&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{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]=R):R=s[23];let U;s[24]!==O?(U=t.jsx(Z,{children:t.jsx(Ue,{children:O})}),s[24]=O,s[25]=U):U=s[25];let M;s[26]!==R||s[27]!==U||s[28]!==C?(M=t.jsx(Le,{children:t.jsxs(Be,{children:[C,I,R,U]})}),s[26]=R,s[27]=U,s[28]=C,s[29]=M):M=s[29];const V=M;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(Ot,{size:36,className:"text-muted-foreground"}),s[35]=v):v=s[35];let F;s[36]!==o?(F=o("orgs.collectionDetail.noComponentDefinedTitle"),s[36]=o,s[37]=F):F=s[37];let J;s[38]!==o?(J=o("orgs.collectionDetail.noComponentDefinedDescription"),s[38]=o,s[39]=J):J=s[39];let z;s[40]!==o?(z=o("orgs.collectionDetail.goBackButton"),s[40]=o,s[41]=z):z=s[41];let L;s[42]!==d||s[43]!==z?(L={onClick:d,children:z},s[42]=d,s[43]=z,s[44]=L):L=s[44];let q;s[45]!==F||s[46]!==J||s[47]!==L?(q=t.jsx(Jt,{icon:v,title:F,description:J,buttonProps:L}),s[45]=F,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(Qt,{}),s[2]=i):i=s[2],i}function zl(){const s=k.c(7),e=Q();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(Ee,{children:t.jsx(E.Suspense,{fallback:l,children:o})}),s[5]=l,s[6]=i):i=s[6],i}export{zl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Y as be,a5 as $e,b8 as De,Z as me,a3 as Oe,c as R,b as H,j as t,k as ve,B,r as Z,m as Ne,F as te,x as Me,K as ae,d as se,au as ue,D as ze,E as Ee,f as Ue,b9 as Re,o as Ve,$ as Fe,_ as Le,t as Y}from"./index-CEdLDEAA.js";import{g as Be}from"./extract-connection-data-RBeNwZod.js";import{E as Se}from"./empty-state-owKXC3o8.js";import{E as He,c as qe,r as Ge,b as Ke,d as Qe}from"./connection-form-helpers-CNpigz6y.js";import{c as Xe,S as We,V as Je}from"./index-BXLlcUzd.js";import{u as ye,T as Ye}from"./use-mcp-auth-status-C-OW2Sh9.js";import{u as Ze}from"./use-members-Cc8G0stB.js";import{A as et}from"./avatar-nAUbnUE8.js";import{a as Ce,b as _e,u as tt}from"./use-connection-DqlBxSxU.js";import{u as we}from"./use-mcp-client-CbH6VRGA.js";import{a as st}from"./use-mcp-tools-CvYorOot.js";import{c as nt,C as it,a as ot,d as at}from"./AreaChart-CiJy3yHG.js";import{i as lt,a as rt}from"./mcp-oauth-BMYIe3Z0.js";import{I as le}from"./integration-icon-DZAQT7b4.js";import{s as ct}from"./Plus-B8Fp-uPP.js";import{U as dt,a as mt,aJ as ut,a4 as xt}from"./agent-icon-6PN48eXB.js";import{a as ke,s as pt}from"./Settings02-DpOYWrho.js";import{s as ce}from"./Trash01-DrdtrRyV.js";import{q as ft,p as ht,o as gt,m as jt,n as bt}from"./sidebar-CxqL3ymz.js";import{F as K,b as Q,c as X,d as L,e as W,f as vt,a as Nt}from"./form-DeWN8q_1.js";import{I as J}from"./input-HNtx0Zqc.js";import{u as St,D as yt}from"./use-delete-connection-BuY4wFY1.js";import{c as Ct,B as _t,a as wt,C as kt}from"./monitoring-stats-row-tt2cqmHS.js";import{u as It}from"./studio-tools-GPb7OAbs.js";import{a as Tt}from"./use-virtual-mcp-Ffm9narY.js";import{i as Ie}from"./ChevronRight-CNAPLLgl.js";import{a as Te}from"./Users03-Cubz8plF.js";import{b as ne,c as At,T as ie,a as Pt}from"./tabs-BI5AKYPo.js";import{g as Ae}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-B0F44YUx.js";import{d as Dt}from"./Tool01-DrekBx2F.js";import{g as de,M as Ot}from"./index-DIGPBsN_.js";import{C as Mt}from"./collection-search-BAdFeMaK.js";import{C as zt}from"./card-CxST7PR_.js";import{B as Et}from"./badge-C7TPZgd1.js";import{c as Ut,D as Rt,b as Vt,a as xe}from"./dropdown-menu-CPRYVx7l.js";import{S as pe,a as fe,b as he,c as ge,d as G}from"./select-CS7LSkMB.js";import{i as Ft}from"./CheckCircle-B2Ham_Ku.js";import{t as Lt}from"./ChevronDown-XduUmQT8.js";import{a as Bt}from"./Tool02-f4cggfek.js";import{s as oe}from"./Star01-DCrAYCg2.js";import{s as Ht}from"./XClose-DfxPXTPd.js";import{p as qt,i as Gt}from"./connection-Co_z0yly.js";import"./metadata-dUsYcpuu.js";import"./index-BbSeHWzc.js";import"./Key01-B-2R1ZuS.js";import"./auth-0oxc70vP.js";import"./use-registry-connections-BQ-qHpvw.js";import"./use-organization-settings-Dy5ifd9c.js";import"./index-BhH-15Yq.js";import"./popover-aywGfvt3.js";import"./tooltip-D58aKtt6.js";import"./Check-DKSVtPgB.js";import"./SearchMd-TCQIcUNv.js";import"./use-mobile-Ba5JGjny.js";import"./use-create-virtual-mcp-h29MWxLI.js";import"./use-navigate-to-agent-v_msuRK8.js";import"./hooks-Dk1fYF5C.js";import"./decopilot-sse-pool-DxdJdhNu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-C--UGYIN.js";import"./use-org-auth-client-FK00uheF.js";import"./User01-BiNLMs3u.js";import"./AlertCircle-CT1Vda1-.js";import"./ArrowUp-BW8m6yuk.js";import"./XCircle-BNbdsBJE.js";import"./ArrowUpRight-CfZYO-uI.js";import"./TrendUp01-BY9xhAkx.js";import"./ChevronUp-CmwEFUkY.js";import"./DotsVertical-D7_z7rxq.js";import"./Stars02-HqPdqjox.js";import"./Copy01-MHFArsKW.js";import"./CpuChip01-DaWYaD2O.js";import"./FilterLines-AuQ7dcpe.js";import"./Palette-Dfz37bMR.js";import"./SwitchHorizontal01-DbwoldJG.js";import"./HardDrive-GPfm6kn5.js";import"./LayoutLeft-M_0PEtZB.js";import"./LinkExternal01-CYlScGIe.js";import"./LogOut01-BP509aaC.js";import"./Monitor01-B_mbAV5l.js";import"./Sun-Bp4LoN0q.js";import"./Play-CDYSljWl.js";import"./SearchLg-DSNE_kzb.js";import"./Shield01-pA5IS0Gy.js";import"./Stars01-CDw3ILjF.js";import"./Upload01-MfdrmtQ1.js";import"./Users01-CUKHhGDQ.js";import"./X-Bio89LMx.js";import"./Zap-D8gG88Mb.js";import"./label-C_6cjt6L.js";import"./alert-dialog-CkaJnSQD.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(dt,{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(mt,{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(ct,{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=It(),o=es(a),{data:r}=Me({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=Ct(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(nt,{config:ts,className:"h-16 w-full",children:t.jsxs(_t,{data:p,barCategoryGap:"4%",children:[t.jsx(it,{content:t.jsx(ot,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(wt,{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(kt,{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=Tt(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(Mt,{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(zt,{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(Ot,{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.name}),t.jsx(Ye,{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(ne,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ne,{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(ne,{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(ne,{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(At,{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(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children: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(ie,{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(ie,{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(ie,{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(ie,{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(Pt,{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(ut,{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($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children: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}=ze(),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(oe,{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(oe,{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(oe,{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(oe,{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(xt,{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(He,{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(pt,{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(vt,{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=Ge(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=Ke(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Qe(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=Ve(),d=_e(),{org:f}=te(),u=St({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}=Ze(),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=Xe(D,Qt),v=Fe({resolver:Le(qe),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 rt({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(yt,{...u}),t.jsx(ft,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{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(et,{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(Nt,{...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(We,{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(Je,{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=Be("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 lt({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}=Ue(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=tt(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}=st(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:$}=at(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Re(_);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(Ee,{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 bi(){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{bi as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as se,b as Me,r as u,j as r,k as fe,B as De,e5 as Jt,ay as Zt,aE as xe,e6 as en,e7 as tn,e8 as nn,e9 as rn,bP as on,ea as sn,eb as lt,aA as an,ec as ln,ed as cn,ee as dn,ef as un,eg as fn,eh as pn,ei as mn,ej as xn,ek as hn,m as le,o as gn,t as ne,K as Ze}from"./index-CEdLDEAA.js";import{F as bn,l as yn}from"./monaco-editor-DxOyQFTd.js";import{C as vn,f as Cn,a_ as wn,a$ as jn}from"./agent-icon-6PN48eXB.js";import{s as Nn}from"./XClose-DfxPXTPd.js";import{l as En}from"./automation-runs-D4o6uJsl.js";import{c as et,T as tt,a as nt}from"./tooltip-D58aKtt6.js";import{a as Sn}from"./chat-context-DSVU-Wdj.js";import{u as Dn}from"./shell-layout-IrSF4vBc.js";import{i as Mn,E as Rn,a as Ae,b as Tn,f as Pn,g as kn,c as Fn,t as re,d as we,e as Le,h as je,j as Oe,k as Ie,l as An,s as Ln,v as On,m as $e,n as Ne,o as rt,p as In,q as Ee,r as Ke,w as $n,x as Kn,y as zn,z as _n}from"./index-DxLBfYsO.js";import{b as Gn,h as Bn,a as Vn,c as Un,d as Hn,e as qn}from"./dialog-h-UdyNtv.js";import{I as ot}from"./input-HNtx0Zqc.js";import{A as Wn,a as Qn,b as Xn,c as Yn,d as Jn,e as Zn,f as er,g as tr}from"./alert-dialog-CkaJnSQD.js";import{t as nr}from"./ChevronDown-XduUmQT8.js";import{i as rr}from"./ChevronRight-CNAPLLgl.js";import"./spinner-DlE_5plH.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-CT1Vda1-.js";import"./Tool01-DrekBx2F.js";import"./ArrowUp-BW8m6yuk.js";import"./Settings02-DpOYWrho.js";import"./Tool02-f4cggfek.js";import"./XCircle-BNbdsBJE.js";import"./ArrowUpRight-CfZYO-uI.js";import"./TrendUp01-BY9xhAkx.js";import"./ZapSquare-B0F44YUx.js";import"./Users03-Cubz8plF.js";import"./CheckCircle-B2Ham_Ku.js";import"./Check-DKSVtPgB.js";import"./ChevronUp-CmwEFUkY.js";import"./DotsVertical-D7_z7rxq.js";import"./Stars02-HqPdqjox.js";import"./Copy01-MHFArsKW.js";import"./CpuChip01-DaWYaD2O.js";import"./Eye-C--UGYIN.js";import"./FilterLines-AuQ7dcpe.js";import"./Star01-DCrAYCg2.js";import"./Palette-Dfz37bMR.js";import"./SwitchHorizontal01-DbwoldJG.js";import"./HardDrive-GPfm6kn5.js";import"./Key01-B-2R1ZuS.js";import"./LayoutLeft-M_0PEtZB.js";import"./LinkExternal01-CYlScGIe.js";import"./LogOut01-BP509aaC.js";import"./Monitor01-B_mbAV5l.js";import"./Sun-Bp4LoN0q.js";import"./Play-CDYSljWl.js";import"./Plus-B8Fp-uPP.js";import"./SearchLg-DSNE_kzb.js";import"./SearchMd-TCQIcUNv.js";import"./Shield01-pA5IS0Gy.js";import"./Stars01-CDw3ILjF.js";import"./Trash01-DrdtrRyV.js";import"./Upload01-MfdrmtQ1.js";import"./User01-BiNLMs3u.js";import"./Users01-CUKHhGDQ.js";import"./X-Bio89LMx.js";import"./Zap-D8gG88Mb.js";import"./select-CS7LSkMB.js";import"./useInfiniteQuery-CIdU8zaX.js";import"./use-infinite-scroll-B6f2rvDK.js";import"./use-connection-DqlBxSxU.js";import"./use-mcp-client-CbH6VRGA.js";import"./auth-0oxc70vP.js";import"./use-virtual-mcp-Ffm9narY.js";import"./card-CxST7PR_.js";import"./sidebar-CxqL3ymz.js";import"./use-mobile-Ba5JGjny.js";import"./table-yMd-ysMj.js";import"./empty-state-owKXC3o8.js";import"./use-members-Cc8G0stB.js";import"./use-org-auth-client-FK00uheF.js";import"./use-clock-tick-CI08Mmp8.js";import"./use-automations-sK4gm0lB.js";import"./studio-tools-GPb7OAbs.js";import"./useSuspenseInfiniteQuery-CRyCnL_Q.js";import"./avatar-nAUbnUE8.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dc2zEVVx.js";import"./calendar-DflxrfDH.js";import"./tab-id-BPlSueXP.js";import"./hooks-Dk1fYF5C.js";import"./decopilot-sse-pool-DxdJdhNu.js";import"./backoff-CrEUbyZT.js";import"./index-DIGPBsN_.js";import"./integration-icon-DZAQT7b4.js";import"./use-navigate-to-agent-v_msuRK8.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CiJy3yHG.js";import"./form-DeWN8q_1.js";import"./label-C_6cjt6L.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CMg1asW3.js";import"./use-decopilot-events-CRPJ09kV.js";import"./use-organization-settings-Dy5ifd9c.js";import"./required-auth-layout-A8YhZ8Bt.js";import"./use-org-sso-GGzUcbSy.js";import"./drawer-EdmUkKNT.js";import"./collection-search-BAdFeMaK.js";import"./index-CcxifCya.js";import"./get-initials-D-f_fDFw.js";import"./popover-aywGfvt3.js";import"./dropdown-menu-CPRYVx7l.js";import"./github-repo-picker-o8v5oAL0.js";import"./use-debounced-value-CXIGbeRl.js";import"./authenticate-and-persist-oauth-CnnloxGX.js";import"./mcp-oauth-BMYIe3Z0.js";import"./use-mcp-tools-CvYorOot.js";import"./extract-connection-data-RBeNwZod.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-B2s3ApVy.js";import"./use-tags-DeZcjykM.js";import"./skeleton-D6YbAWwm.js";import"./command-DdkloL5q.js";import"./index-BhH-15Yq.js";import"./companions-core-CrqyIrvA.js";import"./tabs-BI5AKYPo.js";import"./toggle-group-B1yWxSP3.js";import"./use-deco-credits-BH2bg0UO.js";import"./toolbar-D-16WLmG.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DIyBBD3g.js";import"./use-registry-connections-BQ-qHpvw.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DCPrBM2_.js";import"./connection-form-helpers-CNpigz6y.js";import"./collection-tabs-BwVPtFSB.js";import"./badge-C7TPZgd1.js";import"./select-model-DXu1robt.js";import"./checkbox-OoJa9LkI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CymQlmfF.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CsGyaN7B.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-uyk0FDWU.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-C-OW2Sh9.js";import"./use-debounced-autosave-D2OSHXg-.js";import"./index-BbSeHWzc.js";import"./search-input-Kzdqefxt.js";import"./switch-LoEIjRNg.js";import"./use-secrets-C0VtSmLk.js";import"./useQueries-ChfVENok.js";import"./use-file-configs-DqAW69yO.js";import"./automation-list-row-CtNuBGQb.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,N=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(N),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(N));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(Gn,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Bn,{children:D}),e[15]=D,e[16]=M):M=e[16];let j;e[17]!==P||e[18]!==M?(j=r.jsxs(Vn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=j):j=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Un,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==j?(U=r.jsx(Hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[j,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=j,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(qn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",N=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(Wn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Qn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Xn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Yn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let j;e[33]!==P||e[34]!==D||e[35]!==M?(j=r.jsx(Jn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=j):j=e[36];let R;e[37]!==S||e[38]!==j?(R=r.jsxs(Zn,{children:[S,j]}),e[37]=S,e[38]=j,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(er,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==N||e[45]!==E?(T=r.jsx(tr,{open:N,onOpenChange:m,children:E}),e[43]=m,e[44]=N,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),N=on(a),d=u.useCallback(x=>{f(x),N(x)},[N]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),N=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(N.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),N.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var jr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=jr;var Nr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=Nr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:N,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let j;e[4]!==v||e[5]!==N?(j=()=>{N(),v()},e[4]=v,e[5]=N,e[6]=j):j=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(rr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(vn,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==j||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:j,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=j,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:N}=An(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=N.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function ka({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,N]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,j]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=Sn(),{openSidePanel:yt}=Dn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=zn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function jt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function Nt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),N(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=je(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),jt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=On(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await Nt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Mn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?_n(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),N(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Rn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=Ln(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),j(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A($n(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S(Kn(o.results??"")),j((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),j(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),j(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),Ne("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await In(i,e,s);Ne("git status after save",o)}catch(o){Ne("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){Ne("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){N(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);N(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?je(g.path):d?je(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Tn(h,f),Xe=Pn(qt,v),Fe=F?.length??0,Ye=kn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(Cn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Qe("new-file"),children:r.jsx(wn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Qe("new-folder"),children:r.jsx(jn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(En,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!y&&Xe.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=v.has(n.path),C=g?.path===n.path,ce=Fn(n.path,n.kind),Ce=c&&Y.has(n.path);return r.jsx(zr,{node:n,depth:o,isExpanded:p,isSelected:C,isLoading:Ce,fileVisual:Le(n.name),onSelect:()=>k(n),onOpen:()=>{c?Vt(n.path,p):me(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>_e(w,"Path",we(n.path)),onCopyRelativePath:()=>_e(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Pe(n)},n.path)}),!y&&T&&Xe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Fe>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Fe,Fe>=it?"+":""]})]}),F!==null&&F.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),F?.map(t=>{const n=t.split("/").pop()??t,o=je(t),{Icon:c,color:p}=Le(n),C=d===t;return r.jsxs("button",{type:"button",onClick:()=>me(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",C&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),y&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),Je>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Je,M?"+":""]}),P&&r.jsx(fe,{size:10,className:"animate-spin"})]}),!P&&I!==null&&Ye.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ye.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Le(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>Kt(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(Vr,{text:p.text,query:y})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[Z.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:Z.map(t=>{const n=_.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=d===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),He(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:C=>{C.stopPropagation(),Gt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Yt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&he(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&de?.loaded?r.jsx(bn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:de.editorValue,path:d,onChange:t=>{const n=d;n&&te(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Xt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!de?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[w(Wt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Oe(d)]})]})]}),r.jsx(sr,{open:H!==null,mode:H?.mode??"new-file",initialName:H?.mode==="rename"?H.node.name:"",parentLabel:H&&H.mode!=="rename"?H.parentDir==="/"?"/":re(H.parentDir):void 0,isPending:be,onSubmit:t=>Mt(w,t),onOpenChange:t=>{!t&&!be&&oe(null)}}),r.jsx(ar,{deleteTarget:Te,deleteDirtyPaths:Qt,fsActionPending:be,onOpenChange:t=>{!t&&!be&&Pe(null)},onConfirm:t=>{Dt(w,t)}})]})}export{ka as FileExplorer};
|