decocms 4.52.2 → 4.52.3
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-ClNAIcG0.js → AlertCircle-B53JhFAu.js} +1 -1
- package/dist/client/assets/{ArrowUp-DY8HR8F0.js → ArrowUp-BRSr5Hko.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DjTrxTn1.js → ArrowUpRight-H0WTVT37.js} +1 -1
- package/dist/client/assets/{Check-BaUMJ78L.js → Check-C_CIFiKi.js} +1 -1
- package/dist/client/assets/{CheckCircle-BDnR8A1L.js → CheckCircle-BHN-wFbK.js} +1 -1
- package/dist/client/assets/{ChevronDown-wNYjMtTF.js → ChevronDown-BfG3lHhC.js} +1 -1
- package/dist/client/assets/{ChevronRight-C-TpN8He.js → ChevronRight-Dqs4UYfi.js} +1 -1
- package/dist/client/assets/{ChevronUp-C6irMbKQ.js → ChevronUp-D1yQd_10.js} +1 -1
- package/dist/client/assets/{Circle-YG_2bf45.js → Circle-BMe_lNRs.js} +1 -1
- package/dist/client/assets/{Copy01-_g0t0qlZ.js → Copy01-I5E-L-KP.js} +1 -1
- package/dist/client/assets/{DotsVertical-DTKbesDy.js → DotsVertical-DCj3Pe-o.js} +1 -1
- package/dist/client/assets/{Eye-B0b47qlC.js → Eye-Fa6zzcvh.js} +1 -1
- package/dist/client/assets/{FilterLines-CgaBTy3e.js → FilterLines-Dabon75B.js} +1 -1
- package/dist/client/assets/{Globe01-XPkeFMHR.js → Globe01-D8Lfegq4.js} +1 -1
- package/dist/client/assets/{Globe04-BrUOkeSn.js → Globe04-BKaoGJE9.js} +1 -1
- package/dist/client/assets/{HardDrive-C0Mdm8TH.js → HardDrive-CmlVCNCP.js} +1 -1
- package/dist/client/assets/{Key01-X2Cp5G1j.js → Key01-BlVS9wch.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DlvxEfnj.js → LayoutLeft-CvxAKnEI.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DbsJ_E6N.js → LinkExternal01-3dZq5bY0.js} +1 -1
- package/dist/client/assets/{List-Bk3antXp.js → List-DoWo7FQN.js} +1 -1
- package/dist/client/assets/{Loading02-Q-5W4uzZ.js → Loading02-CQnI4ICL.js} +1 -1
- package/dist/client/assets/{Monitor01-CNRD_PE8.js → Monitor01-CadwJLnk.js} +1 -1
- package/dist/client/assets/{Palette-DjHatrbR.js → Palette-BJcNGJoP.js} +1 -1
- package/dist/client/assets/{Play-CeoTbFcX.js → Play-CgD79iZg.js} +1 -1
- package/dist/client/assets/{Plus-BMHnzEgp.js → Plus-D63gaaHA.js} +1 -1
- package/dist/client/assets/{SearchLg-V_Q9UCyP.js → SearchLg-MLCu3K6z.js} +1 -1
- package/dist/client/assets/{SearchMd-DANDIa_n.js → SearchMd-evNv9trP.js} +1 -1
- package/dist/client/assets/{Settings02-C8t-YS9f.js → Settings02-Ddh7L72a.js} +1 -1
- package/dist/client/assets/{Shield01-Dn1dWDdY.js → Shield01-CoyB298o.js} +1 -1
- package/dist/client/assets/{Star01-CFBLrKzQ.js → Star01-D1xnxtGT.js} +1 -1
- package/dist/client/assets/{Stars01-CdPO3Nl2.js → Stars01-IimVOfNw.js} +1 -1
- package/dist/client/assets/{Stars02-u80z6or-.js → Stars02-D3yMrrs0.js} +1 -1
- package/dist/client/assets/{Sun-BntcwdNi.js → Sun-icg_V74A.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C5lh09BG.js → SwitchHorizontal01-DDDazbVr.js} +1 -1
- package/dist/client/assets/{Tool01-B8q9vFcz.js → Tool01-FgDVN5Aa.js} +1 -1
- package/dist/client/assets/{Trash01-CfJ0a-B-.js → Trash01-Cf4xz_lu.js} +1 -1
- package/dist/client/assets/{Upload01-D_QZcVHs.js → Upload01-DqR1L_zb.js} +1 -1
- package/dist/client/assets/{User01-Darruqx_.js → User01-2BQwgTbP.js} +1 -1
- package/dist/client/assets/{Users01-Bus8Z2ZL.js → Users01-CHhUYr_-.js} +1 -1
- package/dist/client/assets/{Users03-C1C_-4H4.js → Users03-BubKtGEN.js} +1 -1
- package/dist/client/assets/{X-DuH9meaW.js → X-DNthiYnC.js} +1 -1
- package/dist/client/assets/{XCircle-DDi-eHUx.js → XCircle-CowkXBTi.js} +1 -1
- package/dist/client/assets/{XClose-GdiLhRNK.js → XClose-B9_O9ZwX.js} +1 -1
- package/dist/client/assets/{Zap-Dy75gJ9Z.js → Zap-DptPhcrr.js} +1 -1
- package/dist/client/assets/{ZapSquare-P6cQPzc4.js → ZapSquare-DM6ZWSzD.js} +1 -1
- package/dist/client/assets/{ZoomOut-DP0DgIxq.js → ZoomOut-BmpdGZEc.js} +1 -1
- package/dist/client/assets/{access-gate-B7VqgZu1.js → access-gate-DzI7fje7.js} +1 -1
- package/dist/client/assets/{add-section-modal-BfmN6P7x.js → add-section-modal-Cl2Q63YX.js} +1 -1
- package/dist/client/assets/{agent-capabilities-B1SWagyu.js → agent-capabilities-DlIlOn9g.js} +1 -1
- package/dist/client/assets/{agent-icon-DgEjd-zg.js → agent-icon-DiJCyVK_.js} +1 -1
- package/dist/client/assets/{agents-list-DNHcK1QD.js → agents-list-C6ag4VGE.js} +1 -1
- package/dist/client/assets/{ai-providers-DTLfG4EU.js → ai-providers-Cn8GiYb0.js} +1 -1
- package/dist/client/assets/{alert-Q_eEr_y9.js → alert-BNE2objS.js} +1 -1
- package/dist/client/assets/{alert-dialog-B1rOkStA.js → alert-dialog-Bb_E0Ib3.js} +1 -1
- package/dist/client/assets/{app-editor-BRbNZS9F.js → app-editor-u7WWlq5N.js} +1 -1
- package/dist/client/assets/{auth-USBWp_2D.js → auth-X2zOoLs3.js} +1 -1
- package/dist/client/assets/{auth-catchall-DQYMKZjA.js → auth-catchall-B5n0qWQs.js} +1 -1
- package/dist/client/assets/{auth-entry-BfHZrcV5.js → auth-entry-8VtUevv2.js} +1 -1
- package/dist/client/assets/{auth-split-layout-VPCmaeTK.js → auth-split-layout-cRqLGO3N.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DcLeuVqz.js → authenticate-and-persist-oauth-uQHwVym9.js} +1 -1
- package/dist/client/assets/{automation-list-row-CoXbNmPR.js → automation-list-row-DMW0IRGB.js} +1 -1
- package/dist/client/assets/{automation-runs-B6W-oQ-b.js → automation-runs-Dt4hr7e4.js} +1 -1
- package/dist/client/assets/{automations-obFho4ZR.js → automations-CHbcRBgK.js} +1 -1
- package/dist/client/assets/{autosend-CmW2aOxR.js → autosend-hpJ3sd0t.js} +1 -1
- package/dist/client/assets/{avatar-BRw1vbr3.js → avatar-7MpZ9q34.js} +1 -1
- package/dist/client/assets/{badge-CVxnahFC.js → badge-DK3Lxhxf.js} +1 -1
- package/dist/client/assets/{block-document-Q6RnxK7S.js → block-document-D52oI8HZ.js} +1 -1
- package/dist/client/assets/{brand-context-BonyZcM-.js → brand-context-kupTn8ww.js} +1 -1
- package/dist/client/assets/{breadcrumb-aBS6Ng2n.js → breadcrumb-Chp_BCp3.js} +1 -1
- package/dist/client/assets/{buckets-C7dWs2uu.js → buckets-9c-3tQqN.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Do97eXJC.js → bulk-category-panel-Cvr8ttuk.js} +1 -1
- package/dist/client/assets/{calendar-JCMASnmh.js → calendar-CVcC02T0.js} +1 -1
- package/dist/client/assets/{capability-load-error-YZD1WIw1.js → capability-load-error-BDl1R2Mq.js} +1 -1
- package/dist/client/assets/{card-Box4iJoV.js → card-CuLmtjkK.js} +1 -1
- package/dist/client/assets/{category-editor-DhuqqWc4.js → category-editor-CXTluY_C.js} +1 -1
- package/dist/client/assets/{chat-context-RywSrvyo.js → chat-context-Bcthg0Rk.js} +1 -1
- package/dist/client/assets/{checkbox-CIrD_BaK.js → checkbox-B1YF-uK0.js} +1 -1
- package/dist/client/assets/{cli-auth-success-XSaYrZBb.js → cli-auth-success-C53wAj-e.js} +1 -1
- package/dist/client/assets/{collection-detail-D1g5WZ3K.js → collection-detail-ZtPppzVw.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bj7twyNb.js → collection-display-button-DpeNVXJK.js} +1 -1
- package/dist/client/assets/{collection-search-DFOtRfqr.js → collection-search-COWX-zrS.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DGM0c4AV.js → collection-table-wrapper-Dx6fV4WQ.js} +1 -1
- package/dist/client/assets/{collection-tabs-C8GiZNTZ.js → collection-tabs-CJs3t0kZ.js} +1 -1
- package/dist/client/assets/{command-C5AmTrdX.js → command-U4hp1Sg9.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DylsNiNy.js → commerce-onboarding-IejA-j4v.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DXKUejW8.js → connect-desktop-dialog-CttYQBP_.js} +1 -1
- package/dist/client/assets/{connection-card-R8cixMJA.js → connection-card-zsKQnX7M.js} +1 -1
- package/dist/client/assets/{connection-detail-BXlY0hBc.js → connection-detail-u-TS1N7E.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Dg4QpFTl.js → connection-form-helpers-BBQix76t.js} +1 -1
- package/dist/client/assets/{connections-D9SCiPTC.js → connections-CDKaSrk-.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DbpDU6zp.js → decopilot-sse-pool-Bp3qtF_q.js} +1 -1
- package/dist/client/assets/{dialog-DSwtrH3c.js → dialog-DkT4Ri5Y.js} +1 -1
- package/dist/client/assets/{domain-settings-BSHm1szM.js → domain-settings-BFWHE9rM.js} +1 -1
- package/dist/client/assets/{drawer-DLnh7VDP.js → drawer-CsLvjAFm.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CP58k9uG.js → dropdown-menu-Ckz_4tyn.js} +1 -1
- package/dist/client/assets/{empty-state-DeqTpsIg.js → empty-state-B1jCdJ6v.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B9XwWcLA.js → extract-connection-data-iRkA6j8O.js} +1 -1
- package/dist/client/assets/{file-explorer-kVctnG_C.js → file-explorer-DeYjEnVU.js} +1 -1
- package/dist/client/assets/{file-type-icon-DX-skkXW.js → file-type-icon-CGnBXvlC.js} +1 -1
- package/dist/client/assets/{files-DILn6HGU.js → files-BQl4hGax.js} +1 -1
- package/dist/client/assets/{form-CrI62Hn2.js → form-DaFgzcD-.js} +1 -1
- package/dist/client/assets/{general-D1Yw1l7v.js → general-r1yDnvRs.js} +1 -1
- package/dist/client/assets/{github-repo-picker-yq0WAGxV.js → github-repo-picker-DNxMMrPO.js} +1 -1
- package/dist/client/assets/{hooks-DWYbP5m8.js → hooks-6n_u4oV8.js} +1 -1
- package/dist/client/assets/{index-DvNlHFzE.js → index-0RYeOBGJ.js} +1 -1
- package/dist/client/assets/{index-DmpQNPd4.js → index-BBLmYI9u.js} +22 -22
- package/dist/client/assets/{index-DYg2VhI5.js → index-BLUPWNvZ.js} +1 -1
- package/dist/client/assets/{index-Cb7CSq23.js → index-BgmdlU4F.js} +1 -1
- package/dist/client/assets/{index-CI61BawX.js → index-BuoPGVgL.js} +1 -1
- package/dist/client/assets/{index-DYSbWFsV.js → index-BzYr87l3.js} +1 -1
- package/dist/client/assets/{index-DGdLDowk.js → index-CR0OxjC9.js} +1 -1
- package/dist/client/assets/{index-BFgDL42Z.js → index-CakKlCqQ.js} +1 -1
- package/dist/client/assets/{index-C3vwz_dr.js → index-D85wAsnN.js} +1 -1
- package/dist/client/assets/{index-2J9py-e1.js → index-DMCDP9dR.js} +3 -3
- package/dist/client/assets/index-DR1NTX1L.css +1 -0
- package/dist/client/assets/{index-DRWjYT4B.js → index-Dva6I2-Y.js} +1 -1
- package/dist/client/assets/{index-BeYjQpI7.js → index-OHGOt-QL.js} +1 -1
- package/dist/client/assets/{index-D104HfgJ.js → index-_JTFwd45.js} +1 -1
- package/dist/client/assets/{index-redirect-BskdDWV4.js → index-redirect-BdktlaC9.js} +1 -1
- package/dist/client/assets/{index-0NY8sfnD.js → index-zpcYg8ov.js} +1 -1
- package/dist/client/assets/{input-CPgIZjnq.js → input-Bv-zBVyU.js} +1 -1
- package/dist/client/assets/{integration-icon-BRx3OrOO.js → integration-icon-DQZa3sYE.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BqLsPd-I.js → invite-member-dialog-DXZ80KCM.js} +1 -1
- package/dist/client/assets/{label-ByJJI9o9.js → label-o5nMOYcO.js} +1 -1
- package/dist/client/assets/{layout-DkSXJKeZ.js → layout-Ct-NSkaZ.js} +1 -1
- package/dist/client/assets/{login-BaRuvHAv.js → login-BNYF44OS.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CjPLnQJW.js → mcp-oauth-C_medu58.js} +1 -1
- package/dist/client/assets/{members-Cjw14hN6.js → members-C9_M5PqO.js} +1 -1
- package/dist/client/assets/{monaco-editor-DO2E_4ud.js → monaco-editor-tFbpBjhS.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BDngajlS.js → monitoring-stats-row-DeM-N2J5.js} +1 -1
- package/dist/client/assets/{oauth-callback-DDmigr1U.js → oauth-callback-BeTVZqoU.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-jnUl_dNc.js → oauth-callback-ai-provider-DU9kvW_X.js} +1 -1
- package/dist/client/assets/{onboarding-BLwm4iYG.js → onboarding-BXkj_1d1.js} +1 -1
- package/dist/client/assets/{org-install-BKR8pPq9.js → org-install-C5Q_lrGd.js} +1 -1
- package/dist/client/assets/{org-layout-iq4QcPHM.js → org-layout-LSJ3O2qD.js} +1 -1
- package/dist/client/assets/{organization-choice-1zNEO-z1.js → organization-choice-kI0WcHW4.js} +1 -1
- package/dist/client/assets/{orgs-BvPbxUA_.js → orgs-AtEz89cn.js} +1 -1
- package/dist/client/assets/{page-seo-form-xMWOO_aT.js → page-seo-form-B3JcFei-.js} +1 -1
- package/dist/client/assets/page-seo-sheet-JexZxptV.js +1 -0
- package/dist/client/assets/{popover-Di49hXoq.js → popover-DScORrBz.js} +1 -1
- package/dist/client/assets/{post-editor-BJtWqvn2.js → post-editor-CtABAPyS.js} +1 -1
- package/dist/client/assets/{primitives-40xnqKa8.js → primitives-2aKpJLl6.js} +1 -1
- package/dist/client/assets/{profile-B3Qz5OQH.js → profile-B5fhF0J5.js} +1 -1
- package/dist/client/assets/project-app-view-DpI2GgkU.js +1 -0
- package/dist/client/assets/record-editor-BQRaFuNl.js +1 -0
- package/dist/client/assets/registry-BZL70RtY.js +2 -0
- package/dist/client/assets/{registry-layout-BP4UvzFu.js → registry-layout-C6j571Mp.js} +1 -1
- package/dist/client/assets/{require-capability-bheSt4Ha.js → require-capability-CpBEjv6M.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D8-9nMC1.js → required-auth-layout-BllY9X0X.js} +1 -1
- package/dist/client/assets/{reset-password-Cm90t6OS.js → reset-password-DkiqmSgp.js} +1 -1
- package/dist/client/assets/{roles-DRGXssOA.js → roles-DJxIZBSn.js} +1 -1
- package/dist/client/assets/{search-input-CDgOZhUx.js → search-input-BdjHYcO9.js} +1 -1
- package/dist/client/assets/{secrets-ChNigaEB.js → secrets-BG5x9RsU.js} +1 -1
- package/dist/client/assets/{sections-editor-CWNNeE6w.js → sections-editor-N4FsFHJ4.js} +2 -2
- package/dist/client/assets/{select-Cghqgv9M.js → select-DX7cJPSR.js} +1 -1
- package/dist/client/assets/{select-model-hKeuB30h.js → select-model-DeqZghIM.js} +1 -1
- package/dist/client/assets/{seo-editor-BOvmQGoB.js → seo-editor-OsNm8ZRU.js} +1 -1
- package/dist/client/assets/{settings-layout-yKc49o-h.js → settings-layout-DQClMbGM.js} +1 -1
- package/dist/client/assets/{settings-section-DJSF2-yN.js → settings-section-DG4UePho.js} +1 -1
- package/dist/client/assets/{shell-controls-BfBfRxJV.js → shell-controls-CPfTsUc0.js} +1 -1
- package/dist/client/assets/{shell-layout-D6B5jOh9.js → shell-layout-CKAEuy11.js} +1 -1
- package/dist/client/assets/{sidebar-DRcu2eQH.js → sidebar-CQ6X6EgL.js} +1 -1
- package/dist/client/assets/{skeleton-Dgzqsrmm.js → skeleton-B1SkUhzL.js} +1 -1
- package/dist/client/assets/{sso-xUQ7r0ut.js → sso-DKGtOmgQ.js} +1 -1
- package/dist/client/assets/{store-Dkup7A2E.js → store-Oz22e-Wi.js} +1 -1
- package/dist/client/assets/store-registry-DH3yKhz-.js +2 -0
- package/dist/client/assets/{studio-tools-Dq9eyK0h.js → studio-tools-O1wqkKr7.js} +1 -1
- package/dist/client/assets/{switch-CNYOO06Q.js → switch-B4AE76uJ.js} +1 -1
- package/dist/client/assets/{table-D0SHP_P3.js → table-D94_WLHm.js} +1 -1
- package/dist/client/assets/{tabs-WbQCNiHn.js → tabs-BdsrY0VQ.js} +1 -1
- package/dist/client/assets/{textarea-DyoYWnbd.js → textarea-D5bA0vwh.js} +1 -1
- package/dist/client/assets/{toggle-group-Bu-PWxkG.js → toggle-group-f2RgMq4W.js} +1 -1
- package/dist/client/assets/{toolbar-LEdb9i7-.js → toolbar-CnGwQIGK.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BdGG2k_3.js → toolbar-icon-button-DV30tB3z.js} +1 -1
- package/dist/client/assets/{tools-list-CyU2eF6i.js → tools-list-BZtd6vTC.js} +1 -1
- package/dist/client/assets/{tooltip-BRb7PA9v.js → tooltip-C-Fdi799.js} +1 -1
- package/dist/client/assets/{types-DcP2pDvU.js → types-BGdz0DTZ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B-08Js8f.js → use-ai-providers-DnQtGTlK.js} +1 -1
- package/dist/client/assets/{use-automations-RVQrgYV7.js → use-automations-CLvdnni4.js} +1 -1
- package/dist/client/assets/{use-capability-D8RRDS0J.js → use-capability-DyEmup-l.js} +1 -1
- package/dist/client/assets/{use-clock-tick-PutxutBx.js → use-clock-tick-r41I52rR.js} +1 -1
- package/dist/client/assets/{use-collections-DEBusStk.js → use-collections-B4CZte7v.js} +1 -1
- package/dist/client/assets/{use-connection-CbSx9WL-.js → use-connection-C9S1yRy-.js} +1 -1
- package/dist/client/assets/{use-copy-zn7CKsNn.js → use-copy-Dtp5QKkh.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CIsGMDdP.js → use-create-virtual-mcp-bFBi_I94.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CZutZGE6.js → use-debounced-autosave-B_MytNzA.js} +1 -1
- package/dist/client/assets/{use-debounced-value-stLkCGGE.js → use-debounced-value-D5S2o6mL.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-C-bHC4m2.js → use-decopilot-events-X4WShNfU.js} +1 -1
- package/dist/client/assets/{use-delete-connection-LLHSraLG.js → use-delete-connection-B6yuL_jT.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DLjYzDku.js → use-deployment-admin-DOqhSJ2E.js} +1 -1
- package/dist/client/assets/{use-file-configs-Cr3ojEQZ.js → use-file-configs-i-DgXdKu.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DU6_2BYs.js → use-infinite-scroll-C10ycd3E.js} +1 -1
- package/dist/client/assets/{use-join-requests-DCSa94Gt.js → use-join-requests-C9k3gHqE.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BFfDw7Na.js → use-mcp-client-xyqZgz7w.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-ZigM2rJs.js → use-mcp-prompts-rcTAN3zC.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dci7vJWh.js → use-mcp-tools-BY1xI7T1.js} +1 -1
- package/dist/client/assets/{use-members-CkM3oszX.js → use-members-BLAy8O_e.js} +1 -1
- package/dist/client/assets/{use-mobile-DcoKiKHf.js → use-mobile-8PCzv3Mi.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DLTVhJZe.js → use-navigate-to-agent-DFHenM1Y.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-NR_tIEBe.js → use-org-auth-client-Dapr-HwO.js} +1 -1
- package/dist/client/assets/{use-org-sso-BBuTBvZM.js → use-org-sso-Bi4sTov0.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Ds-tZdpJ.js → use-organization-roles-Bf_z3Rj3.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CjrnkZNU.js → use-organization-settings-DTNEfKpa.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BTmktc4i.js → use-registry-connections-B9ry2u5e.js} +1 -1
- package/dist/client/assets/{use-secrets-Q44-sgJw.js → use-secrets-CufX7ryc.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DNwiCMgb.js → use-status-sounds-83cWEknM.js} +1 -1
- package/dist/client/assets/{use-view-mode-T-khPQ1H.js → use-view-mode-CSOFCgi9.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BDvqLUy9.js → use-virtual-mcp-DNIEk3-8.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-KvXcQTyz.js +1 -0
- package/dist/client/assets/{useRouterState-CAhYvs_K.js → useRouterState-Bir8csze.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CNDc5W3G.js +1 -0
- package/dist/client/assets/{users-gc1Jdg0-.js → users-D5_kLsNp.js} +1 -1
- package/dist/client/assets/{variant-calendar-BCNKLZth.js → variant-calendar-FGtc7tCa.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BmycSdLQ.js → view-mode-toggle-BnUQvisV.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-ZbSNKPKh.css +0 -1
- package/dist/client/assets/page-seo-sheet-DWGLdSx-.js +0 -1
- package/dist/client/assets/project-app-view-jdTC0Cg5.js +0 -1
- package/dist/client/assets/record-editor-0LSR3b6o.js +0 -1
- package/dist/client/assets/registry-DJ31-ipj.js +0 -2
- package/dist/client/assets/store-registry-D7mOTqo9.js +0 -2
- package/dist/client/assets/useInfiniteQuery-UssBOKk_.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DzPLr418.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as s,cp as i,l as c}from"./index-
|
|
1
|
+
import{c as d,j as s,cp as i,l as c}from"./index-DMCDP9dR.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,j as i,dL as f,dM as m,l as u,dN as g,dO as x,dP as v,dQ as b,dR as h,dS as w,dT as j,dU as N,dV as z,dW as _,dX as y,dY as p}from"./index-
|
|
1
|
+
import{c,j as i,dL as f,dM as m,l as u,dN as g,dO as x,dP as v,dQ as b,dR as h,dS as w,dT as j,dU as N,dV as z,dW as _,dX as y,dY as p}from"./index-DMCDP9dR.js";import{i as $}from"./Check-C_CIFiKi.js";import{i as D}from"./ChevronRight-Dqs4UYfi.js";import{i as M}from"./Circle-BMe_lNRs.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function L(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function O(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("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-pointer items-center gap-2 rounded-lg 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",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function E(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function G(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,Q as b,L as c,O as d,V as e,W as f,X as g,G as h,P as i,U as j,E as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,l as N,j as t}from"./index-
|
|
1
|
+
import{c as v,l as N,j as t}from"./index-DMCDP9dR.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-DMCDP9dR.js";import{c as O}from"./use-mcp-client-xyqZgz7w.js";import{W as T}from"./constants-B72Xmt_K.js";function x(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(e){const t=x(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function B(e,t){return H(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(e){return e?L[e]??e.toUpperCase():null}function Q(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function X(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(e,t,n,a){const r=e.server,o=e._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[v]:null,l=y?null:g[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const d={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(d[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(d).length>0&&{envVars:d}}}else l?(u=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=g.length>1,M=p.length>1;let m="";c&&M?m=` (${W(c)})`:l&&N&&(m=` (${V(l)})`);const E=I+m;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{j as a,K as b,X as c,Q as d,Z as e,J as f,U as g,B as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as Z,r as u,j as r,i as se,B as he,dZ as Mt,aM as Dt,aS as ie,d_ as Rt,d$ as Pt,e0 as Et,e1 as kt,bL as Tt,e2 as Ot,e3 as qe,aO as At,e4 as Lt,e5 as Ft,e6 as It,e7 as $t,e8 as _t,e9 as zt,ea as Wt,eb as Gt,ec as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-2J9py-e1.js";import{F as Vt,l as Ut}from"./index-CI61BawX.js";import{i as qt,aE as Ht,aF as Qt,aG as ue,aH as Xt,ab as _e}from"./agent-icon-DgEjd-zg.js";import{a as Jt}from"./Tool01-B8q9vFcz.js";import{s as Yt}from"./XClose-GdiLhRNK.js";import{A as Zt}from"./automation-runs-B6W-oQ-b.js";import{T as ze,a as We,b as Ge}from"./tooltip-BRb7PA9v.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-B1rOkStA.js";import{a as cn}from"./chat-context-RywSrvyo.js";import{u as dn}from"./shell-layout-D6B5jOh9.js";import{s as fe,a as Ke,f as un}from"./index-DmpQNPd4.js";import{a as fn,f as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-DSwtrH3c.js";import{I as Be}from"./input-CPgIZjnq.js";import{t as vn}from"./ChevronDown-wNYjMtTF.js";import{i as yn}from"./ChevronRight-C-TpN8He.js";import{a as wn}from"./ZoomOut-DP0DgIxq.js";import{E as Cn,v as Ve,w as we,x as bn,y as jn,z as Nn,A as V,C as me,g as Ce,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-DvNlHFzE.js";import"./AlertCircle-ClNAIcG0.js";import"./ArrowUp-DY8HR8F0.js";import"./Settings02-C8t-YS9f.js";import"./XCircle-DDi-eHUx.js";import"./ArrowUpRight-DjTrxTn1.js";import"./ZapSquare-P6cQPzc4.js";import"./Users03-C1C_-4H4.js";import"./Loading02-Q-5W4uzZ.js";import"./CheckCircle-BDnR8A1L.js";import"./Check-BaUMJ78L.js";import"./ChevronUp-C6irMbKQ.js";import"./Circle-YG_2bf45.js";import"./Stars02-u80z6or-.js";import"./Copy01-_g0t0qlZ.js";import"./DotsVertical-DTKbesDy.js";import"./Globe01-XPkeFMHR.js";import"./Eye-B0b47qlC.js";import"./FilterLines-CgaBTy3e.js";import"./Star01-CFBLrKzQ.js";import"./Globe04-BrUOkeSn.js";import"./SwitchHorizontal01-C5lh09BG.js";import"./HardDrive-C0Mdm8TH.js";import"./Key01-X2Cp5G1j.js";import"./LayoutLeft-DlvxEfnj.js";import"./LinkExternal01-DbsJ_E6N.js";import"./List-Bk3antXp.js";import"./Monitor01-CNRD_PE8.js";import"./Sun-BntcwdNi.js";import"./Palette-DjHatrbR.js";import"./Play-CeoTbFcX.js";import"./Plus-BMHnzEgp.js";import"./SearchLg-V_Q9UCyP.js";import"./SearchMd-DANDIa_n.js";import"./Shield01-Dn1dWDdY.js";import"./Stars01-CdPO3Nl2.js";import"./Trash01-CfJ0a-B-.js";import"./Upload01-D_QZcVHs.js";import"./User01-Darruqx_.js";import"./Users01-Bus8Z2ZL.js";import"./X-DuH9meaW.js";import"./Zap-Dy75gJ9Z.js";import"./select-Cghqgv9M.js";import"./useInfiniteQuery-UssBOKk_.js";import"./use-infinite-scroll-DU6_2BYs.js";import"./use-connection-CbSx9WL-.js";import"./use-collections-DEBusStk.js";import"./use-mcp-client-BFfDw7Na.js";import"./constants-B72Xmt_K.js";import"./auth-USBWp_2D.js";import"./use-virtual-mcp-BDvqLUy9.js";import"./card-Box4iJoV.js";import"./sidebar-DRcu2eQH.js";import"./use-mobile-DcoKiKHf.js";import"./table-D0SHP_P3.js";import"./empty-state-DeqTpsIg.js";import"./use-members-CkM3oszX.js";import"./use-org-auth-client-NR_tIEBe.js";import"./use-clock-tick-PutxutBx.js";import"./use-automations-RVQrgYV7.js";import"./studio-tools-Dq9eyK0h.js";import"./useSuspenseInfiniteQuery-DzPLr418.js";import"./badge-CVxnahFC.js";import"./checkbox-CIrD_BaK.js";import"./command-C5AmTrdX.js";import"./index-C3vwz_dr.js";import"./popover-Di49hXoq.js";import"./avatar-BRw1vbr3.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-zn7CKsNn.js";import"./file-type-icon-DX-skkXW.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DO2E_4ud.js";import"./delay-CnY5UFtP.js";import"./types-DcP2pDvU.js";import"./hooks-DWYbP5m8.js";import"./decopilot-sse-pool-DbpDU6zp.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-BRx3OrOO.js";import"./use-navigate-to-agent-DLTVhJZe.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-ZigM2rJs.js";import"./form-CrI62Hn2.js";import"./label-ByJJI9o9.js";import"./autosend-CmW2aOxR.js";import"./use-ai-providers-B-08Js8f.js";import"./use-decopilot-events-C-bHC4m2.js";import"./use-organization-settings-CjrnkZNU.js";import"./required-auth-layout-D8-9nMC1.js";import"./use-org-sso-BBuTBvZM.js";import"./drawer-DLnh7VDP.js";import"./collection-search-DFOtRfqr.js";import"./tabs-WbQCNiHn.js";import"./toggle-group-Bu-PWxkG.js";import"./agent-capabilities-B1SWagyu.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-R8cixMJA.js";import"./use-registry-connections-BTmktc4i.js";import"./extract-connection-data-B9XwWcLA.js";import"./collection-tabs-C8GiZNTZ.js";import"./textarea-DyoYWnbd.js";import"./connection-form-helpers-Dg4QpFTl.js";import"./authenticate-and-persist-oauth-DcLeuVqz.js";import"./mcp-oauth-CjPLnQJW.js";import"./connect-desktop-dialog-DXKUejW8.js";import"./select-model-hKeuB30h.js";import"./skeleton-Dgzqsrmm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DJSF2-yN.js";import"./dropdown-menu-CP58k9uG.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DNwiCMgb.js";import"./toolbar-LEdb9i7-.js";import"./use-mcp-tools-Dci7vJWh.js";import"./use-capability-D8RRDS0J.js";import"./tools-list-CyU2eF6i.js";import"./switch-CNYOO06Q.js";import"./use-debounced-autosave-CZutZGE6.js";import"./index-DYg2VhI5.js";import"./search-input-CDgOZhUx.js";import"./github-repo-picker-yq0WAGxV.js";import"./use-debounced-value-stLkCGGE.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-Q44-sgJw.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-0NY8sfnD.js";import"./get-initials-D-f_fDFw.js";import"./calendar-JCMASnmh.js";import"./toolbar-icon-button-BdGG2k_3.js";import"./use-file-configs-Cr3ojEQZ.js";import"./automation-list-row-CoXbNmPR.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(i),w=Pn[a];i!==B&&(U(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const Q=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const H=q;let $;e[7]!==w.title?($=r.jsx(fn,{children:w.title}),e[7]=w.title,e[8]=$):$=e[8];let T;e[9]!==w.description?(T=r.jsx(mn,{children:w.description}),e[9]=w.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==w.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:w.placeholder,autoFocus:!0,disabled:d})]}),e[18]=w.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let C;e[33]!==w.submit||e[34]!==d?(C=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):w.submit,e[33]=w.submit,e[34]=d,e[35]=C):C=e[35];let L;e[36]!==k||e[37]!==C?(L=r.jsx(he,{type:"submit",disabled:k,children:C}),e[36]=k,e[37]=C,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==H||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:H,children:[G,j,b]})}),e[42]=H,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==Q||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:Q,children:S}),e[47]=Q,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,He]=kn(Me),Qe=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};Qe.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=He(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=He(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Hn="ContextMenuArrow",Qn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Qn.displayName=Hn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=Qe,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:w}=s,I=x===void 0?!1:x,Q=i.kind==="directory",{Icon:q,color:H}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==H||e[9]!==Q||e[10]!==c||e[11]!==I?(R=Q?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(wn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:H}})]}),e[7]=q,e[8]=H,e[9]=Q,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let C;e[26]!==y?(C=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=C):C=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==w?(z=r.jsx(te,{variant:"destructive",onSelect:w,children:"Delete"}),e[33]=w,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==C||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,C,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=C,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=V(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function ts({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,w]=u.useState([]),[I,Q]=u.useState(""),[q,H]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,C]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){w(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),C(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of we(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of we(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),H(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:Cn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{H(!1)}}async function Oe(t){if(!k.get(t)?.loaded){C(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");C(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}C(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||w(n=>[...n,t]),Oe(t)}function vt(t){w(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),C(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function wt(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=we(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function Ct(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=Ct();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=Ce(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
|
|
1
|
+
import{c as Z,r as u,j as r,i as se,B as he,dZ as Mt,aM as Dt,aS as ie,d_ as Rt,d$ as Pt,e0 as Et,e1 as kt,bL as Tt,e2 as Ot,e3 as qe,aO as At,e4 as Lt,e5 as Ft,e6 as It,e7 as $t,e8 as _t,e9 as zt,ea as Wt,eb as Gt,ec as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-DMCDP9dR.js";import{F as Vt,l as Ut}from"./index-BuoPGVgL.js";import{i as qt,aE as Ht,aF as Qt,aG as ue,aH as Xt,ab as _e}from"./agent-icon-DiJCyVK_.js";import{a as Jt}from"./Tool01-FgDVN5Aa.js";import{s as Yt}from"./XClose-B9_O9ZwX.js";import{A as Zt}from"./automation-runs-Dt4hr7e4.js";import{T as ze,a as We,b as Ge}from"./tooltip-C-Fdi799.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-Bb_E0Ib3.js";import{a as cn}from"./chat-context-Bcthg0Rk.js";import{u as dn}from"./shell-layout-CKAEuy11.js";import{s as fe,a as Ke,f as un}from"./index-BBLmYI9u.js";import{a as fn,f as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-DkT4Ri5Y.js";import{I as Be}from"./input-Bv-zBVyU.js";import{t as vn}from"./ChevronDown-BfG3lHhC.js";import{i as yn}from"./ChevronRight-Dqs4UYfi.js";import{a as wn}from"./ZoomOut-BmpdGZEc.js";import{E as Cn,v as Ve,w as we,x as bn,y as jn,z as Nn,A as V,C as me,g as Ce,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-0RYeOBGJ.js";import"./AlertCircle-B53JhFAu.js";import"./ArrowUp-BRSr5Hko.js";import"./Settings02-Ddh7L72a.js";import"./XCircle-CowkXBTi.js";import"./ArrowUpRight-H0WTVT37.js";import"./ZapSquare-DM6ZWSzD.js";import"./Users03-BubKtGEN.js";import"./Loading02-CQnI4ICL.js";import"./CheckCircle-BHN-wFbK.js";import"./Check-C_CIFiKi.js";import"./ChevronUp-D1yQd_10.js";import"./Circle-BMe_lNRs.js";import"./Stars02-D3yMrrs0.js";import"./Copy01-I5E-L-KP.js";import"./DotsVertical-DCj3Pe-o.js";import"./Globe01-D8Lfegq4.js";import"./Eye-Fa6zzcvh.js";import"./FilterLines-Dabon75B.js";import"./Star01-D1xnxtGT.js";import"./Globe04-BKaoGJE9.js";import"./SwitchHorizontal01-DDDazbVr.js";import"./HardDrive-CmlVCNCP.js";import"./Key01-BlVS9wch.js";import"./LayoutLeft-CvxAKnEI.js";import"./LinkExternal01-3dZq5bY0.js";import"./List-DoWo7FQN.js";import"./Monitor01-CadwJLnk.js";import"./Sun-icg_V74A.js";import"./Palette-BJcNGJoP.js";import"./Play-CgD79iZg.js";import"./Plus-D63gaaHA.js";import"./SearchLg-MLCu3K6z.js";import"./SearchMd-evNv9trP.js";import"./Shield01-CoyB298o.js";import"./Stars01-IimVOfNw.js";import"./Trash01-Cf4xz_lu.js";import"./Upload01-DqR1L_zb.js";import"./User01-2BQwgTbP.js";import"./Users01-CHhUYr_-.js";import"./X-DNthiYnC.js";import"./Zap-DptPhcrr.js";import"./select-DX7cJPSR.js";import"./useInfiniteQuery-KvXcQTyz.js";import"./use-infinite-scroll-C10ycd3E.js";import"./use-connection-C9S1yRy-.js";import"./use-collections-B4CZte7v.js";import"./use-mcp-client-xyqZgz7w.js";import"./constants-B72Xmt_K.js";import"./auth-X2zOoLs3.js";import"./use-virtual-mcp-DNIEk3-8.js";import"./card-CuLmtjkK.js";import"./sidebar-CQ6X6EgL.js";import"./use-mobile-8PCzv3Mi.js";import"./table-D94_WLHm.js";import"./empty-state-B1jCdJ6v.js";import"./use-members-BLAy8O_e.js";import"./use-org-auth-client-Dapr-HwO.js";import"./use-clock-tick-r41I52rR.js";import"./use-automations-CLvdnni4.js";import"./studio-tools-O1wqkKr7.js";import"./useSuspenseInfiniteQuery-CNDc5W3G.js";import"./badge-DK3Lxhxf.js";import"./checkbox-B1YF-uK0.js";import"./command-U4hp1Sg9.js";import"./index-D85wAsnN.js";import"./popover-DScORrBz.js";import"./avatar-7MpZ9q34.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dtp5QKkh.js";import"./file-type-icon-CGnBXvlC.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-tFbpBjhS.js";import"./delay-CnY5UFtP.js";import"./types-BGdz0DTZ.js";import"./hooks-6n_u4oV8.js";import"./decopilot-sse-pool-Bp3qtF_q.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-DQZa3sYE.js";import"./use-navigate-to-agent-DFHenM1Y.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-rcTAN3zC.js";import"./form-DaFgzcD-.js";import"./label-o5nMOYcO.js";import"./autosend-hpJ3sd0t.js";import"./use-ai-providers-DnQtGTlK.js";import"./use-decopilot-events-X4WShNfU.js";import"./use-organization-settings-DTNEfKpa.js";import"./required-auth-layout-BllY9X0X.js";import"./use-org-sso-Bi4sTov0.js";import"./drawer-CsLvjAFm.js";import"./collection-search-COWX-zrS.js";import"./tabs-BdsrY0VQ.js";import"./toggle-group-f2RgMq4W.js";import"./agent-capabilities-DlIlOn9g.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-zsKQnX7M.js";import"./use-registry-connections-B9ry2u5e.js";import"./extract-connection-data-iRkA6j8O.js";import"./collection-tabs-CJs3t0kZ.js";import"./textarea-D5bA0vwh.js";import"./connection-form-helpers-BBQix76t.js";import"./authenticate-and-persist-oauth-uQHwVym9.js";import"./mcp-oauth-C_medu58.js";import"./connect-desktop-dialog-CttYQBP_.js";import"./select-model-DeqZghIM.js";import"./skeleton-B1SkUhzL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DG4UePho.js";import"./dropdown-menu-Ckz_4tyn.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-83cWEknM.js";import"./toolbar-CnGwQIGK.js";import"./use-mcp-tools-BY1xI7T1.js";import"./use-capability-DyEmup-l.js";import"./tools-list-BZtd6vTC.js";import"./switch-B4AE76uJ.js";import"./use-debounced-autosave-B_MytNzA.js";import"./index-BLUPWNvZ.js";import"./search-input-BdjHYcO9.js";import"./github-repo-picker-DNxMMrPO.js";import"./use-debounced-value-D5S2o6mL.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-CufX7ryc.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-zpcYg8ov.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CVcC02T0.js";import"./toolbar-icon-button-DV30tB3z.js";import"./use-file-configs-i-DgXdKu.js";import"./automation-list-row-DMW0IRGB.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(i),w=Pn[a];i!==B&&(U(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const Q=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const H=q;let $;e[7]!==w.title?($=r.jsx(fn,{children:w.title}),e[7]=w.title,e[8]=$):$=e[8];let T;e[9]!==w.description?(T=r.jsx(mn,{children:w.description}),e[9]=w.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==w.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:w.placeholder,autoFocus:!0,disabled:d})]}),e[18]=w.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let C;e[33]!==w.submit||e[34]!==d?(C=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):w.submit,e[33]=w.submit,e[34]=d,e[35]=C):C=e[35];let L;e[36]!==k||e[37]!==C?(L=r.jsx(he,{type:"submit",disabled:k,children:C}),e[36]=k,e[37]=C,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==H||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:H,children:[G,j,b]})}),e[42]=H,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==Q||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:Q,children:S}),e[47]=Q,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,He]=kn(Me),Qe=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};Qe.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=He(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=He(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Hn="ContextMenuArrow",Qn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Qn.displayName=Hn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=Qe,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:w}=s,I=x===void 0?!1:x,Q=i.kind==="directory",{Icon:q,color:H}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==H||e[9]!==Q||e[10]!==c||e[11]!==I?(R=Q?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(wn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:H}})]}),e[7]=q,e[8]=H,e[9]=Q,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let C;e[26]!==y?(C=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=C):C=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==w?(z=r.jsx(te,{variant:"destructive",onSelect:w,children:"Delete"}),e[33]=w,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==C||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,C,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=C,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=V(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function ts({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,w]=u.useState([]),[I,Q]=u.useState(""),[q,H]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,C]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){w(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),C(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of we(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of we(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),H(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:Cn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{H(!1)}}async function Oe(t){if(!k.get(t)?.loaded){C(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");C(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}C(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||w(n=>[...n,t]),Oe(t)}function vt(t){w(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),C(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function wt(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=we(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function Ct(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=Ct();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=Ce(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
|
|
2
2
|
`)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>Q(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?wt(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",V(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[U.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:U.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Vt,{language:Ce(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&C(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",Ce(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":V(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{ts as FileExplorer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bu as zl,j as q,aK as lt,bM as zn,r as Ve,bN as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-
|
|
1
|
+
import{bu as zl,j as q,aK as lt,bM as zn,r as Ve,bN as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-DMCDP9dR.js";import{i as zb}from"./Check-C_CIFiKi.js";import{a as jb}from"./Copy01-I5E-L-KP.js";import{e as S0,h as y0,i as A0,a as _0}from"./dialog-DkT4Ri5Y.js";import{n as I0}from"./Globe01-D8Lfegq4.js";import{j as k0,n as R0}from"./ZoomOut-BmpdGZEc.js";import{u as N0}from"./use-mobile-8PCzv3Mi.js";import{h as C0}from"./tab-id-bb-jjgGv.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",Wb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},q0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,G0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xb=/^( {2,}|\\)\n(?!\s*$)/,$0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tr=/[\p{P}\p{S}]/u,Zl=/[\s\p{P}\p{S}]/u,Zb=/[^\s\p{P}\p{S}]/u,z0=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zl).getRegex(),Qb=/(?!~)[\p{P}\p{S}]/u,j0=/(?!~)[\s\p{P}\p{S}]/u,V0=/(?:[^\s\p{P}\p{S}]|~)/u,Y0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Jb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,W0=le(Jb,"u").replace(/punct/g,tr).getRegex(),K0=le(Jb,"u").replace(/punct/g,Qb).getRegex(),eE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X0=le(eE,"gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),Z0=le(eE,"gu").replace(/notPunctSpace/g,V0).replace(/punctSpace/g,j0).replace(/punct/g,Qb).getRegex(),Q0=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),J0=le(/\\(punct)/,"gu").replace(/punct/g,tr).getRegex(),eS=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tS=le(Kl).replace("(?:-->|$)","-->").getRegex(),nS=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,rS=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tE=le(/^!?\[(label)\]\[(ref)\]/).replace("label",jn).replace("ref",Wl).getRegex(),nE=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wl).getRegex(),aS=le("reflink|nolink(?!\\()","g").replace("reflink",tE).replace("nolink",nE).getRegex(),Ql={_backpedal:ln,anyPunctuation:J0,autolink:eS,blockSkip:Y0,br:Xb,code:G0,del:ln,emStrongLDelim:W0,emStrongRDelimAst:X0,emStrongRDelimUnd:Q0,escape:q0,link:rS,nolink:nE,punctuation:z0,reflink:tE,reflinkSearch:aS,tag:nS,text:$0,url:ln},iS={...Ql,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",jn).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jn).getRegex()},_l={...Ql,emStrongRDelimAst:Z0,emStrongLDelim:K0,url:le(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oS={..._l,br:le(Xb).replace("{2,}","*").getRegex(),text:le(_l.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xn={normal:Xl,gfm:U0,pedantic:H0},Jt={normal:Ql,gfm:_l,breaks:oS,pedantic:iS},sS={"&":"&","<":"<",">":">",'"':""","'":"'"},Pc=e=>sS[e];function Je(e,t){if(t){if(xe.escapeTest.test(e))return e.replace(xe.escapeReplace,Pc)}else if(xe.escapeTestNoEncode.test(e))return e.replace(xe.escapeReplaceNoEncode,Pc);return e}function Fc(e){try{e=encodeURI(e).replace(xe.percentDecode,"%")}catch{return null}return e}function Bc(e,t){const n=e.replace(xe.findPipe,(i,o,s)=>{let u=!1,l=o;for(;--l>=0&&s[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(xe.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(xe.slashPipe,"|");return r}function en(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function uS(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Uc(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,u}function lS(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
|
|
3
3
|
`).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
|
|
4
4
|
`)}var Vn=class{options;rules;lexer;constructor(e){this.options=e||Nt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:en(n,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,e as o,j as i,N as l}from"./index-
|
|
1
|
+
import{c as a,e as o,j as i,N as l}from"./index-DMCDP9dR.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dC as C,c as d,j as c,ad as j,r as f,l as p,ba as b,dD as v,dE as h}from"./index-
|
|
1
|
+
import{dC as C,c as d,j as c,ad as j,r as f,l as p,ba as b,dD as v,dE as h}from"./index-DMCDP9dR.js";import{L as N}from"./label-o5nMOYcO.js";const E=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function w(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,R as e,y as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as U,a1 as V,n as G,M as Q,J as Y,d as K,R,t as w,K as L,j as a,ad as $,H,I as F,c as _,r as B,B as Z,Y as q,X as J}from"./index-
|
|
1
|
+
import{b as U,a1 as V,n as G,M as Q,J as Y,d as K,R,t as w,K as L,j as a,ad as $,H,I as F,c as _,r as B,B as Z,Y as q,X as J}from"./index-DMCDP9dR.js";import{P as k}from"./index-BLUPWNvZ.js";import{u as X}from"./use-org-auth-client-Dapr-HwO.js";import{u as W}from"./use-debounced-autosave-B_MytNzA.js";import{A as ee}from"./avatar-7MpZ9q34.js";import{I as M}from"./input-Bv-zBVyU.js";import{S as P,a as I,b as D,c as te}from"./settings-section-DG4UePho.js";import{D as ae}from"./domain-settings-BFWHE9rM.js";import{S as ne}from"./switch-B4AE76uJ.js";import{c as se,g as oe}from"./use-organization-settings-DTNEfKpa.js";import{u as ie}from"./studio-tools-O1wqkKr7.js";import{c as re,b as le,d as ce,A as de,e as ue,g as me,a as ge,f as fe}from"./alert-dialog-Bb_E0Ib3.js";import{R as pe}from"./require-capability-CpBEjv6M.js";import"./sidebar-CQ6X6EgL.js";import"./LayoutLeft-CvxAKnEI.js";import"./use-mobile-8PCzv3Mi.js";import"./X-DNthiYnC.js";import"./tooltip-C-Fdi799.js";import"./User01-2BQwgTbP.js";import"./card-CuLmtjkK.js";import"./ArrowUpRight-H0WTVT37.js";import"./badge-DK3Lxhxf.js";import"./select-DX7cJPSR.js";import"./Check-C_CIFiKi.js";import"./ChevronDown-BfG3lHhC.js";import"./ChevronUp-D1yQd_10.js";import"./constants-B72Xmt_K.js";import"./use-capability-DyEmup-l.js";import"./access-gate-DzI7fje7.js";import"./capability-load-error-BDl1R2Mq.js";const he=H({name:F().min(1,"Name is required").max(255,"Name is too long"),slug:F().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:F().optional()});function xe(e){const t=_.c(13),{value:f,onChange:d,name:s,disabled:l}=e,u=B.useRef(null);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>u.current?.click(),t[0]=c):c=t[0];const r=c;let m;t[1]!==d?(m=j=>{const b=j.target.files?.[0];if(!b)return;if(b.size>2097152){w.error("Image must be smaller than 2MB");return}const g=new FileReader;g.onerror=je,g.onloadend=()=>{g.result&&d(g.result),u.current&&(u.current.value="")},g.readAsDataURL(b)},t[1]=d,t[2]=m):m=t[2];const n=m;let o;t[3]!==l||t[4]!==n?(o=a.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:n,className:"hidden",disabled:l}),t[3]=l,t[4]=n,t[5]=o):o=t[5];const i=f||void 0,x=s??"?";let p;t[6]!==i||t[7]!==x?(p=a.jsx(ee,{url:i,fallback:x,shape:"square",size:"base"}),t[6]=i,t[7]=x,t[8]=p):p=t[8];let h;return t[9]!==l||t[10]!==o||t[11]!==p?(h=a.jsxs("button",{type:"button",onClick:r,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,p]}),t[9]=l,t[10]=o,t[11]=p,t[12]=h):h=t[12],h}function je(){return w.error("Failed to read image")}function be(){const e=U(),{org:t}=V(),f=X(),d=G(),s=Q({resolver:Y(he),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),l=K({mutationFn:async n=>{const o={name:n.name,slug:n.slug};n.logo&&(o.logo=n.logo);const i=await f.organization.update({data:o});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(n,o)=>{R("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),d.invalidateQueries({queryKey:L.organizations()}),d.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),n?.data?.slug&&n.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:n.data.slug}})},onError:(n,o)=>{R("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:n instanceof Error?n.message:String(n)}),w.error(n instanceof Error?n.message:"Failed to update organization")}}),{schedule:u,flush:c}=W({save:async()=>{const n=s.control._formState.dirtyFields;if(Object.keys(n).length===0||!await s.trigger())return;const i=s.getValues(),x=s.control._defaultValues;s.reset(i,{keepValues:!0});try{await l.mutateAsync(i)}catch{s.reset(x,{keepValues:!0})}}}),r=s.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return a.jsx(P,{children:a.jsxs(I,{children:[a.jsx(D,{title:"Logo",description:"Recommended size is 256x256px",action:a.jsx(xe,{value:s.watch("logo"),onChange:n=>{s.setValue("logo",n??"",{shouldDirty:!0}),c()},name:s.watch("name")})}),a.jsx(D,{title:"Name",action:a.jsx($,{control:s.control,name:"name",render:({field:n})=>a.jsx(M,{id:"org-name",...n,onChange:o=>{n.onChange(o),u()},onBlur:()=>{n.onBlur(),c()},placeholder:"Organization name",className:"w-[280px]"})})}),a.jsx(D,{title:"URL",action:a.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[m&&a.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),a.jsx($,{control:s.control,name:"slug",render:({field:n})=>a.jsx("input",{id:"org-slug",value:n.value??"",name:n.name,ref:n.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const i=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");s.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),u()},onBlur:()=>{n.onBlur(),c()}})})]})}),(r.name||r.slug||r.logo)&&a.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&a.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&a.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&a.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function ve(){const e=_.c(6),t=se(),{mutate:f,isPending:d}=oe();let s;e[0]!==f?(s=u=>f(u),e[0]=f,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==d||e[4]!==s?(l=a.jsx(P,{title:"Task board",description:"A board for tracking org tasks by status, priority, and assignee.",children:a.jsx(I,{children:a.jsx(D,{title:"Enable task board",description:"Adds a Board entry to the sidebar for this organization.",action:a.jsx(ne,{checked:t,disabled:d,onCheckedChange:s})})})}),e[2]=t,e[3]=d,e[4]=s,e[5]=l):l=e[5],l}function ye(){const e=_.c(42),{org:t}=V(),[f,d]=B.useState(!1),[s,l]=B.useState(""),u=ie();let c;e[0]!==t.id||e[1]!==u?(c=async()=>{await u.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=u,e[2]=c):c=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{R("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let m;e[6]!==c||e[7]!==r?(m={mutationFn:c,onSuccess:r,onError:Se},e[6]=c,e[7]=r,e[8]=m):m=e[8];const n=K(m);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>d(!0),e[9]=o):o=e[9];let i;e[10]!==n.isPending?(i=a.jsx(P,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:a.jsx(I,{className:"border-destructive/40",children:a.jsx(D,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:a.jsx(Z,{variant:"destructive",size:"sm",onClick:o,disabled:n.isPending,children:"Delete"})})})}),e[10]=n.isPending,e[11]=i):i=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=N=>{d(N),N||l("")},e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(re,{children:"Delete Organization?"}),e[13]=p):p=e[13];let h;e[14]!==t.name?(h=a.jsxs("p",{children:["This will permanently delete all data associated with"," ",a.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=h):h=e[15];let j;e[16]!==t.name?(j=a.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",a.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=j):j=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=N=>l(N.target.value),e[18]=b):b=e[18];let g;e[19]!==s||e[20]!==t.name?(g=a.jsx(M,{value:s,onChange:b,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=g):g=e[21];let v;e[22]!==g||e[23]!==h||e[24]!==j?(v=a.jsxs(le,{children:[p,a.jsx(ce,{asChild:!0,children:a.jsxs("div",{children:[h,j,g]})})]}),e[22]=g,e[23]=h,e[24]=j,e[25]=v):v=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=a.jsx(de,{children:"Cancel"}),e[26]=O):O=e[26];let y;e[27]!==n?(y=()=>n.mutate(),e[27]=n,e[28]=y):y=e[28];const E=s!==t.name||n.isPending,T=n.isPending?"Deleting…":"Delete organization";let S;e[29]!==y||e[30]!==E||e[31]!==T?(S=a.jsxs(ue,{children:[O,a.jsx(me,{onClick:y,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:T})]}),e[29]=y,e[30]=E,e[31]=T,e[32]=S):S=e[32];let z;e[33]!==v||e[34]!==S?(z=a.jsxs(ge,{children:[v,S]}),e[33]=v,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==f||e[37]!==z?(C=a.jsx(fe,{open:f,onOpenChange:x,children:z}),e[36]=f,e[37]=z,e[38]=C):C=e[38];let A;return e[39]!==C||e[40]!==i?(A=a.jsxs(a.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=A):A=e[41],A}function Se(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ze(){const e=_.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsx(k,{children:a.jsx(k.Content,{children:a.jsx(k.Body,{children:a.jsxs(te,{children:[a.jsx(k.Title,{children:"Organization"}),a.jsx(be,{}),a.jsx(ae,{}),a.jsx(ve,{}),a.jsx(ye,{})]})})})}),e[0]=t):t=e[0],t}function et(){const e=_.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=a.jsx(pe,{capability:"org:manage",area:"general settings",children:a.jsx(ze,{})}),e[0]=t):t=e[0],t}export{et as default};
|
package/dist/client/assets/{github-repo-picker-yq0WAGxV.js → github-repo-picker-DNxMMrPO.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as R,j as t,a1 as U,a as Z,n as B,r as T,aj as $,i as L,d as V,t as F,dF as ee,K as O,m as te,B as ne,l as M,P as se,aD as oe}from"./index-2J9py-e1.js";import{D as re,a as ie,d as le,e as ae}from"./dialog-DSwtrH3c.js";import{C as ce}from"./collection-search-DFOtRfqr.js";import{u as ue}from"./use-debounced-value-stLkCGGE.js";import{b as J,u as de}from"./use-connection-CbSx9WL-.js";import{u as H}from"./use-mcp-client-BFfDw7Na.js";import{W as me,S as Y}from"./constants-B72Xmt_K.js";import{a as W}from"./authenticate-and-persist-oauth-DcLeuVqz.js";import{b as X}from"./Settings02-C8t-YS9f.js";import{K as fe}from"./agent-icon-DgEjd-zg.js";import{u as xe}from"./use-mcp-tools-Dci7vJWh.js";import{e as pe}from"./extract-connection-data-B9XwWcLA.js";import{c as ge}from"./use-navigate-to-agent-DLTVhJZe.js";import{G as q,a as he,f as ye}from"./github-installations-D2vHSx02.js";function P(i){const e=R.c(4),{size:n,className:r}=i;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=f):f=e[0];let l;return e[1]!==r||e[2]!==n?(l=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:r,children:f}),e[1]=r,e[2]=n,e[3]=l):l=e[3],l}function be(i,e){const n=R.c(12),{org:r}=U();let f;n[0]!==r.id?(f=me.REGISTRY(r.id),n[0]=r.id,n[1]=f):f=n[1];const l=f;let o;n[2]!==r.id||n[3]!==r.slug||n[4]!==l?(o={connectionId:l,orgId:r.id,orgSlug:r.slug},n[2]=r.id,n[3]=r.slug,n[4]=l,n[5]=o):o=n[5];const N=H(o);let x;n[6]!==i?(x={name:i},n[6]=i,n[7]=x):x=n[7];const y=e?.enabled??!0;let a;return n[8]!==N||n[9]!==x||n[10]!==y?(a={client:N,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:x,enabled:y,staleTime:3e5,select:Ne},n[8]=N,n[9]=x,n[10]=y,n[11]=a):a=n[11],xe(a)}function Ne(i){return i.structuredContent?.item??null}const je="deco/mcp-github";function we(i){const{org:e}=U(),{data:n}=Z.useSession(),r=J(),f=B(),[l,o]=T.useState("idle"),[N,x]=T.useState(null),[y,a]=T.useState(null),{data:j,isLoading:u}=be(je,{enabled:i.enabled}),c=T.useRef(!1);i.enabled&&j&&!u&&!c.current&&n?.user?.id&&l==="idle"&&(c.current=!0,m());async function m(){if(!(!j||!n?.user?.id||!e))try{o("installing"),x(null);const d=pe(j,e.id,n.user.id,{remoteIndex:0});if(!d.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:w}=await r.create.mutateAsync(d);o("authenticating");const b=await W({connectionId:w,orgId:e.id,orgSlug:e.slug,persistFallback:s=>r.update.mutateAsync({id:w,data:{connection_token:s}}).then(()=>{})});if(b.ran&&!b.ok){try{await r.delete.mutateAsync(w)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}$(f,e.id),a(d),o("ready")}catch(d){x(d instanceof Error?d.message:String(d)),o("error")}}function p(){o("idle"),x(null),a(null),c.current=!1}return i.enabled&&u&&l==="idle"?{status:"installing",error:null,connection:null,retry:p}:{status:l,error:N,connection:y,retry:p}}const Q="GitHub MCP did not return refreshable repo grant metadata";function G(i){if(typeof i!="string")return null;const e=i.trim();return e.length>0?e:null}function Ce(i){try{const e=new URL(i);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function Ie(i){return typeof i=="number"&&Number.isFinite(i)&&Number.isInteger(i)&&i>0?i:void 0}async function K(i){const{orgSlug:e,sourceConnection:n,installationId:r,owner:f,repo:l,githubCallTool:o,selfCallTool:N,orgShared:x}=i,y=await o({name:"MINT_REPO_TOKEN",arguments:{installationId:r,owner:f,repo:l,permissions:q}}),a=y.structuredContent;if(y.isError||!a?.token){const h=y.content?.find(_=>_.type==="text")?.text;throw new Error(h?`Failed to mint a repo-scoped GitHub token: ${h}`:"Failed to mint a repo-scoped GitHub token")}const j=G(a.refreshToken),u=G(a.tokenEndpoint),c=G(a.clientId);if(!j||!u||!c)throw new Error(Q);if(!Ce(u))throw new Error(Q);const m=G(a.repository?.owner),p=G(a.repository?.name),d="GitHub MCP returned refresh metadata for a different repository";if(a.repository?.owner!==void 0&&(!m||m.toLowerCase()!==f.toLowerCase()))throw new Error(d);if(a.repository?.name!==void 0&&(!p||p.toLowerCase()!==l.toLowerCase()))throw new Error(d);const g=Ie(a.repository?.id),w=a.expiresAt?Date.parse(a.expiresAt):NaN,b=Number.isFinite(w)?Math.max(0,Math.floor((w-Date.now())/1e3)):null,C=(typeof a.expiresIn=="number"&&Number.isFinite(a.expiresIn)&&Number.isInteger(a.expiresIn)&&a.expiresIn>0?a.expiresIn:null)??b,S=await N({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${f}/${l}`,description:`Repo-scoped GitHub access for ${f}/${l}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{...x?{orgShared:!0}:{},repoScope:{installationId:r,repositoryId:g,owner:f,repo:l,permissions:q,grantProvider:"github-mcp"}}}}}),v=S.structuredContent??S,I=v.item?.id??v.id;if(!I)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${I}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:a.token,refreshToken:j,expiresIn:C,scope:a.scope??null,clientId:c,tokenEndpoint:u})})).ok)throw await N({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:I}}function Qe(i){const e=R.c(22),{open:n,onOpenChange:r,title:f,onImportComplete:l,mode:o}=i,N=o===void 0?"agent":o,x=f??(N==="connection"?"Add repo":"Import from GitHub"),[y,a]=T.useState(null);let j;e[0]!==x?(j=t.jsx(re,{className:"sr-only",children:t.jsx(ie,{children:x})}),e[0]=x,e[1]=j):j=e[1];let u;e[2]!==x||e[3]!==y?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:y?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>a(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(X,{size:16})}),t.jsx("img",{src:y.avatarUrl,alt:y.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:y.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(P,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=x,e[3]=y,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=c):c=e[5];let m;e[6]!==r?(m=()=>r(!1),e[6]=r,e[7]=m):m=e[7];let p;e[8]!==N||e[9]!==l||e[10]!==n||e[11]!==y||e[12]!==m?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:c,children:t.jsx(Se,{open:n,onComplete:m,selectedInstallation:y,onSelectInstallation:a,onImportComplete:l,mode:N})})}),e[8]=N,e[9]=l,e[10]=n,e[11]=y,e[12]=m,e[13]=p):p=e[13];let d;e[14]!==j||e[15]!==u||e[16]!==p?(d=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,p]}),e[14]=j,e[15]=u,e[16]=p,e[17]=d):d=e[17];let g;return e[18]!==r||e[19]!==n||e[20]!==d?(g=t.jsx(ae,{open:n,onOpenChange:r,children:d}),e[18]=r,e[19]=n,e[20]=d,e[21]=g):g=e[21],g}function Se({open:i,onComplete:e,selectedInstallation:n,onSelectInstallation:r,onImportComplete:f,mode:l="agent"}){const{org:o}=U(),N=B(),x=ge(),[y,a]=T.useState(null),j=de({slug:"mcp-github"}),u=he(j),c=we({enabled:i&&u.length===0}),m=u.length===1?u[0]??null:y,p=H({connectionId:m?.id??"",orgId:o.id,orgSlug:o.slug}),d=H({connectionId:Y,orgId:o.id,orgSlug:o.slug}),g=async(s,C)=>{try{const v=await p.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:C}});if(v.isError)return null;const E=v.content?.find(h=>h.type==="resource")?.resource?.text;if(!E)return null;try{const h=JSON.parse(E);return typeof h=="string"?h:JSON.stringify(h)}catch{return E}}catch{return null}},w=(s,C)=>{Promise.all([g(C,"AGENTS.md"),g(C,"CLAUDE.md")]).then(async([S,v])=>{const I=S??v??null;I&&(await d.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:I}}}}),$(N,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},b=V({mutationFn:async s=>{if(!m||!n)throw new Error("No GitHub connection or installation");const C=n.installationId;if(l==="connection"){const{childConnectionId:I}=await K({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:E=>p.callTool(E),selfCallTool:E=>d.callTool(E),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:I,item:null}}const{childConnectionId:S}=await K({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:I=>p.callTool(I),selfCallTool:I=>d.callTool(I)});let v=null;try{const I=await d.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s.name,description:s.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:s.owner,name:s.name,url:s.url,installationId:C,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),E=I.structuredContent??I,h=E.item?.id;if(!E.item||!h)throw new Error("Failed to create the imported agent");return v=h,{virtualMcpId:h,repo:s,connectionId:S,item:E.item}}catch(I){throw v&&await d.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:v}}).catch(()=>{}),await d.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),I}},onSuccess:({virtualMcpId:s,repo:C,connectionId:S,item:v})=>{if(l==="connection"||!s||!v){$(N,o.id),ee(N,o.id),F.success(`Added ${C.name}`),e();return}if(N.setQueryData(O.collectionItem(d,o.id,"","VIRTUAL_MCP",s),{item:v}),$(N,o.id),w(s,C),f){f({virtualMcpId:s,repo:C,connectionId:S});return}F.success(`Imported ${C.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),x(s)},onError:s=>{F.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(D,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(D,{status:"error",error:c.error,retry:c.retry}):u.length===0&&c.status==="idle"?t.jsx(D,{status:"installing",error:null,retry:c.retry}):u.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(s=>t.jsxs("button",{type:"button",onClick:()=>a(s),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?t.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(P,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):m?n?t.jsx(Te,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>b.mutate(s),isSaving:b.isPending}):t.jsx(ve,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,onSelect:r,showBackButton:u.length>1,onBack:()=>a(null)}):null}function ve(i){const e=R.c(47),{connectionId:n,orgId:r,orgSlug:f,onSelect:l,showBackButton:o,onBack:N}=i;let x;e[0]!==r||e[1]!==f?(x={connectionId:Y,orgId:r,orgSlug:f},e[0]=r,e[1]=f,e[2]=x):x=e[2];const y=H(x),a=B(),j=J();let u;e[3]!==n||e[4]!==r?(u=O.githubUserOrgs(r,n),e[3]=n,e[4]=r,e[5]=u):u=e[5];let c;e[6]!==n||e[7]!==y?(c=()=>ye(h=>y.callTool(h),n),e[6]=n,e[7]=y,e[8]=c):c=e[8];let m;e[9]!==u||e[10]!==c?(m={queryKey:u,queryFn:c},e[9]=u,e[10]=c,e[11]=m):m=e[11];const p=te(m);let d;e[12]!==j||e[13]!==n||e[14]!==p||e[15]!==r||e[16]!==f||e[17]!==a?(d={mutationFn:async()=>{const h=await W({connectionId:n,orgId:r,orgSlug:f,persistFallback:k=>j.update.mutateAsync({id:n,data:{connection_token:k}}).then(_e)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${f}/mcp/${n}`,window.location.origin);await a.invalidateQueries({queryKey:O.isMCPAuthenticated(_.href,null)}),await a.invalidateQueries({queryKey:O.mcpClientPrefix()}),await p.refetch()},onError:Ee},e[12]=j,e[13]=n,e[14]=p,e[15]=r,e[16]=f,e[17]=a,e[18]=d):d=e[18];const g=V(d);if(p.isLoading){let h;return e[19]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=h):h=e[19],h}if(p.isError){let h,_;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),_=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=h,e[21]=_):(h=e[20],_=e[21]);let k;e[22]!==g?(k=()=>g.mutate(),e[22]=g,e[23]=k):k=e[23];let A;e[24]!==g.isPending?(A=g.isPending?t.jsx(L,{size:14,className:"animate-spin"}):t.jsx(P,{className:"size-3.5"}),e[24]=g.isPending,e[25]=A):A=e[25];let z;return e[26]!==g.isPending||e[27]!==k||e[28]!==A?(z=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[h,_,t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:k,disabled:g.isPending,children:[A,"Reconnect GitHub"]})]}),e[26]=g.isPending,e[27]=k,e[28]=A,e[29]=z):z=e[29],z}const w=p.data;if(!w)return null;let b;e[30]!==N||e[31]!==o?(b=o&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(X,{size:12}),"Change connection"]})}),e[30]=N,e[31]=o,e[32]=b):b=e[32];let s;if(e[33]!==w.installations||e[34]!==l){let h;e[36]!==l?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},_.installationId),e[36]=l,e[37]=h):h=e[37],s=w.installations.map(h),e[33]=w.installations,e[34]=l,e[35]=s}else s=e[35];let C;e[38]!==s?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=C):C=e[39];const S=w.appSlug?`https://github.com/apps/${w.appSlug}/installations/new`:"https://github.com/settings/installations";let v;e[40]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=v):v=e[40];let I;e[41]!==S?(I=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",v]})}),e[41]=S,e[42]=I):I=e[42];let E;return e[43]!==I||e[44]!==b||e[45]!==C?(E=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,C,I]}),e[43]=I,e[44]=b,e[45]=C,e[46]=E):E=e[46],E}function Ee(i){F.error("Failed to reconnect GitHub: "+(i instanceof Error?i.message:"Unknown error"))}function _e(){}function Te(i){const e=R.c(20),{connectionId:n,orgId:r,orgSlug:f,installation:l,onSelectRepo:o,isSaving:N}=i,[x,y]=T.useState(""),a=ue(x,300),j=T.useDeferredValue(a),u=x!==j;let c;e[0]!==u||e[1]!==x?(c=t.jsx(ce,{placeholder:"Search repositories...",value:x,onChange:y,isSearching:u}),e[0]=u,e[1]=x,e[2]=c):c=e[2];const m=u?"opacity-40":"opacity-100";let p;e[3]!==m?(p=M("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",m),e[3]=m,e[4]=p):p=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=d):d=e[5];let g;e[6]!==n||e[7]!==j||e[8]!==l||e[9]!==N||e[10]!==o||e[11]!==r||e[12]!==f?(g=t.jsx(T.Suspense,{fallback:d,children:t.jsx(ke,{connectionId:n,orgId:r,orgSlug:f,installation:l,query:j,onSelectRepo:o,isSaving:N})}),e[6]=n,e[7]=j,e[8]=l,e[9]=N,e[10]=o,e[11]=r,e[12]=f,e[13]=g):g=e[13];let w;e[14]!==p||e[15]!==g?(w=t.jsx("div",{className:p,children:g}),e[14]=p,e[15]=g,e[16]=w):w=e[16];let b;return e[17]!==c||e[18]!==w?(b=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c,w]}),e[17]=c,e[18]=w,e[19]=b):b=e[19],b}function ke(i){const e=R.c(29),{connectionId:n,orgId:r,orgSlug:f,installation:l,query:o,onSelectRepo:N,isSaving:x}=i;let y;e[0]!==n||e[1]!==r||e[2]!==f?(y={connectionId:n,orgId:r,orgSlug:f},e[0]=n,e[1]=r,e[2]=f,e[3]=y):y=e[3];const a=H(y),j=l.type==="User"?"user":"org",u=o?`${j}:${l.login} ${o} in:name`:`${j}:${l.login}`;let c;e[4]!==n||e[5]!==l.login||e[6]!==r||e[7]!==o?(c=O.githubOrgRepos(r,n,l.login,o),e[4]=n,e[5]=l.login,e[6]=r,e[7]=o,e[8]=c):c=e[8];let m;e[9]!==a||e[10]!==u?(m=async b=>{const{signal:s}=b,S=(await a.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:30}},void 0,{signal:s})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(Re)},e[9]=a,e[10]=u,e[11]=m):m=e[11];let p;e[12]!==c||e[13]!==m?(p={queryKey:c,queryFn:m},e[12]=c,e[13]=m,e[14]=p):p=e[14];const{data:d}=se(p);if(d.length===0){let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=b):b=e[15];let s;e[16]!==o?(s=o&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=o,e[17]=s):s=e[17];let C;return e[18]!==s?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[b,s]}),e[18]=s,e[19]=C):C=e[19],C}let g;if(e[20]!==x||e[21]!==N||e[22]!==d){let b;e[24]!==x||e[25]!==N?(b=s=>t.jsxs("button",{type:"button",onClick:()=>N(s),disabled:x,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(P,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:s.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[s.private?t.jsx(oe,{size:10}):t.jsx(fe,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=x,e[25]=N,e[26]=b):b=e[26],g=d.map(b),e[20]=x,e[21]=N,e[22]=d,e[23]=g}else g=e[23];let w;return e[27]!==g?(w=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[27]=g,e[28]=w):w=e[28],w}function Re(i){return{name:i.name,fullName:i.full_name,owner:i.full_name.split("/")[0]??"",url:i.html_url,private:i.private,description:i.description,updatedAt:i.updated_at}}function D(i){const e=R.c(33),{status:n,error:r,retry:f}=i;if(n==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=v):v=e[1];const I=r??"Something went wrong while connecting to GitHub.";let E;e[2]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:I})]}),e[2]=I,e[3]=E):E=e[3];let h;e[4]!==f?(h=t.jsx("button",{type:"button",onClick:f,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=f,e[5]=h):h=e[5];let _;return e[6]!==E||e[7]!==h?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,E,h]}),e[6]=E,e[7]=h,e[8]=_):_=e[8],_}const l=n==="authenticating";let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(L,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=N):N=e[10];const x=l?"Authenticating with GitHub":"Setting up GitHub";let y;e[11]!==x?(y=t.jsx("p",{className:"text-sm font-medium",children:x}),e[11]=x,e[12]=y):y=e[12];const a=l?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==a?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e[13]=a,e[14]=j):j=e[14];let u;e[15]!==y||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,j]}),e[15]=y,e[16]=j,e[17]=u):u=e[17];const c=l?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[18]!==c?(m=M("size-1.5 rounded-full",c),e[18]=c,e[19]=m):m=e[19];let p;e[20]!==m?(p=t.jsx("span",{className:m}),e[20]=m,e[21]=p):p=e[21];const d=l?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[22]!==d?(g=M("size-1.5 rounded-full",d),e[22]=d,e[23]=g):g=e[23];let w;e[24]!==g?(w=t.jsx("span",{className:g}),e[24]=g,e[25]=w):w=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=b):b=e[26];let s;e[27]!==p||e[28]!==w?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[p,w,b]}),e[27]=p,e[28]=w,e[29]=s):s=e[29];let C;return e[30]!==s||e[31]!==u?(C=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,u,s]}),e[30]=s,e[31]=u,e[32]=C):C=e[32],C}export{Qe as G,P as a,we as b,K as p,be as u};
|
|
1
|
+
import{c as R,j as t,a1 as U,a as Z,n as B,r as T,aj as $,i as L,d as V,t as F,dF as ee,K as O,m as te,B as ne,l as M,P as se,aD as oe}from"./index-DMCDP9dR.js";import{D as re,a as ie,d as le,e as ae}from"./dialog-DkT4Ri5Y.js";import{C as ce}from"./collection-search-COWX-zrS.js";import{u as ue}from"./use-debounced-value-D5S2o6mL.js";import{b as J,u as de}from"./use-connection-C9S1yRy-.js";import{u as H}from"./use-mcp-client-xyqZgz7w.js";import{W as me,S as Y}from"./constants-B72Xmt_K.js";import{a as W}from"./authenticate-and-persist-oauth-uQHwVym9.js";import{b as X}from"./Settings02-Ddh7L72a.js";import{K as fe}from"./agent-icon-DiJCyVK_.js";import{u as xe}from"./use-mcp-tools-BY1xI7T1.js";import{e as pe}from"./extract-connection-data-iRkA6j8O.js";import{c as ge}from"./use-navigate-to-agent-DFHenM1Y.js";import{G as q,a as he,f as ye}from"./github-installations-D2vHSx02.js";function P(i){const e=R.c(4),{size:n,className:r}=i;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=f):f=e[0];let l;return e[1]!==r||e[2]!==n?(l=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:r,children:f}),e[1]=r,e[2]=n,e[3]=l):l=e[3],l}function be(i,e){const n=R.c(12),{org:r}=U();let f;n[0]!==r.id?(f=me.REGISTRY(r.id),n[0]=r.id,n[1]=f):f=n[1];const l=f;let o;n[2]!==r.id||n[3]!==r.slug||n[4]!==l?(o={connectionId:l,orgId:r.id,orgSlug:r.slug},n[2]=r.id,n[3]=r.slug,n[4]=l,n[5]=o):o=n[5];const N=H(o);let x;n[6]!==i?(x={name:i},n[6]=i,n[7]=x):x=n[7];const y=e?.enabled??!0;let a;return n[8]!==N||n[9]!==x||n[10]!==y?(a={client:N,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:x,enabled:y,staleTime:3e5,select:Ne},n[8]=N,n[9]=x,n[10]=y,n[11]=a):a=n[11],xe(a)}function Ne(i){return i.structuredContent?.item??null}const je="deco/mcp-github";function we(i){const{org:e}=U(),{data:n}=Z.useSession(),r=J(),f=B(),[l,o]=T.useState("idle"),[N,x]=T.useState(null),[y,a]=T.useState(null),{data:j,isLoading:u}=be(je,{enabled:i.enabled}),c=T.useRef(!1);i.enabled&&j&&!u&&!c.current&&n?.user?.id&&l==="idle"&&(c.current=!0,m());async function m(){if(!(!j||!n?.user?.id||!e))try{o("installing"),x(null);const d=pe(j,e.id,n.user.id,{remoteIndex:0});if(!d.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:w}=await r.create.mutateAsync(d);o("authenticating");const b=await W({connectionId:w,orgId:e.id,orgSlug:e.slug,persistFallback:s=>r.update.mutateAsync({id:w,data:{connection_token:s}}).then(()=>{})});if(b.ran&&!b.ok){try{await r.delete.mutateAsync(w)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}$(f,e.id),a(d),o("ready")}catch(d){x(d instanceof Error?d.message:String(d)),o("error")}}function p(){o("idle"),x(null),a(null),c.current=!1}return i.enabled&&u&&l==="idle"?{status:"installing",error:null,connection:null,retry:p}:{status:l,error:N,connection:y,retry:p}}const Q="GitHub MCP did not return refreshable repo grant metadata";function G(i){if(typeof i!="string")return null;const e=i.trim();return e.length>0?e:null}function Ce(i){try{const e=new URL(i);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function Ie(i){return typeof i=="number"&&Number.isFinite(i)&&Number.isInteger(i)&&i>0?i:void 0}async function K(i){const{orgSlug:e,sourceConnection:n,installationId:r,owner:f,repo:l,githubCallTool:o,selfCallTool:N,orgShared:x}=i,y=await o({name:"MINT_REPO_TOKEN",arguments:{installationId:r,owner:f,repo:l,permissions:q}}),a=y.structuredContent;if(y.isError||!a?.token){const h=y.content?.find(_=>_.type==="text")?.text;throw new Error(h?`Failed to mint a repo-scoped GitHub token: ${h}`:"Failed to mint a repo-scoped GitHub token")}const j=G(a.refreshToken),u=G(a.tokenEndpoint),c=G(a.clientId);if(!j||!u||!c)throw new Error(Q);if(!Ce(u))throw new Error(Q);const m=G(a.repository?.owner),p=G(a.repository?.name),d="GitHub MCP returned refresh metadata for a different repository";if(a.repository?.owner!==void 0&&(!m||m.toLowerCase()!==f.toLowerCase()))throw new Error(d);if(a.repository?.name!==void 0&&(!p||p.toLowerCase()!==l.toLowerCase()))throw new Error(d);const g=Ie(a.repository?.id),w=a.expiresAt?Date.parse(a.expiresAt):NaN,b=Number.isFinite(w)?Math.max(0,Math.floor((w-Date.now())/1e3)):null,C=(typeof a.expiresIn=="number"&&Number.isFinite(a.expiresIn)&&Number.isInteger(a.expiresIn)&&a.expiresIn>0?a.expiresIn:null)??b,S=await N({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${f}/${l}`,description:`Repo-scoped GitHub access for ${f}/${l}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{...x?{orgShared:!0}:{},repoScope:{installationId:r,repositoryId:g,owner:f,repo:l,permissions:q,grantProvider:"github-mcp"}}}}}),v=S.structuredContent??S,I=v.item?.id??v.id;if(!I)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${I}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:a.token,refreshToken:j,expiresIn:C,scope:a.scope??null,clientId:c,tokenEndpoint:u})})).ok)throw await N({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:I}}function Qe(i){const e=R.c(22),{open:n,onOpenChange:r,title:f,onImportComplete:l,mode:o}=i,N=o===void 0?"agent":o,x=f??(N==="connection"?"Add repo":"Import from GitHub"),[y,a]=T.useState(null);let j;e[0]!==x?(j=t.jsx(re,{className:"sr-only",children:t.jsx(ie,{children:x})}),e[0]=x,e[1]=j):j=e[1];let u;e[2]!==x||e[3]!==y?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:y?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>a(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(X,{size:16})}),t.jsx("img",{src:y.avatarUrl,alt:y.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:y.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(P,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=x,e[3]=y,e[4]=u):u=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=c):c=e[5];let m;e[6]!==r?(m=()=>r(!1),e[6]=r,e[7]=m):m=e[7];let p;e[8]!==N||e[9]!==l||e[10]!==n||e[11]!==y||e[12]!==m?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:c,children:t.jsx(Se,{open:n,onComplete:m,selectedInstallation:y,onSelectInstallation:a,onImportComplete:l,mode:N})})}),e[8]=N,e[9]=l,e[10]=n,e[11]=y,e[12]=m,e[13]=p):p=e[13];let d;e[14]!==j||e[15]!==u||e[16]!==p?(d=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,p]}),e[14]=j,e[15]=u,e[16]=p,e[17]=d):d=e[17];let g;return e[18]!==r||e[19]!==n||e[20]!==d?(g=t.jsx(ae,{open:n,onOpenChange:r,children:d}),e[18]=r,e[19]=n,e[20]=d,e[21]=g):g=e[21],g}function Se({open:i,onComplete:e,selectedInstallation:n,onSelectInstallation:r,onImportComplete:f,mode:l="agent"}){const{org:o}=U(),N=B(),x=ge(),[y,a]=T.useState(null),j=de({slug:"mcp-github"}),u=he(j),c=we({enabled:i&&u.length===0}),m=u.length===1?u[0]??null:y,p=H({connectionId:m?.id??"",orgId:o.id,orgSlug:o.slug}),d=H({connectionId:Y,orgId:o.id,orgSlug:o.slug}),g=async(s,C)=>{try{const v=await p.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:C}});if(v.isError)return null;const E=v.content?.find(h=>h.type==="resource")?.resource?.text;if(!E)return null;try{const h=JSON.parse(E);return typeof h=="string"?h:JSON.stringify(h)}catch{return E}}catch{return null}},w=(s,C)=>{Promise.all([g(C,"AGENTS.md"),g(C,"CLAUDE.md")]).then(async([S,v])=>{const I=S??v??null;I&&(await d.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:I}}}}),$(N,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},b=V({mutationFn:async s=>{if(!m||!n)throw new Error("No GitHub connection or installation");const C=n.installationId;if(l==="connection"){const{childConnectionId:I}=await K({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:E=>p.callTool(E),selfCallTool:E=>d.callTool(E),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:I,item:null}}const{childConnectionId:S}=await K({orgSlug:o.slug,sourceConnection:m,installationId:C,owner:s.owner,repo:s.name,githubCallTool:I=>p.callTool(I),selfCallTool:I=>d.callTool(I)});let v=null;try{const I=await d.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s.name,description:s.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:s.owner,name:s.name,url:s.url,installationId:C,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),E=I.structuredContent??I,h=E.item?.id;if(!E.item||!h)throw new Error("Failed to create the imported agent");return v=h,{virtualMcpId:h,repo:s,connectionId:S,item:E.item}}catch(I){throw v&&await d.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:v}}).catch(()=>{}),await d.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),I}},onSuccess:({virtualMcpId:s,repo:C,connectionId:S,item:v})=>{if(l==="connection"||!s||!v){$(N,o.id),ee(N,o.id),F.success(`Added ${C.name}`),e();return}if(N.setQueryData(O.collectionItem(d,o.id,"","VIRTUAL_MCP",s),{item:v}),$(N,o.id),w(s,C),f){f({virtualMcpId:s,repo:C,connectionId:S});return}F.success(`Imported ${C.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),x(s)},onError:s=>{F.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(D,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(D,{status:"error",error:c.error,retry:c.retry}):u.length===0&&c.status==="idle"?t.jsx(D,{status:"installing",error:null,retry:c.retry}):u.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(s=>t.jsxs("button",{type:"button",onClick:()=>a(s),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?t.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(P,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):m?n?t.jsx(Te,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>b.mutate(s),isSaving:b.isPending}):t.jsx(ve,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,onSelect:r,showBackButton:u.length>1,onBack:()=>a(null)}):null}function ve(i){const e=R.c(47),{connectionId:n,orgId:r,orgSlug:f,onSelect:l,showBackButton:o,onBack:N}=i;let x;e[0]!==r||e[1]!==f?(x={connectionId:Y,orgId:r,orgSlug:f},e[0]=r,e[1]=f,e[2]=x):x=e[2];const y=H(x),a=B(),j=J();let u;e[3]!==n||e[4]!==r?(u=O.githubUserOrgs(r,n),e[3]=n,e[4]=r,e[5]=u):u=e[5];let c;e[6]!==n||e[7]!==y?(c=()=>ye(h=>y.callTool(h),n),e[6]=n,e[7]=y,e[8]=c):c=e[8];let m;e[9]!==u||e[10]!==c?(m={queryKey:u,queryFn:c},e[9]=u,e[10]=c,e[11]=m):m=e[11];const p=te(m);let d;e[12]!==j||e[13]!==n||e[14]!==p||e[15]!==r||e[16]!==f||e[17]!==a?(d={mutationFn:async()=>{const h=await W({connectionId:n,orgId:r,orgSlug:f,persistFallback:k=>j.update.mutateAsync({id:n,data:{connection_token:k}}).then(_e)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${f}/mcp/${n}`,window.location.origin);await a.invalidateQueries({queryKey:O.isMCPAuthenticated(_.href,null)}),await a.invalidateQueries({queryKey:O.mcpClientPrefix()}),await p.refetch()},onError:Ee},e[12]=j,e[13]=n,e[14]=p,e[15]=r,e[16]=f,e[17]=a,e[18]=d):d=e[18];const g=V(d);if(p.isLoading){let h;return e[19]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=h):h=e[19],h}if(p.isError){let h,_;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),_=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=h,e[21]=_):(h=e[20],_=e[21]);let k;e[22]!==g?(k=()=>g.mutate(),e[22]=g,e[23]=k):k=e[23];let A;e[24]!==g.isPending?(A=g.isPending?t.jsx(L,{size:14,className:"animate-spin"}):t.jsx(P,{className:"size-3.5"}),e[24]=g.isPending,e[25]=A):A=e[25];let z;return e[26]!==g.isPending||e[27]!==k||e[28]!==A?(z=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[h,_,t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:k,disabled:g.isPending,children:[A,"Reconnect GitHub"]})]}),e[26]=g.isPending,e[27]=k,e[28]=A,e[29]=z):z=e[29],z}const w=p.data;if(!w)return null;let b;e[30]!==N||e[31]!==o?(b=o&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(X,{size:12}),"Change connection"]})}),e[30]=N,e[31]=o,e[32]=b):b=e[32];let s;if(e[33]!==w.installations||e[34]!==l){let h;e[36]!==l?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},_.installationId),e[36]=l,e[37]=h):h=e[37],s=w.installations.map(h),e[33]=w.installations,e[34]=l,e[35]=s}else s=e[35];let C;e[38]!==s?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=C):C=e[39];const S=w.appSlug?`https://github.com/apps/${w.appSlug}/installations/new`:"https://github.com/settings/installations";let v;e[40]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=v):v=e[40];let I;e[41]!==S?(I=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",v]})}),e[41]=S,e[42]=I):I=e[42];let E;return e[43]!==I||e[44]!==b||e[45]!==C?(E=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,C,I]}),e[43]=I,e[44]=b,e[45]=C,e[46]=E):E=e[46],E}function Ee(i){F.error("Failed to reconnect GitHub: "+(i instanceof Error?i.message:"Unknown error"))}function _e(){}function Te(i){const e=R.c(20),{connectionId:n,orgId:r,orgSlug:f,installation:l,onSelectRepo:o,isSaving:N}=i,[x,y]=T.useState(""),a=ue(x,300),j=T.useDeferredValue(a),u=x!==j;let c;e[0]!==u||e[1]!==x?(c=t.jsx(ce,{placeholder:"Search repositories...",value:x,onChange:y,isSearching:u}),e[0]=u,e[1]=x,e[2]=c):c=e[2];const m=u?"opacity-40":"opacity-100";let p;e[3]!==m?(p=M("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",m),e[3]=m,e[4]=p):p=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=d):d=e[5];let g;e[6]!==n||e[7]!==j||e[8]!==l||e[9]!==N||e[10]!==o||e[11]!==r||e[12]!==f?(g=t.jsx(T.Suspense,{fallback:d,children:t.jsx(ke,{connectionId:n,orgId:r,orgSlug:f,installation:l,query:j,onSelectRepo:o,isSaving:N})}),e[6]=n,e[7]=j,e[8]=l,e[9]=N,e[10]=o,e[11]=r,e[12]=f,e[13]=g):g=e[13];let w;e[14]!==p||e[15]!==g?(w=t.jsx("div",{className:p,children:g}),e[14]=p,e[15]=g,e[16]=w):w=e[16];let b;return e[17]!==c||e[18]!==w?(b=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c,w]}),e[17]=c,e[18]=w,e[19]=b):b=e[19],b}function ke(i){const e=R.c(29),{connectionId:n,orgId:r,orgSlug:f,installation:l,query:o,onSelectRepo:N,isSaving:x}=i;let y;e[0]!==n||e[1]!==r||e[2]!==f?(y={connectionId:n,orgId:r,orgSlug:f},e[0]=n,e[1]=r,e[2]=f,e[3]=y):y=e[3];const a=H(y),j=l.type==="User"?"user":"org",u=o?`${j}:${l.login} ${o} in:name`:`${j}:${l.login}`;let c;e[4]!==n||e[5]!==l.login||e[6]!==r||e[7]!==o?(c=O.githubOrgRepos(r,n,l.login,o),e[4]=n,e[5]=l.login,e[6]=r,e[7]=o,e[8]=c):c=e[8];let m;e[9]!==a||e[10]!==u?(m=async b=>{const{signal:s}=b,S=(await a.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:30}},void 0,{signal:s})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(Re)},e[9]=a,e[10]=u,e[11]=m):m=e[11];let p;e[12]!==c||e[13]!==m?(p={queryKey:c,queryFn:m},e[12]=c,e[13]=m,e[14]=p):p=e[14];const{data:d}=se(p);if(d.length===0){let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=b):b=e[15];let s;e[16]!==o?(s=o&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=o,e[17]=s):s=e[17];let C;return e[18]!==s?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[b,s]}),e[18]=s,e[19]=C):C=e[19],C}let g;if(e[20]!==x||e[21]!==N||e[22]!==d){let b;e[24]!==x||e[25]!==N?(b=s=>t.jsxs("button",{type:"button",onClick:()=>N(s),disabled:x,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(P,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:s.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[s.private?t.jsx(oe,{size:10}):t.jsx(fe,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=x,e[25]=N,e[26]=b):b=e[26],g=d.map(b),e[20]=x,e[21]=N,e[22]=d,e[23]=g}else g=e[23];let w;return e[27]!==g?(w=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[27]=g,e[28]=w):w=e[28],w}function Re(i){return{name:i.name,fullName:i.full_name,owner:i.full_name.split("/")[0]??"",url:i.html_url,private:i.private,description:i.description,updatedAt:i.updated_at}}function D(i){const e=R.c(33),{status:n,error:r,retry:f}=i;if(n==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=v):v=e[1];const I=r??"Something went wrong while connecting to GitHub.";let E;e[2]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:I})]}),e[2]=I,e[3]=E):E=e[3];let h;e[4]!==f?(h=t.jsx("button",{type:"button",onClick:f,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=f,e[5]=h):h=e[5];let _;return e[6]!==E||e[7]!==h?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,E,h]}),e[6]=E,e[7]=h,e[8]=_):_=e[8],_}const l=n==="authenticating";let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(L,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=N):N=e[10];const x=l?"Authenticating with GitHub":"Setting up GitHub";let y;e[11]!==x?(y=t.jsx("p",{className:"text-sm font-medium",children:x}),e[11]=x,e[12]=y):y=e[12];const a=l?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==a?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:a}),e[13]=a,e[14]=j):j=e[14];let u;e[15]!==y||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[y,j]}),e[15]=y,e[16]=j,e[17]=u):u=e[17];const c=l?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[18]!==c?(m=M("size-1.5 rounded-full",c),e[18]=c,e[19]=m):m=e[19];let p;e[20]!==m?(p=t.jsx("span",{className:m}),e[20]=m,e[21]=p):p=e[21];const d=l?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[22]!==d?(g=M("size-1.5 rounded-full",d),e[22]=d,e[23]=g):g=e[23];let w;e[24]!==g?(w=t.jsx("span",{className:g}),e[24]=g,e[25]=w):w=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=b):b=e[26];let s;e[27]!==p||e[28]!==w?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[p,w,b]}),e[27]=p,e[28]=w,e[29]=s):s=e[29];let C;return e[30]!==s||e[31]!==u?(C=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,u,s]}),e[30]=s,e[31]=u,e[32]=C):C=e[32],C}export{Qe as G,P as a,we as b,K as p,be as u};
|