decocms 4.16.0 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle--rPujN3Y.js → AlertCircle-D8gnDqwf.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-6nYdIeA_.js → ArrowUpRight-BlXghneM.js} +1 -1
- package/dist/client/assets/{CheckCircle-uEcNv3oG.js → CheckCircle-DCCFCHyS.js} +1 -1
- package/dist/client/assets/{ChevronDown-DZjF3Thv.js → ChevronDown-BLALKRGM.js} +1 -1
- package/dist/client/assets/{ChevronRight-Z0q9tr5K.js → ChevronRight-Gacf5_E2.js} +1 -1
- package/dist/client/assets/{ChevronUp-D4D_9neM.js → ChevronUp-DBXbYduj.js} +1 -1
- package/dist/client/assets/{DotsVertical-BXAKlKX4.js → DotsVertical-D7ryssxp.js} +1 -1
- package/dist/client/assets/{Eye-Cov1iekv.js → Eye-BFLaa-Ve.js} +1 -1
- package/dist/client/assets/{FilterLines-CemhGOOA.js → FilterLines-CK4jmUMp.js} +1 -1
- package/dist/client/assets/{Globe01-C05BMTjz.js → Globe01-Bx-hz-as.js} +1 -1
- package/dist/client/assets/{Globe04-BRwKw7PX.js → Globe04-u6eY2Kop.js} +1 -1
- package/dist/client/assets/{HardDrive-DH-7bfsp.js → HardDrive-B06hZ2KP.js} +1 -1
- package/dist/client/assets/{Key01-Zbo9TQ6M.js → Key01-D0oVN5CX.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DLmY-nUd.js → LayoutLeft-1bN-FR8E.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DI4shoup.js → LinkExternal01-D4vA-I3a.js} +1 -1
- package/dist/client/assets/{Monitor01-qwfVoWYX.js → Monitor01-DrJKeSJ4.js} +1 -1
- package/dist/client/assets/{Palette-BrKsv6mu.js → Palette-CvuWqoBi.js} +1 -1
- package/dist/client/assets/{Play-D612TCCW.js → Play-DuOwU6E2.js} +1 -1
- package/dist/client/assets/{Plus-DK07_JoD.js → Plus-Bz2JwGOE.js} +1 -1
- package/dist/client/assets/{SearchLg-Bn8rNJBm.js → SearchLg-CfwbHNr5.js} +1 -1
- package/dist/client/assets/{SearchMd-CF0EzaSp.js → SearchMd-Bn2Kbs9E.js} +1 -1
- package/dist/client/assets/{Settings02-CMY7mFtN.js → Settings02-N32UBNZq.js} +1 -1
- package/dist/client/assets/{Shield01-TkrC5hLh.js → Shield01-BztOm8mA.js} +1 -1
- package/dist/client/assets/{Star01-D_WMzpkz.js → Star01-GFElhP7X.js} +1 -1
- package/dist/client/assets/{Stars01-Dgo6ZeEq.js → Stars01-CK-XatBt.js} +1 -1
- package/dist/client/assets/{Stars02-D0TDGrAi.js → Stars02-BpRz9194.js} +1 -1
- package/dist/client/assets/{Sun-CyYaDPq3.js → Sun-CRJdfBLT.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CY8rL9G2.js → SwitchHorizontal01-Bcp8nSOf.js} +1 -1
- package/dist/client/assets/{Tool01-93CsHV7z.js → Tool01-DrE6CqtR.js} +1 -1
- package/dist/client/assets/{Trash01-pwMDa2Co.js → Trash01-kVRWRMat.js} +1 -1
- package/dist/client/assets/{Upload01-BIfi-RBp.js → Upload01-TiHLQTwG.js} +1 -1
- package/dist/client/assets/{User01-Ck187G2K.js → User01-9o9EbE3X.js} +1 -1
- package/dist/client/assets/{Users01-B4dXvjnK.js → Users01-CMbqiB_R.js} +1 -1
- package/dist/client/assets/{Users03-DgL-nSvI.js → Users03-K1B4uaw7.js} +1 -1
- package/dist/client/assets/{X-BC75c88P.js → X-BQZZQdg0.js} +1 -1
- package/dist/client/assets/{XCircle-C30_UXd3.js → XCircle-BOFvuFHl.js} +1 -1
- package/dist/client/assets/{XClose-BnLOhLbC.js → XClose-ChRyc7zA.js} +1 -1
- package/dist/client/assets/{Zap-CwhZlKhU.js → Zap-RN8PAcZE.js} +1 -1
- package/dist/client/assets/{ZapSquare-CiXrDW73.js → ZapSquare-D4RqdrSL.js} +1 -1
- package/dist/client/assets/{ZoomOut-CgUBbs0k.js → ZoomOut-CwXzA7X6.js} +1 -1
- package/dist/client/assets/{access-gate-Ddakg94Z.js → access-gate-DayZt2qh.js} +1 -1
- package/dist/client/assets/{add-section-modal-BEvvmMxn.js → add-section-modal-BgsTQi1S.js} +1 -1
- package/dist/client/assets/agent-capabilities-C8WZk9re.js +1 -0
- package/dist/client/assets/agent-icon-BRuLsBYY.js +1 -0
- package/dist/client/assets/{agents-list-BNcLGGdI.js → agents-list-Bb32bFe0.js} +1 -1
- package/dist/client/assets/ai-providers-CtFbvrBB.js +1 -0
- package/dist/client/assets/{alert-DQEgpj3F.js → alert-DGlfAxXY.js} +1 -1
- package/dist/client/assets/{alert-dialog-B4gO4yN5.js → alert-dialog-D87-BKea.js} +2 -2
- package/dist/client/assets/app-editor-BTeZcD9G.js +1 -0
- package/dist/client/assets/{auth-catchall-D3JzAW-k.js → auth-catchall-CDZHIENi.js} +1 -1
- package/dist/client/assets/{auth-entry-Bwc-RALg.js → auth-entry--IJuST3G.js} +1 -1
- package/dist/client/assets/{auth-DLMAAdjO.js → auth-pLLkIszG.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BLTOjOLB.js → auth-split-layout-Cm8DpBZy.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DakefadM.js → authenticate-and-persist-oauth-VdmVLbtW.js} +1 -1
- package/dist/client/assets/{automation-list-row-ipQdiSSm.js → automation-list-row-DJcYtMaz.js} +1 -1
- package/dist/client/assets/{automation-runs-C74R9g0x.js → automation-runs-BQZ05VJM.js} +1 -1
- package/dist/client/assets/automations-DXzG8kgd.js +1 -0
- package/dist/client/assets/{avatar-DS9aYjJt.js → avatar-DxH3BnSs.js} +1 -1
- package/dist/client/assets/{badge-wSwvHa02.js → badge-wh5eWpb9.js} +1 -1
- package/dist/client/assets/{block-document-BEmcXKPE.js → block-document-OYJ-kskh.js} +2 -2
- package/dist/client/assets/{brand-context-DoLXR5-x.js → brand-context-Dkhy-emW.js} +1 -1
- package/dist/client/assets/breadcrumb-DZbB5tzN.js +1 -0
- package/dist/client/assets/{buckets-B1pMqHCa.js → buckets-DWf7-mkQ.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-K9RKoTBZ.js → bulk-category-panel-BfqGc7PR.js} +1 -1
- package/dist/client/assets/capability-load-error-B0knfbbl.js +1 -0
- package/dist/client/assets/{card-C45fkaVO.js → card-D-LCVQQb.js} +1 -1
- package/dist/client/assets/category-editor-dubEmgpx.js +1 -0
- package/dist/client/assets/{chat-context-TTwf8MAP.js → chat-context-CIKFBD8u.js} +4 -4
- package/dist/client/assets/{checkbox-TzOn0Djh.js → checkbox-CFdij7Ei.js} +1 -1
- package/dist/client/assets/{cli-auth-success--q8-44bB.js → cli-auth-success-BJWjcvwa.js} +1 -1
- package/dist/client/assets/collection-detail-C8jnHEZw.js +1 -0
- package/dist/client/assets/{collection-display-button-DAd8Da4w.js → collection-display-button-DDEI8eBI.js} +1 -1
- package/dist/client/assets/{collection-search-DvBi3Q2M.js → collection-search-B0gYtEWh.js} +1 -1
- package/dist/client/assets/{collection-tabs-B4wJfJxi.js → collection-tabs-DGDRpyxJ.js} +1 -1
- package/dist/client/assets/{command-CCTW1Ytf.js → command-VE4J0WmB.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-jLm6p03A.js → commerce-onboarding-DtwhvPKV.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-B-Qjl-2m.js → connect-desktop-dialog-DRNK5Zqx.js} +1 -1
- package/dist/client/assets/{connection-card-B_S6LeLq.js → connection-card-Dzp4nWAC.js} +1 -1
- package/dist/client/assets/connection-detail-BnRE6ILz.js +1 -0
- package/dist/client/assets/{connection-form-helpers-0vbutknj.js → connection-form-helpers-BKzMCiDP.js} +1 -1
- package/dist/client/assets/{connections-CrVC5c7D.js → connections-BPohRO-Z.js} +1 -1
- package/dist/client/assets/{decopilot-ByyydzKl.js → decopilot-D_-94MU_.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DbAPLrBY.js → decopilot-sse-pool-DA88fFcW.js} +1 -1
- package/dist/client/assets/{dialog-Ql8kdDTa.js → dialog-BdIjDk0G.js} +1 -1
- package/dist/client/assets/{domain-settings-D1WiqXBP.js → domain-settings-CTC9j3wY.js} +1 -1
- package/dist/client/assets/{drawer-CBX0QEUx.js → drawer-D1X6O6Aa.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CIAjydh3.js → dropdown-menu-8PMbgM0q.js} +1 -1
- package/dist/client/assets/{empty-state-BzX7YwgA.js → empty-state-y_scHUYK.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CFrqNmH9.js → extract-connection-data-BhI39RpO.js} +1 -1
- package/dist/client/assets/file-explorer-BD0vY2dd.js +2 -0
- package/dist/client/assets/{file-type-icon-fjgLfwGj.js → file-type-icon-Bx1NX_Gy.js} +1 -1
- package/dist/client/assets/{files-B7cjcKYB.js → files-BFgu7BJp.js} +1 -1
- package/dist/client/assets/{form-hBMUZ-LI.js → form-P-LOMg0X.js} +1 -1
- package/dist/client/assets/{general-SCBmH2JA.js → general-DaU6Yz-f.js} +1 -1
- package/dist/client/assets/github-repo-picker-CmustdLW.js +1 -0
- package/dist/client/assets/{hooks-wJ9L2q1Z.js → hooks-UY6BFV6z.js} +4 -4
- package/dist/client/assets/{import-from-deco-dialog-rnwM3BUn.js → import-from-deco-dialog-CopvXqdM.js} +1 -1
- package/dist/client/assets/{index-DbVMhyOM.js → index-BZCHEyhA.js} +1 -1
- package/dist/client/assets/{index-D57sxBgv.js → index-BbFfuuHN.js} +1 -1
- package/dist/client/assets/{index-DPqZ0lBB.js → index-BgCyOgdF.js} +25 -25
- package/dist/client/assets/{index-CRIhXX57.js → index-BrtU3HWl.js} +3 -3
- package/dist/client/assets/{index-D7be0Dd5.js → index-BwaOBBZ-.js} +1 -1
- package/dist/client/assets/{index-Bl9dJ0nD.js → index-CAQVV5KO.js} +1 -1
- package/dist/client/assets/index-Cgz2WBho.js +173 -0
- package/dist/client/assets/index-D4EP6iY-.js +1 -0
- package/dist/client/assets/{index-B6CxQrCo.js → index-DHTICC_v.js} +12 -12
- package/dist/client/assets/{index-9wbmkYIt.js → index-DJMmArQj.js} +1 -1
- package/dist/client/assets/index-DStyXwbT.js +1 -0
- package/dist/client/assets/index-DTpadbju.js +1 -0
- package/dist/client/assets/index-DmMZ0-sF.css +1 -0
- package/dist/client/assets/{index-B3lyyZoz.js → index-Dq2Ts3Yi.js} +1 -1
- package/dist/client/assets/{index-redirect-JCm2yIgz.js → index-redirect-YHMCgUs4.js} +1 -1
- package/dist/client/assets/{input-92IYvOwC.js → input-DgsFOGyM.js} +1 -1
- package/dist/client/assets/{integration-icon-BO-UF1BS.js → integration-icon-m6Sa_hcd.js} +1 -1
- package/dist/client/assets/{label-ClPdqpUd.js → label-CwMsBEmc.js} +1 -1
- package/dist/client/assets/library-tab-DZNwBek9.js +7 -0
- package/dist/client/assets/{login-DgOPYAOM.js → login-DDPQBbDq.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DTOnM3tW.js → mcp-oauth-SxDhA9AX.js} +1 -1
- package/dist/client/assets/{members-DIJN_e3F.js → members-DiR3wVIq.js} +2 -2
- package/dist/client/assets/{monaco-editor-Bmt-pGiV.js → monaco-editor-iFVtSMuF.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-5ex8aBKD.js → monitoring-stats-row-D6W0tudn.js} +1 -1
- package/dist/client/assets/{oauth-callback-BxJL43IL.js → oauth-callback-Cj-8kU65.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-T3ZxDraC.js → oauth-callback-ai-provider-Dc1dGP3j.js} +1 -1
- package/dist/client/assets/{onboarding-CrwoKUAN.js → onboarding-DF_zbux6.js} +1 -1
- package/dist/client/assets/{org-install-RobmE1uK.js → org-install-CEMN6R-y.js} +1 -1
- package/dist/client/assets/{org-layout-DmAiWQnF.js → org-layout-bk5Xtfa_.js} +1 -1
- package/dist/client/assets/{organization-choice-Crc0nA8E.js → organization-choice-CE_aU8pP.js} +1 -1
- package/dist/client/assets/{page-seo-form-BEyx98K-.js → page-seo-form-Derb8U-C.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BoNARuVh.js +1 -0
- package/dist/client/assets/popover-4-S-2t4S.js +1 -0
- package/dist/client/assets/post-editor-CHJjQHP8.js +1 -0
- package/dist/client/assets/{primitives-Cs1JxLBO.js → primitives-DFOak6EH.js} +1 -1
- package/dist/client/assets/{profile--fDEth4Y.js → profile-BNOuWcgq.js} +1 -1
- package/dist/client/assets/project-app-view-ChmoDNv-.js +1 -0
- package/dist/client/assets/record-editor-CS39Vomm.js +1 -0
- package/dist/client/assets/registry-D4tm3ZFm.js +2 -0
- package/dist/client/assets/{registry-layout-DmIz6dSp.js → registry-layout-BPKVzNcW.js} +4 -4
- package/dist/client/assets/{require-capability-BaKHYhiM.js → require-capability-BJprrccL.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BaYXJW0b.js → required-auth-layout-B0YEEBld.js} +1 -1
- package/dist/client/assets/{reset-password-AxTehpVn.js → reset-password-CkXuGUs6.js} +1 -1
- package/dist/client/assets/roles-lfwag5Tp.js +1 -0
- package/dist/client/assets/{scroll-area-CH-368qd.js → scroll-area-C8YtCymQ.js} +54 -54
- package/dist/client/assets/{search-input-DZumeAoO.js → search-input-Du_36cRj.js} +1 -1
- package/dist/client/assets/{secrets-BPAq0_qo.js → secrets-CnPg0qON.js} +1 -1
- package/dist/client/assets/{sections-editor-Crz16gyQ.js → sections-editor-BR6KfAKE.js} +2 -2
- package/dist/client/assets/select-DzzBmNmo.js +1 -0
- package/dist/client/assets/{select-model-CGEu5pyd.js → select-model-F8Y_Cf3t.js} +1 -1
- package/dist/client/assets/seo-editor-gJ1HxoCF.js +1 -0
- package/dist/client/assets/settings-layout-CGT7LCro.js +1 -0
- package/dist/client/assets/{settings-section-EyCuv06A.js → settings-section-rq7s23q-.js} +1 -1
- package/dist/client/assets/{sheet-CTWseyLj.js → sheet-B3q7nz8B.js} +1 -1
- package/dist/client/assets/shell-controls-mi9y4ySh.js +1 -0
- package/dist/client/assets/{shell-layout-u7hzXt3K.js → shell-layout-QzfqSuxf.js} +1 -1
- package/dist/client/assets/shell-route-loading-Bpj8AlnX.js +1 -0
- package/dist/client/assets/{sidebar-BaLCxwAl.js → sidebar-D2BmctMK.js} +1 -1
- package/dist/client/assets/{skeleton-BpxeXqnd.js → skeleton-f0d6RrIL.js} +1 -1
- package/dist/client/assets/{sso-DvvStBWC.js → sso-D4e1TwT3.js} +1 -1
- package/dist/client/assets/{store-D8QMJIIY.js → store-DxI78Zhs.js} +1 -1
- package/dist/client/assets/store-registry-DKwI23vv.js +2 -0
- package/dist/client/assets/{studio-tools-zOdwK0zh.js → studio-tools-D6ANxpFE.js} +1 -1
- package/dist/client/assets/switch-BRlkUTqX.js +1 -0
- package/dist/client/assets/{tab-id-AX1D_RMI.js → tab-id-DPNwWMUY.js} +1 -1
- package/dist/client/assets/{table-BpbB_kJT.js → table-65-g1dd8.js} +1 -1
- package/dist/client/assets/tabs-ByVhqny2.js +1 -0
- package/dist/client/assets/{task-status-DNPwSqe7.js → task-status-BMnLETgS.js} +1 -1
- package/dist/client/assets/{textarea-tv37zNgD.js → textarea-Dp78LmPE.js} +1 -1
- package/dist/client/assets/toggle-group-BIoy7tOG.js +1 -0
- package/dist/client/assets/{toolbar-NyfHrEzE.js → toolbar-C1WgDWOZ.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-ePdMhfbx.js → toolbar-icon-button-DdAIuoK2.js} +1 -1
- package/dist/client/assets/tools-list-BrZf2-sc.js +1 -0
- package/dist/client/assets/tooltip-CWNyrHYY.js +1 -0
- package/dist/client/assets/{types-DMnh_mjG.js → types-BHL4d6ji.js} +6 -6
- package/dist/client/assets/{use-ai-providers-D3giib4c.js → use-ai-providers-CVS8EjHf.js} +1 -1
- package/dist/client/assets/{use-automations-DIPQb7eg.js → use-automations-DJ1_UqKB.js} +1 -1
- package/dist/client/assets/{use-capability-JneQ7Vlv.js → use-capability-BmznXR_9.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CcOZ6R_w.js → use-clock-tick-BXZK-6ig.js} +1 -1
- package/dist/client/assets/{use-collections-B43Sol5V.js → use-collections-BnOL5hT8.js} +1 -1
- package/dist/client/assets/{use-connection-u7lGziaM.js → use-connection-CRsO-Bab.js} +1 -1
- package/dist/client/assets/{use-copy-BHyTm1ci.js → use-copy-DK8lBdjB.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DHdZYJVG.js → use-create-virtual-mcp-C50juX43.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-NW1w5qmo.js → use-debounced-autosave-Q8tZcL7-.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DW3gYKw6.js → use-debounced-value-C2hJqHIV.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DMfVXUJv.js → use-decopilot-events-BB7o7ets.js} +1 -1
- package/dist/client/assets/{use-delete-connection-TXFJhj7J.js → use-delete-connection-D7WMNDAi.js} +1 -1
- package/dist/client/assets/{use-file-configs-D5Wy46KQ.js → use-file-configs-Bxsm4MXe.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-pt1aYNB9.js → use-infinite-scroll-DFBavgZf.js} +1 -1
- package/dist/client/assets/{use-join-requests-DmwWk_kt.js → use-join-requests-CNT469hS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BKmxEbDP.js → use-mcp-client-DAJmDOVO.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-C9PuaVPO.js → use-mcp-prompts-D3eulxzR.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C821Tleh.js → use-mcp-tools-AjHzJbIQ.js} +1 -1
- package/dist/client/assets/{use-members-CcA5-SWw.js → use-members-BZroloWO.js} +1 -1
- package/dist/client/assets/{use-mobile-C77wgjj_.js → use-mobile-BkWraisf.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-Dlhjy-0a.js +1 -0
- package/dist/client/assets/{use-org-auth-client-C5YzOJMC.js → use-org-auth-client-BG_aw3vg.js} +1 -1
- package/dist/client/assets/{use-org-sso-IHoKz-Sw.js → use-org-sso-CEETlaem.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DZZfJv7z.js → use-organization-roles-BrhJCA0y.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D4bmJmDV.js → use-organization-settings-D9G2tGsW.js} +1 -1
- package/dist/client/assets/{use-registry-connections-zNHTAa1f.js → use-registry-connections-CTTYiKTQ.js} +1 -1
- package/dist/client/assets/{use-secrets-DuaBuygY.js → use-secrets-sB7thdOD.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BChPDpHE.js → use-status-sounds-DuOBmrHo.js} +1 -1
- package/dist/client/assets/{use-view-mode-Bkt4wZfz.js → use-view-mode-CFXBQhh0.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CsOrbTV4.js → use-virtual-mcp-CJycW-Qv.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Bl42Nudd.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-uA0LQwFa.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-DSwCaH3D.js → useSuspenseQueries-DohIOUYY.js} +1 -1
- package/dist/client/assets/{variant-calendar-DjuUZNmE.js → variant-calendar-DxXS9CiZ.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-zxXxzJo1.js → view-mode-toggle-D2SvIjQW.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +24 -18
- package/dist/server/server.js +12 -12
- package/package.json +1 -1
- package/dist/client/assets/agent-icon-BvWwsV9-.js +0 -1
- package/dist/client/assets/ai-providers-Cc-Qaitu.js +0 -1
- package/dist/client/assets/app-editor-b3ZDQT3y.js +0 -1
- package/dist/client/assets/automations-DHGV1vHN.js +0 -1
- package/dist/client/assets/capability-load-error-ocuq5X52.js +0 -1
- package/dist/client/assets/category-editor-BnbZ-tzO.js +0 -1
- package/dist/client/assets/collection-detail-DJv60Khn.js +0 -1
- package/dist/client/assets/connection-detail-CkHKK3hC.js +0 -1
- package/dist/client/assets/context-menu-BukQHkkX.js +0 -1
- package/dist/client/assets/file-explorer-CE7vUpn6.js +0 -2
- package/dist/client/assets/github-repo-picker-BS2-yyCb.js +0 -1
- package/dist/client/assets/index-BpE19-ck.js +0 -1
- package/dist/client/assets/index-BvU5lMjs.js +0 -1
- package/dist/client/assets/index-D9mYZCKV.css +0 -1
- package/dist/client/assets/index-DVXwW1US.js +0 -173
- package/dist/client/assets/index-DsqZHRRi.js +0 -3
- package/dist/client/assets/index-lxZN2uXp.js +0 -1
- package/dist/client/assets/page-seo-sheet-CRRHJ6vi.js +0 -1
- package/dist/client/assets/popover-BIbjLTCp.js +0 -1
- package/dist/client/assets/post-editor-DeJ4iIDf.js +0 -1
- package/dist/client/assets/project-app-view-Bw4pBi_7.js +0 -1
- package/dist/client/assets/record-editor-BMbdlgjH.js +0 -1
- package/dist/client/assets/registry-D7x-icQ2.js +0 -2
- package/dist/client/assets/roles-BOurXkap.js +0 -1
- package/dist/client/assets/select-DtrgZFUN.js +0 -1
- package/dist/client/assets/seo-editor-D3daX9h9.js +0 -1
- package/dist/client/assets/settings-layout-CmO92Idf.js +0 -1
- package/dist/client/assets/shell-controls-C3e2T-jB.js +0 -1
- package/dist/client/assets/shell-route-loading-COjyAVLN.js +0 -1
- package/dist/client/assets/sortable.esm-D3HJ-J2L.js +0 -5
- package/dist/client/assets/store-registry-CVCe-t3Q.js +0 -2
- package/dist/client/assets/switch-CxpAoaO8.js +0 -1
- package/dist/client/assets/tabs-B2YmTAz6.js +0 -1
- package/dist/client/assets/toggle-group-B-GnyMpd.js +0 -1
- package/dist/client/assets/tools-list-D5fafb0R.js +0 -1
- package/dist/client/assets/tooltip-BN4g0v-x.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-C9zrAPJx.js +0 -1
- package/dist/client/assets/use-org-fs-BToe7wyo.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DnUFt-2J.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CPNNqGjW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as i,
|
|
1
|
+
import{c as n,j as i,cv as u,l as c,bM as m,dj as x,dk as j,cw as N,cx as b,dl as g,dm as D}from"./index-DHTICC_v.js";import{i as h}from"./X-BQZZQdg0.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,E as a,O as b,R as c,T as d,k as e,z as f,v as g,y as h,w as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as X,
|
|
1
|
+
import{c as X,G as H,m as U,r as W,K as J,k as ee,d as Z,v as te,t as p,j as i,B as $}from"./index-DHTICC_v.js";import{u as ie}from"./studio-tools-D6ANxpFE.js";import{b as se,S as ne,a as oe}from"./settings-section-rq7s23q-.js";import{B as Q}from"./badge-wh5eWpb9.js";import{I as ae}from"./input-DgsFOGyM.js";import{d as re,S as le,a as ce,b as de,c as me}from"./select-DzzBmNmo.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let v;e[10]!==s?(v=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=v):v=e[11];let N;e[12]!==n||e[13]!==t.id?(N=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=N):N=e[14];let P;e[15]!==v||e[16]!==N?(P={mutationFn:v,onSuccess:N,onError:je},e[15]=v,e[16]=N,e[17]=P):P=e[17];const h=Z(P);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let R;e[22]!==S||e[23]!==y?(R={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=R):R=e[24];const F=Z(R);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let V;e[29]!==_||e[30]!==A?(V={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=V):V=e[31];const D=Z(V);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==F||e[44]!==D){let o;e[46]!==E||e[47]!==F||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>F.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(ve,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=F,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=F,e[44]=D,e[45]=O}else O=e[45];let G;e[50]===Symbol.for("react.memo_cache_sentinel")?(G=o=>x(o.target.value),e[50]=G):G=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:G,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let k;e[59]!==T||e[60]!==C||e[61]!==L?(k=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=k):k=e[62];let w;e[63]!==M||e[64]!==k?(w=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,k]}),e[63]=M,e[64]=k,e[65]=w):w=e[65];let B;return e[66]!==O||e[67]!==w?(B=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,w]})}),e[66]=O,e[67]=w,e[68]=B):B=e[68],B}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function ve(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=Ne;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function Ne(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as s,
|
|
1
|
+
import{c as d,j as s,cn as i,l as c}from"./index-DHTICC_v.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,j as
|
|
1
|
+
import{c,j as i,dG as f,dH as m,l as u,dI as g,dJ as x,dK as v,dL as b,dM as h,dN as w,dO as j,dP as N,dQ as z,dR as _,dS as y,dT as p}from"./index-DHTICC_v.js";import{i as $}from"./ChevronUp-DBXbYduj.js";import{i as D}from"./ChevronRight-Gacf5_E2.js";import{a as M}from"./DotsVertical-D7ryssxp.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function G(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function L(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function O(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function H(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function J(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function K(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function Q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function q(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,G as b,L as c,K as d,Q as e,q as f,J as g,H as h,P as i,E as j,O as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,l as N,j as t}from"./index-
|
|
1
|
+
import{c as v,l as N,j as t}from"./index-DHTICC_v.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-DHTICC_v.js";import{W as T,e as O}from"./use-mcp-client-DAJmDOVO.js";function x(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(e){const t=x(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function q(e,t){return H(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function B(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(e){return e?L[e]??e.toUpperCase():null}function J(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function Q(e,t,n,a,r){const o=await O({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=G[n[e]&63];return t};function j(e){return`${e}_${$()}`}function K(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function V(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function W(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function X(e,t,n,a){const r=e.server,o=e._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[v]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${W(c)})`:l&&N&&(g=` (${V(l)})`);const E=I+g;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{j as a,K as b,Q as c,J as d,X as e,B as f,U as g,q as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as Z,r as u,j as r,i as ie,B as he,dX as Mt,a3 as Dt,a9 as se,dY as Rt,dZ as Pt,d_ as Et,d$ as kt,bK as Tt,e0 as Ot,e1 as qe,a5 as At,e2 as Lt,e3 as Ft,e4 as It,e5 as $t,e6 as _t,e7 as zt,e8 as Wt,e9 as Gt,ea as Kt,l as ae,m as Bt,t as W,K as $e}from"./index-DHTICC_v.js";import{F as Vt,l as Ut}from"./index-BwaOBBZ-.js";import{i as qt,az as Xt,aA as Qt,aB as ue,aC as Ht,X as _e}from"./agent-icon-BRuLsBYY.js";import{a as Jt}from"./Tool01-DrE6CqtR.js";import{s as Yt}from"./XClose-ChRyc7zA.js";import{S as Zt}from"./scroll-area-C8YtCymQ.js";import{T as ze,a as We,b as Ge}from"./tooltip-CWNyrHYY.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-D87-BKea.js";import{u as cn}from"./chat-context-CIKFBD8u.js";import{b as dn}from"./shell-layout-QzfqSuxf.js";import{am as fe,an as Ke,ao as un}from"./index-BgCyOgdF.js";import{a as fn,b as mn,c as pn,D as xn,d as hn,e as gn}from"./dialog-BdIjDk0G.js";import{I as Be}from"./input-DgsFOGyM.js";import{t as vn}from"./ChevronDown-BLALKRGM.js";import{i as yn}from"./ChevronRight-Gacf5_E2.js";import{a as Cn}from"./ZoomOut-CwXzA7X6.js";import{E as wn,v as Ve,w as Ce,x as bn,y as jn,z as Nn,A as V,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-Cgz2WBho.js";import"./AlertCircle-D8gnDqwf.js";import"./SwitchHorizontal01-Bcp8nSOf.js";import"./Settings02-N32UBNZq.js";import"./XCircle-BOFvuFHl.js";import"./ArrowUpRight-BlXghneM.js";import"./ZapSquare-D4RqdrSL.js";import"./Users03-K1B4uaw7.js";import"./CheckCircle-DCCFCHyS.js";import"./ChevronUp-DBXbYduj.js";import"./DotsVertical-D7ryssxp.js";import"./Stars02-BpRz9194.js";import"./Eye-BFLaa-Ve.js";import"./Globe01-Bx-hz-as.js";import"./FilterLines-CK4jmUMp.js";import"./Star01-GFElhP7X.js";import"./Globe04-u6eY2Kop.js";import"./HardDrive-B06hZ2KP.js";import"./Key01-D0oVN5CX.js";import"./LayoutLeft-1bN-FR8E.js";import"./LinkExternal01-D4vA-I3a.js";import"./Monitor01-DrJKeSJ4.js";import"./Sun-CRJdfBLT.js";import"./Palette-CvuWqoBi.js";import"./Play-DuOwU6E2.js";import"./Plus-Bz2JwGOE.js";import"./SearchLg-CfwbHNr5.js";import"./SearchMd-Bn2Kbs9E.js";import"./Shield01-BztOm8mA.js";import"./Stars01-CK-XatBt.js";import"./Trash01-kVRWRMat.js";import"./Upload01-TiHLQTwG.js";import"./User01-9o9EbE3X.js";import"./Users01-CMbqiB_R.js";import"./X-BQZZQdg0.js";import"./Zap-RN8PAcZE.js";import"./use-clock-tick-BXZK-6ig.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DK8lBdjB.js";import"./file-type-icon-Bx1NX_Gy.js";import"./use-mobile-BkWraisf.js";import"./tab-id-DPNwWMUY.js";import"./content-blocks-o63cs2vh.js";import"./types-BHL4d6ji.js";import"./use-mcp-client-DAJmDOVO.js";import"./auth-pLLkIszG.js";import"./hooks-UY6BFV6z.js";import"./decopilot-sse-pool-DA88fFcW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-D6ANxpFE.js";import"./sheet-B3q7nz8B.js";import"./integration-icon-m6Sa_hcd.js";import"./use-virtual-mcp-CJycW-Qv.js";import"./use-collections-BnOL5hT8.js";import"./use-navigate-to-agent-Dlhjy-0a.js";import"./use-connection-CRsO-Bab.js";import"./use-mcp-prompts-D3eulxzR.js";import"./form-P-LOMg0X.js";import"./label-CwMsBEmc.js";import"./select-DzzBmNmo.js";import"./use-ai-providers-CVS8EjHf.js";import"./use-decopilot-events-BB7o7ets.js";import"./use-organization-settings-D9G2tGsW.js";import"./avatar-DxH3BnSs.js";import"./required-auth-layout-B0YEEBld.js";import"./use-org-sso-CEETlaem.js";import"./library-tab-DZNwBek9.js";import"./drawer-D1X6O6Aa.js";import"./collection-search-B0gYtEWh.js";import"./tabs-ByVhqny2.js";import"./toggle-group-BIoy7tOG.js";import"./agent-capabilities-C8WZk9re.js";import"./connect-desktop-dialog-DRNK5Zqx.js";import"./decopilot-D_-94MU_.js";import"./checkbox-CFdij7Ei.js";import"./skeleton-f0d6RrIL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rq7s23q-.js";import"./card-D-LCVQQb.js";import"./popover-4-S-2t4S.js";import"./command-VE4J0WmB.js";import"./index-BbFfuuHN.js";import"./useInfiniteQuery-Bl42Nudd.js";import"./use-infinite-scroll-DFBavgZf.js";import"./dropdown-menu-8PMbgM0q.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dzp4nWAC.js";import"./use-registry-connections-CTTYiKTQ.js";import"./extract-connection-data-BhI39RpO.js";import"./collection-tabs-DGDRpyxJ.js";import"./badge-wh5eWpb9.js";import"./textarea-Dp78LmPE.js";import"./connection-form-helpers-BKzMCiDP.js";import"./authenticate-and-persist-oauth-VdmVLbtW.js";import"./mcp-oauth-SxDhA9AX.js";import"./useSuspenseInfiniteQuery-uA0LQwFa.js";import"./shell-route-loading-Bpj8AlnX.js";import"./task-status-BMnLETgS.js";import"./use-status-sounds-DuOBmrHo.js";import"./empty-state-y_scHUYK.js";import"./toolbar-C1WgDWOZ.js";import"./use-mcp-tools-AjHzJbIQ.js";import"./use-capability-BmznXR_9.js";import"./tools-list-BrZf2-sc.js";import"./switch-BRlkUTqX.js";import"./use-debounced-autosave-Q8tZcL7-.js";import"./index-BZCHEyhA.js";import"./sidebar-D2BmctMK.js";import"./search-input-Du_36cRj.js";import"./github-repo-picker-CmustdLW.js";import"./use-debounced-value-C2hJqHIV.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-sB7thdOD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-DdAIuoK2.js";import"./automation-runs-BQZ05VJM.js";import"./table-65-g1dd8.js";import"./use-members-BZroloWO.js";import"./use-org-auth-client-BG_aw3vg.js";import"./use-automations-DJ1_UqKB.js";import"./use-file-configs-Bxsm4MXe.js";import"./monaco-editor-iFVtSMuF.js";import"./select-model-F8Y_Cf3t.js";import"./automation-list-row-DJcYtMaz.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(i){const e=Z.c(51),{open:s,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=i,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(s),C=Pn[a];s!==B&&(U(s),s&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const Q=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const X=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let T;e[9]!==C.description?(T=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(ie,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==X||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:X,children:[G,j,b]})}),e[42]=X,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==Q||e[48]!==s||e[49]!==S?(z=r.jsx(gn,{open:s,onOpenChange:Q,children:S}),e[47]=Q,e[48]=s,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Xe]=kn(Me),Qe=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:c,modal:m=!0}=i,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:s})})};Qe.displayName=Me;var He="ContextMenuTrigger",Je=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...c}=i,m=Xe(He,s),x=F(s),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:se(i.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?i.onPointerDown:se(i.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?i.onPointerMove:se(i.onPointerMove,xe(d)),onPointerCancel:a?i.onPointerCancel:se(i.onPointerCancel,xe(d)),onPointerUp:a?i.onPointerUp:se(i.onPointerUp,xe(d))})]})});Je.displayName=He;var On="ContextMenuPortal",Ye=i=>{const{__scopeContextMenu:e,...s}=i,a=F(e);return r.jsx(Et,{...a,...s})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=Xe(Ze,s),m=F(s),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{i.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{i.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Xn="ContextMenuArrow",Qn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Wt,{...c,...a,ref:e})});Qn.displayName=Xn;var Hn="ContextMenuSubTrigger",Jn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Hn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Kt,{...c,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var er=Qe,tr=Je,nr=Ye,rr=et,or=tt,sr=nt;function ir(i){const e=Z.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(er,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function ar(i){const e=Z.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function lr(i){const e=Z.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(i){const e=Z.c(12);let s,a,c,m;e[0]!==i?({className:s,inset:a,variant:m,...c}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=c,e[4]=m):(s=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==s?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(i){const e=Z.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ae("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(sr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(i){const e=Z.c(45),{node:s,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:C}=i,I=x===void 0?!1:x,Q=s.kind==="directory",{Icon:q,color:X}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==X||e[9]!==Q||e[10]!==c||e[11]!==I?(R=Q?r.jsxs(r.Fragment,{children:[I?r.jsx(ie,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:X}})]}),e[7]=q,e[8]=X,e[9]=Q,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==s.name?(P=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(ir,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function ur(i){const e=V(i);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(i){const e=i.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Ht,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function Qs({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,C]=u.useState([]),[I,Q]=u.useState(""),[q,X]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{setChatOpen:_}=dn(),K=Bt(),[D,H]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(i,e,s)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${i}/${e}/${s}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function st(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function it(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),H(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),H(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){H(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),H(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),it(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),X(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:wn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{X(!1)}}async function Oe(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(i,e,s,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(i,e,s,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(i,e,s)});try{const l=await un(i,e,s);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||C(n=>[...n,t]),Oe(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?st(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_(!0),z({parts:[{type:"text",text:n.join(`
|
|
2
|
+
`)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>Q(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Xt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",V(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[U.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:U.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Vt,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":V(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&H(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{Qs as FileExplorer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bs as zl,j as q,a2 as lt,bL as zn,r as Ve,bM as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-DHTICC_v.js";import{i as zb}from"./ChevronUp-DBXbYduj.js";import{a as jb}from"./Eye-BFLaa-Ve.js";import{e as S0,g as y0,h as A0,a as _0}from"./dialog-BdIjDk0G.js";import{n as I0}from"./Globe01-Bx-hz-as.js";import{j as k0,n as R0}from"./ZoomOut-CwXzA7X6.js";import{u as N0}from"./use-mobile-BkWraisf.js";import{k as C0}from"./tab-id-DPNwWMUY.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-DHTICC_v.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{
|
|
1
|
+
import{cz as C,c as f,j as c,a0 as j,r as d,l as p,b8 as b,cA as v,cB as h}from"./index-DHTICC_v.js";import{L as N}from"./label-CwMsBEmc.js";const E=C,g=d.createContext({}),M=t=>{const e=f.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=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.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=d.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=f.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=f.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=f.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=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,R as e,y as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as M,
|
|
1
|
+
import{b as M,G as $,m as U,p as Q,n as Y,d as q,v as P,t as w,K as L,j as n,a0 as I,o as Z,s as k,c as E,r as T,B as H,L as B,y as J}from"./index-DHTICC_v.js";import{P as N}from"./index-BZCHEyhA.js";import{u as W}from"./use-org-auth-client-BG_aw3vg.js";import{u as X}from"./use-debounced-autosave-Q8tZcL7-.js";import{A as ee}from"./avatar-DxH3BnSs.js";import{I as V}from"./input-DgsFOGyM.js";import{S as G,a as K,b as A,c as te}from"./settings-section-rq7s23q-.js";import{D as ne}from"./domain-settings-CTC9j3wY.js";import{u as ae}from"./studio-tools-D6ANxpFE.js";import{c as se,b as oe,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-D87-BKea.js";import{R as me}from"./require-capability-BJprrccL.js";import"./sidebar-D2BmctMK.js";import"./LayoutLeft-1bN-FR8E.js";import"./use-mobile-BkWraisf.js";import"./sheet-B3q7nz8B.js";import"./X-BQZZQdg0.js";import"./tooltip-CWNyrHYY.js";import"./User01-9o9EbE3X.js";import"./card-D-LCVQQb.js";import"./ArrowUpRight-BlXghneM.js";import"./badge-wh5eWpb9.js";import"./select-DzzBmNmo.js";import"./ChevronUp-DBXbYduj.js";import"./ChevronDown-BLALKRGM.js";import"./use-capability-BmznXR_9.js";import"./access-gate-DayZt2qh.js";import"./capability-load-error-B0knfbbl.js";const ge=Z({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function fe(e){const t=E.c(13),{value:v,onChange:h,name:o,disabled:d}=e,m=T.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=pe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let s;t[3]!==d||t[4]!==a?(s=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=s):s=t[5];const i=v||void 0,p=o??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==s||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,g]}),t[9]=d,t[10]=s,t[11]=g,t[12]=f):f=t[12],f}function pe(){return w.error("Failed to read image")}function he(){const e=M(),{org:t}=$(),v=W(),h=U(),o=Q({resolver:Y(ge),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=q({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const i=await v.organization.update({data:s});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,s)=>{P("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:L.organizations()}),h.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,s)=>{P("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const i=o.getValues(),p=o.control._defaultValues;o.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{o.reset(p,{keepValues:!0})}}}),r=o.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(G,{children:n.jsxs(K,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(fe,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(I,{control:o.control,name:"name",render:({field:a})=>n.jsx(V,{id:"org-name",...a,onChange:s=>{a.onChange(s),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{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:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(I,{control:o.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:s=>{const i=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(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 xe(){const e=E.c(42),{org:t}=$(),[v,h]=T.useState(!1),[o,d]=T.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{P("organization_deleted",{organization_id:t.id}),localStorage.getItem(B.lastOrgSlug())===t.slug&&localStorage.removeItem(B.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:je},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=q(c);let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=()=>h(!0),e[9]=s):s=e[9];let i;e[10]!==a.isPending?(i=n.jsx(G,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(K,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(H,{variant:"destructive",size:"sm",onClick:s,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(se,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=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]=f):f=e[15];let x;e[16]!==t.name?(x=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]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==o||e[20]!==t.name?(u=n.jsx(V,{value:o,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=o,e[20]=t.name,e[21]=u):u=e[21];let y;e[22]!==u||e[23]!==f||e[24]!==x?(y=n.jsxs(oe,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=y):y=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(re,{children:"Cancel"}),e[26]=D):D=e[26];let b;e[27]!==a?(b=()=>a.mutate(),e[27]=a,e[28]=b):b=e[28];const F=o!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==b||e[30]!==F||e[31]!==R?(S=n.jsxs(le,{children:[D,n.jsx(ce,{onClick:b,disabled:F,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=b,e[30]=F,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ue,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let _;return e[39]!==C||e[40]!==i?(_=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=_):_=e[41],_}function je(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ve(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(he,{}),n.jsx(ne,{}),n.jsx(xe,{})]})})})}),e[0]=t):t=e[0],t}function Qe(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ve,{})}),e[0]=t):t=e[0],t}export{Qe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as $,j as t,G as Q,a as te,m as W,r as G,U as B,i as D,d as ne,t as z,K as V,k as se,l as K,q as oe,a1 as re}from"./index-DHTICC_v.js";import{c as ie,a as ae,d as le,e as ce}from"./dialog-BdIjDk0G.js";import{C as J}from"./checkbox-CFdij7Ei.js";import{C as ue}from"./collection-search-B0gYtEWh.js";import{u as de}from"./use-debounced-value-C2hJqHIV.js";import{b as me,u as fe}from"./use-connection-CRsO-Bab.js";import{W as pe,u as H,S as X}from"./use-mcp-client-DAJmDOVO.js";import{b as Z}from"./Settings02-N32UBNZq.js";import{w as ge}from"./agent-icon-BRuLsBYY.js";import{a as xe}from"./authenticate-and-persist-oauth-VdmVLbtW.js";import{u as he}from"./use-mcp-tools-AjHzJbIQ.js";import{e as ye}from"./extract-connection-data-BhI39RpO.js";import{c as be}from"./use-navigate-to-agent-Dlhjy-0a.js";import{f as we}from"./github-installations-DzN1UQ4x.js";function M(s){const e=$.c(4),{size:n,className:o}=s;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=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]=u):u=e[0];let l;return e[1]!==o||e[2]!==n?(l=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:u}),e[1]=o,e[2]=n,e[3]=l):l=e[3],l}function Ne(s,e){const n=$.c(12),{org:o}=Q();let u;n[0]!==o.id?(u=pe.REGISTRY(o.id),n[0]=o.id,n[1]=u):u=n[1];const l=u;let i;n[2]!==o.id||n[3]!==o.slug||n[4]!==l?(i={connectionId:l,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=l,n[5]=i):i=n[5];const x=H(i);let m;n[6]!==s?(m={name:s},n[6]=s,n[7]=m):m=n[7];const r=e?.enabled??!0;let h;return n[8]!==x||n[9]!==m||n[10]!==r?(h={client:x,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:m,enabled:r,staleTime:3e5,select:je},n[8]=x,n[9]=m,n[10]=r,n[11]=h):h=n[11],he(h)}function je(s){return s.structuredContent?.item??null}const Ie="deco/mcp-github";function Ce(s){const{org:e}=Q(),{data:n}=te.useSession(),o=me(),u=W(),[l,i]=G.useState("idle"),[x,m]=G.useState(null),[r,h]=G.useState(null),{data:g,isLoading:a}=Ne(Ie,{enabled:s.enabled}),w=G.useRef(!1);s.enabled&&g&&!a&&!w.current&&n?.user?.id&&l==="idle"&&(w.current=!0,b());async function b(){if(!(!g||!n?.user?.id||!e))try{i("installing"),m(null);const y=ye(g,e.id,n.user.id,{remoteIndex:0});if(!y.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:I}=await o.create.mutateAsync(y);i("authenticating");const f=await xe({connectionId:I,orgId:e.id,orgSlug:e.slug,persistFallback:d=>o.update.mutateAsync({id:I,data:{connection_token:d}}).then(()=>{})});if(f.ran&&!f.ok){try{await o.delete.mutateAsync(I)}catch{}throw new Error(f.error&&f.error!=="no token received"?f.error:"No token received from GitHub")}B(u,e.id),h(y),i("ready")}catch(y){m(y instanceof Error?y.message:String(y)),i("error")}}function N(){i("idle"),m(null),h(null),w.current=!1}return s.enabled&&a&&l==="idle"?{status:"installing",error:null,connection:null,retry:N}:{status:l,error:x,connection:r,retry:N}}const F={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return F;const e=s;return Object.values(e).some(n=>typeof n!="string")?F:e}function ve(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ee(s){const e=s.metadata?.repoScope;if(!e||typeof e.installationId!="number"||!Number.isFinite(e.installationId)||!Number.isInteger(e.installationId)||e.installationId<=0||typeof e.owner!="string"||typeof e.repo!="string"||e.owner.length===0||e.repo.length===0)return null;const n=ve(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Se(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function Te(s){return(s??[]).filter(e=>Ee(e)===null)}const Y="GitHub MCP did not return refreshable repo grant metadata";function L(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function ke(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function _e(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function Ae(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:u,repo:l,githubCallTool:i,selfCallTool:x}=s,m=await i({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:u,repo:l,permissions:F}}),r=m.structuredContent;if(m.isError||!r?.token){const T=m.content?.find(v=>v.type==="text")?.text;throw new Error(T?`Failed to mint a repo-scoped GitHub token: ${T}`:"Failed to mint a repo-scoped GitHub token")}const h=L(r.refreshToken),g=L(r.tokenEndpoint),a=L(r.clientId);if(!h||!g||!a)throw new Error(Y);if(!ke(g))throw new Error(Y);const w=L(r.repository?.owner),b=L(r.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(r.repository?.owner!==void 0&&(!w||w.toLowerCase()!==u.toLowerCase()))throw new Error(N);if(r.repository?.name!==void 0&&(!b||b.toLowerCase()!==l.toLowerCase()))throw new Error(N);const y=_e(r.repository?.id),j=r.expiresAt?Date.parse(r.expiresAt):NaN,I=Number.isFinite(j)?Math.max(0,Math.floor((j-Date.now())/1e3)):null,d=(typeof r.expiresIn=="number"&&Number.isFinite(r.expiresIn)&&Number.isInteger(r.expiresIn)&&r.expiresIn>0?r.expiresIn:null)??I,C=await x({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${u}/${l}`,description:`Repo-scoped GitHub access for ${u}/${l}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{repoScope:{installationId:o,repositoryId:y,owner:u,repo:l,permissions:F,grantProvider:"github-mcp"}}}}}),p=C.structuredContent??C,S=p.item?.id??p.id;if(!S)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${S}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:r.token,refreshToken:h,expiresIn:d,scope:r.scope??null,clientId:a,tokenEndpoint:g})})).ok)throw await x({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:S}}const U=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A new GitHub issue has been opened in ${s}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A pull request was opened in ${s}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:s,name:e})=>`A pull request was closed in ${s}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function Re(s,e){const n=new Set;if(s.paramsSchema)for(const u of Object.keys(s.paramsSchema))n.add(u);if(Array.isArray(s.params))for(const u of s.params)n.add(u.name);else if(s.params&&typeof s.params=="object")for(const u of Object.keys(s.params))n.add(u);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const o={};return n.has("owner")&&(o.owner=e.owner),n.has("name")&&(o.name=e.name),n.has("repository")&&(o.repository=`${e.owner}/${e.name}`),o}async function Oe({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:u,selectedKeys:l}){const i=await s({name:"TRIGGER_LIST",arguments:{}}),x=i.structuredContent??i,m=new Map((x.triggers??[]).map(a=>[a.type,a])),r=U.filter(a=>l.has(a.key)),h=await Promise.allSettled(r.map(async a=>{const w=m.get(a.triggerType);if(!w)throw new Error(`Trigger ${a.triggerType} not exposed`);const b=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${a.nameSuffix}`,virtual_mcp_id:n,messages:a.instructions(o),active:!0}}),N=(b.structuredContent??b).id;if(!N)throw new Error(`AUTOMATION_CREATE returned no id for ${a.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:N,type:"event",connection_id:u,event_type:a.triggerType,params:Re(w,o)}})})),g=h.filter(a=>a.status==="rejected").length;return g>0&&console.error("Some GitHub automations failed to set up:",h.filter(a=>a.status==="rejected")),{total:h.length,failed:g}}function Ze(s){const e=$.c(22),{open:n,onOpenChange:o,title:u,hideAutoRespondCheckbox:l,onImportComplete:i}=s,x=u===void 0?"Import from GitHub":u,m=l===void 0?!1:l,[r,h]=G.useState(null);let g;e[0]!==x?(g=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:x})}),e[0]=x,e[1]=g):g=e[1];let a;e[2]!==r||e[3]!==x?(a=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:r?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>h(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(Z,{size:16})}),t.jsx("img",{src:r.avatarUrl,alt:r.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:r.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=r,e[3]=x,e[4]=a):a=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(D,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let b;e[6]!==o?(b=()=>o(!1),e[6]=o,e[7]=b):b=e[7];let N;e[8]!==m||e[9]!==i||e[10]!==n||e[11]!==r||e[12]!==b?(N=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(G.Suspense,{fallback:w,children:t.jsx(Ge,{open:n,onComplete:b,selectedInstallation:r,onSelectInstallation:h,hideAutoRespondCheckbox:m,onImportComplete:i})})}),e[8]=m,e[9]=i,e[10]=n,e[11]=r,e[12]=b,e[13]=N):N=e[13];let y;e[14]!==g||e[15]!==a||e[16]!==N?(y=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,a,N]}),e[14]=g,e[15]=a,e[16]=N,e[17]=y):y=e[17];let j;return e[18]!==o||e[19]!==n||e[20]!==y?(j=t.jsx(ce,{open:n,onOpenChange:o,children:y}),e[18]=o,e[19]=n,e[20]=y,e[21]=j):j=e[21],j}function Ge({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:u,onImportComplete:l}){const{org:i}=Q(),x=W(),m=be(),[r,h]=G.useState(null),[g,a]=G.useState(!0),[w,b]=G.useState(()=>new Set(U.filter(c=>c.defaultEnabled).map(c=>c.key))),N=U.filter(c=>c.defaultEnabled).map(c=>c.key),y=u?new Set(N):g?w:new Set,j=fe({slug:"mcp-github"}),I=Te(j),f=Ce({enabled:s&&I.length===0}),d=I.length===1?I[0]??null:r,C=H({connectionId:d?.id??"",orgId:i.id,orgSlug:i.slug}),p=H({connectionId:X,orgId:i.id,orgSlug:i.slug}),S=async(c,E)=>{try{const O=await C.callTool({name:"get_file_contents",arguments:{owner:c.owner,repo:c.name,path:E}});if(O.isError)return null;const P=O.content?.find(A=>A.type==="resource")?.resource?.text;if(!P)return null;try{const A=JSON.parse(P);return typeof A=="string"?A:JSON.stringify(A)}catch{return P}}catch{return null}},R=(c,E)=>{Promise.all([S(E,"AGENTS.md"),S(E,"CLAUDE.md")]).then(async([_,O])=>{const k=_??O??null;k&&(await p.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{instructions:k}}}}),B(x,i.id))}).catch(_=>{console.error("GitHub instructions fetch failed:",_)})},T=async({virtualMcpId:c,repo:E,connectionId:_,selectedKeys:O})=>{const{total:k,failed:P}=await Oe({githubCallTool:A=>C.callTool(A),selfCallTool:A=>p.callTool(A),virtualMcpId:c,repo:E,connectionId:_,selectedKeys:O});P>0&&z.warning(`Set up ${k-P}/${k} GitHub automations. Add the rest from the automations view.`)},v=ne({mutationFn:async c=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:_}=await Ae({orgSlug:i.slug,sourceConnection:d,installationId:E,owner:c.owner,repo:c.name,githubCallTool:k=>C.callTool(k),selfCallTool:k=>p.callTool(k)});let O=null;try{const k=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:c.name,description:c.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:c.owner,name:c.name,url:c.url,installationId:E,connectionId:_},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:_}]}}}),P=k.structuredContent??k,A=P.item?.id;if(!P.item||!A)throw new Error("Failed to create the imported agent");return O=A,y.size>0&&await T({virtualMcpId:A,repo:c,connectionId:_,selectedKeys:y}).catch(ee=>{console.error("Failed to set up GitHub automations:",ee),z.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:A,repo:c,connectionId:_,item:P.item}}catch(k){throw O&&await p.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:O}}).catch(()=>{}),await p.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:_,force:!0}}).catch(()=>{}),k}},onSuccess:({virtualMcpId:c,repo:E,connectionId:_,item:O})=>{if(x.setQueryData(V.collectionItem(p,i.id,"","VIRTUAL_MCP",c),{item:O}),B(x,i.id),R(c,E),l){l({virtualMcpId:c,repo:E,connectionId:_});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),m(c)},onError:c=>{z.error("Failed to import repo: "+(c instanceof Error?c.message:"Unknown error"))}});return f.status==="installing"||f.status==="authenticating"?t.jsx(q,{status:f.status,error:null,retry:f.retry}):f.status==="error"?t.jsx(q,{status:"error",error:f.error,retry:f.retry}):I.length===0&&f.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:f.retry}):I.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"})}),I.map(c=>t.jsxs("button",{type:"button",onClick:()=>h(c),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[c.icon?t.jsx("img",{src:c.icon,alt:c.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(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:c.title})]},c.id))]}):d?n?t.jsx($e,{connectionId:d.id,orgId:i.id,orgSlug:i.slug,installation:n,onSelectRepo:c=>v.mutate(c),isSaving:v.isPending,autoRespondEnabled:g,onAutoRespondChange:a,selectedAutomationKeys:w,onAutomationKeysChange:b,hideAutoRespondCheckbox:u}):t.jsx(Pe,{connectionId:d.id,orgId:i.id,orgSlug:i.slug,onSelect:o,showBackButton:I.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=$.c(31),{connectionId:n,orgId:o,orgSlug:u,onSelect:l,showBackButton:i,onBack:x}=s;let m;e[0]!==o||e[1]!==u?(m={connectionId:X,orgId:o,orgSlug:u},e[0]=o,e[1]=u,e[2]=m):m=e[2];const r=H(m);let h;e[3]!==n||e[4]!==o?(h=V.githubUserOrgs(o,n),e[3]=n,e[4]=o,e[5]=h):h=e[5];let g;e[6]!==n||e[7]!==r?(g=()=>we(p=>r.callTool(p),n),e[6]=n,e[7]=r,e[8]=g):g=e[8];let a;e[9]!==h||e[10]!==g?(a={queryKey:h,queryFn:g},e[9]=h,e[10]=g,e[11]=a):a=e[11];const w=se(a);if(w.isLoading){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(D,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=p):p=e[12],p}if(w.isError){let p;return e[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=p):p=e[13],p}const b=w.data;if(!b)return null;let N;e[14]!==x||e[15]!==i?(N=i&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:x,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Z,{size:12}),"Change connection"]})}),e[14]=x,e[15]=i,e[16]=N):N=e[16];let y;if(e[17]!==b.installations||e[18]!==l){let p;e[20]!==l?(p=S=>t.jsxs("button",{type:"button",onClick:()=>l(S),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:S.avatarUrl,alt:S.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:S.login}),S.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 →"})]},S.installationId),e[20]=l,e[21]=p):p=e[21],y=b.installations.map(p),e[17]=b.installations,e[18]=l,e[19]=y}else y=e[19];let j;e[22]!==y?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:y}),e[22]=y,e[23]=j):j=e[23];const I=b.appSlug?`https://github.com/apps/${b.appSlug}/installations/new`:"https://github.com/settings/installations";let f;e[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=f):f=e[24];let d;e[25]!==I?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",f]})}),e[25]=I,e[26]=d):d=e[26];let C;return e[27]!==d||e[28]!==N||e[29]!==j?(C=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,j,d]}),e[27]=d,e[28]=N,e[29]=j,e[30]=C):C=e[30],C}function $e(s){const e=$.c(27),{connectionId:n,orgId:o,orgSlug:u,installation:l,onSelectRepo:i,isSaving:x,autoRespondEnabled:m,onAutoRespondChange:r,selectedAutomationKeys:h,onAutomationKeysChange:g,hideAutoRespondCheckbox:a}=s,[w,b]=G.useState(""),N=de(w,300),y=G.useDeferredValue(N),j=w!==y;let I;e[0]!==j||e[1]!==w?(I=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:b,isSearching:j}),e[0]=j,e[1]=w,e[2]=I):I=e[2];const f=j?"opacity-40":"opacity-100";let d;e[3]!==f?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",f),e[3]=f,e[4]=d):d=e[4];let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(D,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=C):C=e[5];let p;e[6]!==n||e[7]!==y||e[8]!==l||e[9]!==x||e[10]!==i||e[11]!==o||e[12]!==u?(p=t.jsx(G.Suspense,{fallback:C,children:t.jsx(Le,{connectionId:n,orgId:o,orgSlug:u,installation:l,query:y,onSelectRepo:i,isSaving:x})}),e[6]=n,e[7]=y,e[8]=l,e[9]=x,e[10]=i,e[11]=o,e[12]=u,e[13]=p):p=e[13];let S;e[14]!==d||e[15]!==p?(S=t.jsx("div",{className:d,children:p}),e[14]=d,e[15]=p,e[16]=S):S=e[16];let R;e[17]!==m||e[18]!==a||e[19]!==r||e[20]!==g||e[21]!==h?(R=!a&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(J,{checked:m,onCheckedChange:v=>r(v===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),m&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:U.map(v=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(J,{checked:h.has(v.key),onCheckedChange:c=>{const E=new Set(h);c===!0?E.add(v.key):E.delete(v.key),g(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:v.label})]},v.key))})]}),e[17]=m,e[18]=a,e[19]=r,e[20]=g,e[21]=h,e[22]=R):R=e[22];let T;return e[23]!==I||e[24]!==S||e[25]!==R?(T=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[I,S,R]}),e[23]=I,e[24]=S,e[25]=R,e[26]=T):T=e[26],T}function Le(s){const e=$.c(29),{connectionId:n,orgId:o,orgSlug:u,installation:l,query:i,onSelectRepo:x,isSaving:m}=s;let r;e[0]!==n||e[1]!==o||e[2]!==u?(r={connectionId:n,orgId:o,orgSlug:u},e[0]=n,e[1]=o,e[2]=u,e[3]=r):r=e[3];const h=H(r),g=l.type==="User"?"user":"org",a=i?`${g}:${l.login} ${i} in:name`:`${g}:${l.login}`;let w;e[4]!==n||e[5]!==l.login||e[6]!==o||e[7]!==i?(w=V.githubOrgRepos(o,n,l.login,i),e[4]=n,e[5]=l.login,e[6]=o,e[7]=i,e[8]=w):w=e[8];let b;e[9]!==h||e[10]!==a?(b=async f=>{const{signal:d}=f,p=(await h.callTool({name:"search_repositories",arguments:{query:a,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!p)throw new Error("No response from search_repositories");return(JSON.parse(p).items??[]).map(He)},e[9]=h,e[10]=a,e[11]=b):b=e[11];let N;e[12]!==w||e[13]!==b?(N={queryKey:w,queryFn:b},e[12]=w,e[13]=b,e[14]=N):N=e[14];const{data:y}=oe(N);if(y.length===0){let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=f):f=e[15];let d;e[16]!==i?(d=i&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=i,e[17]=d):d=e[17];let C;return e[18]!==d?(C=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[f,d]}),e[18]=d,e[19]=C):C=e[19],C}let j;if(e[20]!==m||e[21]!==x||e[22]!==y){let f;e[24]!==m||e[25]!==x?(f=d=>t.jsxs("button",{type:"button",onClick:()=>x(d),disabled:m,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(M,{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:d.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:[d.private?t.jsx(re,{size:10}):t.jsx(ge,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=m,e[25]=x,e[26]=f):f=e[26],j=y.map(f),e[20]=m,e[21]=x,e[22]=y,e[23]=j}else j=e[23];let I;return e[27]!==j?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:j}),e[27]=j,e[28]=I):I=e[28],I}function He(s){return{name:s.name,fullName:s.full_name,owner:s.full_name.split("/")[0]??"",url:s.html_url,private:s.private,description:s.description,updatedAt:s.updated_at}}function q(s){const e=$.c(33),{status:n,error:o,retry:u}=s;if(n==="error"){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=p):p=e[0];let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=S):S=e[1];const R=o??"Something went wrong while connecting to GitHub.";let T;e[2]!==R?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[S,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R})]}),e[2]=R,e[3]=T):T=e[3];let v;e[4]!==u?(v=t.jsx("button",{type:"button",onClick:u,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]=u,e[5]=v):v=e[5];let c;return e[6]!==T||e[7]!==v?(c=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,T,v]}),e[6]=T,e[7]=v,e[8]=c):c=e[8],c}const l=n==="authenticating";let i;e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[9]=i):i=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"relative size-10",children:[i,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(D,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=x):x=e[10];const m=l?"Authenticating with GitHub":"Setting up GitHub";let r;e[11]!==m?(r=t.jsx("p",{className:"text-sm font-medium",children:m}),e[11]=m,e[12]=r):r=e[12];const h=l?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let g;e[13]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=g):g=e[14];let a;e[15]!==r||e[16]!==g?(a=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[r,g]}),e[15]=r,e[16]=g,e[17]=a):a=e[17];const w=l?"bg-muted-foreground/30":"bg-foreground animate-pulse";let b;e[18]!==w?(b=K("size-1.5 rounded-full",w),e[18]=w,e[19]=b):b=e[19];let N;e[20]!==b?(N=t.jsx("span",{className:b}),e[20]=b,e[21]=N):N=e[21];const y=l?"bg-foreground animate-pulse":"bg-muted-foreground/30";let j;e[22]!==y?(j=K("size-1.5 rounded-full",y),e[22]=y,e[23]=j):j=e[23];let I;e[24]!==j?(I=t.jsx("span",{className:j}),e[24]=j,e[25]=I):I=e[25];let f;e[26]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=f):f=e[26];let d;e[27]!==N||e[28]!==I?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,I,f]}),e[27]=N,e[28]=I,e[29]=d):d=e[29];let C;return e[30]!==d||e[31]!==a?(C=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[x,a,d]}),e[30]=d,e[31]=a,e[32]=C):C=e[32],C}export{Ze as G,M as a,Te as g,Ae as p,Ce as u};
|