decocms 4.58.5 → 4.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DmkKUOhm.js → AlertCircle-CAhfY1-I.js} +1 -1
- package/dist/client/assets/{AreaChart-QWxGbKBu.js → AreaChart-CMkV5kTR.js} +1 -1
- package/dist/client/assets/{ArrowUp-DMeNZgjG.js → ArrowUp-CJqXPjUf.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Gimwrhen.js → ArrowUpRight-CNxNg8gQ.js} +1 -1
- package/dist/client/assets/{Check-DYxjoBWV.js → Check-DanyiEnL.js} +1 -1
- package/dist/client/assets/{CheckCircle-B4NmlxYQ.js → CheckCircle-QUfhm4t_.js} +1 -1
- package/dist/client/assets/{ChevronDown-BrD8qg2M.js → ChevronDown-BApPtVmh.js} +1 -1
- package/dist/client/assets/{ChevronRight-D2gtrGMP.js → ChevronRight-DWn63Qut.js} +1 -1
- package/dist/client/assets/{ChevronUp-BKNlcHhX.js → ChevronUp-DHN-jwxT.js} +1 -1
- package/dist/client/assets/{Circle-B_Fqw1K-.js → Circle-BQyPp8-D.js} +1 -1
- package/dist/client/assets/{Copy01-Bc9QBhFd.js → Copy01-BF37UFdB.js} +1 -1
- package/dist/client/assets/{DotsVertical-WBMZIKtT.js → DotsVertical-LI2dCOUo.js} +1 -1
- package/dist/client/assets/{Eye-BKTF2OaK.js → Eye-CuhoU23S.js} +1 -1
- package/dist/client/assets/{FilterLines-Cxtbp1DY.js → FilterLines-NLpPVI-d.js} +1 -1
- package/dist/client/assets/{Globe01-oF2ruraB.js → Globe01-DuV6QcZy.js} +1 -1
- package/dist/client/assets/{Globe04-Bt3_QuH9.js → Globe04-CbE6CX79.js} +1 -1
- package/dist/client/assets/{HardDrive-B4iV_oDv.js → HardDrive-B1IIWkTs.js} +1 -1
- package/dist/client/assets/{Key01-z2KeAwWe.js → Key01-_q-La8CZ.js} +1 -1
- package/dist/client/assets/{LayoutLeft-EcdOJis4.js → LayoutLeft-Dw2hmIVd.js} +1 -1
- package/dist/client/assets/{LinkExternal01-m0U-Lm_o.js → LinkExternal01-DzbL04rr.js} +1 -1
- package/dist/client/assets/{List-CfReT_EU.js → List-BzPiI9b3.js} +1 -1
- package/dist/client/assets/{Loading02-BYwsqZEG.js → Loading02-BD0siFDt.js} +1 -1
- package/dist/client/assets/{Monitor01-BTk9yxuR.js → Monitor01-CbNIOnyB.js} +1 -1
- package/dist/client/assets/{Package-BUQJFAeb.js → Package-C23vLxNv.js} +1 -1
- package/dist/client/assets/{Palette-DCYAwuZ_.js → Palette-BIL7c4-L.js} +1 -1
- package/dist/client/assets/{Play-BFoRJghB.js → Play-GDXaUCH4.js} +1 -1
- package/dist/client/assets/{Plus-BC3OQAv6.js → Plus-Bu9bwB8j.js} +1 -1
- package/dist/client/assets/{SearchLg-BSwwKRR3.js → SearchLg-D7xA7zpm.js} +1 -1
- package/dist/client/assets/{SearchMd-GQIk2JN7.js → SearchMd-kTkW79UX.js} +1 -1
- package/dist/client/assets/{Settings02-C8WW6-r8.js → Settings02-C5v-emPS.js} +1 -1
- package/dist/client/assets/{Shield01-Bsiz7jUT.js → Shield01-t3-_-OY2.js} +1 -1
- package/dist/client/assets/{Star01-CoAmgzIu.js → Star01-DsSI6JW7.js} +1 -1
- package/dist/client/assets/{Stars01-DaCn5yDz.js → Stars01-8mxVtFbj.js} +1 -1
- package/dist/client/assets/{Stars02-kVXYdBfS.js → Stars02-DxxHV0k7.js} +1 -1
- package/dist/client/assets/{Sun-gbZ0Crr7.js → Sun-D-S9S2ej.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D0WmE4M_.js → SwitchHorizontal01-t1IT2jBx.js} +1 -1
- package/dist/client/assets/{Tool01-BHeREp7L.js → Tool01-Dv8zTOAK.js} +1 -1
- package/dist/client/assets/{Tool02-J_PfM8Nz.js → Tool02-ClipZ7bo.js} +1 -1
- package/dist/client/assets/{Trash01-DTo19AbB.js → Trash01-3_WDaYuV.js} +1 -1
- package/dist/client/assets/{TrendUp01-BlXicyb4.js → TrendUp01-znQWqXKh.js} +1 -1
- package/dist/client/assets/{Upload01-D2kJMwQq.js → Upload01-CSq1162V.js} +1 -1
- package/dist/client/assets/{User01-DAvNYaFB.js → User01-ClCsZZP9.js} +1 -1
- package/dist/client/assets/{Users01-BXcNizDT.js → Users01-DxmBQruN.js} +1 -1
- package/dist/client/assets/{Users03-Bv07fLWj.js → Users03-D6h5pXVq.js} +1 -1
- package/dist/client/assets/{X-B7Sc0GS4.js → X-B8cdBzJ0.js} +1 -1
- package/dist/client/assets/{XCircle-BUA08cO-.js → XCircle--KFzS8uf.js} +1 -1
- package/dist/client/assets/{XClose-DUzYp9PV.js → XClose-BIcQUxWe.js} +1 -1
- package/dist/client/assets/{Zap-BchfKKws.js → Zap-5x6E8SYA.js} +1 -1
- package/dist/client/assets/{ZapSquare-D534FsK3.js → ZapSquare-CEGEJhAq.js} +1 -1
- package/dist/client/assets/{ZoomOut-Bb6xRcrC.js → ZoomOut-CPyQR9cf.js} +1 -1
- package/dist/client/assets/{access-gate-DvLkIQEB.js → access-gate-ybDqt62Q.js} +1 -1
- package/dist/client/assets/{add-section-modal-DrC7rGwY.js → add-section-modal-BEdX2PIy.js} +1 -1
- package/dist/client/assets/{agent-icon-DrSWK4T8.js → agent-icon-BVYuA7Oa.js} +1 -1
- package/dist/client/assets/{agents-list-CazHYJrP.js → agents-list-BI7OVFSz.js} +1 -1
- package/dist/client/assets/{ai-providers-C5e8zl2m.js → ai-providers-AUfUnQL3.js} +1 -1
- package/dist/client/assets/{alert-DWiS1Ssy.js → alert-CB1BcySG.js} +1 -1
- package/dist/client/assets/{alert-dialog-BjO-yqLW.js → alert-dialog-bGcaxIEN.js} +3 -3
- package/dist/client/assets/app-editor-De3qb1xS.js +1 -0
- package/dist/client/assets/{auth-Cr406d5k.js → auth-CwljyZPh.js} +1 -1
- package/dist/client/assets/{auth-catchall-DmK3mLYZ.js → auth-catchall-CZ9cU40-.js} +1 -1
- package/dist/client/assets/{auth-entry-Cbx-GuS4.js → auth-entry-C6RuvS5q.js} +1 -1
- package/dist/client/assets/{auth-split-layout-EAOc66uL.js → auth-split-layout-BUfPVFko.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BP5LS1nd.js → authenticate-and-persist-oauth-B2DnQbSw.js} +1 -1
- package/dist/client/assets/{automation-list-row-CrJ2rvgh.js → automation-list-row-BoM-GHgO.js} +1 -1
- package/dist/client/assets/{automation-runs-DTIdBSof.js → automation-runs-BFZIrw9m.js} +1 -1
- package/dist/client/assets/automations-BmmmF_u2.js +1 -0
- package/dist/client/assets/{autosend-B2JqcvZh.js → autosend-Cgw0LO6f.js} +1 -1
- package/dist/client/assets/{avatar-pT8UjaWS.js → avatar-D1BbV9dp.js} +1 -1
- package/dist/client/assets/{badge-CV-Q9eu5.js → badge-3OH2cdJk.js} +1 -1
- package/dist/client/assets/{block-document-DtE_kuZ8.js → block-document-BDYEic9n.js} +1 -1
- package/dist/client/assets/{brand-context-D_nuRqPr.js → brand-context-mT5kKhNh.js} +1 -1
- package/dist/client/assets/{buckets-BFQpuNkV.js → buckets-riSvZz6H.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DzdXnKMT.js → bulk-category-panel-D6gjFCwQ.js} +1 -1
- package/dist/client/assets/{calendar-DKmCedkw.js → calendar-6Go5xXYA.js} +1 -1
- package/dist/client/assets/{capability-load-error-DEzva6Xd.js → capability-load-error-NkKSnlKi.js} +1 -1
- package/dist/client/assets/{card-B_g-bY4h.js → card-ywNPelP4.js} +1 -1
- package/dist/client/assets/category-editor-V7Yj0KHT.js +1 -0
- package/dist/client/assets/chat-context-CvjQMyke.js +28 -0
- package/dist/client/assets/{checkbox-G49vRqoM.js → checkbox-Bj_DwN9o.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BVDV8nJr.js → cli-auth-success-BTxpgVS3.js} +1 -1
- package/dist/client/assets/collection-detail-D21kPj2q.js +1 -0
- package/dist/client/assets/{collection-display-button-CQDEsifn.js → collection-display-button-BJfPUKE4.js} +1 -1
- package/dist/client/assets/{collection-search-DpJQEBO5.js → collection-search-DitylQVA.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DnXCMPMf.js → collection-table-wrapper-D_6Mi7wH.js} +1 -1
- package/dist/client/assets/{collection-tabs-BbkNjy2P.js → collection-tabs-KzsrqC8l.js} +1 -1
- package/dist/client/assets/{command-Sv_8xo4a.js → command-BIP4vaGE.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-4RfRMnpk.js → commerce-onboarding-DJe165NY.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-u9wYmVqy.js → connect-desktop-dialog-DWFQpS_H.js} +1 -1
- package/dist/client/assets/{connection-card-Bgg_OkYA.js → connection-card-BzPHXusj.js} +1 -1
- package/dist/client/assets/{connection-detail-CM7qNLh_.js → connection-detail-3GdLb4fJ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bi6ZDNqH.js → connection-form-helpers-BG0cOPY5.js} +1 -1
- package/dist/client/assets/{connections-Bu_u8mU5.js → connections-UmN7B2Ql.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DhNLRlpz.js → decopilot-sse-pool-BOoUc205.js} +1 -1
- package/dist/client/assets/{dialog-B_6-uR4V.js → dialog-CS6EDVA4.js} +1 -1
- package/dist/client/assets/{domain-settings-DAZrDgxX.js → domain-settings-BbnLGqPe.js} +1 -1
- package/dist/client/assets/{drawer-BE9ljxm4.js → drawer-CTZJ2rAS.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CYQZB-4N.js → dropdown-menu-C2eFZtvw.js} +1 -1
- package/dist/client/assets/{empty-state-BTc9UY0F.js → empty-state-CqYJWNTB.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CvHlHsvl.js → extract-connection-data-CqVJ9mYj.js} +1 -1
- package/dist/client/assets/file-explorer-Dg1dLblo.js +2 -0
- package/dist/client/assets/{file-type-icon-x196dC_k.js → file-type-icon-5cBucj4Z.js} +1 -1
- package/dist/client/assets/{files-HVnAj5g0.js → files-CgfJa6LA.js} +1 -1
- package/dist/client/assets/{form-BpJgWXmx.js → form-DChJt1IJ.js} +1 -1
- package/dist/client/assets/{general-BRnnePfm.js → general-DwZLxCS6.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DPCWySa3.js → github-repo-picker-DxX-MN6R.js} +1 -1
- package/dist/client/assets/{hooks-MtX5yASy.js → hooks-D4O7gEHf.js} +2 -2
- package/dist/client/assets/{index-DpZiwWtQ.js → index-8MqyY2FH.js} +1 -1
- package/dist/client/assets/{index-rc7xx5cq.js → index-C0jM0g4Y.js} +1 -1
- package/dist/client/assets/{index-COnCP9Pm.js → index-C5AgWvQk.js} +1 -1
- package/dist/client/assets/index-Cb2Ylen2.js +1 -0
- package/dist/client/assets/{index-CpmRkbKB.js → index-Chh9RHFe.js} +1 -1
- package/dist/client/assets/{index-DfceqVpf.js → index-CpZPszPD.js} +6 -6
- package/dist/client/assets/index-CyKS18Fo.js +519 -0
- package/dist/client/assets/{index-BVSRBupd.js → index-D7lkrNY4.js} +1 -1
- package/dist/client/assets/{index-D1cnvmIK.js → index-D9UEbl2s.js} +1 -1
- package/dist/client/assets/{index-vUa7jft6.js → index-DJnB8JtD.js} +1 -1
- package/dist/client/assets/{index-BB2Lp-YP.js → index-H2smweq-.js} +1 -1
- package/dist/client/assets/index-HuEHg6r8.css +1 -0
- package/dist/client/assets/{index-BoCwmHA9.js → index-NzZzUEr9.js} +1 -1
- package/dist/client/assets/{index-CgBmlUGm.js → index-Zph9A7yf.js} +3 -3
- package/dist/client/assets/{index-redirect-Dxbb0cRJ.js → index-redirect-CQNCPzHE.js} +1 -1
- package/dist/client/assets/index-wL3MlfNU.js +1 -0
- package/dist/client/assets/{input-BnfEMIGT.js → input-CUUe2IQe.js} +1 -1
- package/dist/client/assets/{integration-icon-DLw7Zft3.js → integration-icon-CSLpssyE.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CbenwQ8v.js → invite-member-dialog-fMYShoJ-.js} +1 -1
- package/dist/client/assets/{label-BdRgp1MD.js → label-BGyB36M1.js} +1 -1
- package/dist/client/assets/{layout-CqeBa1cF.js → layout-t74mRWaE.js} +1 -1
- package/dist/client/assets/{login-CYEaQqwT.js → login-B6OBiRjq.js} +1 -1
- package/dist/client/assets/{mcp-oauth-8tCiarSV.js → mcp-oauth-oOtKvLXg.js} +1 -1
- package/dist/client/assets/{members-R-KJb-Nb.js → members-DrYtPaUZ.js} +1 -1
- package/dist/client/assets/{monaco-editor-DbroNHLy.js → monaco-editor-rZmsrnl3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DWrjP-P4.js → monitoring-stats-row-DIVfa2WI.js} +1 -1
- package/dist/client/assets/{oauth-callback-B5oUBRK_.js → oauth-callback-DLJO0SZu.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C9rCA9BF.js → oauth-callback-ai-provider-CfWkt8o9.js} +1 -1
- package/dist/client/assets/{onboarding-BlaWK09V.js → onboarding-8eWMYwyA.js} +1 -1
- package/dist/client/assets/{org-install-CNf-OWcO.js → org-install-DjzI551t.js} +1 -1
- package/dist/client/assets/{org-layout-ByALDfov.js → org-layout-BuNdKPV_.js} +1 -1
- package/dist/client/assets/{organization-choice-CTuH9NQx.js → organization-choice-CgkZtwbY.js} +1 -1
- package/dist/client/assets/{orgs-frB9HZGo.js → orgs-CnEtKOua.js} +1 -1
- package/dist/client/assets/{page-seo-form-4KKLbC--.js → page-seo-form-DYH-zjCO.js} +1 -1
- package/dist/client/assets/page-seo-sheet-4ecioc_U.js +1 -0
- package/dist/client/assets/{popover-B2JX6-0F.js → popover-D-tVO42q.js} +1 -1
- package/dist/client/assets/post-editor-B-25ZlfI.js +1 -0
- package/dist/client/assets/{primitives-DOEQanbU.js → primitives-C8z1ctK9.js} +1 -1
- package/dist/client/assets/{profile-D-8Tz2JV.js → profile-gyw2jnYz.js} +1 -1
- package/dist/client/assets/project-app-view-BT8Kq9Tv.js +1 -0
- package/dist/client/assets/record-editor-DIFzf9nj.js +1 -0
- package/dist/client/assets/{registry-layout-D11d1EH8.js → registry-layout-CNAsuCnF.js} +1 -1
- package/dist/client/assets/registry-rgyxXC6C.js +2 -0
- package/dist/client/assets/{reports-YOAOmQPl.js → reports-Uv1n5J03.js} +1 -1
- package/dist/client/assets/{require-capability-CRc0PI1K.js → require-capability-CmUTiDqU.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dun_88x7.js → required-auth-layout-Dd3Zjc0e.js} +1 -1
- package/dist/client/assets/{reset-password-C01iUl_w.js → reset-password-CufXY7i_.js} +1 -1
- package/dist/client/assets/{roles-CDxA1daT.js → roles-CeowhO7J.js} +1 -1
- package/dist/client/assets/{search-input--1w25EJQ.js → search-input-Co8buizV.js} +1 -1
- package/dist/client/assets/{secrets-mBYvAZ8C.js → secrets-D_LZKxNT.js} +1 -1
- package/dist/client/assets/{sections-editor-6Hfiw9AZ.js → sections-editor-BZ4dK03B.js} +2 -2
- package/dist/client/assets/{select-YITUw-eM.js → select-CLnM5xZY.js} +1 -1
- package/dist/client/assets/{select-model-BiEGzTzi.js → select-model-DHvKHtQ9.js} +1 -1
- package/dist/client/assets/seo-editor-C21X4Q2z.js +1 -0
- package/dist/client/assets/settings-layout-Dfl-lUfC.js +1 -0
- package/dist/client/assets/{settings-section-D76W_ZOD.js → settings-section-DgeqehPc.js} +1 -1
- package/dist/client/assets/shell-controls-CT9oavT5.js +1 -0
- package/dist/client/assets/{shell-layout-D1XBVOK8.js → shell-layout-BRwC1gio.js} +1 -1
- package/dist/client/assets/{sidebar-jC_LjgnK.js → sidebar-nisndB4B.js} +1 -1
- package/dist/client/assets/{skeleton-RwzvQC_m.js → skeleton-D0D1c07b.js} +1 -1
- package/dist/client/assets/{sso-DcrhFcWz.js → sso-BSDd9tq8.js} +1 -1
- package/dist/client/assets/{store-63IePOFu.js → store-BV1X0Xqt.js} +1 -1
- package/dist/client/assets/store-registry-ZVDNYEZt.js +2 -0
- package/dist/client/assets/{studio-tools-DtERx3-w.js → studio-tools-BSLnTfFC.js} +1 -1
- package/dist/client/assets/{switch-D80K3uBB.js → switch-CAPrI9f4.js} +1 -1
- package/dist/client/assets/{table-BkZs-l64.js → table-BV77eO9f.js} +1 -1
- package/dist/client/assets/{tabs-BoJ2RRJH.js → tabs-Dnhjr_ni.js} +1 -1
- package/dist/client/assets/{textarea-D1IgqmmJ.js → textarea-DAEAkdQ_.js} +1 -1
- package/dist/client/assets/{toggle-group-BESFh1Up.js → toggle-group-z06LwOXU.js} +1 -1
- package/dist/client/assets/toolbar-KDAy2LOV.js +1 -0
- package/dist/client/assets/{toolbar-icon-button-BHN8jOXq.js → toolbar-icon-button-CVVU6wPU.js} +1 -1
- package/dist/client/assets/{tools-list-C_inZD2F.js → tools-list-AydqEwPG.js} +1 -1
- package/dist/client/assets/{tooltip-CB_N8QyX.js → tooltip-CT63cZcY.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B21DVkoY.js → use-ai-providers-CNn-G0WG.js} +1 -1
- package/dist/client/assets/{use-automations-DAxW4YOG.js → use-automations-Dl6TdHzo.js} +1 -1
- package/dist/client/assets/{use-capability-DXWPCR7E.js → use-capability-B6eGKNoH.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CIfovY09.js → use-clock-tick-BPem6EqS.js} +1 -1
- package/dist/client/assets/{use-collections-BhGPmLDM.js → use-collections-C3OPKdUJ.js} +1 -1
- package/dist/client/assets/{use-connection-Don2WgMf.js → use-connection-CWojo_D3.js} +1 -1
- package/dist/client/assets/{use-copy-D9V8a-BA.js → use-copy-CxtHgMoF.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DACeDuiK.js → use-create-virtual-mcp-BwWtNGwR.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CwePX8_C.js → use-debounced-autosave-drPWJZkH.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DDhg7maH.js → use-debounced-value-COlFFg1d.js} +1 -1
- package/dist/client/assets/use-deco-credits-BOpkUCFX.js +1 -0
- package/dist/client/assets/{use-decopilot-events-CdQ11k4e.js → use-decopilot-events-Bf9nxorT.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CESgQQPM.js → use-delete-connection-B9DLwSDQ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C-p7NcWq.js → use-deployment-admin-B5jnygPZ.js} +1 -1
- package/dist/client/assets/{use-file-configs-DjGQF94E.js → use-file-configs-DT0jLQzS.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CI9or9uk.js → use-infinite-scroll-0Zcm9XAP.js} +1 -1
- package/dist/client/assets/{use-join-requests-BRQ7B01q.js → use-join-requests-BYCTGU4E.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CdJHCm8Y.js → use-mcp-client-DA4l7NMh.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BaIf7aPi.js → use-mcp-tools-DFM0siR4.js} +1 -1
- package/dist/client/assets/{use-members-D7p2Y_Sp.js → use-members-BOUewexP.js} +1 -1
- package/dist/client/assets/{use-mobile-B9R6eaP0.js → use-mobile-_5IIYeUG.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-CCdr2MAT.js +1 -0
- package/dist/client/assets/{use-org-auth-client-qPiJ9muQ.js → use-org-auth-client-DjqRzh-D.js} +1 -1
- package/dist/client/assets/{use-org-sso-DVm_ZMu0.js → use-org-sso-DBUVZzYp.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bl7KPPFu.js → use-organization-roles-Co8EUVEp.js} +1 -1
- package/dist/client/assets/use-organization-settings-Czmh3IHJ.js +1 -0
- package/dist/client/assets/use-registry-connections-BaiK5dhC.js +1 -0
- package/dist/client/assets/{use-secrets-R9ijaYXA.js → use-secrets-Fpj5hs9J.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DNCLrwgH.js → use-status-sounds-BsTQkWMh.js} +1 -1
- package/dist/client/assets/{use-view-mode-hbBi1AjX.js → use-view-mode-DJIg85oh.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-9wSLzLB_.js → use-virtual-mcp-CCbgOxsv.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DUk6rN9-.js +1 -0
- package/dist/client/assets/{useRouterState-BtJCOeXu.js → useRouterState-CRUjsuyq.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BH7eDxqd.js +1 -0
- package/dist/client/assets/{users-CoyQldzm.js → users-DMWmGBAn.js} +1 -1
- package/dist/client/assets/{variant-calendar-BLe1F2o5.js → variant-calendar-gZNap7OW.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B5VpN44M.js → view-mode-toggle-C6z_jqZe.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +218 -221
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-capabilities-D4qVYFGl.js +0 -1
- package/dist/client/assets/app-editor-BvRMXYUj.js +0 -1
- package/dist/client/assets/automations-DYkmPo70.js +0 -1
- package/dist/client/assets/breadcrumb-KAYTw6cp.js +0 -1
- package/dist/client/assets/category-editor-C8d9H87J.js +0 -1
- package/dist/client/assets/chat-context-B3fhdzY7.js +0 -28
- package/dist/client/assets/collection-detail-DhEzbVeK.js +0 -1
- package/dist/client/assets/file-explorer-FC0-Nk0f.js +0 -2
- package/dist/client/assets/index-5j_V_WzF.js +0 -1
- package/dist/client/assets/index-B_EB6W38.css +0 -1
- package/dist/client/assets/index-iuSXEyY3.js +0 -519
- package/dist/client/assets/index-lSTbpmGd.js +0 -1
- package/dist/client/assets/page-seo-sheet-_D8bPs-T.js +0 -1
- package/dist/client/assets/post-editor-Yy07sm7u.js +0 -1
- package/dist/client/assets/project-app-view-W9cF5z_o.js +0 -1
- package/dist/client/assets/record-editor-DBQKHVL8.js +0 -1
- package/dist/client/assets/registry-B4hs64Aa.js +0 -2
- package/dist/client/assets/seo-editor-CWHt-0kE.js +0 -1
- package/dist/client/assets/settings-layout-DiVhKoC1.js +0 -1
- package/dist/client/assets/shell-controls-CK1hP56f.js +0 -1
- package/dist/client/assets/store-registry-D8WsJ3u9.js +0 -2
- package/dist/client/assets/toolbar-DJusbmmf.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-3qDPth_I.js +0 -1
- package/dist/client/assets/use-organization-settings-BIgNW-JC.js +0 -1
- package/dist/client/assets/use-registry-connections-CkzW69jF.js +0 -1
- package/dist/client/assets/useInfiniteQuery-uL7J0_7H.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-1KPMSa71.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as ke,a as en,Z as un,M as mn,J as pn,j as e,B as J,t as X,r as le,n as hn,b as fn,i as Se,R as C,K as pe,c as xn,a2 as gn,Y as jn,l as vn,m as yn}from"./index-CgBmlUGm.js";import{g as _n}from"./connection-slug-eyAPH6o3.js";import{u as nn,a as tn,g as Cn,C as Le}from"./connection-card-Bgg_OkYA.js";import{C as bn}from"./collection-search-DpJQEBO5.js";import{C as Nn}from"./collection-tabs-BbkNjy2P.js";import{a as wn,b as Sn,e as In,g as kn}from"./extract-connection-data-CvHlHsvl.js";import{e as sn,d as on,D as an,a as rn,f as An,c as Dn}from"./dialog-B_6-uR4V.js";import{D as Pn,a as Tn,c as Fn,b as Vn,d as Mn,e as Bn,f as On}from"./drawer-BE9ljxm4.js";import{u as Ln}from"./use-mobile-B9R6eaP0.js";import{F as O,b as L,c as R,d as $,e as E,a as Qe}from"./form-BpJgWXmx.js";import{I as Y}from"./input-BnfEMIGT.js";import{S as Rn,a as $n,b as En,c as zn,d as me}from"./select-YITUw-eM.js";import{T as Kn}from"./textarea-D1IgqmmJ.js";import{b as cn}from"./use-connection-Don2WgMf.js";import{n as Ie,i as Re}from"./Tool02-J_PfM8Nz.js";import{s as $e}from"./Star01-CoAmgzIu.js";import{am as Hn}from"./agent-icon-DrSWK4T8.js";import{s as Un}from"./XClose-DUzYp9PV.js";import{c as Xn,i as Ne,a as We,E as qn,p as Gn,b as Qn,d as Wn}from"./connection-form-helpers-Bi6ZDNqH.js";import{u as Ye}from"./use-infinite-scroll-CI9or9uk.js";import{a as Ee}from"./authenticate-and-persist-oauth-BP5LS1nd.js";import{B as we}from"./badge-CV-Q9eu5.js";import{T as ze,a as Ke,b as He}from"./tooltip-CB_N8QyX.js";import{u as Yn}from"./useSuspenseInfiniteQuery-1KPMSa71.js";import{u as Jn}from"./use-mcp-client-CdJHCm8Y.js";import{S as Zn}from"./constants-CaIX_f5U.js";import{i as Je}from"./Check-DYxjoBWV.js";import{s as et}from"./Plus-BC3OQAv6.js";import{u as nt}from"./studio-tools-DtERx3-w.js";import{u as tt}from"./use-ai-providers-B21DVkoY.js";function st({open:s,onOpenChange:n,onCreated:m}){const{org:g}=ke(),{data:h}=en.useSession(),{stdioEnabled:S}=un(),D=Ln(),z=cn(),l=nn(),P=tn(l,"").items,o=mn({resolver:pn(Xn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=o.watch("ui_type"),I=o.watch("connection_url"),F=o.watch("npx_package"),x=Ne({uiType:f,connectionUrl:I??"",npxPackage:F??""})??We({uiType:f,connectionUrl:I??"",registryItems:P}),r=t=>{const d=t.trim();if(!d)return;const a=!!o.formState.dirtyFields.title,c=!!o.formState.dirtyFields.description,j=!!o.formState.dirtyFields.env_vars,N=u=>{if(u&&(!a&&!o.getValues("title").trim()&&u.title&&o.setValue("title",u.title,{shouldDirty:!1}),!c&&!(o.getValues("description")??"").trim()&&u.description&&o.setValue("description",u.description,{shouldDirty:!1}),!j&&u.envVarKeys?.length)){const w=o.getValues("env_vars")??[],q=new Set(w.map(M=>M.key)),he=u.envVarKeys.filter(M=>!q.has(M));he.length>0&&o.setValue("env_vars",[...w,...he.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},v=Gn(d);if(v&&S){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",v.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),N(Ne({uiType:"NPX",npxPackage:v.packageName}));return}if(d.startsWith("http://")||d.startsWith("https://")){const u=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";o.setValue("ui_type",u,{shouldDirty:!0}),o.setValue("connection_url",d,{shouldDirty:!0}),N(Ne({uiType:u,connectionUrl:d})??We({uiType:u,connectionUrl:d,registryItems:P}));return}f==="NPX"&&N(Ne({uiType:"NPX",npxPackage:d}))},K=t=>{t||o.reset(),n(t)},b=async t=>{let d,a=null,c=null,j=null;t.ui_type==="NPX"?(d="STDIO",a="",j=Qn(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(d="STDIO",a="",j=Wn(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(d=t.ui_type,a=t.connection_url||"",c=t.connection_token||null);const N=wn("conn");try{await z.create.mutateAsync({id:N,title:t.title,description:t.description||null,connection_type:d,connection_url:a,connection_token:c,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:h?.user?.id||"system",organization_id:g.id,icon:t.icon??null,app_name:null,app_id:null,connection_headers:j,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),o.reset(),n(!1),m?.(N)}catch{X.error("Failed to create connection")}},k="Create Connection",H="Create a custom connection in your organization. Fill in the details below.",_=o.formState.isSubmitting?"Saving...":"Create Connection",V=e.jsxs("div",{className:"grid gap-4",children:[e.jsx(O,{control:o.control,name:"ui_type",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"Type *"}),e.jsxs(Rn,{value:t.value,onValueChange:t.onChange,children:[e.jsx($,{children:e.jsx($n,{children:e.jsx(En,{})})}),e.jsxs(zn,{children:[e.jsx(me,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(me,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(me,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"w-4 h-4"}),"Websocket"]})}),S&&e.jsxs(e.Fragment,{children:[e.jsx(me,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(me,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Hn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(E,{})]})}),f==="NPX"&&e.jsx(O,{control:o.control,name:"npx_package",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"NPM Package *"}),e.jsx($,{children:e.jsx(Y,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:d=>{const a=d.clipboardData.getData("text");a&&(d.preventDefault(),o.setValue("npx_package",a.trim(),{shouldDirty:!0}),r(a))},onBlur:d=>{r(d.target.value),t.onBlur()}})}),e.jsx(E,{})]})}),f==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(O,{control:o.control,name:"stdio_command",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"Command *"}),e.jsx($,{children:e.jsx(Y,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(E,{})]})}),e.jsx(O,{control:o.control,name:"stdio_args",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"Arguments"}),e.jsx($,{children:e.jsx(Y,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(E,{})]})})]}),e.jsx(O,{control:o.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"Working Directory"}),e.jsx($,{children:e.jsx(Y,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(E,{})]})})]}),(f==="NPX"||f==="STDIO")&&e.jsx(O,{control:o.control,name:"env_vars",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"Environment Variables"}),e.jsx($,{children:e.jsx(qn,{value:t.value??[],onChange:t.onChange})}),e.jsx(E,{})]})}),f!=="NPX"&&f!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(O,{control:o.control,name:"connection_url",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"URL *"}),e.jsx($,{children:e.jsx(Y,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:d=>{const a=d.clipboardData.getData("text");a&&(d.preventDefault(),o.setValue("connection_url",a.trim(),{shouldDirty:!0}),r(a))},onBlur:d=>{r(d.target.value),t.onBlur()}})}),e.jsx(E,{})]})}),e.jsx(O,{control:o.control,name:"connection_token",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:x?.token?.label??"Token (optional)"}),e.jsx($,{children:e.jsx(Y,{type:"password",placeholder:x?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...t,value:t.value??""})}),x?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(E,{})]})})]}),e.jsx(O,{control:o.control,name:"title",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"Name *"}),e.jsx($,{children:e.jsx(Y,{placeholder:"My Connection",...t})}),e.jsx(E,{})]})}),e.jsx(O,{control:o.control,name:"description",render:({field:t})=>e.jsxs(L,{children:[e.jsx(R,{children:"Description"}),e.jsx($,{children:e.jsx(Kn,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(E,{})]})})]});return D?e.jsx(Pn,{open:s,onOpenChange:K,children:e.jsxs(Tn,{className:"max-h-[90vh]",children:[e.jsx(Fn,{className:"pb-2",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 text-left",children:[e.jsx(Vn,{children:k}),e.jsx(Mn,{className:"mt-1",children:H})]}),e.jsx(Bn,{asChild:!0,children:e.jsx(J,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:e.jsx(Un,{size:16})})})]})}),e.jsx(Qe,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(b),children:[e.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:V}),e.jsx(On,{children:e.jsx(J,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:_})})]})})]})}):e.jsx(sn,{open:s,onOpenChange:K,children:e.jsxs(on,{className:"sm:max-w-[525px]",children:[e.jsxs(an,{children:[e.jsx(rn,{children:k}),e.jsx(An,{children:H})]}),e.jsx(Qe,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(b),children:[e.jsx("div",{className:"py-4",children:V}),e.jsxs(Dn,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>K(!1),children:"Cancel"}),e.jsx(J,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:_})]})]})})]})})}function ot(s){const n=xn.c(68),{mode:m,agentId:g,addedConnectionIds:h,onAdd:S,onCloneAndAdd:D,onConnectAndAdd:z,connectingItemId:l,search:y,onCreateConnection:P,onBrowseNavigate:o,defaultTab:f}=s,I=m===void 0?"add":m,F=f===void 0?"connected":f,{org:x}=ke(),r=le.useDeferredValue(y),K=y!==r;let b;n[0]!==r?(b=r.trim().toLowerCase(),n[0]=r,n[1]=b):b=n[1];const k=b;let H;n[2]!==F?(H=i=>i??F,n[2]=F,n[3]=H):H=n[3];const[_,V]=gn(jn.connectionsTab(x.slug)+(F==="all"?":home-modal":":agent-modal"),H);let t;n[4]!==_||n[5]!==V?(t=i=>{i!==_&&C("connections_dialog_tab_changed",{to_tab:i}),V(i)},n[4]=_,n[5]=V,n[6]=t):t=n[6];const d=t;let a;n[7]!==x.id||n[8]!==x.slug?(a={connectionId:Zn,orgId:x.id,orgSlug:x.slug},n[7]=x.id,n[8]=x.slug,n[9]=a):a=n[9];const c=Jn(a),j=r?.trim().split(/\s+/).filter(Boolean)??[],N=j.length>0?{operator:"or",conditions:j.flatMap(mt)}:void 0,v={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},u=JSON.stringify(v),{data:w,fetchNextPage:q,hasNextPage:he,isFetchingNextPage:M}=Yn({queryKey:pe.collectionListInfinite(c,x.id,"","CONNECTIONS",u),queryFn:async i=>{const{pageParam:p}=i,U=p===void 0?0:p;return(await c.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:U}})).structuredContent},initialPageParam:0,getNextPageParam:dt,staleTime:3e4}),Xe=w?.pages.flatMap(lt)??[],fe=Cn(Xe),ln=new Set(Xe.filter(ct).map(rt)),xe=nn(),G=tn(xe,r),Ae=Ye(G.loadMore,G.hasMore,G.isLoadingMore),De=Ye(q,he??!1,M),T=_==="all"||!!k,qe=T?G.items.filter(i=>{const p=Sn(i);if(p&&ln.has(p))return!1;if(!k)return!0;const U=i._meta?.["mcp.mesh"],Q=[i.title,i.description,i.name,i.server?.title,i.server?.description,i.server?.name,U?.friendly_name,U?.friendlyName].filter(Boolean).join(" ").toLowerCase();return j.some(B=>Q.includes(B.toLowerCase()))}):[],de=qe.filter(it),ue=qe.filter(at);let ge;n[10]!==h?(ge=i=>i.some(p=>h.has(p.id)),n[10]=h,n[11]=ge):ge=n[11];const Pe=ge;let je;n[12]!==h||n[13]!==g||n[14]!==l||n[15]!==Pe||n[16]!==I||n[17]!==S||n[18]!==o||n[19]!==D?(je=(i,p,U,Q,B)=>{const be=Pe(B),ce=B.find(W=>!h.has(W.id)),A=B[0];if(I==="browse"){const W=_n(A);return e.jsx(Le,{connection:{title:p,icon:U,description:B.length>1?`${B.length} instances`:Q??void 0},fallbackIcon:e.jsx(Ie,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs(we,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Connected"]}),onClick:()=>{C("connection_browse_clicked",{app_name:A.app_name??null,connection_id:A.id,instances_count:B.length}),o?.(W)}},i)}return e.jsx(Le,{connection:{title:p,icon:U,description:Q},fallbackIcon:e.jsx(Ie,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[be&&e.jsxs(we,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Added"]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:W=>{W.stopPropagation(),ce?(C("connection_add_clicked",{action:"use_existing",app_name:A.app_name??null,connection_id:ce.id}),g&&C("agent_connection_attached",{agent_id:g,connection_id:ce.id,app_name:A.app_name??null,mode:"existing"}),S(ce.id)):(C("connection_add_clicked",{action:"clone",app_name:A.app_name??null,base_connection_id:A.id}),D(A))},children:"Add"})]})},i)},n[12]=h,n[13]=g,n[14]=l,n[15]=Pe,n[16]=I,n[17]=S,n[18]=o,n[19]=D,n[20]=je):je=n[20];const ve=je;let ye;n[21]!==l||n[22]!==I||n[23]!==z?(ye=i=>{const p=i._meta?.["mcp.mesh"],U=p?.friendlyName||p?.friendly_name||i.server?.title||i.title||i.server?.name||i.name||i.id||"",Q=i.server?.description||i.description||null,B=i.server?.icons?.[0]?.src||kn(i.server?.repository)||null,be=p?.official===!0,ce=p?.verified===!0,A=p?.owner==="deco";return e.jsx(Le,{connection:{title:U,description:Q,icon:B},fallbackIcon:e.jsx(Ie,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[A&&e.jsxs(ze,{children:[e.jsx(Ke,{asChild:!0,children:e.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Made by Deco",className:"size-3"})})}),e.jsx(He,{children:"Built and maintained by Deco"})]}),!A&&be&&e.jsxs(ze,{children:[e.jsx(Ke,{asChild:!0,children:e.jsx(we,{variant:"outline",size:"icon",children:e.jsx(Re,{})})}),e.jsx(He,{children:"Built and maintained by the official vendor"})]}),!A&&!be&&ce&&e.jsxs(ze,{children:[e.jsx(Ke,{asChild:!0,children:e.jsx(we,{variant:"outline",size:"icon",children:e.jsx(Re,{})})}),e.jsx(He,{children:"Verified by the Deco team"})]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:W=>{W.stopPropagation(),C("connection_add_clicked",{action:"connect_new",registry_item_id:i.id,app_name:p?.friendlyName||i.server?.name||i.name||null}),z(i)},children:l===i.id?e.jsx(Se,{size:14,className:"animate-spin"}):I==="browse"?"Connect":"Add"})]})},`catalog-${i.id}`)},n[21]=l,n[22]=I,n[23]=z,n[24]=ye):ye=n[24];const Ge=ye;let Z;n[25]!==_||n[26]!==d||n[27]!==P||n[28]!==k?(Z=!k&&e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsx(Nn,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:_,onTabChange:i=>d(i)}),e.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{C("connections_dialog_custom_clicked"),P()},children:[e.jsx(et,{size:12}),"Custom Connection"]})]}),n[25]=_,n[26]=d,n[27]=P,n[28]=k,n[29]=Z):Z=n[29];const Te=K&&"opacity-50 pointer-events-none";let ee;n[30]!==Te?(ee=vn("flex-1 overflow-auto p-5 transition-opacity duration-150",Te),n[30]=Te,n[31]=ee):ee=n[31];const dn="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let _e;n[32]!==ve?(_e=i=>{if(i.type==="group")return ve(i.key,i.title,i.icon,null,i.connections);const p=i.connection;return ve(p.id,p.title,p.icon,p.description??null,[p])},n[32]=ve,n[33]=_e):_e=n[33];const Fe=fe.map(_e);let ne;n[34]!==De?(ne=e.jsx("div",{ref:De,className:"col-span-full h-1"}),n[34]=De,n[35]=ne):ne=n[35];let te;n[36]!==M?(te=M&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(Se,{size:24,className:"animate-spin text-muted-foreground"})}),n[36]=M,n[37]=te):te=n[37];const Ve=T&&de.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx(Re,{size:13,className:"text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),e.jsx("div",{className:"flex-1 h-px bg-border"})]}),Me=T&&de.map(Ge),Be=T&&ue.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),e.jsx("div",{className:"flex-1 h-px bg-border"})]}),Oe=T&&ue.map(Ge);let se;n[38]!==Ae||n[39]!==xe||n[40]!==T?(se=T&&xe.length>0&&e.jsx("div",{ref:Ae,className:"col-span-full h-1"}),n[38]=Ae,n[39]=xe,n[40]=T,n[41]=se):se=n[41];let oe;n[42]!==G.isLoadingMore||n[43]!==T?(oe=T&&G.isLoadingMore&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(Se,{size:24,className:"animate-spin text-muted-foreground"})}),n[42]=G.isLoadingMore,n[43]=T,n[44]=oe):oe=n[44];let ae;n[45]!==Fe||n[46]!==ne||n[47]!==te||n[48]!==Ve||n[49]!==Me||n[50]!==Be||n[51]!==Oe||n[52]!==se||n[53]!==oe?(ae=e.jsxs("div",{className:dn,children:[Fe,ne,te,Ve,Me,Be,Oe,se,oe]}),n[45]=Fe,n[46]=ne,n[47]=te,n[48]=Ve,n[49]=Me,n[50]=Be,n[51]=Oe,n[52]=se,n[53]=oe,n[54]=ae):ae=n[54];let ie;n[55]!==_||n[56]!==fe.length||n[57]!==ue||n[58]!==y||n[59]!==de?(ie=fe.length===0&&de.length===0&&ue.length===0&&e.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:y?`No connections match "${y}"`:_==="connected"?"No connections yet":"No connections available"}),n[55]=_,n[56]=fe.length,n[57]=ue,n[58]=y,n[59]=de,n[60]=ie):ie=n[60];let re;n[61]!==ee||n[62]!==ae||n[63]!==ie?(re=e.jsxs("div",{className:ee,children:[ae,ie]}),n[61]=ee,n[62]=ae,n[63]=ie,n[64]=re):re=n[64];let Ce;return n[65]!==Z||n[66]!==re?(Ce=e.jsxs(e.Fragment,{children:[Z,re]}),n[65]=Z,n[66]=re,n[67]=Ce):Ce=n[67],Ce}function at(s){return!s.verified&&!s._meta?.["mcp.mesh"]?.verified&&!s.meta?.verified}function it(s){return s.verified||s._meta?.["mcp.mesh"]?.verified||s.meta?.verified}function rt(s){return s.app_name}function ct(s){return s.app_name}function lt(s){return s?.items??[]}function dt(s,n){if(s?.hasMore)return n.reduce(ut,0)}function ut(s,n){return s+(n?.items?.length??0)}function mt(s){return[{field:["title"],operator:"contains",value:s},{field:["description"],operator:"contains",value:s}]}function Kt({open:s,onOpenChange:n,defaultTab:m,initialSearch:g="",...h}){const S=h.mode??"add",D="agentId"in h?h.agentId:void 0,z="addedConnectionIds"in h?h.addedConnectionIds??new Set:new Set,l="onAdd"in h&&h.onAdd?h.onAdd:a=>{},y=(a,c,j)=>{D&&C("agent_connection_attached",{agent_id:D,connection_id:a,app_name:c,mode:j})},[P,o]=le.useState(null),[f,I]=le.useState(g),[F,x]=le.useState(!1),{org:r}=ke(),{data:K}=en.useSession(),b=cn(),k=hn(),H=fn(),_=a=>{n(!1),H({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:a}})},V=()=>{k.invalidateQueries({predicate:a=>{const c=a.queryKey;return c[1]===r.id&&c[3]==="collection"&&c[4]==="CONNECTIONS"}})},t=async a=>{o(a.app_name??a.id);try{const j=`${a.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,v=(await b.create.mutateAsync({title:j,description:a.description??null,connection_type:a.connection_type,connection_url:a.connection_url??null,connection_token:null,icon:a.icon??null,app_name:a.app_name??null,app_id:a.app_id??null,connection_headers:a.connection_headers??null})).id,u=await Ee({connectionId:v,orgId:r.id,orgSlug:r.slug,persistFallback:w=>b.update.mutateAsync({id:v,data:{connection_token:w}}).then(()=>{})});if(u.ran&&!u.ok){C("connection_oauth_failed",{connection_id:v,flow:"clone",error:u.error??"no_token"}),X.error(`Authentication failed: ${u.error??"no token received"}`),await b.delete.mutateAsync(v);return}if(u.ran){C("connection_oauth_succeeded",{connection_id:v,flow:"clone"});const w=new URL(`/api/${r.slug}/mcp/${v}`,window.location.origin);await k.invalidateQueries({queryKey:pe.isMCPAuthenticated(w.href,null)}),V()}y(v,a.app_name??null,"clone"),l(v)}catch(c){console.error("Failed to add connection:",c),X.error("Failed to add connection")}finally{o(null)}},d=async a=>{if(!(!r||!K?.user?.id)){o(a.id);try{const c=In(a,r.id,K.user.id,{remoteIndex:0}),j=c.connection_type==="STDIO",N=!!c.connection_url,v=j&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!N&&!v){X.error("This MCP Server cannot be connected: no connection method available"),o(null);return}const{id:u}=await b.create.mutateAsync(c),w=await Ee({connectionId:u,orgId:r.id,orgSlug:r.slug,persistFallback:q=>b.update.mutateAsync({id:u,data:{connection_token:q}}).then(()=>{})});if(w.ran&&!w.ok){C("connection_oauth_failed",{connection_id:u,flow:"connect_new",error:w.error??"no_token"}),X.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${w.error??"no token received"})`}),y(u,c.app_name??null,"new"),l(u);return}if(w.ran){C("connection_oauth_succeeded",{connection_id:u,flow:"connect_new"});const q=new URL(`/api/${r.slug}/mcp/${u}`,window.location.origin);await k.invalidateQueries({queryKey:pe.isMCPAuthenticated(q.href,null)}),V(),X.success("Connected and authenticated")}else X.success("Connected");y(u,c.app_name??null,"new"),l(u)}catch(c){console.error("Failed to connect:",c),X.error("Failed to connect")}finally{o(null)}}};return e.jsxs(sn,{open:s,onOpenChange:n,children:[e.jsxs(on,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[e.jsx(an,{className:"px-6 pt-5 pb-0 shrink-0",children:e.jsx(rn,{className:"text-base font-semibold",children:S==="browse"?"Connections":"Add Connection"})}),e.jsx("div",{className:"pt-3 shrink-0",children:e.jsx(bn,{value:f,onChange:I,placeholder:"Search connections..."})}),e.jsx(le.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(Se,{size:24,className:"animate-spin text-muted-foreground"})}),children:e.jsx(ot,{mode:S,agentId:D,addedConnectionIds:z,onAdd:l,onCloneAndAdd:t,onConnectAndAdd:d,connectingItemId:P,search:f,onCreateConnection:()=>x(!0),onBrowseNavigate:_,defaultTab:m})})]}),e.jsx(st,{open:F,onOpenChange:x,onCreated:async a=>{x(!1);const c=await Ee({connectionId:a,orgId:r.id,orgSlug:r.slug,persistFallback:j=>b.update.mutateAsync({id:a,data:{connection_token:j}}).then(()=>{})});if(c.ran&&!c.ok){C("connection_oauth_failed",{connection_id:a,flow:"custom_create",error:c.error??"no_token"}),X.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${c.error??"no token received"})`}),y(a,null,"custom"),l(a),n(!1);return}if(c.ran){C("connection_oauth_succeeded",{connection_id:a,flow:"custom_create"});const j=new URL(`/api/${r.slug}/mcp/${a}`,window.location.origin);await k.invalidateQueries({queryKey:pe.isMCPAuthenticated(j.href,null)}),V()}y(a,null,"custom"),l(a),n(!1)}})]})}const Ze=new Map;function Ht(){const{org:s}=ke(),n=nt(),m=tt(),g=m.find(r=>r.providerId==="deco"),{data:h,isLoading:S,refetch:D,isFetching:z}=yn({queryKey:pe.aiProviderCredits(s.id,"deco"),enabled:!!g,staleTime:6e4,queryFn:async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=h?.balanceCents??null,y=l!=null?l/100:null,P=le.useRef(new Map);if(l!=null){const r=Ze.get(s.id);P.current.get(s.id)&&r!=null&&l>r&&C("credits_topped_up_detected",{organization_id:s.id,delta_cents:l-r,previous_balance_cents:r,new_balance_cents:l}),Ze.set(s.id,l),P.current.set(s.id,!0)}const o=!!g,f=l!=null&&l>0,I=l!=null&&l===0,F=l!=null&&l===200,x=m.length>0&&m.every(r=>r.providerId==="deco");return{hasDecoKey:o,decoKeyId:g?.id??null,balanceCents:l,balanceDollars:y,hasCredits:f,isZeroBalance:I,isInitialFreeCredit:F,hasOnlyDecoProvider:x,isLoading:S,isFetching:z,refetch:D}}function Ue(s){const n=s?.metadata?.githubRepo;if(!n?.url)return{status:"none"};const m=n.connectionId;return!!m&&!!s?.connections?.some(S=>S.connection_id===m)?{status:"attached",repo:n,connectionId:m}:!!m||n.installationId!=null?{status:"detached",repo:n}:{status:"public-clone",repo:n}}function Ut(s){const n=Ue(s);return n.status==="attached"||n.status==="public-clone"?n.repo:null}function Xt(s){if(typeof s!="object"||s===null)return!1;const m=s.githubRepo?.url;return typeof m=="string"&&m.length>0}function qt(s){return Ue(s).status==="attached"}function Gt(s){const n=Ue(s).status;return n==="attached"||n==="detached"}function Qt(s){const n=new Set;for(const m of s??[]){const g=m.metadata?.liveAgentId;typeof g=="string"&&g&&n.add(m.id)}return n}function Wt(s,n){if(!s)return null;const m=s.metadata?.liveAgentId;if(typeof m=="string"&&m)return{mode:"dev",targetId:m};const g=(n??[]).find(h=>h.metadata?.liveAgentId===s.id);return g?{mode:"live",targetId:g.id}:null}export{Kt as A,Qt as a,Xt as b,qt as c,Gt as d,Wt as f,Ut as g,Ue as r,Ht as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-CgBmlUGm.js";import{i as jt}from"./ChevronRight-D2gtrGMP.js";import{A as kt}from"./automation-runs-DTIdBSof.js";import{A as _t}from"./add-section-modal-DrC7rGwY.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index-iuSXEyY3.js";import"./select-YITUw-eM.js";import"./tooltip-CB_N8QyX.js";import"./Check-DYxjoBWV.js";import"./ChevronDown-BrD8qg2M.js";import"./ChevronUp-BKNlcHhX.js";import"./useInfiniteQuery-uL7J0_7H.js";import"./use-infinite-scroll-CI9or9uk.js";import"./use-connection-Don2WgMf.js";import"./use-collections-BhGPmLDM.js";import"./use-mcp-client-CdJHCm8Y.js";import"./constants-CaIX_f5U.js";import"./auth-Cr406d5k.js";import"./use-virtual-mcp-9wSLzLB_.js";import"./card-B_g-bY4h.js";import"./sidebar-jC_LjgnK.js";import"./LayoutLeft-EcdOJis4.js";import"./use-mobile-B9R6eaP0.js";import"./X-B7Sc0GS4.js";import"./table-BkZs-l64.js";import"./empty-state-BTc9UY0F.js";import"./use-members-D7p2Y_Sp.js";import"./use-org-auth-client-qPiJ9muQ.js";import"./use-clock-tick-CIfovY09.js";import"./AlertCircle-DmkKUOhm.js";import"./CheckCircle-B4NmlxYQ.js";import"./Circle-B_Fqw1K-.js";import"./agent-icon-DrSWK4T8.js";import"./Tool01-BHeREp7L.js";import"./ArrowUp-DMeNZgjG.js";import"./Settings02-C8WW6-r8.js";import"./Tool02-J_PfM8Nz.js";import"./XCircle-BUA08cO-.js";import"./ArrowUpRight-Gimwrhen.js";import"./TrendUp01-BlXicyb4.js";import"./ZapSquare-D534FsK3.js";import"./Users03-Bv07fLWj.js";import"./Loading02-BYwsqZEG.js";import"./Stars02-kVXYdBfS.js";import"./Copy01-Bc9QBhFd.js";import"./ZoomOut-Bb6xRcrC.js";import"./DotsVertical-WBMZIKtT.js";import"./Globe01-oF2ruraB.js";import"./Eye-BKTF2OaK.js";import"./FilterLines-Cxtbp1DY.js";import"./Star01-CoAmgzIu.js";import"./Globe04-Bt3_QuH9.js";import"./SwitchHorizontal01-D0WmE4M_.js";import"./HardDrive-B4iV_oDv.js";import"./Key01-z2KeAwWe.js";import"./LinkExternal01-m0U-Lm_o.js";import"./List-CfReT_EU.js";import"./Monitor01-BTk9yxuR.js";import"./Sun-gbZ0Crr7.js";import"./Package-BUQJFAeb.js";import"./Palette-DCYAwuZ_.js";import"./Play-BFoRJghB.js";import"./Plus-BC3OQAv6.js";import"./SearchLg-BSwwKRR3.js";import"./SearchMd-GQIk2JN7.js";import"./Shield01-Bsiz7jUT.js";import"./Stars01-DaCn5yDz.js";import"./Trash01-DTo19AbB.js";import"./Upload01-D2kJMwQq.js";import"./User01-DAvNYaFB.js";import"./Users01-BXcNizDT.js";import"./XClose-DUzYp9PV.js";import"./Zap-BchfKKws.js";import"./use-automations-DAxW4YOG.js";import"./studio-tools-DtERx3-w.js";import"./useSuspenseInfiniteQuery-1KPMSa71.js";import"./badge-CV-Q9eu5.js";import"./checkbox-G49vRqoM.js";import"./command-Sv_8xo4a.js";import"./index-DpZiwWtQ.js";import"./dialog-B_6-uR4V.js";import"./popover-B2JX6-0F.js";import"./avatar-pT8UjaWS.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D9V8a-BA.js";import"./file-type-icon-x196dC_k.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DbroNHLy.js";import"./index-BB2Lp-YP.js";import"./chat-context-B3fhdzY7.js";import"./autosend-B2JqcvZh.js";import"./hooks-MtX5yASy.js";import"./decopilot-sse-pool-DhNLRlpz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-B21DVkoY.js";import"./use-decopilot-events-CdQ11k4e.js";import"./use-organization-settings-BIgNW-JC.js";import"./index-D1cnvmIK.js";import"./shell-layout-D1XBVOK8.js";import"./alert-dialog-BjO-yqLW.js";import"./required-auth-layout-Dun_88x7.js";import"./use-org-sso-DVm_ZMu0.js";import"./integration-icon-DLw7Zft3.js";import"./use-navigate-to-agent-3qDPth_I.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-QWxGbKBu.js";import"./form-BpJgWXmx.js";import"./label-BdRgp1MD.js";import"./input-BnfEMIGT.js";import"./drawer-BE9ljxm4.js";import"./collection-search-DpJQEBO5.js";import"./tabs-BoJ2RRJH.js";import"./toggle-group-BESFh1Up.js";import"./agent-capabilities-D4qVYFGl.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Bgg_OkYA.js";import"./use-registry-connections-CkzW69jF.js";import"./extract-connection-data-CvHlHsvl.js";import"./collection-tabs-BbkNjy2P.js";import"./textarea-D1IgqmmJ.js";import"./connection-form-helpers-Bi6ZDNqH.js";import"./authenticate-and-persist-oauth-BP5LS1nd.js";import"./mcp-oauth-8tCiarSV.js";import"./connect-desktop-dialog-u9wYmVqy.js";import"./select-model-BiEGzTzi.js";import"./skeleton-RwzvQC_m.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D76W_ZOD.js";import"./dropdown-menu-CYQZB-4N.js";import"./index-DfceqVpf.js";import"./toolbar-DJusbmmf.js";import"./use-debounced-value-DDhg7maH.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DNCLrwgH.js";import"./use-mcp-tools-BaIf7aPi.js";import"./use-capability-DXWPCR7E.js";import"./tools-list-C_inZD2F.js";import"./switch-D80K3uBB.js";import"./use-debounced-autosave-CwePX8_C.js";import"./index-CpmRkbKB.js";import"./search-input--1w25EJQ.js";import"./github-repo-picker-DPCWySa3.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-R9ijaYXA.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-vUa7jft6.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DKmCedkw.js";import"./toolbar-icon-button-BHN8jOXq.js";import"./use-file-configs-DjGQF94E.js";import"./automation-list-row-CrJ2rvgh.js";function $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Nr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Nr as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as R,j as o,a5 as L,b as T,r as $,B as M,R as N}from"./index-CgBmlUGm.js";import{s as q}from"./Plus-BC3OQAv6.js";import{i as S}from"./Zap-BchfKKws.js";import{S as D}from"./search-input--1w25EJQ.js";import{P as l}from"./index-CpmRkbKB.js";import{E as b}from"./empty-state-BTc9UY0F.js";import{c as O}from"./use-automations-DAxW4YOG.js";import{c as V}from"./use-navigate-to-agent-3qDPth_I.js";import{A as F}from"./automation-list-row-CrJ2rvgh.js";import{e as G}from"./constants-CaIX_f5U.js";import{a as H}from"./use-virtual-mcp-9wSLzLB_.js";import{R as J}from"./require-capability-CRc0PI1K.js";import"./SearchMd-GQIk2JN7.js";import"./sidebar-jC_LjgnK.js";import"./LayoutLeft-EcdOJis4.js";import"./use-mobile-B9R6eaP0.js";import"./X-B7Sc0GS4.js";import"./tooltip-CB_N8QyX.js";import"./use-mcp-client-CdJHCm8Y.js";import"./auth-Cr406d5k.js";import"./studio-tools-DtERx3-w.js";import"./hooks-MtX5yASy.js";import"./decopilot-sse-pool-DhNLRlpz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-BjO-yqLW.js";import"./dropdown-menu-CYQZB-4N.js";import"./Check-DYxjoBWV.js";import"./ChevronRight-D2gtrGMP.js";import"./Circle-B_Fqw1K-.js";import"./Stars02-kVXYdBfS.js";import"./DotsVertical-WBMZIKtT.js";import"./Trash01-DTo19AbB.js";import"./agent-icon-DrSWK4T8.js";import"./AlertCircle-DmkKUOhm.js";import"./Tool01-BHeREp7L.js";import"./ArrowUp-DMeNZgjG.js";import"./Settings02-C8WW6-r8.js";import"./Tool02-J_PfM8Nz.js";import"./XCircle-BUA08cO-.js";import"./ArrowUpRight-Gimwrhen.js";import"./TrendUp01-BlXicyb4.js";import"./ZapSquare-D534FsK3.js";import"./Users03-Bv07fLWj.js";import"./Loading02-BYwsqZEG.js";import"./CheckCircle-B4NmlxYQ.js";import"./ChevronDown-BrD8qg2M.js";import"./ChevronUp-BKNlcHhX.js";import"./Copy01-Bc9QBhFd.js";import"./ZoomOut-Bb6xRcrC.js";import"./Globe01-oF2ruraB.js";import"./Eye-BKTF2OaK.js";import"./FilterLines-Cxtbp1DY.js";import"./Star01-CoAmgzIu.js";import"./Globe04-Bt3_QuH9.js";import"./SwitchHorizontal01-D0WmE4M_.js";import"./HardDrive-B4iV_oDv.js";import"./Key01-z2KeAwWe.js";import"./LinkExternal01-m0U-Lm_o.js";import"./List-CfReT_EU.js";import"./Monitor01-BTk9yxuR.js";import"./Sun-gbZ0Crr7.js";import"./Package-BUQJFAeb.js";import"./Palette-DCYAwuZ_.js";import"./Play-BFoRJghB.js";import"./SearchLg-BSwwKRR3.js";import"./Shield01-Bsiz7jUT.js";import"./Stars01-DaCn5yDz.js";import"./Upload01-D2kJMwQq.js";import"./User01-DAvNYaFB.js";import"./Users01-BXcNizDT.js";import"./XClose-DUzYp9PV.js";import"./use-collections-BhGPmLDM.js";import"./use-capability-DXWPCR7E.js";import"./access-gate-DvLkIQEB.js";import"./capability-load-error-DEzva6Xd.js";function K(){const t=R.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,B=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(B.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function jo(){const t=R.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{jo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as o,l as m,j as n,bc as u}from"./index-CgBmlUGm.js";import{i as d}from"./ChevronRight-D2gtrGMP.js";function b(r){const e=o.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("min-w-0 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=n.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function x(r){const e=o.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=n.jsx("ol",{"data-slot":"breadcrumb-list",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function N(r){const e=o.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("inline-flex items-center gap-1.5 min-w-0",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=n.jsx("li",{"data-slot":"breadcrumb-item",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function g(r){const e=o.c(10);let a,t,s;e[0]!==r?({asChild:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);const l=a?u:"a";let i;e[4]!==t?(i=m("hover:text-foreground transition-colors truncate",t),e[4]=t,e[5]=i):i=e[5];let c;return e[6]!==l||e[7]!==s||e[8]!==i?(c=n.jsx(l,{"data-slot":"breadcrumb-link",className:i,...s}),e[6]=l,e[7]=s,e[8]=i,e[9]=c):c=e[9],c}function j(r){const e=o.c(8);let a,t;e[0]!==r?({className:a,...t}=r,e[0]=r,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let s;e[3]!==a?(s=m("text-foreground font-medium truncate",a),e[3]=a,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l=n.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s,...t}),e[5]=t,e[6]=s,e[7]=l):l=e[7],l}function h(r){const e=o.c(12);let a,t,s;e[0]!==r?({children:a,className:t,...s}=r,e[0]=r,e[1]=a,e[2]=t,e[3]=s):(a=e[1],t=e[2],s=e[3]);let l;e[4]!==t?(l=m("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",t),e[4]=t,e[5]=l):l=e[5];let i;e[6]!==a?(i=a??n.jsx(d,{}),e[6]=a,e[7]=i):i=e[7];let c;return e[8]!==s||e[9]!==l||e[10]!==i?(c=n.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...s,children:i}),e[8]=s,e[9]=l,e[10]=i,e[11]=c):c=e[11],c}export{N as B,b as a,x as b,g as c,h as d,j as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as G,r as S,l as Q,j as t,B as U,i as V,t as I}from"./index-CgBmlUGm.js";import{i as X}from"./XCircle-BUA08cO-.js";import{aH as Y,ab as T}from"./agent-icon-DrSWK4T8.js";import{n as Z}from"./LinkExternal01-m0U-Lm_o.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-BjO-yqLW.js";import{I as H}from"./input-BnfEMIGT.js";import{L}from"./label-BdRgp1MD.js";import{v as at,w as mt,T as nt,o as lt,x as R,y as pt,U as ct}from"./index-iuSXEyY3.js";import{c as dt,B as ut,a as gt}from"./block-document-DtE_kuZ8.js";import{u as xt,s as v,E as ft}from"./primitives-DOEQanbU.js";import{t as ht}from"./ChevronDown-BrD8qg2M.js";import{J as yt,K as jt,I as vt}from"./automation-runs-DTIdBSof.js";import"./AlertCircle-DmkKUOhm.js";import"./Tool01-BHeREp7L.js";import"./ArrowUp-DMeNZgjG.js";import"./Settings02-C8WW6-r8.js";import"./Tool02-J_PfM8Nz.js";import"./ArrowUpRight-Gimwrhen.js";import"./TrendUp01-BlXicyb4.js";import"./ZapSquare-D534FsK3.js";import"./Users03-Bv07fLWj.js";import"./Loading02-BYwsqZEG.js";import"./CheckCircle-B4NmlxYQ.js";import"./Check-DYxjoBWV.js";import"./ChevronRight-D2gtrGMP.js";import"./ChevronUp-BKNlcHhX.js";import"./Circle-B_Fqw1K-.js";import"./Stars02-kVXYdBfS.js";import"./Copy01-Bc9QBhFd.js";import"./ZoomOut-Bb6xRcrC.js";import"./DotsVertical-WBMZIKtT.js";import"./Globe01-oF2ruraB.js";import"./Eye-BKTF2OaK.js";import"./FilterLines-Cxtbp1DY.js";import"./Star01-CoAmgzIu.js";import"./Globe04-Bt3_QuH9.js";import"./SwitchHorizontal01-D0WmE4M_.js";import"./HardDrive-B4iV_oDv.js";import"./Key01-z2KeAwWe.js";import"./LayoutLeft-EcdOJis4.js";import"./List-CfReT_EU.js";import"./Monitor01-BTk9yxuR.js";import"./Sun-gbZ0Crr7.js";import"./Package-BUQJFAeb.js";import"./Palette-DCYAwuZ_.js";import"./Play-BFoRJghB.js";import"./Plus-BC3OQAv6.js";import"./SearchLg-BSwwKRR3.js";import"./SearchMd-GQIk2JN7.js";import"./Shield01-Bsiz7jUT.js";import"./Stars01-DaCn5yDz.js";import"./Trash01-DTo19AbB.js";import"./Upload01-D2kJMwQq.js";import"./User01-DAvNYaFB.js";import"./Users01-BXcNizDT.js";import"./XClose-DUzYp9PV.js";import"./X-B7Sc0GS4.js";import"./Zap-BchfKKws.js";import"./chat-context-B3fhdzY7.js";import"./autosend-B2JqcvZh.js";import"./hooks-MtX5yASy.js";import"./use-mcp-client-CdJHCm8Y.js";import"./constants-CaIX_f5U.js";import"./auth-Cr406d5k.js";import"./decopilot-sse-pool-DhNLRlpz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-DtERx3-w.js";import"./use-virtual-mcp-9wSLzLB_.js";import"./use-collections-BhGPmLDM.js";import"./use-ai-providers-B21DVkoY.js";import"./use-decopilot-events-CdQ11k4e.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-BIgNW-JC.js";import"./tooltip-CB_N8QyX.js";import"./dialog-B_6-uR4V.js";import"./drawer-BE9ljxm4.js";import"./collection-search-DpJQEBO5.js";import"./use-mobile-B9R6eaP0.js";import"./AreaChart-QWxGbKBu.js";import"./index-D1cnvmIK.js";import"./shell-layout-D1XBVOK8.js";import"./avatar-pT8UjaWS.js";import"./required-auth-layout-Dun_88x7.js";import"./use-org-sso-DVm_ZMu0.js";import"./form-BpJgWXmx.js";import"./select-YITUw-eM.js";import"./tabs-BoJ2RRJH.js";import"./toggle-group-BESFh1Up.js";import"./agent-capabilities-D4qVYFGl.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Bgg_OkYA.js";import"./use-registry-connections-CkzW69jF.js";import"./use-connection-Don2WgMf.js";import"./useInfiniteQuery-uL7J0_7H.js";import"./use-infinite-scroll-CI9or9uk.js";import"./extract-connection-data-CvHlHsvl.js";import"./card-B_g-bY4h.js";import"./integration-icon-DLw7Zft3.js";import"./collection-tabs-BbkNjy2P.js";import"./badge-CV-Q9eu5.js";import"./textarea-D1IgqmmJ.js";import"./connection-form-helpers-Bi6ZDNqH.js";import"./authenticate-and-persist-oauth-BP5LS1nd.js";import"./mcp-oauth-8tCiarSV.js";import"./useSuspenseInfiniteQuery-1KPMSa71.js";import"./connect-desktop-dialog-u9wYmVqy.js";import"./select-model-BiEGzTzi.js";import"./checkbox-G49vRqoM.js";import"./skeleton-RwzvQC_m.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D76W_ZOD.js";import"./command-Sv_8xo4a.js";import"./index-DpZiwWtQ.js";import"./popover-B2JX6-0F.js";import"./dropdown-menu-CYQZB-4N.js";import"./index-DfceqVpf.js";import"./file-type-icon-x196dC_k.js";import"./toolbar-DJusbmmf.js";import"./use-debounced-value-DDhg7maH.js";import"./index-BB2Lp-YP.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DNCLrwgH.js";import"./empty-state-BTc9UY0F.js";import"./use-mcp-tools-BaIf7aPi.js";import"./use-capability-DXWPCR7E.js";import"./tools-list-C_inZD2F.js";import"./switch-D80K3uBB.js";import"./use-debounced-autosave-CwePX8_C.js";import"./index-CpmRkbKB.js";import"./sidebar-jC_LjgnK.js";import"./search-input--1w25EJQ.js";import"./github-repo-picker-DPCWySa3.js";import"./use-navigate-to-agent-3qDPth_I.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-R9ijaYXA.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./format-time-BnbuEtat.js";import"./use-members-D7p2Y_Sp.js";import"./use-org-auth-client-qPiJ9muQ.js";import"./index-vUa7jft6.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DKmCedkw.js";import"./toolbar-icon-button-BHN8jOXq.js";import"./use-file-configs-DjGQF94E.js";import"./monaco-editor-DbroNHLy.js";import"./use-automations-DAxW4YOG.js";import"./automation-list-row-CrJ2rvgh.js";import"./table-BkZs-l64.js";import"./use-clock-tick-CIfovY09.js";import"./use-copy-D9V8a-BA.js";function bt(k){const e=G.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function gr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=z.length,M=o=>s("slug",o),J=async(o,w)=>{const q=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:q,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",E)}),c(E),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},W=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){M(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(H,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:W,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(H,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&J(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{gr as CategoryEditor};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import{c as ie,a5 as J,K as fe,m as Ye,l as Ze,bB as Je,j as Q,cs as et,a6 as qe,n as Fe,t as re,a2 as ue,Y as pe,b as je,u as Ue,e as tt,r as S,R as nt,a as st,a7 as at,ak as ot}from"./index-CgBmlUGm.js";import{A as Qe,c as rt,a as it,w as ct}from"./autosend-B2JqcvZh.js";import{S as lt,u as dt,d as ut,b as pt}from"./hooks-MtX5yASy.js";import{u as ft}from"./studio-tools-DtERx3-w.js";import{u as ht}from"./use-mcp-client-CdJHCm8Y.js";import{a as mt,S as gt}from"./constants-CaIX_f5U.js";import{u as yt}from"./use-virtual-mcp-9wSLzLB_.js";import{u as xt,a as ge}from"./use-ai-providers-B21DVkoY.js";import{u as St}from"./use-decopilot-events-CdQ11k4e.js";import{q as vt,n as It}from"./tab-id-bb-jjgGv.js";import{h as bt,u as kt}from"./use-organization-settings-BIgNW-JC.js";const Ct={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},Mt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},Tt={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},wt={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},Et={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},At={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Ke(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function _t(t){return Ke(t).includes("deepresearch")}const Rt=["sonar","searchpreview","online"];function We(t){const e=Ke(t);return e.includes("deepresearch")?!1:Rt.some(n=>e.includes(n))}function Ve(t){return t.asyncResearch!==!0&&We(t.modelId)}function Be(t){return t.asyncResearch===!0||_t(t.modelId)||We(t.modelId)}function le(t,e,n,s){for(const a of n){const o=t.find(r=>r.modelId===a);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}for(const a of n){const o=t.find(r=>r.modelId.includes(a));if(o)return{keyId:e,modelId:o.modelId,title:o.title}}if(s){const a=t.find(s);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}return null}function Pt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const a=e[s.id]??[],o=s.providerId;n.chat.fast||(n.chat.fast=le(a,s.id,Ct[o]??[])),n.chat.smart||(n.chat.smart=le(a,s.id,Mt[o]??[])),n.chat.thinking||(n.chat.thinking=le(a,s.id,Tt[o]??[])),n.image||(n.image=le(a,s.id,wt[o]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=le(a,s.id,Et[o]??[],Ve)),n.deepResearch||(n.deepResearch=le(a,s.id,At[o]??[],Be))}return n}const $e={online:!1,capabilities:[],ready:!1};function $t(t){const e=ie.c(9),{org:n}=J(),s=ft(),a=t?.fast??!1;let o;e[0]!==n.id?(o=fe.currentLink(n.id),e[0]=n.id,e[1]=o):o=e[1];let r;e[2]!==s?(r=async()=>{const M=await s.call("LINK_CURRENT_GET",{});return M?{...M,ready:!0}:{...$e,ready:!0}},e[2]=s,e[3]=r):r=e[3];const c=a?1e3:1e4,m=a?2e3:15e3;let y;e[4]!==o||e[5]!==r||e[6]!==c||e[7]!==m?(y={queryKey:o,queryFn:r,staleTime:c,refetchInterval:m,refetchOnWindowFocus:!0},e[4]=o,e[5]=r,e[6]=c,e[7]=m,e[8]=y):y=e[8];const{data:I}=Ye(y);return I??$e}const Dt=Je("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function kn(t){const e=ie.c(10),{variant:n,size:s}=t;let a;e[0]!==s||e[1]!==n?(a=Ze(Dt({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=a):a=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=Q.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=Q.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let c;e[5]!==a?(c=Q.jsxs("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=a,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=Q.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=m):m=e[7];let y;return e[8]!==c?(y=Q.jsxs("div",{role:"status",children:[c,m]}),e[8]=c,e[9]=y):y=e[9],y}function Ot(t,e=[]){return t==="stop"?e.filter(a=>a.type==="text"&&a.text).map(a=>a.text).join(`
|
|
2
|
-
`).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const ve={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function Lt(t,e){if(!t)return null;const n=e?et(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[s,a]of Object.entries(ve))if(a.harness===t&&a.sandbox===n)return s;return null}function Cn(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function Nt(t,e){return e&&t&&ve[t].sandbox==="user-desktop"?"decopilot":t}function qt(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function Ft(t){const e=ie.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=qe(n);let a;if(e[1]!==s?.params.appSlug||e[2]!==s?.params.collectionName||e[3]!==s?.params.itemId||e[4]!==t){a=[],t&&a.push(`### Selected Agent
|
|
3
|
-
- ID: ${t}`);let o;e[6]!==s?.params.appSlug||e[7]!==s?.params.collectionName||e[8]!==s?.params.itemId?(o=[],s?.params.appSlug&&o.push(`- Connection ID: ${s?.params.appSlug}`),s?.params.collectionName&&o.push(`- Collection: ${s?.params.collectionName}`),s?.params.itemId&&o.push(`- Item ID: ${s?.params.itemId}`),e[6]=s?.params.appSlug,e[7]=s?.params.collectionName,e[8]=s?.params.itemId,e[9]=o):o=e[9],o.length>0&&a.push(`### Current Resource
|
|
4
|
-
The user is viewing the following resource:
|
|
5
|
-
${o.join(`
|
|
6
|
-
`)}
|
|
7
|
-
|
|
8
|
-
Help the user understand and work with this resource.`),e[1]=s?.params.appSlug,e[2]=s?.params.collectionName,e[3]=s?.params.itemId,e[4]=t,e[5]=a}else a=e[5];return a.join(`
|
|
9
|
-
|
|
10
|
-
`)}function jt(){const t=ie.c(5),e=Fe(),{org:n}=J();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const a=qe(s);let o;return t[1]!==a?.params||t[2]!==n||t[3]!==e?(o=r=>{const m=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!m||!m[1])return;const y=m[1],I=a?.params.appSlug;if(!I)return;e.invalidateQueries({queryKey:fe.collection(n.slug,I,y)});const M=y.toLowerCase().replace(/_/g," ");re.success(`${M} updated`)},t[1]=a?.params,t[2]=n,t[3]=e,t[4]=o):o=t[4],o}function Ut(){const t=ie.c(4),{org:e,project:n}=J(),s=`${e.id}/${n.id}`;let a;t[0]!==s?(a=pe.taskLastViewed(s),t[0]=s,t[1]=a):a=t[1];const[,o]=ue(a,Qt);let r;return t[2]!==o?(r={markTaskRead:m=>{o(y=>({...y,[m]:new Date().toISOString()}))}},t[2]=o,t[3]=r):r=t[3],r}function Qt(t){return t??{}}function He(){const t=je(),{org:e}=J(),n=Ue({strict:!1}),s=tt({strict:!1}),a=n.virtualmcpid??mt(e.id).id,o=(m,y)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:m},search:I=>{const M={},q=y?.virtualMcpId??I.virtualmcpid;q&&(M.virtualmcpid=q);const h=I.main;return h&&typeof h=="string"&&!vt(h)&&(M.main=h),(I.sidepanel==="chat"||I.sidepanel===0)&&(M.sidepanel=I.sidepanel),y?.autosend&&(M.autosend=Qe),M}})},r=S.useRef(crypto.randomUUID()),c=s.taskId??r.current;return{virtualMcpId:a,taskId:c,navigateToTask:o}}function Kt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(s),o=>o.charCodeAt(0)));return[{type:"text",text:`${e}
|
|
11
|
-
${a}`}]}catch(a){console.error("Failed to decode text file:",a)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function De(t,e){const n=[];for(const s of t)"text"in s&&s.text?n.push({type:"text",text:`[${e}]
|
|
12
|
-
${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function Wt(t,e){const n=(t.files??[]).filter(r=>r.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const a=n.map(r=>`<skill-file path="${r.relPath}">
|
|
13
|
-
${r.content.trim()}
|
|
14
|
-
</skill-file>`).join(`
|
|
15
|
-
|
|
16
|
-
`),o=s.length>0?`
|
|
17
|
-
|
|
18
|
-
Other files in \`${t.sandboxPath}/\`: ${s.join(", ")}`:"";return[{type:"text",text:`[${e}]
|
|
19
|
-
${a}${o}`}]}function Vt(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const a=Array.isArray(s.content)?s.content:[s.content];for(const o of a)switch(o.type){case"text":{const r=o.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
|
|
20
|
-
${r}`});break}case"image":case"audio":{if(!o.data||!o.mimeType)continue;n.push({type:"file",url:`data:${o.mimeType};base64,${o.data}`,mediaType:o.mimeType});break}case"resource":{const r=o.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?n.push({type:"text",text:`[${e}]
|
|
21
|
-
${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&n.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return n}function Ge(t){if(!t)return[];const e=[];let n="";const s=a=>{if(a){if(a.type==="text"&&"text"in a&&typeof a.text=="string")n+=a.text;else if(a.type==="mention"&&a.attrs){const o=a.attrs.char??"/",r=`${o}${a.attrs.name}`;if(n+=r,o==="@"){const c=a.attrs.metadata;c&&!Array.isArray(c)&&"agentId"in c?e.push({type:"text",text:`[DELEGATE TO AGENT: ${c.title??a.attrs.name} (agent_id: ${c.agentId})]
|
|
22
|
-
Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(c)&&e.push(...De(c,r))}else if(a.attrs.kind==="skill"){const c=a.attrs.metadata;c&&!Array.isArray(c)&&Array.isArray(c.files)&&e.push(...Wt(c,r))}else{const c=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(c)&&c.length>0&&"role"in c[0]?e.push(...Vt(c,r)):Array.isArray(c)&&e.push(...De(c,r))}}else if(a.type==="file"&&a.attrs){const o=a.attrs,r=`[file:://${encodeURIComponent(o.name)}]`;n+=r,e.push(...Kt(o,r))}if("content"in a&&Array.isArray(a.content))for(const o of a.content)s(o)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function Mn(t){const e=Ge(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function Tn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Bt(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function wn(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function Ht(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function Gt(t,e){return t.filter(n=>n.messageId!==e)}const Oe=new Map,Ee=new Set;function zt(t){Ee.add(t)}function Xt(t){return Ee.has(t)}function Yt(t){Ee.delete(t)}function ye(t){let e=Oe.get(t);return e||(e=new lt([]),Oe.set(t,e)),e}function ze(t,e){ye(t).update(n=>Ht(n,e))}function we(t,e){ye(t).update(n=>Gt(n,e))}function Zt(t,e){ye(t).set(e)}const Ie=new Map;function Jt(t,e){Ie.set(`${t}:${e.id}`,e)}function en(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function Le(t,e){Ie.delete(`${t}:${e}`)}async function Z(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Zt(e,s.items??[])}catch{}}function En(t){const e=ie.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return S.useSyncExternalStore(s.subscribe,s.get,s.get)}function tn(){const{org:t}=J();return{enqueue:ze,refresh:e=>Z(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;we(e,n);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return re.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await Z(t.slug,e)}}}}const Ne=new Set,ae=new Set;function de(t){return S.useSyncExternalStore(t.subscribe,t.get,t.get)}function nn(t){return t.kind==="loading"?"ready":t.kind}function oe(t,e,n,s){if(!t)return null;const a=e.find(r=>r.id===t.keyId);if(!a)return null;const o=n.find(r=>r.modelId===t.modelId);return o?{...o,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function sn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function an(t,e,n,s){if(!n||s.length===0)return null;const a=e.find(m=>m.id===n);if(!a)return null;const o=Pt([a],{[n]:s}),r=t==="fast"?o.chat.fast:t==="thinking"?o.chat.thinking:o.chat.smart;if(!r)return null;const c=s.find(m=>m.modelId===r.modelId);return c?{...c,keyId:n}:null}const on=1e4,rn=10,Ae=S.createContext(null),_e=S.createContext(null),Re=S.createContext(null),Xe=S.createContext(null);function cn({children:t}){const{locator:e}=J(),{virtualMcpId:n}=He(),[s,a]=ue(pe.chatSelectedImageModel(e),null),[o,r]=ue(pe.chatSelectedWebSearchModel(e),null),[c,m]=ue(pe.chatSelectedDeepResearchModel(e),null),[y,I]=S.useState(null),[M,q]=S.useState("default"),h=bt(),[R,K]=ue(pe.chatSimpleModeTier(e),null),F=kt()?"fast":sn(R),x=xt(),E=h.tiers[F],C=y&&x.some(l=>l.id===y)?y:E?.keyId??x[0]?.id??null,{models:D,isLoading:B}=ge(C??void 0),{models:ee}=ge(E?.keyId),{models:T}=ge(h.tiers.image?.keyId),{models:V}=ge(h.tiers.web_search?.keyId),{models:H}=ge(h.tiers.deep_research?.keyId),j=oe(E,x,ee,E?.title)??an(F,x,C,D),G=B,N=D.filter(l=>l.capabilities?.includes("image")),u=oe(s,x,N),O=oe(h.tiers.image,x,T,h.tiers.image?.title)??u??N[0]??null,P=D.filter(Ve),te=oe(o,x,P),U=P.find(l=>l.modelId==="perplexity/sonar")??P[0]??null,z=oe(h.tiers.web_search,x,V,h.tiers.web_search?.title)??te??U,b=D.filter(Be),k=oe(c,x,b),X=b.find(l=>l.modelId==="perplexity/deep-research")??b.find(l=>l.asyncResearch===!0)??b[0]??null,ce=oe(h.tiers.deep_research,x,H,h.tiers.deep_research?.title)??k??X,ke=yt(n)??{id:n,title:"",description:null,icon:null},[xe,he]=S.useState({}),Se=(l,_)=>{const w=[];for(const Y of _.content??[])Y.type==="text"&&Y.text?.trim()&&w.push(Y.text.trim());const L=w.join(`
|
|
23
|
-
`);if(!L){ne(l);return}new TextEncoder().encode(L).length>on||he(Y=>Object.keys(Y).length>=rn&&!(l in Y)?Y:{...Y,[l]:L})},ne=l=>{he(_=>{const{[l]:w,...L}=_;return L})},[Ce,Me]=ue(pe.chatLastAgentOption(e),l=>l&&l in ve?l:null),se=un(),Pe=se?.isThreadLocked&&se.lockedHarness!=null?Lt(se.lockedHarness,se.lockedSandbox):null,me=$t(),Te=Nt(Ce,me.ready&&!me.online),i=se?.isThreadLocked?Pe:Te,d=i?ve[i]:null,$=d?.harness??null,A=d?.sandbox??null,[p,v]=S.useState(void 0),g=S.useRef(p);g.current=p;const f={selectedModel:j,setModel:()=>{},credentialId:C,setCredentialId:I,allModelsConnections:x,isModelsLoading:G,selectedVirtualMcp:ke,imageModel:O,setImageModel:l=>{a(l?.keyId?{keyId:l.keyId,modelId:l.modelId}:null)},webSearchModel:z,setWebSearchModel:l=>{r(l?.keyId?{keyId:l.keyId,modelId:l.modelId}:null)},deepResearchModel:ce,setDeepResearchModel:l=>{m(l?.keyId?{keyId:l.keyId,modelId:l.modelId}:null)},chatMode:M,setChatMode:q,appContexts:xe,setAppContext:Se,clearAppContext:ne,tiptapDoc:p,setTiptapDoc:v,tiptapDocRef:g,resetInteraction:()=>{},simpleModeTier:F,setSimpleModeTier:l=>K(l),pendingAgentOption:i,setPendingAgentOption:Me,pendingHarnessId:$,pendingSandboxProviderKind:A};return Q.jsx(Re.Provider,{value:f,children:t})}function An(t){const e=ie.c(41),{virtualMcpId:n,task:s,children:a}=t,{locator:o}=J(),{data:r}=st.useSession(),c=r?.user??null,{taskId:m,virtualMcpId:y,navigateToTask:I}=He(),[M]=at(),{markTaskRead:q}=Ut(),h=pt(),R=m,K=y,W=Ft(K);let F;e[0]!==q||e[1]!==I?(F=(b,k)=>{q(b),I(b,{virtualMcpId:k?.virtualMcpId,autosend:k?.autosend})},e[0]=q,e[1]=I,e[2]=F):F=e[2];const x=F,E=R&&s?.id===R?s:null,C=E?.harness_id??null,D=E?.sandbox_provider_kind??null,B=E?.branch??null,ee=C!=null,T=B;let V;e[3]!==T||e[4]!==x||e[5]!==h||e[6]!==n?(V=()=>{const b=crypto.randomUUID();return h.create({id:b,virtual_mcp_id:n,...T?{branch:T}:{}}).then(()=>x(b)).catch(()=>{x(b)}),b},e[3]=T,e[4]=x,e[5]=h,e[6]=n,e[7]=V):V=e[7];const H=V;let j;e[8]!==T||e[9]!==o||e[10]!==x||e[11]!==h||e[12]!==n?(j=b=>{const k=crypto.randomUUID(),X=b.virtualMcpId??n,ce=X===n?T:null;ct(sessionStorage,o,k,b.message),h.create({id:k,virtual_mcp_id:X,...ce?{branch:ce}:{}}).then(()=>x(k,{virtualMcpId:b.virtualMcpId,autosend:!0})).catch(()=>{x(k,{virtualMcpId:b.virtualMcpId,autosend:!0})})},e[8]=T,e[9]=o,e[10]=x,e[11]=h,e[12]=n,e[13]=j):j=e[13];const G=j;let N;e[14]!==R||e[15]!==h?(N=b=>{R&&h.setBranch(R,b)},e[14]=R,e[15]=h,e[16]=N):N=e[16];let u;e[17]!==E||e[18]!==H||e[19]!==G||e[20]!==T||e[21]!==R||e[22]!==K||e[23]!==ee||e[24]!==B||e[25]!==C||e[26]!==D||e[27]!==x||e[28]!==N?(u={virtualMcpId:K,taskId:R,openTask:x,createTask:H,createTaskWithMessage:G,activeTask:E,isThreadLocked:ee,lockedHarness:C,lockedSandbox:D,lockedBranch:B,currentBranch:T,setCurrentTaskBranch:N},e[17]=E,e[18]=H,e[19]=G,e[20]=T,e[21]=R,e[22]=K,e[23]=ee,e[24]=B,e[25]=C,e[26]=D,e[27]=x,e[28]=N,e[29]=u):u=e[29];const O=u;let P;e[30]!==W||e[31]!==M||e[32]!==I||e[33]!==c?(P={user:c,contextPrompt:W,preferences:M,rawNavigateToTask:I},e[30]=W,e[31]=M,e[32]=I,e[33]=c,e[34]=P):P=e[34];const te=P;let U;e[35]!==a||e[36]!==te?(U=Q.jsx(cn,{children:Q.jsx(Xe.Provider,{value:te,children:a})}),e[35]=a,e[36]=te,e[37]=U):U=e[37];let z;return e[38]!==U||e[39]!==O?(z=Q.jsx(_e.Provider,{value:O,children:U}),e[38]=U,e[39]=O,e[40]=z):z=e[40],z}function _n({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:a}=ln();t&&!Ne.has(t)&&(Ne.add(t),nt("chat_opened",{thread_id:t}));const{imageModel:o,webSearchModel:r,deepResearchModel:c,chatMode:m,setChatMode:y,appContexts:I,setTiptapDoc:M,simpleModeTier:q,pendingSandboxProviderKind:h,pendingHarnessId:R}=dn(),K=S.useContext(Xe);if(!K)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:W,contextPrompt:F,preferences:x,rawNavigateToTask:E}=K,{org:C,locator:D}=J(),B=tn(),[ee,T]=S.useState(null),V=jt(),H=Fe(),j=dt(),G=je(),N=ht({connectionId:gt,orgId:C.id,orgSlug:C.slug}),u=ut(C.slug,t,{client:N});S.use(u.ready);const O=de(u.messages),P=de(u.status),te=de(u.finishReason),U=de(u.runStatusStage),z=de(u.hasMoreOlder),b=de(u.isFetchingOlder),k=S.useRef({onToolCall:V,queryClient:H,rawNavigateToTask:E,taskId:t,manager:j,navigate:G,orgId:C.id,orgSlug:C.slug});k.current={onToolCall:V,queryClient:H,rawNavigateToTask:E,taskId:t,manager:j,navigate:G,orgId:C.id,orgSlug:C.slug},St({orgSlug:C.slug,taskId:t,onTaskStatus:i=>{const d=k.current,$=i.data.message_id;if(i.data.status==="in_progress"&&$){we(d.taskId,$);const A=en(d.taskId,$);A&&u.applyLocalMessage(A),Z(d.orgSlug,d.taskId)}Xt(d.taskId)&&(async()=>(await Z(d.orgSlug,d.taskId),await u.reconcileFromServer()&&ye(d.taskId).get().length===0&&Yt(d.taskId)))()}}),S.useEffect(()=>{const i={onData:p=>{if(p.type==="data-thread-title"){const v=p.data;if(!v?.title)return;const g=k.current;if(!g.taskId)return;g.manager.patchThread({id:g.taskId,title:v.title,updated_at:new Date().toISOString()});return}if(p.type==="data-deck-updated"){const v=p.data;if(!v?.path)return;const g=v.path,f=k.current;f.queryClient.invalidateQueries({queryKey:fe.orgFsStat(f.orgId,"home",g)}),f.queryClient.invalidateQueries({queryKey:fe.orgFsRecent(f.orgId)}),f.navigate({to:".",search:l=>({...l,main:It(g)}),replace:!0});return}if(p.type==="data-open-preview"){const v=p.data,g=k.current,f=g.taskId;if(f){const l=g.manager.threads.get().find(_=>_.id===f);g.manager.patchThread({id:f,...v?.branch?{branch:v.branch}:{},...v?.sandboxProviderKind?{sandbox_provider_kind:v.sandboxProviderKind}:{},metadata:{...l?.metadata??{},...v?.githubRepo?{githubRepo:v.githubRepo}:{},...v?.sandboxMap?{sandboxMap:v.sandboxMap}:{}}})}g.navigate({to:".",search:l=>({...l,main:"preview"}),replace:!0});return}},onFinish:(p,v,g)=>{const f=k.current;f.taskId&&Z(f.orgSlug,f.taskId),f.taskId&&f.manager.patchThread({id:f.taskId,status:Ot(g,p.parts),updated_at:new Date().toISOString()});const l=p.parts?.some(w=>{const L=w;return(L.type==="tool-share_with_user"||L.type==="tool-bash"||L.type==="tool-write")&&L.state==="output-available"});if(f.taskId&&l){const w=fe.threadOutputs(f.taskId);for(const L of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{f.queryClient.invalidateQueries({queryKey:w})},L)}f.queryClient.invalidateQueries({queryKey:fe.homeNextActions(f.orgSlug)});const _=p.metadata?.thread_id;_&&_!==f.taskId&&f.rawNavigateToTask(_)},onError:p=>{T(p),console.error("[chat] Error",p)},onToolCall:p=>k.current.onToolCall(p)};u.observer=i,Z(k.current.orgSlug,k.current.taskId);const d=p=>p==="submitted"||p==="streaming";let $=d(u.status.get().kind);const A=u.status.subscribe(()=>{const p=d(u.status.get().kind);if(p===$)return;$=p;const v=k.current;Z(v.orgSlug,v.taskId)});return()=>{u.observer===i&&(u.observer=null),A()}},[u]);const X=P.kind==="submitted"||P.kind==="streaming",ce=O.length===0,be=O.at(-1),ke=!X&&be?.role==="assistant"&&be.parts.some(i=>"state"in i&&i.state==="approval-requested"),xe=s,he=(xe?.status==="in_progress"||xe?.status==="expired")&&P.kind==="ready"&&O.length>0;async function Se(i){const d=t,$=n,A=Object.entries(I),p=A.length>0?A.map(([_,w])=>`### App Context: ${_}
|
|
24
|
-
${w}`).join(`
|
|
25
|
-
|
|
26
|
-
`):"",v=[F,p].filter(Boolean).join(`
|
|
27
|
-
|
|
28
|
-
`);let g=m;g==="gen-image"&&!o&&(g="default"),g==="web-search"&&!r&&(g="default"),g==="deep-research"&&!c&&(g="default"),(g==="web-search"||g==="deep-research")&&y("default");const f=qt({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:R??void 0,sandboxProviderKind:h??void 0,branch:a}});s?.harness_id||j.patchThread({id:d,harness_id:f.harnessId??"decopilot",sandbox_provider_kind:f.sandboxProviderKind??null,updated_at:new Date().toISOString()});const l={tier:q,mode:g,toolApprovalLevel:x.toolApprovalLevel??ot(),system:v||void 0,agent:{id:$},thread_id:d,...f};try{if(X||he){let _=!0;try{Jt(d,i),await u.enqueue(i,l),ze(d,{workflowId:`thread-run:${d}:${i.id}`,messageId:i.id,text:Bt(i.parts),hasAttachments:i.parts.some(w=>w.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),zt(d)}catch(w){_=!1,Le(d,i.id),we(d,i.id),T(w instanceof Error?w:new Error(String(w))),re.error(w instanceof Error?w.message:"Failed to queue message")}return Z(C.slug,d),_}return await u.submit({kind:"message",message:i},l),!0}finally{ae.delete(d)}}async function ne(i){const d=i.parts??Ge(i.tiptapDoc);if(d.length===0||ae.has(t))return;ae.add(t),T(null),M(void 0);const $={tiptapDoc:i.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:W?.image??void 0,name:W?.name??"you"}},A={id:crypto.randomUUID(),role:"user",parts:d,metadata:$};await Se(A)}async function Ce(i,d){if(ae.has(t))return re.info("Still sending your previous message — try again in a moment"),!1;if(ae.add(t),!await B.cancel(t,i))return ae.delete(t),re.error("Couldn't remove the original message"),!1;Le(t,i),u.removeLocalMessage(i);const A={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:d}],metadata:{created_at:new Date().toISOString(),user:{avatar:W?.image??void 0,name:W?.name??"you"}}};try{return await Se(A)}catch(p){return re.error(p instanceof Error?p.message:"Failed to send edited message"),!1}}const Me=async()=>{u.stop();try{const i=await fetch(`/api/${C.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(i.status===404)return;if(!i.ok){const d=await i.json().catch(()=>({}));throw new Error(d.message??`Cancel failed: ${i.status}`)}}catch(i){const d=i instanceof Error?i.message:"Failed to cancel";re.error(d),console.error("[chat] cancelRun",i)}},se=i=>i&&typeof i=="object"&&"type"in i?ne({tiptapDoc:i}):ne(i),me=Ue({strict:!1}).autosend===Qe;S.useEffect(()=>{if(!me||O.length>0)return;const i=rt(sessionStorage,D,t);i&&ne(i.message).then(()=>{it(sessionStorage,D,t)})},[me,O.length,D,t,ne]);const Te={messages:O,status:nn(P),sendMessage:se,editQueuedMessage:Ce,stop:()=>{Me()},submit:(i,d)=>u.submit(i,d),removeLocalMessage:i=>u.removeLocalMessage(i),isSendInFlight:()=>ae.has(t),error:ee,clearError:()=>T(null),finishReason:te,runStatusStage:U,clearFinishReason:()=>u.finishReason.set(null),isStreaming:X,isChatEmpty:ce,isWaitingForApprovals:ke??!1,isRunInProgress:he,hasMoreOlder:z,isFetchingOlder:b,fetchOlderMessages:u.fetchOlderMessages.bind(u)};return Q.jsx(Ae.Provider,{value:Te,children:e})}function Rn(){const t=S.useContext(Ae);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function Pn(){return S.useContext(Ae)}function ln(){const t=S.useContext(_e);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function dn(){const t=S.useContext(Re);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function $n(){return S.useContext(Re)}function un(){return S.useContext(_e)}export{_n as A,cn as C,kn as S,dn as a,Rn as b,un as c,ln as d,En as e,tn as f,Le as g,Pn as h,An as i,Tn as j,Ge as k,He as l,$n as m,Ve as n,Be as o,Cn as p,Pt as q,wn as s,Mn as t,$t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as O,j as t,B as F,i as Y,H as Ge,I as te,U as Pe,r as $,a5 as re,M as Qe,u as Ye,L as W,t as Ze,l as je,e as le,aZ as ke}from"./index-CgBmlUGm.js";import{E as Ae}from"./empty-state-BTc9UY0F.js";import{u as Xe,a as Ee}from"./use-collections-BhGPmLDM.js";import{u as ae}from"./use-mcp-client-CdJHCm8Y.js";import{F as se,a as et,b as ce,d as de}from"./form-BpJgWXmx.js";import{I as me}from"./input-BnfEMIGT.js";import{T as ie}from"./textarea-D1IgqmmJ.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-BoCwmHA9.js";import{ar as it,L as rt,an as lt,U as at,ae as ct,as as dt,Y as be}from"./agent-icon-DrSWK4T8.js";import{g as mt,M as ut,a as Ne}from"./index-D1cnvmIK.js";import{A as xt,a as pt,b as ft}from"./alert-DWiS1Ssy.js";import{S as ve,a as Se,b as ye,c as we,d as ne}from"./select-YITUw-eM.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-CB_N8QyX.js";import{i as gt}from"./AlertCircle-DmkKUOhm.js";import{s as jt}from"./Stars02-kVXYdBfS.js";import{a as bt}from"./Copy01-Bc9QBhFd.js";import{i as Nt}from"./Play-BFoRJghB.js";import{a as Oe,b as Re,B as J,c as G,d as Q,e as _e}from"./breadcrumb-KAYTw6cp.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-C_inZD2F.js";import{a as Me,u as De}from"./use-connection-Don2WgMf.js";import{a as wt}from"./use-mcp-tools-BaIf7aPi.js";import{M as Ct,c as It}from"./monaco-editor-DbroNHLy.js";import{I as Te}from"./integration-icon-DLw7Zft3.js";import{h as $t,m as Tt}from"./chat-context-B3fhdzY7.js";import{u as Pt}from"./shell-layout-D1XBVOK8.js";import{n as kt}from"./Tool02-J_PfM8Nz.js";import"./constants-CaIX_f5U.js";import"./auth-Cr406d5k.js";import"./label-BdRgp1MD.js";import"./index-CpmRkbKB.js";import"./sidebar-jC_LjgnK.js";import"./LayoutLeft-EcdOJis4.js";import"./use-mobile-B9R6eaP0.js";import"./X-B7Sc0GS4.js";import"./ZoomOut-Bb6xRcrC.js";import"./Key01-z2KeAwWe.js";import"./extract-connection-data-CvHlHsvl.js";import"./use-registry-connections-CkzW69jF.js";import"./use-organization-settings-BIgNW-JC.js";import"./studio-tools-DtERx3-w.js";import"./Plus-BC3OQAv6.js";import"./index-BVSRBupd.js";import"./index-DpZiwWtQ.js";import"./popover-B2JX6-0F.js";import"./use-virtual-mcp-9wSLzLB_.js";import"./Check-DYxjoBWV.js";import"./SearchMd-GQIk2JN7.js";import"./Users03-Bv07fLWj.js";import"./use-create-virtual-mcp-DACeDuiK.js";import"./use-navigate-to-agent-3qDPth_I.js";import"./hooks-MtX5yASy.js";import"./decopilot-sse-pool-DhNLRlpz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-BHeREp7L.js";import"./ArrowUp-DMeNZgjG.js";import"./Settings02-C8WW6-r8.js";import"./XCircle-BUA08cO-.js";import"./ArrowUpRight-Gimwrhen.js";import"./TrendUp01-BlXicyb4.js";import"./ZapSquare-D534FsK3.js";import"./Loading02-BYwsqZEG.js";import"./CheckCircle-B4NmlxYQ.js";import"./ChevronDown-BrD8qg2M.js";import"./ChevronRight-D2gtrGMP.js";import"./ChevronUp-BKNlcHhX.js";import"./Circle-B_Fqw1K-.js";import"./DotsVertical-WBMZIKtT.js";import"./Globe01-oF2ruraB.js";import"./Eye-BKTF2OaK.js";import"./FilterLines-Cxtbp1DY.js";import"./Star01-CoAmgzIu.js";import"./Globe04-Bt3_QuH9.js";import"./SwitchHorizontal01-D0WmE4M_.js";import"./HardDrive-B4iV_oDv.js";import"./LinkExternal01-m0U-Lm_o.js";import"./List-CfReT_EU.js";import"./Monitor01-BTk9yxuR.js";import"./Sun-gbZ0Crr7.js";import"./Package-BUQJFAeb.js";import"./Palette-DCYAwuZ_.js";import"./SearchLg-BSwwKRR3.js";import"./Shield01-Bsiz7jUT.js";import"./Stars01-DaCn5yDz.js";import"./Trash01-DTo19AbB.js";import"./Upload01-D2kJMwQq.js";import"./User01-DAvNYaFB.js";import"./Users01-BXcNizDT.js";import"./XClose-DUzYp9PV.js";import"./Zap-BchfKKws.js";import"./mcp-oauth-8tCiarSV.js";import"./badge-CV-Q9eu5.js";import"./index-BB2Lp-YP.js";import"./autosend-B2JqcvZh.js";import"./use-ai-providers-B21DVkoY.js";import"./use-decopilot-events-CdQ11k4e.js";import"./tab-id-bb-jjgGv.js";import"./avatar-pT8UjaWS.js";import"./dialog-B_6-uR4V.js";import"./alert-dialog-BjO-yqLW.js";import"./required-auth-layout-Dun_88x7.js";import"./use-org-sso-DVm_ZMu0.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Mt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Xe(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function Lt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Dt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const zt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=Me(e),N=$t(),A=Tt(),{openSidePanel:U}=Pt(),L=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),z=wt({client:_}),j=z.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),V=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,Z]=$.useState("json"),[Le,ze]=$.useState(!1);E&&!Le&&(Z("ui"),ze(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const X=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const ge=Number(h[D]);Number.isNaN(ge)||(h[D]=ge)}});const v=await _.callTool({name:s,arguments:h}),K=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-a);p(K),g(v),C(h);const We=JSON.stringify(K),he=new TextEncoder().encode(We).length;y({duration:`${Ke}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const K=performance.now();y({duration:`${Math.round(K-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??zt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:X(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&M==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>A?.setAppContext(L,a),onTeardown:()=>A?.clearAppContext(L),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[z.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):z.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:z.isSuccess?"ready":z.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!Me(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:Lt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=De(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Kt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Wt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=De(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async M=>{i&&await R.update.mutateAsync({id:i,data:M})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Kt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let L;s[24]!==P?(L=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=L):L=s[25];let _;s[26]!==U||s[27]!==L||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,L]})}),s[26]=U,s[27]=L,s[28]=N,s[29]=_):_=s[29];const z=_;if(y){let M;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(M=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let V;return s[38]!==z||s[39]!==E?(V=t.jsx(ue,{breadcrumb:z,children:E}),s[38]=z,s[39]=E,s[40]=V):V=s[40],V}function Gt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{}),s[2]=i):i=s[2],i}function Kn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Kn as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as Z,r as u,j as r,i as se,B as he,d$ as Mt,aO as Dt,aU as ie,e0 as Rt,e1 as Pt,e2 as Et,e3 as kt,bN as Tt,e4 as Ot,e5 as qe,aQ as At,e6 as Lt,e7 as Ft,e8 as It,e9 as $t,ea as _t,eb as zt,ec as Wt,ed as Gt,ee as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-CgBmlUGm.js";import{F as Ut,l as Vt}from"./index-BB2Lp-YP.js";import{i as qt,aD as Qt,aE as Ht,aF as ue,aG as Xt,ab as _e}from"./agent-icon-DrSWK4T8.js";import{a as Jt}from"./Tool01-BHeREp7L.js";import{s as Yt}from"./XClose-DUzYp9PV.js";import{A as Zt}from"./automation-runs-DTIdBSof.js";import{T as ze,a as We,b as Ge}from"./tooltip-CB_N8QyX.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-BjO-yqLW.js";import{b as cn}from"./chat-context-B3fhdzY7.js";import{u as dn}from"./shell-layout-D1XBVOK8.js";import{s as fe,a as Ke,f as un}from"./index-iuSXEyY3.js";import{a as fn,f as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-B_6-uR4V.js";import{I as Be}from"./input-BnfEMIGT.js";import{t as vn}from"./ChevronDown-BrD8qg2M.js";import{i as yn}from"./ChevronRight-D2gtrGMP.js";import{a as wn}from"./ZoomOut-Bb6xRcrC.js";import{E as Cn,v as Ue,w as we,x as bn,y as jn,z as Nn,A as U,C as me,g as Ce,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-DfceqVpf.js";import"./AlertCircle-DmkKUOhm.js";import"./ArrowUp-DMeNZgjG.js";import"./Settings02-C8WW6-r8.js";import"./Tool02-J_PfM8Nz.js";import"./XCircle-BUA08cO-.js";import"./ArrowUpRight-Gimwrhen.js";import"./TrendUp01-BlXicyb4.js";import"./ZapSquare-D534FsK3.js";import"./Users03-Bv07fLWj.js";import"./Loading02-BYwsqZEG.js";import"./CheckCircle-B4NmlxYQ.js";import"./Check-DYxjoBWV.js";import"./ChevronUp-BKNlcHhX.js";import"./Circle-B_Fqw1K-.js";import"./Stars02-kVXYdBfS.js";import"./Copy01-Bc9QBhFd.js";import"./DotsVertical-WBMZIKtT.js";import"./Globe01-oF2ruraB.js";import"./Eye-BKTF2OaK.js";import"./FilterLines-Cxtbp1DY.js";import"./Star01-CoAmgzIu.js";import"./Globe04-Bt3_QuH9.js";import"./SwitchHorizontal01-D0WmE4M_.js";import"./HardDrive-B4iV_oDv.js";import"./Key01-z2KeAwWe.js";import"./LayoutLeft-EcdOJis4.js";import"./LinkExternal01-m0U-Lm_o.js";import"./List-CfReT_EU.js";import"./Monitor01-BTk9yxuR.js";import"./Sun-gbZ0Crr7.js";import"./Package-BUQJFAeb.js";import"./Palette-DCYAwuZ_.js";import"./Play-BFoRJghB.js";import"./Plus-BC3OQAv6.js";import"./SearchLg-BSwwKRR3.js";import"./SearchMd-GQIk2JN7.js";import"./Shield01-Bsiz7jUT.js";import"./Stars01-DaCn5yDz.js";import"./Trash01-DTo19AbB.js";import"./Upload01-D2kJMwQq.js";import"./User01-DAvNYaFB.js";import"./Users01-BXcNizDT.js";import"./X-B7Sc0GS4.js";import"./Zap-BchfKKws.js";import"./select-YITUw-eM.js";import"./useInfiniteQuery-uL7J0_7H.js";import"./use-infinite-scroll-CI9or9uk.js";import"./use-connection-Don2WgMf.js";import"./use-collections-BhGPmLDM.js";import"./use-mcp-client-CdJHCm8Y.js";import"./constants-CaIX_f5U.js";import"./auth-Cr406d5k.js";import"./use-virtual-mcp-9wSLzLB_.js";import"./card-B_g-bY4h.js";import"./sidebar-jC_LjgnK.js";import"./use-mobile-B9R6eaP0.js";import"./table-BkZs-l64.js";import"./empty-state-BTc9UY0F.js";import"./use-members-D7p2Y_Sp.js";import"./use-org-auth-client-qPiJ9muQ.js";import"./use-clock-tick-CIfovY09.js";import"./use-automations-DAxW4YOG.js";import"./studio-tools-DtERx3-w.js";import"./useSuspenseInfiniteQuery-1KPMSa71.js";import"./badge-CV-Q9eu5.js";import"./checkbox-G49vRqoM.js";import"./command-Sv_8xo4a.js";import"./index-DpZiwWtQ.js";import"./popover-B2JX6-0F.js";import"./avatar-pT8UjaWS.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D9V8a-BA.js";import"./file-type-icon-x196dC_k.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-DbroNHLy.js";import"./delay-CnY5UFtP.js";import"./index-D1cnvmIK.js";import"./hooks-MtX5yASy.js";import"./decopilot-sse-pool-DhNLRlpz.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-DLw7Zft3.js";import"./use-navigate-to-agent-3qDPth_I.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-QWxGbKBu.js";import"./form-BpJgWXmx.js";import"./label-BdRgp1MD.js";import"./autosend-B2JqcvZh.js";import"./use-ai-providers-B21DVkoY.js";import"./use-decopilot-events-CdQ11k4e.js";import"./use-organization-settings-BIgNW-JC.js";import"./required-auth-layout-Dun_88x7.js";import"./use-org-sso-DVm_ZMu0.js";import"./drawer-BE9ljxm4.js";import"./collection-search-DpJQEBO5.js";import"./tabs-BoJ2RRJH.js";import"./toggle-group-BESFh1Up.js";import"./agent-capabilities-D4qVYFGl.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Bgg_OkYA.js";import"./use-registry-connections-CkzW69jF.js";import"./extract-connection-data-CvHlHsvl.js";import"./collection-tabs-BbkNjy2P.js";import"./textarea-D1IgqmmJ.js";import"./connection-form-helpers-Bi6ZDNqH.js";import"./authenticate-and-persist-oauth-BP5LS1nd.js";import"./mcp-oauth-8tCiarSV.js";import"./connect-desktop-dialog-u9wYmVqy.js";import"./select-model-BiEGzTzi.js";import"./skeleton-RwzvQC_m.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D76W_ZOD.js";import"./dropdown-menu-CYQZB-4N.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DNCLrwgH.js";import"./toolbar-DJusbmmf.js";import"./use-mcp-tools-BaIf7aPi.js";import"./use-capability-DXWPCR7E.js";import"./tools-list-C_inZD2F.js";import"./switch-D80K3uBB.js";import"./use-debounced-autosave-CwePX8_C.js";import"./index-CpmRkbKB.js";import"./search-input--1w25EJQ.js";import"./github-repo-picker-DPCWySa3.js";import"./use-debounced-value-DDhg7maH.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-R9ijaYXA.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-vUa7jft6.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DKmCedkw.js";import"./toolbar-icon-button-BHN8jOXq.js";import"./use-file-configs-DjGQF94E.js";import"./automation-list-row-CrJ2rvgh.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,V]=u.useState(i),w=Pn[a];i!==B&&(V(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==w.title?($=r.jsx(fn,{children:w.title}),e[7]=w.title,e[8]=$):$=e[8];let T;e[9]!==w.description?(T=r.jsx(mn,{children:w.description}),e[9]=w.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==w.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:w.placeholder,autoFocus:!0,disabled:d})]}),e[18]=w.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let C;e[33]!==w.submit||e[34]!==d?(C=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):w.submit,e[33]=w.submit,e[34]=d,e[35]=C):C=e[35];let L;e[36]!==k||e[37]!==C?(L=r.jsx(he,{type:"submit",disabled:k,children:C}),e[36]=k,e[37]=C,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Un="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Vn.displayName=Un;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ve(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:V,onDelete:w}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(wn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ve,{}),e[25]=k):k=e[25];let C;e[26]!==y?(C=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=C):C=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ve,{}),e[30]=b):b=e[30];let S;e[31]!==V?(S=r.jsx(te,{onSelect:V,children:"Rename"}),e[31]=V,e[32]=S):S=e[32];let z;e[33]!==w?(z=r.jsx(te,{variant:"destructive",onSelect:w,children:"Delete"}),e[33]=w,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==C||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,C,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=C,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Vt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=U(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function os({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[V,w]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,C]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return V.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){w(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),C(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:U(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=U(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of we(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:U(n),to:U(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:U(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:U(t),limit:Ue}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of we(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ue,maxDepth:Cn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Oe(t){if(!k.get(t)?.loaded){C(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");C(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}C(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),V.includes(t)||w(n=>[...n,t]),Oe(t)}function vt(t){w(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),C(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function wt(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=we(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function Ct(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=Ct();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=Ce(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?wt(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",U(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[V.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:V.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Ut,{language:Ce(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&C(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",Ce(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":U(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{os as FileExplorer};
|