decocms 4.131.2 → 4.131.4
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-Dkv2twCy.js → AlertCircle-DevA0A1M.js} +1 -1
- package/dist/client/assets/{AreaChart-Drb-WBuc.js → AreaChart-BWfAq2gc.js} +1 -1
- package/dist/client/assets/{ArrowRight-D1F_c8mU.js → ArrowRight-Dq4C6lJ4.js} +1 -1
- package/dist/client/assets/{ArrowUp-CfejN6kE.js → ArrowUp-CLXut3hx.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-pyqwDg-l.js → ArrowUpRight-Bay5EW8Z.js} +1 -1
- package/dist/client/assets/{Check-Du2CH0Qx.js → Check-DN6IPn_3.js} +1 -1
- package/dist/client/assets/{CheckCircle-pc0wi1b4.js → CheckCircle-ck8m-YN6.js} +1 -1
- package/dist/client/assets/{ChevronDown-CIPwphYr.js → ChevronDown-cZoWRgvb.js} +1 -1
- package/dist/client/assets/{ChevronRight-bpU9x4EL.js → ChevronRight-CmrokxXJ.js} +1 -1
- package/dist/client/assets/{ChevronUp-f9GdHpvo.js → ChevronUp-CswOdRaR.js} +1 -1
- package/dist/client/assets/{Copy01-DBHRmMgp.js → Copy01-BGeJ_uJU.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dl3GV1z7.js → DotsVertical-Db5Rriwt.js} +1 -1
- package/dist/client/assets/{Eye-pDXTSR_y.js → Eye-BqdZYqpI.js} +1 -1
- package/dist/client/assets/{FilterLines-BFWPoe09.js → FilterLines-BFxvHa0q.js} +1 -1
- package/dist/client/assets/{HardDrive-BCPMH3VT.js → HardDrive-C1-SCHTe.js} +1 -1
- package/dist/client/assets/{Key01-CBwzTn3B.js → Key01-YwqEObkc.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CWKaiAHc.js → LayoutLeft-BzJLVhVQ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DsH5I9jm.js → LinkExternal01-Dv9Aj-K0.js} +1 -1
- package/dist/client/assets/{LogOut01-YgIKEMFw.js → LogOut01-D1zBEUWi.js} +1 -1
- package/dist/client/assets/{Monitor01-q2Qybp9B.js → Monitor01-c_9oVNrI.js} +1 -1
- package/dist/client/assets/{Palette-BY72GXhm.js → Palette-CgoT-TdN.js} +1 -1
- package/dist/client/assets/{Play-9D0sdMED.js → Play-DY15eh3c.js} +1 -1
- package/dist/client/assets/{Plus-1ztWOFkn.js → Plus-D7R6BF5R.js} +1 -1
- package/dist/client/assets/{SearchLg-CBRhPi_g.js → SearchLg-B1avg8bD.js} +1 -1
- package/dist/client/assets/{SearchMd-CoeKfSSe.js → SearchMd-B-lbf8c2.js} +1 -1
- package/dist/client/assets/{Settings02-Dvu63VK8.js → Settings02-k_lwzmTv.js} +1 -1
- package/dist/client/assets/{Shield01-ByBFJvxc.js → Shield01-DFBgcYa0.js} +1 -1
- package/dist/client/assets/{Star01-B1Kn4-_i.js → Star01-Bv8b5o6W.js} +1 -1
- package/dist/client/assets/{Stars01-DpgpdjJr.js → Stars01-CAvqsR90.js} +1 -1
- package/dist/client/assets/{Stars02-D9_55K26.js → Stars02-Djd7mUzA.js} +1 -1
- package/dist/client/assets/{Sun-DMtwJS6D.js → Sun-DZlLfVSj.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BAtdmOhb.js → SwitchHorizontal01-C9T_FryU.js} +1 -1
- package/dist/client/assets/{Tool01-DMFHdvqO.js → Tool01-B14PZEqF.js} +1 -1
- package/dist/client/assets/{Tool02-CCso8U2x.js → Tool02-C-4pjcCY.js} +1 -1
- package/dist/client/assets/{Trash01-CTHwttyB.js → Trash01-DnjcslV5.js} +1 -1
- package/dist/client/assets/{TrendUp01-CnWDWhEF.js → TrendUp01-BVE2-KuE.js} +1 -1
- package/dist/client/assets/{Upload01-BY9ftwcq.js → Upload01-uhey7zjg.js} +1 -1
- package/dist/client/assets/{User01-BTBcFc9z.js → User01-DQzbx1Xu.js} +1 -1
- package/dist/client/assets/{Users01-Cql_e-31.js → Users01-Ct4A_zsW.js} +1 -1
- package/dist/client/assets/{Users03-o-LyclnZ.js → Users03-C-mvAxcs.js} +1 -1
- package/dist/client/assets/{X-DsUhkCER.js → X-DsJCvKBO.js} +1 -1
- package/dist/client/assets/{XCircle-qpPGG1wt.js → XCircle-Eu9CNvjp.js} +1 -1
- package/dist/client/assets/{XClose-B6aD5HLV.js → XClose-BcWYJ3jm.js} +1 -1
- package/dist/client/assets/{Zap-u5rNKW8G.js → Zap-BiPzgNTf.js} +1 -1
- package/dist/client/assets/{ZapSquare-qUxPDGDu.js → ZapSquare-DpSSWmnE.js} +1 -1
- package/dist/client/assets/{access-gate-CKUKLx71.js → access-gate-BUe45Oc3.js} +1 -1
- package/dist/client/assets/{add-section-modal-dEKzXkSV.js → add-section-modal-Cj4WcLQN.js} +1 -1
- package/dist/client/assets/{agent-icon-Cn-zdV8E.js → agent-icon-DW-jknHC.js} +1 -1
- package/dist/client/assets/{agents-list-CIQknPiT.js → agents-list-CnJm5oWk.js} +1 -1
- package/dist/client/assets/{ai-providers-pcs4cL5s.js → ai-providers-D9DCe_7q.js} +1 -1
- package/dist/client/assets/{alert-BrYvcVNo.js → alert-DM1JMd0G.js} +1 -1
- package/dist/client/assets/{alert-dialog-DdeUN0gs.js → alert-dialog-B5UNzzAF.js} +1 -1
- package/dist/client/assets/{app-editor-BokdYxzt.js → app-editor-Des7fkeu.js} +1 -1
- package/dist/client/assets/{auth-DxnCXfEr.js → auth-Btre_1OW.js} +1 -1
- package/dist/client/assets/{auth-catchall-CfgT5x1l.js → auth-catchall-DEyYZDPo.js} +1 -1
- package/dist/client/assets/{auth-entry-z-RVgErJ.js → auth-entry-Bk6mD7w7.js} +1 -1
- package/dist/client/assets/{auth-split-layout-RjHJpu_H.js → auth-split-layout-Xx-1MkJu.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BgQP48Df.js → authenticate-and-persist-oauth-DMOmyFRT.js} +1 -1
- package/dist/client/assets/{automation-list-row-BgQ-Sntx.js → automation-list-row-C0qxtH51.js} +1 -1
- package/dist/client/assets/{automation-runs-DJHP3Ebd.js → automation-runs-D_CI6v6C.js} +1 -1
- package/dist/client/assets/{automations-GH1d56mw.js → automations-DuYav8ee.js} +1 -1
- package/dist/client/assets/{avatar-CtA1rHBR.js → avatar-6012j4NF.js} +1 -1
- package/dist/client/assets/{badge-DLw-128i.js → badge-kM5UAKst.js} +1 -1
- package/dist/client/assets/{block-document-BJX5tnOk.js → block-document-Cuu1bHmR.js} +1 -1
- package/dist/client/assets/{brand-context-DkvpqsQ8.js → brand-context-QIm13fsq.js} +1 -1
- package/dist/client/assets/{buckets-DwZxLwtb.js → buckets-cXyEFJzj.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BRjHEgsf.js → bulk-category-panel-2liLzEa8.js} +1 -1
- package/dist/client/assets/{calendar-DDOXvi9j.js → calendar-MyVXyluP.js} +1 -1
- package/dist/client/assets/{capability-load-error-BSRBDTUF.js → capability-load-error-DXOesTij.js} +1 -1
- package/dist/client/assets/{card-C_7Dfz9P.js → card-LK3SgMlx.js} +1 -1
- package/dist/client/assets/{category-editor-Q5uFZ0SW.js → category-editor-Bpk_JSk7.js} +1 -1
- package/dist/client/assets/chat-context-4A5jyyEw.js +36 -0
- package/dist/client/assets/{checkbox-CTh8EHLV.js → checkbox-C9Nq068Z.js} +1 -1
- package/dist/client/assets/{cli-auth-success-wvSiqOx7.js → cli-auth-success-C3PdvGhV.js} +1 -1
- package/dist/client/assets/{collection-detail-BGIhyphq.js → collection-detail-COz359qR.js} +1 -1
- package/dist/client/assets/{collection-display-button-BK6TSoeX.js → collection-display-button-C9dL_fAH.js} +1 -1
- package/dist/client/assets/{collection-search-CgPrJD5s.js → collection-search-C63j6Zzd.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BBK5Zjn2.js → collection-table-wrapper-B06IqYXO.js} +1 -1
- package/dist/client/assets/{collection-tabs-DQPFhmJa.js → collection-tabs-C_e51TYz.js} +1 -1
- package/dist/client/assets/{command-mkWdNJiA.js → command-DtoG6f_9.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Bs7-iua6.js → commerce-onboarding-E61cJuT5.js} +1 -1
- package/dist/client/assets/{companions-core-CCmjJd5y.js → companions-core-RUJyQPUT.js} +1 -1
- package/dist/client/assets/{connect-BteNxC1u.js → connect-B7aqLNJY.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DCNWmwTZ.js → connect-desktop-dialog-Dj9gRQkE.js} +1 -1
- package/dist/client/assets/{connection-card-5582YW8P.js → connection-card-BoF_KE8y.js} +1 -1
- package/dist/client/assets/{connection-detail-XbVgn9MH.js → connection-detail-DLH59AQX.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CmY0Q2Uk.js → connection-form-helpers-DB9ro8Ha.js} +1 -1
- package/dist/client/assets/{connection-CaaVbqW9.js → connection-vyIAo10g.js} +1 -1
- package/dist/client/assets/{connections-BXNw1IKw.js → connections-DfRW6lnA.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-qYgFQjLn.js → decopilot-sse-pool-CFz6l2VG.js} +1 -1
- package/dist/client/assets/{dialog-DRzTNCF2.js → dialog-D370feZI.js} +1 -1
- package/dist/client/assets/{domain-settings-DHJNEbEZ.js → domain-settings-6514J2nW.js} +1 -1
- package/dist/client/assets/{drawer-SsJOHRPA.js → drawer-LhH6tqHN.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BokfpNru.js → dropdown-menu-DBsO6utH.js} +1 -1
- package/dist/client/assets/{empty-state-CiJvvnog.js → empty-state-Cj1VbJ0y.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Br5Lsj7z.js → extract-connection-data-C8zhfgGc.js} +1 -1
- package/dist/client/assets/{file-explorer-BzAb8PtM.js → file-explorer-CEKYwf0q.js} +1 -1
- package/dist/client/assets/{form-CQNziZWc.js → form-Dj_8GoDc.js} +1 -1
- package/dist/client/assets/{general-Ch6aAbGc.js → general-cez9yeo-.js} +1 -1
- package/dist/client/assets/{github-repo-picker-pUO4-UP7.js → github-repo-picker-CeuXOkGP.js} +1 -1
- package/dist/client/assets/{hooks-CAzZfDok.js → hooks-DJ2YKeR9.js} +1 -1
- package/dist/client/assets/{index-DX_PyEaT.js → index-8UQlPx-e.js} +1 -1
- package/dist/client/assets/{index-TW5Rc09W.js → index-9dxBGS0M.js} +1 -1
- package/dist/client/assets/{index-CJRST3_Z.js → index-B6pbxJBU.js} +35 -35
- package/dist/client/assets/{index-Da2mllxf.js → index-BtxByavv.js} +1 -1
- package/dist/client/assets/{index-CCb4vxYi.js → index-CZWx2CTD.js} +1 -1
- package/dist/client/assets/{index-DeO_SMjA.js → index-D6fjxFLg.js} +1 -1
- package/dist/client/assets/{index-DoQWemFd.js → index-DLoS2Gvr.js} +3 -3
- package/dist/client/assets/{index-B5Nibhwf.js → index-Dx1y19yx.js} +1 -1
- package/dist/client/assets/{index-CcuY69gd.js → index-DxEI9GBV.js} +1 -1
- package/dist/client/assets/{index-L0hE-NEv.js → index-YTROANcF.js} +1 -1
- package/dist/client/assets/{index-redirect-R3JpdyEK.js → index-redirect-DP7n2JdM.js} +1 -1
- package/dist/client/assets/{index-D3OCvKaU.js → index-tHM8NTfd.js} +3 -3
- package/dist/client/assets/{input-Bs4tcVhT.js → input-CtPcKTyA.js} +1 -1
- package/dist/client/assets/{integration-icon-DG6YOOMj.js → integration-icon-C-2mN9ni.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DH3jQ_Zb.js → invite-member-dialog-B_qNDeU_.js} +1 -1
- package/dist/client/assets/{label-DUiPU4TM.js → label-Dx1_DE-f.js} +1 -1
- package/dist/client/assets/{layout-DQcUE9z4.js → layout-CxQ_ZjYX.js} +1 -1
- package/dist/client/assets/{login-B9FnuorL.js → login-XiuCflbI.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CVKUYIl9.js → mcp-oauth-Ch4TwOlY.js} +1 -1
- package/dist/client/assets/{members-BfVc1Xdw.js → members-Ci-qw088.js} +1 -1
- package/dist/client/assets/{monaco-editor-G_cJDJ93.js → monaco-editor-AliIqm4c.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BxRM7k9X.js → monitoring-stats-row-DN9PtAZT.js} +1 -1
- package/dist/client/assets/{multi-select-CXzg904j.js → multi-select-YuTRMMq6.js} +1 -1
- package/dist/client/assets/{oauth-callback-TGwV85BQ.js → oauth-callback-B5VSsFYW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-PgVBkiBN.js → oauth-callback-ai-provider-DvHFF9AB.js} +1 -1
- package/dist/client/assets/{onboarding-DdQNQ4A0.js → onboarding-C1PGqPn5.js} +1 -1
- package/dist/client/assets/{org-install-DAHfRxpD.js → org-install-D3FG3YSl.js} +1 -1
- package/dist/client/assets/{org-layout-CRo4EKIA.js → org-layout-CC1aR_Ar.js} +1 -1
- package/dist/client/assets/{organization-choice-CvVH3S_L.js → organization-choice-QLXU0-_4.js} +1 -1
- package/dist/client/assets/{orgs--E_IaGAZ.js → orgs-urMoQKB9.js} +1 -1
- package/dist/client/assets/{page-seo-form-CJ3NlYkD.js → page-seo-form-CmZpKqZS.js} +1 -1
- package/dist/client/assets/{popover-DqHD4yxd.js → popover-C3OgPzQD.js} +1 -1
- package/dist/client/assets/{post-editor-BABr2CJx.js → post-editor-nU307FBm.js} +1 -1
- package/dist/client/assets/{primitives-DqZjRnu7.js → primitives-CK5MU42p.js} +1 -1
- package/dist/client/assets/{profile-BdUjk22-.js → profile-hYMdiEA5.js} +1 -1
- package/dist/client/assets/project-app-view-qdfNZvBx.js +1 -0
- package/dist/client/assets/record-editor-DWuuBfxd.js +1 -0
- package/dist/client/assets/{redirect-editor-DFcl2X7j.js → redirect-editor-BMgNAGHS.js} +1 -1
- package/dist/client/assets/registry-RIQmZ8qc.js +2 -0
- package/dist/client/assets/{registry-layout-DGnc-Dtp.js → registry-layout-BNIYUe33.js} +1 -1
- package/dist/client/assets/{reports-hna_6ROV.js → reports-BH4VUIWR.js} +1 -1
- package/dist/client/assets/{require-capability-BYjfZMZ1.js → require-capability-B-Sqx0zT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B9TfjBVw.js → required-auth-layout-C91T3YkY.js} +1 -1
- package/dist/client/assets/{reset-password-twiesJde.js → reset-password-DZU7Xnj2.js} +1 -1
- package/dist/client/assets/{roles-DT5JKVI3.js → roles-B1Km9s7i.js} +1 -1
- package/dist/client/assets/{search-input-Ce9IROHU.js → search-input-C_HmTn9N.js} +1 -1
- package/dist/client/assets/{secrets-DluwaWyV.js → secrets-w6471qmo.js} +1 -1
- package/dist/client/assets/{sections-editor-DwLNB7L7.js → sections-editor-EpO7m57q.js} +1 -1
- package/dist/client/assets/{select-CPtJAf28.js → select-QOGEC2YQ.js} +1 -1
- package/dist/client/assets/{select-model-D7Ovd4CR.js → select-model-BjPHv_Dr.js} +1 -1
- package/dist/client/assets/{self-tool-result-JL1AnTkc.js → self-tool-result-Wf62ha3A.js} +1 -1
- package/dist/client/assets/{seo-editor-BrV87B5V.js → seo-editor-CypChmsn.js} +1 -1
- package/dist/client/assets/{settings-layout-7SeTok6D.js → settings-layout-C-KR57M3.js} +1 -1
- package/dist/client/assets/{settings-section-Dgg5nCua.js → settings-section-B7sLcI44.js} +1 -1
- package/dist/client/assets/{shell-controls-CPbdWqkG.js → shell-controls-DtA7fOjc.js} +1 -1
- package/dist/client/assets/{shell-layout-BexOLm1f.js → shell-layout-DjpBxe62.js} +1 -1
- package/dist/client/assets/{sidebar-BjYwCtXi.js → sidebar-DS29jp1e.js} +1 -1
- package/dist/client/assets/{skeleton-BwfY4sYC.js → skeleton-CVx36MXd.js} +1 -1
- package/dist/client/assets/{sso-v56tNQF7.js → sso-BWUbQwJM.js} +1 -1
- package/dist/client/assets/{store-LUDpSYn5.js → store-BepPvAB9.js} +1 -1
- package/dist/client/assets/store-registry-DBscfyiP.js +2 -0
- package/dist/client/assets/{studio-tools-D5UPG7xq.js → studio-tools-DBJ4BlKP.js} +1 -1
- package/dist/client/assets/{switch-Br6uEAbX.js → switch-BAMPQcFC.js} +1 -1
- package/dist/client/assets/{tab-id-YHtlg7gF.js → tab-id-DLditg27.js} +1 -1
- package/dist/client/assets/{table-Ciw0rD4-.js → table-DunMqZev.js} +1 -1
- package/dist/client/assets/{tabs-BvhudmcJ.js → tabs-DXpVtqDW.js} +1 -1
- package/dist/client/assets/{textarea-dx3oQXX3.js → textarea-hljn8moZ.js} +1 -1
- package/dist/client/assets/{toggle-group-BQ-mtOqg.js → toggle-group-CugvhNWb.js} +1 -1
- package/dist/client/assets/{toolbar-Ba5XXE-M.js → toolbar-dY2heqgV.js} +1 -1
- package/dist/client/assets/{tooltip-DrF8Dycy.js → tooltip-C4NGAgAM.js} +1 -1
- package/dist/client/assets/use-ai-providers-COkTONXg.js +1 -0
- package/dist/client/assets/{use-api-keys-BMxSi9Mc.js → use-api-keys-BondmtJR.js} +1 -1
- package/dist/client/assets/{use-automations-BoP3NYfz.js → use-automations-RGeim-7x.js} +1 -1
- package/dist/client/assets/{use-autosave-DVJxzXG6.js → use-autosave-BBmT_CQu.js} +1 -1
- package/dist/client/assets/{use-capability-hQ0DXv0z.js → use-capability-nY6kVL8r.js} +1 -1
- package/dist/client/assets/{use-clock-tick-2gdnxIz7.js → use-clock-tick-GBpMaXwL.js} +1 -1
- package/dist/client/assets/{use-connection-BqPnQoRJ.js → use-connection-uKN5YWIx.js} +1 -1
- package/dist/client/assets/{use-copy-D32fta2h.js → use-copy-EWLYbeWi.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BM65v9ER.js → use-create-virtual-mcp-DS8KPcoG.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-3BGJnmLE.js → use-debounced-autosave-_O3PoKoh.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B5eH48Lw.js → use-debounced-value-DuOUoSmu.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BzZz8lBr.js → use-deco-credits-ClFjXcZg.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CF5TQ0kC.js → use-decopilot-events-DSmTv1gx.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CSsIa0wR.js → use-delete-connection-DjRlgLwA.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Do0J3fTo.js → use-deployment-admin-3EsHBbN1.js} +1 -1
- package/dist/client/assets/{use-file-configs-Bw1gACmS.js → use-file-configs-Bgb80job.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CLgVcggv.js → use-infinite-scroll-DFYxMuWT.js} +1 -1
- package/dist/client/assets/{use-join-requests-CLtr7l1c.js → use-join-requests-CTLDVqMF.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CuDIWjse.js → use-mcp-auth-status-Bbnk5NX6.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DBBu3lpa.js → use-mcp-client-BAwn-0AV.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BKx6eQVH.js → use-mcp-tools-CgtI4_xz.js} +1 -1
- package/dist/client/assets/{use-members-C1XPdRpt.js → use-members-C_p-7j4-.js} +1 -1
- package/dist/client/assets/{use-mobile-B9xC4LZs.js → use-mobile-B-9CWMAs.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B_NFjN6b.js → use-navigate-to-agent-DEAiy9mr.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BFAUjn-N.js → use-org-auth-client-GW_RbwIG.js} +1 -1
- package/dist/client/assets/{use-org-sso-Dx0HxB9Q.js → use-org-sso-C5GowRh9.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cw7KjQX3.js → use-organization-roles-CjrQlUME.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BZ_WlMTx.js → use-organization-settings-D0V5wIDO.js} +1 -1
- package/dist/client/assets/{use-registry-app-D7Jfc22S.js → use-registry-app-D8hx17d1.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CxLWLJ5V.js → use-registry-connections-o8h37zTy.js} +1 -1
- package/dist/client/assets/{use-secrets-DmXwh72p.js → use-secrets-C-31Hjoh.js} +1 -1
- package/dist/client/assets/{use-status-sounds-1iMDr_3s.js → use-status-sounds-DZIf-G4r.js} +1 -1
- package/dist/client/assets/{use-view-mode-BgyziSsp.js → use-view-mode-CyIY6QXB.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bymtbi-1.js → use-virtual-mcp-DXStXtw1.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DAxuc5L-.js +1 -0
- package/dist/client/assets/{useQueries-B_FHAwLH.js → useQueries-Dk_rR620.js} +1 -1
- package/dist/client/assets/{useRouterState-xO3EhEgx.js → useRouterState-CFblvFqM.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BwVy3QbN.js +1 -0
- package/dist/client/assets/{users-C0hZEUyz.js → users-TcleqpoV.js} +1 -1
- package/dist/client/assets/{variant-calendar-DqDgry3x.js → variant-calendar-BH0fql5v.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C6H1y3Fg.js → view-mode-toggle-BMYy47UV.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +275 -275
- package/dist/server/server.js +197 -197
- package/package.json +1 -1
- package/dist/client/assets/chat-context-DcyOF_pB.js +0 -36
- package/dist/client/assets/project-app-view-N89P5i_H.js +0 -1
- package/dist/client/assets/record-editor-BGUbMaDe.js +0 -1
- package/dist/client/assets/registry-ohfLJ5M4.js +0 -2
- package/dist/client/assets/store-registry-BRGh_j8X.js +0 -2
- package/dist/client/assets/use-ai-providers-BiLZ6IzA.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Cth5f35D.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C_27-SXB.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as se,b as Me,r as u,j as r,k as fe,B as De,dZ as Jt,ay as Zt,aE as xe,d_ as en,d$ as tn,e0 as nn,e1 as rn,bH as on,e2 as sn,e3 as lt,aA as an,e4 as ln,e5 as cn,e6 as dn,e7 as un,e8 as fn,e9 as pn,ea as mn,eb as xn,ec as hn,m as le,o as gn,t as ne,K as Ze}from"./index-D3OCvKaU.js";import{F as bn,l as yn}from"./monaco-editor-G_cJDJ93.js";import{G as vn,k as Cn,b0 as wn,b1 as Nn}from"./agent-icon-Cn-zdV8E.js";import{s as jn}from"./XClose-B6aD5HLV.js";import{n as En}from"./automation-runs-DJHP3Ebd.js";import{c as et,T as tt,a as nt}from"./tooltip-DrF8Dycy.js";import{b as Sn}from"./chat-context-DcyOF_pB.js";import{u as Dn}from"./shell-layout-BexOLm1f.js";import{i as Mn,E as Rn,a as Ae,b as Tn,f as Pn,g as kn,c as Fn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as An,s as Ln,v as On,m as $e,n as je,o as rt,p as In,q as Ee,r as Ke,w as $n,x as Kn,y as zn,z as _n}from"./index-CJRST3_Z.js";import{b as Gn,h as Bn,a as Vn,c as Un,d as Hn,e as qn}from"./dialog-DRzTNCF2.js";import{I as ot}from"./input-Bs4tcVhT.js";import{c as Wn,d as Qn,b as Xn,f as Yn,g as Jn,e as Zn,a as er,A as tr}from"./alert-dialog-DdeUN0gs.js";import{t as nr}from"./ChevronDown-CIPwphYr.js";import{i as rr}from"./ChevronRight-bpU9x4EL.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-Dkv2twCy.js";import"./Tool01-DMFHdvqO.js";import"./ArrowUp-CfejN6kE.js";import"./Settings02-Dvu63VK8.js";import"./Tool02-CCso8U2x.js";import"./ArrowRight-D1F_c8mU.js";import"./ArrowUpRight-pyqwDg-l.js";import"./TrendUp01-CnWDWhEF.js";import"./ZapSquare-qUxPDGDu.js";import"./Users03-o-LyclnZ.js";import"./CheckCircle-pc0wi1b4.js";import"./Check-Du2CH0Qx.js";import"./ChevronUp-f9GdHpvo.js";import"./DotsVertical-Dl3GV1z7.js";import"./Stars02-D9_55K26.js";import"./Copy01-DBHRmMgp.js";import"./Eye-pDXTSR_y.js";import"./FilterLines-BFWPoe09.js";import"./Star01-B1Kn4-_i.js";import"./Palette-BY72GXhm.js";import"./SwitchHorizontal01-BAtdmOhb.js";import"./HardDrive-BCPMH3VT.js";import"./Key01-CBwzTn3B.js";import"./LayoutLeft-CWKaiAHc.js";import"./XCircle-qpPGG1wt.js";import"./LinkExternal01-DsH5I9jm.js";import"./LogOut01-YgIKEMFw.js";import"./Monitor01-q2Qybp9B.js";import"./Sun-DMtwJS6D.js";import"./Play-9D0sdMED.js";import"./Plus-1ztWOFkn.js";import"./SearchLg-CBRhPi_g.js";import"./SearchMd-CoeKfSSe.js";import"./Shield01-ByBFJvxc.js";import"./Stars01-DpgpdjJr.js";import"./Trash01-CTHwttyB.js";import"./Upload01-BY9ftwcq.js";import"./User01-BTBcFc9z.js";import"./Users01-Cql_e-31.js";import"./X-DsUhkCER.js";import"./Zap-u5rNKW8G.js";import"./select-CPtJAf28.js";import"./useInfiniteQuery-Cth5f35D.js";import"./use-infinite-scroll-CLgVcggv.js";import"./use-connection-BqPnQoRJ.js";import"./use-mcp-client-DBBu3lpa.js";import"./auth-DxnCXfEr.js";import"./use-virtual-mcp-Bymtbi-1.js";import"./card-C_7Dfz9P.js";import"./sidebar-BjYwCtXi.js";import"./use-mobile-B9xC4LZs.js";import"./table-Ciw0rD4-.js";import"./empty-state-CiJvvnog.js";import"./use-members-C1XPdRpt.js";import"./use-org-auth-client-BFAUjn-N.js";import"./use-clock-tick-2gdnxIz7.js";import"./use-automations-BoP3NYfz.js";import"./studio-tools-D5UPG7xq.js";import"./useSuspenseInfiniteQuery-C_27-SXB.js";import"./avatar-CtA1rHBR.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D32fta2h.js";import"./tab-id-YHtlg7gF.js";import"./hooks-CAzZfDok.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-qYgFQjLn.js";import"./index-B5Nibhwf.js";import"./calendar-DDOXvi9j.js";import"./integration-icon-DG6YOOMj.js";import"./use-navigate-to-agent-B_NFjN6b.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-Drb-WBuc.js";import"./form-CQNziZWc.js";import"./label-DUiPU4TM.js";import"./use-ai-providers-BiLZ6IzA.js";import"./use-decopilot-events-CF5TQ0kC.js";import"./use-organization-settings-BZ_WlMTx.js";import"./required-auth-layout-B9TfjBVw.js";import"./use-org-sso-Dx0HxB9Q.js";import"./drawer-SsJOHRPA.js";import"./collection-search-CgPrJD5s.js";import"./index-DoQWemFd.js";import"./get-initials-D-f_fDFw.js";import"./popover-DqHD4yxd.js";import"./use-registry-app-D7Jfc22S.js";import"./use-mcp-tools-BKx6eQVH.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-BgQP48Df.js";import"./mcp-oauth-CVKUYIl9.js";import"./extract-connection-data-Br5Lsj7z.js";import"./metadata-dUsYcpuu.js";import"./dropdown-menu-BokfpNru.js";import"./command-mkWdNJiA.js";import"./index-CCb4vxYi.js";import"./companions-core-CCmjJd5y.js";import"./tabs-BvhudmcJ.js";import"./toggle-group-BQ-mtOqg.js";import"./use-deco-credits-BzZz8lBr.js";import"./toolbar-Ba5XXE-M.js";import"./skeleton-BwfY4sYC.js";import"./github-repo-picker-pUO4-UP7.js";import"./use-debounced-value-B5eH48Lw.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-5582YW8P.js";import"./use-registry-connections-CxLWLJ5V.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-dx3oQXX3.js";import"./connection-form-helpers-CmY0Q2Uk.js";import"./collection-tabs-DQPFhmJa.js";import"./badge-DLw-128i.js";import"./connect-desktop-dialog-DCNWmwTZ.js";import"./select-model-D7Ovd4CR.js";import"./checkbox-CTh8EHLV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dgg5nCua.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-1iMDr_3s.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-hQ0DXv0z.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-CuDIWjse.js";import"./use-debounced-autosave-3BGJnmLE.js";import"./index-DeO_SMjA.js";import"./search-input-Ce9IROHU.js";import"./switch-Br6uEAbX.js";import"./use-secrets-DmXwh72p.js";import"./useQueries-B_FHAwLH.js";import"./use-file-configs-Bw1gACmS.js";import"./automation-list-row-BgQ-Sntx.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(Gn,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Bn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Vn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Un,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(U=r.jsx(Hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(qn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(Wn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Qn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Xn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Yn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Jn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Zn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(er,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(tr,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(rr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(vn,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=An(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Pa({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=Sn(),{openSidePanel:yt}=Dn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=zn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Nt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=On(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Mn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?_n(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Rn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=Ln(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A($n(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S(Kn(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await In(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Tn(h,f),Xe=Pn(qt,v),Fe=F?.length??0,Ye=kn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
|
|
1
|
+
import{c as se,b as Me,r as u,j as r,k as fe,B as De,dZ as Jt,ay as Zt,aE as xe,d_ as en,d$ as tn,e0 as nn,e1 as rn,bH as on,e2 as sn,e3 as lt,aA as an,e4 as ln,e5 as cn,e6 as dn,e7 as un,e8 as fn,e9 as pn,ea as mn,eb as xn,ec as hn,m as le,o as gn,t as ne,K as Ze}from"./index-tHM8NTfd.js";import{F as bn,l as yn}from"./monaco-editor-AliIqm4c.js";import{G as vn,k as Cn,b0 as wn,b1 as Nn}from"./agent-icon-DW-jknHC.js";import{s as jn}from"./XClose-BcWYJ3jm.js";import{n as En}from"./automation-runs-D_CI6v6C.js";import{c as et,T as tt,a as nt}from"./tooltip-C4NGAgAM.js";import{b as Sn}from"./chat-context-4A5jyyEw.js";import{u as Dn}from"./shell-layout-DjpBxe62.js";import{i as Mn,E as Rn,a as Ae,b as Tn,f as Pn,g as kn,c as Fn,t as re,d as we,e as Le,h as Ne,j as Oe,k as Ie,l as An,s as Ln,v as On,m as $e,n as je,o as rt,p as In,q as Ee,r as Ke,w as $n,x as Kn,y as zn,z as _n}from"./index-B6pbxJBU.js";import{b as Gn,h as Bn,a as Vn,c as Un,d as Hn,e as qn}from"./dialog-D370feZI.js";import{I as ot}from"./input-CtPcKTyA.js";import{c as Wn,d as Qn,b as Xn,f as Yn,g as Jn,e as Zn,a as er,A as tr}from"./alert-dialog-B5UNzzAF.js";import{t as nr}from"./ChevronDown-cZoWRgvb.js";import{i as rr}from"./ChevronRight-CmrokxXJ.js";import"./delay-CnY5UFtP.js";import"./AlertCircle-DevA0A1M.js";import"./Tool01-B14PZEqF.js";import"./ArrowUp-CLXut3hx.js";import"./Settings02-k_lwzmTv.js";import"./Tool02-C-4pjcCY.js";import"./ArrowRight-Dq4C6lJ4.js";import"./ArrowUpRight-Bay5EW8Z.js";import"./TrendUp01-BVE2-KuE.js";import"./ZapSquare-DpSSWmnE.js";import"./Users03-C-mvAxcs.js";import"./CheckCircle-ck8m-YN6.js";import"./Check-DN6IPn_3.js";import"./ChevronUp-CswOdRaR.js";import"./DotsVertical-Db5Rriwt.js";import"./Stars02-Djd7mUzA.js";import"./Copy01-BGeJ_uJU.js";import"./Eye-BqdZYqpI.js";import"./FilterLines-BFxvHa0q.js";import"./Star01-Bv8b5o6W.js";import"./Palette-CgoT-TdN.js";import"./SwitchHorizontal01-C9T_FryU.js";import"./HardDrive-C1-SCHTe.js";import"./Key01-YwqEObkc.js";import"./LayoutLeft-BzJLVhVQ.js";import"./XCircle-Eu9CNvjp.js";import"./LinkExternal01-Dv9Aj-K0.js";import"./LogOut01-D1zBEUWi.js";import"./Monitor01-c_9oVNrI.js";import"./Sun-DZlLfVSj.js";import"./Play-DY15eh3c.js";import"./Plus-D7R6BF5R.js";import"./SearchLg-B1avg8bD.js";import"./SearchMd-B-lbf8c2.js";import"./Shield01-DFBgcYa0.js";import"./Stars01-CAvqsR90.js";import"./Trash01-DnjcslV5.js";import"./Upload01-uhey7zjg.js";import"./User01-DQzbx1Xu.js";import"./Users01-Ct4A_zsW.js";import"./X-DsJCvKBO.js";import"./Zap-BiPzgNTf.js";import"./select-QOGEC2YQ.js";import"./useInfiniteQuery-DAxuc5L-.js";import"./use-infinite-scroll-DFYxMuWT.js";import"./use-connection-uKN5YWIx.js";import"./use-mcp-client-BAwn-0AV.js";import"./auth-Btre_1OW.js";import"./use-virtual-mcp-DXStXtw1.js";import"./card-LK3SgMlx.js";import"./sidebar-DS29jp1e.js";import"./use-mobile-B-9CWMAs.js";import"./table-DunMqZev.js";import"./empty-state-Cj1VbJ0y.js";import"./use-members-C_p-7j4-.js";import"./use-org-auth-client-GW_RbwIG.js";import"./use-clock-tick-GBpMaXwL.js";import"./use-automations-RGeim-7x.js";import"./studio-tools-DBJ4BlKP.js";import"./useSuspenseInfiniteQuery-BwVy3QbN.js";import"./avatar-6012j4NF.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-EWLYbeWi.js";import"./tab-id-DLditg27.js";import"./hooks-DJ2YKeR9.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CFz6l2VG.js";import"./index-Dx1y19yx.js";import"./calendar-MyVXyluP.js";import"./integration-icon-C-2mN9ni.js";import"./use-navigate-to-agent-DEAiy9mr.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BWfAq2gc.js";import"./form-Dj_8GoDc.js";import"./label-Dx1_DE-f.js";import"./use-ai-providers-COkTONXg.js";import"./use-decopilot-events-DSmTv1gx.js";import"./use-organization-settings-D0V5wIDO.js";import"./required-auth-layout-C91T3YkY.js";import"./use-org-sso-C5GowRh9.js";import"./drawer-LhH6tqHN.js";import"./collection-search-C63j6Zzd.js";import"./index-DLoS2Gvr.js";import"./get-initials-D-f_fDFw.js";import"./popover-C3OgPzQD.js";import"./use-registry-app-D8hx17d1.js";import"./use-mcp-tools-CgtI4_xz.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DMOmyFRT.js";import"./mcp-oauth-Ch4TwOlY.js";import"./extract-connection-data-C8zhfgGc.js";import"./metadata-dUsYcpuu.js";import"./dropdown-menu-DBsO6utH.js";import"./command-DtoG6f_9.js";import"./index-CZWx2CTD.js";import"./companions-core-RUJyQPUT.js";import"./tabs-DXpVtqDW.js";import"./toggle-group-CugvhNWb.js";import"./use-deco-credits-ClFjXcZg.js";import"./toolbar-dY2heqgV.js";import"./skeleton-CVx36MXd.js";import"./github-repo-picker-CeuXOkGP.js";import"./use-debounced-value-DuOUoSmu.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./connection-card-BoF_KE8y.js";import"./use-registry-connections-o8h37zTy.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-hljn8moZ.js";import"./connection-form-helpers-DB9ro8Ha.js";import"./collection-tabs-C_e51TYz.js";import"./badge-kM5UAKst.js";import"./connect-desktop-dialog-Dj9gRQkE.js";import"./select-model-BjPHv_Dr.js";import"./checkbox-C9Nq068Z.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B7sLcI44.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DZIf-G4r.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-nY6kVL8r.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-Bbnk5NX6.js";import"./use-debounced-autosave-_O3PoKoh.js";import"./index-D6fjxFLg.js";import"./search-input-C_HmTn9N.js";import"./switch-BAMPQcFC.js";import"./use-secrets-C-31Hjoh.js";import"./useQueries-Dk_rR620.js";import"./use-file-configs-Bgb80job.js";import"./automation-list-row-C0qxtH51.js";const or={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function sr(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:h,onSubmit:f,onOpenChange:v}=i,j=l===void 0?"":l,d=h===void 0?!1:h,x=Me(),[g,k]=u.useState(j),[Z,q]=u.useState(s),y=or[a];s!==Z&&(q(s),s&&k(j));let b;e[0]!==d||e[1]!==v?(b=_=>{!_&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const F=b;let A;e[3]!==d||e[4]!==g||e[5]!==f?(A=async _=>{_.preventDefault();const te=g.trim();!te||d||await f(te)},e[3]=d,e[4]=g,e[5]=f,e[6]=A):A=e[6];const I=A;let S;e[7]!==y.titleKey||e[8]!==x?(S=x(y.titleKey),e[7]=y.titleKey,e[8]=x,e[9]=S):S=e[9];let P;e[10]!==S?(P=r.jsx(Gn,{children:S}),e[10]=S,e[11]=P):P=e[11];let D;e[12]!==y.descriptionKey||e[13]!==x?(D=x(y.descriptionKey),e[12]=y.descriptionKey,e[13]=x,e[14]=D):D=e[14];let M;e[15]!==D?(M=r.jsx(Bn,{children:D}),e[15]=D,e[16]=M):M=e[16];let N;e[17]!==P||e[18]!==M?(N=r.jsxs(Vn,{children:[P,M]}),e[17]=P,e[18]=M,e[19]=N):N=e[19];let R;e[20]!==m||e[21]!==x?(R=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(ot,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=R):R=e[22];let E;e[23]!==x?(E=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=E):E=e[24];let T;e[25]!==E?(T=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[25]=E,e[26]=T):T=e[26];let Q;e[27]===Symbol.for("react.memo_cache_sentinel")?(Q=_=>k(_.target.value),e[27]=Q):Q=e[27];let X;e[28]!==y.placeholderKey||e[29]!==x?(X=x(y.placeholderKey),e[28]=y.placeholderKey,e[29]=x,e[30]=X):X=e[30];let Y;e[31]!==d||e[32]!==g||e[33]!==X?(Y=r.jsx(ot,{id:"file-explorer-name",value:g,onChange:Q,placeholder:X,autoFocus:!0,disabled:d}),e[31]=d,e[32]=g,e[33]=X,e[34]=Y):Y=e[34];let G;e[35]!==T||e[36]!==Y?(G=r.jsxs("div",{className:"space-y-1.5",children:[T,Y]}),e[35]=T,e[36]=Y,e[37]=G):G=e[37];let $;e[38]!==R||e[39]!==G?($=r.jsxs("div",{className:"space-y-4 py-4",children:[R,G]}),e[38]=R,e[39]=G,e[40]=$):$=e[40];let W;e[41]!==v?(W=()=>v(!1),e[41]=v,e[42]=W):W=e[42];let K;e[43]!==x?(K=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=K):K=e[44];let z;e[45]!==d||e[46]!==W||e[47]!==K?(z=r.jsx(De,{type:"button",variant:"outline",onClick:W,disabled:d,children:K}),e[45]=d,e[46]=W,e[47]=K,e[48]=z):z=e[48];let B;e[49]!==d||e[50]!==g?(B=!g.trim()||d,e[49]=d,e[50]=g,e[51]=B):B=e[51];let L;e[52]!==y.submitKey||e[53]!==d||e[54]!==x?(L=d?r.jsxs(r.Fragment,{children:[r.jsx(fe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(y.submitKey),e[52]=y.submitKey,e[53]=d,e[54]=x,e[55]=L):L=e[55];let V;e[56]!==B||e[57]!==L?(V=r.jsx(De,{type:"submit",disabled:B,children:L}),e[56]=B,e[57]=L,e[58]=V):V=e[58];let O;e[59]!==z||e[60]!==V?(O=r.jsxs(Un,{children:[z,V]}),e[59]=z,e[60]=V,e[61]=O):O=e[61];let U;e[62]!==I||e[63]!==$||e[64]!==O||e[65]!==N?(U=r.jsx(Hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:I,children:[N,$,O]})}),e[62]=I,e[63]=$,e[64]=O,e[65]=N,e[66]=U):U=e[66];let ee;return e[67]!==F||e[68]!==s||e[69]!==U?(ee=r.jsx(qn,{open:s,onOpenChange:F,children:U}),e[67]=F,e[68]=s,e[69]=U,e[70]=ee):ee=e[70],ee}function ar(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:h}=i,f=Me(),v=s?.kind==="directory",j=s!==null,d=v?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==f||e[1]!==d?(x=f(d),e[0]=f,e[1]=d,e[2]=x):x=e[2];let g;e[3]!==x?(g=r.jsx(Wn,{children:x}),e[3]=x,e[4]=g):g=e[4];let k;e[5]!==f?(k=f("sandbox.fileExplorerDeleteDialog.description"),e[5]=f,e[6]=k):k=e[6];const Z=s?.name;let q;e[7]!==Z?(q=r.jsx("span",{className:"font-mono",children:Z}),e[7]=Z,e[8]=q):q=e[8];let y;e[9]!==v||e[10]!==f?(y=v?f("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=v,e[10]=f,e[11]=y):y=e[11];let b;e[12]!==a.length||e[13]!==f?(b=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?f("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):f("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=f,e[14]=b):b=e[14];let F;e[15]!==k||e[16]!==q||e[17]!==y||e[18]!==b?(F=r.jsxs(Qn,{children:[k," ",q,y,b]}),e[15]=k,e[16]=q,e[17]=y,e[18]=b,e[19]=F):F=e[19];let A;e[20]!==F||e[21]!==g?(A=r.jsxs(Xn,{children:[g,F]}),e[20]=F,e[21]=g,e[22]=A):A=e[22];let I;e[23]!==f?(I=f("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=f,e[24]=I):I=e[24];let S;e[25]!==l||e[26]!==I?(S=r.jsx(Yn,{disabled:l,children:I}),e[25]=l,e[26]=I,e[27]=S):S=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==h?(D=Q=>{Q.preventDefault(),s&&h(s)},e[28]=s,e[29]=h,e[30]=D):D=e[30];let M;e[31]!==f?(M=f("sandbox.fileExplorerDeleteDialog.delete"),e[31]=f,e[32]=M):M=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==M?(N=r.jsx(Jn,{disabled:P,onClick:D,children:M}),e[33]=P,e[34]=D,e[35]=M,e[36]=N):N=e[36];let R;e[37]!==S||e[38]!==N?(R=r.jsxs(Zn,{children:[S,N]}),e[37]=S,e[38]=N,e[39]=R):R=e[39];let E;e[40]!==A||e[41]!==R?(E=r.jsxs(er,{children:[A,R]}),e[40]=A,e[41]=R,e[42]=E):E=e[42];let T;return e[43]!==m||e[44]!==j||e[45]!==E?(T=r.jsx(tr,{open:j,onOpenChange:m,children:E}),e[43]=m,e[44]=j,e[45]=E,e[46]=T):T=e[46],T}var ze="ContextMenu",[ir]=an(ze,[lt]),J=lt(),[lr,ct]=ir(ze),dt=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[h,f]=u.useState(!1),v=J(e),j=on(a),d=u.useCallback(x=>{f(x),j(x)},[j]);return r.jsx(lr,{scope:e,open:h,onOpenChange:d,modal:m,children:r.jsx(sn,{...v,dir:l,open:h,onOpenChange:d,modal:m,children:s})})};dt.displayName=ze;var ut="ContextMenuTrigger",ft=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ct(ut,s),h=J(s),f=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...f.current})}),j=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(j.current),[]),x=g=>{f.current={x:g.clientX,y:g.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Jt,{...h,virtualRef:v}),r.jsx(Zt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:xe(i.onContextMenu,g=>{d(),x(g),g.preventDefault()}),onPointerDown:a?i.onPointerDown:xe(i.onPointerDown,Se(g=>{d(),j.current=window.setTimeout(()=>x(g),700)})),onPointerMove:a?i.onPointerMove:xe(i.onPointerMove,Se(d)),onPointerCancel:a?i.onPointerCancel:xe(i.onPointerCancel,Se(d)),onPointerUp:a?i.onPointerUp:xe(i.onPointerUp,Se(d))})]})});ft.displayName=ut;var cr="ContextMenuPortal",pt=i=>{const{__scopeContextMenu:e,...s}=i,a=J(e);return r.jsx(nn,{...a,...s})};pt.displayName=cr;var mt="ContextMenuContent",xt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ct(mt,s),m=J(s),h=u.useRef(!1);return r.jsx(rn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:f=>{i.onCloseAutoFocus?.(f),!f.defaultPrevented&&h.current&&f.preventDefault(),h.current=!1},onInteractOutside:f=>{i.onInteractOutside?.(f),!f.defaultPrevented&&!l.modal&&(h.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xt.displayName=mt;var dr="ContextMenuGroup",ur=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(ln,{...l,...a,ref:e})});ur.displayName=dr;var fr="ContextMenuLabel",pr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(cn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuItem",ht=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(en,{...l,...a,ref:e})});ht.displayName=mr;var xr="ContextMenuCheckboxItem",hr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(dn,{...l,...a,ref:e})});hr.displayName=xr;var gr="ContextMenuRadioGroup",br=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(un,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioItem",vr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(fn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuItemIndicator",wr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(pn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuSeparator",gt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(tn,{...l,...a,ref:e})});gt.displayName=Nr;var jr="ContextMenuArrow",Er=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(mn,{...l,...a,ref:e})});Er.displayName=jr;var Sr="ContextMenuSubTrigger",Dr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(xn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubContent",Rr=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=J(s);return r.jsx(hn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Rr.displayName=Mr;function Se(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var Tr=dt,Pr=ft,kr=pt,Fr=xt,Ar=ht,Lr=gt;function Or(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Tr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ir(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Pr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(kr,{children:r.jsx(Fr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function ue(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const h=m===void 0?"default":m;let f;e[5]!==s?(f=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=f):f=e[6];let v;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==h?(v=r.jsx(Ar,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:f,...l}),e[7]=a,e[8]=l,e[9]=f,e[10]=h,e[11]=v):v=e[11],v}function st(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Lr,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const Kr="#d9a441";function zr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:h,fileVisual:f,onOpen:v,onSelect:j,onNewFile:d,onNewFolder:x,onCopyPath:g,onCopyRelativePath:k,onRename:Z,onDelete:q}=i,y=h===void 0?!1:h,b=Me(),F=s.kind==="directory",{Icon:A,color:I}=f,S=m&&"bg-accent";let P;e[0]!==S?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",S),e[0]=S,e[1]=P):P=e[1];const D=`${a*14+8}px`;let M;e[2]!==D?(M={paddingLeft:D},e[2]=D,e[3]=M):M=e[3];let N;e[4]!==v||e[5]!==j?(N=()=>{j(),v()},e[4]=v,e[5]=j,e[6]=N):N=e[6];let R;e[7]!==A||e[8]!==I||e[9]!==F||e[10]!==l||e[11]!==y?(R=F?r.jsxs(r.Fragment,{children:[y?r.jsx(fe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(nr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(rr,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(vn,{size:16,className:"shrink-0",style:{color:Kr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(A,{size:16,className:"shrink-0",style:{color:I}})]}),e[7]=A,e[8]=I,e[9]=F,e[10]=l,e[11]=y,e[12]=R):R=e[12];let E;e[13]!==s.name?(E=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=E):E=e[14];let T;e[15]!==P||e[16]!==M||e[17]!==N||e[18]!==R||e[19]!==E?(T=r.jsx(Ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:M,onClick:N,children:[R,E]})}),e[15]=P,e[16]=M,e[17]=N,e[18]=R,e[19]=E,e[20]=T):T=e[20];let Q;e[21]!==b?(Q=b("sandbox.fileTreeRow.newFile"),e[21]=b,e[22]=Q):Q=e[22];let X;e[23]!==d||e[24]!==Q?(X=r.jsx(ue,{onSelect:d,children:Q}),e[23]=d,e[24]=Q,e[25]=X):X=e[25];let Y;e[26]!==b?(Y=b("sandbox.fileTreeRow.newFolder"),e[26]=b,e[27]=Y):Y=e[27];let G;e[28]!==x||e[29]!==Y?(G=r.jsx(ue,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=G):G=e[30];let $;e[31]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx(st,{}),e[31]=$):$=e[31];let W;e[32]!==b?(W=b("sandbox.fileTreeRow.copyPath"),e[32]=b,e[33]=W):W=e[33];let K;e[34]!==g||e[35]!==W?(K=r.jsx(ue,{onSelect:g,children:W}),e[34]=g,e[35]=W,e[36]=K):K=e[36];let z;e[37]!==b?(z=b("sandbox.fileTreeRow.copyRelativePath"),e[37]=b,e[38]=z):z=e[38];let B;e[39]!==k||e[40]!==z?(B=r.jsx(ue,{onSelect:k,children:z}),e[39]=k,e[40]=z,e[41]=B):B=e[41];let L;e[42]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(st,{}),e[42]=L):L=e[42];let V;e[43]!==b?(V=b("sandbox.fileTreeRow.rename"),e[43]=b,e[44]=V):V=e[44];let O;e[45]!==Z||e[46]!==V?(O=r.jsx(ue,{onSelect:Z,children:V}),e[45]=Z,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==b?(U=b("sandbox.fileTreeRow.delete"),e[48]=b,e[49]=U):U=e[49];let ee;e[50]!==q||e[51]!==U?(ee=r.jsx(ue,{variant:"destructive",onSelect:q,children:U}),e[50]=q,e[51]=U,e[52]=ee):ee=e[52];let _;e[53]!==X||e[54]!==G||e[55]!==K||e[56]!==B||e[57]!==O||e[58]!==ee?(_=r.jsxs($r,{className:"w-52",children:[X,G,$,K,B,L,O,ee]}),e[53]=X,e[54]=G,e[55]=K,e[56]=B,e[57]=O,e[58]=ee,e[59]=_):_=e[59];let te;return e[60]!==_||e[61]!==T?(te=r.jsxs(Or,{children:[T,_]}),e[60]=_,e[61]=T,e[62]=te):te=e[62],te}yn.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const at=200,_r=2,Gr=250,it=200;function Br(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function Vr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,h;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:v,segments:j}=An(s,a);l="truncate font-mono text-muted-foreground",m=v&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),h=j.map(Ur),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=h}else l=e[2],m=e[3],h=e[4];let f;return e[5]!==l||e[6]!==m||e[7]!==h?(f=r.jsxs("span",{className:l,children:[m,h]}),e[5]=l,e[6]=m,e[7]=h,e[8]=f):f=e[8],f}function Ur(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Pa({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[l,m]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:f}=l,[v,j]=u.useState(new Set),[d,x]=u.useState(null),[g,k]=u.useState(null),[Z,q]=u.useState([]),[y,b]=u.useState(""),[F,A]=u.useState(null),[I,S]=u.useState(null),[P,D]=u.useState(!1),[M,N]=u.useState(!1),[R,E]=u.useState(!1),[T,Q]=u.useState(!1),[,X]=u.useState(new Set),[Y,G]=u.useState(new Set),$=u.useRef(0),W=u.useRef(null),K=u.useRef(new Set),z=u.useRef(new Map),B=u.useRef(null),L=u.useRef(0),V=u.useRef(null),O=u.useRef(null),U=u.useRef(null);function ee(t){X(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[_,te]=u.useState(new Map),Re=u.useRef(null),[ae,he]=u.useState(null),{sendMessage:bt}=Sn(),{openSidePanel:yt}=Dn(),ge=gn(),[H,oe]=u.useState(null),[Te,Pe]=u.useState(null),[be,ye]=u.useState(!1);async function ie(t,n){const o=await fetch(Br(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function ve(){ge.invalidateQueries({queryKey:rt(i,e,s)})}function _e(t,n,o){navigator.clipboard.writeText(o).then(()=>ne.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>ne.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function vt(t){const n=zn(t);if(!n)return;const o=`${i}/${e}/${s}`;ge.setQueryData(Ze.decofile(o),c=>{if(!c)return c;const{[n]:p,...C}=c;return C}),ge.invalidateQueries({queryKey:Ze.liveMeta(i,e,s)})}function Ct(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>we(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)vt(o)}function wt(t){const n=we(t);return Z.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=_.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ge(t){q(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),te(n=>{const o=new Map;for(const[c,p]of n){const C=t(c);C&&o.set(C,p)}return o}),k(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Nt(t){const n=we(t);k(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ge(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function jt(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await pe(),await ve(),oe(null),me(o)}async function Et(t,n){if(!H)return;const o=Ee(H.parentDir,n);if(Ke(o,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),m(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await pe(),await ve(),oe(null),j(p=>{const C=new Set(p);for(const ce of Ie(o))C.add(ce);return C.add(o),C}),k({name:n,path:o,kind:"directory",children:[]})}async function St(t,n){if(!H)return;const o=H.node.path,c=Ne(o),p=Ee(c,n);if(p===o){oe(null);return}if(Ke(p,h,f))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ge(C=>C===o?p:C.startsWith(`${o}/`)?Ee(p,C.slice(o.length+1)):C),await pe(),await ve(),oe(null)}async function Dt(t,n){ye(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Ct(n),Nt(n.path),await pe(),await ve(),Pe(null),ne.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){ne.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{ye(!1)}}async function Mt(t,n){const o=On(n);if(o){ne.error(o);return}ye(!0);try{H?.mode==="new-file"?(await jt(t,n),ne.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):H?.mode==="new-folder"?(await Et(t,n),ne.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):H?.mode==="rename"&&(await St(t,n),ne.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){ne.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{ye(!1)}}const Be=u.useRef(!1);Be.current||(Be.current=!0,W.current=pe());const[Rt,Tt]=u.useState(null),w=Me();if(a&&a!==Rt){Tt(a);const t=a;queueMicrotask(()=>{Mn(t)&&me(t)})}async function ke(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Ve(t,n,o){if(o!==$.current)return!1;let c=!1;return m(p=>{const C=n?_n(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!C.truncated,{files:C.files,directories:C.directories,truncated:c}}),c&&ne.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Pt(t){const n=z.current.get(t);if(n)return n;const o=$.current,c=(async()=>{const p=await ke({pattern:"**/*",path:re(t),limit:Ae}),C=Ve(p,!0,o);return!C&&o===$.current&&ee(ce=>{const Ce=new Set(ce);return Ce.add(t),Ce}),C})();z.current.set(t,c);try{return await c}finally{z.current.delete(t)}}async function Ue(t){if(!$e(t,K.current))return!1;G(n=>new Set(n).add(t));try{return await Pt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function kt(t,n){const o=new Set(K.current);for(const c of Ie(n)){if(!$e(c,o))continue;if(await Ue(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function pe(){const t=++$.current;V.current=null,O.current=null,z.current.clear(),E(!0),ee(new Set),j(new Set),G(new Set);try{const n=await ke({pattern:"**/*",limit:Ae,maxDepth:Rn});Ve(n,!1,t),Q(!0)}catch{T&&ne.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{E(!1)}}async function He(t){if(!_.get(t)?.loaded){te(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=Ln(o.content??"");te(p=>{const C=new Map(p);return C.set(t,{savedContent:c,editorValue:c,loaded:!0}),C})}catch{}}}function Ft(){L.current++,A(null),S(null),D(!1),N(!1)}async function At(){const t=$.current,n=V.current;if(n&&n.generation===t)return n.files;const o=O.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await ke({pattern:"**/*",limit:Ae});return $.current===t&&(V.current={generation:t,files:p.files}),p.files})();O.current={generation:t,promise:c};try{return await c}finally{O.current?.generation===t&&(O.current=null)}}async function Lt(t,n){try{const o=await At();if(n!==L.current)return;A($n(o,t,it))}catch{if(n!==L.current)return;A([])}}async function Ot(t,n){D(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:at});if(n!==L.current)return;S(Kn(o.results??"")),N((o.matchCount??0)>=at)}catch{if(n!==L.current)return;S([]),N(!1)}finally{n===L.current&&D(!1)}}function It(t){const n=t.trim(),o=++L.current;Lt(n,o),n.length<_r?(S(null),D(!1),N(!1)):Ot(n,o)}function $t(t){if(b(t),B.current&&clearTimeout(B.current),!t.trim()){Ft();return}B.current=setTimeout(()=>{It(t)},Gr)}function qe(t){const n=U.current;if(!n||n.path!==d)return;U.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function Kt(t){U.current={path:t.path,line:t.line};const n=d===t.path&&_.get(t.path)?.loaded;me(t.path),n&&Re.current&&qe(Re.current)}async function zt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ge.invalidateQueries({queryKey:rt(i,e,s)});try{const o=await In(i,e,s);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}te(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function _t(t){x(t),k({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),he(null),Z.includes(t)||q(n=>[...n,t]),He(t)}function Gt(t){q(n=>{const o=n.filter(c=>c!==t);return d===t&&x(o[o.length-1]??null),o}),te(n=>{const o=new Map(n);return o.delete(t),o})}function We(t){j(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Bt(t){if($e(t,K.current))try{if(await Ue(t))return}catch(n){ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}We(t)}async function Vt(t,n){if(n){We(t);return}await Bt(t)}async function Ut(t){await W.current,await kt(w,t);const n=Ie(t);j(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),_t(t)}function me(t){Ut(t).catch(n=>{ne.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Ht(){return g?.kind==="directory"?g.path:g?.kind==="file"?Ne(g.path):d?Ne(d):"/"}function Qe(t){const n=Ht();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const qt=Tn(h,f),Xe=Pn(qt,v),Fe=F?.length??0,Ye=kn(I??[]),Je=I?.length??0,de=d?_.get(d):null,Wt=de?.loaded&&de.editorValue!==de.savedContent,Qt=Te?wt(Te.path):[],Xt=(t,n)=>{Re.current=t,qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await zt(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!d)return;const p=c.getValueInRange(o);he({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Yt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Oe(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),yt("chat"),bt({parts:[{type:"text",text:n.join(`
|
|
2
2
|
`)}]}),he(null)}return R&&!T?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(Cn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:y,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Qe("new-file"),children:r.jsx(wn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(et,{children:[r.jsx(tt,{asChild:!0,children:r.jsx(De,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Qe("new-folder"),children:r.jsx(Nn,{size:14})})}),r.jsx(nt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(En,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!y&&Xe.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=v.has(n.path),C=g?.path===n.path,ce=Fn(n.path,n.kind),Ce=c&&Y.has(n.path);return r.jsx(zr,{node:n,depth:o,isExpanded:p,isSelected:C,isLoading:Ce,fileVisual:Le(n.name),onSelect:()=>k(n),onOpen:()=>{c?Vt(n.path,p):me(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>_e(w,"Path",we(n.path)),onCopyRelativePath:()=>_e(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Pe(n)},n.path)}),!y&&T&&Xe.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Fe>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Fe,Fe>=it?"+":""]})]}),F!==null&&F.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),F?.map(t=>{const n=t.split("/").pop()??t,o=Ne(t),{Icon:c,color:p}=Le(n),C=d===t;return r.jsxs("button",{type:"button",onClick:()=>me(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",C&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),y&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),Je>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[Je,M?"+":""]}),P&&r.jsx(fe,{size:10,className:"animate-spin"})]}),!P&&I!==null&&Ye.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ye.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Le(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>Kt(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(Vr,{text:p.text,query:y})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[Z.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:Z.map(t=>{const n=_.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=d===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),He(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:C=>{C.stopPropagation(),Gt(t)},children:r.jsx(jn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Yt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&he(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&de?.loaded?r.jsx(bn,{language:Oe(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:de.editorValue,path:d,onChange:t=>{const n=d;n&&te(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Xt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!de?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(fe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[w(Wt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Oe(d)]})]})]}),r.jsx(sr,{open:H!==null,mode:H?.mode??"new-file",initialName:H?.mode==="rename"?H.node.name:"",parentLabel:H&&H.mode!=="rename"?H.parentDir==="/"?"/":re(H.parentDir):void 0,isPending:be,onSubmit:t=>Mt(w,t),onOpenChange:t=>{!t&&!be&&oe(null)}}),r.jsx(ar,{deleteTarget:Te,deleteDirtyPaths:Qt,fsActionPending:be,onOpenChange:t=>{!t&&!be&&Pe(null)},onConfirm:t=>{Dt(w,t)}})]})}export{Pa as FileExplorer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dN as C,c as d,j as c,a5 as j,r as f,m as p,b5 as b,dO as v,dP as N}from"./index-
|
|
1
|
+
import{dN as C,c as d,j as c,a5 as j,r as f,m as p,b5 as b,dO as v,dP as N}from"./index-tHM8NTfd.js";import{L as h}from"./label-Dx1_DE-f.js";const E=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=N(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function P(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function w(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(h,{"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 L(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,P as b,w as c,L as d,R as e,y as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as G,F as te,r as Z,j as i,B as J,L as ge,W as de,X,b as Y,d as me,o as ue,Z as fe,Y as pe,e as oe,p as ee,t as q,K as ie,a5 as se,G as ne,w as he}from"./index-D3OCvKaU.js";import{P as M}from"./index-DeO_SMjA.js";import{A as xe,b as je}from"./alert-BrYvcVNo.js";import{i as Se}from"./ArrowRight-D1F_c8mU.js";import{n as ze}from"./LinkExternal01-DsH5I9jm.js";import{s as ve}from"./XClose-B6aD5HLV.js";import{u as be}from"./use-org-auth-client-BFAUjn-N.js";import{u as ye}from"./use-debounced-autosave-3BGJnmLE.js";import{A as Oe}from"./avatar-CtA1rHBR.js";import{I as ae}from"./input-Bs4tcVhT.js";import{S as re,a as le,b as Q,c as Ce}from"./settings-section-Dgg5nCua.js";import{D as we}from"./domain-settings-DHJNEbEZ.js";import{u as De}from"./studio-tools-D5UPG7xq.js";import{c as _e,d as Ae,b as Ne,f as Fe,g as Te,e as Ee,a as Pe,A as Re}from"./alert-dialog-DdeUN0gs.js";import{R as ke}from"./require-capability-BYjfZMZ1.js";import"./sidebar-BjYwCtXi.js";import"./LayoutLeft-CWKaiAHc.js";import"./use-mobile-B9xC4LZs.js";import"./X-DsUhkCER.js";import"./tooltip-DrF8Dycy.js";import"./User01-BTBcFc9z.js";import"./card-C_7Dfz9P.js";import"./ArrowUpRight-pyqwDg-l.js";import"./badge-DLw-128i.js";import"./select-CPtJAf28.js";import"./Check-Du2CH0Qx.js";import"./ChevronDown-CIPwphYr.js";import"./ChevronUp-f9GdHpvo.js";import"./use-capability-hQ0DXv0z.js";import"./access-gate-CKUKLx71.js";import"./capability-load-error-BSRBDTUF.js";function ce(e){return`connect-banner-dismissed:${e}`}function Le(e){if(typeof window>"u")return!0;try{return localStorage.getItem(ce(e))==="1"}catch{return!1}}function Ie(){const e=G.c(17),{org:t}=te();let n;e[0]!==t.id?(n=()=>Le(t.id),e[0]=t.id,e[1]=n):n=e[1];const[u,p]=Z.useState(n);if(u)return null;let o;e[2]!==t.id?(o=()=>{p(!0);try{localStorage.setItem(ce(t.id),"1")}catch{}},e[2]=t.id,e[3]=o):o=e[3];const g=o;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ze,{}),e[4]=d):d=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=l):l=e[5];let c;e[6]!==t.slug?(c={org:t.slug},e[6]=t.slug,e[7]=c):c=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Se,{size:12}),e[8]=m):m=e[8];let s;e[9]!==c?(s=i.jsx(J,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(ge,{to:"/$org/settings/connect",params:c,children:["Connect to clients ",m]})}),e[9]=c,e[10]=s):s=e[10];let a;e[11]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(ve,{size:14}),e[11]=a):a=e[11];let r;e[12]!==g?(r=i.jsx(J,{variant:"ghost",size:"icon",className:"size-7",onClick:g,"aria-label":"Dismiss",children:a}),e[12]=g,e[13]=r):r=e[13];let f;return e[14]!==s||e[15]!==r?(f=i.jsxs(xe,{variant:"info",className:"items-center",children:[d,i.jsxs(je,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[l,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s,r]})]})]}),e[14]=s,e[15]=r,e[16]=f):f=e[16],f}const $e=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function Be(e){return typeof e=="string"&&$e.has(e.trim().toLowerCase())}const qe=de({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!Be(e),"This organization URL is reserved by Studio"),logo:X().optional()});function Ge(e){const t=G.c(17),{value:n,onChange:u,name:p,disabled:o}=e,g=Y(),d=Z.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>d.current?.click(),t[0]=l):l=t[0];const c=l;let m;t[1]!==u||t[2]!==g?(m=W=>{const S=W.target.files?.[0];if(!S)return;if(S.size>2097152){q.error(g("settings.organizationForm.imageTooLarge"));return}const x=new FileReader;x.onerror=()=>q.error(g("settings.organizationForm.failedToReadImage")),x.onloadend=()=>{x.result&&u(x.result),d.current&&(d.current.value="")},x.readAsDataURL(S)},t[1]=u,t[2]=g,t[3]=m):m=t[3];const s=m;let a;t[4]!==g?(a=g("settings.organizationForm.uploadLogoLabel"),t[4]=g,t[5]=a):a=t[5];let r;t[6]!==o||t[7]!==s?(r=i.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),t[6]=o,t[7]=s,t[8]=r):r=t[8];const f=n||void 0,j=p??"?";let h;t[9]!==f||t[10]!==j?(h=i.jsx(Oe,{url:f,fallback:j,shape:"square",size:"base"}),t[9]=f,t[10]=j,t[11]=h):h=t[11];let z;return t[12]!==o||t[13]!==a||t[14]!==r||t[15]!==h?(z=i.jsxs("button",{type:"button",onClick:c,disabled:o,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":a,children:[r,h]}),t[12]=o,t[13]=a,t[14]=r,t[15]=h,t[16]=z):z=t[16],z}function Ve(){const e=Y(),t=me(),{org:n}=te(),u=be(),p=ue(),o=fe({resolver:pe(qe),values:{name:n.name??"",slug:n.slug??"",logo:n.logo??""}}),g=oe({mutationFn:async s=>{const a={name:s.name,slug:s.slug};s.logo&&(a.logo=s.logo);const r=await u.organization.update({data:a});if(r?.error)throw new Error(r.error.message||e("settings.organizationForm.failedToUpdateOrg"));return r},onSuccess:(s,a)=>{ee("organization_settings_updated",{organization_id:n.id,fields:Object.keys(a)}),p.invalidateQueries({queryKey:ie.organizations()}),p.invalidateQueries({queryKey:ie.activeOrganization(n.slug)}),q.success(e("settings.organizationForm.updateSuccess")),s?.data?.slug&&s.data.slug!==n.slug&&t({to:"/$org/settings/general",params:{org:s.data.slug}})},onError:(s,a)=>{ee("organization_settings_update_failed",{organization_id:n.id,fields:Object.keys(a),error:s instanceof Error?s.message:String(s)}),q.error(s instanceof Error?s.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:d,flush:l}=ye({save:async()=>{const s=o.control._formState.dirtyFields;if(Object.keys(s).length===0||!await o.trigger())return;const r=o.getValues(),f=o.control._defaultValues;o.reset(r,{keepValues:!0});try{await g.mutateAsync(r)}catch{o.reset(f,{keepValues:!0})}}}),c=o.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(re,{children:i.jsxs(le,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(Ge,{value:o.watch("logo"),onChange:s=>{o.setValue("logo",s??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(se,{control:o.control,name:"name",render:({field:s})=>i.jsx(ae,{id:"org-name",...s,onChange:a=>{s.onChange(a),d()},onBlur:()=>{s.onBlur(),l()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[m&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),i.jsx(se,{control:o.control,name:"slug",render:({field:s})=>i.jsx("input",{id:"org-slug",value:s.value??"",name:s.name,ref:s.ref,placeholder:e("settings.organizationForm.slugPlaceholder"),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:a=>{const r=a.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",r,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),d()},onBlur:()=>{s.onBlur(),l()}})})]})}),(c.name||c.slug||c.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&i.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&i.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&i.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]})]})})}function Ue(){const e=G.c(86),t=Y(),{org:n}=te(),[u,p]=Z.useState(!1),[o,g]=Z.useState(""),d=De();let l;e[0]!==n.id||e[1]!==d?(l=async()=>{await d.call("ORGANIZATION_DELETE",{id:n.id})},e[0]=n.id,e[1]=d,e[2]=l):l=e[2];let c;e[3]!==n.id||e[4]!==n.slug||e[5]!==t?(c=()=>{ee("organization_deleted",{organization_id:n.id}),localStorage.getItem(ne.lastOrgSlug())===n.slug&&localStorage.removeItem(ne.lastOrgSlug()),he(),q.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=n.id,e[4]=n.slug,e[5]=t,e[6]=c):c=e[6];let m;e[7]!==t?(m=v=>{q.error(v instanceof Error?v.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=m):m=e[8];let s;e[9]!==l||e[10]!==c||e[11]!==m?(s={mutationFn:l,onSuccess:c,onError:m},e[9]=l,e[10]=c,e[11]=m,e[12]=s):s=e[12];const a=oe(s);let r;e[13]!==t?(r=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=r):r=e[14];let f;e[15]!==t?(f=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=f):f=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let h;e[19]!==t?(h=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=h):h=e[20];let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=()=>p(!0),e[21]=z):z=e[21];const W=a.isPending;let S;e[22]!==t?(S=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=S):S=e[23];let x;e[24]!==a.isPending||e[25]!==S?(x=i.jsx(J,{variant:"destructive",size:"sm",onClick:z,disabled:W,children:S}),e[24]=a.isPending,e[25]=S,e[26]=x):x=e[26];let b;e[27]!==x||e[28]!==j||e[29]!==h?(b=i.jsx(le,{className:"border-destructive/40",children:i.jsx(Q,{title:j,description:h,action:x})}),e[27]=x,e[28]=j,e[29]=h,e[30]=b):b=e[30];let y;e[31]!==b||e[32]!==r||e[33]!==f?(y=i.jsx(re,{title:r,description:f,children:b}),e[31]=b,e[32]=r,e[33]=f,e[34]=y):y=e[34];let V;e[35]===Symbol.for("react.memo_cache_sentinel")?(V=v=>{p(v),v||g("")},e[35]=V):V=e[35];let O;e[36]!==t?(O=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=O):O=e[37];let C;e[38]!==O?(C=i.jsx(_e,{children:O}),e[38]=O,e[39]=C):C=e[39];let w;e[40]!==n.name||e[41]!==t?(w=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:n.name}),e[40]=n.name,e[41]=t,e[42]=w):w=e[42];let D;e[43]!==w?(D=i.jsx("p",{children:w}),e[43]=w,e[44]=D):D=e[44];let _;e[45]!==n.name||e[46]!==t?(_=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:n.name}),e[45]=n.name,e[46]=t,e[47]=_):_=e[47];let A;e[48]!==_?(A=i.jsx("p",{className:"mt-3 mb-1.5",children:_}),e[48]=_,e[49]=A):A=e[49];let U;e[50]===Symbol.for("react.memo_cache_sentinel")?(U=v=>g(v.target.value),e[50]=U):U=e[50];let N;e[51]!==o||e[52]!==n.name?(N=i.jsx(ae,{value:o,onChange:U,placeholder:n.name,autoFocus:!0}),e[51]=o,e[52]=n.name,e[53]=N):N=e[53];let F;e[54]!==D||e[55]!==A||e[56]!==N?(F=i.jsx(Ae,{asChild:!0,children:i.jsxs("div",{children:[D,A,N]})}),e[54]=D,e[55]=A,e[56]=N,e[57]=F):F=e[57];let T;e[58]!==C||e[59]!==F?(T=i.jsxs(Ne,{children:[C,F]}),e[58]=C,e[59]=F,e[60]=T):T=e[60];let E;e[61]!==t?(E=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=E):E=e[62];let P;e[63]!==E?(P=i.jsx(Fe,{children:E}),e[63]=E,e[64]=P):P=e[64];let R;e[65]!==a?(R=()=>a.mutate(),e[65]=a,e[66]=R):R=e[66];const H=o!==n.name||a.isPending;let k;e[67]!==a.isPending||e[68]!==t?(k=a.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=a.isPending,e[68]=t,e[69]=k):k=e[69];let L;e[70]!==R||e[71]!==H||e[72]!==k?(L=i.jsx(Te,{onClick:R,disabled:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:k}),e[70]=R,e[71]=H,e[72]=k,e[73]=L):L=e[73];let I;e[74]!==P||e[75]!==L?(I=i.jsxs(Ee,{children:[P,L]}),e[74]=P,e[75]=L,e[76]=I):I=e[76];let $;e[77]!==T||e[78]!==I?($=i.jsxs(Pe,{children:[T,I]}),e[77]=T,e[78]=I,e[79]=$):$=e[79];let B;e[80]!==u||e[81]!==$?(B=i.jsx(Re,{open:u,onOpenChange:V,children:$}),e[80]=u,e[81]=$,e[82]=B):B=e[82];let K;return e[83]!==y||e[84]!==B?(K=i.jsxs(i.Fragment,{children:[y,B]}),e[83]=y,e[84]=B,e[85]=K):K=e[85],K}function Ke(){const e=G.c(10),t=Y();let n;e[0]!==t?(n=t("settings.orgGeneral.organization"),e[0]=t,e[1]=n):n=e[1];let u;e[2]!==n?(u=i.jsx(M.Title,{children:n}),e[2]=n,e[3]=u):u=e[3];let p,o,g,d;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Ie,{}),o=i.jsx(Ve,{}),g=i.jsx(we,{}),d=i.jsx(Ue,{}),e[4]=p,e[5]=o,e[6]=g,e[7]=d):(p=e[4],o=e[5],g=e[6],d=e[7]);let l;return e[8]!==u?(l=i.jsx(M,{children:i.jsx(M.Content,{children:i.jsx(M.Body,{children:i.jsxs(Ce,{children:[u,p,o,g,d]})})})}),e[8]=u,e[9]=l):l=e[9],l}function yt(){const e=G.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(ke,{capability:"org:manage",area:"general settings",children:i.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{yt as default};
|
|
1
|
+
import{c as G,F as te,r as Z,j as i,B as J,L as ge,W as de,X,b as Y,d as me,o as ue,Z as fe,Y as pe,e as oe,p as ee,t as q,K as ie,a5 as se,G as ne,w as he}from"./index-tHM8NTfd.js";import{P as M}from"./index-D6fjxFLg.js";import{A as xe,b as je}from"./alert-DM1JMd0G.js";import{i as Se}from"./ArrowRight-Dq4C6lJ4.js";import{n as ze}from"./LinkExternal01-Dv9Aj-K0.js";import{s as ve}from"./XClose-BcWYJ3jm.js";import{u as be}from"./use-org-auth-client-GW_RbwIG.js";import{u as ye}from"./use-debounced-autosave-_O3PoKoh.js";import{A as Oe}from"./avatar-6012j4NF.js";import{I as ae}from"./input-CtPcKTyA.js";import{S as re,a as le,b as Q,c as Ce}from"./settings-section-B7sLcI44.js";import{D as we}from"./domain-settings-6514J2nW.js";import{u as De}from"./studio-tools-DBJ4BlKP.js";import{c as _e,d as Ae,b as Ne,f as Fe,g as Te,e as Ee,a as Pe,A as Re}from"./alert-dialog-B5UNzzAF.js";import{R as ke}from"./require-capability-B-Sqx0zT.js";import"./sidebar-DS29jp1e.js";import"./LayoutLeft-BzJLVhVQ.js";import"./use-mobile-B-9CWMAs.js";import"./X-DsJCvKBO.js";import"./tooltip-C4NGAgAM.js";import"./User01-DQzbx1Xu.js";import"./card-LK3SgMlx.js";import"./ArrowUpRight-Bay5EW8Z.js";import"./badge-kM5UAKst.js";import"./select-QOGEC2YQ.js";import"./Check-DN6IPn_3.js";import"./ChevronDown-cZoWRgvb.js";import"./ChevronUp-CswOdRaR.js";import"./use-capability-nY6kVL8r.js";import"./access-gate-BUe45Oc3.js";import"./capability-load-error-DXOesTij.js";function ce(e){return`connect-banner-dismissed:${e}`}function Le(e){if(typeof window>"u")return!0;try{return localStorage.getItem(ce(e))==="1"}catch{return!1}}function Ie(){const e=G.c(17),{org:t}=te();let n;e[0]!==t.id?(n=()=>Le(t.id),e[0]=t.id,e[1]=n):n=e[1];const[u,p]=Z.useState(n);if(u)return null;let o;e[2]!==t.id?(o=()=>{p(!0);try{localStorage.setItem(ce(t.id),"1")}catch{}},e[2]=t.id,e[3]=o):o=e[3];const g=o;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ze,{}),e[4]=d):d=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("span",{children:"Use Studio MCP anywhere — paste a command into Claude Code, Cursor, Codex, or any MCP client."}),e[5]=l):l=e[5];let c;e[6]!==t.slug?(c={org:t.slug},e[6]=t.slug,e[7]=c):c=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Se,{size:12}),e[8]=m):m=e[8];let s;e[9]!==c?(s=i.jsx(J,{asChild:!0,size:"sm",variant:"ghost",className:"text-xs gap-1",children:i.jsxs(ge,{to:"/$org/settings/connect",params:c,children:["Connect to clients ",m]})}),e[9]=c,e[10]=s):s=e[10];let a;e[11]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(ve,{size:14}),e[11]=a):a=e[11];let r;e[12]!==g?(r=i.jsx(J,{variant:"ghost",size:"icon",className:"size-7",onClick:g,"aria-label":"Dismiss",children:a}),e[12]=g,e[13]=r):r=e[13];let f;return e[14]!==s||e[15]!==r?(f=i.jsxs(xe,{variant:"info",className:"items-center",children:[d,i.jsxs(je,{className:"flex-1 flex items-center justify-between gap-2 text-sm",children:[l,i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s,r]})]})]}),e[14]=s,e[15]=r,e[16]=f):f=e[16],f}const $e=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function Be(e){return typeof e=="string"&&$e.has(e.trim().toLowerCase())}const qe=de({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!Be(e),"This organization URL is reserved by Studio"),logo:X().optional()});function Ge(e){const t=G.c(17),{value:n,onChange:u,name:p,disabled:o}=e,g=Y(),d=Z.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>d.current?.click(),t[0]=l):l=t[0];const c=l;let m;t[1]!==u||t[2]!==g?(m=W=>{const S=W.target.files?.[0];if(!S)return;if(S.size>2097152){q.error(g("settings.organizationForm.imageTooLarge"));return}const x=new FileReader;x.onerror=()=>q.error(g("settings.organizationForm.failedToReadImage")),x.onloadend=()=>{x.result&&u(x.result),d.current&&(d.current.value="")},x.readAsDataURL(S)},t[1]=u,t[2]=g,t[3]=m):m=t[3];const s=m;let a;t[4]!==g?(a=g("settings.organizationForm.uploadLogoLabel"),t[4]=g,t[5]=a):a=t[5];let r;t[6]!==o||t[7]!==s?(r=i.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),t[6]=o,t[7]=s,t[8]=r):r=t[8];const f=n||void 0,j=p??"?";let h;t[9]!==f||t[10]!==j?(h=i.jsx(Oe,{url:f,fallback:j,shape:"square",size:"base"}),t[9]=f,t[10]=j,t[11]=h):h=t[11];let z;return t[12]!==o||t[13]!==a||t[14]!==r||t[15]!==h?(z=i.jsxs("button",{type:"button",onClick:c,disabled:o,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":a,children:[r,h]}),t[12]=o,t[13]=a,t[14]=r,t[15]=h,t[16]=z):z=t[16],z}function Ve(){const e=Y(),t=me(),{org:n}=te(),u=be(),p=ue(),o=fe({resolver:pe(qe),values:{name:n.name??"",slug:n.slug??"",logo:n.logo??""}}),g=oe({mutationFn:async s=>{const a={name:s.name,slug:s.slug};s.logo&&(a.logo=s.logo);const r=await u.organization.update({data:a});if(r?.error)throw new Error(r.error.message||e("settings.organizationForm.failedToUpdateOrg"));return r},onSuccess:(s,a)=>{ee("organization_settings_updated",{organization_id:n.id,fields:Object.keys(a)}),p.invalidateQueries({queryKey:ie.organizations()}),p.invalidateQueries({queryKey:ie.activeOrganization(n.slug)}),q.success(e("settings.organizationForm.updateSuccess")),s?.data?.slug&&s.data.slug!==n.slug&&t({to:"/$org/settings/general",params:{org:s.data.slug}})},onError:(s,a)=>{ee("organization_settings_update_failed",{organization_id:n.id,fields:Object.keys(a),error:s instanceof Error?s.message:String(s)}),q.error(s instanceof Error?s.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:d,flush:l}=ye({save:async()=>{const s=o.control._formState.dirtyFields;if(Object.keys(s).length===0||!await o.trigger())return;const r=o.getValues(),f=o.control._defaultValues;o.reset(r,{keepValues:!0});try{await g.mutateAsync(r)}catch{o.reset(f,{keepValues:!0})}}}),c=o.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(re,{children:i.jsxs(le,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(Ge,{value:o.watch("logo"),onChange:s=>{o.setValue("logo",s??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(se,{control:o.control,name:"name",render:({field:s})=>i.jsx(ae,{id:"org-name",...s,onChange:a=>{s.onChange(a),d()},onBlur:()=>{s.onBlur(),l()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[m&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),i.jsx(se,{control:o.control,name:"slug",render:({field:s})=>i.jsx("input",{id:"org-slug",value:s.value??"",name:s.name,ref:s.ref,placeholder:e("settings.organizationForm.slugPlaceholder"),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:a=>{const r=a.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",r,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),d()},onBlur:()=>{s.onBlur(),l()}})})]})}),(c.name||c.slug||c.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[c.name&&i.jsx("p",{className:"text-xs text-destructive",children:c.name.message}),c.slug&&i.jsx("p",{className:"text-xs text-destructive",children:c.slug.message}),c.logo&&i.jsx("p",{className:"text-xs text-destructive",children:c.logo.message})]})]})})}function Ue(){const e=G.c(86),t=Y(),{org:n}=te(),[u,p]=Z.useState(!1),[o,g]=Z.useState(""),d=De();let l;e[0]!==n.id||e[1]!==d?(l=async()=>{await d.call("ORGANIZATION_DELETE",{id:n.id})},e[0]=n.id,e[1]=d,e[2]=l):l=e[2];let c;e[3]!==n.id||e[4]!==n.slug||e[5]!==t?(c=()=>{ee("organization_deleted",{organization_id:n.id}),localStorage.getItem(ne.lastOrgSlug())===n.slug&&localStorage.removeItem(ne.lastOrgSlug()),he(),q.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=n.id,e[4]=n.slug,e[5]=t,e[6]=c):c=e[6];let m;e[7]!==t?(m=v=>{q.error(v instanceof Error?v.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=m):m=e[8];let s;e[9]!==l||e[10]!==c||e[11]!==m?(s={mutationFn:l,onSuccess:c,onError:m},e[9]=l,e[10]=c,e[11]=m,e[12]=s):s=e[12];const a=oe(s);let r;e[13]!==t?(r=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=r):r=e[14];let f;e[15]!==t?(f=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=f):f=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let h;e[19]!==t?(h=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=h):h=e[20];let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=()=>p(!0),e[21]=z):z=e[21];const W=a.isPending;let S;e[22]!==t?(S=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=S):S=e[23];let x;e[24]!==a.isPending||e[25]!==S?(x=i.jsx(J,{variant:"destructive",size:"sm",onClick:z,disabled:W,children:S}),e[24]=a.isPending,e[25]=S,e[26]=x):x=e[26];let b;e[27]!==x||e[28]!==j||e[29]!==h?(b=i.jsx(le,{className:"border-destructive/40",children:i.jsx(Q,{title:j,description:h,action:x})}),e[27]=x,e[28]=j,e[29]=h,e[30]=b):b=e[30];let y;e[31]!==b||e[32]!==r||e[33]!==f?(y=i.jsx(re,{title:r,description:f,children:b}),e[31]=b,e[32]=r,e[33]=f,e[34]=y):y=e[34];let V;e[35]===Symbol.for("react.memo_cache_sentinel")?(V=v=>{p(v),v||g("")},e[35]=V):V=e[35];let O;e[36]!==t?(O=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=O):O=e[37];let C;e[38]!==O?(C=i.jsx(_e,{children:O}),e[38]=O,e[39]=C):C=e[39];let w;e[40]!==n.name||e[41]!==t?(w=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:n.name}),e[40]=n.name,e[41]=t,e[42]=w):w=e[42];let D;e[43]!==w?(D=i.jsx("p",{children:w}),e[43]=w,e[44]=D):D=e[44];let _;e[45]!==n.name||e[46]!==t?(_=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:n.name}),e[45]=n.name,e[46]=t,e[47]=_):_=e[47];let A;e[48]!==_?(A=i.jsx("p",{className:"mt-3 mb-1.5",children:_}),e[48]=_,e[49]=A):A=e[49];let U;e[50]===Symbol.for("react.memo_cache_sentinel")?(U=v=>g(v.target.value),e[50]=U):U=e[50];let N;e[51]!==o||e[52]!==n.name?(N=i.jsx(ae,{value:o,onChange:U,placeholder:n.name,autoFocus:!0}),e[51]=o,e[52]=n.name,e[53]=N):N=e[53];let F;e[54]!==D||e[55]!==A||e[56]!==N?(F=i.jsx(Ae,{asChild:!0,children:i.jsxs("div",{children:[D,A,N]})}),e[54]=D,e[55]=A,e[56]=N,e[57]=F):F=e[57];let T;e[58]!==C||e[59]!==F?(T=i.jsxs(Ne,{children:[C,F]}),e[58]=C,e[59]=F,e[60]=T):T=e[60];let E;e[61]!==t?(E=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=E):E=e[62];let P;e[63]!==E?(P=i.jsx(Fe,{children:E}),e[63]=E,e[64]=P):P=e[64];let R;e[65]!==a?(R=()=>a.mutate(),e[65]=a,e[66]=R):R=e[66];const H=o!==n.name||a.isPending;let k;e[67]!==a.isPending||e[68]!==t?(k=a.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=a.isPending,e[68]=t,e[69]=k):k=e[69];let L;e[70]!==R||e[71]!==H||e[72]!==k?(L=i.jsx(Te,{onClick:R,disabled:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:k}),e[70]=R,e[71]=H,e[72]=k,e[73]=L):L=e[73];let I;e[74]!==P||e[75]!==L?(I=i.jsxs(Ee,{children:[P,L]}),e[74]=P,e[75]=L,e[76]=I):I=e[76];let $;e[77]!==T||e[78]!==I?($=i.jsxs(Pe,{children:[T,I]}),e[77]=T,e[78]=I,e[79]=$):$=e[79];let B;e[80]!==u||e[81]!==$?(B=i.jsx(Re,{open:u,onOpenChange:V,children:$}),e[80]=u,e[81]=$,e[82]=B):B=e[82];let K;return e[83]!==y||e[84]!==B?(K=i.jsxs(i.Fragment,{children:[y,B]}),e[83]=y,e[84]=B,e[85]=K):K=e[85],K}function Ke(){const e=G.c(10),t=Y();let n;e[0]!==t?(n=t("settings.orgGeneral.organization"),e[0]=t,e[1]=n):n=e[1];let u;e[2]!==n?(u=i.jsx(M.Title,{children:n}),e[2]=n,e[3]=u):u=e[3];let p,o,g,d;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Ie,{}),o=i.jsx(Ve,{}),g=i.jsx(we,{}),d=i.jsx(Ue,{}),e[4]=p,e[5]=o,e[6]=g,e[7]=d):(p=e[4],o=e[5],g=e[6],d=e[7]);let l;return e[8]!==u?(l=i.jsx(M,{children:i.jsx(M.Content,{children:i.jsx(M.Body,{children:i.jsxs(Ce,{children:[u,p,o,g,d]})})})}),e[8]=u,e[9]=l):l=e[9],l}function yt(){const e=G.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(ke,{capability:"org:manage",area:"general settings",children:i.jsx(Ke,{})}),e[0]=t):t=e[0],t}export{yt as default};
|
package/dist/client/assets/{github-repo-picker-pUO4-UP7.js → github-repo-picker-CeuXOkGP.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as xe,a as ye,o as me,r as H,_ as oe,c as se,b as ee,j as t,k as Z,e as ge,t as le,dR as Ne,K as te,G as ve,n as ke,m as ue,B as ce,x as Ce,y as Re}from"./index-D3OCvKaU.js";import{a as we,b as Se,d as Pe,e as Ie}from"./dialog-DRzTNCF2.js";import{C as _e}from"./collection-search-CgPrJD5s.js";import{u as Ee}from"./use-debounced-value-B5eH48Lw.js";import{b as pe,u as Te}from"./use-connection-BqPnQoRJ.js";import{u as re,S as he}from"./use-mcp-client-DBBu3lpa.js";import{a as be}from"./authenticate-and-persist-oauth-BgQP48Df.js";import{b as de}from"./Settings02-Dvu63VK8.js";import{n as Ae}from"./LinkExternal01-DsH5I9jm.js";import{X as ze}from"./agent-icon-Cn-zdV8E.js";import{u as Le,G as q}from"./use-registry-app-D7Jfc22S.js";import{e as Ge}from"./extract-connection-data-Br5Lsj7z.js";import{c as Fe}from"./use-navigate-to-agent-B_NFjN6b.js";import{p as fe,f as Oe}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{g as Ue}from"./github-repo-scope-DjMZbiKa.js";const De="deco/mcp-github";function He(P){const{org:e}=xe(),{data:u}=ye.useSession(),p=pe(),k=me(),[l,r]=H.useState("idle"),[o,s]=H.useState(null),[f,v]=H.useState(null),{data:j,isLoading:R}=Le(De,{enabled:P.enabled}),d=H.useRef(!1);P.enabled&&j&&!R&&!d.current&&u?.user?.id&&l==="idle"&&(d.current=!0,c());async function c(){if(!(!j||!u?.user?.id||!e))try{r("installing"),s(null);const i=Ge(j,e.id,u.user.id,{remoteIndex:0});if(!i.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:x}=await p.create.mutateAsync(i);r("authenticating");const b=await be({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>p.update.mutateAsync({id:x,data:{connection_token:m}}).then(()=>{})});if(b.ran&&!b.ok){try{await p.delete.mutateAsync(x)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}oe(k,e.id),v(i),r("ready")}catch(i){s(i instanceof Error?i.message:String(i)),r("error")}}function a(){r("idle"),s(null),v(null),d.current=!1}return P.enabled&&R&&l==="idle"?{status:"installing",error:null,connection:null,retry:a}:{status:l,error:o,connection:f,retry:a}}function at(P){const e=se.c(27),{open:u,onOpenChange:p,title:k,onImportComplete:l,mode:r}=P,o=r===void 0?"agent":r,s=ee();let f;e[0]!==o||e[1]!==s||e[2]!==k?(f=k??s(o==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=o,e[1]=s,e[2]=k,e[3]=f):f=e[3];const v=f,[j,R]=H.useState(null);let d;e[4]!==v?(d=t.jsx(we,{className:"sr-only",children:t.jsx(Se,{children:v})}),e[4]=v,e[5]=d):d=e[5];let c;e[6]!==v||e[7]!==j||e[8]!==s?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:j?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>R(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(de,{size:16})}),t.jsx("img",{src:j.avatarUrl,alt:j.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:j.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v})]})}),e[6]=v,e[7]=j,e[8]=s,e[9]=c):c=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=a):a=e[10];let i;e[11]!==p?(i=()=>p(!1),e[11]=p,e[12]=i):i=e[12];let g;e[13]!==o||e[14]!==l||e[15]!==u||e[16]!==j||e[17]!==i?(g=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(H.Suspense,{fallback:a,children:t.jsx($e,{open:u,onComplete:i,selectedInstallation:j,onSelectInstallation:R,onImportComplete:l,mode:o})})}),e[13]=o,e[14]=l,e[15]=u,e[16]=j,e[17]=i,e[18]=g):g=e[18];let x;e[19]!==d||e[20]!==c||e[21]!==g?(x=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[d,c,g]}),e[19]=d,e[20]=c,e[21]=g,e[22]=x):x=e[22];let b;return e[23]!==p||e[24]!==u||e[25]!==x?(b=t.jsx(Ie,{open:u,onOpenChange:p,children:x}),e[23]=p,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function $e({open:P,onComplete:e,selectedInstallation:u,onSelectInstallation:p,onImportComplete:k,mode:l="agent"}){const r=ee(),{org:o}=xe(),s=me(),f=Fe(),[v,j]=H.useState(null),R=Te({slug:"mcp-github"}),d=Ue(R),c=He({enabled:P&&d.length===0}),a=d.length===1?d[0]??null:v,i=re({connectionId:a?.id??"",orgId:o.id,orgSlug:o.slug}),g=re({connectionId:he,orgId:o.id,orgSlug:o.slug}),x=async(n,y)=>{try{const w=await i.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:y}});if(w.isError)return null;const S=w.content?.find(I=>I.type==="resource")?.resource?.text;if(!S)return null;try{const I=JSON.parse(S);return typeof I=="string"?I:JSON.stringify(I)}catch{return S}}catch{return null}},b=(n,y)=>{Promise.all([x(y,"AGENTS.md"),x(y,"CLAUDE.md")]).then(async([N,w])=>{const C=N??w??null;C&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:C}}}}),oe(s,o.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},m=ge({mutationFn:async n=>{if(!a||!u)throw new Error("No GitHub connection or installation");const y=u.installationId;if(l==="connection"){const{childConnectionId:C}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:S=>i.callTool(S),selfCallTool:S=>g.callTool(S),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:C,item:null}}const{childConnectionId:N}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:C=>i.callTool(C),selfCallTool:C=>g.callTool(C)});let w=null;try{const C=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:y,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),S=C.structuredContent??C,I=S.item?.id;if(!S.item||!I)throw new Error("Failed to create the imported agent");return w=I,{virtualMcpId:I,repo:n,connectionId:N,item:S.item}}catch(C){throw w&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:w}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),C}},onSuccess:({virtualMcpId:n,repo:y,connectionId:N,item:w})=>{if(l==="connection"||!n||!w){oe(s,o.id),Ne(s,o.id),le.success(r("common.githubRepoPicker.addedRepo",{name:y.name})),e();return}if(s.setQueryData(te.collectionItem(g,o.id,"","VIRTUAL_MCP",n),{item:w}),oe(s,o.id),b(n,y),k){k({virtualMcpId:n,repo:y,connectionId:N});return}le.success(r("common.githubRepoPicker.importedRepo",{name:y.name})),e(),localStorage.setItem(ve.sidebarOpen(),JSON.stringify(!1)),f(n)},onError:n=>{le.error(r("common.githubRepoPicker.failedImport",{error:n instanceof Error?n.message:r("common.githubRepoPicker.unknownError")}))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(ae,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(ae,{status:"error",error:c.error,retry:c.retry}):d.length===0&&c.status==="idle"?t.jsx(ae,{status:"installing",error:null,retry:c.retry}):d.length>1&&!a?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:r("common.githubRepoPicker.selectConnection")})}),d.map(n=>t.jsxs("button",{type:"button",onClick:()=>j(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.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(q,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?u?t.jsx(Qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,installation:u,onSelectRepo:n=>m.mutate(n),isSaving:m.isPending}):t.jsx(qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,onSelect:p,showBackButton:d.length>1,onBack:()=>j(null)}):null}function qe(P){const e=se.c(126),{connectionId:u,orgId:p,orgSlug:k,onSelect:l,showBackButton:r,onBack:o}=P,s=ee();let f;e[0]!==p||e[1]!==k?(f={connectionId:he,orgId:p,orgSlug:k},e[0]=p,e[1]=k,e[2]=f):f=e[2];const v=re(f),j=me(),R=pe();let d;e[3]!==u||e[4]!==p?(d=te.githubUserOrgs(p,u),e[3]=u,e[4]=p,e[5]=d):d=e[5];let c;e[6]!==u||e[7]!==v?(c=()=>Oe(h=>v.callTool(h),u),e[6]=u,e[7]=v,e[8]=c):c=e[8];let a;e[9]!==d||e[10]!==c?(a={queryKey:d,queryFn:c},e[9]=d,e[10]=c,e[11]=a):a=e[11];const i=ke(a);let g;e[12]!==R||e[13]!==u||e[14]!==i||e[15]!==p||e[16]!==k||e[17]!==j?(g=async()=>{const h=await be({connectionId:u,orgId:p,orgSlug:k,persistFallback:A=>R.update.mutateAsync({id:u,data:{connection_token:A}}).then(Me)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${k}/mcp/${u}`,window.location.origin);await j.invalidateQueries({queryKey:te.isMCPAuthenticated(_.href,null)}),await j.invalidateQueries({queryKey:te.mcpClientPrefix()}),await i.refetch()},e[12]=R,e[13]=u,e[14]=i,e[15]=p,e[16]=k,e[17]=j,e[18]=g):g=e[18];let x;e[19]!==s?(x=h=>{le.error(s("common.githubRepoPicker.failedReconnect",{error:h instanceof Error?h.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=x):x=e[20];let b;e[21]!==g||e[22]!==x?(b={mutationFn:g,onError:x},e[21]=g,e[22]=x,e[23]=b):b=e[23];const m=ge(b);if(i.isLoading){let h;return e[24]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=h):h=e[24],h}if(i.isError){let h;e[25]!==s?(h=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=h):h=e[26];let _;e[27]!==h?(_=t.jsx("p",{className:"text-sm text-destructive",children:h}),e[27]=h,e[28]=_):_=e[28];let A;e[29]!==s?(A=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=A):A=e[30];let z;e[31]!==A?(z=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:A}),e[31]=A,e[32]=z):z=e[32];let L;e[33]!==m?(L=()=>m.mutate(),e[33]=m,e[34]=L):L=e[34];const $=m.isPending;let G;e[35]!==m.isPending?(G=m.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(q,{className:"size-3.5"}),e[35]=m.isPending,e[36]=G):G=e[36];let F;e[37]!==s?(F=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=F):F=e[38];let O;e[39]!==m.isPending||e[40]!==L||e[41]!==G||e[42]!==F?(O=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:L,disabled:$,children:[G,F]}),e[39]=m.isPending,e[40]=L,e[41]=G,e[42]=F,e[43]=O):O=e[43];let D;return e[44]!==z||e[45]!==O||e[46]!==_?(D=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[_,z,O]}),e[44]=z,e[45]=O,e[46]=_,e[47]=D):D=e[47],D}const n=i.data;if(!n)return null;const y=n.appSlug?`https://github.com/apps/${n.appSlug}/installations/new`:"https://github.com/settings/installations";if(n.installations.length===0){let h;e[48]!==o||e[49]!==r||e[50]!==s?(h=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:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=o,e[49]=r,e[50]=s,e[51]=h):h=e[51];let _;e[52]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-8 text-foreground"})}),e[52]=_):_=e[52];let A;e[53]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=A):A=e[53];let z;e[54]!==s?(z=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=z):z=e[55];let L;e[56]!==z?(L=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[A,z]}),e[56]=z,e[57]=L):L=e[57];let $;e[58]!==s?($=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=$):$=e[59];let G;e[60]!==$?(G=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:$}),e[60]=$,e[61]=G):G=e[61];let F;e[62]!==s?(F=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=F):F=e[63];let O;e[64]!==F?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:F}),e[64]=F,e[65]=O):O=e[65];let D;e[66]!==s?(D=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=D):D=e[67];let ne;e[68]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Ae,{size:14}),e[68]=ne):ne=e[68];let M;e[69]!==y||e[70]!==D?(M=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:[D,ne]})}),e[69]=y,e[70]=D,e[71]=M):M=e[71];let Q;e[72]!==i?(Q=()=>{i.refetch()},e[72]=i,e[73]=Q):Q=e[73];const je=i.isFetching;let B;e[74]!==i.isFetching?(B=i.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[74]=i.isFetching,e[75]=B):B=e[75];let V;e[76]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[76]=s,e[77]=V):V=e[77];let K;e[78]!==i.isFetching||e[79]!==Q||e[80]!==B||e[81]!==V?(K=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:Q,disabled:je,children:[B,V]}),e[78]=i.isFetching,e[79]=Q,e[80]=B,e[81]=V,e[82]=K):K=e[82];let J;e[83]!==M||e[84]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[M,K]}),e[83]=M,e[84]=K,e[85]=J):J=e[85];let W;e[86]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[86]=s,e[87]=W):W=e[87];let Y;e[88]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[88]=W,e[89]=Y):Y=e[89];let X;e[90]!==L||e[91]!==G||e[92]!==O||e[93]!==J||e[94]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[_,L,G,O,J,Y]}),e[90]=L,e[91]=G,e[92]=O,e[93]=J,e[94]=Y,e[95]=X):X=e[95];let ie;return e[96]!==X||e[97]!==h?(ie=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h,X]}),e[96]=X,e[97]=h,e[98]=ie):ie=e[98],ie}let N;e[99]!==o||e[100]!==r||e[101]!==s?(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:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[99]=o,e[100]=r,e[101]=s,e[102]=N):N=e[102];let w;if(e[103]!==n.installations||e[104]!==l||e[105]!==s){let h;e[107]!==l||e[108]!==s?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},_.installationId),e[107]=l,e[108]=s,e[109]=h):h=e[109],w=n.installations.map(h),e[103]=n.installations,e[104]=l,e[105]=s,e[106]=w}else w=e[106];let C;e[110]!==w?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:w}),e[110]=w,e[111]=C):C=e[111];let S;e[112]!==s?(S=s("common.githubRepoPicker.accountNotListed"),e[112]=s,e[113]=S):S=e[113];let I;e[114]!==s?(I=s("common.githubRepoPicker.installGitHubApp"),e[114]=s,e[115]=I):I=e[115];let E;e[116]!==I?(E=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[116]=I,e[117]=E):E=e[117];let T;e[118]!==y||e[119]!==S||e[120]!==E?(T=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[S," ",E]})}),e[118]=y,e[119]=S,e[120]=E,e[121]=T):T=e[121];let U;return e[122]!==C||e[123]!==T||e[124]!==N?(U=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,C,T]}),e[122]=C,e[123]=T,e[124]=N,e[125]=U):U=e[125],U}function Me(){}function Qe(P){const e=se.c(23),{connectionId:u,orgId:p,orgSlug:k,installation:l,onSelectRepo:r,isSaving:o}=P,s=ee(),[f,v]=H.useState(""),j=Ee(f,300),R=H.useDeferredValue(j),d=f!==R;let c;e[0]!==s?(c=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==d||e[3]!==f||e[4]!==c?(a=t.jsx(_e,{placeholder:c,value:f,onChange:v,isSearching:d}),e[2]=d,e[3]=f,e[4]=c,e[5]=a):a=e[5];const i=d?"opacity-40":"opacity-100";let g;e[6]!==i?(g=ue("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",i),e[6]=i,e[7]=g):g=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=x):x=e[8];let b;e[9]!==u||e[10]!==R||e[11]!==l||e[12]!==o||e[13]!==r||e[14]!==p||e[15]!==k?(b=t.jsx(H.Suspense,{fallback:x,children:t.jsx(Be,{connectionId:u,orgId:p,orgSlug:k,installation:l,query:R,onSelectRepo:r,isSaving:o})}),e[9]=u,e[10]=R,e[11]=l,e[12]=o,e[13]=r,e[14]=p,e[15]=k,e[16]=b):b=e[16];let m;e[17]!==g||e[18]!==b?(m=t.jsx("div",{className:g,children:b}),e[17]=g,e[18]=b,e[19]=m):m=e[19];let n;return e[20]!==a||e[21]!==m?(n=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a,m]}),e[20]=a,e[21]=m,e[22]=n):n=e[22],n}function Be(P){const e=se.c(36),{connectionId:u,orgId:p,orgSlug:k,installation:l,query:r,onSelectRepo:o,isSaving:s}=P,f=ee();let v;e[0]!==u||e[1]!==p||e[2]!==k?(v={connectionId:u,orgId:p,orgSlug:k},e[0]=u,e[1]=p,e[2]=k,e[3]=v):v=e[3];const j=re(v),R=l.type==="User"?"user":"org",d=r?`${R}:${l.login} ${r} in:name`:`${R}:${l.login}`;let c;e[4]!==u||e[5]!==l.login||e[6]!==p||e[7]!==r?(c=te.githubOrgRepos(p,u,l.login,r),e[4]=u,e[5]=l.login,e[6]=p,e[7]=r,e[8]=c):c=e[8];let a;e[9]!==j||e[10]!==d?(a=async m=>{const{signal:n}=m,N=(await j.callTool({name:"search_repositories",arguments:{query:d,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Ve)},e[9]=j,e[10]=d,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i={queryKey:c,queryFn:a},e[12]=c,e[13]=a,e[14]=i):i=e[14];const{data:g}=Ce(i);if(g.length===0){let m;e[15]!==f?(m=f("common.githubRepoPicker.noRepositoriesFound"),e[15]=f,e[16]=m):m=e[16];let n;e[17]!==m?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[17]=m,e[18]=n):n=e[18];let y;e[19]!==r||e[20]!==f?(y=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:f("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=r,e[20]=f,e[21]=y):y=e[21];let N;return e[22]!==n||e[23]!==y?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[n,y]}),e[22]=n,e[23]=y,e[24]=N):N=e[24],N}let x;if(e[25]!==s||e[26]!==o||e[27]!==g||e[28]!==f){let m;e[30]!==s||e[31]!==o||e[32]!==f?(m=n=>t.jsxs("button",{type:"button",onClick:()=>o(n),disabled:s,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(q,{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:n.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:[n.private?t.jsx(Re,{size:10}):t.jsx(ze,{size:10}),n.private?f("common.githubRepoPicker.private"):f("common.githubRepoPicker.public")]})]},n.fullName),e[30]=s,e[31]=o,e[32]=f,e[33]=m):m=e[33],x=g.map(m),e[25]=s,e[26]=o,e[27]=g,e[28]=f,e[29]=x}else x=e[29];let b;return e[34]!==x?(b=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:x}),e[34]=x,e[35]=b):b=e[35],b}function Ve(P){return{name:P.name,fullName:P.full_name,owner:P.full_name.split("/")[0]??"",url:P.html_url,private:P.private,description:P.description,updatedAt:P.updated_at}}function ae(P){const e=se.c(51),{status:u,error:p,retry:k}=P,l=ee();if(u==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let w;e[1]!==l?(w=l("common.githubRepoPicker.connectionFailed"),e[1]=l,e[2]=w):w=e[2];let C;e[3]!==w?(C=t.jsx("p",{className:"text-sm font-medium",children:w}),e[3]=w,e[4]=C):C=e[4];let S;e[5]!==p||e[6]!==l?(S=p??l("common.githubRepoPicker.somethingWentWrong"),e[5]=p,e[6]=l,e[7]=S):S=e[7];let I;e[8]!==S?(I=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:S}),e[8]=S,e[9]=I):I=e[9];let E;e[10]!==C||e[11]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,I]}),e[10]=C,e[11]=I,e[12]=E):E=e[12];let T;e[13]!==l?(T=l("common.githubRepoPicker.tryAgain"),e[13]=l,e[14]=T):T=e[14];let U;e[15]!==k||e[16]!==T?(U=t.jsx("button",{type:"button",onClick:k,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:T}),e[15]=k,e[16]=T,e[17]=U):U=e[17];let h;return e[18]!==E||e[19]!==U?(h=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,E,U]}),e[18]=E,e[19]=U,e[20]=h):h=e[20],h}const r=u==="authenticating";let o;e[21]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-foreground"})}),e[21]=o):o=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let f;e[23]!==r||e[24]!==l?(f=l(r?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=r,e[24]=l,e[25]=f):f=e[25];let v;e[26]!==f?(v=t.jsx("p",{className:"text-sm font-medium",children:f}),e[26]=f,e[27]=v):v=e[27];let j;e[28]!==r||e[29]!==l?(j=l(r?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=r,e[29]=l,e[30]=j):j=e[30];let R;e[31]!==j?(R=t.jsx("p",{className:"text-xs text-muted-foreground",children:j}),e[31]=j,e[32]=R):R=e[32];let d;e[33]!==v||e[34]!==R?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,R]}),e[33]=v,e[34]=R,e[35]=d):d=e[35];const c=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[36]!==c?(a=ue("size-1.5 rounded-full",c),e[36]=c,e[37]=a):a=e[37];let i;e[38]!==a?(i=t.jsx("span",{className:a}),e[38]=a,e[39]=i):i=e[39];const g=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let x;e[40]!==g?(x=ue("size-1.5 rounded-full",g),e[40]=g,e[41]=x):x=e[41];let b;e[42]!==x?(b=t.jsx("span",{className:x}),e[42]=x,e[43]=b):b=e[43];let m;e[44]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=m):m=e[44];let n;e[45]!==i||e[46]!==b?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[i,b,m]}),e[45]=i,e[46]=b,e[47]=n):n=e[47];let y;return e[48]!==n||e[49]!==d?(y=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,d,n]}),e[48]=n,e[49]=d,e[50]=y):y=e[50],y}export{at as G,He as u};
|
|
1
|
+
import{F as xe,a as ye,o as me,r as H,_ as oe,c as se,b as ee,j as t,k as Z,e as ge,t as le,dR as Ne,K as te,G as ve,n as ke,m as ue,B as ce,x as Ce,y as Re}from"./index-tHM8NTfd.js";import{a as we,b as Se,d as Pe,e as Ie}from"./dialog-D370feZI.js";import{C as _e}from"./collection-search-C63j6Zzd.js";import{u as Ee}from"./use-debounced-value-DuOUoSmu.js";import{b as pe,u as Te}from"./use-connection-uKN5YWIx.js";import{u as re,S as he}from"./use-mcp-client-BAwn-0AV.js";import{a as be}from"./authenticate-and-persist-oauth-DMOmyFRT.js";import{b as de}from"./Settings02-k_lwzmTv.js";import{n as Ae}from"./LinkExternal01-Dv9Aj-K0.js";import{X as ze}from"./agent-icon-DW-jknHC.js";import{u as Le,G as q}from"./use-registry-app-D8hx17d1.js";import{e as Ge}from"./extract-connection-data-C8zhfgGc.js";import{c as Fe}from"./use-navigate-to-agent-DEAiy9mr.js";import{p as fe,f as Oe}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{g as Ue}from"./github-repo-scope-DjMZbiKa.js";const De="deco/mcp-github";function He(P){const{org:e}=xe(),{data:u}=ye.useSession(),p=pe(),k=me(),[l,r]=H.useState("idle"),[o,s]=H.useState(null),[f,v]=H.useState(null),{data:j,isLoading:R}=Le(De,{enabled:P.enabled}),d=H.useRef(!1);P.enabled&&j&&!R&&!d.current&&u?.user?.id&&l==="idle"&&(d.current=!0,c());async function c(){if(!(!j||!u?.user?.id||!e))try{r("installing"),s(null);const i=Ge(j,e.id,u.user.id,{remoteIndex:0});if(!i.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:x}=await p.create.mutateAsync(i);r("authenticating");const b=await be({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>p.update.mutateAsync({id:x,data:{connection_token:m}}).then(()=>{})});if(b.ran&&!b.ok){try{await p.delete.mutateAsync(x)}catch{}throw new Error(b.error&&b.error!=="no token received"?b.error:"No token received from GitHub")}oe(k,e.id),v(i),r("ready")}catch(i){s(i instanceof Error?i.message:String(i)),r("error")}}function a(){r("idle"),s(null),v(null),d.current=!1}return P.enabled&&R&&l==="idle"?{status:"installing",error:null,connection:null,retry:a}:{status:l,error:o,connection:f,retry:a}}function at(P){const e=se.c(27),{open:u,onOpenChange:p,title:k,onImportComplete:l,mode:r}=P,o=r===void 0?"agent":r,s=ee();let f;e[0]!==o||e[1]!==s||e[2]!==k?(f=k??s(o==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=o,e[1]=s,e[2]=k,e[3]=f):f=e[3];const v=f,[j,R]=H.useState(null);let d;e[4]!==v?(d=t.jsx(we,{className:"sr-only",children:t.jsx(Se,{children:v})}),e[4]=v,e[5]=d):d=e[5];let c;e[6]!==v||e[7]!==j||e[8]!==s?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:j?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>R(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(de,{size:16})}),t.jsx("img",{src:j.avatarUrl,alt:j.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:j.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v})]})}),e[6]=v,e[7]=j,e[8]=s,e[9]=c):c=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[10]=a):a=e[10];let i;e[11]!==p?(i=()=>p(!1),e[11]=p,e[12]=i):i=e[12];let g;e[13]!==o||e[14]!==l||e[15]!==u||e[16]!==j||e[17]!==i?(g=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(H.Suspense,{fallback:a,children:t.jsx($e,{open:u,onComplete:i,selectedInstallation:j,onSelectInstallation:R,onImportComplete:l,mode:o})})}),e[13]=o,e[14]=l,e[15]=u,e[16]=j,e[17]=i,e[18]=g):g=e[18];let x;e[19]!==d||e[20]!==c||e[21]!==g?(x=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[d,c,g]}),e[19]=d,e[20]=c,e[21]=g,e[22]=x):x=e[22];let b;return e[23]!==p||e[24]!==u||e[25]!==x?(b=t.jsx(Ie,{open:u,onOpenChange:p,children:x}),e[23]=p,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function $e({open:P,onComplete:e,selectedInstallation:u,onSelectInstallation:p,onImportComplete:k,mode:l="agent"}){const r=ee(),{org:o}=xe(),s=me(),f=Fe(),[v,j]=H.useState(null),R=Te({slug:"mcp-github"}),d=Ue(R),c=He({enabled:P&&d.length===0}),a=d.length===1?d[0]??null:v,i=re({connectionId:a?.id??"",orgId:o.id,orgSlug:o.slug}),g=re({connectionId:he,orgId:o.id,orgSlug:o.slug}),x=async(n,y)=>{try{const w=await i.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:y}});if(w.isError)return null;const S=w.content?.find(I=>I.type==="resource")?.resource?.text;if(!S)return null;try{const I=JSON.parse(S);return typeof I=="string"?I:JSON.stringify(I)}catch{return S}}catch{return null}},b=(n,y)=>{Promise.all([x(y,"AGENTS.md"),x(y,"CLAUDE.md")]).then(async([N,w])=>{const C=N??w??null;C&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:C}}}}),oe(s,o.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},m=ge({mutationFn:async n=>{if(!a||!u)throw new Error("No GitHub connection or installation");const y=u.installationId;if(l==="connection"){const{childConnectionId:C}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:S=>i.callTool(S),selfCallTool:S=>g.callTool(S),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:C,item:null}}const{childConnectionId:N}=await fe({orgSlug:o.slug,sourceConnection:a,installationId:y,owner:n.owner,repo:n.name,githubCallTool:C=>i.callTool(C),selfCallTool:C=>g.callTool(C)});let w=null;try{const C=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:y,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),S=C.structuredContent??C,I=S.item?.id;if(!S.item||!I)throw new Error("Failed to create the imported agent");return w=I,{virtualMcpId:I,repo:n,connectionId:N,item:S.item}}catch(C){throw w&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:w}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),C}},onSuccess:({virtualMcpId:n,repo:y,connectionId:N,item:w})=>{if(l==="connection"||!n||!w){oe(s,o.id),Ne(s,o.id),le.success(r("common.githubRepoPicker.addedRepo",{name:y.name})),e();return}if(s.setQueryData(te.collectionItem(g,o.id,"","VIRTUAL_MCP",n),{item:w}),oe(s,o.id),b(n,y),k){k({virtualMcpId:n,repo:y,connectionId:N});return}le.success(r("common.githubRepoPicker.importedRepo",{name:y.name})),e(),localStorage.setItem(ve.sidebarOpen(),JSON.stringify(!1)),f(n)},onError:n=>{le.error(r("common.githubRepoPicker.failedImport",{error:n instanceof Error?n.message:r("common.githubRepoPicker.unknownError")}))}});return c.status==="installing"||c.status==="authenticating"?t.jsx(ae,{status:c.status,error:null,retry:c.retry}):c.status==="error"?t.jsx(ae,{status:"error",error:c.error,retry:c.retry}):d.length===0&&c.status==="idle"?t.jsx(ae,{status:"installing",error:null,retry:c.retry}):d.length>1&&!a?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:r("common.githubRepoPicker.selectConnection")})}),d.map(n=>t.jsxs("button",{type:"button",onClick:()=>j(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.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(q,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?u?t.jsx(Qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,installation:u,onSelectRepo:n=>m.mutate(n),isSaving:m.isPending}):t.jsx(qe,{connectionId:a.id,orgId:o.id,orgSlug:o.slug,onSelect:p,showBackButton:d.length>1,onBack:()=>j(null)}):null}function qe(P){const e=se.c(126),{connectionId:u,orgId:p,orgSlug:k,onSelect:l,showBackButton:r,onBack:o}=P,s=ee();let f;e[0]!==p||e[1]!==k?(f={connectionId:he,orgId:p,orgSlug:k},e[0]=p,e[1]=k,e[2]=f):f=e[2];const v=re(f),j=me(),R=pe();let d;e[3]!==u||e[4]!==p?(d=te.githubUserOrgs(p,u),e[3]=u,e[4]=p,e[5]=d):d=e[5];let c;e[6]!==u||e[7]!==v?(c=()=>Oe(h=>v.callTool(h),u),e[6]=u,e[7]=v,e[8]=c):c=e[8];let a;e[9]!==d||e[10]!==c?(a={queryKey:d,queryFn:c},e[9]=d,e[10]=c,e[11]=a):a=e[11];const i=ke(a);let g;e[12]!==R||e[13]!==u||e[14]!==i||e[15]!==p||e[16]!==k||e[17]!==j?(g=async()=>{const h=await be({connectionId:u,orgId:p,orgSlug:k,persistFallback:A=>R.update.mutateAsync({id:u,data:{connection_token:A}}).then(Me)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const _=new URL(`/api/${k}/mcp/${u}`,window.location.origin);await j.invalidateQueries({queryKey:te.isMCPAuthenticated(_.href,null)}),await j.invalidateQueries({queryKey:te.mcpClientPrefix()}),await i.refetch()},e[12]=R,e[13]=u,e[14]=i,e[15]=p,e[16]=k,e[17]=j,e[18]=g):g=e[18];let x;e[19]!==s?(x=h=>{le.error(s("common.githubRepoPicker.failedReconnect",{error:h instanceof Error?h.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=x):x=e[20];let b;e[21]!==g||e[22]!==x?(b={mutationFn:g,onError:x},e[21]=g,e[22]=x,e[23]=b):b=e[23];const m=ge(b);if(i.isLoading){let h;return e[24]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[24]=h):h=e[24],h}if(i.isError){let h;e[25]!==s?(h=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=h):h=e[26];let _;e[27]!==h?(_=t.jsx("p",{className:"text-sm text-destructive",children:h}),e[27]=h,e[28]=_):_=e[28];let A;e[29]!==s?(A=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=A):A=e[30];let z;e[31]!==A?(z=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:A}),e[31]=A,e[32]=z):z=e[32];let L;e[33]!==m?(L=()=>m.mutate(),e[33]=m,e[34]=L):L=e[34];const $=m.isPending;let G;e[35]!==m.isPending?(G=m.isPending?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(q,{className:"size-3.5"}),e[35]=m.isPending,e[36]=G):G=e[36];let F;e[37]!==s?(F=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=F):F=e[38];let O;e[39]!==m.isPending||e[40]!==L||e[41]!==G||e[42]!==F?(O=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:L,disabled:$,children:[G,F]}),e[39]=m.isPending,e[40]=L,e[41]=G,e[42]=F,e[43]=O):O=e[43];let D;return e[44]!==z||e[45]!==O||e[46]!==_?(D=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[_,z,O]}),e[44]=z,e[45]=O,e[46]=_,e[47]=D):D=e[47],D}const n=i.data;if(!n)return null;const y=n.appSlug?`https://github.com/apps/${n.appSlug}/installations/new`:"https://github.com/settings/installations";if(n.installations.length===0){let h;e[48]!==o||e[49]!==r||e[50]!==s?(h=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:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=o,e[49]=r,e[50]=s,e[51]=h):h=e[51];let _;e[52]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-8 text-foreground"})}),e[52]=_):_=e[52];let A;e[53]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=A):A=e[53];let z;e[54]!==s?(z=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=z):z=e[55];let L;e[56]!==z?(L=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[A,z]}),e[56]=z,e[57]=L):L=e[57];let $;e[58]!==s?($=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=$):$=e[59];let G;e[60]!==$?(G=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:$}),e[60]=$,e[61]=G):G=e[61];let F;e[62]!==s?(F=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=F):F=e[63];let O;e[64]!==F?(O=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:F}),e[64]=F,e[65]=O):O=e[65];let D;e[66]!==s?(D=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=D):D=e[67];let ne;e[68]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Ae,{size:14}),e[68]=ne):ne=e[68];let M;e[69]!==y||e[70]!==D?(M=t.jsx(ce,{asChild:!0,size:"sm",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:[D,ne]})}),e[69]=y,e[70]=D,e[71]=M):M=e[71];let Q;e[72]!==i?(Q=()=>{i.refetch()},e[72]=i,e[73]=Q):Q=e[73];const je=i.isFetching;let B;e[74]!==i.isFetching?(B=i.isFetching&&t.jsx(Z,{size:14,className:"animate-spin"}),e[74]=i.isFetching,e[75]=B):B=e[75];let V;e[76]!==s?(V=s("common.githubRepoPicker.checkAgain"),e[76]=s,e[77]=V):V=e[77];let K;e[78]!==i.isFetching||e[79]!==Q||e[80]!==B||e[81]!==V?(K=t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:Q,disabled:je,children:[B,V]}),e[78]=i.isFetching,e[79]=Q,e[80]=B,e[81]=V,e[82]=K):K=e[82];let J;e[83]!==M||e[84]!==K?(J=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[M,K]}),e[83]=M,e[84]=K,e[85]=J):J=e[85];let W;e[86]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[86]=s,e[87]=W):W=e[87];let Y;e[88]!==W?(Y=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[88]=W,e[89]=Y):Y=e[89];let X;e[90]!==L||e[91]!==G||e[92]!==O||e[93]!==J||e[94]!==Y?(X=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[_,L,G,O,J,Y]}),e[90]=L,e[91]=G,e[92]=O,e[93]=J,e[94]=Y,e[95]=X):X=e[95];let ie;return e[96]!==X||e[97]!==h?(ie=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h,X]}),e[96]=X,e[97]=h,e[98]=ie):ie=e[98],ie}let N;e[99]!==o||e[100]!==r||e[101]!==s?(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:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(de,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[99]=o,e[100]=r,e[101]=s,e[102]=N):N=e[102];let w;if(e[103]!==n.installations||e[104]!==l||e[105]!==s){let h;e[107]!==l||e[108]!==s?(h=_=>t.jsxs("button",{type:"button",onClick:()=>l(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},_.installationId),e[107]=l,e[108]=s,e[109]=h):h=e[109],w=n.installations.map(h),e[103]=n.installations,e[104]=l,e[105]=s,e[106]=w}else w=e[106];let C;e[110]!==w?(C=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:w}),e[110]=w,e[111]=C):C=e[111];let S;e[112]!==s?(S=s("common.githubRepoPicker.accountNotListed"),e[112]=s,e[113]=S):S=e[113];let I;e[114]!==s?(I=s("common.githubRepoPicker.installGitHubApp"),e[114]=s,e[115]=I):I=e[115];let E;e[116]!==I?(E=t.jsx("span",{className:"underline underline-offset-2",children:I}),e[116]=I,e[117]=E):E=e[117];let T;e[118]!==y||e[119]!==S||e[120]!==E?(T=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[S," ",E]})}),e[118]=y,e[119]=S,e[120]=E,e[121]=T):T=e[121];let U;return e[122]!==C||e[123]!==T||e[124]!==N?(U=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,C,T]}),e[122]=C,e[123]=T,e[124]=N,e[125]=U):U=e[125],U}function Me(){}function Qe(P){const e=se.c(23),{connectionId:u,orgId:p,orgSlug:k,installation:l,onSelectRepo:r,isSaving:o}=P,s=ee(),[f,v]=H.useState(""),j=Ee(f,300),R=H.useDeferredValue(j),d=f!==R;let c;e[0]!==s?(c=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==d||e[3]!==f||e[4]!==c?(a=t.jsx(_e,{placeholder:c,value:f,onChange:v,isSearching:d}),e[2]=d,e[3]=f,e[4]=c,e[5]=a):a=e[5];const i=d?"opacity-40":"opacity-100";let g;e[6]!==i?(g=ue("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",i),e[6]=i,e[7]=g):g=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Z,{size:18,className:"animate-spin text-muted-foreground"})}),e[8]=x):x=e[8];let b;e[9]!==u||e[10]!==R||e[11]!==l||e[12]!==o||e[13]!==r||e[14]!==p||e[15]!==k?(b=t.jsx(H.Suspense,{fallback:x,children:t.jsx(Be,{connectionId:u,orgId:p,orgSlug:k,installation:l,query:R,onSelectRepo:r,isSaving:o})}),e[9]=u,e[10]=R,e[11]=l,e[12]=o,e[13]=r,e[14]=p,e[15]=k,e[16]=b):b=e[16];let m;e[17]!==g||e[18]!==b?(m=t.jsx("div",{className:g,children:b}),e[17]=g,e[18]=b,e[19]=m):m=e[19];let n;return e[20]!==a||e[21]!==m?(n=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a,m]}),e[20]=a,e[21]=m,e[22]=n):n=e[22],n}function Be(P){const e=se.c(36),{connectionId:u,orgId:p,orgSlug:k,installation:l,query:r,onSelectRepo:o,isSaving:s}=P,f=ee();let v;e[0]!==u||e[1]!==p||e[2]!==k?(v={connectionId:u,orgId:p,orgSlug:k},e[0]=u,e[1]=p,e[2]=k,e[3]=v):v=e[3];const j=re(v),R=l.type==="User"?"user":"org",d=r?`${R}:${l.login} ${r} in:name`:`${R}:${l.login}`;let c;e[4]!==u||e[5]!==l.login||e[6]!==p||e[7]!==r?(c=te.githubOrgRepos(p,u,l.login,r),e[4]=u,e[5]=l.login,e[6]=p,e[7]=r,e[8]=c):c=e[8];let a;e[9]!==j||e[10]!==d?(a=async m=>{const{signal:n}=m,N=(await j.callTool({name:"search_repositories",arguments:{query:d,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Ve)},e[9]=j,e[10]=d,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i={queryKey:c,queryFn:a},e[12]=c,e[13]=a,e[14]=i):i=e[14];const{data:g}=Ce(i);if(g.length===0){let m;e[15]!==f?(m=f("common.githubRepoPicker.noRepositoriesFound"),e[15]=f,e[16]=m):m=e[16];let n;e[17]!==m?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[17]=m,e[18]=n):n=e[18];let y;e[19]!==r||e[20]!==f?(y=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:f("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=r,e[20]=f,e[21]=y):y=e[21];let N;return e[22]!==n||e[23]!==y?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[n,y]}),e[22]=n,e[23]=y,e[24]=N):N=e[24],N}let x;if(e[25]!==s||e[26]!==o||e[27]!==g||e[28]!==f){let m;e[30]!==s||e[31]!==o||e[32]!==f?(m=n=>t.jsxs("button",{type:"button",onClick:()=>o(n),disabled:s,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(q,{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:n.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:[n.private?t.jsx(Re,{size:10}):t.jsx(ze,{size:10}),n.private?f("common.githubRepoPicker.private"):f("common.githubRepoPicker.public")]})]},n.fullName),e[30]=s,e[31]=o,e[32]=f,e[33]=m):m=e[33],x=g.map(m),e[25]=s,e[26]=o,e[27]=g,e[28]=f,e[29]=x}else x=e[29];let b;return e[34]!==x?(b=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:x}),e[34]=x,e[35]=b):b=e[35],b}function Ve(P){return{name:P.name,fullName:P.full_name,owner:P.full_name.split("/")[0]??"",url:P.html_url,private:P.private,description:P.description,updatedAt:P.updated_at}}function ae(P){const e=se.c(51),{status:u,error:p,retry:k}=P,l=ee();if(u==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let w;e[1]!==l?(w=l("common.githubRepoPicker.connectionFailed"),e[1]=l,e[2]=w):w=e[2];let C;e[3]!==w?(C=t.jsx("p",{className:"text-sm font-medium",children:w}),e[3]=w,e[4]=C):C=e[4];let S;e[5]!==p||e[6]!==l?(S=p??l("common.githubRepoPicker.somethingWentWrong"),e[5]=p,e[6]=l,e[7]=S):S=e[7];let I;e[8]!==S?(I=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:S}),e[8]=S,e[9]=I):I=e[9];let E;e[10]!==C||e[11]!==I?(E=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,I]}),e[10]=C,e[11]=I,e[12]=E):E=e[12];let T;e[13]!==l?(T=l("common.githubRepoPicker.tryAgain"),e[13]=l,e[14]=T):T=e[14];let U;e[15]!==k||e[16]!==T?(U=t.jsx("button",{type:"button",onClick:k,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:T}),e[15]=k,e[16]=T,e[17]=U):U=e[17];let h;return e[18]!==E||e[19]!==U?(h=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,E,U]}),e[18]=E,e[19]=U,e[20]=h):h=e[20],h}const r=u==="authenticating";let o;e[21]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(q,{className:"size-5 text-foreground"})}),e[21]=o):o=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[22]=s):s=e[22];let f;e[23]!==r||e[24]!==l?(f=l(r?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=r,e[24]=l,e[25]=f):f=e[25];let v;e[26]!==f?(v=t.jsx("p",{className:"text-sm font-medium",children:f}),e[26]=f,e[27]=v):v=e[27];let j;e[28]!==r||e[29]!==l?(j=l(r?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=r,e[29]=l,e[30]=j):j=e[30];let R;e[31]!==j?(R=t.jsx("p",{className:"text-xs text-muted-foreground",children:j}),e[31]=j,e[32]=R):R=e[32];let d;e[33]!==v||e[34]!==R?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,R]}),e[33]=v,e[34]=R,e[35]=d):d=e[35];const c=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[36]!==c?(a=ue("size-1.5 rounded-full",c),e[36]=c,e[37]=a):a=e[37];let i;e[38]!==a?(i=t.jsx("span",{className:a}),e[38]=a,e[39]=i):i=e[39];const g=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let x;e[40]!==g?(x=ue("size-1.5 rounded-full",g),e[40]=g,e[41]=x):x=e[41];let b;e[42]!==x?(b=t.jsx("span",{className:x}),e[42]=x,e[43]=b):b=e[43];let m;e[44]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=m):m=e[44];let n;e[45]!==i||e[46]!==b?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[i,b,m]}),e[45]=i,e[46]=b,e[47]=n):n=e[47];let y;return e[48]!==n||e[49]!==d?(y=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,d,n]}),e[48]=n,e[49]=d,e[50]=y):y=e[50],y}export{at as G,He as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{du as St,dv as It,b9 as N,X as c,dw as de,bf as ze,dx as Et,b8 as Tt,aH as wt,a4 as O,a3 as W,a1 as oe,W as _,ba as m,a$ as U,co as Mt,dy as I,a2 as At,t as ge,c as Ee,r as J,F as Ot,j as Ct}from"./index-
|
|
1
|
+
import{du as St,dv as It,b9 as N,X as c,dw as de,bf as ze,dx as Et,b8 as Tt,aH as wt,a4 as O,a3 as W,a1 as oe,W as _,ba as m,a$ as U,co as Mt,dy as I,a2 as At,t as ge,c as Ee,r as J,F as Ot,j as Ct}from"./index-tHM8NTfd.js";import{S as Nt,u as Rt}from"./use-mcp-client-BAwn-0AV.js";import{d as xt}from"./delay-CnY5UFtP.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{d as Dt,D as Lt}from"./decopilot-sse-pool-CFz6l2VG.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 ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var Je="vercel.ai.error",kt=Symbol.for(Je),Ce,Ne,Z=class We extends(Ne=Error,Ce=kt,Ne){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return We.hasMarker(e,Je)}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 Ge(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Ye="AI_InvalidArgumentError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Re,xe,Zt=class extends(xe=Z,Re=jt,xe){constructor({message:t,cause:e,argument:a}){super({name:Ye,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,He)}},qe="AI_JSONParseError",Xe=`vercel.ai.error.${qe}`,$t=Symbol.for(Xe),Pe,De,Le=class extends(De=Z,Pe=$t,De){constructor({text:t,cause:e}){super({name:qe,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${Ge(e)}`,cause:e}),this[Pe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Xe)}},Qe="AI_TypeValidationError",Ke=`vercel.ai.error.${Qe}`,Ut=Symbol.for(Ke),ke,je,X=class ve extends(je=Z,ke=Ut,je){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:Qe,message:`${s}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${Ge(a)}`,cause:a}),this[ke]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,Ke)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Zt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Ft=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Bt=/"(?: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 Ze(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ft.test(t)===!1&&Bt.test(t)===!1?e:Vt(e)}function Vt(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 zt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ze(t)}try{return Ze(t)}finally{Error.stackTraceLimit=e}}function Te(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]=V(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(V):V(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(V)),t.allOf!=null&&(t.allOf=t.allOf.map(V)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(V));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=V(e[a]);return t}function V(t){return typeof t=="boolean"?t:Te(t)}var Jt=Symbol("Let zodToJsonSchema decide on which parser to use"),$e={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"},Wt=t=>typeof t=="string"?{...$e,name:t}:{...$e,...t};function R(){return{}}function Gt(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 Yt(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 Ht(){return{type:"boolean"}}function et(t,e){return b(t.type._def,e)}var qt=(t,e)=>b(t.innerType._def,e);function tt(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>tt(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 Xt(t)}}var Xt=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 Qt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function Kt(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):R()}function ea(t){return{type:"string",enum:Array.from(t.values)}}var ta=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function aa(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(ta(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 ra(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 at(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?na(t):t}var sa=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function na(t){let e="";for(let a=0;a<t.length;a++)sa.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ue(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Ue(e,r)}function Ue(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 Me,r as ie,d as os,F as Tt,b as Ge,j as t,B as xe,t as Qe,m as qe,K as Qt,n as rs,z as Es,u as As,p as Wt,E as Vs}from"./index-
|
|
1
|
+
import{c as Me,r as ie,d as os,F as Tt,b as Ge,j as t,B as xe,t as Qe,m as qe,K as Qt,n as rs,z as Es,u as As,p as Wt,E as Vs}from"./index-tHM8NTfd.js";import{S as Ks}from"./search-input-C_HmTn9N.js";import{P as et}from"./index-D6fjxFLg.js";import{E as is}from"./empty-state-Cj1VbJ0y.js";import{R as Us}from"./require-capability-B-Sqx0zT.js";import{x as ms,n as qs,y as Bs,z as us,B as Xt,D as qt,E as ys,H as Hs,I as fs,J as ws,A as Js,K as Qs}from"./automation-runs-D_CI6v6C.js";import{u as ts}from"./use-connection-uKN5YWIx.js";import{g as Ss}from"./connection-slug-eyAPH6o3.js";import{B as kt}from"./badge-kM5UAKst.js";import{P as $t,a as zt,b as Et}from"./popover-C3OgPzQD.js";import{c as Bt,T as Ht,a as Jt}from"./tooltip-C4NGAgAM.js";import{i as Yt}from"./Check-DN6IPn_3.js";import{a as Kt}from"./Copy01-BGeJ_uJU.js";import{n as xs,a as At}from"./Tool02-C-4pjcCY.js";import{i as ns}from"./FilterLines-BFxvHa0q.js";import{i as Gs}from"./Key01-YwqEObkc.js";import{i as Ws}from"./Play-DY15eh3c.js";import{aQ as Xs,a2 as Ys,a9 as Zs}from"./agent-icon-DW-jknHC.js";import{M as ps}from"./monaco-editor-AliIqm4c.js";import{u as el}from"./use-members-C_p-7j4-.js";import{S as tl,u as sl,W as ll}from"./use-mcp-client-BAwn-0AV.js";import{a as ol}from"./use-virtual-mcp-DXStXtw1.js";import{c as rl}from"./SwitchHorizontal01-C9T_FryU.js";import{s as il}from"./Plus-D7R6BF5R.js";import{s as nl}from"./Trash01-DnjcslV5.js";import{I as Dt}from"./input-CtPcKTyA.js";import{M as Rt}from"./multi-select-YuTRMMq6.js";import{a as Pt,b as Ft,d as He,c as _t,S as Ot}from"./select-QOGEC2YQ.js";import{t as Is}from"./ChevronDown-cZoWRgvb.js";import{s as al}from"./Stars02-Djd7mUzA.js";import{C as cl}from"./calendar-MyVXyluP.js";import{T as dl}from"./textarea-hljn8moZ.js";import{C as ks}from"./collection-tabs-C_e51TYz.js";import{S as ml}from"./switch-BAMPQcFC.js";import{L as ul}from"./label-Dx1_DE-f.js";import{I as Ct}from"./integration-icon-C-2mN9ni.js";import{A as Cs}from"./avatar-6012j4NF.js";import{A as fl,a as xl,b as pl}from"./alert-DM1JMd0G.js";import{C as Ts}from"./card-LK3SgMlx.js";import{K as Ye}from"./monitoring-stats-row-DN9PtAZT.js";import{u as Ms}from"./studio-tools-DBJ4BlKP.js";import{u as gl}from"./useSuspenseInfiniteQuery-BwVy3QbN.js";import{o as hl,m as vl,p as jl,q as Nl}from"./sidebar-DS29jp1e.js";import{T as tt,a as Gt,b as Ls,c as Ds,d as Ee,e as Rs}from"./table-DunMqZev.js";import{n as bl}from"./ChevronUp-CswOdRaR.js";import{u as yl}from"./use-infinite-scroll-DFYxMuWT.js";import{c as wl,b as Sl}from"./use-automations-RGeim-7x.js";import"./SearchMd-B-lbf8c2.js";import"./use-capability-nY6kVL8r.js";import"./access-gate-BUe45Oc3.js";import"./capability-load-error-DXOesTij.js";import"./useInfiniteQuery-DAxuc5L-.js";import"./use-clock-tick-GBpMaXwL.js";import"./AlertCircle-DevA0A1M.js";import"./CheckCircle-ck8m-YN6.js";import"./DotsVertical-Db5Rriwt.js";import"./XCircle-Eu9CNvjp.js";import"./Stars01-CAvqsR90.js";import"./ArrowRight-Dq4C6lJ4.js";import"./ChevronRight-CmrokxXJ.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-EWLYbeWi.js";import"./dialog-D370feZI.js";import"./X-DsJCvKBO.js";import"./use-mobile-B-9CWMAs.js";import"./tab-id-DLditg27.js";import"./hooks-DJ2YKeR9.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CFz6l2VG.js";import"./chat-context-4A5jyyEw.js";import"./use-ai-providers-COkTONXg.js";import"./use-decopilot-events-DSmTv1gx.js";import"./use-organization-settings-D0V5wIDO.js";import"./index-Dx1y19yx.js";import"./Eye-BqdZYqpI.js";import"./Star01-Bv8b5o6W.js";import"./XClose-BcWYJ3jm.js";import"./ZapSquare-DpSSWmnE.js";import"./Tool01-B14PZEqF.js";import"./Monitor01-c_9oVNrI.js";import"./Upload01-uhey7zjg.js";import"./shell-layout-DjpBxe62.js";import"./Users03-C-mvAxcs.js";import"./SearchLg-B1avg8bD.js";import"./Zap-BiPzgNTf.js";import"./required-auth-layout-C91T3YkY.js";import"./use-org-sso-C5GowRh9.js";import"./LinkExternal01-Dv9Aj-K0.js";import"./ArrowUpRight-Bay5EW8Z.js";import"./Palette-CgoT-TdN.js";import"./use-navigate-to-agent-DEAiy9mr.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BWfAq2gc.js";import"./form-Dj_8GoDc.js";import"./ArrowUp-CLXut3hx.js";import"./Settings02-k_lwzmTv.js";import"./TrendUp01-BVE2-KuE.js";import"./HardDrive-C1-SCHTe.js";import"./LayoutLeft-BzJLVhVQ.js";import"./LogOut01-D1zBEUWi.js";import"./Sun-DZlLfVSj.js";import"./Shield01-DFBgcYa0.js";import"./User01-DQzbx1Xu.js";import"./Users01-Ct4A_zsW.js";import"./use-org-auth-client-GW_RbwIG.js";import"./auth-Btre_1OW.js";import"./checkbox-C9Nq068Z.js";import"./command-DtoG6f_9.js";import"./index-CZWx2CTD.js";const ss={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},Il=["eq","contains","exists","in"];function kl(s){return Il.includes(s)}function st(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function Cl(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...d]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&kl(i)?i:"eq",value:decodeURIComponent(d.join(":")||"")}}).filter(e=>e!==void 0)}function Ut(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function gs(s){return s.trim()?s.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[l,...i]=e.split("=");return{key:l||"",operator:"eq",value:i.join("=")}}if(e.includes("~")){const[l,...i]=e.split("~");return{key:l||"",operator:"contains",value:i.join("~")}}if(e.includes("@")){const[l,...i]=e.split("@");return{key:l||"",operator:"in",value:i.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Tl(s){const e={},l={},i=[],d={};for(const n of s)if(n.key.trim())switch(n.operator){case"eq":n.value&&(e[n.key]=n.value);break;case"contains":n.value&&(l[n.key]=`%${n.value}%`);break;case"exists":i.push(n.key);break;case"in":n.value&&(d[n.key]=n.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(l).length>0?l:void 0,propertyKeys:i.length>0?i:void 0,propertyInValues:Object.keys(d).length>0?d:void 0}}function hs(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};const e=s._decocms_truncated;if(typeof e=="string"&&e.length>0)return{content:e,isTruncated:!0,originalSize:e.length};let l;try{l=JSON.stringify(s,null,2)}catch{return{content:"[Unable to serialize JSON]",isTruncated:!1,originalSize:0}}const i=l.length;return i<=ss.maxJsonRenderSize?{content:l,isTruncated:!1,originalSize:i}:{content:l.slice(0,ss.maxJsonRenderSize)+`
|
|
4
4
|
|