decocms 4.76.78 → 4.76.79
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-DBEuJvXd.js → AlertCircle-NWT5MP59.js} +1 -1
- package/dist/client/assets/{AreaChart-RJnPaDTO.js → AreaChart-O3QKrQPh.js} +1 -1
- package/dist/client/assets/{ArrowUp-OqBYOpu3.js → ArrowUp-CI9f7Rli.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-3xkp-kWm.js → ArrowUpRight-BLwgj-5u.js} +1 -1
- package/dist/client/assets/{Check-Oxo5mPeL.js → Check-CQ8-e3GA.js} +1 -1
- package/dist/client/assets/{CheckCircle-DAvZWWWn.js → CheckCircle-B8lzemah.js} +1 -1
- package/dist/client/assets/{ChevronDown-DCZlSvzQ.js → ChevronDown-DFRYq9AW.js} +1 -1
- package/dist/client/assets/{ChevronRight-L_rxCnv3.js → ChevronRight-__Xchs6i.js} +1 -1
- package/dist/client/assets/{ChevronUp-BXrO8J56.js → ChevronUp-Bk9mNl9n.js} +1 -1
- package/dist/client/assets/{Circle-DLL8alCD.js → Circle-B7cLY0dJ.js} +1 -1
- package/dist/client/assets/{Copy01-uwiMYWRU.js → Copy01-DSoPlmWJ.js} +1 -1
- package/dist/client/assets/{DotsVertical-B0IViKUD.js → DotsVertical-BwkyfTFO.js} +1 -1
- package/dist/client/assets/{Eye-DVo1_Pm2.js → Eye-Bq2ekfRv.js} +1 -1
- package/dist/client/assets/{FilterLines-CAdlDh3I.js → FilterLines-BX9-SCxr.js} +1 -1
- package/dist/client/assets/{Flag01-fXAeu3l9.js → Flag01-8dzumq8s.js} +1 -1
- package/dist/client/assets/{Globe01-By9gtoyg.js → Globe01-yzHFTNA0.js} +1 -1
- package/dist/client/assets/{Globe04-uOyvHHk7.js → Globe04-DuWNuxaZ.js} +1 -1
- package/dist/client/assets/{HardDrive-D38nWE_J.js → HardDrive-ChdiMduQ.js} +1 -1
- package/dist/client/assets/{Image01-B-uMMK1I.js → Image01-DgmL_Wby.js} +1 -1
- package/dist/client/assets/{Key01-ChBXFLCM.js → Key01-iTFprcNj.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DPtsS7J4.js → LayoutLeft-DqR7Gk_I.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C3luIiQr.js → LinkExternal01-tSVLxTO-.js} +1 -1
- package/dist/client/assets/{List-CgvHjjyd.js → List-CKTtYv0g.js} +1 -1
- package/dist/client/assets/{Monitor01-BbnHlrzQ.js → Monitor01-BuRZenpT.js} +1 -1
- package/dist/client/assets/{Package-CJkGCd9M.js → Package-Ciy5YR41.js} +1 -1
- package/dist/client/assets/{Palette-Dem2eeFJ.js → Palette-BvKxQVC0.js} +1 -1
- package/dist/client/assets/{Play-02R_l1hm.js → Play-CeHEWsS2.js} +1 -1
- package/dist/client/assets/{Plus-D8fSfWhL.js → Plus-NAA0XEwV.js} +1 -1
- package/dist/client/assets/{SearchLg-BKY8fQrj.js → SearchLg-TrTg6wyY.js} +1 -1
- package/dist/client/assets/{SearchMd-Di7fRkvt.js → SearchMd-cSNFYpug.js} +1 -1
- package/dist/client/assets/{Settings02-CJygIZBg.js → Settings02-FiuW9M68.js} +1 -1
- package/dist/client/assets/{Shield01-bU8ewL-C.js → Shield01-P0gtso05.js} +1 -1
- package/dist/client/assets/{Star01-CAO22TgC.js → Star01-CmbYYVwX.js} +1 -1
- package/dist/client/assets/{Stars01-BbGPjqZd.js → Stars01-CjcKnRO3.js} +1 -1
- package/dist/client/assets/{Stars02-Bs0TEaNy.js → Stars02-C0ZdnGol.js} +1 -1
- package/dist/client/assets/{Sun-BZaKEOLT.js → Sun-N1hbZsBI.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DqE-u_vC.js → SwitchHorizontal01-Dbf6vT8W.js} +1 -1
- package/dist/client/assets/{Tool01-DHJpebK1.js → Tool01-BuL_OPjq.js} +1 -1
- package/dist/client/assets/{Tool02-DlSNNbnL.js → Tool02-SRLl9iMy.js} +1 -1
- package/dist/client/assets/{Trash01-BGwW4PUs.js → Trash01-BEUt_ZFy.js} +1 -1
- package/dist/client/assets/{TrendUp01-Lnwj2rUh.js → TrendUp01-Dd7ID2Ak.js} +1 -1
- package/dist/client/assets/{Upload01-DVcY511n.js → Upload01-BdYkMGf5.js} +1 -1
- package/dist/client/assets/{User01-joygJQdk.js → User01-BuskJcXh.js} +1 -1
- package/dist/client/assets/{UserPlus01-DvdLIpOn.js → UserPlus01-I1RBlBt2.js} +1 -1
- package/dist/client/assets/{Users01-BVTwFHJb.js → Users01-bv-zYUvR.js} +1 -1
- package/dist/client/assets/{Users03-FhX9tiey.js → Users03-uQDm2N1U.js} +1 -1
- package/dist/client/assets/{X-Bs0u_0yh.js → X-D37ABNsH.js} +1 -1
- package/dist/client/assets/{XCircle-DGorVz-d.js → XCircle-B1AuAQ6C.js} +1 -1
- package/dist/client/assets/{XClose-hq2LkF75.js → XClose-N5g0Jmie.js} +1 -1
- package/dist/client/assets/{Zap-CT4kcBoV.js → Zap-D7hv22Ar.js} +1 -1
- package/dist/client/assets/{ZapSquare-DivgtbPr.js → ZapSquare-I37sZUyy.js} +1 -1
- package/dist/client/assets/{ZoomOut-B2C9WPW-.js → ZoomOut-C6ASppVU.js} +1 -1
- package/dist/client/assets/{access-gate-B4pZWmwl.js → access-gate-DttmKZh0.js} +1 -1
- package/dist/client/assets/{add-section-modal-JBdSC8cO.js → add-section-modal-C2mWaR4D.js} +1 -1
- package/dist/client/assets/{agent-icon-Xdz_mRuJ.js → agent-icon-BXJxtnIS.js} +1 -1
- package/dist/client/assets/{agents-list-2gWOzqrw.js → agents-list-MRO_H-zy.js} +1 -1
- package/dist/client/assets/{ai-providers-N4FbEwVk.js → ai-providers-CpQgI_QJ.js} +1 -1
- package/dist/client/assets/{alert-dialog-CWlVUd73.js → alert-dialog-DS5vnPXz.js} +1 -1
- package/dist/client/assets/{alert-j61mFoia.js → alert-qyaJB4-4.js} +1 -1
- package/dist/client/assets/{app-editor-BRpM18eX.js → app-editor-DZz7gi_D.js} +1 -1
- package/dist/client/assets/{auth-catchall-B0LUMpZy.js → auth-catchall-DMON0huT.js} +1 -1
- package/dist/client/assets/{auth-entry-wtr1fLwN.js → auth-entry-CceXSuE1.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bifmzv2W.js → auth-split-layout-DwAyeKe8.js} +1 -1
- package/dist/client/assets/{auth-DDOP_TUe.js → auth-wu3ShF63.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BcKcvBur.js → authenticate-and-persist-oauth-CMhoqQaF.js} +1 -1
- package/dist/client/assets/{automation-list-row-CWbyvM3t.js → automation-list-row-BBV0EPoJ.js} +1 -1
- package/dist/client/assets/{automation-runs-ewxrJgPk.js → automation-runs-qsX2v47y.js} +1 -1
- package/dist/client/assets/automations-CUMgHaXo.js +1 -0
- package/dist/client/assets/{autosend-sntJRLit.js → autosend-7F45whv_.js} +1 -1
- package/dist/client/assets/{avatar-BumqAYVV.js → avatar-BidIHGtX.js} +1 -1
- package/dist/client/assets/{badge-DuwyDvgL.js → badge-CZ22AXi2.js} +1 -1
- package/dist/client/assets/{block-document-COkNQDU1.js → block-document-CsC-wRuG.js} +1 -1
- package/dist/client/assets/{brand-context-DJ55kBWm.js → brand-context-qDZ-BzsZ.js} +1 -1
- package/dist/client/assets/{buckets-CZaQ9-E2.js → buckets-M2Atx_XZ.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-C4UbsY4X.js → bulk-category-panel-Cd_ZyUBH.js} +1 -1
- package/dist/client/assets/{calendar-Dpt7QB2d.js → calendar-Vyya8AVM.js} +1 -1
- package/dist/client/assets/{capability-load-error-CVQ-0IvS.js → capability-load-error-CHJpJoE8.js} +1 -1
- package/dist/client/assets/{card-whir3-TU.js → card-4UY0XyGm.js} +1 -1
- package/dist/client/assets/{category-editor-DSjyTevO.js → category-editor-DaU2gL1A.js} +1 -1
- package/dist/client/assets/{chat-context-CZYpc7lP.js → chat-context-BgzAc_sD.js} +1 -1
- package/dist/client/assets/{checkbox-DbEZ6b_D.js → checkbox-DTTzGgDp.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DhmnJDJJ.js → cli-auth-success-CXUBAfSL.js} +1 -1
- package/dist/client/assets/{collection-detail-B32MmFU7.js → collection-detail-Cjm7ugAn.js} +1 -1
- package/dist/client/assets/{collection-display-button--OVhArve.js → collection-display-button-Ct8ZCD85.js} +1 -1
- package/dist/client/assets/{collection-search-26JlKJRJ.js → collection-search-BNlVJQJ6.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DPtPbXkO.js → collection-table-wrapper-rvwk-VDM.js} +1 -1
- package/dist/client/assets/{collection-tabs-CMkX9SJV.js → collection-tabs-BuHhy4w7.js} +1 -1
- package/dist/client/assets/{command-BoNCgAXF.js → command-C2qQZRBk.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DbO5ycXJ.js → commerce-onboarding-s6XHDF1d.js} +1 -1
- package/dist/client/assets/{companions-core-C3l18hJe.js → companions-core-DnG6T6eB.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DR3AZpl6.js → connect-desktop-dialog-CvsuQuya.js} +1 -1
- package/dist/client/assets/{connection-card-ClbjHgoq.js → connection-card-C5DqLZv2.js} +1 -1
- package/dist/client/assets/{connection-detail-B8ktqErv.js → connection-detail-DUqLyJIU.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CkjvvPa_.js → connection-form-helpers-GtWYUDM9.js} +1 -1
- package/dist/client/assets/connections-Bv1n7hnz.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-ByDpDqQ2.js → decopilot-sse-pool-B9iK6ns-.js} +1 -1
- package/dist/client/assets/{dialog-hBUfi5DB.js → dialog-HBBCSa8Y.js} +1 -1
- package/dist/client/assets/{domain-settings-DnawB_fV.js → domain-settings-Zb4Opd1X.js} +1 -1
- package/dist/client/assets/{drawer-CrQJ-4Ry.js → drawer-COp33Mdu.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BDW1EJyx.js → dropdown-menu-MsavL0ma.js} +1 -1
- package/dist/client/assets/{empty-state-LUctNkh2.js → empty-state-CmyChBrn.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BFgBaCrk.js → extract-connection-data-D7fs47LL.js} +1 -1
- package/dist/client/assets/{file-explorer-1FqRLQQ5.js → file-explorer-UPsbMtks.js} +1 -1
- package/dist/client/assets/{file-type-icon-CaoqUw2g.js → file-type-icon-VxqyFQG8.js} +1 -1
- package/dist/client/assets/{files-BpPo_clL.js → files-CPhiXm9a.js} +1 -1
- package/dist/client/assets/{form-B8zhOVR3.js → form-B_zUNTS4.js} +1 -1
- package/dist/client/assets/{general-DxlJNW0F.js → general-BuXtd1m4.js} +1 -1
- package/dist/client/assets/{github-repo-picker-D93GRlsF.js → github-repo-picker-BLeREnmC.js} +1 -1
- package/dist/client/assets/{hooks-DNLn_ut2.js → hooks-BZlnl4wN.js} +1 -1
- package/dist/client/assets/{index-vt02LGOF.js → index--IKD5rOc.js} +1 -1
- package/dist/client/assets/{index-BUTM8e7t.js → index-7swhLrry.js} +1 -1
- package/dist/client/assets/{index-DArYfizl.js → index-B6NwnY9X.js} +1 -1
- package/dist/client/assets/{index-CWrnaczo.js → index-BjnTTOYD.js} +1 -1
- package/dist/client/assets/{index-CdyljS_N.js → index-C0fF6Nmd.js} +1 -1
- package/dist/client/assets/{index-F-ZMCKP-.js → index-CJZqHoWu.js} +2 -2
- package/dist/client/assets/{index-DTiOXvtP.js → index-CjkSjvvy.js} +1 -1
- package/dist/client/assets/{index-MnX4iOa5.js → index-CwBKEYBb.js} +1 -1
- package/dist/client/assets/{index-gpoC3ssJ.js → index-D-r3rjSU.js} +5 -5
- package/dist/client/assets/{index-DGQdC8j6.js → index-D4utvNsR.js} +3 -3
- package/dist/client/assets/{index-sveg7vlb.js → index-DicupuM5.js} +1 -1
- package/dist/client/assets/{index-qg-bT8JA.js → index-Djd1r33z.js} +1 -1
- package/dist/client/assets/{index-Cag8mnTh.js → index-LhVZmt7a.js} +1 -1
- package/dist/client/assets/{index-redirect-UnLDnJlQ.js → index-redirect-CLYWr53b.js} +1 -1
- package/dist/client/assets/{index-ivY09p7e.js → index-sDWBtTOL.js} +1 -1
- package/dist/client/assets/{input-DwWe5Hqk.js → input-Ddc8GyCU.js} +1 -1
- package/dist/client/assets/{integration-icon-CfaWXLBn.js → integration-icon-CIdkP7k0.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-D3eUhcy1.js → invite-member-dialog-CpzKfDWm.js} +1 -1
- package/dist/client/assets/{label-DdsuSm6M.js → label-DsHShlh_.js} +1 -1
- package/dist/client/assets/{layout-Bts6NJ_J.js → layout-2N03ztVn.js} +1 -1
- package/dist/client/assets/{login-Dd4NGdu8.js → login-DWyMNJs3.js} +1 -1
- package/dist/client/assets/{mcp-oauth-SHxAJnkD.js → mcp-oauth-KJCmJgBu.js} +1 -1
- package/dist/client/assets/{members-6mHVnRNm.js → members-CBn0aB_O.js} +1 -1
- package/dist/client/assets/{monaco-editor-DGONpAoN.js → monaco-editor-B9Xp4u4G.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CfSW2sgf.js → monitoring-stats-row-LR2JknH9.js} +1 -1
- package/dist/client/assets/{multi-select-CD32kF2s.js → multi-select-Ceb8LBER.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bzq_-z2r.js → oauth-callback-DMQLYnlm.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DxKql_z0.js → oauth-callback-ai-provider-BwQNilfc.js} +1 -1
- package/dist/client/assets/{onboarding-BwDunMKX.js → onboarding-CGN_xMMx.js} +1 -1
- package/dist/client/assets/{org-install-BR62T5jO.js → org-install-BkwU8WUn.js} +1 -1
- package/dist/client/assets/{org-layout-BHG4t6-u.js → org-layout-COS9nQD9.js} +1 -1
- package/dist/client/assets/{organization-choice-DlY0QjY5.js → organization-choice-BiZjReCB.js} +1 -1
- package/dist/client/assets/{orgs-Bsar34iG.js → orgs-Ckipp54i.js} +1 -1
- package/dist/client/assets/{page-seo-form-D8JddRAG.js → page-seo-form-4lRZCU7E.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DfsAdHjp.js +1 -0
- package/dist/client/assets/{popover-BoSjy_J9.js → popover-B46I_Ucw.js} +1 -1
- package/dist/client/assets/{post-editor-BeOF_jnK.js → post-editor-C5FLIO95.js} +1 -1
- package/dist/client/assets/{primitives-cDJctbRp.js → primitives-Svun8brc.js} +1 -1
- package/dist/client/assets/{profile-BpIHCO3e.js → profile-B4sYbcgm.js} +1 -1
- package/dist/client/assets/project-app-view-DH-2VH6R.js +1 -0
- package/dist/client/assets/record-editor-gilDUuiR.js +1 -0
- package/dist/client/assets/redirect-editor-Bl_Pg6Cw.js +1 -0
- package/dist/client/assets/registry-5LQCvTVr.js +2 -0
- package/dist/client/assets/{registry-layout-BTDmQem2.js → registry-layout-DnM1m10w.js} +1 -1
- package/dist/client/assets/{reports-rH-WO9Po.js → reports-DNbuVjAM.js} +1 -1
- package/dist/client/assets/{require-capability--U_vi60H.js → require-capability-C33DXbmM.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B-_kB-P-.js → required-auth-layout-BlrFCB6M.js} +1 -1
- package/dist/client/assets/{reset-password-BbwEGkWF.js → reset-password-DLU44zom.js} +1 -1
- package/dist/client/assets/{roles-BRucDg6D.js → roles-CMlgtGhV.js} +1 -1
- package/dist/client/assets/{search-input-B0lumlG7.js → search-input-BND_6eX8.js} +1 -1
- package/dist/client/assets/{secrets-Cx316kN4.js → secrets-Ce6HtP8Q.js} +1 -1
- package/dist/client/assets/{sections-editor-DUBW607x.js → sections-editor-CBREWsVi.js} +1 -1
- package/dist/client/assets/{select-vVirKMnE.js → select-Cgj3tK9y.js} +1 -1
- package/dist/client/assets/{select-model-BltF0usx.js → select-model-Cg2EESV5.js} +1 -1
- package/dist/client/assets/{self-tool-result-hAvB5Ojq.js → self-tool-result-3kSlTB-7.js} +1 -1
- package/dist/client/assets/{seo-editor-CWtXZnRQ.js → seo-editor-Kn0aTI-T.js} +1 -1
- package/dist/client/assets/{settings-layout-Bew9lvu0.js → settings-layout-B1Oxghjr.js} +1 -1
- package/dist/client/assets/{settings-section-CvpT3RW4.js → settings-section-DDOPDuOE.js} +1 -1
- package/dist/client/assets/{shell-controls-C-g_XIqJ.js → shell-controls-SOU59lii.js} +1 -1
- package/dist/client/assets/{shell-layout-b2wj0DO7.js → shell-layout-Cx8SPKkd.js} +1 -1
- package/dist/client/assets/{sidebar-C_llE2r0.js → sidebar-SFF8zaaZ.js} +1 -1
- package/dist/client/assets/{skeleton-CB7DUvyX.js → skeleton-DSjfN9Xh.js} +1 -1
- package/dist/client/assets/{sso-CUBuMbRD.js → sso-CZnb6wsO.js} +1 -1
- package/dist/client/assets/{store-B1pmnLUq.js → store-C8L0GETU.js} +1 -1
- package/dist/client/assets/store-registry-CdjrXOJQ.js +2 -0
- package/dist/client/assets/{studio-tools-DII0jqi8.js → studio-tools-BWndc-fQ.js} +1 -1
- package/dist/client/assets/{switch-DW7tjnTv.js → switch-CjEjtKhZ.js} +1 -1
- package/dist/client/assets/{table-DqN44BtI.js → table-ClTv7bfG.js} +1 -1
- package/dist/client/assets/{tabs-DoePSWje.js → tabs-B777ilaN.js} +1 -1
- package/dist/client/assets/{textarea-BH3kgWLk.js → textarea-D6dFtA7Z.js} +1 -1
- package/dist/client/assets/{toggle-group-Dbv18C0K.js → toggle-group-CQTvZEmD.js} +1 -1
- package/dist/client/assets/{toolbar-CFkubGs8.js → toolbar-CAvFyYH2.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B2gRcy3Z.js → toolbar-icon-button-BgDS1fC7.js} +1 -1
- package/dist/client/assets/{tooltip-CO1zVhUs.js → tooltip-C9-Aq0A0.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DuJIHuvT.js → use-ai-providers-CrlMzELc.js} +1 -1
- package/dist/client/assets/{use-automations-CjVm1klr.js → use-automations-B522nl9G.js} +1 -1
- package/dist/client/assets/{use-autosave-IhKsmyqJ.js → use-autosave-BBCk9peY.js} +1 -1
- package/dist/client/assets/{use-capability-CEIYeJxR.js → use-capability-Bh-cXZQP.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BDXFn1B6.js → use-clock-tick-CPHfLtvQ.js} +1 -1
- package/dist/client/assets/{use-collections-BqfJEMNR.js → use-collections-C4ZdBvCy.js} +1 -1
- package/dist/client/assets/{use-connection-DM8eKjeN.js → use-connection-CMZ9jqla.js} +1 -1
- package/dist/client/assets/{use-copy-eCXRBbSs.js → use-copy-B11qmxiZ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C4Sbw3ia.js → use-create-virtual-mcp-Cr3TUikS.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DQFgMtID.js → use-debounced-autosave-Cc5UHtj5.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CMoeorqx.js → use-debounced-value-LEPVWu3-.js} +1 -1
- package/dist/client/assets/{use-deco-credits-C0lExqRa.js → use-deco-credits-DQ9ANHT7.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-qGOD1WG0.js → use-decopilot-events-ammftc5y.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BOFCmtMj.js → use-delete-connection-CB0l1Kvt.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Cwn49qZM.js → use-deployment-admin-BW1qOrfz.js} +1 -1
- package/dist/client/assets/{use-file-configs-Nmeyll7B.js → use-file-configs-DI04dv5Q.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DW-B2iyn.js → use-infinite-scroll-CBFoMQ8w.js} +1 -1
- package/dist/client/assets/{use-join-requests-Dz8x0kbW.js → use-join-requests-d-ZVDLei.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D-ki6Fzr.js → use-mcp-auth-status-DxwuZvfF.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Csg0Ohl1.js → use-mcp-client-Dxv8FjGO.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DF4E3rLo.js → use-mcp-tools-DXkXFAag.js} +1 -1
- package/dist/client/assets/{use-members-B1t5oiJJ.js → use-members-BwWfSaf3.js} +1 -1
- package/dist/client/assets/{use-mobile-DVuyUrh-.js → use-mobile-sXXxxOPa.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BL2c2hni.js → use-navigate-to-agent-CNjqf1SD.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-dM7W8lCQ.js → use-org-auth-client-Dc6RqagL.js} +1 -1
- package/dist/client/assets/{use-org-sso-w2vntLws.js → use-org-sso-BpXfZfCP.js} +1 -1
- package/dist/client/assets/{use-organization-roles-7B2EryzT.js → use-organization-roles-1VIcG8c9.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Dfv3IVMe.js → use-organization-settings-CApfiGSv.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DMVj_IUs.js → use-registry-connections-CSbasPhs.js} +1 -1
- package/dist/client/assets/{use-secrets-j8nq_pg4.js → use-secrets-JetoEI8o.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CQv-RBYC.js → use-status-sounds-C0EdfjXB.js} +1 -1
- package/dist/client/assets/{use-view-mode-DJr2m2Jz.js → use-view-mode-S-wbwlBg.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-6yApsgIW.js → use-virtual-mcp-D5tjWVve.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DS0faLJi.js +1 -0
- package/dist/client/assets/{useRouterState-D5zTQX9l.js → useRouterState-eCJDvEu-.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CSO0szLh.js +1 -0
- package/dist/client/assets/{users-Dji-ZHlw.js → users-oZTgivG1.js} +1 -1
- package/dist/client/assets/{variant-calendar-UBPoL6eu.js → variant-calendar-Dl5OgOoK.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BxM9Rzzk.js → view-mode-toggle-D1X7KEBT.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/automations-C5v25H5e.js +0 -1
- package/dist/client/assets/connections-BcUWe8c_.js +0 -1
- package/dist/client/assets/page-seo-sheet-CaWQpVxd.js +0 -1
- package/dist/client/assets/project-app-view-CD4EGdca.js +0 -1
- package/dist/client/assets/record-editor-DpnQ11Qy.js +0 -1
- package/dist/client/assets/redirect-editor-DTyzzd3k.js +0 -1
- package/dist/client/assets/registry-B76hNPE7.js +0 -2
- package/dist/client/assets/store-registry-UxzRtugx.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CzbwdXBh.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-0mVVL1tH.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-D4utvNsR.js";import{c as O}from"./use-mcp-client-Dxv8FjGO.js";import{W as T}from"./constants-D_FQAPnt.js";function x(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(t){const e=x(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function B(t,e){return H(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(t){if(!t)return[];const e=[];for(const n of t){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])}e.push(...a)}return e}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(t){return t?D[t]??t.toUpperCase():null}function Q(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function X(t,e,n,a,r){const o=await O({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const Y="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=G[n[t]&63];return e};function j(t){return`${t}_${$()}`}function K(t){return t._meta?.["mcp.mesh"]?.appName||t.server?.name||null}function V(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(t,e,n,a){const r=t.server,o=t._meta?.[Y],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",C=r?.description||null,R=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,k=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,w=o?.configuration_state,A=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??[],S=a?.packageIndex??0,v=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[v];let u,f,_=null;if(c){const h=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=L(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,N=p.length>1;let d="";c&&N?d=` (${W(c)})`:l&&M&&(d=` (${V(l)})`);const E=I+d;return{id:j("conn"),title:E,description:C,icon:R,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:_,oauth_config:k,configuration_state:w??null,configuration_scopes:A??null,metadata:{source:"store",registry_item_id:t.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:e,tools:null,bindings:null,status:"inactive"}}export{K as a,U as b,X as c,Q as d,Z as e,J as f,j as g,B as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as Y,r as u,j as r,i as oe,B as pe,d$ as jt,aO as Nt,aU as re,e0 as St,e1 as Mt,e2 as Dt,e3 as Rt,bO as Pt,e4 as Et,e5 as Be,aQ as kt,e6 as Tt,e7 as Ot,e8 as At,e9 as Lt,ea as Ft,eb as $t,ec as It,ed as _t,ee as zt,l as ie,n as Gt,t as Q,K as Le}from"./index-DGQdC8j6.js";import{F as Kt,l as Bt}from"./index-vt02LGOF.js";import{d as Vt,ax as Ut,ay as Wt}from"./agent-icon-Xdz_mRuJ.js";import{s as Qt}from"./XClose-hq2LkF75.js";import{A as qt}from"./automation-runs-ewxrJgPk.js";import{b as Fe,T as $e,a as Ie}from"./tooltip-CO1zVhUs.js";import{b as Ht}from"./chat-context-CZYpc7lP.js";import{u as Xt}from"./shell-layout-b2wj0DO7.js";import{s as de,a as _e,f as Yt}from"./index-gpoC3ssJ.js";import{a as Jt,h as Zt,D as en,c as tn,d as nn,e as rn}from"./dialog-hBUfi5DB.js";import{I as ze}from"./input-DwWe5Hqk.js";import{c as on,d as an,b as sn,A as ln,g as cn,e as dn,a as un,f as fn}from"./alert-dialog-CWlVUd73.js";import{t as mn}from"./ChevronDown-DCZlSvzQ.js";import{i as pn}from"./ChevronRight-L_rxCnv3.js";import{a as xn}from"./ZoomOut-B2C9WPW-.js";import{v as hn,E as gn,w as Ge,x as ve,y as vn,z as yn,A as Cn,C as H,D as ue,G as wn,g as ye,I as Ce,J as bn,K as jn,M as we,N as fe,O as be,P as Nn,Q as Sn}from"./index-CWrnaczo.js";import"./AlertCircle-DBEuJvXd.js";import"./UserPlus01-DvdLIpOn.js";import"./Tool01-DHJpebK1.js";import"./ArrowUp-OqBYOpu3.js";import"./Settings02-CJygIZBg.js";import"./Tool02-DlSNNbnL.js";import"./XCircle-DGorVz-d.js";import"./ArrowUpRight-3xkp-kWm.js";import"./TrendUp01-Lnwj2rUh.js";import"./ZapSquare-DivgtbPr.js";import"./Users03-FhX9tiey.js";import"./CheckCircle-DAvZWWWn.js";import"./Check-Oxo5mPeL.js";import"./ChevronUp-BXrO8J56.js";import"./Circle-DLL8alCD.js";import"./Stars02-Bs0TEaNy.js";import"./Copy01-uwiMYWRU.js";import"./DotsVertical-B0IViKUD.js";import"./Globe01-By9gtoyg.js";import"./Eye-DVo1_Pm2.js";import"./FilterLines-CAdlDh3I.js";import"./Flag01-fXAeu3l9.js";import"./Star01-CAO22TgC.js";import"./Globe04-uOyvHHk7.js";import"./SwitchHorizontal01-DqE-u_vC.js";import"./HardDrive-D38nWE_J.js";import"./Image01-B-uMMK1I.js";import"./Key01-ChBXFLCM.js";import"./LayoutLeft-DPtsS7J4.js";import"./LinkExternal01-C3luIiQr.js";import"./List-CgvHjjyd.js";import"./Monitor01-BbnHlrzQ.js";import"./Sun-BZaKEOLT.js";import"./Package-CJkGCd9M.js";import"./Palette-Dem2eeFJ.js";import"./Play-02R_l1hm.js";import"./Plus-D8fSfWhL.js";import"./SearchLg-BKY8fQrj.js";import"./SearchMd-Di7fRkvt.js";import"./Shield01-bU8ewL-C.js";import"./Stars01-BbGPjqZd.js";import"./Trash01-BGwW4PUs.js";import"./Upload01-DVcY511n.js";import"./User01-joygJQdk.js";import"./Users01-BVTwFHJb.js";import"./X-Bs0u_0yh.js";import"./Zap-CT4kcBoV.js";import"./select-vVirKMnE.js";import"./useInfiniteQuery-CzbwdXBh.js";import"./use-infinite-scroll-DW-B2iyn.js";import"./use-connection-DM8eKjeN.js";import"./use-collections-BqfJEMNR.js";import"./use-mcp-client-Csg0Ohl1.js";import"./constants-D_FQAPnt.js";import"./auth-DDOP_TUe.js";import"./use-virtual-mcp-6yApsgIW.js";import"./card-whir3-TU.js";import"./sidebar-C_llE2r0.js";import"./use-mobile-DVuyUrh-.js";import"./table-DqN44BtI.js";import"./empty-state-LUctNkh2.js";import"./use-members-B1t5oiJJ.js";import"./use-org-auth-client-dM7W8lCQ.js";import"./use-clock-tick-BDXFn1B6.js";import"./use-automations-CjVm1klr.js";import"./studio-tools-DII0jqi8.js";import"./useSuspenseInfiniteQuery-0mVVL1tH.js";import"./avatar-BumqAYVV.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-eCXRBbSs.js";import"./file-type-icon-CaoqUw2g.js";import"./tab-id-BijBBRwE.js";import"./hooks-DNLn_ut2.js";import"./decopilot-sse-pool-ByDpDqQ2.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./monaco-editor-DGONpAoN.js";import"./index-BUTM8e7t.js";import"./integration-icon-CfaWXLBn.js";import"./use-navigate-to-agent-BL2c2hni.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-RJnPaDTO.js";import"./form-B8zhOVR3.js";import"./label-DdsuSm6M.js";import"./autosend-sntJRLit.js";import"./use-ai-providers-DuJIHuvT.js";import"./use-decopilot-events-qGOD1WG0.js";import"./use-organization-settings-Dfv3IVMe.js";import"./required-auth-layout-B-_kB-P-.js";import"./use-org-sso-w2vntLws.js";import"./drawer-CrQJ-4Ry.js";import"./collection-search-26JlKJRJ.js";import"./tabs-DoePSWje.js";import"./toggle-group-Dbv18C0K.js";import"./use-deco-credits-C0lExqRa.js";import"./extract-connection-data-BFgBaCrk.js";import"./connection-card-ClbjHgoq.js";import"./use-registry-connections-DMVj_IUs.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BH3kgWLk.js";import"./connection-form-helpers-CkjvvPa_.js";import"./authenticate-and-persist-oauth-BcKcvBur.js";import"./mcp-oauth-SHxAJnkD.js";import"./collection-tabs-CMkX9SJV.js";import"./badge-DuwyDvgL.js";import"./connect-desktop-dialog-DR3AZpl6.js";import"./select-model-BltF0usx.js";import"./checkbox-DbEZ6b_D.js";import"./skeleton-CB7DUvyX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CvpT3RW4.js";import"./command-BoNCgAXF.js";import"./index-Cag8mnTh.js";import"./popover-BoSjy_J9.js";import"./dropdown-menu-BDW1EJyx.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CQv-RBYC.js";import"./toolbar-CFkubGs8.js";import"./use-mcp-tools-DF4E3rLo.js";import"./use-capability-CEIYeJxR.js";import"./use-debounced-autosave-DQFgMtID.js";import"./index-qg-bT8JA.js";import"./search-input-B0lumlG7.js";import"./use-mcp-auth-status-D-ki6Fzr.js";import"./switch-DW7tjnTv.js";import"./github-repo-picker-D93GRlsF.js";import"./use-debounced-value-CMoeorqx.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-j8nq_pg4.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-C3l18hJe.js";import"./index-F-ZMCKP-.js";import"./get-initials-D-f_fDFw.js";import"./calendar-Dpt7QB2d.js";import"./toolbar-icon-button-B2gRcy3Z.js";import"./use-file-configs-Nmeyll7B.js";import"./automation-list-row-CWbyvM3t.js";const Mn={"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 Dn(s){const e=Y.c(51),{open:i,mode:a,initialName:c,parentLabel:f,isPending:h,onSubmit:p,onOpenChange:v}=s,y=c===void 0?"":c,d=h===void 0?!1:h,[x,C]=u.useState(y),[D,k]=u.useState(i),g=Mn[a];i!==D&&(k(i),i&&C(y));let b;e[0]!==d||e[1]!==v?(b=V=>{!V&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const U=b;let T;e[3]!==d||e[4]!==x||e[5]!==p?(T=async V=>{V.preventDefault();const q=x.trim();!q||d||await p(q)},e[3]=d,e[4]=x,e[5]=p,e[6]=T):T=e[6];const O=T;let j;e[7]!==g.title?(j=r.jsx(Jt,{children:g.title}),e[7]=g.title,e[8]=j):j=e[8];let w;e[9]!==g.description?(w=r.jsx(Zt,{children:g.description}),e[9]=g.description,e[10]=w):w=e[10];let A;e[11]!==j||e[12]!==w?(A=r.jsxs(en,{children:[j,w]}),e[11]=j,e[12]=w,e[13]=A):A=e[13];let L;e[14]!==f?(L=f&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(ze,{value:f,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=f,e[15]=L):L=e[15];let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=G):G=e[16];let $;e[17]===Symbol.for("react.memo_cache_sentinel")?($=V=>C(V.target.value),e[17]=$):$=e[17];let I;e[18]!==g.placeholder||e[19]!==d||e[20]!==x?(I=r.jsxs("div",{className:"space-y-1.5",children:[G,r.jsx(ze,{id:"file-explorer-name",value:x,onChange:$,placeholder:g.placeholder,autoFocus:!0,disabled:d})]}),e[18]=g.placeholder,e[19]=d,e[20]=x,e[21]=I):I=e[21];let R;e[22]!==I||e[23]!==L?(R=r.jsxs("div",{className:"space-y-4 py-4",children:[L,I]}),e[22]=I,e[23]=L,e[24]=R):R=e[24];let P;e[25]!==v?(P=()=>v(!1),e[25]=v,e[26]=P):P=e[26];let _;e[27]!==d||e[28]!==P?(_=r.jsx(pe,{type:"button",variant:"outline",onClick:P,disabled:d,children:"Cancel"}),e[27]=d,e[28]=P,e[29]=_):_=e[29];let z;e[30]!==d||e[31]!==x?(z=!x.trim()||d,e[30]=d,e[31]=x,e[32]=z):z=e[32];let N;e[33]!==g.submit||e[34]!==d?(N=d?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:14,className:"animate-spin"}),"Saving…"]}):g.submit,e[33]=g.submit,e[34]=d,e[35]=N):N=e[35];let K;e[36]!==z||e[37]!==N?(K=r.jsx(pe,{type:"submit",disabled:z,children:N}),e[36]=z,e[37]=N,e[38]=K):K=e[38];let S;e[39]!==_||e[40]!==K?(S=r.jsxs(tn,{children:[_,K]}),e[39]=_,e[40]=K,e[41]=S):S=e[41];let E;e[42]!==O||e[43]!==R||e[44]!==S||e[45]!==A?(E=r.jsx(nn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:O,children:[A,R,S]})}),e[42]=O,e[43]=R,e[44]=S,e[45]=A,e[46]=E):E=e[46];let W;return e[47]!==U||e[48]!==i||e[49]!==E?(W=r.jsx(rn,{open:i,onOpenChange:U,children:E}),e[47]=U,e[48]=i,e[49]=E,e[50]=W):W=e[50],W}function Rn(s){const e=Y.c(31),{deleteTarget:i,deleteDirtyPaths:a,fsActionPending:c,onOpenChange:f,onConfirm:h}=s,p=i!==null,v=i?.kind==="directory"?"folder":"file";let y;e[0]!==v?(y=r.jsxs(on,{children:["Delete ",v,"?"]}),e[0]=v,e[1]=y):y=e[1];const d=i?.name;let x;e[2]!==d?(x=r.jsx("span",{className:"font-mono",children:d}),e[2]=d,e[3]=x):x=e[3];const C=i?.kind==="directory"?" and everything inside it.":".";let D;e[4]!==a.length?(D=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?"One open file has unsaved changes that will be lost.":`${a.length} open files have unsaved changes that will be lost.`]}),e[4]=a.length,e[5]=D):D=e[5];let k;e[6]!==x||e[7]!==C||e[8]!==D?(k=r.jsxs(an,{children:["This will permanently delete"," ",x,C,D]}),e[6]=x,e[7]=C,e[8]=D,e[9]=k):k=e[9];let g;e[10]!==y||e[11]!==k?(g=r.jsxs(sn,{children:[y,k]}),e[10]=y,e[11]=k,e[12]=g):g=e[12];let b;e[13]!==c?(b=r.jsx(ln,{disabled:c,children:"Cancel"}),e[13]=c,e[14]=b):b=e[14];const U=c||!i;let T;e[15]!==i||e[16]!==h?(T=L=>{L.preventDefault(),i&&h(i)},e[15]=i,e[16]=h,e[17]=T):T=e[17];let O;e[18]!==U||e[19]!==T?(O=r.jsx(cn,{disabled:U,onClick:T,children:"Delete"}),e[18]=U,e[19]=T,e[20]=O):O=e[20];let j;e[21]!==b||e[22]!==O?(j=r.jsxs(dn,{children:[b,O]}),e[21]=b,e[22]=O,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==g?(w=r.jsxs(un,{children:[g,j]}),e[24]=j,e[25]=g,e[26]=w):w=e[26];let A;return e[27]!==f||e[28]!==p||e[29]!==w?(A=r.jsx(fn,{open:p,onOpenChange:f,children:w}),e[27]=f,e[28]=p,e[29]=w,e[30]=A):A=e[30],A}var je="ContextMenu",[Pn]=kt(je,[Be]),B=Be(),[En,Ve]=Pn(je),Ue=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:f=!0}=s,[h,p]=u.useState(!1),v=B(e),y=Pt(a),d=u.useCallback(x=>{p(x),y(x)},[y]);return r.jsx(En,{scope:e,open:h,onOpenChange:d,modal:f,children:r.jsx(Et,{...v,dir:c,open:h,onOpenChange:d,modal:f,children:i})})};Ue.displayName=je;var We="ContextMenuTrigger",Qe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,f=Ve(We,i),h=B(i),p=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),y=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(y.current),[]),x=C=>{p.current={x:C.clientX,y:C.clientY},f.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(jt,{...h,virtualRef:v}),r.jsx(Nt.span,{"data-state":f.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:re(s.onContextMenu,C=>{d(),x(C),C.preventDefault()}),onPointerDown:a?s.onPointerDown:re(s.onPointerDown,me(C=>{d(),y.current=window.setTimeout(()=>x(C),700)})),onPointerMove:a?s.onPointerMove:re(s.onPointerMove,me(d)),onPointerCancel:a?s.onPointerCancel:re(s.onPointerCancel,me(d)),onPointerUp:a?s.onPointerUp:re(s.onPointerUp,me(d))})]})});Qe.displayName=We;var kn="ContextMenuPortal",qe=s=>{const{__scopeContextMenu:e,...i}=s,a=B(e);return r.jsx(Dt,{...a,...i})};qe.displayName=kn;var He="ContextMenuContent",Xe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Ve(He,i),f=B(i),h=u.useRef(!1);return r.jsx(Rt,{...f,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&h.current&&p.preventDefault(),h.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(h.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)"}})});Xe.displayName=He;var Tn="ContextMenuGroup",On=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Tt,{...c,...a,ref:e})});On.displayName=Tn;var An="ContextMenuLabel",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ot,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuItem",Ye=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(St,{...c,...a,ref:e})});Ye.displayName=Fn;var $n="ContextMenuCheckboxItem",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(At,{...c,...a,ref:e})});In.displayName=$n;var _n="ContextMenuRadioGroup",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Lt,{...c,...a,ref:e})});zn.displayName=_n;var Gn="ContextMenuRadioItem",Kn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ft,{...c,...a,ref:e})});Kn.displayName=Gn;var Bn="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx($t,{...c,...a,ref:e})});Vn.displayName=Bn;var Un="ContextMenuSeparator",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Mt,{...c,...a,ref:e})});Je.displayName=Un;var Wn="ContextMenuArrow",Qn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(It,{...c,...a,ref:e})});Qn.displayName=Wn;var qn="ContextMenuSubTrigger",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(_t,{...c,...a,ref:e})});Hn.displayName=qn;var Xn="ContextMenuSubContent",Yn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(zt,{...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)"}})});Yn.displayName=Xn;function me(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var Jn=Ue,Zn=Qe,er=qe,tr=Xe,nr=Ye,rr=Je;function or(s){const e=Y.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(Jn,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ir(s){const e=Y.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(Zn,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Y.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=ie("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 f;return e[5]!==a||e[6]!==c?(f=r.jsx(er,{children:r.jsx(tr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}function ee(s){const e=Y.c(12);let i,a,c,f;e[0]!==s?({className:i,inset:a,variant:f,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=f):(i=e[1],a=e[2],c=e[3],f=e[4]);const h=f===void 0?"default":f;let p;e[5]!==i?(p=ie("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 v;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==h?(v=r.jsx(nr,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=h,e[11]=v):v=e[11],v}function Ke(s){const e=Y.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=ie("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==a||e[6]!==c?(f=r.jsx(rr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}const sr="#d9a441";function lr(s){const e=Y.c(45),{node:i,depth:a,isExpanded:c,isSelected:f,isLoading:h,fileVisual:p,onOpen:v,onSelect:y,onNewFile:d,onNewFolder:x,onCopyPath:C,onCopyRelativePath:D,onRename:k,onDelete:g}=s,b=h===void 0?!1:h,U=i.kind==="directory",{Icon:T,color:O}=p,j=f&&"bg-accent";let w;e[0]!==j?(w=ie("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",j),e[0]=j,e[1]=w):w=e[1];const A=`${a*14+8}px`;let L;e[2]!==A?(L={paddingLeft:A},e[2]=A,e[3]=L):L=e[3];let G;e[4]!==v||e[5]!==y?(G=()=>{y(),v()},e[4]=v,e[5]=y,e[6]=G):G=e[6];let $;e[7]!==T||e[8]!==O||e[9]!==U||e[10]!==c||e[11]!==b?($=U?r.jsxs(r.Fragment,{children:[b?r.jsx(oe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(mn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(pn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(xn,{size:16,className:"shrink-0",style:{color:sr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(T,{size:16,className:"shrink-0",style:{color:O}})]}),e[7]=T,e[8]=O,e[9]=U,e[10]=c,e[11]=b,e[12]=$):$=e[12];let I;e[13]!==i.name?(I=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=I):I=e[14];let R;e[15]!==w||e[16]!==L||e[17]!==G||e[18]!==$||e[19]!==I?(R=r.jsx(ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:w,style:L,onClick:G,children:[$,I]})}),e[15]=w,e[16]=L,e[17]=G,e[18]=$,e[19]=I,e[20]=R):R=e[20];let P;e[21]!==d?(P=r.jsx(ee,{onSelect:d,children:"New File"}),e[21]=d,e[22]=P):P=e[22];let _;e[23]!==x?(_=r.jsx(ee,{onSelect:x,children:"New Folder"}),e[23]=x,e[24]=_):_=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsx(Ke,{}),e[25]=z):z=e[25];let N;e[26]!==C?(N=r.jsx(ee,{onSelect:C,children:"Copy Path"}),e[26]=C,e[27]=N):N=e[27];let K;e[28]!==D?(K=r.jsx(ee,{onSelect:D,children:"Copy Relative Path"}),e[28]=D,e[29]=K):K=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(Ke,{}),e[30]=S):S=e[30];let E;e[31]!==k?(E=r.jsx(ee,{onSelect:k,children:"Rename"}),e[31]=k,e[32]=E):E=e[32];let W;e[33]!==g?(W=r.jsx(ee,{variant:"destructive",onSelect:g,children:"Delete"}),e[33]=g,e[34]=W):W=e[34];let V;e[35]!==P||e[36]!==_||e[37]!==N||e[38]!==K||e[39]!==E||e[40]!==W?(V=r.jsxs(ar,{className:"w-52",children:[P,_,z,N,K,S,E,W]}),e[35]=P,e[36]=_,e[37]=N,e[38]=K,e[39]=E,e[40]=W,e[41]=V):V=e[41];let q;return e[42]!==V||e[43]!==R?(q=r.jsxs(or,{children:[R,V]}),e[42]=V,e[43]=R,e[44]=q):q=e[44],q}Bt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function cr(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function oa({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,f]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:p}=c,[v,y]=u.useState(new Set),[d,x]=u.useState(null),[C,D]=u.useState(null),[k,g]=u.useState([]),[b,U]=u.useState(""),[T,O]=u.useState(!1),[j,w]=u.useState(!1),[,A]=u.useState(new Set),[L,G]=u.useState(new Set),$=u.useRef(0),I=u.useRef(null),R=u.useRef(new Set),P=u.useRef(new Map);function _(t){A(n=>{const o=typeof t=="function"?t(n):t;return R.current=o,o})}const[z,N]=u.useState(new Map),K=u.useRef(null),[S,E]=u.useState(null),{sendMessage:W}=Ht(),{openSidePanel:V}=Xt(),q=Gt(),[F,X]=u.useState(null),[xe,he]=u.useState(null),[ae,se]=u.useState(!1);async function J(t,n){const o=await fetch(cr(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 le(){q.invalidateQueries({queryKey:_e(s,e,i)})}function Ne(t,n){navigator.clipboard.writeText(n).then(()=>Q.success(`${t} copied`),()=>Q.error(`Failed to copy ${t.toLowerCase()}`))}function Ze(t){const n=Nn(t);if(!n)return;const o=`${s}/${e}/${i}`;q.setQueryData(Le.decofile(o),l=>{if(!l)return l;const{[n]:m,...M}=l;return M}),q.invalidateQueries({queryKey:Le.liveMeta(s,e,i)})}function et(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>ue(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)Ze(o)}function tt(t){const n=ue(t);return k.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=z.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Se(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),N(n=>{const o=new Map;for(const[l,m]of n){const M=t(l);M&&o.set(M,m)}return o}),D(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 nt(t){const n=ue(t);D(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Se(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function rt(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);await J("write",{path:H(n),content:""}),await te(),await le(),X(null),ge(n)}async function ot(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);const o=H(n);await J("mkdir",{path:o}),f(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await te(),await le(),X(null),y(l=>{const m=new Set(l);for(const M of ve(n))m.add(M);return m.add(n),m}),D({name:t,path:n,kind:"directory",children:[]})}async function it(t){if(!F)return;const n=F.node.path,o=we(n),l=fe(o,t);if(l===n){X(null);return}if(be(l,h,p))throw new Error(`"${t}" already exists`);await J("rename",{from:H(n),to:H(l)}),Se(m=>m===n?l:m.startsWith(`${n}/`)?fe(l,m.slice(n.length+1)):m),await te(),await le(),X(null)}async function at(t){se(!0);try{await J("unlink",{path:H(t.path),recursive:t.kind==="directory"}),et(t),nt(t.path),await te(),await le(),he(null),Q.success(`Deleted "${t.name}"`)}catch(n){Q.error(n instanceof Error?n.message:"Delete failed")}finally{se(!1)}}async function st(t){const n=jn(t);if(n){Q.error(n);return}se(!0);try{F?.mode==="new-file"?(await rt(t),Q.success(`Created "${t}"`)):F?.mode==="new-folder"?(await ot(t),Q.success(`Created folder "${t}"`)):F?.mode==="rename"&&(await it(t),Q.success(`Renamed to "${t}"`))}catch(o){Q.error(o instanceof Error?o.message:"Operation failed")}finally{se(!1)}}const Me=u.useRef(!1);Me.current||(Me.current=!0,I.current=te());const[lt,ct]=u.useState(null);if(a&&a!==lt){ct(a);const t=a;queueMicrotask(()=>{hn(t)&&ge(t).catch(n=>{Q.error(n instanceof Error?n.message:"Failed to open file")})})}async function De(t){const n=await J("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Re(t,n,o){if(o!==$.current)return!1;let l=!1;return f(m=>{const M=n?Sn(m.files,m.directories,t,m.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!M.truncated,{files:M.files,directories:M.directories,truncated:l}}),l&&Q.warning("File list truncated — some files may be hidden"),l}async function dt(t){const n=P.current.get(t);if(n)return n;const o=$.current,l=(async()=>{const m=await De({pattern:"**/*",path:H(t),limit:Ge}),M=Re(m,!0,o);return!M&&o===$.current&&_(ne=>{const ce=new Set(ne);return ce.add(t),ce}),M})();P.current.set(t,l);try{return await l}finally{P.current.delete(t)}}async function Pe(t){if(!Ce(t,R.current))return!1;G(n=>new Set(n).add(t));try{return await dt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function ut(t){const n=new Set(R.current);for(const o of ve(t)){if(!Ce(o,n))continue;if(await Pe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function te(){const t=++$.current;P.current.clear(),O(!0),_(new Set),y(new Set),G(new Set);try{const n=await De({pattern:"**/*",limit:Ge,maxDepth:gn});Re(n,!1,t),w(!0)}catch{j&&Q.error("Failed to refresh file tree")}finally{O(!1)}}async function Ee(t){if(!z.get(t)?.loaded){N(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await J("read",{path:H(t),full:!0}),l=bn(o.content??"");N(m=>{const M=new Map(m);return M.set(t,{savedContent:l,editorValue:l,loaded:!0}),M})}catch{}}}async function ft(t,n){try{await J("write",{path:H(t),content:n}),de("file saved via sandbox /write",{path:t}),q.invalidateQueries({queryKey:_e(s,e,i)});try{const o=await Yt(s,e,i);de("git status after save",o)}catch(o){de("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}N(o=>{const l=new Map(o),m=l.get(t);return m&&l.set(t,{...m,savedContent:n}),l})}catch(o){de("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function mt(t){x(t),D({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),E(null),k.includes(t)||g(n=>[...n,t]),Ee(t)}function pt(t){g(n=>{const o=n.filter(l=>l!==t);return d===t&&x(o[o.length-1]??null),o}),N(n=>{const o=new Map(n);return o.delete(t),o})}function ke(t){y(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function xt(t){if(Ce(t,R.current))try{if(await Pe(t))return}catch(n){Q.error(n instanceof Error?n.message:"Failed to load folder");return}ke(t)}async function ht(t,n){if(n){ke(t);return}await xt(t)}async function ge(t){await I.current,await ut(t);const n=ve(t);y(o=>{const l=new Set(o);for(const m of n)l.add(m);return l}),mt(t)}function gt(){return C?.kind==="directory"?C.path:C?.kind==="file"?we(C.path):d?we(d):"/"}function Te(t){const n=gt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const vt=vn(h,p),Oe=yn(vt,v),Ae=b?Oe.filter(t=>t.node.name.toLowerCase().includes(b.toLowerCase())):Oe,Z=d?z.get(d):null,yt=Z?.loaded&&Z.editorValue!==Z.savedContent,Ct=xe?tt(xe.path):[],wt=(t,n)=>{K.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ft(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const m=l.getValueInRange(o);E({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:m})})};function bt(t){if(!S)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${S.filePath}\``,`**Lines:** ${S.lineStart}–${S.lineEnd}`];if(S.selectedCode){const o=ye(S.filePath),l=S.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),V("chat"),W({parts:[{type:"text",text:n.join(`
|
|
1
|
+
import{c as Y,r as u,j as r,i as oe,B as pe,d$ as jt,aO as Nt,aU as re,e0 as St,e1 as Mt,e2 as Dt,e3 as Rt,bO as Pt,e4 as Et,e5 as Be,aQ as kt,e6 as Tt,e7 as Ot,e8 as At,e9 as Lt,ea as Ft,eb as $t,ec as It,ed as _t,ee as zt,l as ie,n as Gt,t as Q,K as Le}from"./index-D4utvNsR.js";import{F as Kt,l as Bt}from"./index--IKD5rOc.js";import{d as Vt,ax as Ut,ay as Wt}from"./agent-icon-BXJxtnIS.js";import{s as Qt}from"./XClose-N5g0Jmie.js";import{A as qt}from"./automation-runs-qsX2v47y.js";import{b as Fe,T as $e,a as Ie}from"./tooltip-C9-Aq0A0.js";import{b as Ht}from"./chat-context-BgzAc_sD.js";import{u as Xt}from"./shell-layout-Cx8SPKkd.js";import{s as de,a as _e,f as Yt}from"./index-D-r3rjSU.js";import{a as Jt,h as Zt,D as en,c as tn,d as nn,e as rn}from"./dialog-HBBCSa8Y.js";import{I as ze}from"./input-Ddc8GyCU.js";import{c as on,d as an,b as sn,A as ln,g as cn,e as dn,a as un,f as fn}from"./alert-dialog-DS5vnPXz.js";import{t as mn}from"./ChevronDown-DFRYq9AW.js";import{i as pn}from"./ChevronRight-__Xchs6i.js";import{a as xn}from"./ZoomOut-C6ASppVU.js";import{v as hn,E as gn,w as Ge,x as ve,y as vn,z as yn,A as Cn,C as H,D as ue,G as wn,g as ye,I as Ce,J as bn,K as jn,M as we,N as fe,O as be,P as Nn,Q as Sn}from"./index-BjnTTOYD.js";import"./AlertCircle-NWT5MP59.js";import"./UserPlus01-I1RBlBt2.js";import"./Tool01-BuL_OPjq.js";import"./ArrowUp-CI9f7Rli.js";import"./Settings02-FiuW9M68.js";import"./Tool02-SRLl9iMy.js";import"./XCircle-B1AuAQ6C.js";import"./ArrowUpRight-BLwgj-5u.js";import"./TrendUp01-Dd7ID2Ak.js";import"./ZapSquare-I37sZUyy.js";import"./Users03-uQDm2N1U.js";import"./CheckCircle-B8lzemah.js";import"./Check-CQ8-e3GA.js";import"./ChevronUp-Bk9mNl9n.js";import"./Circle-B7cLY0dJ.js";import"./Stars02-C0ZdnGol.js";import"./Copy01-DSoPlmWJ.js";import"./DotsVertical-BwkyfTFO.js";import"./Globe01-yzHFTNA0.js";import"./Eye-Bq2ekfRv.js";import"./FilterLines-BX9-SCxr.js";import"./Flag01-8dzumq8s.js";import"./Star01-CmbYYVwX.js";import"./Globe04-DuWNuxaZ.js";import"./SwitchHorizontal01-Dbf6vT8W.js";import"./HardDrive-ChdiMduQ.js";import"./Image01-DgmL_Wby.js";import"./Key01-iTFprcNj.js";import"./LayoutLeft-DqR7Gk_I.js";import"./LinkExternal01-tSVLxTO-.js";import"./List-CKTtYv0g.js";import"./Monitor01-BuRZenpT.js";import"./Sun-N1hbZsBI.js";import"./Package-Ciy5YR41.js";import"./Palette-BvKxQVC0.js";import"./Play-CeHEWsS2.js";import"./Plus-NAA0XEwV.js";import"./SearchLg-TrTg6wyY.js";import"./SearchMd-cSNFYpug.js";import"./Shield01-P0gtso05.js";import"./Stars01-CjcKnRO3.js";import"./Trash01-BEUt_ZFy.js";import"./Upload01-BdYkMGf5.js";import"./User01-BuskJcXh.js";import"./Users01-bv-zYUvR.js";import"./X-D37ABNsH.js";import"./Zap-D7hv22Ar.js";import"./select-Cgj3tK9y.js";import"./useInfiniteQuery-DS0faLJi.js";import"./use-infinite-scroll-CBFoMQ8w.js";import"./use-connection-CMZ9jqla.js";import"./use-collections-C4ZdBvCy.js";import"./use-mcp-client-Dxv8FjGO.js";import"./constants-D_FQAPnt.js";import"./auth-wu3ShF63.js";import"./use-virtual-mcp-D5tjWVve.js";import"./card-4UY0XyGm.js";import"./sidebar-SFF8zaaZ.js";import"./use-mobile-sXXxxOPa.js";import"./table-ClTv7bfG.js";import"./empty-state-CmyChBrn.js";import"./use-members-BwWfSaf3.js";import"./use-org-auth-client-Dc6RqagL.js";import"./use-clock-tick-CPHfLtvQ.js";import"./use-automations-B522nl9G.js";import"./studio-tools-BWndc-fQ.js";import"./useSuspenseInfiniteQuery-CSO0szLh.js";import"./avatar-BidIHGtX.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B11qmxiZ.js";import"./file-type-icon-VxqyFQG8.js";import"./tab-id-BijBBRwE.js";import"./hooks-BZlnl4wN.js";import"./decopilot-sse-pool-B9iK6ns-.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./monaco-editor-B9Xp4u4G.js";import"./index-7swhLrry.js";import"./integration-icon-CIdkP7k0.js";import"./use-navigate-to-agent-CNjqf1SD.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-O3QKrQPh.js";import"./form-B_zUNTS4.js";import"./label-DsHShlh_.js";import"./autosend-7F45whv_.js";import"./use-ai-providers-CrlMzELc.js";import"./use-decopilot-events-ammftc5y.js";import"./use-organization-settings-CApfiGSv.js";import"./required-auth-layout-BlrFCB6M.js";import"./use-org-sso-BpXfZfCP.js";import"./drawer-COp33Mdu.js";import"./collection-search-BNlVJQJ6.js";import"./tabs-B777ilaN.js";import"./toggle-group-CQTvZEmD.js";import"./use-deco-credits-DQ9ANHT7.js";import"./extract-connection-data-D7fs47LL.js";import"./connection-card-C5DqLZv2.js";import"./use-registry-connections-CSbasPhs.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-D6dFtA7Z.js";import"./connection-form-helpers-GtWYUDM9.js";import"./authenticate-and-persist-oauth-CMhoqQaF.js";import"./mcp-oauth-KJCmJgBu.js";import"./collection-tabs-BuHhy4w7.js";import"./badge-CZ22AXi2.js";import"./connect-desktop-dialog-CvsuQuya.js";import"./select-model-Cg2EESV5.js";import"./checkbox-DTTzGgDp.js";import"./skeleton-DSjfN9Xh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DDOPDuOE.js";import"./command-C2qQZRBk.js";import"./index-LhVZmt7a.js";import"./popover-B46I_Ucw.js";import"./dropdown-menu-MsavL0ma.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C0EdfjXB.js";import"./toolbar-CAvFyYH2.js";import"./use-mcp-tools-DXkXFAag.js";import"./use-capability-Bh-cXZQP.js";import"./use-debounced-autosave-Cc5UHtj5.js";import"./index-Djd1r33z.js";import"./search-input-BND_6eX8.js";import"./use-mcp-auth-status-DxwuZvfF.js";import"./switch-CjEjtKhZ.js";import"./github-repo-picker-BLeREnmC.js";import"./use-debounced-value-LEPVWu3-.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-JetoEI8o.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DnG6T6eB.js";import"./index-CJZqHoWu.js";import"./get-initials-D-f_fDFw.js";import"./calendar-Vyya8AVM.js";import"./toolbar-icon-button-BgDS1fC7.js";import"./use-file-configs-DI04dv5Q.js";import"./automation-list-row-BBV0EPoJ.js";const Mn={"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 Dn(s){const e=Y.c(51),{open:i,mode:a,initialName:c,parentLabel:f,isPending:h,onSubmit:p,onOpenChange:v}=s,y=c===void 0?"":c,d=h===void 0?!1:h,[x,C]=u.useState(y),[D,k]=u.useState(i),g=Mn[a];i!==D&&(k(i),i&&C(y));let b;e[0]!==d||e[1]!==v?(b=V=>{!V&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const U=b;let T;e[3]!==d||e[4]!==x||e[5]!==p?(T=async V=>{V.preventDefault();const q=x.trim();!q||d||await p(q)},e[3]=d,e[4]=x,e[5]=p,e[6]=T):T=e[6];const O=T;let j;e[7]!==g.title?(j=r.jsx(Jt,{children:g.title}),e[7]=g.title,e[8]=j):j=e[8];let w;e[9]!==g.description?(w=r.jsx(Zt,{children:g.description}),e[9]=g.description,e[10]=w):w=e[10];let A;e[11]!==j||e[12]!==w?(A=r.jsxs(en,{children:[j,w]}),e[11]=j,e[12]=w,e[13]=A):A=e[13];let L;e[14]!==f?(L=f&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(ze,{value:f,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=f,e[15]=L):L=e[15];let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=G):G=e[16];let $;e[17]===Symbol.for("react.memo_cache_sentinel")?($=V=>C(V.target.value),e[17]=$):$=e[17];let I;e[18]!==g.placeholder||e[19]!==d||e[20]!==x?(I=r.jsxs("div",{className:"space-y-1.5",children:[G,r.jsx(ze,{id:"file-explorer-name",value:x,onChange:$,placeholder:g.placeholder,autoFocus:!0,disabled:d})]}),e[18]=g.placeholder,e[19]=d,e[20]=x,e[21]=I):I=e[21];let R;e[22]!==I||e[23]!==L?(R=r.jsxs("div",{className:"space-y-4 py-4",children:[L,I]}),e[22]=I,e[23]=L,e[24]=R):R=e[24];let P;e[25]!==v?(P=()=>v(!1),e[25]=v,e[26]=P):P=e[26];let _;e[27]!==d||e[28]!==P?(_=r.jsx(pe,{type:"button",variant:"outline",onClick:P,disabled:d,children:"Cancel"}),e[27]=d,e[28]=P,e[29]=_):_=e[29];let z;e[30]!==d||e[31]!==x?(z=!x.trim()||d,e[30]=d,e[31]=x,e[32]=z):z=e[32];let N;e[33]!==g.submit||e[34]!==d?(N=d?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:14,className:"animate-spin"}),"Saving…"]}):g.submit,e[33]=g.submit,e[34]=d,e[35]=N):N=e[35];let K;e[36]!==z||e[37]!==N?(K=r.jsx(pe,{type:"submit",disabled:z,children:N}),e[36]=z,e[37]=N,e[38]=K):K=e[38];let S;e[39]!==_||e[40]!==K?(S=r.jsxs(tn,{children:[_,K]}),e[39]=_,e[40]=K,e[41]=S):S=e[41];let E;e[42]!==O||e[43]!==R||e[44]!==S||e[45]!==A?(E=r.jsx(nn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:O,children:[A,R,S]})}),e[42]=O,e[43]=R,e[44]=S,e[45]=A,e[46]=E):E=e[46];let W;return e[47]!==U||e[48]!==i||e[49]!==E?(W=r.jsx(rn,{open:i,onOpenChange:U,children:E}),e[47]=U,e[48]=i,e[49]=E,e[50]=W):W=e[50],W}function Rn(s){const e=Y.c(31),{deleteTarget:i,deleteDirtyPaths:a,fsActionPending:c,onOpenChange:f,onConfirm:h}=s,p=i!==null,v=i?.kind==="directory"?"folder":"file";let y;e[0]!==v?(y=r.jsxs(on,{children:["Delete ",v,"?"]}),e[0]=v,e[1]=y):y=e[1];const d=i?.name;let x;e[2]!==d?(x=r.jsx("span",{className:"font-mono",children:d}),e[2]=d,e[3]=x):x=e[3];const C=i?.kind==="directory"?" and everything inside it.":".";let D;e[4]!==a.length?(D=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?"One open file has unsaved changes that will be lost.":`${a.length} open files have unsaved changes that will be lost.`]}),e[4]=a.length,e[5]=D):D=e[5];let k;e[6]!==x||e[7]!==C||e[8]!==D?(k=r.jsxs(an,{children:["This will permanently delete"," ",x,C,D]}),e[6]=x,e[7]=C,e[8]=D,e[9]=k):k=e[9];let g;e[10]!==y||e[11]!==k?(g=r.jsxs(sn,{children:[y,k]}),e[10]=y,e[11]=k,e[12]=g):g=e[12];let b;e[13]!==c?(b=r.jsx(ln,{disabled:c,children:"Cancel"}),e[13]=c,e[14]=b):b=e[14];const U=c||!i;let T;e[15]!==i||e[16]!==h?(T=L=>{L.preventDefault(),i&&h(i)},e[15]=i,e[16]=h,e[17]=T):T=e[17];let O;e[18]!==U||e[19]!==T?(O=r.jsx(cn,{disabled:U,onClick:T,children:"Delete"}),e[18]=U,e[19]=T,e[20]=O):O=e[20];let j;e[21]!==b||e[22]!==O?(j=r.jsxs(dn,{children:[b,O]}),e[21]=b,e[22]=O,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==g?(w=r.jsxs(un,{children:[g,j]}),e[24]=j,e[25]=g,e[26]=w):w=e[26];let A;return e[27]!==f||e[28]!==p||e[29]!==w?(A=r.jsx(fn,{open:p,onOpenChange:f,children:w}),e[27]=f,e[28]=p,e[29]=w,e[30]=A):A=e[30],A}var je="ContextMenu",[Pn]=kt(je,[Be]),B=Be(),[En,Ve]=Pn(je),Ue=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:f=!0}=s,[h,p]=u.useState(!1),v=B(e),y=Pt(a),d=u.useCallback(x=>{p(x),y(x)},[y]);return r.jsx(En,{scope:e,open:h,onOpenChange:d,modal:f,children:r.jsx(Et,{...v,dir:c,open:h,onOpenChange:d,modal:f,children:i})})};Ue.displayName=je;var We="ContextMenuTrigger",Qe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,f=Ve(We,i),h=B(i),p=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),y=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(y.current),[]),x=C=>{p.current={x:C.clientX,y:C.clientY},f.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(jt,{...h,virtualRef:v}),r.jsx(Nt.span,{"data-state":f.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:re(s.onContextMenu,C=>{d(),x(C),C.preventDefault()}),onPointerDown:a?s.onPointerDown:re(s.onPointerDown,me(C=>{d(),y.current=window.setTimeout(()=>x(C),700)})),onPointerMove:a?s.onPointerMove:re(s.onPointerMove,me(d)),onPointerCancel:a?s.onPointerCancel:re(s.onPointerCancel,me(d)),onPointerUp:a?s.onPointerUp:re(s.onPointerUp,me(d))})]})});Qe.displayName=We;var kn="ContextMenuPortal",qe=s=>{const{__scopeContextMenu:e,...i}=s,a=B(e);return r.jsx(Dt,{...a,...i})};qe.displayName=kn;var He="ContextMenuContent",Xe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Ve(He,i),f=B(i),h=u.useRef(!1);return r.jsx(Rt,{...f,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&h.current&&p.preventDefault(),h.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(h.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)"}})});Xe.displayName=He;var Tn="ContextMenuGroup",On=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Tt,{...c,...a,ref:e})});On.displayName=Tn;var An="ContextMenuLabel",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ot,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuItem",Ye=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(St,{...c,...a,ref:e})});Ye.displayName=Fn;var $n="ContextMenuCheckboxItem",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(At,{...c,...a,ref:e})});In.displayName=$n;var _n="ContextMenuRadioGroup",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Lt,{...c,...a,ref:e})});zn.displayName=_n;var Gn="ContextMenuRadioItem",Kn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ft,{...c,...a,ref:e})});Kn.displayName=Gn;var Bn="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx($t,{...c,...a,ref:e})});Vn.displayName=Bn;var Un="ContextMenuSeparator",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Mt,{...c,...a,ref:e})});Je.displayName=Un;var Wn="ContextMenuArrow",Qn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(It,{...c,...a,ref:e})});Qn.displayName=Wn;var qn="ContextMenuSubTrigger",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(_t,{...c,...a,ref:e})});Hn.displayName=qn;var Xn="ContextMenuSubContent",Yn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(zt,{...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)"}})});Yn.displayName=Xn;function me(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var Jn=Ue,Zn=Qe,er=qe,tr=Xe,nr=Ye,rr=Je;function or(s){const e=Y.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(Jn,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ir(s){const e=Y.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(Zn,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Y.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=ie("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 f;return e[5]!==a||e[6]!==c?(f=r.jsx(er,{children:r.jsx(tr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}function ee(s){const e=Y.c(12);let i,a,c,f;e[0]!==s?({className:i,inset:a,variant:f,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=f):(i=e[1],a=e[2],c=e[3],f=e[4]);const h=f===void 0?"default":f;let p;e[5]!==i?(p=ie("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 v;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==h?(v=r.jsx(nr,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=h,e[11]=v):v=e[11],v}function Ke(s){const e=Y.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=ie("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==a||e[6]!==c?(f=r.jsx(rr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}const sr="#d9a441";function lr(s){const e=Y.c(45),{node:i,depth:a,isExpanded:c,isSelected:f,isLoading:h,fileVisual:p,onOpen:v,onSelect:y,onNewFile:d,onNewFolder:x,onCopyPath:C,onCopyRelativePath:D,onRename:k,onDelete:g}=s,b=h===void 0?!1:h,U=i.kind==="directory",{Icon:T,color:O}=p,j=f&&"bg-accent";let w;e[0]!==j?(w=ie("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",j),e[0]=j,e[1]=w):w=e[1];const A=`${a*14+8}px`;let L;e[2]!==A?(L={paddingLeft:A},e[2]=A,e[3]=L):L=e[3];let G;e[4]!==v||e[5]!==y?(G=()=>{y(),v()},e[4]=v,e[5]=y,e[6]=G):G=e[6];let $;e[7]!==T||e[8]!==O||e[9]!==U||e[10]!==c||e[11]!==b?($=U?r.jsxs(r.Fragment,{children:[b?r.jsx(oe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(mn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(pn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(xn,{size:16,className:"shrink-0",style:{color:sr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(T,{size:16,className:"shrink-0",style:{color:O}})]}),e[7]=T,e[8]=O,e[9]=U,e[10]=c,e[11]=b,e[12]=$):$=e[12];let I;e[13]!==i.name?(I=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=I):I=e[14];let R;e[15]!==w||e[16]!==L||e[17]!==G||e[18]!==$||e[19]!==I?(R=r.jsx(ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:w,style:L,onClick:G,children:[$,I]})}),e[15]=w,e[16]=L,e[17]=G,e[18]=$,e[19]=I,e[20]=R):R=e[20];let P;e[21]!==d?(P=r.jsx(ee,{onSelect:d,children:"New File"}),e[21]=d,e[22]=P):P=e[22];let _;e[23]!==x?(_=r.jsx(ee,{onSelect:x,children:"New Folder"}),e[23]=x,e[24]=_):_=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsx(Ke,{}),e[25]=z):z=e[25];let N;e[26]!==C?(N=r.jsx(ee,{onSelect:C,children:"Copy Path"}),e[26]=C,e[27]=N):N=e[27];let K;e[28]!==D?(K=r.jsx(ee,{onSelect:D,children:"Copy Relative Path"}),e[28]=D,e[29]=K):K=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(Ke,{}),e[30]=S):S=e[30];let E;e[31]!==k?(E=r.jsx(ee,{onSelect:k,children:"Rename"}),e[31]=k,e[32]=E):E=e[32];let W;e[33]!==g?(W=r.jsx(ee,{variant:"destructive",onSelect:g,children:"Delete"}),e[33]=g,e[34]=W):W=e[34];let V;e[35]!==P||e[36]!==_||e[37]!==N||e[38]!==K||e[39]!==E||e[40]!==W?(V=r.jsxs(ar,{className:"w-52",children:[P,_,z,N,K,S,E,W]}),e[35]=P,e[36]=_,e[37]=N,e[38]=K,e[39]=E,e[40]=W,e[41]=V):V=e[41];let q;return e[42]!==V||e[43]!==R?(q=r.jsxs(or,{children:[R,V]}),e[42]=V,e[43]=R,e[44]=q):q=e[44],q}Bt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function cr(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function oa({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,f]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:p}=c,[v,y]=u.useState(new Set),[d,x]=u.useState(null),[C,D]=u.useState(null),[k,g]=u.useState([]),[b,U]=u.useState(""),[T,O]=u.useState(!1),[j,w]=u.useState(!1),[,A]=u.useState(new Set),[L,G]=u.useState(new Set),$=u.useRef(0),I=u.useRef(null),R=u.useRef(new Set),P=u.useRef(new Map);function _(t){A(n=>{const o=typeof t=="function"?t(n):t;return R.current=o,o})}const[z,N]=u.useState(new Map),K=u.useRef(null),[S,E]=u.useState(null),{sendMessage:W}=Ht(),{openSidePanel:V}=Xt(),q=Gt(),[F,X]=u.useState(null),[xe,he]=u.useState(null),[ae,se]=u.useState(!1);async function J(t,n){const o=await fetch(cr(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 le(){q.invalidateQueries({queryKey:_e(s,e,i)})}function Ne(t,n){navigator.clipboard.writeText(n).then(()=>Q.success(`${t} copied`),()=>Q.error(`Failed to copy ${t.toLowerCase()}`))}function Ze(t){const n=Nn(t);if(!n)return;const o=`${s}/${e}/${i}`;q.setQueryData(Le.decofile(o),l=>{if(!l)return l;const{[n]:m,...M}=l;return M}),q.invalidateQueries({queryKey:Le.liveMeta(s,e,i)})}function et(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>ue(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)Ze(o)}function tt(t){const n=ue(t);return k.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=z.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Se(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),N(n=>{const o=new Map;for(const[l,m]of n){const M=t(l);M&&o.set(M,m)}return o}),D(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 nt(t){const n=ue(t);D(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Se(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function rt(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);await J("write",{path:H(n),content:""}),await te(),await le(),X(null),ge(n)}async function ot(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);const o=H(n);await J("mkdir",{path:o}),f(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await te(),await le(),X(null),y(l=>{const m=new Set(l);for(const M of ve(n))m.add(M);return m.add(n),m}),D({name:t,path:n,kind:"directory",children:[]})}async function it(t){if(!F)return;const n=F.node.path,o=we(n),l=fe(o,t);if(l===n){X(null);return}if(be(l,h,p))throw new Error(`"${t}" already exists`);await J("rename",{from:H(n),to:H(l)}),Se(m=>m===n?l:m.startsWith(`${n}/`)?fe(l,m.slice(n.length+1)):m),await te(),await le(),X(null)}async function at(t){se(!0);try{await J("unlink",{path:H(t.path),recursive:t.kind==="directory"}),et(t),nt(t.path),await te(),await le(),he(null),Q.success(`Deleted "${t.name}"`)}catch(n){Q.error(n instanceof Error?n.message:"Delete failed")}finally{se(!1)}}async function st(t){const n=jn(t);if(n){Q.error(n);return}se(!0);try{F?.mode==="new-file"?(await rt(t),Q.success(`Created "${t}"`)):F?.mode==="new-folder"?(await ot(t),Q.success(`Created folder "${t}"`)):F?.mode==="rename"&&(await it(t),Q.success(`Renamed to "${t}"`))}catch(o){Q.error(o instanceof Error?o.message:"Operation failed")}finally{se(!1)}}const Me=u.useRef(!1);Me.current||(Me.current=!0,I.current=te());const[lt,ct]=u.useState(null);if(a&&a!==lt){ct(a);const t=a;queueMicrotask(()=>{hn(t)&&ge(t).catch(n=>{Q.error(n instanceof Error?n.message:"Failed to open file")})})}async function De(t){const n=await J("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Re(t,n,o){if(o!==$.current)return!1;let l=!1;return f(m=>{const M=n?Sn(m.files,m.directories,t,m.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!M.truncated,{files:M.files,directories:M.directories,truncated:l}}),l&&Q.warning("File list truncated — some files may be hidden"),l}async function dt(t){const n=P.current.get(t);if(n)return n;const o=$.current,l=(async()=>{const m=await De({pattern:"**/*",path:H(t),limit:Ge}),M=Re(m,!0,o);return!M&&o===$.current&&_(ne=>{const ce=new Set(ne);return ce.add(t),ce}),M})();P.current.set(t,l);try{return await l}finally{P.current.delete(t)}}async function Pe(t){if(!Ce(t,R.current))return!1;G(n=>new Set(n).add(t));try{return await dt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function ut(t){const n=new Set(R.current);for(const o of ve(t)){if(!Ce(o,n))continue;if(await Pe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function te(){const t=++$.current;P.current.clear(),O(!0),_(new Set),y(new Set),G(new Set);try{const n=await De({pattern:"**/*",limit:Ge,maxDepth:gn});Re(n,!1,t),w(!0)}catch{j&&Q.error("Failed to refresh file tree")}finally{O(!1)}}async function Ee(t){if(!z.get(t)?.loaded){N(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await J("read",{path:H(t),full:!0}),l=bn(o.content??"");N(m=>{const M=new Map(m);return M.set(t,{savedContent:l,editorValue:l,loaded:!0}),M})}catch{}}}async function ft(t,n){try{await J("write",{path:H(t),content:n}),de("file saved via sandbox /write",{path:t}),q.invalidateQueries({queryKey:_e(s,e,i)});try{const o=await Yt(s,e,i);de("git status after save",o)}catch(o){de("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}N(o=>{const l=new Map(o),m=l.get(t);return m&&l.set(t,{...m,savedContent:n}),l})}catch(o){de("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function mt(t){x(t),D({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),E(null),k.includes(t)||g(n=>[...n,t]),Ee(t)}function pt(t){g(n=>{const o=n.filter(l=>l!==t);return d===t&&x(o[o.length-1]??null),o}),N(n=>{const o=new Map(n);return o.delete(t),o})}function ke(t){y(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function xt(t){if(Ce(t,R.current))try{if(await Pe(t))return}catch(n){Q.error(n instanceof Error?n.message:"Failed to load folder");return}ke(t)}async function ht(t,n){if(n){ke(t);return}await xt(t)}async function ge(t){await I.current,await ut(t);const n=ve(t);y(o=>{const l=new Set(o);for(const m of n)l.add(m);return l}),mt(t)}function gt(){return C?.kind==="directory"?C.path:C?.kind==="file"?we(C.path):d?we(d):"/"}function Te(t){const n=gt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const vt=vn(h,p),Oe=yn(vt,v),Ae=b?Oe.filter(t=>t.node.name.toLowerCase().includes(b.toLowerCase())):Oe,Z=d?z.get(d):null,yt=Z?.loaded&&Z.editorValue!==Z.savedContent,Ct=xe?tt(xe.path):[],wt=(t,n)=>{K.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ft(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const m=l.getValueInRange(o);E({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:m})})};function bt(t){if(!S)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${S.filePath}\``,`**Lines:** ${S.lineStart}–${S.lineEnd}`];if(S.selectedCode){const o=ye(S.filePath),l=S.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),V("chat"),W({parts:[{type:"text",text:n.join(`
|
|
2
2
|
`)}]}),E(null)}return T&&!j?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{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(Vt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:b,onChange:t=>U(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(Fe,{children:[r.jsx($e,{asChild:!0,children:r.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Te("new-file"),children:r.jsx(Ut,{size:14})})}),r.jsx(Ie,{side:"bottom",children:"New file"})]}),r.jsxs(Fe,{children:[r.jsx($e,{asChild:!0,children:r.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Te("new-folder"),children:r.jsx(Wt,{size:14})})}),r.jsx(Ie,{side:"bottom",children:"New folder"})]})]}),r.jsx(qt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ae.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",m=v.has(n.path),M=C?.path===n.path,ne=Cn(n.path,n.kind),ce=l&&L.has(n.path);return r.jsx(lr,{node:n,depth:o,isExpanded:m,isSelected:M,isLoading:ce,fileVisual:wn(n.name),onSelect:()=>D(n),onOpen:()=>{l?ht(n.path,m):ge(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:ne}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:ne}),onCopyPath:()=>Ne("Path",ue(n.path)),onCopyRelativePath:()=>Ne("Relative path",H(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:ne}),onDelete:()=>he(n)},n.path)}),j&&Ae.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:b?`No files match "${b}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[k.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:k.map(t=>{const n=z.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,m=t.split("/").pop()??t;return r.jsxs("div",{className:ie("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:()=>{x(t),Ee(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:m}),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:M=>{M.stopPropagation(),pt(t)},children:r.jsx(Qt,{size:12})})]},t)})}),S&&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()&&bt(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"&&E(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&&Z?.loaded?r.jsx(Kt,{language:ye(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:d,onChange:t=>{const n=d;n&&N(o=>{const l=new Map(o),m=l.get(n);return m&&l.set(n,{...m,editorValue:t??""}),l})},onMount:wt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{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&&!Z?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{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:[yt?"Modified":"Saved"," ·"," ",ye(d)]})]})]}),r.jsx(Dn,{open:F!==null,mode:F?.mode??"new-file",initialName:F?.mode==="rename"?F.node.name:"",parentLabel:F&&F.mode!=="rename"?F.parentDir==="/"?"/":H(F.parentDir):void 0,isPending:ae,onSubmit:st,onOpenChange:t=>{!t&&!ae&&X(null)}}),r.jsx(Rn,{deleteTarget:xe,deleteDirtyPaths:Ct,fsActionPending:ae,onOpenChange:t=>{!t&&!ae&&he(null)},onConfirm:t=>{at(t)}})]})}export{oa as FileExplorer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bx as zl,j as q,aM as lt,bP as zn,r as Ve,F as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-
|
|
1
|
+
import{bx as zl,j as q,aM as lt,bP as zn,r as Ve,F as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-D4utvNsR.js";import{i as zb}from"./Check-CQ8-e3GA.js";import{a as jb}from"./Copy01-DSoPlmWJ.js";import{e as S0,g as y0,f as A0,a as _0}from"./dialog-HBBCSa8Y.js";import{n as I0}from"./Globe01-yzHFTNA0.js";import{k as k0,n as R0}from"./ZoomOut-C6ASppVU.js";import{u as N0}from"./use-mobile-sXXxxOPa.js";import{h as C0}from"./tab-id-BijBBRwE.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-D4utvNsR.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{dE as C,c as d,j as c,ah as j,r as f,l as p,bd as b,dF as h,dG as v}from"./index-
|
|
1
|
+
import{dE as C,c as d,j as c,ah as j,r as f,l as p,bd as b,dF as h,dG as v}from"./index-D4utvNsR.js";import{L as N}from"./label-DsHShlh_.js";const D=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}=h();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=v(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,D as a,w as b,L as c,P as d,y as e,R as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as K,C as V,n as M,M as Q,J as Z,d as U,p as F,t as w,K as L,j as n,ah as $,H,I as T,c as D,r as B,B as Y,D as q,s as J}from"./index-DGQdC8j6.js";import{P as k}from"./index-qg-bT8JA.js";import{u as W}from"./use-org-auth-client-dM7W8lCQ.js";import{u as X}from"./use-debounced-autosave-DQFgMtID.js";import{A as ee}from"./avatar-BumqAYVV.js";import{I as G}from"./input-DwWe5Hqk.js";import{S as P,a as I,b as _,c as te}from"./settings-section-CvpT3RW4.js";import{D as ne}from"./domain-settings-DnawB_fV.js";import{S as ae}from"./switch-DW7tjnTv.js";import{c as se,f as oe}from"./use-organization-settings-Dfv3IVMe.js";import{u as ie}from"./studio-tools-DII0jqi8.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-CWlVUd73.js";import{R as pe}from"./require-capability--U_vi60H.js";import"./sidebar-C_llE2r0.js";import"./LayoutLeft-DPtsS7J4.js";import"./use-mobile-DVuyUrh-.js";import"./X-Bs0u_0yh.js";import"./tooltip-CO1zVhUs.js";import"./User01-joygJQdk.js";import"./card-whir3-TU.js";import"./ArrowUpRight-3xkp-kWm.js";import"./badge-DuwyDvgL.js";import"./select-vVirKMnE.js";import"./Check-Oxo5mPeL.js";import"./ChevronDown-DCZlSvzQ.js";import"./ChevronUp-BXrO8J56.js";import"./constants-D_FQAPnt.js";import"./use-capability-CEIYeJxR.js";import"./access-gate-B4pZWmwl.js";import"./capability-load-error-CVQ-0IvS.js";const he=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function xe(e){return typeof e=="string"&&he.has(e.trim().toLowerCase())}const je=H({name:T().min(1,"Name is required").max(255,"Name is too long"),slug:T().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!xe(e),"This organization URL is reserved by Studio"),logo:T().optional()});function be(e){const t=D.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=ye,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 a=m;let o;t[3]!==l||t[4]!==a?(o=n.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[3]=l,t[4]=a,t[5]=o):o=t[5];const i=f||void 0,x=s??"?";let p;t[6]!==i||t[7]!==x?(p=n.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=n.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 ye(){return w.error("Failed to read image")}function ve(){const e=K(),{org:t}=V(),f=W(),d=M(),s=Q({resolver:Z(je),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),l=U({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.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:(a,o)=>{F("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"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{F("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:u,flush:c}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).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 n.jsx(P,{children:n.jsxs(I,{children:[n.jsx(_,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(be,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),c()},name:s.watch("name")})}),n.jsx(_,{title:"Name",action:n.jsx($,{control:s.control,name:"name",render:({field:a})=>n.jsx(G,{id:"org-name",...a,onChange:o=>{a.onChange(o),u()},onBlur:()=>{a.onBlur(),c()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(_,{title:"URL",action:n.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&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),n.jsx($,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.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:()=>{a.onBlur(),c()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Se(){const e=D.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=n.jsx(P,{title:"Task board",description:"A board for tracking org tasks by status, priority, and assignee.",children:n.jsx(I,{children:n.jsx(_,{title:"Enable task board",description:"Adds a Board entry to the sidebar for this organization.",action:n.jsx(ae,{checked:t,disabled:d,onCheckedChange:s})})})}),e[2]=t,e[3]=d,e[4]=s,e[5]=l):l=e[5],l}function ze(){const e=D.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=()=>{F("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:Ce},e[6]=c,e[7]=r,e[8]=m):m=e[8];const a=U(m);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>d(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(P,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(I,{className:"border-destructive/40",children:n.jsx(_,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.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=n.jsx(re,{children:"Delete Organization?"}),e[13]=p):p=e[13];let h;e[14]!==t.name?(h=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.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=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.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=n.jsx(G,{value:s,onChange:b,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=g):g=e[21];let y;e[22]!==g||e[23]!==h||e[24]!==j?(y=n.jsxs(le,{children:[p,n.jsx(ce,{asChild:!0,children:n.jsxs("div",{children:[h,j,g]})})]}),e[22]=g,e[23]=h,e[24]=j,e[25]=y):y=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(de,{children:"Cancel"}),e[26]=O):O=e[26];let v;e[27]!==a?(v=()=>a.mutate(),e[27]=a,e[28]=v):v=e[28];const E=s!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==v||e[30]!==E||e[31]!==R?(S=n.jsxs(ue,{children:[O,n.jsx(me,{onClick:v,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=v,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ge,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==f||e[37]!==z?(C=n.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=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=A):A=e[41],A}function Ce(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function we(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(k,{children:n.jsx(k.Content,{children:n.jsx(k.Body,{children:n.jsxs(te,{children:[n.jsx(k.Title,{children:"Organization"}),n.jsx(ve,{}),n.jsx(ne,{}),n.jsx(Se,{}),n.jsx(ze,{})]})})})}),e[0]=t):t=e[0],t}function nt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(pe,{capability:"org:manage",area:"general settings",children:n.jsx(we,{})}),e[0]=t):t=e[0],t}export{nt as default};
|
|
1
|
+
import{b as K,C as V,n as M,M as Q,J as Z,d as U,p as F,t as w,K as L,j as n,ah as $,H,I as T,c as D,r as B,B as Y,D as q,s as J}from"./index-D4utvNsR.js";import{P as k}from"./index-Djd1r33z.js";import{u as W}from"./use-org-auth-client-Dc6RqagL.js";import{u as X}from"./use-debounced-autosave-Cc5UHtj5.js";import{A as ee}from"./avatar-BidIHGtX.js";import{I as G}from"./input-Ddc8GyCU.js";import{S as P,a as I,b as _,c as te}from"./settings-section-DDOPDuOE.js";import{D as ne}from"./domain-settings-Zb4Opd1X.js";import{S as ae}from"./switch-CjEjtKhZ.js";import{c as se,f as oe}from"./use-organization-settings-CApfiGSv.js";import{u as ie}from"./studio-tools-BWndc-fQ.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-DS5vnPXz.js";import{R as pe}from"./require-capability-C33DXbmM.js";import"./sidebar-SFF8zaaZ.js";import"./LayoutLeft-DqR7Gk_I.js";import"./use-mobile-sXXxxOPa.js";import"./X-D37ABNsH.js";import"./tooltip-C9-Aq0A0.js";import"./User01-BuskJcXh.js";import"./card-4UY0XyGm.js";import"./ArrowUpRight-BLwgj-5u.js";import"./badge-CZ22AXi2.js";import"./select-Cgj3tK9y.js";import"./Check-CQ8-e3GA.js";import"./ChevronDown-DFRYq9AW.js";import"./ChevronUp-Bk9mNl9n.js";import"./constants-D_FQAPnt.js";import"./use-capability-Bh-cXZQP.js";import"./access-gate-DttmKZh0.js";import"./capability-load-error-CHJpJoE8.js";const he=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function xe(e){return typeof e=="string"&&he.has(e.trim().toLowerCase())}const je=H({name:T().min(1,"Name is required").max(255,"Name is too long"),slug:T().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!xe(e),"This organization URL is reserved by Studio"),logo:T().optional()});function be(e){const t=D.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=ye,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 a=m;let o;t[3]!==l||t[4]!==a?(o=n.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[3]=l,t[4]=a,t[5]=o):o=t[5];const i=f||void 0,x=s??"?";let p;t[6]!==i||t[7]!==x?(p=n.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=n.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 ye(){return w.error("Failed to read image")}function ve(){const e=K(),{org:t}=V(),f=W(),d=M(),s=Q({resolver:Z(je),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),l=U({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.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:(a,o)=>{F("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"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{F("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:u,flush:c}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).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 n.jsx(P,{children:n.jsxs(I,{children:[n.jsx(_,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(be,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),c()},name:s.watch("name")})}),n.jsx(_,{title:"Name",action:n.jsx($,{control:s.control,name:"name",render:({field:a})=>n.jsx(G,{id:"org-name",...a,onChange:o=>{a.onChange(o),u()},onBlur:()=>{a.onBlur(),c()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(_,{title:"URL",action:n.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&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),n.jsx($,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.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:()=>{a.onBlur(),c()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Se(){const e=D.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=n.jsx(P,{title:"Task board",description:"A board for tracking org tasks by status, priority, and assignee.",children:n.jsx(I,{children:n.jsx(_,{title:"Enable task board",description:"Adds a Board entry to the sidebar for this organization.",action:n.jsx(ae,{checked:t,disabled:d,onCheckedChange:s})})})}),e[2]=t,e[3]=d,e[4]=s,e[5]=l):l=e[5],l}function ze(){const e=D.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=()=>{F("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:Ce},e[6]=c,e[7]=r,e[8]=m):m=e[8];const a=U(m);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>d(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(P,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(I,{className:"border-destructive/40",children:n.jsx(_,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.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=n.jsx(re,{children:"Delete Organization?"}),e[13]=p):p=e[13];let h;e[14]!==t.name?(h=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.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=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.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=n.jsx(G,{value:s,onChange:b,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=g):g=e[21];let y;e[22]!==g||e[23]!==h||e[24]!==j?(y=n.jsxs(le,{children:[p,n.jsx(ce,{asChild:!0,children:n.jsxs("div",{children:[h,j,g]})})]}),e[22]=g,e[23]=h,e[24]=j,e[25]=y):y=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(de,{children:"Cancel"}),e[26]=O):O=e[26];let v;e[27]!==a?(v=()=>a.mutate(),e[27]=a,e[28]=v):v=e[28];const E=s!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==v||e[30]!==E||e[31]!==R?(S=n.jsxs(ue,{children:[O,n.jsx(me,{onClick:v,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=v,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ge,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==f||e[37]!==z?(C=n.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=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=A):A=e[41],A}function Ce(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function we(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(k,{children:n.jsx(k.Content,{children:n.jsx(k.Body,{children:n.jsxs(te,{children:[n.jsx(k.Title,{children:"Organization"}),n.jsx(ve,{}),n.jsx(ne,{}),n.jsx(Se,{}),n.jsx(ze,{})]})})})}),e[0]=t):t=e[0],t}function nt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(pe,{capability:"org:manage",area:"general settings",children:n.jsx(we,{})}),e[0]=t):t=e[0],t}export{nt as default};
|
package/dist/client/assets/{github-repo-picker-D93GRlsF.js → github-repo-picker-BLeREnmC.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,j as t,C as F,a as Y,n as M,r as T,ac as H,i as z,d as B,t as U,dH as W,K as R,m as X,B as Z,l as D,v as ee,w as te}from"./index-DGQdC8j6.js";import{D as ne,a as se,d as oe,e as ie}from"./dialog-hBUfi5DB.js";import{C as le}from"./collection-search-26JlKJRJ.js";import{u as re}from"./use-debounced-value-CMoeorqx.js";import{b as Q,u as ae}from"./use-connection-DM8eKjeN.js";import{u as L}from"./use-mcp-client-Csg0Ohl1.js";import{W as ce,S as V}from"./constants-D_FQAPnt.js";import{a as K}from"./authenticate-and-persist-oauth-BcKcvBur.js";import{b as J}from"./Settings02-CJygIZBg.js";import{I as ue}from"./agent-icon-Xdz_mRuJ.js";import{u as de}from"./use-mcp-tools-DF4E3rLo.js";import{e as me}from"./extract-connection-data-BFgBaCrk.js";import{c as fe}from"./use-navigate-to-agent-BL2c2hni.js";import{g as xe,p as q,f as ge}from"./provision-repo-scoped-github-connection-CB4ICKHq.js";function G(y){const e=A.c(4),{size:n,className:i}=y;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=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]=h):h=e[0];let r;return e[1]!==i||e[2]!==n?(r=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:i,children:h}),e[1]=i,e[2]=n,e[3]=r):r=e[3],r}function he(y,e){const n=A.c(12),{org:i}=F();let h;n[0]!==i.id?(h=ce.REGISTRY(i.id),n[0]=i.id,n[1]=h):h=n[1];const r=h;let o;n[2]!==i.id||n[3]!==i.slug||n[4]!==r?(o={connectionId:r,orgId:i.id,orgSlug:i.slug},n[2]=i.id,n[3]=i.slug,n[4]=r,n[5]=o):o=n[5];const p=L(o);let c;n[6]!==y?(c={name:y},n[6]=y,n[7]=c):c=n[7];const b=e?.enabled??!0;let C;return n[8]!==p||n[9]!==c||n[10]!==b?(C={client:p,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:c,enabled:b,staleTime:3e5,select:pe},n[8]=p,n[9]=c,n[10]=b,n[11]=C):C=n[11],de(C)}function pe(y){return y.structuredContent?.item??null}const be="deco/mcp-github";function ye(y){const{org:e}=F(),{data:n}=Y.useSession(),i=Q(),h=M(),[r,o]=T.useState("idle"),[p,c]=T.useState(null),[b,C]=T.useState(null),{data:j,isLoading:u}=he(be,{enabled:y.enabled}),l=T.useRef(!1);y.enabled&&j&&!u&&!l.current&&n?.user?.id&&r==="idle"&&(l.current=!0,d());async function d(){if(!(!j||!n?.user?.id||!e))try{o("installing"),c(null);const a=me(j,e.id,n.user.id,{remoteIndex:0});if(!a.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:N}=await i.create.mutateAsync(a);o("authenticating");const x=await K({connectionId:N,orgId:e.id,orgSlug:e.slug,persistFallback:s=>i.update.mutateAsync({id:N,data:{connection_token:s}}).then(()=>{})});if(x.ran&&!x.ok){try{await i.delete.mutateAsync(N)}catch{}throw new Error(x.error&&x.error!=="no token received"?x.error:"No token received from GitHub")}H(h,e.id),C(a),o("ready")}catch(a){c(a instanceof Error?a.message:String(a)),o("error")}}function m(){o("idle"),c(null),C(null),l.current=!1}return y.enabled&&u&&r==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:r,error:p,connection:b,retry:m}}function De(y){const e=A.c(22),{open:n,onOpenChange:i,title:h,onImportComplete:r,mode:o}=y,p=o===void 0?"agent":o,c=h??(p==="connection"?"Add repo":"Import from GitHub"),[b,C]=T.useState(null);let j;e[0]!==c?(j=t.jsx(ne,{className:"sr-only",children:t.jsx(se,{children:c})}),e[0]=c,e[1]=j):j=e[1];let u;e[2]!==c||e[3]!==b?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:b?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(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(J,{size:16})}),t.jsx("img",{src:b.avatarUrl,alt:b.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:b.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(G,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:c})]})}),e[2]=c,e[3]=b,e[4]=u):u=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=l):l=e[5];let d;e[6]!==i?(d=()=>i(!1),e[6]=i,e[7]=d):d=e[7];let m;e[8]!==p||e[9]!==r||e[10]!==n||e[11]!==b||e[12]!==d?(m=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:l,children:t.jsx(je,{open:n,onComplete:d,selectedInstallation:b,onSelectInstallation:C,onImportComplete:r,mode:p})})}),e[8]=p,e[9]=r,e[10]=n,e[11]=b,e[12]=d,e[13]=m):m=e[13];let a;e[14]!==j||e[15]!==u||e[16]!==m?(a=t.jsxs(oe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,m]}),e[14]=j,e[15]=u,e[16]=m,e[17]=a):a=e[17];let f;return e[18]!==i||e[19]!==n||e[20]!==a?(f=t.jsx(ie,{open:n,onOpenChange:i,children:a}),e[18]=i,e[19]=n,e[20]=a,e[21]=f):f=e[21],f}function je({open:y,onComplete:e,selectedInstallation:n,onSelectInstallation:i,onImportComplete:h,mode:r="agent"}){const{org:o}=F(),p=M(),c=fe(),[b,C]=T.useState(null),j=ae({slug:"mcp-github"}),u=xe(j),l=ye({enabled:y&&u.length===0}),d=u.length===1?u[0]??null:b,m=L({connectionId:d?.id??"",orgId:o.id,orgSlug:o.slug}),a=L({connectionId:V,orgId:o.id,orgSlug:o.slug}),f=async(s,v)=>{try{const _=await m.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:v}});if(_.isError)return null;const I=_.content?.find(g=>g.type==="resource")?.resource?.text;if(!I)return null;try{const g=JSON.parse(I);return typeof g=="string"?g:JSON.stringify(g)}catch{return I}}catch{return null}},N=(s,v)=>{Promise.all([f(v,"AGENTS.md"),f(v,"CLAUDE.md")]).then(async([S,_])=>{const w=S??_??null;w&&(await a.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:w}}}}),H(p,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},x=B({mutationFn:async s=>{if(!d||!n)throw new Error("No GitHub connection or installation");const v=n.installationId;if(r==="connection"){const{childConnectionId:w}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:I=>m.callTool(I),selfCallTool:I=>a.callTool(I),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:w,item:null}}const{childConnectionId:S}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:w=>m.callTool(w),selfCallTool:w=>a.callTool(w)});let _=null;try{const w=await a.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:v,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),I=w.structuredContent??w,g=I.item?.id;if(!I.item||!g)throw new Error("Failed to create the imported agent");return _=g,{virtualMcpId:g,repo:s,connectionId:S,item:I.item}}catch(w){throw _&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:_}}).catch(()=>{}),await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),w}},onSuccess:({virtualMcpId:s,repo:v,connectionId:S,item:_})=>{if(r==="connection"||!s||!_){H(p,o.id),W(p,o.id),U.success(`Added ${v.name}`),e();return}if(p.setQueryData(R.collectionItem(a,o.id,"","VIRTUAL_MCP",s),{item:_}),H(p,o.id),N(s,v),h){h({virtualMcpId:s,repo:v,connectionId:S});return}U.success(`Imported ${v.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(s)},onError:s=>{U.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return l.status==="installing"||l.status==="authenticating"?t.jsx($,{status:l.status,error:null,retry:l.retry}):l.status==="error"?t.jsx($,{status:"error",error:l.error,retry:l.retry}):u.length===0&&l.status==="idle"?t.jsx($,{status:"installing",error:null,retry:l.retry}):u.length>1&&!d?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:()=>C(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(G,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):d?n?t.jsx(we,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>x.mutate(s),isSaving:x.isPending}):t.jsx(Ne,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,onSelect:i,showBackButton:u.length>1,onBack:()=>C(null)}):null}function Ne(y){const e=A.c(47),{connectionId:n,orgId:i,orgSlug:h,onSelect:r,showBackButton:o,onBack:p}=y;let c;e[0]!==i||e[1]!==h?(c={connectionId:V,orgId:i,orgSlug:h},e[0]=i,e[1]=h,e[2]=c):c=e[2];const b=L(c),C=M(),j=Q();let u;e[3]!==n||e[4]!==i?(u=R.githubUserOrgs(i,n),e[3]=n,e[4]=i,e[5]=u):u=e[5];let l;e[6]!==n||e[7]!==b?(l=()=>ge(g=>b.callTool(g),n),e[6]=n,e[7]=b,e[8]=l):l=e[8];let d;e[9]!==u||e[10]!==l?(d={queryKey:u,queryFn:l},e[9]=u,e[10]=l,e[11]=d):d=e[11];const m=X(d);let a;e[12]!==j||e[13]!==n||e[14]!==m||e[15]!==i||e[16]!==h||e[17]!==C?(a={mutationFn:async()=>{const g=await K({connectionId:n,orgId:i,orgSlug:h,persistFallback:E=>j.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ce)});if(g.ran&&!g.ok)throw new Error(g.error??"no token received");const k=new URL(`/api/${h}/mcp/${n}`,window.location.origin);await C.invalidateQueries({queryKey:R.isMCPAuthenticated(k.href,null)}),await C.invalidateQueries({queryKey:R.mcpClientPrefix()}),await m.refetch()},onError:ve},e[12]=j,e[13]=n,e[14]=m,e[15]=i,e[16]=h,e[17]=C,e[18]=a):a=e[18];const f=B(a);if(m.isLoading){let g;return e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=g):g=e[19],g}if(m.isError){let g,k;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),k=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]=g,e[21]=k):(g=e[20],k=e[21]);let E;e[22]!==f?(E=()=>f.mutate(),e[22]=f,e[23]=E):E=e[23];let P;e[24]!==f.isPending?(P=f.isPending?t.jsx(z,{size:14,className:"animate-spin"}):t.jsx(G,{className:"size-3.5"}),e[24]=f.isPending,e[25]=P):P=e[25];let O;return e[26]!==f.isPending||e[27]!==E||e[28]!==P?(O=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[g,k,t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:E,disabled:f.isPending,children:[P,"Reconnect GitHub"]})]}),e[26]=f.isPending,e[27]=E,e[28]=P,e[29]=O):O=e[29],O}const N=m.data;if(!N)return null;let x;e[30]!==p||e[31]!==o?(x=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:p,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(J,{size:12}),"Change connection"]})}),e[30]=p,e[31]=o,e[32]=x):x=e[32];let s;if(e[33]!==N.installations||e[34]!==r){let g;e[36]!==r?(g=k=>t.jsxs("button",{type:"button",onClick:()=>r(k),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:k.avatarUrl,alt:k.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:k.login}),k.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 →"})]},k.installationId),e[36]=r,e[37]=g):g=e[37],s=N.installations.map(g),e[33]=N.installations,e[34]=r,e[35]=s}else s=e[35];let v;e[38]!==s?(v=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=v):v=e[39];const S=N.appSlug?`https://github.com/apps/${N.appSlug}/installations/new`:"https://github.com/settings/installations";let _;e[40]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=_):_=e[40];let w;e[41]!==S?(w=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?"," ",_]})}),e[41]=S,e[42]=w):w=e[42];let I;return e[43]!==w||e[44]!==x||e[45]!==v?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,v,w]}),e[43]=w,e[44]=x,e[45]=v,e[46]=I):I=e[46],I}function ve(y){U.error("Failed to reconnect GitHub: "+(y instanceof Error?y.message:"Unknown error"))}function Ce(){}function we(y){const e=A.c(20),{connectionId:n,orgId:i,orgSlug:h,installation:r,onSelectRepo:o,isSaving:p}=y,[c,b]=T.useState(""),C=re(c,300),j=T.useDeferredValue(C),u=c!==j;let l;e[0]!==u||e[1]!==c?(l=t.jsx(le,{placeholder:"Search repositories...",value:c,onChange:b,isSearching:u}),e[0]=u,e[1]=c,e[2]=l):l=e[2];const d=u?"opacity-40":"opacity-100";let m;e[3]!==d?(m=D("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",d),e[3]=d,e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=a):a=e[5];let f;e[6]!==n||e[7]!==j||e[8]!==r||e[9]!==p||e[10]!==o||e[11]!==i||e[12]!==h?(f=t.jsx(T.Suspense,{fallback:a,children:t.jsx(Se,{connectionId:n,orgId:i,orgSlug:h,installation:r,query:j,onSelectRepo:o,isSaving:p})}),e[6]=n,e[7]=j,e[8]=r,e[9]=p,e[10]=o,e[11]=i,e[12]=h,e[13]=f):f=e[13];let N;e[14]!==m||e[15]!==f?(N=t.jsx("div",{className:m,children:f}),e[14]=m,e[15]=f,e[16]=N):N=e[16];let x;return e[17]!==l||e[18]!==N?(x=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l,N]}),e[17]=l,e[18]=N,e[19]=x):x=e[19],x}function Se(y){const e=A.c(29),{connectionId:n,orgId:i,orgSlug:h,installation:r,query:o,onSelectRepo:p,isSaving:c}=y;let b;e[0]!==n||e[1]!==i||e[2]!==h?(b={connectionId:n,orgId:i,orgSlug:h},e[0]=n,e[1]=i,e[2]=h,e[3]=b):b=e[3];const C=L(b),j=r.type==="User"?"user":"org",u=o?`${j}:${r.login} ${o} in:name`:`${j}:${r.login}`;let l;e[4]!==n||e[5]!==r.login||e[6]!==i||e[7]!==o?(l=R.githubOrgRepos(i,n,r.login,o),e[4]=n,e[5]=r.login,e[6]=i,e[7]=o,e[8]=l):l=e[8];let d;e[9]!==C||e[10]!==u?(d=async x=>{const{signal:s}=x,S=(await C.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(Ie)},e[9]=C,e[10]=u,e[11]=d):d=e[11];let m;e[12]!==l||e[13]!==d?(m={queryKey:l,queryFn:d},e[12]=l,e[13]=d,e[14]=m):m=e[14];const{data:a}=ee(m);if(a.length===0){let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=x):x=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 v;return e[18]!==s?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[x,s]}),e[18]=s,e[19]=v):v=e[19],v}let f;if(e[20]!==c||e[21]!==p||e[22]!==a){let x;e[24]!==c||e[25]!==p?(x=s=>t.jsxs("button",{type:"button",onClick:()=>p(s),disabled:c,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(G,{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(te,{size:10}):t.jsx(ue,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=c,e[25]=p,e[26]=x):x=e[26],f=a.map(x),e[20]=c,e[21]=p,e[22]=a,e[23]=f}else f=e[23];let N;return e[27]!==f?(N=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:f}),e[27]=f,e[28]=N):N=e[28],N}function Ie(y){return{name:y.name,fullName:y.full_name,owner:y.full_name.split("/")[0]??"",url:y.html_url,private:y.private,description:y.description,updatedAt:y.updated_at}}function $(y){const e=A.c(33),{status:n,error:i,retry:h}=y;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(G,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=_):_=e[1];const w=i??"Something went wrong while connecting to GitHub.";let I;e[2]!==w?(I=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[_,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:w})]}),e[2]=w,e[3]=I):I=e[3];let g;e[4]!==h?(g=t.jsx("button",{type:"button",onClick:h,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]=h,e[5]=g):g=e[5];let k;return e[6]!==I||e[7]!==g?(k=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,I,g]}),e[6]=I,e[7]=g,e[8]=k):k=e[8],k}const r=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(G,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=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(z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=p):p=e[10];const c=r?"Authenticating with GitHub":"Setting up GitHub";let b;e[11]!==c?(b=t.jsx("p",{className:"text-sm font-medium",children:c}),e[11]=c,e[12]=b):b=e[12];const C=r?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==C?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=j):j=e[14];let u;e[15]!==b||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[b,j]}),e[15]=b,e[16]=j,e[17]=u):u=e[17];const l=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let d;e[18]!==l?(d=D("size-1.5 rounded-full",l),e[18]=l,e[19]=d):d=e[19];let m;e[20]!==d?(m=t.jsx("span",{className:d}),e[20]=d,e[21]=m):m=e[21];const a=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let f;e[22]!==a?(f=D("size-1.5 rounded-full",a),e[22]=a,e[23]=f):f=e[23];let N;e[24]!==f?(N=t.jsx("span",{className:f}),e[24]=f,e[25]=N):N=e[25];let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=x):x=e[26];let s;e[27]!==m||e[28]!==N?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[m,N,x]}),e[27]=m,e[28]=N,e[29]=s):s=e[29];let v;return e[30]!==s||e[31]!==u?(v=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,u,s]}),e[30]=s,e[31]=u,e[32]=v):v=e[32],v}export{De as G,G as a,ye as b,he as u};
|
|
1
|
+
import{c as A,j as t,C as F,a as Y,n as M,r as T,ac as H,i as z,d as B,t as U,dH as W,K as R,m as X,B as Z,l as D,v as ee,w as te}from"./index-D4utvNsR.js";import{D as ne,a as se,d as oe,e as ie}from"./dialog-HBBCSa8Y.js";import{C as le}from"./collection-search-BNlVJQJ6.js";import{u as re}from"./use-debounced-value-LEPVWu3-.js";import{b as Q,u as ae}from"./use-connection-CMZ9jqla.js";import{u as L}from"./use-mcp-client-Dxv8FjGO.js";import{W as ce,S as V}from"./constants-D_FQAPnt.js";import{a as K}from"./authenticate-and-persist-oauth-CMhoqQaF.js";import{b as J}from"./Settings02-FiuW9M68.js";import{I as ue}from"./agent-icon-BXJxtnIS.js";import{u as de}from"./use-mcp-tools-DXkXFAag.js";import{e as me}from"./extract-connection-data-D7fs47LL.js";import{c as fe}from"./use-navigate-to-agent-CNjqf1SD.js";import{g as xe,p as q,f as ge}from"./provision-repo-scoped-github-connection-CB4ICKHq.js";function G(y){const e=A.c(4),{size:n,className:i}=y;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=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]=h):h=e[0];let r;return e[1]!==i||e[2]!==n?(r=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:i,children:h}),e[1]=i,e[2]=n,e[3]=r):r=e[3],r}function he(y,e){const n=A.c(12),{org:i}=F();let h;n[0]!==i.id?(h=ce.REGISTRY(i.id),n[0]=i.id,n[1]=h):h=n[1];const r=h;let o;n[2]!==i.id||n[3]!==i.slug||n[4]!==r?(o={connectionId:r,orgId:i.id,orgSlug:i.slug},n[2]=i.id,n[3]=i.slug,n[4]=r,n[5]=o):o=n[5];const p=L(o);let c;n[6]!==y?(c={name:y},n[6]=y,n[7]=c):c=n[7];const b=e?.enabled??!0;let C;return n[8]!==p||n[9]!==c||n[10]!==b?(C={client:p,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:c,enabled:b,staleTime:3e5,select:pe},n[8]=p,n[9]=c,n[10]=b,n[11]=C):C=n[11],de(C)}function pe(y){return y.structuredContent?.item??null}const be="deco/mcp-github";function ye(y){const{org:e}=F(),{data:n}=Y.useSession(),i=Q(),h=M(),[r,o]=T.useState("idle"),[p,c]=T.useState(null),[b,C]=T.useState(null),{data:j,isLoading:u}=he(be,{enabled:y.enabled}),l=T.useRef(!1);y.enabled&&j&&!u&&!l.current&&n?.user?.id&&r==="idle"&&(l.current=!0,d());async function d(){if(!(!j||!n?.user?.id||!e))try{o("installing"),c(null);const a=me(j,e.id,n.user.id,{remoteIndex:0});if(!a.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:N}=await i.create.mutateAsync(a);o("authenticating");const x=await K({connectionId:N,orgId:e.id,orgSlug:e.slug,persistFallback:s=>i.update.mutateAsync({id:N,data:{connection_token:s}}).then(()=>{})});if(x.ran&&!x.ok){try{await i.delete.mutateAsync(N)}catch{}throw new Error(x.error&&x.error!=="no token received"?x.error:"No token received from GitHub")}H(h,e.id),C(a),o("ready")}catch(a){c(a instanceof Error?a.message:String(a)),o("error")}}function m(){o("idle"),c(null),C(null),l.current=!1}return y.enabled&&u&&r==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:r,error:p,connection:b,retry:m}}function De(y){const e=A.c(22),{open:n,onOpenChange:i,title:h,onImportComplete:r,mode:o}=y,p=o===void 0?"agent":o,c=h??(p==="connection"?"Add repo":"Import from GitHub"),[b,C]=T.useState(null);let j;e[0]!==c?(j=t.jsx(ne,{className:"sr-only",children:t.jsx(se,{children:c})}),e[0]=c,e[1]=j):j=e[1];let u;e[2]!==c||e[3]!==b?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:b?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(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(J,{size:16})}),t.jsx("img",{src:b.avatarUrl,alt:b.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:b.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(G,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:c})]})}),e[2]=c,e[3]=b,e[4]=u):u=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=l):l=e[5];let d;e[6]!==i?(d=()=>i(!1),e[6]=i,e[7]=d):d=e[7];let m;e[8]!==p||e[9]!==r||e[10]!==n||e[11]!==b||e[12]!==d?(m=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:l,children:t.jsx(je,{open:n,onComplete:d,selectedInstallation:b,onSelectInstallation:C,onImportComplete:r,mode:p})})}),e[8]=p,e[9]=r,e[10]=n,e[11]=b,e[12]=d,e[13]=m):m=e[13];let a;e[14]!==j||e[15]!==u||e[16]!==m?(a=t.jsxs(oe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,m]}),e[14]=j,e[15]=u,e[16]=m,e[17]=a):a=e[17];let f;return e[18]!==i||e[19]!==n||e[20]!==a?(f=t.jsx(ie,{open:n,onOpenChange:i,children:a}),e[18]=i,e[19]=n,e[20]=a,e[21]=f):f=e[21],f}function je({open:y,onComplete:e,selectedInstallation:n,onSelectInstallation:i,onImportComplete:h,mode:r="agent"}){const{org:o}=F(),p=M(),c=fe(),[b,C]=T.useState(null),j=ae({slug:"mcp-github"}),u=xe(j),l=ye({enabled:y&&u.length===0}),d=u.length===1?u[0]??null:b,m=L({connectionId:d?.id??"",orgId:o.id,orgSlug:o.slug}),a=L({connectionId:V,orgId:o.id,orgSlug:o.slug}),f=async(s,v)=>{try{const _=await m.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:v}});if(_.isError)return null;const I=_.content?.find(g=>g.type==="resource")?.resource?.text;if(!I)return null;try{const g=JSON.parse(I);return typeof g=="string"?g:JSON.stringify(g)}catch{return I}}catch{return null}},N=(s,v)=>{Promise.all([f(v,"AGENTS.md"),f(v,"CLAUDE.md")]).then(async([S,_])=>{const w=S??_??null;w&&(await a.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:w}}}}),H(p,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},x=B({mutationFn:async s=>{if(!d||!n)throw new Error("No GitHub connection or installation");const v=n.installationId;if(r==="connection"){const{childConnectionId:w}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:I=>m.callTool(I),selfCallTool:I=>a.callTool(I),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:w,item:null}}const{childConnectionId:S}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:w=>m.callTool(w),selfCallTool:w=>a.callTool(w)});let _=null;try{const w=await a.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:v,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),I=w.structuredContent??w,g=I.item?.id;if(!I.item||!g)throw new Error("Failed to create the imported agent");return _=g,{virtualMcpId:g,repo:s,connectionId:S,item:I.item}}catch(w){throw _&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:_}}).catch(()=>{}),await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),w}},onSuccess:({virtualMcpId:s,repo:v,connectionId:S,item:_})=>{if(r==="connection"||!s||!_){H(p,o.id),W(p,o.id),U.success(`Added ${v.name}`),e();return}if(p.setQueryData(R.collectionItem(a,o.id,"","VIRTUAL_MCP",s),{item:_}),H(p,o.id),N(s,v),h){h({virtualMcpId:s,repo:v,connectionId:S});return}U.success(`Imported ${v.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(s)},onError:s=>{U.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return l.status==="installing"||l.status==="authenticating"?t.jsx($,{status:l.status,error:null,retry:l.retry}):l.status==="error"?t.jsx($,{status:"error",error:l.error,retry:l.retry}):u.length===0&&l.status==="idle"?t.jsx($,{status:"installing",error:null,retry:l.retry}):u.length>1&&!d?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:()=>C(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(G,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):d?n?t.jsx(we,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>x.mutate(s),isSaving:x.isPending}):t.jsx(Ne,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,onSelect:i,showBackButton:u.length>1,onBack:()=>C(null)}):null}function Ne(y){const e=A.c(47),{connectionId:n,orgId:i,orgSlug:h,onSelect:r,showBackButton:o,onBack:p}=y;let c;e[0]!==i||e[1]!==h?(c={connectionId:V,orgId:i,orgSlug:h},e[0]=i,e[1]=h,e[2]=c):c=e[2];const b=L(c),C=M(),j=Q();let u;e[3]!==n||e[4]!==i?(u=R.githubUserOrgs(i,n),e[3]=n,e[4]=i,e[5]=u):u=e[5];let l;e[6]!==n||e[7]!==b?(l=()=>ge(g=>b.callTool(g),n),e[6]=n,e[7]=b,e[8]=l):l=e[8];let d;e[9]!==u||e[10]!==l?(d={queryKey:u,queryFn:l},e[9]=u,e[10]=l,e[11]=d):d=e[11];const m=X(d);let a;e[12]!==j||e[13]!==n||e[14]!==m||e[15]!==i||e[16]!==h||e[17]!==C?(a={mutationFn:async()=>{const g=await K({connectionId:n,orgId:i,orgSlug:h,persistFallback:E=>j.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ce)});if(g.ran&&!g.ok)throw new Error(g.error??"no token received");const k=new URL(`/api/${h}/mcp/${n}`,window.location.origin);await C.invalidateQueries({queryKey:R.isMCPAuthenticated(k.href,null)}),await C.invalidateQueries({queryKey:R.mcpClientPrefix()}),await m.refetch()},onError:ve},e[12]=j,e[13]=n,e[14]=m,e[15]=i,e[16]=h,e[17]=C,e[18]=a):a=e[18];const f=B(a);if(m.isLoading){let g;return e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=g):g=e[19],g}if(m.isError){let g,k;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),k=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]=g,e[21]=k):(g=e[20],k=e[21]);let E;e[22]!==f?(E=()=>f.mutate(),e[22]=f,e[23]=E):E=e[23];let P;e[24]!==f.isPending?(P=f.isPending?t.jsx(z,{size:14,className:"animate-spin"}):t.jsx(G,{className:"size-3.5"}),e[24]=f.isPending,e[25]=P):P=e[25];let O;return e[26]!==f.isPending||e[27]!==E||e[28]!==P?(O=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[g,k,t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:E,disabled:f.isPending,children:[P,"Reconnect GitHub"]})]}),e[26]=f.isPending,e[27]=E,e[28]=P,e[29]=O):O=e[29],O}const N=m.data;if(!N)return null;let x;e[30]!==p||e[31]!==o?(x=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:p,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(J,{size:12}),"Change connection"]})}),e[30]=p,e[31]=o,e[32]=x):x=e[32];let s;if(e[33]!==N.installations||e[34]!==r){let g;e[36]!==r?(g=k=>t.jsxs("button",{type:"button",onClick:()=>r(k),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:k.avatarUrl,alt:k.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:k.login}),k.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 →"})]},k.installationId),e[36]=r,e[37]=g):g=e[37],s=N.installations.map(g),e[33]=N.installations,e[34]=r,e[35]=s}else s=e[35];let v;e[38]!==s?(v=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=v):v=e[39];const S=N.appSlug?`https://github.com/apps/${N.appSlug}/installations/new`:"https://github.com/settings/installations";let _;e[40]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=_):_=e[40];let w;e[41]!==S?(w=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?"," ",_]})}),e[41]=S,e[42]=w):w=e[42];let I;return e[43]!==w||e[44]!==x||e[45]!==v?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,v,w]}),e[43]=w,e[44]=x,e[45]=v,e[46]=I):I=e[46],I}function ve(y){U.error("Failed to reconnect GitHub: "+(y instanceof Error?y.message:"Unknown error"))}function Ce(){}function we(y){const e=A.c(20),{connectionId:n,orgId:i,orgSlug:h,installation:r,onSelectRepo:o,isSaving:p}=y,[c,b]=T.useState(""),C=re(c,300),j=T.useDeferredValue(C),u=c!==j;let l;e[0]!==u||e[1]!==c?(l=t.jsx(le,{placeholder:"Search repositories...",value:c,onChange:b,isSearching:u}),e[0]=u,e[1]=c,e[2]=l):l=e[2];const d=u?"opacity-40":"opacity-100";let m;e[3]!==d?(m=D("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",d),e[3]=d,e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=a):a=e[5];let f;e[6]!==n||e[7]!==j||e[8]!==r||e[9]!==p||e[10]!==o||e[11]!==i||e[12]!==h?(f=t.jsx(T.Suspense,{fallback:a,children:t.jsx(Se,{connectionId:n,orgId:i,orgSlug:h,installation:r,query:j,onSelectRepo:o,isSaving:p})}),e[6]=n,e[7]=j,e[8]=r,e[9]=p,e[10]=o,e[11]=i,e[12]=h,e[13]=f):f=e[13];let N;e[14]!==m||e[15]!==f?(N=t.jsx("div",{className:m,children:f}),e[14]=m,e[15]=f,e[16]=N):N=e[16];let x;return e[17]!==l||e[18]!==N?(x=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l,N]}),e[17]=l,e[18]=N,e[19]=x):x=e[19],x}function Se(y){const e=A.c(29),{connectionId:n,orgId:i,orgSlug:h,installation:r,query:o,onSelectRepo:p,isSaving:c}=y;let b;e[0]!==n||e[1]!==i||e[2]!==h?(b={connectionId:n,orgId:i,orgSlug:h},e[0]=n,e[1]=i,e[2]=h,e[3]=b):b=e[3];const C=L(b),j=r.type==="User"?"user":"org",u=o?`${j}:${r.login} ${o} in:name`:`${j}:${r.login}`;let l;e[4]!==n||e[5]!==r.login||e[6]!==i||e[7]!==o?(l=R.githubOrgRepos(i,n,r.login,o),e[4]=n,e[5]=r.login,e[6]=i,e[7]=o,e[8]=l):l=e[8];let d;e[9]!==C||e[10]!==u?(d=async x=>{const{signal:s}=x,S=(await C.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(Ie)},e[9]=C,e[10]=u,e[11]=d):d=e[11];let m;e[12]!==l||e[13]!==d?(m={queryKey:l,queryFn:d},e[12]=l,e[13]=d,e[14]=m):m=e[14];const{data:a}=ee(m);if(a.length===0){let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=x):x=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 v;return e[18]!==s?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[x,s]}),e[18]=s,e[19]=v):v=e[19],v}let f;if(e[20]!==c||e[21]!==p||e[22]!==a){let x;e[24]!==c||e[25]!==p?(x=s=>t.jsxs("button",{type:"button",onClick:()=>p(s),disabled:c,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(G,{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(te,{size:10}):t.jsx(ue,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=c,e[25]=p,e[26]=x):x=e[26],f=a.map(x),e[20]=c,e[21]=p,e[22]=a,e[23]=f}else f=e[23];let N;return e[27]!==f?(N=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:f}),e[27]=f,e[28]=N):N=e[28],N}function Ie(y){return{name:y.name,fullName:y.full_name,owner:y.full_name.split("/")[0]??"",url:y.html_url,private:y.private,description:y.description,updatedAt:y.updated_at}}function $(y){const e=A.c(33),{status:n,error:i,retry:h}=y;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(G,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=_):_=e[1];const w=i??"Something went wrong while connecting to GitHub.";let I;e[2]!==w?(I=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[_,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:w})]}),e[2]=w,e[3]=I):I=e[3];let g;e[4]!==h?(g=t.jsx("button",{type:"button",onClick:h,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]=h,e[5]=g):g=e[5];let k;return e[6]!==I||e[7]!==g?(k=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,I,g]}),e[6]=I,e[7]=g,e[8]=k):k=e[8],k}const r=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(G,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=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(z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=p):p=e[10];const c=r?"Authenticating with GitHub":"Setting up GitHub";let b;e[11]!==c?(b=t.jsx("p",{className:"text-sm font-medium",children:c}),e[11]=c,e[12]=b):b=e[12];const C=r?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==C?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=j):j=e[14];let u;e[15]!==b||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[b,j]}),e[15]=b,e[16]=j,e[17]=u):u=e[17];const l=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let d;e[18]!==l?(d=D("size-1.5 rounded-full",l),e[18]=l,e[19]=d):d=e[19];let m;e[20]!==d?(m=t.jsx("span",{className:d}),e[20]=d,e[21]=m):m=e[21];const a=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let f;e[22]!==a?(f=D("size-1.5 rounded-full",a),e[22]=a,e[23]=f):f=e[23];let N;e[24]!==f?(N=t.jsx("span",{className:f}),e[24]=f,e[25]=N):N=e[25];let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=x):x=e[26];let s;e[27]!==m||e[28]!==N?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[m,N,x]}),e[27]=m,e[28]=N,e[29]=s):s=e[29];let v;return e[30]!==s||e[31]!==u?(v=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,u,s]}),e[30]=s,e[31]=u,e[32]=v):v=e[32],v}export{De as G,G as a,ye as b,he as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dx as _t,dy as St,bi as R,I as c,dz as de,bo as Ve,bv as It,bh as Et,aW as Tt,ag as O,af as G,ad as oe,H as _,bj as m,b3 as F,dA as wt,dB as I,ae as Mt,t as ge,c as Ie,r as W,C as At,j as Ot}from"./index-
|
|
1
|
+
import{dx as _t,dy as St,bi as R,I as c,dz as de,bo as Ve,bv as It,bh as Et,aW as Tt,ag as O,af as G,ad as oe,H as _,bj as m,b3 as F,dA as wt,dB as I,ae as Mt,t as ge,c as Ie,r as W,C as At,j as Ot}from"./index-D4utvNsR.js";import{u as Ct}from"./use-mcp-client-Dxv8FjGO.js";import{S as Rt}from"./constants-D_FQAPnt.js";import{d as Nt,D as xt}from"./decopilot-sse-pool-B9iK6ns-.js";import{d as Pt}from"./delay-CnY5UFtP.js";import{e as Dt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Me;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Me||(Me={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Ae;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ae||(Ae={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var ze="vercel.ai.error",Lt=Symbol.for(ze),Oe,Ce,Z=class Je extends(Ce=Error,Oe=Lt,Ce){constructor({name:e,message:a,cause:r}){super(a),this[Oe]=!0,this.name=e,this.cause=r}static isInstance(e){return Je.hasMarker(e,ze)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function We(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ge="AI_InvalidArgumentError",Ye=`vercel.ai.error.${Ge}`,kt=Symbol.for(Ye),Re,Ne,jt=class extends(Ne=Z,Re=kt,Ne){constructor({message:t,cause:e,argument:a}){super({name:Ge,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,Ye)}},qe="AI_JSONParseError",He=`vercel.ai.error.${qe}`,Zt=Symbol.for(He),xe,Pe,De=class extends(Pe=Z,xe=Zt,Pe){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${We(e)}`,cause:e}),this[xe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,He)}},Xe="AI_TypeValidationError",Qe=`vercel.ai.error.${Xe}`,$t=Symbol.for(Qe),Le,ke,X=class ve extends(ke=Z,Le=$t,ke){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Xe,message:`${s}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${We(a)}`,cause:a}),this[Le]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,Qe)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new jt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Ut=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Ft=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function je(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ut.test(t)===!1&&Ft.test(t)===!1?e:Bt(e)}function Bt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function Vt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return je(t)}try{return je(t)}finally{Error.stackTraceLimit=e}}function Ee(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Ee(t)}var zt=Symbol("Let zodToJsonSchema decide on which parser to use"),Ze={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Jt=t=>typeof t=="string"?{...Ze,name:t}:{...Ze,...t};function N(){return{}}function Wt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Gt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Yt(){return{type:"boolean"}}function Ke(t,e){return b(t.type._def,e)}var qt=(t,e)=>b(t.innerType._def,e);function et(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>et(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Ht(t)}}var Ht=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Xt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function Qt(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function Kt(t){return{type:"string",enum:Array.from(t.values)}}var ea=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function ta(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ea(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function aa(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function tt(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?sa(t):t}var ra=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sa(t){let e="";for(let a=0;a<t.length;a++)ra.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:$e(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=$e(e,r)}function $e(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,aM as R}from"./index-
|
|
1
|
+
import{r as a,aM as R}from"./index-D4utvNsR.js";function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ne(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oe(e,t){if(e==null)return{};var r,n,o=je(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function je(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Me(e,t){return me(e)||ye(e,t)||Ee(e,t)||we()}function Pe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e){var t=Pe(e,"string");return typeof t=="symbol"?t:t+""}function Ee(e,t){if(e){if(typeof e=="string")return re(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}function Re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ie(Object(r),!0).forEach(function(n){Re(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ie(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function A(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function F(e){return{}.toString.call(e).includes("Object")}function Te(e){return!Object.keys(e).length}function D(e){return typeof e=="function"}function Ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Le(e,t){return F(t)||P("changeType"),Object.keys(t).some(function(r){return!Ce(e,r)})&&P("changeField"),t}function Ae(e){D(e)||P("selectorType")}function $e(e){D(e)||F(e)||P("handlerType"),F(e)&&Object.values(e).some(function(t){return!D(t)})&&P("handlersType")}function De(e){e||P("initialIsRequired"),F(e)||P("initialType"),Te(e)&&P("initialContent")}function Ve(e,t){throw new Error(e[t]||e.default)}var xe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},P=A(Ve)(xe),q={changes:Le,selector:Ae,handler:$e,initial:De};function Ne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};q.initial(e),q.handler(t);var r={current:e},n=A(Fe)(r,t),o=A(ze)(r),i=A(q.changes)(e),c=A(qe)(r);function s(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(j){return j};return q.selector(p),p(r.current)}function f(p){Ie(n,o,i,c)(p)}return[s,f]}function qe(e,t){return D(t)?t(e.current):t}function ze(e,t){return e.current=ae(ae({},e.current),t),t}function Fe(e,t,r){return D(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Ue={create:Ne},He={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function We(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function Be(e){return{}.toString.call(e).includes("Object")}function Ke(e){return e||ue("configIsRequired"),Be(e)||ue("configType"),e.urls?(Ge(),{paths:{vs:e.urls.monacoBase}}):e}function Ge(){console.warn(ce.deprecation)}function Ye(e,t){throw new Error(e[t]||e.default)}var ce={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
3
|
You are using deprecated way of configuration.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bi as f,bj as t,af as R,I as l,c2 as z,H as s,ag as y,ad as g,aW as b,b3 as H,bg as V,c3 as ve,c4 as xe,c5 as K,c6 as W,c7 as we,c8 as Ce,c9 as Z,ca as ke,cb as Pe,cc as qe,cd as Te,ce as Ie,cf as Ee,cg as Le,ch as ze,bu as Ae,ci as De,cj as Ue,ck as Ne,cl as $e,cm as Oe,cn as je,co as Be,bt as Fe,r as oe,c as J,j as w,cp as Ve,cq as We,p as Ke,l as se,bx as Ze}from"./index-
|
|
1
|
+
import{bi as f,bj as t,af as R,I as l,c2 as z,H as s,ag as y,ad as g,aW as b,b3 as H,bg as V,c3 as ve,c4 as xe,c5 as K,c6 as W,c7 as we,c8 as Ce,c9 as Z,ca as ke,cb as Pe,cc as qe,cd as Te,ce as Ie,cf as Ee,cg as Le,ch as ze,bu as Ae,ci as De,cj as Ue,ck as Ne,cl as $e,cm as Oe,cn as je,co as Be,bt as Fe,r as oe,c as J,j as w,cp as Ve,cq as We,p as Ke,l as se,bx as Ze}from"./index-D4utvNsR.js";import{P as Je}from"./use-mcp-client-Dxv8FjGO.js";const de=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Ye(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${Ge(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,c=r.match(n);if(c){const m=(c.index??0)+c[0].length;return r.slice(0,m)+`
|
|
2
2
|
`+i+r.slice(m)}const d=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,u=r.match(d);if(u){const m=(u.index??0)+u[0].length;return r.slice(0,m)+`
|
|
3
3
|
<head>
|
|
4
4
|
`+i+`
|