decocms 3.95.2 → 3.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cfc_3Wku.js → AlertCircle-BrEgqy4C.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-PBxrWp0K.js → ArrowUpRight-dqkJVgXk.js} +1 -1
- package/dist/client/assets/{CheckCircle-CLACSeOp.js → CheckCircle-BELFHeJ_.js} +1 -1
- package/dist/client/assets/{ChevronDown-BIUXavyh.js → ChevronDown-C02eYJK7.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CacCl2uq.js → ChevronLeft-CqiM2rGp.js} +1 -1
- package/dist/client/assets/{ChevronRight-SazNjFB-.js → ChevronRight-Rak0sf1y.js} +1 -1
- package/dist/client/assets/{ChevronUp-DCE2rwz7.js → ChevronUp-C2_z85hK.js} +1 -1
- package/dist/client/assets/{DotsVertical-BPvOYkst.js → DotsVertical-CrLTZ_rJ.js} +1 -1
- package/dist/client/assets/{Eye-C4bN22wy.js → Eye-KdT6fAXQ.js} +1 -1
- package/dist/client/assets/{FilterLines-DgxU0Paj.js → FilterLines-D9Fk5xgd.js} +1 -1
- package/dist/client/assets/{Globe01-Cjv372sM.js → Globe01-DD2vvH9Y.js} +1 -1
- package/dist/client/assets/{Globe04-CqFLhzCq.js → Globe04-Cp0kDyls.js} +1 -1
- package/dist/client/assets/{HardDrive-CsMQeHTh.js → HardDrive-CRLy3F5c.js} +1 -1
- package/dist/client/assets/{Key01-pQc06hUW.js → Key01-kiND7qp1.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CHs7Tlwc.js → LayoutLeft-BGayXB6j.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DoVSaWSv.js → LinkExternal01-CoTqsvA6.js} +1 -1
- package/dist/client/assets/{Monitor01-D_wB8ZAg.js → Monitor01-DRh9jiNA.js} +1 -1
- package/dist/client/assets/{Palette-zBeZQBjk.js → Palette-BQAv-HiM.js} +1 -1
- package/dist/client/assets/{Play-ByOHeDrv.js → Play-Ctj-JyMN.js} +1 -1
- package/dist/client/assets/{Plus-hnndMnbG.js → Plus-DQMsWKXp.js} +1 -1
- package/dist/client/assets/{SearchMd-BDkfnks7.js → SearchMd-CTdZTSxj.js} +1 -1
- package/dist/client/assets/{Settings02-Bgu1bQNF.js → Settings02-DZoKzWEv.js} +1 -1
- package/dist/client/assets/{Shield01-CaPKhnEk.js → Shield01-fOlgiTmp.js} +1 -1
- package/dist/client/assets/{Star01-DBJ3WRq3.js → Star01-CZqCpyvl.js} +1 -1
- package/dist/client/assets/{Stars01-Cd1K38zt.js → Stars01-Ae1PiOCP.js} +1 -1
- package/dist/client/assets/{Stars02-C8p3j306.js → Stars02-CEcEV2x1.js} +1 -1
- package/dist/client/assets/{Sun-BosDAosa.js → Sun-BlaoOCgr.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-tzBohv7u.js → SwitchHorizontal01-ClsPCmf-.js} +1 -1
- package/dist/client/assets/{Tool01-DpKtUDdc.js → Tool01-BFKHYBxu.js} +1 -1
- package/dist/client/assets/{Trash01-rh0eNQOR.js → Trash01-AyXF9MEf.js} +1 -1
- package/dist/client/assets/{Upload01-BjNnhp_v.js → Upload01-DCmxXheu.js} +1 -1
- package/dist/client/assets/{User01-Dc_u7k7u.js → User01-BO7S3TIr.js} +1 -1
- package/dist/client/assets/{Users01-CZp60s82.js → Users01-DfacWtOx.js} +1 -1
- package/dist/client/assets/{Users03-D9jw9_8M.js → Users03-CqKlqVoH.js} +1 -1
- package/dist/client/assets/{X-BOtIuTSA.js → X-MB-OWrnU.js} +1 -1
- package/dist/client/assets/{XCircle-BFiq-Ufk.js → XCircle-DcrNWY52.js} +1 -1
- package/dist/client/assets/{XClose-ZusYOTM2.js → XClose-C0Njrlhp.js} +1 -1
- package/dist/client/assets/{Zap-CoaVYb8q.js → Zap-BeSLks75.js} +1 -1
- package/dist/client/assets/{ZapSquare-qyh7C_H5.js → ZapSquare-CpJG9Oj7.js} +1 -1
- package/dist/client/assets/{ZoomOut-Dz5ig_WP.js → ZoomOut-C7eIvwp9.js} +1 -1
- package/dist/client/assets/{access-gate-orW6D_Hy.js → access-gate-BTwMUx8s.js} +1 -1
- package/dist/client/assets/{add-section-modal-DgUsCJmI.js → add-section-modal-j_jXpJBA.js} +1 -1
- package/dist/client/assets/{agent-icon-Ck_LXvX6.js → agent-icon-DcWi6oQf.js} +1 -1
- package/dist/client/assets/{agents-list-BsLnfcET.js → agents-list-D0AfDGuT.js} +1 -1
- package/dist/client/assets/{ai-providers-ckC6upuL.js → ai-providers-BuVR6Fq-.js} +1 -1
- package/dist/client/assets/{alert-DAyVZIro.js → alert-RMwHcRZt.js} +1 -1
- package/dist/client/assets/{alert-dialog-By5kEZab.js → alert-dialog-DhnepmPL.js} +3 -3
- package/dist/client/assets/{app-editor-DOz1H16P.js → app-editor-0tpnZ9z8.js} +1 -1
- package/dist/client/assets/{auth-CCy0Drng.js → auth-MTgCv3B6.js} +1 -1
- package/dist/client/assets/{auth-catchall-D11kd7LI.js → auth-catchall-CVuOJ40y.js} +1 -1
- package/dist/client/assets/{auth-entry-yKEJtCM6.js → auth-entry-DNo7lJtC.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DQ851amt.js → auth-split-layout-BkcesqQu.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DGbAvD7K.js → authenticate-and-persist-oauth-xA4lKCG1.js} +1 -1
- package/dist/client/assets/{automation-list-row-9CdBZv5k.js → automation-list-row-lXLMGjAl.js} +1 -1
- package/dist/client/assets/{automation-runs-CvvNAcan.js → automation-runs-BNqiryvr.js} +1 -1
- package/dist/client/assets/automations-Dh_fnqca.js +1 -0
- package/dist/client/assets/{avatar-atM_zFvT.js → avatar-Bmaq3oui.js} +1 -1
- package/dist/client/assets/{badge-CRnqySv8.js → badge-DgW_sNSd.js} +1 -1
- package/dist/client/assets/block-document-4RcwatC8.js +3 -0
- package/dist/client/assets/{brand-context-CIttdQEu.js → brand-context-D457Ff4i.js} +1 -1
- package/dist/client/assets/{buckets-C358kQkm.js → buckets-BLZkDBf0.js} +1 -1
- package/dist/client/assets/{capability-load-error-BY-EM1R7.js → capability-load-error-DqYgq0OP.js} +1 -1
- package/dist/client/assets/{card-DcfhxqYa.js → card-CdB8pO82.js} +1 -1
- package/dist/client/assets/category-editor-DyYEMWv7.js +1 -0
- package/dist/client/assets/{chat-context-DUkhJZb1.js → chat-context-r3NULPrq.js} +5 -5
- package/dist/client/assets/{checkbox-DHMRbOGr.js → checkbox-D8lwJ8xg.js} +1 -1
- package/dist/client/assets/{cli-auth-success-D_tFN7lo.js → cli-auth-success-D4W1hh6D.js} +1 -1
- package/dist/client/assets/{collection-detail-Cf9qNtcJ.js → collection-detail-DZE_RwOf.js} +1 -1
- package/dist/client/assets/{collection-display-button-CAD8eEes.js → collection-display-button-ZIEr6UdN.js} +1 -1
- package/dist/client/assets/{collection-search-CEFB4N9h.js → collection-search-COO4vS-f.js} +1 -1
- package/dist/client/assets/{collection-tabs-7yV2wNiz.js → collection-tabs-pohcUS35.js} +1 -1
- package/dist/client/assets/{command-BhSQl6iR.js → command-BEOutwEN.js} +1 -1
- package/dist/client/assets/commerce-onboarding-vmBc36Wn.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-OLpDCCJy.js → connect-desktop-dialog-D1W6pIZ9.js} +1 -1
- package/dist/client/assets/{connection-card-leV2dWB5.js → connection-card-DvFBQwK2.js} +1 -1
- package/dist/client/assets/{connection-detail-CtTm4CeS.js → connection-detail-BiatZeVg.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CvuWF_qN.js → connection-form-helpers-DRUXP-X_.js} +1 -1
- package/dist/client/assets/{connections-Blpj-c9R.js → connections-BgPPdK1V.js} +1 -1
- package/dist/client/assets/{context-menu-CRoD3ZAL.js → context-menu-CCN5BrKr.js} +1 -1
- package/dist/client/assets/{decopilot-D7TbwmHb.js → decopilot-CxPeW6hk.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BhzKIXOc.js → decopilot-sse-pool-BnDSFddS.js} +1 -1
- package/dist/client/assets/{dialog-BrMqBLoG.js → dialog-DdTE3CAC.js} +1 -1
- package/dist/client/assets/{domain-settings-DAd913ma.js → domain-settings-BjzJ5uyt.js} +1 -1
- package/dist/client/assets/{drawer-CfMQnZNS.js → drawer-DwwZCC3K.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CHb585vC.js → dropdown-menu-DKzuZbGW.js} +1 -1
- package/dist/client/assets/{empty-state-B58FJks6.js → empty-state-rYwga-lm.js} +1 -1
- package/dist/client/assets/{extract-connection-data-mwMTLk6T.js → extract-connection-data-B4owvROB.js} +1 -1
- package/dist/client/assets/{file-explorer-BsvPzrPk.js → file-explorer-BtKyCE-H.js} +1 -1
- package/dist/client/assets/{file-type-icon-DNI19WPJ.js → file-type-icon-wUDm0Suu.js} +1 -1
- package/dist/client/assets/{files-BgCO3rTn.js → files-CtXlrxsm.js} +1 -1
- package/dist/client/assets/{form-CZR03a0k.js → form-DbBK-5wv.js} +1 -1
- package/dist/client/assets/{general-B6RNMONX.js → general-DF27snE9.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CEcNDks4.js → github-repo-picker-D-tUatSG.js} +1 -1
- package/dist/client/assets/{hooks-D_Uz5YqG.js → hooks-INfKdXVO.js} +5 -5
- package/dist/client/assets/{import-from-deco-dialog-p8NIwh4J.js → import-from-deco-dialog-le5qLPLs.js} +1 -1
- package/dist/client/assets/{index-BPPHWgnF.js → index-B2UoUa7-.js} +5 -5
- package/dist/client/assets/{index-Cdmj5Zuz.js → index-BQKrhCqr.js} +26 -26
- package/dist/client/assets/{index-COgzl_Ta.js → index-BTgWpT9v.js} +1 -1
- package/dist/client/assets/{index-BF86DuYb.js → index-CUyflRk0.js} +1 -1
- package/dist/client/assets/{index-bVu_tc1G.js → index-Cn6fC_Ac.js} +1 -1
- package/dist/client/assets/{index-XAYG34k_.js → index-D1r046zx.js} +1 -1
- package/dist/client/assets/{index-mR2grFpg.js → index-D8Uvg14I.js} +2 -2
- package/dist/client/assets/{index-BKpqVwD3.js → index-DRm-BOiP.js} +1 -1
- package/dist/client/assets/{index-1b1JIngz.js → index-DX1mGsi2.js} +1 -1
- package/dist/client/assets/{index-C2VvKTDb.js → index-D_cJIjMW.js} +1 -1
- package/dist/client/assets/{index-DWCaHQH5.js → index-Dnl2BpV5.js} +1 -1
- package/dist/client/assets/{index-CJpvCWxT.js → index-EsOpLcz-.js} +1 -1
- package/dist/client/assets/{index-BjOC32Yz.js → index-ZWwLrXbl.js} +1 -1
- package/dist/client/assets/index-cLiT1dYJ.js +1 -0
- package/dist/client/assets/{index-redirect-PJniQcSY.js → index-redirect-_nLhO8q2.js} +1 -1
- package/dist/client/assets/{input-CAqohOCw.js → input-cOCMYrBp.js} +1 -1
- package/dist/client/assets/{integration-icon-D-l3weCN.js → integration-icon-BDOKXt2t.js} +1 -1
- package/dist/client/assets/{label-vS-FNBbi.js → label-BI0j7uY8.js} +1 -1
- package/dist/client/assets/{login-CiEh5fgP.js → login-Tnea6rjC.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BKGGJL08.js → mcp-oauth-CZJDhaE3.js} +1 -1
- package/dist/client/assets/{members-C9O8j0OG.js → members-ELCKwmM1.js} +2 -2
- package/dist/client/assets/{monaco-editor-T8FHtT4g.js → monaco-editor-DZJR8nuD.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DY3Lf615.js → monitoring-stats-row-DVW1uxUq.js} +1 -1
- package/dist/client/assets/{oauth-callback-DjM7brwt.js → oauth-callback-BY0UQ4hx.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C5ZMrnJG.js → oauth-callback-ai-provider-CdAJ6XTe.js} +1 -1
- package/dist/client/assets/{onboarding-CswUYAZm.js → onboarding-DHGJq1nj.js} +1 -1
- package/dist/client/assets/{org-install-B4xgFc4p.js → org-install-D0cgxy0P.js} +1 -1
- package/dist/client/assets/{org-layout-D3LBJrJs.js → org-layout-CqQb7V03.js} +1 -1
- package/dist/client/assets/{organization-choice-CNPjn_yN.js → organization-choice-CcykvGTC.js} +1 -1
- package/dist/client/assets/{page-seo-form-CJFpRoTo.js → page-seo-form-B61j3DLN.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BKFroR3I.js +1 -0
- package/dist/client/assets/popover-BFI2s-K5.js +1 -0
- package/dist/client/assets/post-editor-Cx7_h-UZ.js +1 -0
- package/dist/client/assets/{preview-dialog-B1vi9-fr.js → preview-dialog-CfSpAFWk.js} +1 -1
- package/dist/client/assets/{primitives-Bzvrwjv8.js → primitives-ceFrDMZ8.js} +1 -1
- package/dist/client/assets/{profile-DPa3rad7.js → profile-CQj8hLnx.js} +1 -1
- package/dist/client/assets/project-app-view-DjTqKb4e.js +1 -0
- package/dist/client/assets/record-editor-DGroyIl1.js +1 -0
- package/dist/client/assets/registry-CeujA3jc.js +2 -0
- package/dist/client/assets/{registry-layout-BNlw995g.js → registry-layout-DNGdaDCg.js} +1 -1
- package/dist/client/assets/{require-capability-B0pLnXm-.js → require-capability-Dv8CdaOQ.js} +1 -1
- package/dist/client/assets/{required-auth-layout-x-i8ZoC0.js → required-auth-layout-BI2vgegn.js} +1 -1
- package/dist/client/assets/{reset-password-DKwWj-71.js → reset-password-B1MVnY7V.js} +1 -1
- package/dist/client/assets/{roles-9vPn8Mdx.js → roles-D8h9UhMY.js} +1 -1
- package/dist/client/assets/{save-status-DTW2k8xy.js → save-status-C6pdsybd.js} +1 -1
- package/dist/client/assets/{scroll-area-BYpyUruI.js → scroll-area--KGkDlfc.js} +20 -20
- package/dist/client/assets/{search-input-TVfqfJNR.js → search-input-ClOkWtT1.js} +1 -1
- package/dist/client/assets/{secrets-BGs6tVek.js → secrets-CJZKcITI.js} +1 -1
- package/dist/client/assets/{sections-editor-Ct1Apalw.js → sections-editor-D6nPxPBw.js} +1 -1
- package/dist/client/assets/select-BpWT9NxB.js +1 -0
- package/dist/client/assets/{select-model-BDrEtF_b.js → select-model-BUbOpgp-.js} +1 -1
- package/dist/client/assets/{seo-editor-C2aLmJ4l.js → seo-editor-DeAuhtw-.js} +1 -1
- package/dist/client/assets/{settings-layout-JIIRFT--.js → settings-layout-Drs_RBsy.js} +1 -1
- package/dist/client/assets/{settings-section-B1hEg5tt.js → settings-section-D0PQML5z.js} +1 -1
- package/dist/client/assets/{sheet-xIAnuqBY.js → sheet-Bh_kypR-.js} +1 -1
- package/dist/client/assets/{shell-controls-E9u5mZl9.js → shell-controls-Nmxnzdo8.js} +1 -1
- package/dist/client/assets/{shell-layout-VHD_Cb4p.js → shell-layout-D9BdE-pr.js} +1 -1
- package/dist/client/assets/{shell-route-loading-UgPa6Gp0.js → shell-route-loading-BPSGiR4a.js} +1 -1
- package/dist/client/assets/{sidebar-Dic6MKz3.js → sidebar-DPZoMbeP.js} +1 -1
- package/dist/client/assets/{skeleton-l5WcqW-d.js → skeleton-Ce4pjv8y.js} +1 -1
- package/dist/client/assets/{sortable.esm-C6e7uRcc.js → sortable.esm-BJQ3_vpH.js} +1 -1
- package/dist/client/assets/{sso-BsdFrO3k.js → sso-Cvmi628s.js} +1 -1
- package/dist/client/assets/{store-CD1F43O1.js → store-DjSGMocW.js} +1 -1
- package/dist/client/assets/store-registry-BP6MDxTR.js +2 -0
- package/dist/client/assets/{studio-tools-DU-ZAJkb.js → studio-tools-prp9Lpwk.js} +1 -1
- package/dist/client/assets/{switch-DEM0JLOB.js → switch-DldSyEsh.js} +1 -1
- package/dist/client/assets/{table-BDuaFb3S.js → table-CNvgb9Mo.js} +1 -1
- package/dist/client/assets/{tabs-Dp30CQm6.js → tabs-DZdnCzIX.js} +1 -1
- package/dist/client/assets/{task-status-CHcy80C5.js → task-status-DbhcaMw-.js} +1 -1
- package/dist/client/assets/{textarea-DZ0cwW9T.js → textarea-7wQk0SdM.js} +1 -1
- package/dist/client/assets/{toggle-group-B0D5b5vv.js → toggle-group-CnVWeylZ.js} +1 -1
- package/dist/client/assets/{toolbar-CM0oxqqJ.js → toolbar-D2dJyxUi.js} +1 -1
- package/dist/client/assets/tooltip-BcZ7kxok.js +1 -0
- package/dist/client/assets/{types-ChbMCG4z.js → types-CfcfJn-e.js} +3 -3
- package/dist/client/assets/{use-ai-providers-3kzcspcA.js → use-ai-providers-CYjRxPY4.js} +1 -1
- package/dist/client/assets/{use-automations-CBdsl76f.js → use-automations-BKHbHQVe.js} +1 -1
- package/dist/client/assets/{use-capability-DIj7inLh.js → use-capability-_zd_sWix.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BhM6aweN.js → use-clock-tick-Dxhf7J79.js} +1 -1
- package/dist/client/assets/{use-collections-DCRwCZbA.js → use-collections-CVtzAI_4.js} +1 -1
- package/dist/client/assets/use-connection-BcgeGs-R.js +1 -0
- package/dist/client/assets/{use-copy-B9mKG-Cl.js → use-copy-D7-bM3_U.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DWL_4AZa.js → use-create-virtual-mcp-sEOK3OGz.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-74uRzVCk.js → use-debounced-autosave-Dw5z0WsS.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CEYmnp3Z.js → use-delete-connection-BA5LApPZ.js} +1 -1
- package/dist/client/assets/{use-file-configs-tFZARuVD.js → use-file-configs-BLlYdTvj.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BXb-IdDg.js → use-infinite-scroll-B3z1ggE3.js} +1 -1
- package/dist/client/assets/{use-join-requests-ChImrko0.js → use-join-requests-DXZefKlG.js} +1 -1
- package/dist/client/assets/{use-mcp-client-By9elASA.js → use-mcp-client-Ctg4zbCn.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-BQ24j_v7.js → use-mcp-prompts-Dv9w7cJn.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CA13UBDI.js → use-mcp-tools-CxaQCmvQ.js} +1 -1
- package/dist/client/assets/{use-members-CFm515Vu.js → use-members-BdpapftV.js} +1 -1
- package/dist/client/assets/{use-mobile-DGuf6z1K.js → use-mobile-XBBKLnBG.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-wLnAUTat.js +1 -0
- package/dist/client/assets/use-org-auth-client-N6OssZ7e.js +1 -0
- package/dist/client/assets/{use-org-sso-D8Ga6XsJ.js → use-org-sso-BtCKgCqJ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CyvZcNQO.js → use-organization-roles-DIOhz7Qp.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bm71-TG1.js → use-organization-settings-CSB6B7Jr.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CUVj2mnn.js → use-registry-connections-D71Qe36n.js} +1 -1
- package/dist/client/assets/{use-secrets-CtHs1hZn.js → use-secrets-OpYJ3uj0.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CMZ27EbO.js → use-status-sounds-Bi6GrV2F.js} +1 -1
- package/dist/client/assets/{use-view-mode-BcEfe2OZ.js → use-view-mode-Di33Xh4J.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-PbRTUXIl.js → use-virtual-mcp-BUu5xf_e.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-5pwPVyhJ.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-MlMUD9_u.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-MxZtGRx5.js → useSuspenseQueries-DuY6292-.js} +1 -1
- package/dist/client/assets/{variant-calendar-3BvbAdEp.js → variant-calendar-BfW4hbwz.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BlJhLCJe.js → view-mode-toggle-DHDWPLEi.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/automations-DRoU1R5A.js +0 -1
- package/dist/client/assets/block-document-ZCzKdEgO.js +0 -3
- package/dist/client/assets/category-editor-w0Z5PA-x.js +0 -1
- package/dist/client/assets/commerce-onboarding-RG8X3rm5.js +0 -1
- package/dist/client/assets/index-PlO7oC7l.js +0 -1
- package/dist/client/assets/page-seo-sheet-rGvYJg6n.js +0 -1
- package/dist/client/assets/popover-gpaDR2DW.js +0 -1
- package/dist/client/assets/post-editor-BbQuQUQ_.js +0 -1
- package/dist/client/assets/project-app-view-msR2LZdf.js +0 -1
- package/dist/client/assets/record-editor-E_cR9ohG.js +0 -1
- package/dist/client/assets/registry-VtY8EXvk.js +0 -2
- package/dist/client/assets/select-ClA37U3B.js +0 -1
- package/dist/client/assets/store-registry-VZuDIT1R.js +0 -2
- package/dist/client/assets/tooltip-C1RDYh52.js +0 -1
- package/dist/client/assets/use-connection-KWXjUJZI.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-C_zx7c7F.js +0 -1
- package/dist/client/assets/use-org-auth-client-CrQBEA_r.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BjOz-8X9.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-q689xaFO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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-BQKrhCqr.js";import{L as N}from"./label-BI0j7uY8.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,R as e,y as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as M,
|
|
1
|
+
import{b as M,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-BQKrhCqr.js";import{P as N}from"./index-CUyflRk0.js";import{u as W}from"./use-org-auth-client-N6OssZ7e.js";import{u as X}from"./use-debounced-autosave-Dw5z0WsS.js";import{A as ee}from"./avatar-Bmaq3oui.js";import{I as V}from"./input-cOCMYrBp.js";import{S as K,a as G,b as A,c as te}from"./settings-section-D0PQML5z.js";import{D as ne}from"./domain-settings-BjzJ5uyt.js";import{u as ae}from"./studio-tools-prp9Lpwk.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-DhnepmPL.js";import{R as me}from"./require-capability-Dv8CdaOQ.js";import"./sidebar-DPZoMbeP.js";import"./LayoutLeft-BGayXB6j.js";import"./use-mobile-XBBKLnBG.js";import"./sheet-Bh_kypR-.js";import"./X-MB-OWrnU.js";import"./tooltip-BcZ7kxok.js";import"./User01-BO7S3TIr.js";import"./card-CdB8pO82.js";import"./ArrowUpRight-dqkJVgXk.js";import"./badge-DgW_sNSd.js";import"./select-BpWT9NxB.js";import"./ChevronUp-C2_z85hK.js";import"./ChevronDown-C02eYJK7.js";import"./use-capability-_zd_sWix.js";import"./access-gate-BTwMUx8s.js";import"./capability-load-error-DqYgq0OP.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-CEcNDks4.js → github-repo-picker-D-tUatSG.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,j as t,C as Q,a as te,m as W,r as A,a6 as B,i as D,d as ne,t as z,K as V,k as se,l as K,q as oe,af as re}from"./index-Cdmj5Zuz.js";import{c as ie,d as ae,b as le,a as ce}from"./dialog-BrMqBLoG.js";import{C as J}from"./checkbox-DHMRbOGr.js";import{C as ue}from"./collection-search-CEFB4N9h.js";import{b as de,u as me}from"./use-connection-KWXjUJZI.js";import{W as fe,u as H,S as X}from"./use-mcp-client-By9elASA.js";import{b as Z}from"./Settings02-Bgu1bQNF.js";import{v as pe}from"./agent-icon-Ck_LXvX6.js";import{a as ge}from"./authenticate-and-persist-oauth-DGbAvD7K.js";import{u as xe}from"./use-mcp-tools-CA13UBDI.js";import{e as he}from"./extract-connection-data-mwMTLk6T.js";import{m as be}from"./use-navigate-to-agent-C_zx7c7F.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 F=[{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=F.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(D,{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(F.filter(u=>u.defaultEnabled).map(u=>u.key))),N=F.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(D,{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(D,{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:F.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(D,{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-BQKrhCqr.js";import{c as ie,d as ae,b as le,a as ce}from"./dialog-DdTE3CAC.js";import{C as J}from"./checkbox-D8lwJ8xg.js";import{C as ue}from"./collection-search-COO4vS-f.js";import{b as de,u as me}from"./use-connection-BcgeGs-R.js";import{W as fe,u as H,S as X}from"./use-mcp-client-Ctg4zbCn.js";import{b as Z}from"./Settings02-DZoKzWEv.js";import{v as pe}from"./agent-icon-DcWi6oQf.js";import{a as ge}from"./authenticate-and-persist-oauth-xA4lKCG1.js";import{u as xe}from"./use-mcp-tools-CxaQCmvQ.js";import{e as he}from"./extract-connection-data-B4owvROB.js";import{m as be}from"./use-navigate-to-agent-wLnAUTat.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};
|