decocms 3.97.5 → 3.97.6
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-BY01IebW.js → AlertCircle-fJcOtdPg.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CrNpVXJQ.js → ArrowUpRight-CrqD-eAO.js} +1 -1
- package/dist/client/assets/{CheckCircle-UPyj94ce.js → CheckCircle-MeJbRt1q.js} +1 -1
- package/dist/client/assets/{ChevronDown-DuS1gosF.js → ChevronDown-pn1meT8d.js} +1 -1
- package/dist/client/assets/{ChevronLeft-DNoBDBkQ.js → ChevronLeft-CK9mz_lA.js} +1 -1
- package/dist/client/assets/{ChevronRight-DUYBaJAA.js → ChevronRight-DkLBQXIZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-Bj5wnP8v.js → ChevronUp-D_sqWanb.js} +1 -1
- package/dist/client/assets/{DotsVertical-BoWHOZg-.js → DotsVertical-CFX5mHy_.js} +1 -1
- package/dist/client/assets/{Eye-BN8eZd3q.js → Eye-DSxffwpX.js} +1 -1
- package/dist/client/assets/{FilterLines-BcDA53T2.js → FilterLines-BfGXNoDf.js} +1 -1
- package/dist/client/assets/{Globe01-CtRTi-q3.js → Globe01-BE6-Vhn-.js} +1 -1
- package/dist/client/assets/{Globe04-DcqSH090.js → Globe04-ClAPc8QV.js} +1 -1
- package/dist/client/assets/{HardDrive-LcockCRx.js → HardDrive-C_5bQN2s.js} +1 -1
- package/dist/client/assets/{Key01-BcXniqTr.js → Key01-BEdNDv5D.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DIu4qlvA.js → LayoutLeft-xN92xt-k.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dyt9zIKA.js → LinkExternal01-DtMdLshW.js} +1 -1
- package/dist/client/assets/{Monitor01-BY0WhsQY.js → Monitor01-BxZlH4vE.js} +1 -1
- package/dist/client/assets/{Palette-D0tFYq6o.js → Palette-tvgJAmq5.js} +1 -1
- package/dist/client/assets/{Play-Ds_dyiCJ.js → Play-QNolhpYo.js} +1 -1
- package/dist/client/assets/{Plus-CXJQYPWf.js → Plus-BdYkovF2.js} +1 -1
- package/dist/client/assets/{SearchMd--1Uwo-4h.js → SearchMd-3nngg6Ks.js} +1 -1
- package/dist/client/assets/{Settings02-Qog-9BW9.js → Settings02-O2mlkc2j.js} +1 -1
- package/dist/client/assets/{Shield01-BjGAptDu.js → Shield01-D0p_z1Rh.js} +1 -1
- package/dist/client/assets/{Star01-BNPre7m8.js → Star01-CVDxujLg.js} +1 -1
- package/dist/client/assets/{Stars01-CUSSCI6Q.js → Stars01-NhcGkHTz.js} +1 -1
- package/dist/client/assets/{Stars02--YU8wF8-.js → Stars02-D1Mwhwxh.js} +1 -1
- package/dist/client/assets/{Sun-DF1tmwEc.js → Sun-BzZB8rLL.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C-d9B1Pc.js → SwitchHorizontal01-CmA6k3Gw.js} +1 -1
- package/dist/client/assets/{Tool01-Cbity1uu.js → Tool01-Ck1tGOLa.js} +1 -1
- package/dist/client/assets/{Trash01-Csom-OmK.js → Trash01-C1jDkITE.js} +1 -1
- package/dist/client/assets/{Upload01-BKLWvYK3.js → Upload01-aLxa_7qU.js} +1 -1
- package/dist/client/assets/{User01-rB66Yp8m.js → User01-l2zA0L_A.js} +1 -1
- package/dist/client/assets/{Users01-CSjiAX-B.js → Users01-CtlXU5tT.js} +1 -1
- package/dist/client/assets/{Users03-CzMI4hYk.js → Users03-BsjGrVdp.js} +1 -1
- package/dist/client/assets/{X-C23kraKx.js → X-8uKw4TRo.js} +1 -1
- package/dist/client/assets/{XCircle-DAQ6sXs1.js → XCircle-BmHlL-Zi.js} +1 -1
- package/dist/client/assets/{XClose-CD3EJbwD.js → XClose-MzbQnLCs.js} +1 -1
- package/dist/client/assets/{Zap-BKA-au81.js → Zap-BTyMjGbn.js} +1 -1
- package/dist/client/assets/{ZapSquare-JpoS_XnR.js → ZapSquare-3iu7JN55.js} +1 -1
- package/dist/client/assets/{ZoomOut-B5vLZpoX.js → ZoomOut-CYXoJJk1.js} +1 -1
- package/dist/client/assets/{access-gate-hq7UmdZv.js → access-gate-bI6nuQ5T.js} +1 -1
- package/dist/client/assets/{add-section-modal-DPGYUmmW.js → add-section-modal-BIzdQ3Jk.js} +1 -1
- package/dist/client/assets/{agent-icon-B_lvSp90.js → agent-icon-DFvaJiDY.js} +1 -1
- package/dist/client/assets/{agents-list-BuiqFvDD.js → agents-list-C3qeGqX8.js} +1 -1
- package/dist/client/assets/{ai-providers-igMP4uEw.js → ai-providers-BkFo9nQy.js} +1 -1
- package/dist/client/assets/{alert-dialog-CsikfeuV.js → alert-dialog-C6EVgeBX.js} +1 -1
- package/dist/client/assets/{alert-B6tz0cqs.js → alert-qtwSyUZJ.js} +1 -1
- package/dist/client/assets/{app-editor-DA7fDqIP.js → app-editor-BEK4yQ_A.js} +1 -1
- package/dist/client/assets/{auth-CdNUf-u6.js → auth-Cal4T12d.js} +1 -1
- package/dist/client/assets/{auth-catchall-DTkC1khj.js → auth-catchall-FB-wZz9s.js} +1 -1
- package/dist/client/assets/{auth-entry-ChKD6XAl.js → auth-entry-BdIkAdSG.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CUgDVzOC.js → auth-split-layout-BsQ4TGuC.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B-HUI4Rh.js → authenticate-and-persist-oauth-BZc7Ted8.js} +1 -1
- package/dist/client/assets/{automation-list-row-DqslLX8-.js → automation-list-row-DG7qfwQf.js} +1 -1
- package/dist/client/assets/{automation-runs-C-ImxLWq.js → automation-runs-DtNrxAp4.js} +1 -1
- package/dist/client/assets/{automations-BIUDKFSY.js → automations-BNj6PofQ.js} +1 -1
- package/dist/client/assets/{avatar-CjYG3-98.js → avatar-CwOaN9pX.js} +1 -1
- package/dist/client/assets/{badge-yqmEwWNw.js → badge-DGKSOBGC.js} +1 -1
- package/dist/client/assets/{block-document-Ddmw8MXB.js → block-document-D3IORjt-.js} +1 -1
- package/dist/client/assets/{brand-context-b43I5gSL.js → brand-context-gr2Kz8zt.js} +1 -1
- package/dist/client/assets/{buckets-dtFdBXmS.js → buckets-B2oo94iU.js} +1 -1
- package/dist/client/assets/{capability-load-error-CFrsagBh.js → capability-load-error-D4a3b5Uc.js} +1 -1
- package/dist/client/assets/{card-CZci2Ked.js → card-BT_nUMTM.js} +1 -1
- package/dist/client/assets/{category-editor-CufMmbEd.js → category-editor-BxcuFYi3.js} +1 -1
- package/dist/client/assets/{chat-context-hue9xev7.js → chat-context-COWNKjf7.js} +1 -1
- package/dist/client/assets/{checkbox-CnyL8XHl.js → checkbox-CHhzhSXJ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DEWC2vv9.js → cli-auth-success-54eeF86z.js} +1 -1
- package/dist/client/assets/{collection-detail-BmiSLLei.js → collection-detail-CqMXAIhp.js} +1 -1
- package/dist/client/assets/{collection-display-button-DA3BZFv2.js → collection-display-button-wARffpUM.js} +1 -1
- package/dist/client/assets/{collection-search-BaiviTLW.js → collection-search-BFQ4OhXe.js} +1 -1
- package/dist/client/assets/{collection-tabs-gJzAs0-U.js → collection-tabs-BAyt72oR.js} +1 -1
- package/dist/client/assets/{command-BtIUrGW9.js → command-BR9F3g1G.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-B6X46OGL.js → commerce-onboarding-BeqWQISd.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-lLRzH9Wf.js → connect-desktop-dialog-07IWkdaH.js} +1 -1
- package/dist/client/assets/{connection-card-BvZozJYf.js → connection-card-Dl--lNJe.js} +1 -1
- package/dist/client/assets/{connection-detail--FRkiCAU.js → connection-detail-AcwFFCQy.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BXpJ-39p.js → connection-form-helpers-BjNvSNQg.js} +1 -1
- package/dist/client/assets/{connections-B8tGIqm6.js → connections-DjDyltCI.js} +1 -1
- package/dist/client/assets/{context-menu-DdUP1nvw.js → context-menu-NIiceaiM.js} +1 -1
- package/dist/client/assets/{decopilot-D6Us63Iz.js → decopilot-hWRVkXzW.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cn1O82-8.js → decopilot-sse-pool-BkD5Vlqs.js} +1 -1
- package/dist/client/assets/{dialog-Djo11OZ8.js → dialog-Cyifv3G9.js} +1 -1
- package/dist/client/assets/{domain-settings-Qv_TUecy.js → domain-settings-CkXzInCJ.js} +1 -1
- package/dist/client/assets/{drawer-CGy7XhOb.js → drawer-JGISYavf.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CuiF-07J.js → dropdown-menu-BJVltTV3.js} +1 -1
- package/dist/client/assets/{empty-state-CFMrMwNK.js → empty-state-DnQZ-XhB.js} +1 -1
- package/dist/client/assets/{extract-connection-data-HZVgcUqH.js → extract-connection-data-Bq3lwCXC.js} +1 -1
- package/dist/client/assets/{file-explorer-d1r4yEtA.js → file-explorer-jRMynDw8.js} +1 -1
- package/dist/client/assets/{file-type-icon-9Eew51_j.js → file-type-icon-Dv84qEA9.js} +1 -1
- package/dist/client/assets/{files-BX2R4Hdg.js → files-r5omO6Th.js} +1 -1
- package/dist/client/assets/{form-Bws9hvDL.js → form-DWQLeODh.js} +1 -1
- package/dist/client/assets/{general-BfDLAR84.js → general-CSTYHVNl.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DgsWIyrn.js → github-repo-picker-H0oT363r.js} +1 -1
- package/dist/client/assets/{hooks-BFhhtb2P.js → hooks-DQcMNMU9.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-B_FF9twl.js → import-from-deco-dialog-Djhp-jTF.js} +1 -1
- package/dist/client/assets/{index-CM09tGUK.js → index-5WweUe2_.js} +1 -1
- package/dist/client/assets/{index-BwVMeD3q.js → index-BHn6e0Se.js} +3 -3
- package/dist/client/assets/{index-zLeBpb-e.js → index-BMT2Fr2d.js} +1 -1
- package/dist/client/assets/{index-Cyi-U3f4.js → index-Bjcx3nRG.js} +1 -1
- package/dist/client/assets/{index-CxFZHubh.js → index-BkiBNOb3.js} +25 -25
- package/dist/client/assets/{index-Cb0xFHoO.js → index-Bs46DU41.js} +1 -1
- package/dist/client/assets/{index-Bbr4phoV.js → index-CIxivSGi.js} +1 -1
- package/dist/client/assets/{index-CNHawUWP.js → index-DJINNu9L.js} +1 -1
- package/dist/client/assets/{index-C5p4XFGO.js → index-DN3DrlLQ.js} +1 -1
- package/dist/client/assets/{index-D6bagO5K.js → index-DZvELjVm.js} +1 -1
- package/dist/client/assets/{index-Bfc1Ah6s.js → index-EfvpxM9b.js} +1 -1
- package/dist/client/assets/{index-DgHQzdnZ.js → index-IIHfSSHd.js} +1 -1
- package/dist/client/assets/index-ezx837e_.js +1 -0
- package/dist/client/assets/{index-redirect-CEK3pBZ_.js → index-redirect-CdRbbveI.js} +1 -1
- package/dist/client/assets/{index-BQpSQsx-.js → index-uucvgtdd.js} +1 -1
- package/dist/client/assets/{input-C8pdmexi.js → input-B-Pb-iQx.js} +1 -1
- package/dist/client/assets/{integration-icon-BYt__tsS.js → integration-icon-BYmEZGh5.js} +1 -1
- package/dist/client/assets/{label-6fUzynqC.js → label-Dc1p-WMs.js} +1 -1
- package/dist/client/assets/{login-RzsGUcw2.js → login-hIHZKaLN.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DOYfP2o1.js → mcp-oauth-CQkaDVAB.js} +1 -1
- package/dist/client/assets/{members-C8QsS2ME.js → members-CwGKFfd8.js} +1 -1
- package/dist/client/assets/{monaco-editor-DGlh_VCI.js → monaco-editor-HPIYbtKC.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-tBQqJwnX.js → monitoring-stats-row-Cp0dQQPp.js} +1 -1
- package/dist/client/assets/{oauth-callback-C7HO5sjA.js → oauth-callback-S9pNiita.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C2ZKRasi.js → oauth-callback-ai-provider-Bn-jrGFP.js} +1 -1
- package/dist/client/assets/{onboarding-Pxz11AYs.js → onboarding-D-XkA1WF.js} +1 -1
- package/dist/client/assets/{org-install-Fk_fo4EG.js → org-install-BlQqrlG1.js} +1 -1
- package/dist/client/assets/{org-layout-BYDLh4Da.js → org-layout-DcKJCuet.js} +1 -1
- package/dist/client/assets/{organization-choice-D91Z6ihZ.js → organization-choice-xM7kJrun.js} +1 -1
- package/dist/client/assets/{page-seo-form-Dw_-ajyz.js → page-seo-form-Co-ts-e9.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DzMEj-6t.js +1 -0
- package/dist/client/assets/{popover-cxXkvARj.js → popover-4qhYIUWo.js} +1 -1
- package/dist/client/assets/{post-editor-CqZVJyys.js → post-editor-m_5Acqks.js} +1 -1
- package/dist/client/assets/{preview-dialog-C1XBzik_.js → preview-dialog-Bz9c-xiV.js} +1 -1
- package/dist/client/assets/{primitives-C8RGsHih.js → primitives-Bb10pQJV.js} +1 -1
- package/dist/client/assets/{profile-RQBuJ0-C.js → profile-BBtrBCC8.js} +1 -1
- package/dist/client/assets/project-app-view-R3dJtbKa.js +1 -0
- package/dist/client/assets/record-editor-B-hdKUxj.js +1 -0
- package/dist/client/assets/registry-B_a2vIE9.js +2 -0
- package/dist/client/assets/{registry-layout-JxXagtmN.js → registry-layout-DET4-b1_.js} +1 -1
- package/dist/client/assets/{require-capability-D8wtdjJA.js → require-capability-_0uXwGU-.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Bni9Lv8T.js → required-auth-layout-Crj-Dp7t.js} +1 -1
- package/dist/client/assets/{reset-password-CDD1X47u.js → reset-password-BUGjtZUo.js} +1 -1
- package/dist/client/assets/{roles-BmFGLWBQ.js → roles-BEf9Yg1v.js} +1 -1
- package/dist/client/assets/{save-status-Ap0tRvUu.js → save-status-DSRENc3i.js} +1 -1
- package/dist/client/assets/{scroll-area-BFIPKXPy.js → scroll-area-eBc0wf7v.js} +1 -1
- package/dist/client/assets/{search-input-DqD8geWF.js → search-input-DT_JKNy3.js} +1 -1
- package/dist/client/assets/{secrets-CUG9brF8.js → secrets-DGtylvlf.js} +1 -1
- package/dist/client/assets/{sections-editor-2XAp7iDT.js → sections-editor-D6yHRgfS.js} +1 -1
- package/dist/client/assets/{select-UKSqIIxL.js → select-BW0GS-sD.js} +1 -1
- package/dist/client/assets/{select-model-Duntt4sG.js → select-model-CB71JKeW.js} +1 -1
- package/dist/client/assets/{seo-editor-sJTA698t.js → seo-editor-C6M00UrO.js} +1 -1
- package/dist/client/assets/{settings-layout-D4PyBfZX.js → settings-layout-sk_Xs5v3.js} +1 -1
- package/dist/client/assets/{settings-section-uysJimh1.js → settings-section-prScMNzK.js} +1 -1
- package/dist/client/assets/{sheet-DaEm5-cm.js → sheet-BeyyimwJ.js} +1 -1
- package/dist/client/assets/{shell-controls-D-FZtlw4.js → shell-controls-Dl-Z1hcG.js} +1 -1
- package/dist/client/assets/{shell-layout-BU2Eo26M.js → shell-layout-DJkQm9ri.js} +1 -1
- package/dist/client/assets/{shell-route-loading-k31lp-sb.js → shell-route-loading-CwMHFQUh.js} +1 -1
- package/dist/client/assets/{sidebar-CDHrQeMJ.js → sidebar-Bs5hYMFZ.js} +1 -1
- package/dist/client/assets/{skeleton-CjN5A6XL.js → skeleton-DpFeLiG8.js} +1 -1
- package/dist/client/assets/{sortable.esm-DWhmpOCs.js → sortable.esm-D36A3isx.js} +1 -1
- package/dist/client/assets/{sso-CWuDaOKP.js → sso-BpeT1mQP.js} +1 -1
- package/dist/client/assets/{store-DMU35qQr.js → store-CaF9Mk93.js} +1 -1
- package/dist/client/assets/store-registry-q-E7flZt.js +2 -0
- package/dist/client/assets/{studio-tools-Cj1fBaXp.js → studio-tools-By-RAUnB.js} +1 -1
- package/dist/client/assets/{switch-BlhCItPG.js → switch-CnAdsV_e.js} +1 -1
- package/dist/client/assets/{table-Bt_fbenL.js → table-DFbId_dZ.js} +1 -1
- package/dist/client/assets/{tabs-DLLYyT_4.js → tabs-BXGI5o2r.js} +1 -1
- package/dist/client/assets/{task-status-DG_3CCeu.js → task-status-ClBLjafq.js} +1 -1
- package/dist/client/assets/{textarea-LTBnL6Dv.js → textarea-C0xG5lgY.js} +1 -1
- package/dist/client/assets/{toggle-group-DLR6cnlJ.js → toggle-group-DMtsh5NF.js} +1 -1
- package/dist/client/assets/{toolbar-BuAJdBWi.js → toolbar-Dz2F7jsm.js} +1 -1
- package/dist/client/assets/{tooltip-_TcC7QSJ.js → tooltip-DbXsqmjo.js} +1 -1
- package/dist/client/assets/{types-C9zbfwjF.js → types-CZk9_Z8c.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Mmhw_1Og.js → use-ai-providers-WiPZJScZ.js} +1 -1
- package/dist/client/assets/{use-automations-Cw5ubZKL.js → use-automations-CyoUprKw.js} +1 -1
- package/dist/client/assets/{use-capability-CP1V4i_3.js → use-capability-DTqJ4XUv.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BbDdy2cM.js → use-clock-tick-B2vJyztT.js} +1 -1
- package/dist/client/assets/{use-collections-DDwKLwWC.js → use-collections-ZFJu8_05.js} +1 -1
- package/dist/client/assets/{use-connection-bj-QmeCF.js → use-connection-BXbi3G-n.js} +1 -1
- package/dist/client/assets/{use-copy-TPlwZ6aA.js → use-copy-BdLLJ_fi.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CoJdf93N.js → use-create-virtual-mcp-BuUXsiAm.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D_Bc7lE0.js → use-debounced-autosave-HTy2hxZu.js} +1 -1
- package/dist/client/assets/{use-delete-connection-0kzxSS_1.js → use-delete-connection-CpC6odhp.js} +1 -1
- package/dist/client/assets/{use-file-configs-BumxkY1W.js → use-file-configs-B39Wbm4e.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B0LwAHpI.js → use-infinite-scroll-By_ChSnA.js} +1 -1
- package/dist/client/assets/{use-join-requests-BVChfrSN.js → use-join-requests-Clvetl3Y.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DjnQKDkF.js → use-mcp-client-BbksZMyI.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-7fCwwbYc.js → use-mcp-prompts-Cw3K78_o.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CbjkHt5p.js → use-mcp-tools-DRPCqs25.js} +1 -1
- package/dist/client/assets/{use-members-DPAHG5Sy.js → use-members-CMfXyasv.js} +1 -1
- package/dist/client/assets/{use-mobile-7oYhfh2a.js → use-mobile-D4nRxsIe.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C1cPyWif.js → use-navigate-to-agent-BTBF1w74.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CywDmsAy.js → use-org-auth-client-BtI7VkGK.js} +1 -1
- package/dist/client/assets/{use-org-sso-BRBxUiX-.js → use-org-sso-CAx_bgC5.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bk3e4nqx.js → use-organization-roles-Db9bHG-3.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DeAexlNB.js → use-organization-settings-BwYobfuk.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B0D0ZFPH.js → use-registry-connections-BldJ2nwB.js} +1 -1
- package/dist/client/assets/{use-secrets-COBbdB1z.js → use-secrets-CxKHovWg.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CwxWlyu5.js → use-status-sounds-CKvsYwcO.js} +1 -1
- package/dist/client/assets/{use-view-mode-DY00qIDT.js → use-view-mode-BBopJmXj.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bn261I3R.js → use-virtual-mcp-RUDrgBDG.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D-zpdPgg.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CRSha7cG.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-BZYHmjMQ.js → useSuspenseQueries-DKnOs7t9.js} +1 -1
- package/dist/client/assets/{variant-calendar-Ds28F-NA.js → variant-calendar-B3GXjQEb.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-e9BSYjzY.js → view-mode-toggle-5-CmRgcL.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-BolwlNK6.js +0 -1
- package/dist/client/assets/page-seo-sheet-CFP5LBzL.js +0 -1
- package/dist/client/assets/project-app-view-BUDCdtfR.js +0 -1
- package/dist/client/assets/record-editor-x3p3WRWl.js +0 -1
- package/dist/client/assets/registry-DUN-rzpb.js +0 -2
- package/dist/client/assets/store-registry-DE3B_JjR.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CbK39j5Y.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-HNqdvvLG.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cG as C,c as f,j as c,af as j,r as d,l as p,bg as b,cH as v,cI as h}from"./index-
|
|
1
|
+
import{cG as C,c as f,j as c,af as j,r as d,l as p,bg as b,cH as v,cI as h}from"./index-BHn6e0Se.js";import{L as N}from"./label-Dc1p-WMs.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,D as $,m as U,p as Q,n as Y,d as q,w as P,t as w,K as L,j as n,af 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-
|
|
1
|
+
import{b as M,D as $,m as U,p as Q,n as Y,d as q,w as P,t as w,K as L,j as n,af 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-BHn6e0Se.js";import{P as N}from"./index-Bjcx3nRG.js";import{u as W}from"./use-org-auth-client-BtI7VkGK.js";import{u as X}from"./use-debounced-autosave-HTy2hxZu.js";import{A as ee}from"./avatar-CwOaN9pX.js";import{I as V}from"./input-B-Pb-iQx.js";import{S as K,a as G,b as A,c as te}from"./settings-section-prScMNzK.js";import{D as ne}from"./domain-settings-CkXzInCJ.js";import{u as ae}from"./studio-tools-By-RAUnB.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-C6EVgeBX.js";import{R as me}from"./require-capability-_0uXwGU-.js";import"./sidebar-Bs5hYMFZ.js";import"./LayoutLeft-xN92xt-k.js";import"./use-mobile-D4nRxsIe.js";import"./sheet-BeyyimwJ.js";import"./X-8uKw4TRo.js";import"./tooltip-DbXsqmjo.js";import"./User01-l2zA0L_A.js";import"./card-BT_nUMTM.js";import"./ArrowUpRight-CrqD-eAO.js";import"./badge-DGKSOBGC.js";import"./select-BW0GS-sD.js";import"./ChevronUp-D_sqWanb.js";import"./ChevronDown-pn1meT8d.js";import"./use-capability-DTqJ4XUv.js";import"./access-gate-bI6nuQ5T.js";import"./capability-load-error-D4a3b5Uc.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(K,{children:n.jsxs(G,{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(K,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(G,{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};
|
package/dist/client/assets/{github-repo-picker-DgsWIyrn.js → github-repo-picker-H0oT363r.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,j as t,D as Q,a as te,m as W,r as A,a7 as B,i as F,d as ne,t as z,K as V,k as se,l as K,q as oe,ag as re}from"./index-BwVMeD3q.js";import{c as ie,d as ae,b as le,a as ce}from"./dialog-Djo11OZ8.js";import{C as J}from"./checkbox-CnyL8XHl.js";import{C as ue}from"./collection-search-BaiviTLW.js";import{b as de,u as me}from"./use-connection-bj-QmeCF.js";import{W as fe,u as H,S as X}from"./use-mcp-client-DjnQKDkF.js";import{b as Z}from"./Settings02-Qog-9BW9.js";import{v as pe}from"./agent-icon-B_lvSp90.js";import{a as ge}from"./authenticate-and-persist-oauth-B-HUI4Rh.js";import{u as xe}from"./use-mcp-tools-CbjkHt5p.js";import{e as he}from"./extract-connection-data-HZVgcUqH.js";import{m as be}from"./use-navigate-to-agent-C1cPyWif.js";function U(s){const e=L.c(4),{size:n,className:o}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[0];let a;return e[1]!==o||e[2]!==n?(a=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:c}),e[1]=o,e[2]=n,e[3]=a):a=e[3],a}function ye(s,e){const n=L.c(12),{org:o}=Q();let c;n[0]!==o.id?(c=fe.REGISTRY(o.id),n[0]=o.id,n[1]=c):c=n[1];const a=c;let r;n[2]!==o.id||n[3]!==o.slug||n[4]!==a?(r={connectionId:a,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=a,n[5]=r):r=n[5];const m=H(r);let f;n[6]!==s?(f={name:s},n[6]=s,n[7]=f):f=n[7];const i=e?.enabled??!0;let h;return n[8]!==m||n[9]!==f||n[10]!==i?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:i,staleTime:3e5,select:we},n[8]=m,n[9]=f,n[10]=i,n[11]=h):h=n[11],xe(h)}function we(s){return s.structuredContent?.item??null}const Ne="deco/mcp-github";function Ie(s){const{org:e}=Q(),{data:n}=te.useSession(),o=de(),c=W(),[a,r]=A.useState("idle"),[m,f]=A.useState(null),[i,h]=A.useState(null),{data:x,isLoading:l}=ye(Ne,{enabled:s.enabled}),w=A.useRef(!1);s.enabled&&x&&!l&&!w.current&&n?.user?.id&&a==="idle"&&(w.current=!0,y());async function y(){if(!(!x||!n?.user?.id||!e))try{r("installing"),f(null);const b=he(x,e.id,n.user.id,{remoteIndex:0});if(!b.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:S}=await o.create.mutateAsync(b);r("authenticating");const p=await ge({connectionId:S,orgId:e.id,orgSlug:e.slug,persistFallback:d=>o.update.mutateAsync({id:S,data:{connection_token:d}}).then(()=>{})});if(p.ran&&!p.ok){try{await o.delete.mutateAsync(S)}catch{}throw new Error(p.error&&p.error!=="no token received"?p.error:"No token received from GitHub")}B(c,e.id),h(b),r("ready")}catch(b){f(b instanceof Error?b.message:String(b)),r("error")}}function N(){r("idle"),f(null),h(null),w.current=!1}return s.enabled&&l&&a==="idle"?{status:"installing",error:null,connection:null,retry:N}:{status:a,error:m,connection:i,retry:N}}const M={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return M;const e=s;return Object.values(e).some(n=>typeof n!="string")?M:e}function je(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ce(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=je(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 ve(s){return(s??[]).filter(e=>Ce(e)===null)}async function Ee(s,e){const o=(await s({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:e}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(o)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function We(s,e){const n=e.toLowerCase();return s.find(o=>o.login.toLowerCase()===n)}const Y="GitHub MCP did not return refreshable repo grant metadata";function $(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function Te(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 ke(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:c,repo:a,githubCallTool:r,selfCallTool:m}=s,f=await r({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:c,repo:a,permissions:M}}),i=f.structuredContent;if(f.isError||!i?.token){const T=f.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=$(i.refreshToken),x=$(i.tokenEndpoint),l=$(i.clientId);if(!h||!x||!l)throw new Error(Y);if(!Te(x))throw new Error(Y);const w=$(i.repository?.owner),y=$(i.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==c.toLowerCase()))throw new Error(N);if(i.repository?.name!==void 0&&(!y||y.toLowerCase()!==a.toLowerCase()))throw new Error(N);const b=_e(i.repository?.id),I=i.expiresAt?Date.parse(i.expiresAt):NaN,S=Number.isFinite(I)?Math.max(0,Math.floor((I-Date.now())/1e3)):null,d=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??S,j=await m({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${c}/${a}`,description:`Repo-scoped GitHub access for ${c}/${a}`,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:b,owner:c,repo:a,permissions:M,grantProvider:"github-mcp"}}}}}),g=j.structuredContent??j,C=g.item?.id??g.id;if(!C)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${C}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:d,scope:i.scope??null,clientId:l,tokenEndpoint:x})})).ok)throw await m({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:C}}function Re(s,e){const n=L.c(4),[o,c]=A.useState(s);let a,r;return n[0]!==e||n[1]!==s?(a=()=>{const m=setTimeout(()=>c(s),e);return()=>clearTimeout(m)},r=[s,e],n[0]=e,n[1]=s,n[2]=a,n[3]=r):(a=n[2],r=n[3]),A.useEffect(a,r),o}const D=[{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 Ae(s,e){const n=new Set;if(s.paramsSchema)for(const c of Object.keys(s.paramsSchema))n.add(c);if(Array.isArray(s.params))for(const c of s.params)n.add(c.name);else if(s.params&&typeof s.params=="object")for(const c of Object.keys(s.params))n.add(c);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:c,selectedKeys:a}){const r=await s({name:"TRIGGER_LIST",arguments:{}}),m=r.structuredContent??r,f=new Map((m.triggers??[]).map(l=>[l.type,l])),i=D.filter(l=>a.has(l.key)),h=await Promise.allSettled(i.map(async l=>{const w=f.get(l.triggerType);if(!w)throw new Error(`Trigger ${l.triggerType} not exposed`);const y=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${l.nameSuffix}`,virtual_mcp_id:n,messages:l.instructions(o),active:!0}}),N=(y.structuredContent??y).id;if(!N)throw new Error(`AUTOMATION_CREATE returned no id for ${l.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:N,type:"event",connection_id:c,event_type:l.triggerType,params:Ae(w,o)}})})),x=h.filter(l=>l.status==="rejected").length;return x>0&&console.error("Some GitHub automations failed to set up:",h.filter(l=>l.status==="rejected")),{total:h.length,failed:x}}function Xe(s){const e=L.c(22),{open:n,onOpenChange:o,title:c,hideAutoRespondCheckbox:a,onImportComplete:r}=s,m=c===void 0?"Import from GitHub":c,f=a===void 0?!1:a,[i,h]=A.useState(null);let x;e[0]!==m?(x=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:m})}),e[0]=m,e[1]=x):x=e[1];let l;e[2]!==i||e[3]!==m?(l=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:i?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:i.avatarUrl,alt:i.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(U,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:m})]})}),e[2]=i,e[3]=m,e[4]=l):l=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(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let y;e[6]!==o?(y=()=>o(!1),e[6]=o,e[7]=y):y=e[7];let N;e[8]!==f||e[9]!==r||e[10]!==n||e[11]!==i||e[12]!==y?(N=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(A.Suspense,{fallback:w,children:t.jsx(Ge,{open:n,onComplete:y,selectedInstallation:i,onSelectInstallation:h,hideAutoRespondCheckbox:f,onImportComplete:r})})}),e[8]=f,e[9]=r,e[10]=n,e[11]=i,e[12]=y,e[13]=N):N=e[13];let b;e[14]!==x||e[15]!==l||e[16]!==N?(b=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[x,l,N]}),e[14]=x,e[15]=l,e[16]=N,e[17]=b):b=e[17];let I;return e[18]!==o||e[19]!==n||e[20]!==b?(I=t.jsx(ce,{open:n,onOpenChange:o,children:b}),e[18]=o,e[19]=n,e[20]=b,e[21]=I):I=e[21],I}function Ge({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:c,onImportComplete:a}){const{org:r}=Q(),m=W(),f=be(),[i,h]=A.useState(null),[x,l]=A.useState(!0),[w,y]=A.useState(()=>new Set(D.filter(u=>u.defaultEnabled).map(u=>u.key))),N=D.filter(u=>u.defaultEnabled).map(u=>u.key),b=c?new Set(N):x?w:new Set,I=me({slug:"mcp-github"}),S=ve(I),p=Ie({enabled:s&&S.length===0}),d=S.length===1?S[0]??null:i,j=H({connectionId:d?.id??"",orgId:r.id,orgSlug:r.slug}),g=H({connectionId:X,orgId:r.id,orgSlug:r.slug}),C=async(u,E)=>{try{const G=await j.callTool({name:"get_file_contents",arguments:{owner:u.owner,repo:u.name,path:E}});if(G.isError)return null;const P=G.content?.find(R=>R.type==="resource")?.resource?.text;if(!P)return null;try{const R=JSON.parse(P);return typeof R=="string"?R:JSON.stringify(R)}catch{return P}}catch{return null}},O=(u,E)=>{Promise.all([C(E,"AGENTS.md"),C(E,"CLAUDE.md")]).then(async([k,G])=>{const _=k??G??null;_&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:u,data:{metadata:{instructions:_}}}}),B(m,r.id))}).catch(k=>{console.error("GitHub instructions fetch failed:",k)})},T=async({virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G})=>{const{total:_,failed:P}=await Oe({githubCallTool:R=>j.callTool(R),selfCallTool:R=>g.callTool(R),virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G});P>0&&z.warning(`Set up ${_-P}/${_} GitHub automations. Add the rest from the automations view.`)},v=ne({mutationFn:async u=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:k}=await ke({orgSlug:r.slug,sourceConnection:d,installationId:E,owner:u.owner,repo:u.name,githubCallTool:_=>j.callTool(_),selfCallTool:_=>g.callTool(_)});let G=null;try{const _=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:u.name,description:u.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:u.owner,name:u.name,url:u.url,installationId:E,connectionId:k},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:k}]}}}),P=_.structuredContent??_,R=P.item?.id;if(!P.item||!R)throw new Error("Failed to create the imported agent");return G=R,b.size>0&&await T({virtualMcpId:R,repo:u,connectionId:k,selectedKeys:b}).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:R,repo:u,connectionId:k,item:P.item}}catch(_){throw G&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:G}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),_}},onSuccess:({virtualMcpId:u,repo:E,connectionId:k,item:G})=>{if(m.setQueryData(V.collectionItem(g,r.id,"","VIRTUAL_MCP",u),{item:G}),B(m,r.id),O(u,E),a){a({virtualMcpId:u,repo:E,connectionId:k});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),f(u)},onError:u=>{z.error("Failed to import repo: "+(u instanceof Error?u.message:"Unknown error"))}});return p.status==="installing"||p.status==="authenticating"?t.jsx(q,{status:p.status,error:null,retry:p.retry}):p.status==="error"?t.jsx(q,{status:"error",error:p.error,retry:p.retry}):S.length===0&&p.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:p.retry}):S.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"})}),S.map(u=>t.jsxs("button",{type:"button",onClick:()=>h(u),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[u.icon?t.jsx("img",{src:u.icon,alt:u.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(U,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:u.title})]},u.id))]}):d?n?t.jsx(Le,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:u=>v.mutate(u),isSaving:v.isPending,autoRespondEnabled:x,onAutoRespondChange:l,selectedAutomationKeys:w,onAutomationKeysChange:y,hideAutoRespondCheckbox:c}):t.jsx(Pe,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,onSelect:o,showBackButton:S.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=L.c(31),{connectionId:n,orgId:o,orgSlug:c,onSelect:a,showBackButton:r,onBack:m}=s;let f;e[0]!==o||e[1]!==c?(f={connectionId:X,orgId:o,orgSlug:c},e[0]=o,e[1]=c,e[2]=f):f=e[2];const i=H(f);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 x;e[6]!==n||e[7]!==i?(x=()=>Ee(g=>i.callTool(g),n),e[6]=n,e[7]=i,e[8]=x):x=e[8];let l;e[9]!==h||e[10]!==x?(l={queryKey:h,queryFn:x},e[9]=h,e[10]=x,e[11]=l):l=e[11];const w=se(l);if(w.isLoading){let g;return e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=g):g=e[12],g}if(w.isError){let g;return e[13]===Symbol.for("react.memo_cache_sentinel")?(g=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]=g):g=e[13],g}const y=w.data;if(!y)return null;let N;e[14]!==m||e[15]!==r?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:m,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]=m,e[15]=r,e[16]=N):N=e[16];let b;if(e[17]!==y.installations||e[18]!==a){let g;e[20]!==a?(g=C=>t.jsxs("button",{type:"button",onClick:()=>a(C),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:C.avatarUrl,alt:C.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:C.login}),C.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 →"})]},C.installationId),e[20]=a,e[21]=g):g=e[21],b=y.installations.map(g),e[17]=y.installations,e[18]=a,e[19]=b}else b=e[19];let I;e[22]!==b?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:b}),e[22]=b,e[23]=I):I=e[23];const S=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=p):p=e[24];let d;e[25]!==S?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",p]})}),e[25]=S,e[26]=d):d=e[26];let j;return e[27]!==d||e[28]!==N||e[29]!==I?(j=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,I,d]}),e[27]=d,e[28]=N,e[29]=I,e[30]=j):j=e[30],j}function Le(s){const e=L.c(27),{connectionId:n,orgId:o,orgSlug:c,installation:a,onSelectRepo:r,isSaving:m,autoRespondEnabled:f,onAutoRespondChange:i,selectedAutomationKeys:h,onAutomationKeysChange:x,hideAutoRespondCheckbox:l}=s,[w,y]=A.useState(""),N=Re(w,300),b=A.useDeferredValue(N),I=w!==b;let S;e[0]!==I||e[1]!==w?(S=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:y,isSearching:I}),e[0]=I,e[1]=w,e[2]=S):S=e[2];const p=I?"opacity-40":"opacity-100";let d;e[3]!==p?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",p),e[3]=p,e[4]=d):d=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let g;e[6]!==n||e[7]!==b||e[8]!==a||e[9]!==m||e[10]!==r||e[11]!==o||e[12]!==c?(g=t.jsx(A.Suspense,{fallback:j,children:t.jsx($e,{connectionId:n,orgId:o,orgSlug:c,installation:a,query:b,onSelectRepo:r,isSaving:m})}),e[6]=n,e[7]=b,e[8]=a,e[9]=m,e[10]=r,e[11]=o,e[12]=c,e[13]=g):g=e[13];let C;e[14]!==d||e[15]!==g?(C=t.jsx("div",{className:d,children:g}),e[14]=d,e[15]=g,e[16]=C):C=e[16];let O;e[17]!==f||e[18]!==l||e[19]!==i||e[20]!==x||e[21]!==h?(O=!l&&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:f,onCheckedChange:v=>i(v===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),f&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.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:u=>{const E=new Set(h);u===!0?E.add(v.key):E.delete(v.key),x(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:v.label})]},v.key))})]}),e[17]=f,e[18]=l,e[19]=i,e[20]=x,e[21]=h,e[22]=O):O=e[22];let T;return e[23]!==S||e[24]!==C||e[25]!==O?(T=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[S,C,O]}),e[23]=S,e[24]=C,e[25]=O,e[26]=T):T=e[26],T}function $e(s){const e=L.c(29),{connectionId:n,orgId:o,orgSlug:c,installation:a,query:r,onSelectRepo:m,isSaving:f}=s;let i;e[0]!==n||e[1]!==o||e[2]!==c?(i={connectionId:n,orgId:o,orgSlug:c},e[0]=n,e[1]=o,e[2]=c,e[3]=i):i=e[3];const h=H(i),x=a.type==="User"?"user":"org",l=r?`${x}:${a.login} ${r} in:name`:`${x}:${a.login}`;let w;e[4]!==n||e[5]!==a.login||e[6]!==o||e[7]!==r?(w=V.githubOrgRepos(o,n,a.login,r),e[4]=n,e[5]=a.login,e[6]=o,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==h||e[10]!==l?(y=async p=>{const{signal:d}=p,g=(await h.callTool({name:"search_repositories",arguments:{query:l,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!g)throw new Error("No response from search_repositories");return(JSON.parse(g).items??[]).map(He)},e[9]=h,e[10]=l,e[11]=y):y=e[11];let N;e[12]!==w||e[13]!==y?(N={queryKey:w,queryFn:y},e[12]=w,e[13]=y,e[14]=N):N=e[14];const{data:b}=oe(N);if(b.length===0){let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=p):p=e[15];let d;e[16]!==r?(d=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=r,e[17]=d):d=e[17];let j;return e[18]!==d?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[p,d]}),e[18]=d,e[19]=j):j=e[19],j}let I;if(e[20]!==f||e[21]!==m||e[22]!==b){let p;e[24]!==f||e[25]!==m?(p=d=>t.jsxs("button",{type:"button",onClick:()=>m(d),disabled:f,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(U,{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(pe,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=f,e[25]=m,e[26]=p):p=e[26],I=b.map(p),e[20]=f,e[21]=m,e[22]=b,e[23]=I}else I=e[23];let S;return e[27]!==I?(S=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:I}),e[27]=I,e[28]=S):S=e[28],S}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=L.c(33),{status:n,error:o,retry:c}=s;if(n==="error"){let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-destructive"})}),e[0]=g):g=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=C):C=e[1];const O=o??"Something went wrong while connecting to GitHub.";let T;e[2]!==O?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:O})]}),e[2]=O,e[3]=T):T=e[3];let v;e[4]!==c?(v=t.jsx("button",{type:"button",onClick:c,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]=c,e[5]=v):v=e[5];let u;return e[6]!==T||e[7]!==v?(u=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[g,T,v]}),e[6]=T,e[7]=v,e[8]=u):u=e[8],u}const a=n==="authenticating";let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-foreground"})}),e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[r,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(F,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const f=a?"Authenticating with GitHub":"Setting up GitHub";let i;e[11]!==f?(i=t.jsx("p",{className:"text-sm font-medium",children:f}),e[11]=f,e[12]=i):i=e[12];const h=a?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let x;e[13]!==h?(x=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=x):x=e[14];let l;e[15]!==i||e[16]!==x?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[i,x]}),e[15]=i,e[16]=x,e[17]=l):l=e[17];const w=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let y;e[18]!==w?(y=K("size-1.5 rounded-full",w),e[18]=w,e[19]=y):y=e[19];let N;e[20]!==y?(N=t.jsx("span",{className:y}),e[20]=y,e[21]=N):N=e[21];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let I;e[22]!==b?(I=K("size-1.5 rounded-full",b),e[22]=b,e[23]=I):I=e[23];let S;e[24]!==I?(S=t.jsx("span",{className:I}),e[24]=I,e[25]=S):S=e[25];let p;e[26]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=p):p=e[26];let d;e[27]!==N||e[28]!==S?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,S,p]}),e[27]=N,e[28]=S,e[29]=d):d=e[29];let j;return e[30]!==d||e[31]!==l?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,l,d]}),e[30]=d,e[31]=l,e[32]=j):j=e[32],j}export{Xe as G,U as a,We as b,Ee as f,ve as g,ke as p,Ie as u};
|
|
1
|
+
import{c as L,j as t,D as Q,a as te,m as W,r as A,a7 as B,i as F,d as ne,t as z,K as V,k as se,l as K,q as oe,ag as re}from"./index-BHn6e0Se.js";import{c as ie,d as ae,b as le,a as ce}from"./dialog-Cyifv3G9.js";import{C as J}from"./checkbox-CHhzhSXJ.js";import{C as ue}from"./collection-search-BFQ4OhXe.js";import{b as de,u as me}from"./use-connection-BXbi3G-n.js";import{W as fe,u as H,S as X}from"./use-mcp-client-BbksZMyI.js";import{b as Z}from"./Settings02-O2mlkc2j.js";import{v as pe}from"./agent-icon-DFvaJiDY.js";import{a as ge}from"./authenticate-and-persist-oauth-BZc7Ted8.js";import{u as xe}from"./use-mcp-tools-DRPCqs25.js";import{e as he}from"./extract-connection-data-Bq3lwCXC.js";import{m as be}from"./use-navigate-to-agent-BTBF1w74.js";function U(s){const e=L.c(4),{size:n,className:o}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[0];let a;return e[1]!==o||e[2]!==n?(a=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:c}),e[1]=o,e[2]=n,e[3]=a):a=e[3],a}function ye(s,e){const n=L.c(12),{org:o}=Q();let c;n[0]!==o.id?(c=fe.REGISTRY(o.id),n[0]=o.id,n[1]=c):c=n[1];const a=c;let r;n[2]!==o.id||n[3]!==o.slug||n[4]!==a?(r={connectionId:a,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=a,n[5]=r):r=n[5];const m=H(r);let f;n[6]!==s?(f={name:s},n[6]=s,n[7]=f):f=n[7];const i=e?.enabled??!0;let h;return n[8]!==m||n[9]!==f||n[10]!==i?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:i,staleTime:3e5,select:we},n[8]=m,n[9]=f,n[10]=i,n[11]=h):h=n[11],xe(h)}function we(s){return s.structuredContent?.item??null}const Ne="deco/mcp-github";function Ie(s){const{org:e}=Q(),{data:n}=te.useSession(),o=de(),c=W(),[a,r]=A.useState("idle"),[m,f]=A.useState(null),[i,h]=A.useState(null),{data:x,isLoading:l}=ye(Ne,{enabled:s.enabled}),w=A.useRef(!1);s.enabled&&x&&!l&&!w.current&&n?.user?.id&&a==="idle"&&(w.current=!0,y());async function y(){if(!(!x||!n?.user?.id||!e))try{r("installing"),f(null);const b=he(x,e.id,n.user.id,{remoteIndex:0});if(!b.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:S}=await o.create.mutateAsync(b);r("authenticating");const p=await ge({connectionId:S,orgId:e.id,orgSlug:e.slug,persistFallback:d=>o.update.mutateAsync({id:S,data:{connection_token:d}}).then(()=>{})});if(p.ran&&!p.ok){try{await o.delete.mutateAsync(S)}catch{}throw new Error(p.error&&p.error!=="no token received"?p.error:"No token received from GitHub")}B(c,e.id),h(b),r("ready")}catch(b){f(b instanceof Error?b.message:String(b)),r("error")}}function N(){r("idle"),f(null),h(null),w.current=!1}return s.enabled&&l&&a==="idle"?{status:"installing",error:null,connection:null,retry:N}:{status:a,error:m,connection:i,retry:N}}const M={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return M;const e=s;return Object.values(e).some(n=>typeof n!="string")?M:e}function je(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ce(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=je(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 ve(s){return(s??[]).filter(e=>Ce(e)===null)}async function Ee(s,e){const o=(await s({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:e}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(o)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function We(s,e){const n=e.toLowerCase();return s.find(o=>o.login.toLowerCase()===n)}const Y="GitHub MCP did not return refreshable repo grant metadata";function $(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function Te(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 ke(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:c,repo:a,githubCallTool:r,selfCallTool:m}=s,f=await r({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:c,repo:a,permissions:M}}),i=f.structuredContent;if(f.isError||!i?.token){const T=f.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=$(i.refreshToken),x=$(i.tokenEndpoint),l=$(i.clientId);if(!h||!x||!l)throw new Error(Y);if(!Te(x))throw new Error(Y);const w=$(i.repository?.owner),y=$(i.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==c.toLowerCase()))throw new Error(N);if(i.repository?.name!==void 0&&(!y||y.toLowerCase()!==a.toLowerCase()))throw new Error(N);const b=_e(i.repository?.id),I=i.expiresAt?Date.parse(i.expiresAt):NaN,S=Number.isFinite(I)?Math.max(0,Math.floor((I-Date.now())/1e3)):null,d=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??S,j=await m({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${c}/${a}`,description:`Repo-scoped GitHub access for ${c}/${a}`,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:b,owner:c,repo:a,permissions:M,grantProvider:"github-mcp"}}}}}),g=j.structuredContent??j,C=g.item?.id??g.id;if(!C)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${C}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:d,scope:i.scope??null,clientId:l,tokenEndpoint:x})})).ok)throw await m({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:C}}function Re(s,e){const n=L.c(4),[o,c]=A.useState(s);let a,r;return n[0]!==e||n[1]!==s?(a=()=>{const m=setTimeout(()=>c(s),e);return()=>clearTimeout(m)},r=[s,e],n[0]=e,n[1]=s,n[2]=a,n[3]=r):(a=n[2],r=n[3]),A.useEffect(a,r),o}const D=[{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 Ae(s,e){const n=new Set;if(s.paramsSchema)for(const c of Object.keys(s.paramsSchema))n.add(c);if(Array.isArray(s.params))for(const c of s.params)n.add(c.name);else if(s.params&&typeof s.params=="object")for(const c of Object.keys(s.params))n.add(c);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:c,selectedKeys:a}){const r=await s({name:"TRIGGER_LIST",arguments:{}}),m=r.structuredContent??r,f=new Map((m.triggers??[]).map(l=>[l.type,l])),i=D.filter(l=>a.has(l.key)),h=await Promise.allSettled(i.map(async l=>{const w=f.get(l.triggerType);if(!w)throw new Error(`Trigger ${l.triggerType} not exposed`);const y=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${l.nameSuffix}`,virtual_mcp_id:n,messages:l.instructions(o),active:!0}}),N=(y.structuredContent??y).id;if(!N)throw new Error(`AUTOMATION_CREATE returned no id for ${l.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:N,type:"event",connection_id:c,event_type:l.triggerType,params:Ae(w,o)}})})),x=h.filter(l=>l.status==="rejected").length;return x>0&&console.error("Some GitHub automations failed to set up:",h.filter(l=>l.status==="rejected")),{total:h.length,failed:x}}function Xe(s){const e=L.c(22),{open:n,onOpenChange:o,title:c,hideAutoRespondCheckbox:a,onImportComplete:r}=s,m=c===void 0?"Import from GitHub":c,f=a===void 0?!1:a,[i,h]=A.useState(null);let x;e[0]!==m?(x=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:m})}),e[0]=m,e[1]=x):x=e[1];let l;e[2]!==i||e[3]!==m?(l=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:i?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:i.avatarUrl,alt:i.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(U,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:m})]})}),e[2]=i,e[3]=m,e[4]=l):l=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(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let y;e[6]!==o?(y=()=>o(!1),e[6]=o,e[7]=y):y=e[7];let N;e[8]!==f||e[9]!==r||e[10]!==n||e[11]!==i||e[12]!==y?(N=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(A.Suspense,{fallback:w,children:t.jsx(Ge,{open:n,onComplete:y,selectedInstallation:i,onSelectInstallation:h,hideAutoRespondCheckbox:f,onImportComplete:r})})}),e[8]=f,e[9]=r,e[10]=n,e[11]=i,e[12]=y,e[13]=N):N=e[13];let b;e[14]!==x||e[15]!==l||e[16]!==N?(b=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[x,l,N]}),e[14]=x,e[15]=l,e[16]=N,e[17]=b):b=e[17];let I;return e[18]!==o||e[19]!==n||e[20]!==b?(I=t.jsx(ce,{open:n,onOpenChange:o,children:b}),e[18]=o,e[19]=n,e[20]=b,e[21]=I):I=e[21],I}function Ge({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:c,onImportComplete:a}){const{org:r}=Q(),m=W(),f=be(),[i,h]=A.useState(null),[x,l]=A.useState(!0),[w,y]=A.useState(()=>new Set(D.filter(u=>u.defaultEnabled).map(u=>u.key))),N=D.filter(u=>u.defaultEnabled).map(u=>u.key),b=c?new Set(N):x?w:new Set,I=me({slug:"mcp-github"}),S=ve(I),p=Ie({enabled:s&&S.length===0}),d=S.length===1?S[0]??null:i,j=H({connectionId:d?.id??"",orgId:r.id,orgSlug:r.slug}),g=H({connectionId:X,orgId:r.id,orgSlug:r.slug}),C=async(u,E)=>{try{const G=await j.callTool({name:"get_file_contents",arguments:{owner:u.owner,repo:u.name,path:E}});if(G.isError)return null;const P=G.content?.find(R=>R.type==="resource")?.resource?.text;if(!P)return null;try{const R=JSON.parse(P);return typeof R=="string"?R:JSON.stringify(R)}catch{return P}}catch{return null}},O=(u,E)=>{Promise.all([C(E,"AGENTS.md"),C(E,"CLAUDE.md")]).then(async([k,G])=>{const _=k??G??null;_&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:u,data:{metadata:{instructions:_}}}}),B(m,r.id))}).catch(k=>{console.error("GitHub instructions fetch failed:",k)})},T=async({virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G})=>{const{total:_,failed:P}=await Oe({githubCallTool:R=>j.callTool(R),selfCallTool:R=>g.callTool(R),virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G});P>0&&z.warning(`Set up ${_-P}/${_} GitHub automations. Add the rest from the automations view.`)},v=ne({mutationFn:async u=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:k}=await ke({orgSlug:r.slug,sourceConnection:d,installationId:E,owner:u.owner,repo:u.name,githubCallTool:_=>j.callTool(_),selfCallTool:_=>g.callTool(_)});let G=null;try{const _=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:u.name,description:u.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:u.owner,name:u.name,url:u.url,installationId:E,connectionId:k},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:k}]}}}),P=_.structuredContent??_,R=P.item?.id;if(!P.item||!R)throw new Error("Failed to create the imported agent");return G=R,b.size>0&&await T({virtualMcpId:R,repo:u,connectionId:k,selectedKeys:b}).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:R,repo:u,connectionId:k,item:P.item}}catch(_){throw G&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:G}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),_}},onSuccess:({virtualMcpId:u,repo:E,connectionId:k,item:G})=>{if(m.setQueryData(V.collectionItem(g,r.id,"","VIRTUAL_MCP",u),{item:G}),B(m,r.id),O(u,E),a){a({virtualMcpId:u,repo:E,connectionId:k});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),f(u)},onError:u=>{z.error("Failed to import repo: "+(u instanceof Error?u.message:"Unknown error"))}});return p.status==="installing"||p.status==="authenticating"?t.jsx(q,{status:p.status,error:null,retry:p.retry}):p.status==="error"?t.jsx(q,{status:"error",error:p.error,retry:p.retry}):S.length===0&&p.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:p.retry}):S.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"})}),S.map(u=>t.jsxs("button",{type:"button",onClick:()=>h(u),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[u.icon?t.jsx("img",{src:u.icon,alt:u.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(U,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:u.title})]},u.id))]}):d?n?t.jsx(Le,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:u=>v.mutate(u),isSaving:v.isPending,autoRespondEnabled:x,onAutoRespondChange:l,selectedAutomationKeys:w,onAutomationKeysChange:y,hideAutoRespondCheckbox:c}):t.jsx(Pe,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,onSelect:o,showBackButton:S.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=L.c(31),{connectionId:n,orgId:o,orgSlug:c,onSelect:a,showBackButton:r,onBack:m}=s;let f;e[0]!==o||e[1]!==c?(f={connectionId:X,orgId:o,orgSlug:c},e[0]=o,e[1]=c,e[2]=f):f=e[2];const i=H(f);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 x;e[6]!==n||e[7]!==i?(x=()=>Ee(g=>i.callTool(g),n),e[6]=n,e[7]=i,e[8]=x):x=e[8];let l;e[9]!==h||e[10]!==x?(l={queryKey:h,queryFn:x},e[9]=h,e[10]=x,e[11]=l):l=e[11];const w=se(l);if(w.isLoading){let g;return e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=g):g=e[12],g}if(w.isError){let g;return e[13]===Symbol.for("react.memo_cache_sentinel")?(g=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]=g):g=e[13],g}const y=w.data;if(!y)return null;let N;e[14]!==m||e[15]!==r?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:m,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]=m,e[15]=r,e[16]=N):N=e[16];let b;if(e[17]!==y.installations||e[18]!==a){let g;e[20]!==a?(g=C=>t.jsxs("button",{type:"button",onClick:()=>a(C),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:C.avatarUrl,alt:C.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:C.login}),C.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 →"})]},C.installationId),e[20]=a,e[21]=g):g=e[21],b=y.installations.map(g),e[17]=y.installations,e[18]=a,e[19]=b}else b=e[19];let I;e[22]!==b?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:b}),e[22]=b,e[23]=I):I=e[23];const S=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=p):p=e[24];let d;e[25]!==S?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",p]})}),e[25]=S,e[26]=d):d=e[26];let j;return e[27]!==d||e[28]!==N||e[29]!==I?(j=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,I,d]}),e[27]=d,e[28]=N,e[29]=I,e[30]=j):j=e[30],j}function Le(s){const e=L.c(27),{connectionId:n,orgId:o,orgSlug:c,installation:a,onSelectRepo:r,isSaving:m,autoRespondEnabled:f,onAutoRespondChange:i,selectedAutomationKeys:h,onAutomationKeysChange:x,hideAutoRespondCheckbox:l}=s,[w,y]=A.useState(""),N=Re(w,300),b=A.useDeferredValue(N),I=w!==b;let S;e[0]!==I||e[1]!==w?(S=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:y,isSearching:I}),e[0]=I,e[1]=w,e[2]=S):S=e[2];const p=I?"opacity-40":"opacity-100";let d;e[3]!==p?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",p),e[3]=p,e[4]=d):d=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let g;e[6]!==n||e[7]!==b||e[8]!==a||e[9]!==m||e[10]!==r||e[11]!==o||e[12]!==c?(g=t.jsx(A.Suspense,{fallback:j,children:t.jsx($e,{connectionId:n,orgId:o,orgSlug:c,installation:a,query:b,onSelectRepo:r,isSaving:m})}),e[6]=n,e[7]=b,e[8]=a,e[9]=m,e[10]=r,e[11]=o,e[12]=c,e[13]=g):g=e[13];let C;e[14]!==d||e[15]!==g?(C=t.jsx("div",{className:d,children:g}),e[14]=d,e[15]=g,e[16]=C):C=e[16];let O;e[17]!==f||e[18]!==l||e[19]!==i||e[20]!==x||e[21]!==h?(O=!l&&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:f,onCheckedChange:v=>i(v===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),f&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.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:u=>{const E=new Set(h);u===!0?E.add(v.key):E.delete(v.key),x(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:v.label})]},v.key))})]}),e[17]=f,e[18]=l,e[19]=i,e[20]=x,e[21]=h,e[22]=O):O=e[22];let T;return e[23]!==S||e[24]!==C||e[25]!==O?(T=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[S,C,O]}),e[23]=S,e[24]=C,e[25]=O,e[26]=T):T=e[26],T}function $e(s){const e=L.c(29),{connectionId:n,orgId:o,orgSlug:c,installation:a,query:r,onSelectRepo:m,isSaving:f}=s;let i;e[0]!==n||e[1]!==o||e[2]!==c?(i={connectionId:n,orgId:o,orgSlug:c},e[0]=n,e[1]=o,e[2]=c,e[3]=i):i=e[3];const h=H(i),x=a.type==="User"?"user":"org",l=r?`${x}:${a.login} ${r} in:name`:`${x}:${a.login}`;let w;e[4]!==n||e[5]!==a.login||e[6]!==o||e[7]!==r?(w=V.githubOrgRepos(o,n,a.login,r),e[4]=n,e[5]=a.login,e[6]=o,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==h||e[10]!==l?(y=async p=>{const{signal:d}=p,g=(await h.callTool({name:"search_repositories",arguments:{query:l,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!g)throw new Error("No response from search_repositories");return(JSON.parse(g).items??[]).map(He)},e[9]=h,e[10]=l,e[11]=y):y=e[11];let N;e[12]!==w||e[13]!==y?(N={queryKey:w,queryFn:y},e[12]=w,e[13]=y,e[14]=N):N=e[14];const{data:b}=oe(N);if(b.length===0){let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=p):p=e[15];let d;e[16]!==r?(d=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=r,e[17]=d):d=e[17];let j;return e[18]!==d?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[p,d]}),e[18]=d,e[19]=j):j=e[19],j}let I;if(e[20]!==f||e[21]!==m||e[22]!==b){let p;e[24]!==f||e[25]!==m?(p=d=>t.jsxs("button",{type:"button",onClick:()=>m(d),disabled:f,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(U,{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(pe,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=f,e[25]=m,e[26]=p):p=e[26],I=b.map(p),e[20]=f,e[21]=m,e[22]=b,e[23]=I}else I=e[23];let S;return e[27]!==I?(S=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:I}),e[27]=I,e[28]=S):S=e[28],S}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=L.c(33),{status:n,error:o,retry:c}=s;if(n==="error"){let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-destructive"})}),e[0]=g):g=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=C):C=e[1];const O=o??"Something went wrong while connecting to GitHub.";let T;e[2]!==O?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:O})]}),e[2]=O,e[3]=T):T=e[3];let v;e[4]!==c?(v=t.jsx("button",{type:"button",onClick:c,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]=c,e[5]=v):v=e[5];let u;return e[6]!==T||e[7]!==v?(u=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[g,T,v]}),e[6]=T,e[7]=v,e[8]=u):u=e[8],u}const a=n==="authenticating";let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-foreground"})}),e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[r,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(F,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const f=a?"Authenticating with GitHub":"Setting up GitHub";let i;e[11]!==f?(i=t.jsx("p",{className:"text-sm font-medium",children:f}),e[11]=f,e[12]=i):i=e[12];const h=a?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let x;e[13]!==h?(x=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=x):x=e[14];let l;e[15]!==i||e[16]!==x?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[i,x]}),e[15]=i,e[16]=x,e[17]=l):l=e[17];const w=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let y;e[18]!==w?(y=K("size-1.5 rounded-full",w),e[18]=w,e[19]=y):y=e[19];let N;e[20]!==y?(N=t.jsx("span",{className:y}),e[20]=y,e[21]=N):N=e[21];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let I;e[22]!==b?(I=K("size-1.5 rounded-full",b),e[22]=b,e[23]=I):I=e[23];let S;e[24]!==I?(S=t.jsx("span",{className:I}),e[24]=I,e[25]=S):S=e[25];let p;e[26]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=p):p=e[26];let d;e[27]!==N||e[28]!==S?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,S,p]}),e[27]=N,e[28]=S,e[29]=d):d=e[29];let j;return e[30]!==d||e[31]!==l?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,l,d]}),e[30]=d,e[31]=l,e[32]=j):j=e[32],j}export{Xe as G,U as a,We as b,Ee as f,ve as g,ke as p,Ie as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{L as _t,cw as St,cx as Et,bl as C,s as c,cy as ue,br as Ve,by as It,bk as Tt,al as wt,aG as O,aF as Y,aD as ne,o as S,bm as f,b7 as B,cz as At,cA as E,aE as Mt,t as ge,r as J,c as Ee,D as Ot,j as Ct}from"./index-
|
|
1
|
+
import{L as _t,cw as St,cx as Et,bl as C,s as c,cy as ue,br as Ve,by as It,bk as Tt,al as wt,aG as O,aF as Y,aD as ne,o as S,bm as f,b7 as B,cz as At,cA as E,aE as Mt,t as ge,r as J,c as Ee,D as Ot,j as Ct}from"./index-BHn6e0Se.js";import{S as Rt,u as Nt}from"./use-mcp-client-BbksZMyI.js";import{d as xt,D as Pt}from"./decopilot-sse-pool-BkD5Vlqs.js";import{d as Dt}from"./delay-CnY5UFtP.js";import{e as Lt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class de extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof de))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}de.create=t=>new de(t);var Me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Me||(Me={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));const kt=1e4,Yr="true";function pe(t,e){return _t.chatAutosend(t,e)}function jt(t){return t==="pending"||t==="sending"}function Zt(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return!e||typeof e!="object"||typeof e.createdAt!="number"||typeof e.message!="object"||!jt(e.status)?null:e}function Wr(t,e,a,r,s=Date.now()){const o={message:r,createdAt:s,status:"pending"};return t.setItem(pe(e,a),JSON.stringify(o)),o}function $t(t,e,a){const r=pe(e,a),s=Zt(t.getItem(r));return s||(t.removeItem(r),null)}function Hr(t,e,a,r=Date.now()){const s=pe(e,a),o=$t(t,e,a);return!o||o.status!=="pending"?null:r-o.createdAt>=kt?(t.removeItem(s),null):(t.setItem(s,JSON.stringify({...o,status:"sending"})),{message:o.message,createdAt:o.createdAt})}function qr(t,e,a){t.removeItem(pe(e,a))}var ze="vercel.ai.error",Ut=Symbol.for(ze),Oe,Ce,j=class Je extends(Ce=Error,Oe=Ut,Ce){constructor({name:e,message:a,cause:r}){super(a),this[Oe]=!0,this.name=e,this.cause=r}static isInstance(e){return Je.hasMarker(e,ze)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var We="AI_InvalidArgumentError",He=`vercel.ai.error.${We}`,Bt=Symbol.for(He),Re,Ne,Ft=class extends(Ne=j,Re=Bt,Ne){constructor({message:t,cause:e,argument:a}){super({name:We,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return j.hasMarker(t,He)}},qe="AI_JSONParseError",Ge=`vercel.ai.error.${qe}`,Vt=Symbol.for(Ge),xe,Pe,De=class extends(Pe=j,xe=Vt,Pe){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${Ye(e)}`,cause:e}),this[xe]=!0,this.text=t}static isInstance(t){return j.hasMarker(t,Ge)}},Xe="AI_TypeValidationError",Qe=`vercel.ai.error.${Xe}`,zt=Symbol.for(Qe),Le,ke,X=class ve extends(ke=j,Le=zt,ke){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Xe,message:`${s}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${Ye(a)}`,cause:a}),this[Le]=!0,this.value=e,this.context=r}static isInstance(e){return j.hasMarker(e,Qe)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},oe=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Ft({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};oe();var Jt=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Yt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function je(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Jt.test(t)===!1&&Yt.test(t)===!1?e:Wt(e)}function Wt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function Ht(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return je(t)}try{return je(t)}finally{Error.stackTraceLimit=e}}function Ie(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Ie(t)}var qt=Symbol("Let zodToJsonSchema decide on which parser to use"),Ze={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Gt=t=>typeof t=="string"?{...Ze,name:t}:{...Ze,...t};function N(){return{}}function Xt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Qt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Kt(){return{type:"boolean"}}function Ke(t,e){return b(t.type._def,e)}var ea=(t,e)=>b(t.innerType._def,e);function et(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>et(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return ta(t)}}var ta=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function aa(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function ra(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function sa(t){return{type:"string",enum:Array.from(t.values)}}var na=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function oa(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(na(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function ia(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function tt(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":M(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":M(a,r.regex,r.message,e);break;case"cuid":M(a,P.cuid,r.message,e);break;case"cuid2":M(a,P.cuid2,r.message,e);break;case"startsWith":M(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":M(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{M(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":M(a,P.base64url,r.message,e);break;case"jwt":M(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&M(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&M(a,P.ipv6Cidr,r.message,e);break}case"emoji":M(a,P.emoji(),r.message,e);break;case"ulid":{M(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{M(a,P.base64,r.message,e);break}}break}case"nanoid":M(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?ua(t):t}var la=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ua(t){let e="";for(let a=0;a<t.length;a++)la.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function M(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:$e(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=$e(e,r)}function $e(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as oe,D as se,m as ie,a as re,r as A,k as ae,K as R,d as le,w as k,t as K,j as t,B as F,l as ce}from"./index-
|
|
1
|
+
import{c as oe,D as se,m as ie,a as re,r as A,k as ae,K as R,d as le,w as k,t as K,j as t,B as F,l as ce}from"./index-BHn6e0Se.js";import{b as de}from"./use-virtual-mcp-RUDrgBDG.js";import{m as Z}from"./use-navigate-to-agent-BTBF1w74.js";import{u as ue}from"./use-connection-BXbi3G-n.js";import{u as Y,S as me}from"./use-mcp-client-BbksZMyI.js";import{g as pe,u as he,f as ge,b as fe,p as Ce,a as xe}from"./github-repo-picker-H0oT363r.js";import{a as be,b as we,c as ye,d as je,D as Ie}from"./dialog-Cyifv3G9.js";import{b as Se}from"./Settings02-O2mlkc2j.js";import{C as ve}from"./collection-search-BFQ4OhXe.js";const Ee=`<svg width="74" height="84" viewBox="0 0 74 84" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M63.4462 15.3005C63.1414 15.2764 57.2333 15.1845 57.2333 15.1845C57.2333 15.1845 52.2906 10.3849 51.8019 9.89426C51.6127 9.71981 51.3729 9.60981 51.1172 9.58008V83.0253L73.2664 77.5175C73.2664 77.5175 64.2277 16.3953 64.1696 15.9772C64.1417 15.7997 64.055 15.6366 63.9235 15.5139C63.7919 15.3913 63.6255 15.3162 63.4462 15.3005Z" fill="#171717"/>
|
|
3
3
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M32.748 0.00356357C34.8334 -0.0568526 36.5759 0.651298 37.9307 2.10122C38.0276 2.20613 38.1209 2.31463 38.2109 2.42544L38.2354 2.42349C38.4434 2.40657 38.6494 2.38638 38.8574 2.38638H38.8672C41.9831 2.3913 44.5571 4.16796 46.3184 7.527C46.8023 8.4621 47.2004 9.43976 47.5068 10.4469L49.9883 9.67837C50.3609 9.56961 51.315 9.42163 51.8037 9.90981L51.9922 82.3883L51.1162 83.0387L0 74.1979C0.0195597 74.0466 6.09952 27.0238 6.3291 25.3629C6.63636 23.1661 6.70922 23.0933 9.03906 22.361L16.957 19.9079C17.4531 16.377 19.1884 11.8165 21.4746 8.18423C24.7237 3.02487 28.7273 0.119714 32.748 0.00356357ZM38.8408 26.7077C38.8133 26.694 36.5926 25.6009 32.2842 25.8747C21.032 26.5853 15.9341 34.4515 16.4229 42.2213C17.0059 51.4485 26.2283 51.1199 26.584 56.734C26.6686 58.0922 25.8271 60.0114 23.4658 60.1588C19.8562 60.3883 15.3438 56.9831 15.3438 56.9831L13.6191 64.3249C13.6191 64.3249 18.1021 69.1296 26.2432 68.6149C33.027 68.1895 37.7351 62.759 37.2344 54.8249C36.5981 44.7397 25.2729 43.7966 25.002 39.4948C24.9512 38.7038 25.0055 35.556 29.9932 35.2418C33.3786 35.0279 36.2354 36.3195 36.2666 36.3336L38.8408 26.7077ZM32.8262 2.6813C26.6181 2.86014 21.2028 12.5587 19.8213 19.0211L26.8311 16.8512C27.6101 12.7476 29.5648 8.48928 32.1221 5.74868C33.0162 4.76667 34.0719 3.94401 35.2432 3.31704H35.2451C34.5654 2.87005 33.7695 2.66203 32.8262 2.6813ZM36.9775 5.46548C35.7921 5.95366 34.7952 6.80972 34.0791 7.57583C32.1608 9.63716 30.5951 12.7807 29.7725 15.9391L38.3057 13.2956C38.3322 11.0721 38.0904 7.7854 36.9775 5.46548ZM39.7568 5.14907C40.7052 7.59721 40.9505 10.4321 40.9795 12.4694L44.9473 11.2389C44.3133 9.17981 42.8075 5.72907 39.7568 5.14907Z" fill="#393939"/>
|
|
4
4
|
</svg>`,Ne=`data:image/svg+xml,${encodeURIComponent(Ee)}`,Ve={title:"New Website",description:"Website cloned from a public template",url:"https://github.com/decocms/webapp-template",owner:"decocms",name:"webapp-template"},Ue={title:"Shopify Headless Store",description:"Shopify Headless Store cloned from a public template",url:"https://github.com/Shopify/hydrogen-demo-store",owner:"Shopify",name:"hydrogen-demo-store",icon:Ne};function ze(){const n=oe.c(6),s=de(),i=Z();let o;n[0]!==s.create||n[1]!==i?(o=async d=>{const c=await s.create.mutateAsync({title:d.title,description:d.description,icon:d.icon??null,status:"active",pinned:!1,connections:[],metadata:{githubRepo:{url:d.url,owner:d.owner,name:d.name},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}});return c.id&&i(c.id),c},n[0]=s.create,n[1]=i,n[2]=o):o=n[2];const u=o;let m;return n[3]!==s.create.isPending||n[4]!==u?(m={createFromTemplate:u,isCreating:s.create.isPending},n[3]=s.create.isPending,n[4]=u,n[5]=m):m=n[5],m}const Le="deco-sites";function Te(n){if(!n||typeof n!="object")return null;const s=n.github;if(!s||typeof s!="object")return null;const i=s.owner,o=s.repo;return typeof i!="string"||typeof o!="string"||i.length===0||o.length===0?null:{owner:i,repo:o}}function _e(n,s){const i=s?Te(s):null,o=i?.owner??Le,u=i?.repo??n;return{owner:o,name:u,url:`https://github.com/${o}/${u}`}}function Ge(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Oe(n){const s=await fetch(`/api/${n}/deco-sites`);if(!s.ok){const i=await s.json().catch(()=>({}));throw new Error(i.error??`Failed to load sites (${s.status})`)}return s.json()}function Be({open:n,onOpenChange:s,onBack:i}){const{org:o}=se(),u=Z(),m=ie(),{data:d}=re.useSession(),[c,$]=A.useState(null),[q,V]=A.useState(null),[y,N]=A.useState(""),h=Y({connectionId:me,orgId:o.id,orgSlug:o.slug}),Q=ue({slug:"mcp-github"}),f=pe(Q),r=he({enabled:n&&f.length===0}),C=f.length===1?f[0]??null:q,j=f.length>1&&!C,W=Y({connectionId:C?.id??"",orgId:o.id,orgSlug:o.slug}),x=n&&f.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:J,isLoading:I,error:X}=ae({queryKey:R.decoSites(d?.user?.email),queryFn:()=>Oe(o.slug),enabled:n&&!!d?.user?.email,staleTime:6e4,retry:!1}),S=J?.sites??[],L=e=>{e||($(null),V(null),N("")),s(e)},T=S.filter(e=>e.name.toLowerCase().includes(y.toLowerCase())||(e.domains?.[0]?.domain?.toLowerCase().includes(y.toLowerCase())??!1)),ee=!c||T.some(e=>e.name===c),v=le({mutationFn:async e=>{if(!C)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");k("deco_site_import_started",{site_name:e});const{installations:p,appSlug:g}=await ge(l=>h.callTool(l),C.id),b=S.find(l=>l.name===e);if(!b)throw new Error("Selected site is no longer available");const a=_e(e,b.metadata),_=fe(p,a.owner);if(!_){const l=g?`https://github.com/apps/${g}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${a.owner}" organization to import this site. ${l}`)}let G=null,O=null,D=null;const te=async()=>{D&&await h.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:D}}).catch(()=>{}),O&&await h.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:O,force:!0}}).catch(()=>{}),G&&await h.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:G,force:!0}}).catch(()=>{})};try{const l=await fetch(`/api/${o.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:e})}),M=await l.json().catch(()=>({}));if(!l.ok)throw new Error(M.error??`Failed to create connection (${l.status})`);const w=M.connId;if(!w)throw new Error("Server did not return a connection ID");G=w;const{childConnectionId:H}=await Ce({orgSlug:o.slug,sourceConnection:C,installationId:_.installationId,owner:a.owner,repo:a.name,githubCallTool:P=>W.callTool(P),selfCallTool:P=>h.callTool(P)});O=H;const U=M.icon??null,z=Ge(e),ne=e.toLowerCase(),B=await h.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:e,description:"Imported from deco.cx",pinned:!1,icon:U??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:ne,githubRepo:{owner:a.owner,name:a.name,url:a.url,installationId:_.installationId,connectionId:H},ui:{banner:null,bannerColor:"#22C55E",icon:U,themeColor:"#22C55E",slug:z,pinnedViews:[{connectionId:w,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:w,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:w},{connection_id:H}]}}}),E=B.structuredContent??B;if(!E.item?.id)throw new Error("Failed to create the imported agent");return D=E.item.id,{slug:z,virtualMcpId:E.item.id,connId:w,item:E.item}}catch(l){throw await te(),l}},onSuccess:({slug:e,virtualMcpId:p,item:g})=>{k("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:e}),m.setQueryData(R.collectionItem(h,o.id,"","VIRTUAL_MCP",p),{item:g}),m.invalidateQueries({predicate:b=>{const a=b.queryKey;return a[1]===o.id&&a[3]==="collection"&&a[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:R.projects(o.id)}),K.success(`Imported ${e} from deco.cx`),L(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),u(p)},onError:e=>{k("deco_site_import_failed",{error:e instanceof Error?e.message:"Unknown error"}),K.error("Import failed: "+(e instanceof Error?e.message:"Unknown error"))}});return t.jsx(be,{open:n,onOpenChange:L,children:t.jsxs(we,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[t.jsx(ye,{className:"sr-only",children:t.jsx(je,{children:"Import from deco.cx"})}),t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&t.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Se,{size:18})}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),t.jsx("div",{children:t.jsx(ve,{value:y,onChange:N,placeholder:"Search sites...",onKeyDown:e=>{e.key==="Escape"&&N("")}})}),t.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&t.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[t.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),t.jsx(F,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),x&&r.status!=="error"&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),j&&!x&&r.status!=="error"&&t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-8 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),f.map(e=>t.jsxs("button",{type:"button",onClick:()=>V(e),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[e.icon?t.jsx("img",{src:e.icon,alt:e.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(xe,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:e.title})]},e.id))]}),I&&!x&&r.status!=="error"&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!I&&!x&&!j&&r.status!=="error"&&!X&&S.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!I&&!x&&!j&&r.status!=="error"&&S.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[T.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",y,"”"]}),T.map(e=>{const p=e.domains?.find(b=>b.production)?.domain??e.domains?.[0]?.domain,g=c===e.name;return t.jsxs("button",{type:"button",onClick:()=>$(e.name),className:ce("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:e.thumb_url?t.jsx("img",{src:e.thumb_url,alt:e.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:e.name}),p&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},e.name)})]})]}),t.jsxs(Ie,{className:"px-8 py-5 border-t border-border",children:[t.jsx(F,{variant:"outline",onClick:()=>L(!1),disabled:v.isPending,children:"Cancel"}),t.jsx(F,{disabled:!c||!ee||v.isPending||I||x||j||!C||r.status==="error",onClick:()=>c&&v.mutate(c),children:v.isPending?"Importing...":"Import"})]})]})})}export{Ue as H,Be as I,Ne as S,Ve as W,ze as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,D as Fe,m as Je,t as W,b as et,u as tt,E as Te,ae as Tt}from"./index-
|
|
1
|
+
import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,D as Fe,m as Je,t as W,b as et,u as tt,E as Te,ae as Tt}from"./index-BHn6e0Se.js";import{i as zt}from"./ChevronRight-DkLBQXIZ.js";import{s as st}from"./Eye-DSxffwpX.js";import{n as Pt,i as nt}from"./Globe01-BE6-Vhn-.js";import{b as lt,e as Ft,f as Ot,a as Et}from"./ZoomOut-CYXoJJk1.js";import{a as pe}from"./Palette-tvgJAmq5.js";import{s as At}from"./Plus-BdYkovF2.js";import{t as Mt}from"./Stars01-NhcGkHTz.js";import{i as xe}from"./Upload01-aLxa_7qU.js";import{i as Oe}from"./Zap-BTyMjGbn.js";import{u as it}from"./use-mobile-D4nRxsIe.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-C6EVgeBX.js";import{b as Ee,a as Ae,d as Me,f as rt,c as Ht,e as Vt,D as Gt}from"./dialog-Cyifv3G9.js";import{I as Ue}from"./input-B-Pb-iQx.js";import{S as K}from"./skeleton-DpFeLiG8.js";import{F as ie,d as at,M as ot}from"./file-type-icon-Dv84qEA9.js";import{a as Qt}from"./toolbar-Dz2F7jsm.js";import{r as Be,s as A,a as be,t as Wt,u as Pe,v as Le,h as Yt,L as Xt,o as Zt,p as Jt,n as es,R as Ve,q as ts,S as ss,b as ns,w as ct,x as le,y as ls}from"./preview-dialog-Bz9c-xiV.js";import{a as ve}from"./DotsVertical-CFX5mHy_.js";import{i as is}from"./Key01-BEdNDv5D.js";import{s as je}from"./Trash01-C1jDkITE.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-BJVltTV3.js";import{T as rs}from"./textarea-C0xG5lgY.js";import{t as as}from"./ChevronDown-pn1meT8d.js";import{n as os}from"./ChevronUp-D_sqWanb.js";import{i as ge}from"./X-8uKw4TRo.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-CK9mz_lA.js";import"./tooltip-DbXsqmjo.js";import"./LinkExternal01-DtMdLshW.js";import"./XClose-MzbQnLCs.js";import"./index-EfvpxM9b.js";import"./LayoutLeft-xN92xt-k.js";import"./popover-4qhYIUWo.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let P;e[23]!==N||e[24]!==D?(P=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=P):P=e[25];let $;return e[26]!==i||e[27]!==P||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,P]}),e[26]=i,e[27]=P,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
|
|
2
2
|
${e}: ${n};${s.slice(a)}`}const r=s.length>0&&!s.endsWith(`
|
|
3
3
|
`)?`
|
|
4
4
|
`:"";return`${s}${r}:root {
|