decocms 3.67.2 → 3.67.3
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-BmclRZ36.js → AlertCircle-Bpe2_GvV.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DfyRpa7I.js → ArrowUpRight-YrfJ1CbZ.js} +1 -1
- package/dist/client/assets/{CheckCircle-chlyBg2w.js → CheckCircle-CYtqo8mv.js} +1 -1
- package/dist/client/assets/{ChevronDown-xnujHbma.js → ChevronDown-Cs8E6-3E.js} +1 -1
- package/dist/client/assets/{ChevronLeft-D-0b0jaB.js → ChevronLeft-B-gfvsw1.js} +1 -1
- package/dist/client/assets/{ChevronRight-DgGMjNQ2.js → ChevronRight-zYXs_-Se.js} +1 -1
- package/dist/client/assets/{ChevronUp-ssLglSfS.js → ChevronUp-ZNXmTuIH.js} +1 -1
- package/dist/client/assets/{DotsVertical-DET7Jl3A.js → DotsVertical-BX13G9P1.js} +1 -1
- package/dist/client/assets/{Eye-Cfz6tZ15.js → Eye-C5YGQqBB.js} +1 -1
- package/dist/client/assets/{FilterLines-Dh9wNNXi.js → FilterLines-Ct0vyoCk.js} +1 -1
- package/dist/client/assets/{Globe01-ewHp_9uK.js → Globe01-DqoZJREO.js} +1 -1
- package/dist/client/assets/{Globe04-CAyiWi73.js → Globe04-aor3r_Wp.js} +1 -1
- package/dist/client/assets/{HardDrive-ABAtWBN-.js → HardDrive-C39-XuLX.js} +1 -1
- package/dist/client/assets/{Key01-JG8IVIcf.js → Key01-C9VOqBor.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BAEXcrIX.js → LayoutLeft-Bc24ivgh.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BDty9NTy.js → LinkExternal01-bw0rYexk.js} +1 -1
- package/dist/client/assets/{Monitor01-BPADhIbr.js → Monitor01-BBKDcKw2.js} +1 -1
- package/dist/client/assets/{Palette-xtfhSkOy.js → Palette-Dee1B_K4.js} +1 -1
- package/dist/client/assets/{Play-BfqfXtxE.js → Play-BYATnDqe.js} +1 -1
- package/dist/client/assets/{Plus-bN4DDzHM.js → Plus-DP7MBDcr.js} +1 -1
- package/dist/client/assets/{SearchMd-JGuF2SJ3.js → SearchMd-BNtCiaDl.js} +1 -1
- package/dist/client/assets/{Settings02-DE29vYCu.js → Settings02-BhiFsU64.js} +1 -1
- package/dist/client/assets/{Shield01-n-a01HQd.js → Shield01-zcrbIoQW.js} +1 -1
- package/dist/client/assets/{Star01-N3VFSdvZ.js → Star01-Bi13YWhS.js} +1 -1
- package/dist/client/assets/{Stars01-DsonRyoA.js → Stars01-Cm43N5JK.js} +1 -1
- package/dist/client/assets/{Stars02-mzsf2wYL.js → Stars02-ilw9rARd.js} +1 -1
- package/dist/client/assets/{Sun-BstscSya.js → Sun-BI8gfoic.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-D9okikgy.js → SwitchHorizontal01-BkhFVCHL.js} +1 -1
- package/dist/client/assets/{Tool01-CzZMajtM.js → Tool01-Ri8IcVVN.js} +1 -1
- package/dist/client/assets/{Trash01-CVFvFDNw.js → Trash01-DgUXWGZr.js} +1 -1
- package/dist/client/assets/{Upload01-nR0-bkCf.js → Upload01-CRl35fVk.js} +1 -1
- package/dist/client/assets/{User01-DN5mCg88.js → User01-B13x_3hK.js} +1 -1
- package/dist/client/assets/{Users01-Dpm21bW1.js → Users01-TRM2A3CY.js} +1 -1
- package/dist/client/assets/{Users03-TDNky6LJ.js → Users03-c3H4VKdl.js} +1 -1
- package/dist/client/assets/{X-vxJbcFZu.js → X-DUzDqibI.js} +1 -1
- package/dist/client/assets/{XCircle-3mnhYuh7.js → XCircle-CiWHFuXX.js} +1 -1
- package/dist/client/assets/{XClose-BWmveN5G.js → XClose-Bod7oMvA.js} +1 -1
- package/dist/client/assets/{Zap-CPGAbdIn.js → Zap-DEQh6kKf.js} +1 -1
- package/dist/client/assets/{ZapSquare-DtlZ0XtN.js → ZapSquare-BA2pOs85.js} +1 -1
- package/dist/client/assets/{ZoomOut-Bv-x8t-3.js → ZoomOut-D6k5Mdn4.js} +1 -1
- package/dist/client/assets/{access-gate-Cjtt7v5f.js → access-gate-DHQsgThb.js} +1 -1
- package/dist/client/assets/{add-section-modal-BHRYoEPv.js → add-section-modal-D5rQ4e_n.js} +1 -1
- package/dist/client/assets/{agent-icon-CHsmfzrp.js → agent-icon-BvSYE4X0.js} +1 -1
- package/dist/client/assets/{agents-list-8AgmuC9x.js → agents-list-BADo6gze.js} +1 -1
- package/dist/client/assets/{ai-providers-DQ7QvCkL.js → ai-providers-D-btg_ej.js} +1 -1
- package/dist/client/assets/{alert-Cmmqv3gG.js → alert-Ck8w_HMj.js} +1 -1
- package/dist/client/assets/{alert-dialog-DFBPrUlf.js → alert-dialog-Iz7Pne8q.js} +1 -1
- package/dist/client/assets/app-editor-DtqVQrAv.js +1 -0
- package/dist/client/assets/{auth-k-iFGlch.js → auth-JrxMRfm7.js} +1 -1
- package/dist/client/assets/{auth-catchall-DnS0SsMp.js → auth-catchall-2ybrzco_.js} +1 -1
- package/dist/client/assets/{auth-split-layout-B4NUZNui.js → auth-split-layout-C4SnTzaq.js} +1 -1
- package/dist/client/assets/{automation-list-row-BkSS1u9G.js → automation-list-row-Cjs43Sd-.js} +1 -1
- package/dist/client/assets/{automation-runs-BYdznHPE.js → automation-runs-CggowR0J.js} +1 -1
- package/dist/client/assets/{automations-C69mMjzM.js → automations-USamT7J9.js} +1 -1
- package/dist/client/assets/{avatar-BJDY188d.js → avatar-yh81kVts.js} +1 -1
- package/dist/client/assets/{badge-CFlBAGVs.js → badge-F_XnDxyE.js} +1 -1
- package/dist/client/assets/{block-document-Df8KoCXn.js → block-document-y2Lktyst.js} +1 -1
- package/dist/client/assets/{brand-context-DuY3atYS.js → brand-context-DqzmhXuN.js} +1 -1
- package/dist/client/assets/{buckets-B4sols7A.js → buckets-De0LJJ-I.js} +1 -1
- package/dist/client/assets/{calendar-CGQ-ie88.js → calendar-DV7Tk4AZ.js} +1 -1
- package/dist/client/assets/{capability-load-error-D3Lo8p0_.js → capability-load-error-D8DXeudL.js} +1 -1
- package/dist/client/assets/{card-0NTlYEIG.js → card-bh08sj3I.js} +1 -1
- package/dist/client/assets/category-editor-Cmo_7k3K.js +1 -0
- package/dist/client/assets/{chat-context-Dv96XiTZ.js → chat-context-CsxEe8Dk.js} +7 -7
- package/dist/client/assets/{checkbox-CpDoQ7Yv.js → checkbox-xjeH3Wpr.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DTM6IRFd.js → cli-auth-success-DPUOH3tk.js} +1 -1
- package/dist/client/assets/{collection-detail-D-z_k4pc.js → collection-detail-B-VkwAVH.js} +1 -1
- package/dist/client/assets/{collection-display-button-Cq4SaVuJ.js → collection-display-button-WtV7BkCy.js} +1 -1
- package/dist/client/assets/{collection-search-wS84Uw7R.js → collection-search-t7pP-iq8.js} +1 -1
- package/dist/client/assets/{collection-tabs-CrXzE-CP.js → collection-tabs-DhaKOcMD.js} +1 -1
- package/dist/client/assets/{command-fpVUb--D.js → command-tbfb-2AV.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-Y_3kKbGF.js → connect-desktop-dialog-OG8wSu5b.js} +1 -1
- package/dist/client/assets/{connection-card-DubGHynt.js → connection-card-tc4mvPkM.js} +1 -1
- package/dist/client/assets/{connection-detail-BxR9TIBE.js → connection-detail-C8sRVuZE.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Cc2oyq0i.js → connection-form-helpers-C7CackfK.js} +1 -1
- package/dist/client/assets/{connections-ZPdMyV6w.js → connections-CL79BWSD.js} +1 -1
- package/dist/client/assets/{context-menu-BN5ZKldy.js → context-menu-CGXH567I.js} +1 -1
- package/dist/client/assets/{decopilot-HFlhm62L.js → decopilot-C_VwkpOk.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CXcIYn_j.js → decopilot-sse-pool-CK5VnB1V.js} +1 -1
- package/dist/client/assets/{dialog-Bep6tMMx.js → dialog-B5Fc7PcC.js} +1 -1
- package/dist/client/assets/{domain-settings-D5odYeT1.js → domain-settings-B9C8VQl7.js} +1 -1
- package/dist/client/assets/{drawer-Col1fd6y.js → drawer-f0G1u50l.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Dxrc7XSl.js → dropdown-menu-Bo5hgXOF.js} +1 -1
- package/dist/client/assets/{empty-state-CBknX3cP.js → empty-state-Dd2C1L1E.js} +1 -1
- package/dist/client/assets/{extract-connection-data-yrZbGAUI.js → extract-connection-data-_MOrxDBF.js} +1 -1
- package/dist/client/assets/{file-explorer-NijMUVyf.js → file-explorer-DzxDZgb_.js} +1 -1
- package/dist/client/assets/{file-type-icon-IKZpdmMx.js → file-type-icon-2rgm4864.js} +1 -1
- package/dist/client/assets/{files-DKn4CBvj.js → files-BamfXXFn.js} +1 -1
- package/dist/client/assets/{form-DV7xSonM.js → form-DEWRKuCN.js} +1 -1
- package/dist/client/assets/{general-BC32Z_k5.js → general-DUftEYdq.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DBTDDdPH.js → github-repo-picker-DaaFmqbw.js} +1 -1
- package/dist/client/assets/{hooks-CD4luOZh.js → hooks-BEP8IXge.js} +1 -1
- package/dist/client/assets/{image-field-C1JcT4iG.js → image-field-D0-sBCXR.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-B86dto7B.js → import-from-deco-dialog-DPg95H7-.js} +1 -1
- package/dist/client/assets/{index-WlHoE4AJ.js → index-BWm_HFUi.js} +1 -1
- package/dist/client/assets/{index-D6GCfqA_.js → index-C4kX7-WK.js} +17 -17
- package/dist/client/assets/{index-zEyeziLM.js → index-CkYx9UrU.js} +1 -1
- package/dist/client/assets/{index-9bg42Pa1.js → index-Cp09uk5T.js} +1 -1
- package/dist/client/assets/{index-Yo8YIrYA.js → index-CrdcZU1p.js} +1 -1
- package/dist/client/assets/{index-CEqjXzTC.js → index-D7sCHzTD.js} +1 -1
- package/dist/client/assets/{index-Dg_mwh5q.js → index-DK5BMExb.js} +1 -1
- package/dist/client/assets/{index-CKbwNZU2.js → index-DT_lqibQ.js} +1 -1
- package/dist/client/assets/{index-pFXSmgDj.js → index-DdencN2D.js} +1 -1
- package/dist/client/assets/{index-CCU8tTNs.js → index-DgiSaeSc.js} +26 -26
- package/dist/client/assets/{index-BxrNS_jM.js → index-DtdRCqfT.js} +3 -3
- package/dist/client/assets/{index-B81miugv.js → index-DxFKESA7.js} +1 -1
- package/dist/client/assets/{index-D9FdNYWJ.js → index-qCsR4teM.js} +1 -1
- package/dist/client/assets/{index-redirect-BLxPXqBJ.js → index-redirect-DlGjs7wZ.js} +1 -1
- package/dist/client/assets/{index-CKlSvIQJ.js → index-u1p_bf-7.js} +1 -1
- package/dist/client/assets/{input-B_0hsonc.js → input-C6eDTm2J.js} +1 -1
- package/dist/client/assets/{integration-icon-CGoCKywQ.js → integration-icon-DZ_y4SYI.js} +1 -1
- package/dist/client/assets/{label-BPTSDSON.js → label-CApOnzUS.js} +1 -1
- package/dist/client/assets/{login-DEEIdIHI.js → login-B1SVfmeu.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DLVO5G51.js → mcp-oauth-topkfZ98.js} +1 -1
- package/dist/client/assets/{members-BQxz1bvp.js → members-CjQxJ_RX.js} +1 -1
- package/dist/client/assets/{monaco-editor-W441ROEf.js → monaco-editor-C74LbgZn.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D5-vmeoy.js → monitoring-stats-row-QiX1Poqq.js} +1 -1
- package/dist/client/assets/{oauth-callback-cwhxBVYa.js → oauth-callback-CMtN5crm.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BRQJO2Gc.js → oauth-callback-ai-provider-B5jMOJVh.js} +1 -1
- package/dist/client/assets/{onboarding-DLulm50I.js → onboarding-CZ-kOd50.js} +1 -1
- package/dist/client/assets/{org-install-BvuRLERX.js → org-install-CYVEJ06f.js} +1 -1
- package/dist/client/assets/{org-layout-U8_N5cyx.js → org-layout-CuGLO-yG.js} +1 -1
- package/dist/client/assets/{page-seo-form-DV2Uk66h.js → page-seo-form-hHpEj2sm.js} +1 -1
- package/dist/client/assets/page-seo-sheet-C2xGdGSj.js +1 -0
- package/dist/client/assets/{popover-sjSahoqv.js → popover-BZPKY_pJ.js} +1 -1
- package/dist/client/assets/{post-editor-DxporwYQ.js → post-editor-bFo5aSK6.js} +1 -1
- package/dist/client/assets/{preview-dialog-DYrCk7gz.js → preview-dialog-B2V7Iomt.js} +1 -1
- package/dist/client/assets/{primitives-YmWQ6h4F.js → primitives-DN8h3bGA.js} +1 -1
- package/dist/client/assets/{profile-CIXAw6_5.js → profile-C3YkJZkf.js} +1 -1
- package/dist/client/assets/{project-app-view-74tj13aJ.js → project-app-view-BpK-h-Rb.js} +1 -1
- package/dist/client/assets/record-editor-DqBdXh9_.js +1 -0
- package/dist/client/assets/registry-BZgs9SVc.js +2 -0
- package/dist/client/assets/{registry-layout-B7TG4eW0.js → registry-layout-nx59aaeW.js} +1 -1
- package/dist/client/assets/{require-capability-kUwVwrRi.js → require-capability-B4oR0b-_.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C8zUq5LT.js → required-auth-layout-BIvWfoYl.js} +1 -1
- package/dist/client/assets/{reset-password-BFZirUKF.js → reset-password-DuG163Lb.js} +1 -1
- package/dist/client/assets/{roles-BPq8P4Fj.js → roles-XTwVX6TJ.js} +1 -1
- package/dist/client/assets/save-referenced-block-rvEy7Ire.js +1 -0
- package/dist/client/assets/{save-status-CYJ9S6i-.js → save-status-DWSE0Ahw.js} +1 -1
- package/dist/client/assets/{schema-form-Phd91_TM.js → schema-form-V0y_iwdn.js} +1 -1
- package/dist/client/assets/{scroll-area-DZusoPfA.js → scroll-area-Bdcg37bX.js} +1 -1
- package/dist/client/assets/{search-input-CZ8SaGMM.js → search-input-DWwtSn3X.js} +1 -1
- package/dist/client/assets/{secrets-aZgMqeMb.js → secrets-DIUX8x6L.js} +1 -1
- package/dist/client/assets/{sections-editor-ok-Kih4-.js → sections-editor-tuEhCOpO.js} +2 -2
- package/dist/client/assets/{select-DZ51rSQd.js → select-DViAZ6BX.js} +1 -1
- package/dist/client/assets/{select-model-D8T9MwL8.js → select-model-Bd9U_6pO.js} +1 -1
- package/dist/client/assets/{seo-editor-D5EYUaLJ.js → seo-editor-RooODx8v.js} +1 -1
- package/dist/client/assets/{settings-layout-Dk7oj7kq.js → settings-layout-CiyDJqF4.js} +1 -1
- package/dist/client/assets/{settings-section-Y-F-fcr9.js → settings-section-BjMM3sOA.js} +1 -1
- package/dist/client/assets/{sheet-CrZDuw8F.js → sheet-CLn7Ee-B.js} +1 -1
- package/dist/client/assets/{shell-controls-BQdMbkHw.js → shell-controls-DIyWXZMt.js} +1 -1
- package/dist/client/assets/{shell-layout-CNKBQhI2.js → shell-layout-Cpd3fKJB.js} +1 -1
- package/dist/client/assets/{shell-route-loading-BcQ50kz_.js → shell-route-loading-Qu4W7RwV.js} +1 -1
- package/dist/client/assets/{sidebar-B48lsh1W.js → sidebar-BvAh8pRK.js} +1 -1
- package/dist/client/assets/{skeleton-DdaIW0fc.js → skeleton-CQ4hZKKg.js} +1 -1
- package/dist/client/assets/{sortable.esm-DFtwWal7.js → sortable.esm-CRDKOVWU.js} +1 -1
- package/dist/client/assets/{sso-l-xNv6oX.js → sso-Be-I4LqT.js} +1 -1
- package/dist/client/assets/{store-vHlKr9x8.js → store-CgjTP1S6.js} +1 -1
- package/dist/client/assets/store-registry-ToY5BNiI.js +2 -0
- package/dist/client/assets/{studio-tools-BzGW_qQX.js → studio-tools-C3pW43RI.js} +1 -1
- package/dist/client/assets/{switch-BpPDo4WS.js → switch-BwuEbygk.js} +1 -1
- package/dist/client/assets/{table-DdNE0yIK.js → table-KwGxLknv.js} +1 -1
- package/dist/client/assets/{tabs-COlIPxJa.js → tabs-CWXbqK3H.js} +1 -1
- package/dist/client/assets/{task-status-saHJktPL.js → task-status-CdiSaFNW.js} +1 -1
- package/dist/client/assets/{textarea-C2QWkbxj.js → textarea-CgeTFjY8.js} +1 -1
- package/dist/client/assets/{toggle-group-Ef_DvlNC.js → toggle-group-DnKFPpga.js} +1 -1
- package/dist/client/assets/{toolbar-3-ia1qjF.js → toolbar-BUvdNtWO.js} +1 -1
- package/dist/client/assets/{tooltip-C3y7Q3JJ.js → tooltip-D9vE3hJi.js} +1 -1
- package/dist/client/assets/{types-CJ7l0TQf.js → types-HcUrhwzw.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DhsmmwNY.js → use-ai-providers-BwFwpBOt.js} +1 -1
- package/dist/client/assets/{use-automations-DZiVqsJE.js → use-automations-BSPuoSfS.js} +1 -1
- package/dist/client/assets/{use-capability-CdIgj6nz.js → use-capability-BPH95vck.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BYonkvKL.js → use-clock-tick-BVJBWlDM.js} +1 -1
- package/dist/client/assets/{use-collections-BvQz1-Ee.js → use-collections-CtQI9edu.js} +1 -1
- package/dist/client/assets/{use-connection-CBkuINe5.js → use-connection-B-GnOxIe.js} +1 -1
- package/dist/client/assets/{use-copy-C-SB9SRF.js → use-copy-DkTFPjAl.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CoINGCk3.js → use-create-virtual-mcp-BpdjItaW.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BYr4wRK_.js → use-debounced-autosave-DmyGwJEl.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DetFuvIX.js → use-deco-credits-CM5FdDx1.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CkxbxokZ.js → use-delete-connection-B7j002Rl.js} +1 -1
- package/dist/client/assets/{use-file-configs-WD--ot8g.js → use-file-configs-BlRU7DjQ.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-gEtDbhxZ.js → use-infinite-scroll-tVsKkDwZ.js} +1 -1
- package/dist/client/assets/{use-join-requests-uHIwhyje.js → use-join-requests-qOpXvple.js} +1 -1
- package/dist/client/assets/{use-mcp-client-C031r2-Q.js → use-mcp-client-00dhsiuh.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-BHrxc05G.js → use-mcp-prompts-CPpnRCz9.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CDVfVRsf.js → use-mcp-tools-CelPls9H.js} +1 -1
- package/dist/client/assets/{use-members-B_mfUbeK.js → use-members-D4qUur-D.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CPPIjmTk.js → use-navigate-to-agent-CjuQTsVF.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-mvZWQoxD.js → use-org-auth-client-B6_dXOCB.js} +1 -1
- package/dist/client/assets/{use-org-sso-BRRrnOZZ.js → use-org-sso-DzARfVqe.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CU-1ZyJo.js → use-organization-roles-C1ZE7DRi.js} +1 -1
- package/dist/client/assets/{use-organization-settings-LtL_2oVQ.js → use-organization-settings-BwlURqPC.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CfQAHSyd.js → use-registry-connections-CnhucvHw.js} +1 -1
- package/dist/client/assets/{use-secrets-C_T7V5DI.js → use-secrets-CZrigvCX.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DzNOpTyc.js → use-status-sounds-cSQbPNIy.js} +1 -1
- package/dist/client/assets/{use-view-mode-DE_kKgBR.js → use-view-mode-BqCV5fdk.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DY9s0f6y.js → use-virtual-mcp-BDx6BF9u.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-3nAveyVa.js +1 -0
- package/dist/client/assets/{useRouterState-Bhxm6U0G.js → useRouterState-DeeIf3re.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DYDXgR3L.js +1 -0
- package/dist/client/assets/{view-mode-toggle-B17n_pEh.js → view-mode-toggle-BA0E_UOT.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1334 -29715
- package/dist/server/server.js +332 -344
- package/package.json +1 -1
- package/dist/client/assets/app-editor-tzegGhGx.js +0 -1
- package/dist/client/assets/category-editor-D-jdlJmP.js +0 -1
- package/dist/client/assets/page-seo-sheet-ucnktWGv.js +0 -1
- package/dist/client/assets/record-editor-DYTfVRe6.js +0 -1
- package/dist/client/assets/registry-HTjMEx4d.js +0 -2
- package/dist/client/assets/save-referenced-block-Canw40SS.js +0 -1
- package/dist/client/assets/store-registry-BX6cxuJq.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DoglCZvJ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-hh4dm7oT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as D,j as s,a1 as le,r as K,p as ae,F as ce,f as de,g as me,B as Y,t as te,K as fe,a as ge,n as ie}from"./index-BxrNS_jM.js";import{i as ue}from"./AlertCircle-BmclRZ36.js";import{i as pe}from"./ChevronRight-DgGMjNQ2.js";import{s as xe}from"./Plus-bN4DDzHM.js";import{s as he}from"./Trash01-CVFvFDNw.js";import{I as X}from"./input-B_0hsonc.js";import{S as oe}from"./switch-BpPDo4WS.js";import{S as ye}from"./skeleton-DdaIW0fc.js";import{A as ne}from"./avatar-BJDY188d.js";import{P as je,a as Ce,b as Se}from"./popover-sjSahoqv.js";import{b as re}from"./use-connection-CBkuINe5.js";import{W as Z}from"./use-mcp-client-C031r2-Q.js";import{P as G}from"./index-Dg_mwh5q.js";import{u as ve}from"./use-registry-connections-CfQAHSyd.js";import{f as _e,g as be}from"./use-organization-settings-LtL_2oVQ.js";import{c as Pe,b as I,S as ee,a as Q}from"./settings-section-Y-F-fcr9.js";import{R as Re}from"./require-capability-kUwVwrRi.js";import"./User01-DN5mCg88.js";import"./use-collections-BvQz1-Ee.js";import"./auth-k-iFGlch.js";import"./sidebar-B48lsh1W.js";import"./LayoutLeft-BAEXcrIX.js";import"./tooltip-C3y7Q3JJ.js";import"./sheet-CrZDuw8F.js";import"./X-vxJbcFZu.js";import"./studio-tools-BzGW_qQX.js";import"./card-0NTlYEIG.js";import"./ArrowUpRight-DfyRpa7I.js";import"./use-capability-CdIgj6nz.js";import"./access-gate-Cjtt7v5f.js";import"./capability-load-error-D3Lo8p0_.js";function ke(t){const e=D.c(3),{error:o}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let n;return e[1]!==o.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",o.message]})]}),e[1]=o.message,e[2]=n):n=e[2],n}function we(t){const e=D.c(36),{onCancel:o,onSuccess:m}=t,n=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==n||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await n.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=n,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:Ne},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==o?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:o,disabled:d,children:"Cancel"}),e[19]=d,e[20]=o,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function Ne(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:o,description:m,icon:n,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==n||e[8]!==o?(c=n?s.jsx("img",{src:n,alt:o,className:"size-8 rounded-md object-contain"}):s.jsx(ne,{fallback:o.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=n,e[8]=o,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Me,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(oe,{checked:r,onClick:Ae,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==o||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:o,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=o,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ae(t){return t.stopPropagation()}function Me(t){return t.stopPropagation()}function Te(){const t=D.c(59),{org:e}=ae(),o=ve(),m=re(),n=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!n)return i===p;const w=n.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=o.find(i=>i.id===p),k=o.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=o.filter(i=>!B.has(i.id));let R;t[13]!==n||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=n??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=n,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const W=C;let U;t[20]!==n||t[21]!==r?(U=async i=>{S(!1);const w=n??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=n,t[21]=r,t[22]=U):U=t[22];const H=U,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==H||t[28]!==a?(T=a&&s.jsx(we,{onCancel:()=>S(!1),onSuccess:H}),t[27]=H,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let F;t[34]!==z||t[35]!==E?(F=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=F):F=t[36];let q;t[37]!==W||t[38]!==P||t[39]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>W(i.id)},i.id),t[37]=W,t[38]=P,t[39]=l,t[40]=q):q=t[40];const V=A.map(q);let $;t[41]!==F||t[42]!==V?($=s.jsxs(Q,{children:[F,V]}),t[41]=F,t[42]=V,t[43]=$):$=t[43],t[44]!==$||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,$]}),t[44]=$,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(ne,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(oe,{checked:!1,disabled:!0,onCheckedChange:ze})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function ze(){}function Ee(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(le,{fallback:Fe,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Te,{})]})})})})})}),t[1]=o):o=t[1],o}function Fe(t){const{error:e}=t;return s.jsx(ke,{error:e??new Error("Failed to load store settings")})}function gt(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Re,{capability:"registry:manage",area:"the store",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}export{gt as default};
|
|
1
|
+
import{e as D,j as s,a1 as le,r as K,p as ae,F as ce,f as de,g as me,B as Y,t as te,K as fe,a as ge,n as ie}from"./index-DtdRCqfT.js";import{i as ue}from"./AlertCircle-Bpe2_GvV.js";import{i as pe}from"./ChevronRight-zYXs_-Se.js";import{s as xe}from"./Plus-DP7MBDcr.js";import{s as he}from"./Trash01-DgUXWGZr.js";import{I as X}from"./input-C6eDTm2J.js";import{S as oe}from"./switch-BwuEbygk.js";import{S as ye}from"./skeleton-CQ4hZKKg.js";import{A as ne}from"./avatar-yh81kVts.js";import{P as je,a as Ce,b as Se}from"./popover-BZPKY_pJ.js";import{b as re}from"./use-connection-B-GnOxIe.js";import{W as Z}from"./use-mcp-client-00dhsiuh.js";import{P as G}from"./index-DK5BMExb.js";import{u as ve}from"./use-registry-connections-CnhucvHw.js";import{f as _e,g as be}from"./use-organization-settings-BwlURqPC.js";import{c as Pe,b as I,S as ee,a as Q}from"./settings-section-BjMM3sOA.js";import{R as Re}from"./require-capability-B4oR0b-_.js";import"./User01-B13x_3hK.js";import"./use-collections-CtQI9edu.js";import"./auth-JrxMRfm7.js";import"./sidebar-BvAh8pRK.js";import"./LayoutLeft-Bc24ivgh.js";import"./tooltip-D9vE3hJi.js";import"./sheet-CLn7Ee-B.js";import"./X-DUzDqibI.js";import"./studio-tools-C3pW43RI.js";import"./card-bh08sj3I.js";import"./ArrowUpRight-YrfJ1CbZ.js";import"./use-capability-BPH95vck.js";import"./access-gate-DHQsgThb.js";import"./capability-load-error-D8DXeudL.js";function ke(t){const e=D.c(3),{error:o}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let n;return e[1]!==o.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",o.message]})]}),e[1]=o.message,e[2]=n):n=e[2],n}function we(t){const e=D.c(36),{onCancel:o,onSuccess:m}=t,n=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==n||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await n.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=n,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:Ne},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==o?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:o,disabled:d,children:"Cancel"}),e[19]=d,e[20]=o,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function Ne(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:o,description:m,icon:n,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==n||e[8]!==o?(c=n?s.jsx("img",{src:n,alt:o,className:"size-8 rounded-md object-contain"}):s.jsx(ne,{fallback:o.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=n,e[8]=o,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Me,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(oe,{checked:r,onClick:Ae,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==o||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:o,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=o,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ae(t){return t.stopPropagation()}function Me(t){return t.stopPropagation()}function Te(){const t=D.c(59),{org:e}=ae(),o=ve(),m=re(),n=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!n)return i===p;const w=n.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=o.find(i=>i.id===p),k=o.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=o.filter(i=>!B.has(i.id));let R;t[13]!==n||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=n??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=n,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const W=C;let U;t[20]!==n||t[21]!==r?(U=async i=>{S(!1);const w=n??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=n,t[21]=r,t[22]=U):U=t[22];const H=U,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==H||t[28]!==a?(T=a&&s.jsx(we,{onCancel:()=>S(!1),onSuccess:H}),t[27]=H,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let F;t[34]!==z||t[35]!==E?(F=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=F):F=t[36];let q;t[37]!==W||t[38]!==P||t[39]!==l?(q=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>W(i.id)},i.id),t[37]=W,t[38]=P,t[39]=l,t[40]=q):q=t[40];const V=A.map(q);let $;t[41]!==F||t[42]!==V?($=s.jsxs(Q,{children:[F,V]}),t[41]=F,t[42]=V,t[43]=$):$=t[43],t[44]!==$||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,$]}),t[44]=$,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(ne,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(oe,{checked:!1,disabled:!0,onCheckedChange:ze})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function ze(){}function Ee(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(le,{fallback:Fe,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Te,{})]})})})})})}),t[1]=o):o=t[1],o}function Fe(t){const{error:e}=t;return s.jsx(ke,{error:e??new Error("Failed to load store settings")})}function gt(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Re,{capability:"registry:manage",area:"the store",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}export{gt as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-nx59aaeW.js","assets/index-DtdRCqfT.js","assets/index-D1gOoljU.css","assets/XCircle-CiWHFuXX.js","assets/CheckCircle-CYtqo8mv.js","assets/Settings02-BhiFsU64.js","assets/use-mcp-client-00dhsiuh.js","assets/auth-JrxMRfm7.js","assets/useInfiniteQuery-3nAveyVa.js","assets/use-infinite-scroll-tVsKkDwZ.js","assets/studio-tools-C3pW43RI.js","assets/badge-F_XnDxyE.js","assets/input-C6eDTm2J.js","assets/dropdown-menu-Bo5hgXOF.js","assets/ChevronUp-ZNXmTuIH.js","assets/ChevronRight-zYXs_-Se.js","assets/DotsVertical-BX13G9P1.js","assets/table-KwGxLknv.js","assets/toggle-group-DnKFPpga.js","assets/use-view-mode-BqCV5fdk.js","assets/tooltip-D9vE3hJi.js","assets/FilterLines-Ct0vyoCk.js","assets/Globe01-DqoZJREO.js","assets/SearchMd-BNtCiaDl.js","assets/dialog-B5Fc7PcC.js","assets/X-DUzDqibI.js","assets/AlertCircle-Bpe2_GvV.js","assets/Upload01-CRl35fVk.js","assets/alert-dialog-Iz7Pne8q.js","assets/card-bh08sj3I.js","assets/Trash01-DgUXWGZr.js","assets/label-CApOnzUS.js","assets/select-DViAZ6BX.js","assets/ChevronDown-Cs8E6-3E.js","assets/switch-BwuEbygk.js","assets/textarea-CgeTFjY8.js","assets/checkbox-xjeH3Wpr.js","assets/Eye-C5YGQqBB.js","assets/LinkExternal01-bw0rYexk.js","assets/use-copy-DkTFPjAl.js","assets/Key01-C9VOqBor.js","assets/Plus-DP7MBDcr.js","assets/mcp-oauth-topkfZ98.js","assets/Play-BYATnDqe.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{e as m,f as n,g as c,j as t,l as f,r as l,ak as p}from"./index-DtdRCqfT.js";import{R as u}from"./require-capability-B4oR0b-_.js";import"./use-capability-BPH95vck.js";import"./access-gate-DHQsgThb.js";import"./capability-load-error-D8DXeudL.js";const g=l.lazy(()=>p(()=>import("./registry-layout-nx59aaeW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as i,p as c}from"./index-
|
|
1
|
+
import{e as i,p as c}from"./index-DtdRCqfT.js";class l extends Error{constructor(r,s){super(r),this.status=s,this.name="StudioToolError"}status}async function u(o,r,s){const t=await fetch(`/api/${encodeURIComponent(o)}/tools/${encodeURIComponent(r)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s??{})});if(!t.ok){let e=`${r} failed (${t.status})`;try{const n=await t.json();n?.error&&(e=n.error)}catch{}throw new l(e,t.status)}return await t.json()}function p(){const o=i.c(5),{org:r}=c(),s=r.slug;let t;o[0]!==s?(t=(n,a)=>u(s,n,a),o[0]=s,o[1]=t):t=o[1];let e;return o[2]!==s||o[3]!==t?(e={orgSlug:s,call:t},o[2]=s,o[3]=t,o[4]=e):e=o[4],e}export{u as c,p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as i,P as C,V as y,_ as B,M as I,bH as M,bG as H,T as z,e as A,c as g}from"./index-
|
|
1
|
+
import{r as c,j as i,P as C,V as y,_ as B,M as I,bH as M,bG as H,T as z,e as A,c as g}from"./index-DtdRCqfT.js";var m="Switch",[U]=z(m),[q,L]=U(m),P=c.forwardRef((a,e)=>{const{__scopeSwitch:t,name:r,checked:s,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=a,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=B({prop:s,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:I(a.onClick,b=>{N(T=>!T),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(R,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});P.displayName=m;var E="SwitchThumb",_=c.forwardRef((a,e)=>{const{__scopeSwitch:t,...r}=a,s=L(E,t);return i.jsx(C.span,{"data-state":j(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});_.displayName=E;var O="SwitchBubbleInput",R=c.forwardRef(({__scopeSwitch:a,control:e,checked:t,bubbles:r=!0,...s},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:d,style:{...s.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});R.displayName=O;function j(a){return a?"checked":"unchecked"}var $=P,D=_;function G(a){const e=A.c(9);let t,r;e[0]!==a?({className:t,...r}=a,e[0]=a,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/20 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[2px] disabled:opacity-50",t),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==s?(o=i.jsx($,{"data-slot":"switch",className:s,...r,children:n}),e[6]=r,e[7]=s,e[8]=o):o=e[8],o}export{G as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c,c as i,j as r}from"./index-
|
|
1
|
+
import{e as c,c as i,j as r}from"./index-DtdRCqfT.js";function d(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("div",{"data-slot":"table-container",className:"w-full min-w-0 bg-card rounded-xl card-shadow overflow-hidden",children:r.jsx("table",{"data-slot":"table",className:s,...l})}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function f(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr]:border-b sticky top-0 z-10 bg-card",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("thead",{"data-slot":"table-header",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function b(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tbody",{"data-slot":"table-body",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function p(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("tr",{"data-slot":"table-row",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function m(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("th",{"data-slot":"table-head",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}function x(o){const e=c.c(8);let t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let s;e[3]!==t?(s=i("p-2 align-middle whitespace-nowrap text-sm [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==l||e[6]!==s?(a=r.jsx("td",{"data-slot":"table-cell",className:s,...l}),e[5]=l,e[6]=s,e[7]=a):a=e[7],a}export{x as T,p as a,b,d as c,f as d,m as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as v,j as d,b6 as M,P as p,M as T,b7 as y,T as P,ah as k,_ as S,ai as F,b8 as V,U as D,e as x,c as g}from"./index-DtdRCqfT.js";var m="Tabs",[G]=P(m,[y]),w=y(),[L,h]=G(m),C=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,onValueChange:r,defaultValue:s,orientation:o="horizontal",dir:i,activationMode:l="automatic",...f}=n,u=k(i),[c,b]=S({prop:t,onChange:r,defaultProp:s??"",caller:m});return d.jsx(L,{scope:a,baseId:F(),value:c,onValueChange:b,orientation:o,dir:u,activationMode:l,children:d.jsx(p.div,{dir:u,"data-orientation":o,...f,ref:e})})});C.displayName=m;var N="TabsList",_=v.forwardRef((n,e)=>{const{__scopeTabs:a,loop:t=!0,...r}=n,s=h(N,a),o=w(a);return d.jsx(V,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:t,children:d.jsx(p.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});_.displayName=N;var j="TabsTrigger",I=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,disabled:r=!1,...s}=n,o=h(j,a),i=w(a),l=E(o.baseId,t),f=$(o.baseId,t),u=t===o.value;return d.jsx(M,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":f,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:e,onMouseDown:T(n.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?o.onValueChange(t):c.preventDefault()}),onKeyDown:T(n.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&o.onValueChange(t)}),onFocus:T(n.onFocus,()=>{const c=o.activationMode!=="manual";!u&&!r&&c&&o.onValueChange(t)})})})});I.displayName=j;var R="TabsContent",A=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,forceMount:r,children:s,...o}=n,i=h(R,a),l=E(i.baseId,t),f=$(i.baseId,t),u=t===i.value,c=v.useRef(u);return v.useEffect(()=>{const b=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(D,{present:r||u,children:({present:b})=>d.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:f,tabIndex:0,...o,ref:e,style:{...n.style,animationDuration:c.current?"0s":void 0},children:b&&s})})});A.displayName=R;function E(n,e){return`${n}-trigger-${e}`}function $(n,e){return`${n}-content-${e}`}var z=C,K=_,B=I,q=A;function O(n){const e=x.c(10);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r===void 0?"pill":r;let o;e[4]!==a?(o=g("flex flex-col gap-2",a),e[4]=a,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==o||e[8]!==s?(i=d.jsx(z,{"data-slot":"tabs","data-variant":s,className:o,...t}),e[6]=t,e[7]=o,e[8]=s,e[9]=i):i=e[9],i}function U(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex h-[52px] items-center border-b border-border":s==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(K,{"data-slot":"tabs-list","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function J(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":s==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(B,{"data-slot":"tabs-trigger","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function Q(n){const e=x.c(8);let a,t;e[0]!==n?({className:a,...t}=n,e[0]=n,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let r;e[3]!==a?(r=g("flex-1 outline-none h-full",a),e[3]=a,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=d.jsx(q,{"data-slot":"tabs-content",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{J as T,U as a,Q as b,O as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as o}from"./AlertCircle-
|
|
1
|
+
import{i as o}from"./AlertCircle-Bpe2_GvV.js";import{i as t}from"./CheckCircle-CYtqo8mv.js";import{i as r}from"./DotsVertical-BX13G9P1.js";import{ad as a}from"./agent-icon-BvSYE4X0.js";import{l}from"./index-DtdRCqfT.js";import{i as n}from"./XCircle-CiWHFuXX.js";const i={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:o,iconClassName:"text-orange-500",labelColor:"text-orange-600 dark:text-orange-400"},failed:{label:"Failed",verb:"Something went wrong",icon:n,iconClassName:"text-red-500",labelColor:"text-red-600 dark:text-red-400"},expired:{label:"Timed out",verb:"Stopped responding",icon:a,iconClassName:"text-amber-500",labelColor:"text-amber-600 dark:text-amber-400"},in_progress:{label:"Running",verb:"Agent is working",icon:l,iconClassName:"text-blue-500",labelColor:"text-blue-600 dark:text-blue-400"},completed:{label:"Done",verb:"Completed",icon:t,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},m={label:"Unknown",verb:"Unknown status",icon:r,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function x(e){return i[e??"completed"]??m}export{i as S,x as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,c as l,j as n}from"./index-
|
|
1
|
+
import{e as o,c as l,j as n}from"./index-DtdRCqfT.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,_ as b,j as c,P as m,M as k,
|
|
1
|
+
import{r as x,_ as b,j as c,P as m,M as k,af as p,b6 as M,b7 as T,ah as S,b8 as A,T as F,bC as $,e as P,c as C}from"./index-DtdRCqfT.js";var j="Toggle",_=x.forwardRef((a,e)=>{const{pressed:l,defaultPressed:s,onPressedChange:n,...r}=a,[t,o]=b({prop:l,onChange:n,defaultProp:s??!1,caller:j});return c.jsx(m.button,{type:"button","aria-pressed":t,"data-state":t?"on":"off","data-disabled":a.disabled?"":void 0,...r,ref:e,onClick:k(a.onClick,()=>{a.disabled||o(!t)})})});_.displayName=j;var v="ToggleGroup",[w]=F(v,[T]),I=T(),h=p.forwardRef((a,e)=>{const{type:l,...s}=a;if(l==="single"){const n=s;return c.jsx(D,{...n,ref:e})}if(l==="multiple"){const n=s;return c.jsx(B,{...n,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${v}\``)});h.displayName=v;var[z,y]=w(v),D=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=b({prop:l,defaultProp:s??"",onChange:n,caller:v});return c.jsx(z,{scope:a.__scopeToggleGroup,type:"single",value:p.useMemo(()=>t?[t]:[],[t]),onItemActivate:o,onItemDeactivate:p.useCallback(()=>o(""),[o]),children:c.jsx(R,{...r,ref:e})})}),B=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=b({prop:l,defaultProp:s??[],onChange:n,caller:v}),i=p.useCallback(u=>o((g=[])=>[...g,u]),[o]),d=p.useCallback(u=>o((g=[])=>g.filter(V=>V!==u)),[o]);return c.jsx(z,{scope:a.__scopeToggleGroup,type:"multiple",value:t,onItemActivate:i,onItemDeactivate:d,children:c.jsx(R,{...r,ref:e})})});h.displayName=v;var[O,H]=w(v),R=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,disabled:s=!1,rovingFocus:n=!0,orientation:r,dir:t,loop:o=!0,...i}=a,d=I(l),u=S(t),g={role:"group",dir:u,...i};return c.jsx(O,{scope:l,rovingFocus:n,disabled:s,children:n?c.jsx(A,{asChild:!0,...d,orientation:r,dir:u,loop:o,children:c.jsx(m.div,{...g,ref:e})}):c.jsx(m.div,{...g,ref:e})})}),f="ToggleGroupItem",N=p.forwardRef((a,e)=>{const l=y(f,a.__scopeToggleGroup),s=H(f,a.__scopeToggleGroup),n=I(a.__scopeToggleGroup),r=l.value.includes(a.value),t=s.disabled||a.disabled,o={...a,pressed:r,disabled:t},i=p.useRef(null);return s.rovingFocus?c.jsx(M,{asChild:!0,...n,focusable:!t,active:r,ref:i,children:c.jsx(G,{...o,ref:e})}):c.jsx(G,{...o,ref:e})});N.displayName=f;var G=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,value:s,...n}=a,r=y(f,l),t={role:"radio","aria-checked":a.pressed,"aria-pressed":void 0},o=r.type==="single"?t:void 0;return c.jsx(_,{...o,...n,ref:e,onPressedChange:i=>{i?r.onItemActivate(s):r.onItemDeactivate(s)}})}),L=h,U=N;const q=$("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),E=x.createContext({size:"default",variant:"default"});function K(a){const e=P.c(20);let l,s,n,r,t;e[0]!==a?({className:s,variant:t,size:r,children:l,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);let o;e[6]!==s?(o=C("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),e[6]=s,e[7]=o):o=e[7];let i;e[8]!==r||e[9]!==t?(i={variant:t,size:r},e[8]=r,e[9]=t,e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==i?(d=c.jsx(E.Provider,{value:i,children:l}),e[11]=l,e[12]=i,e[13]=d):d=e[13];let u;return e[14]!==n||e[15]!==r||e[16]!==o||e[17]!==d||e[18]!==t?(u=c.jsx(L,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:o,...n,children:d}),e[14]=n,e[15]=r,e[16]=o,e[17]=d,e[18]=t,e[19]=u):u=e[19],u}function Q(a){const e=P.c(18);let l,s,n,r,t;e[0]!==a?({className:s,children:l,variant:t,size:r,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);const o=x.useContext(E),i=o.variant||t,d=o.size||r;let u;e[6]!==s||e[7]!==o.size||e[8]!==o.variant||e[9]!==r||e[10]!==t?(u=C(q({variant:o.variant||t,size:o.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),e[6]=s,e[7]=o.size,e[8]=o.variant,e[9]=r,e[10]=t,e[11]=u):u=e[11];let g;return e[12]!==l||e[13]!==n||e[14]!==i||e[15]!==d||e[16]!==u?(g=c.jsx(U,{"data-slot":"toggle-group-item","data-variant":i,"data-size":d,className:u,...n,children:l}),e[12]=l,e[13]=n,e[14]=i,e[15]=d,e[16]=u,e[17]=g):g=e[17],g}export{K as T,Q as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as i,c as p,j as r,r as d,g as N,aO as T,L as S,q as $,D as y}from"./index-
|
|
1
|
+
import{e as i,c as p,j as r,r as d,g as N,aO as T,L as S,q as $,D as y}from"./index-DtdRCqfT.js";import{n as w}from"./ChevronLeft-B-gfvsw1.js";import{i as C}from"./ChevronRight-zYXs_-Se.js";function j(t){const e=i.c(14);let s,o,l,n,c;e[0]!==t?({active:s,className:o,ref:n,type:c,...l}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=l,e[4]=n,e[5]=c):(s=e[1],o=e[2],l=e[3],n=e[4],c=e[5]);const f=c===void 0?"button":c,h=s?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let u;e[6]!==o||e[7]!==h?(u=p("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md transition-colors","max-md:[&_svg]:size-5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",h,o),e[6]=o,e[7]=h,e[8]=u):u=e[8];let g;return e[9]!==l||e[10]!==n||e[11]!==u||e[12]!==f?(g=r.jsx("button",{ref:n,type:f,className:u,...l}),e[9]=l,e[10]=n,e[11]=u,e[12]=f,e[13]=g):g=e[13],g}const k=d.createContext(null);function m(){const t=d.use(k);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function v(t){const e=i.c(8),{children:s}=t,[o,l]=d.useState(null),[n,c]=d.useState(null),[f,h]=d.useState(null),[u,g]=d.useState(null);let b;e[0]!==f||e[1]!==u||e[2]!==n||e[3]!==o?(b={togglesEl:o,setTogglesEl:l,tabsEl:n,setTabsEl:c,centerEl:f,setCenterEl:h,rightEl:u,setRightEl:g},e[0]=f,e[1]=u,e[2]=n,e[3]=o,e[4]=b):b=e[4];let x;return e[5]!==s||e[6]!==b?(x=r.jsx(k,{value:b,children:s}),e[5]=s,e[6]=b,e[7]=x):x=e[7],x}function a(t){const e=i.c(2),{children:s}=t;let o;return e[0]!==s?(o=r.jsx(v,{children:r.jsx("div",{className:"flex flex-col h-full min-h-0",children:s})}),e[0]=s,e[1]=o):o=e[1],o}function L(t){const e=i.c(10);let s,o,l;e[0]!==t?({children:s,className:o,...l}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=l):(s=e[1],o=e[2],l=e[3]);let n;e[4]!==o?(n=p("app-titlebar wco-drag shrink-0 grid grid-cols-3 items-center pl-1 pr-2 pt-0.25 h-12 bg-sidebar",o),e[4]=o,e[5]=n):n=e[5];let c;return e[6]!==s||e[7]!==l||e[8]!==n?(c=r.jsx("div",{className:n,...l,children:s}),e[6]=s,e[7]=l,e[8]=n,e[9]=c):c=e[9],c}function _(t){const e=i.c(2),{children:s}=t;let o;return e[0]!==s?(o=r.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=o):o=e[1],o}function R(t){const e=i.c(2),{children:s}=t;let o;return e[0]!==s?(o=r.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=o):o=e[1],o}function z(){const t=i.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(j,{onClick:G,"aria-label":"Go back",title:"Go back",children:r.jsx(w,{size:16})}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsxs(r.Fragment,{children:[e,r.jsx(j,{onClick:P,"aria-label":"Go forward",title:"Go forward",children:r.jsx(C,{size:16})})]}),t[1]=s):s=t[1],s}function P(){return window.history.forward()}function G(){return window.history.back()}function B(){const t=i.c(7),s=$().logo??y,o=typeof s=="string"?s:s.light,l=typeof s=="string"?s:s.dark;let n;t[0]!==o?(n=r.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=n):n=t[1];let c;t[2]!==l?(c=r.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=l,t[3]=c):c=t[3];let f;return t[4]!==n||t[5]!==c?(f=r.jsxs("span",{className:"wco-hide flex items-center shrink-0 px-2",children:[n,c]}),t[4]=n,t[5]=c,t[6]=f):f=t[6],f}function E(){const t=i.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(d.Suspense,{fallback:r.jsx("span",{className:"wco-hide shrink-0 size-6 mx-2"}),children:r.jsx(B,{})}),t[0]=e):e=t[0],e}function D(){const t=i.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org"},t[0]=e):e=t[0];const{org:s}=N(e);let o;t[1]!==s?(o={org:s},t[1]=s,t[2]=o):o=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx(E,{}),t[3]=l):l=t[3];let n;return t[4]!==o?(n=r.jsx(S,{to:"/$org",params:o,"aria-label":"Back to home",title:"Back to home",className:"wco-no-drag flex items-center shrink-0 cursor-pointer pl-1",children:l}),t[4]=o,t[5]=n):n=t[5],n}function I(){const t=i.c(2),{setCenterEl:e}=m();let s;return t[0]!==e?(s=r.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function O(t){const e=i.c(3),{children:s}=t,{centerEl:o}=m();if(!o)return null;let l;return e[0]!==o||e[1]!==s?(l=T.createPortal(s,o),e[0]=o,e[1]=s,e[2]=l):l=e[2],l}function F(t){const e=i.c(5),{className:s}=t,{setTabsEl:o}=m();let l;e[0]!==s?(l=p("shrink-0 flex items-center",s),e[0]=s,e[1]=l):l=e[1];let n;return e[2]!==o||e[3]!==l?(n=r.jsx("div",{ref:o,className:l}),e[2]=o,e[3]=l,e[4]=n):n=e[4],n}function H(t){const e=i.c(3),{children:s}=t,{tabsEl:o}=m();if(!o)return null;let l;return e[0]!==s||e[1]!==o?(l=T.createPortal(s,o),e[0]=s,e[1]=o,e[2]=l):l=e[2],l}function q(t){const e=i.c(5),{className:s}=t,{setTogglesEl:o}=m();let l;e[0]!==s?(l=p("contents",s),e[0]=s,e[1]=l):l=e[1];let n;return e[2]!==o||e[3]!==l?(n=r.jsx("div",{ref:o,className:l}),e[2]=o,e[3]=l,e[4]=n):n=e[4],n}function A(t){const e=i.c(3),{children:s}=t,{togglesEl:o}=m();if(!o)return null;let l;return e[0]!==s||e[1]!==o?(l=T.createPortal(s,o),e[0]=s,e[1]=o,e[2]=l):l=e[2],l}function U(){const t=i.c(2),{setRightEl:e}=m();let s;return t[0]!==e?(s=r.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}function J(t){const e=i.c(3),{children:s}=t,{rightEl:o}=m();if(!o)return null;let l;return e[0]!==s||e[1]!==o?(l=T.createPortal(s,o),e[0]=s,e[1]=o,e[2]=l):l=e[2],l}a.Provider=v;a.Header=L;a.LeftColumn=_;a.RightColumn=R;a.Nav=z;a.Logo=E;a.LogoLink=D;a.CenterSlot=I;a.Center=O;a.TabsSlot=F;a.Tabs=H;a.TogglesSlot=q;a.Toggles=A;a.RightSlot=U;a.Right=J;export{j as T,a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as c,P as H,
|
|
1
|
+
import{r as a,j as c,P as H,ai as Z,_ as ee,$ as te,V as $,J as oe,M as C,U as G,Z as re,Q as V,W as ne,X as se,T as ae,dB as ie,Y as le,e as _,c as ce}from"./index-DtdRCqfT.js";var ue=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",B=a.forwardRef((o,e)=>c.jsx(H.span,{...o,ref:e,style:{...ue,...o.style}}));B.displayName=de;var pe=B,[O]=ae("Tooltip",[V]),D=V(),z="TooltipProvider",fe=700,A="tooltip.open",[ve,k]=O(z),F=o=>{const{__scopeTooltip:e,delayDuration:t=fe,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,i=a.useRef(!0),d=a.useRef(!1),l=a.useRef(0);return a.useEffect(()=>{const p=l.current;return()=>window.clearTimeout(p)},[]),c.jsx(ve,{scope:e,isOpenDelayedRef:i,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};F.displayName=z;var R="Tooltip",[he,j]=O(R),Y=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:i,delayDuration:d}=o,l=k(R,o.__scopeTooltip),p=D(e),[u,v]=a.useState(null),h=Z(),f=a.useRef(0),x=i??l.disableHoverableContent,m=d??l.delayDuration,g=a.useRef(!1),[y,T]=ee({prop:r,defaultProp:n??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(A))):l.onClose(),s?.(S)},caller:R}),w=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,T(!0)},[T]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),N=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,T(!0),f.current=0},m)},[m,T]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(te,{...p,children:c.jsx(he,{scope:e,contentId:h,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{l.isOpenDelayedRef.current?N():E()},[l.isOpenDelayedRef,N,E]),onTriggerLeave:a.useCallback(()=>{x?P():(window.clearTimeout(f.current),f.current=0)},[P,x]),onOpen:E,onClose:P,disableHoverableContent:x,children:t})})};Y.displayName=R;var M="TooltipTrigger",U=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=j(M,t),s=k(M,t),i=D(t),d=a.useRef(null),l=$(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(oe,{asChild:!0,...i,children:c.jsx(H.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:l,onPointerMove:C(o.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});U.displayName=M;var I="TooltipPortal",[xe,ge]=O(I,{forceMount:void 0}),W=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=j(I,e);return c.jsx(xe,{scope:e,forceMount:t,children:c.jsx(G,{present:t||s.open,children:c.jsx(re,{asChild:!0,container:n,children:r})})})};W.displayName=I;var b="TooltipContent",q=a.forwardRef((o,e)=>{const t=ge(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,i=j(b,o.__scopeTooltip);return c.jsx(G,{present:r||i.open,children:i.disableHoverableContent?c.jsx(X,{side:n,...s,ref:e}):c.jsx(me,{side:n,...s,ref:e})})}),me=a.forwardRef((o,e)=>{const t=j(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=a.useRef(null),s=$(e,n),[i,d]=a.useState(null),{trigger:l,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,h=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((x,m)=>{const g=x.currentTarget,y={x:x.clientX,y:x.clientY},T=be(y,g.getBoundingClientRect()),w=we(y,T),E=Ee(m.getBoundingClientRect()),P=Re([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(l&&u){const x=g=>f(g,u),m=g=>f(g,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",m)}}},[l,u,f,h]),a.useEffect(()=>{if(i){const x=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},T=l?.contains(g)||u?.contains(g),w=!Pe(y,i);T?h():w&&(h(),p())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,i,p,h]),c.jsx(X,{...o,ref:s})}),[Te,ye]=O(R,{isInside:!1}),Ce=ie("TooltipContent"),X=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:i,...d}=o,l=j(b,t),p=D(t),{onClose:u}=l;return a.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),a.useEffect(()=>{if(l.trigger){const v=h=>{h.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[l.trigger,u]),c.jsx(ne,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(se,{"data-state":l.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Ce,{children:r}),c.jsx(Te,{scope:t,isInside:!0,children:c.jsx(pe,{id:l.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=b;var K="TooltipArrow",J=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return ye(K,t).isInside?null:c.jsx(le,{...n,...r,ref:e})});J.displayName=K;function be(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function we(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function Ee(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function Pe(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const d=e[s],l=e[i],p=d.x,u=d.y,v=l.x,h=l.y;u>r!=h>r&&t<(v-p)*(r-u)/(h-u)+p&&(n=!n)}return n}function Re(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),_e(e)}function _e(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(n.y-i.y)>=(s.y-i.y)*(n.x-i.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(n.y-i.y)>=(s.y-i.y)*(n.x-i.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var je=F,Oe=Y,De=U,Le=W,Ae=q,Me=J;const Q=768,L=()=>globalThis.innerWidth<Q;function Ne(){const o=_.c(2),[e,t]=a.useState(L);let r,n;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const s=()=>t(L),i=globalThis.matchMedia(`(max-width: ${Q-1}px)`);return i.addEventListener("change",s),t(L),()=>i.removeEventListener("change",s)},n=[],o[0]=r,o[1]=n):(r=o[0],n=o[1]),a.useEffect(r,n),e}function ke(o){const e=_.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(je,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Se(o){const e=_.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(ke,{children:c.jsx(Oe,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function He(o){const e=_.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(De,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function $e(o){const e=_.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const i=s===void 0?0:s;let d;e[5]!==r?(d=ce("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(Me,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=l):l=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==i||e[11]!==d?(p=c.jsx(Le,{children:c.jsxs(Ae,{"data-slot":"tooltip-content",sideOffset:i,className:d,...n,children:[t,l]})}),e[8]=t,e[9]=n,e[10]=i,e[11]=d,e[12]=p):p=e[12],p}export{He as T,ue as V,$e as a,Se as b,ke as c,Ne as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bh as p,bi as t,aD as y,v as a,c3 as q,s,aE as f,aB as u,aj as m,b2 as x,bf as O,c4 as fe,c5 as ge,c6 as B,c7 as j,c8 as be,c9 as ye,ca as $,cb as Se,cc as _e,cd as He,ce as Me,cf as ke,cg as Pe,ch as qe,ci as Te,bt as Ie,cj as Ee,ck as Le,cl as ze,cm as De,cn as Ae,co as Ue,cp as Ne,bs as Oe,r as te,e as V,j as b,cq as je,cr as Be,t as $e,c as oe}from"./index-
|
|
1
|
+
import{bh as p,bi as t,aD as y,v as a,c3 as q,s,aE as f,aB as u,aj as m,b2 as x,bf as O,c4 as fe,c5 as ge,c6 as B,c7 as j,c8 as be,c9 as ye,ca as $,cb as Se,cc as _e,cd as He,ce as Me,cf as ke,cg as Pe,ch as qe,ci as Te,bt as Ie,cj as Ee,ck as Le,cl as ze,cm as De,cn as Ae,co as Ue,cp as Ne,bs as Oe,r as te,e as V,j as b,cq as je,cr as Be,t as $e,c as oe}from"./index-DtdRCqfT.js";import{P as Ve}from"./use-mcp-client-00dhsiuh.js";const le=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Fe(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${Ke(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,l=r.match(n);if(l){const g=(l.index??0)+l[0].length;return r.slice(0,g)+`
|
|
2
2
|
`+i+r.slice(g)}const c=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,d=r.match(c);if(d){const g=(d.index??0)+d[0].length;return r.slice(0,g)+`
|
|
3
3
|
<head>
|
|
4
4
|
`+i+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,p as f,
|
|
1
|
+
import{e as d,p as f,a5 as P,K as m,m as K}from"./index-DtdRCqfT.js";import{u as S,c as T}from"./studio-tools-C3pW43RI.js";function g(s,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await T(s,"AI_PROVIDER_KEY_LIST",{})}}function E(){const s=d.c(7),{org:e}=f(),o=S();let i;s[0]!==e.id?(i=m.aiProviders(e.id),s[0]=e.id,s[1]=i):i=s[1];let t;s[2]!==o?(t=async()=>await o.call("AI_PROVIDERS_LIST",{}),s[2]=o,s[3]=t):t=s[3];let l;s[4]!==i||s[5]!==t?(l={queryKey:i,staleTime:1/0,queryFn:t},s[4]=i,s[5]=t,s[6]=l):l=s[6];const{data:r}=P(l);return r}function R(){const s=d.c(5),{org:e}=f();let o;s[0]!==e.id||s[1]!==e.slug?(o=g(e.slug,e.id),s[0]=e.id,s[1]=e.slug,s[2]=o):o=s[2];const{data:i}=P(o);let t;return s[3]!==i?.keys?(t=i?.keys??[],s[3]=i?.keys,s[4]=t):t=s[4],t}function q(s){const e=d.c(15),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s??""),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];const l=!!s;let r;e[3]!==s||e[4]!==i?(r=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s??""}),e[3]=s,e[4]=i,e[5]=r):r=e[5];let a;e[6]!==t||e[7]!==l||e[8]!==r?(a={queryKey:t,enabled:l,staleTime:6e4,queryFn:r},e[6]=t,e[7]=l,e[8]=r,e[9]=a):a=e[9];const{data:n,isLoading:_}=K(a);let u;e[10]!==n?.models?(u=n?.models??[],e[10]=n?.models,e[11]=u):u=e[11];const y=!!s&&_;let c;return e[12]!==u||e[13]!==y?(c={models:u,isLoading:y},e[12]=u,e[13]=y,e[14]=c):c=e[14],c}function A(s){const e=d.c(11),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];let l;e[3]!==s||e[4]!==i?(l=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let r;e[6]!==t||e[7]!==l?(r={queryKey:t,staleTime:6e4,queryFn:l},e[6]=t,e[7]=l,e[8]=r):r=e[8];const{data:a}=P(r);let n;return e[9]!==a?.models?(n=a?.models??[],e[9]=a?.models,e[10]=n):n=e[10],n}export{g as a,q as b,E as c,A as d,R as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as U,p as q,K as T,m as I,F as x,a as y,n as m}from"./index-
|
|
1
|
+
import{e as U,p as q,K as T,m as I,F as x,a as y,n as m}from"./index-DtdRCqfT.js";import{S as z,u as J}from"./use-mcp-client-00dhsiuh.js";import{u as Q}from"./studio-tools-C3pW43RI.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],I(r)}function it(t){const e=U.c(9),{org:s}=q(),l=Q();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function ot(t){const e=U.c(10),{org:s}=q(),l=Q();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function at(t,e){const s=U.c(12),{org:l}=q(),a=Q();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],I(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=U.c(64),{org:e}=q(),s=Q(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let p;t[13]!==s?(p=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=p):p=t[14];let A;t[15]!==i||t[16]!==o?(A=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=A):A=t[17];let G;t[18]!==p||t[19]!==A?(G={mutationFn:p,onSuccess:A,onError:W},t[18]=p,t[19]=A,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as u,p as m,m as g,K as p}from"./index-
|
|
1
|
+
import{e as u,p as m,m as g,K as p}from"./index-DtdRCqfT.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let o;e[0]!==c?(o=p.myCapabilities(c),e[0]=c,e[1]=o):o=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==o||e[5]!==a?(i={queryKey:o,queryFn:a,staleTime:3e4,retry:2},e[4]=o,e[5]=a,e[6]=i):i=e[6];const{data:s,isLoading:l,isError:n}=g(i);let t;return e[7]!==s||e[8]!==n||e[9]!==l?(t={data:s,loading:l,error:n},e[7]=s,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:o,error:a}=d();if(o){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const s=c?.capabilities?.[e]===!0,l=s?"role":"denied";let n;return r[5]!==s||r[6]!==l?(n={granted:s,loading:!1,error:!1,reason:l},r[5]=s,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:o}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const s=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:o,isPrivileged:s,roleSlug:a},e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a}from"./differenceInSeconds-NQ4PDo0z.js";import{e as u,r as f}from"./index-
|
|
1
|
+
import{d as a}from"./differenceInSeconds-NQ4PDo0z.js";import{e as u,r as f}from"./index-DtdRCqfT.js";function p(r){const t=a(new Date,r);return t<60?"<1m":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:t<604800?`${Math.floor(t/86400)}d ago`:t<2592e3?`${Math.floor(t/604800)}w ago`:t<31536e3?`${Math.floor(t/2592e3)}mo ago`:`${Math.floor(t/31536e3)}y ago`}function g(r){if(r==null||r==="")return null;const t=r instanceof Date?r.getTime():Date.parse(r);return Number.isFinite(t)?t:null}function h(r,t){const e=t-r;return e>0?e:0}function M(r){if(r<60)return`${r.toFixed(1)}s`;const t=Math.round(r%60*10)/10,e=t>=60?1:0;return`${Math.floor(r/60)+e}m ${(e?0:t).toFixed(1)}s`}const s=new Map;function i(r){let t=s.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},s.set(r,t)),t}function l(r,t){const e=i(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const n of e.subscribers)n()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function $(r){const t=u.c(3),e=r===void 0?6e4:r;let n,o;return t[0]!==e?(n=c=>l(e,c),o=()=>i(e).tick,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),f.useSyncExternalStore(n,o,m)}function m(){return 0}export{M as a,h as c,p as f,g as t,$ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a5 as v,e as x,F as b,a as A,aI as q,n as _}from"./index-DtdRCqfT.js";function Q(e,s,o){const t=[];if(e?.trim()){const n=e.trim(),r=o.map(a=>({field:[String(a)],operator:"contains",value:n}));r.length===1&&r[0]?t.push(r[0]):r.length>1&&t.push({operator:"or",conditions:r})}if(s&&s.length>0)for(const n of s)t.push({field:[n.column],operator:"eq",value:n.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function k(e,s,o){const t=e??o,n=s??"desc";return[{field:[String(t)],direction:n}]}function O(e){if(!e||typeof e!="object")throw new Error("Invalid result");if("isError"in e&&e.isError)throw new Error("content"in e&&Array.isArray(e.content)&&e.content[0]?.type==="text"?e.content[0].text:"Unknown error");if("structuredContent"in e)return e.structuredContent;throw new Error("No structured content found")}function D(e,s,o,t){const n=s.toUpperCase(),r=`COLLECTION_${n}_GET`;return{queryKey:q.collectionItem(t,e,"",n,o??""),queryFn:async()=>{if(!o)return{item:null};const a=await t.callTool({name:r,arguments:{id:o}});return O(a)},staleTime:6e4}}function j(e,s,o,t){const n=x.c(5);let r;n[0]!==t||n[1]!==s||n[2]!==o||n[3]!==e?(r=D(e,s,o,t),n[0]=t,n[1]=s,n[2]=o,n[3]=e,n[4]=r):r=n[4];const{data:a}=v(r);return a?.item??null}const K={structuredContent:{items:[]},isError:!1};function z(e,s,o,t={}){const{searchTerm:n,filters:r,sortKey:a,sortDirection:L,searchFields:S=["title","description"],defaultSortKey:h="updated_at",pageSize:g=100,additionalToolArgs:c}=t,l=s.toUpperCase(),f=`COLLECTION_${l}_LIST`,p=Q(n,r,S),T=k(a,L,h),u={...p&&{where:p},...T&&{orderBy:T},limit:g,offset:0,...c},m=JSON.stringify(u),C=q.collectionList(o,e,"",l,m),{data:w}=v({queryKey:C,queryFn:async()=>o?await o.callTool({name:f,arguments:u}):K,staleTime:3e4,retry:!1,select:d=>O(d??{})?.items??[]});return w}function G(e,s,o){const t=x.c(34),n=b();let r;t[0]!==s?(r=s.toUpperCase(),t[0]=s,t[1]=r):r=t[1];const a=r,L=`COLLECTION_${a}_CREATE`,S=`COLLECTION_${a}_UPDATE`,h=`COLLECTION_${a}_DELETE`;let g;t[2]!==n||t[3]!==e||t[4]!==a?(g=()=>{n.invalidateQueries({predicate:E=>{const i=E.queryKey;return i[1]===e&&i[3]==="collection"&&i[4]===a}})},t[2]=n,t[3]=e,t[4]=a,t[5]=g):g=t[5];const c=g;let l;t[6]!==o||t[7]!==L?(l=async E=>{const i=await o.callTool({name:L,arguments:{data:E}});if(i.isError)throw new Error(Array.isArray(i.content)?i.content[0]?.text:String(i.content));return O(i).item},t[6]=o,t[7]=L,t[8]=l):l=t[8];let f;t[9]!==c?(f=()=>{c(),_.success("Item created successfully")},t[9]=c,t[10]=f):f=t[10];let p;t[11]!==l||t[12]!==f?(p={mutationFn:l,onSuccess:f,onError:B},t[11]=l,t[12]=f,t[13]=p):p=t[13];const T=A(p);let u;t[14]!==o||t[15]!==S?(u=async E=>{const{id:i,data:$}=E,U=await o.callTool({name:S,arguments:{id:i,data:$}});return O(U).item},t[14]=o,t[15]=S,t[16]=u):u=t[16];let m;t[17]!==c?(m=()=>{c(),_.success("Item updated successfully")},t[17]=c,t[18]=m):m=t[18];let C;t[19]!==u||t[20]!==m?(C={mutationFn:u,onSuccess:m,onError:R},t[19]=u,t[20]=m,t[21]=C):C=t[21];const w=A(C);let d;t[22]!==o||t[23]!==h?(d=async E=>{const i=await o.callTool({name:h,arguments:{id:E}});return O(i).item.id},t[22]=o,t[23]=h,t[24]=d):d=t[24];let y;t[25]!==c?(y=()=>{c(),_.success("Item deleted successfully")},t[25]=c,t[26]=y):y=t[26];let I;t[27]!==d||t[28]!==y?(I={mutationFn:d,onSuccess:y,onError:P},t[27]=d,t[28]=y,t[29]=I):I=t[29];const F=A(I);let N;return t[30]!==T||t[31]!==F||t[32]!==w?(N={create:T,update:w,delete:F},t[30]=T,t[31]=F,t[32]=w,t[33]=N):N=t[33],N}function P(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to delete item: ${s}`)}function R(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to update item: ${s}`)}function B(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to create item: ${s}`)}export{G as a,z as b,D as c,j as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as f,p as C}from"./index-
|
|
1
|
+
import{e as f,p as C}from"./index-DtdRCqfT.js";import{a as N,b as O,u as S}from"./use-collections-CtQI9edu.js";import{S as I,u as p}from"./use-mcp-client-00dhsiuh.js";function E(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const m=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=p(a);return O(u.id,"CONNECTIONS",A,m)}function _(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=p(n);return S(i.id,"CONNECTIONS",t,l)}function x(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=p(i);return N(o.id,"CONNECTIONS",n)}export{_ as a,x as b,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c,r as n}from"./index-
|
|
1
|
+
import{e as c,r as n}from"./index-DtdRCqfT.js";function p(){const e=c.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async i=>{await navigator.clipboard.writeText(i),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
|
package/dist/client/assets/{use-create-virtual-mcp-CoINGCk3.js → use-create-virtual-mcp-BpdjItaW.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as g}from"./index-
|
|
1
|
+
import{e as g}from"./index-DtdRCqfT.js";import{b as f}from"./use-virtual-mcp-BDx6BF9u.js";import{m}from"./use-navigate-to-agent-CjuQTsVF.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,r=u===void 0?!1:u,t=f(),c=m();let s;e[2]!==t.create||e[3]!==r||e[4]!==c?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return r&&c(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=r,e[4]=c,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
|
package/dist/client/assets/{use-debounced-autosave-BYr4wRK_.js → use-debounced-autosave-DmyGwJEl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u}from"./index-
|
|
1
|
+
import{r as u}from"./index-DtdRCqfT.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as Se,b as en,u as un,x as pn,w as mn,j as e,B as J,n as X,r as le,F as hn,f as fn,l as ke,t as N,K as me,e as gn,o as xn,a2 as jn,c as yn,m as vn}from"./index-BxrNS_jM.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-DubGHynt.js";import{C as wn}from"./collection-search-wS84Uw7R.js";import{C as bn}from"./collection-tabs-CrXzE-CP.js";import{g as kn,a as Nn,e as Sn,b as In}from"./extract-connection-data-yrZbGAUI.js";import{d as on,c as sn,D as an,a as cn,b as An,e as Tn}from"./dialog-Bep6tMMx.js";import{D as Dn,a as Pn,c as Fn,b as On,d as Mn,e as Vn,f as $n}from"./drawer-Col1fd6y.js";import{u as En,b as Be,T as Re,a as ze}from"./tooltip-C3y7Q3JJ.js";import{F as V,b as $,c as E,d as L,f as B,a as Qe}from"./form-DV7xSonM.js";import{I as Y}from"./input-B_0hsonc.js";import{d as Ln,b as Bn,c as Rn,S as zn,a as pe}from"./select-DZ51rSQd.js";import{T as Hn}from"./textarea-C2QWkbxj.js";import{b as rn}from"./use-connection-CBkuINe5.js";import{n as Ne,c as He}from"./XCircle-3mnhYuh7.js";import{s as Ke}from"./Star01-N3VFSdvZ.js";import{Y as Kn}from"./agent-icon-CHsmfzrp.js";import{s as Un}from"./XClose-BWmveN5G.js";import{c as Xn,i as we,a as We,E as qn,p as Gn,b as Qn,d as Wn}from"./connection-form-helpers-Cc2oyq0i.js";import{u as Ye}from"./use-infinite-scroll-gEtDbhxZ.js";import{u as Yn}from"./useSuspenseInfiniteQuery-hh4dm7oT.js";import{c as Jn,u as Zn}from"./use-mcp-client-C031r2-Q.js";import{i as Ue,a as Xe}from"./mcp-oauth-DLVO5G51.js";import{B as be}from"./badge-CFlBAGVs.js";import{i as Je}from"./ChevronUp-ssLglSfS.js";import{s as et}from"./Plus-bN4DDzHM.js";import{u as nt}from"./studio-tools-BzGW_qQX.js";import{u as tt}from"./use-ai-providers-DhsmmwNY.js";function ot(o){const n=o?.metadata?.githubRepo;return n?n.connectionId?o?.connections?.some(f=>f.connection_id===n.connectionId)?n:null:n:null}function zt(o){if(typeof o!="object"||o===null)return!1;const h=o.githubRepo?.url;return typeof h=="string"&&h.length>0}function st(o){return!!ot(o??null)?.connectionId}function Ht(o){return st(o)}function Kt(o){const n=new Set;for(const h of o??[]){const f=h.metadata?.liveAgentId;typeof f=="string"&&f&&n.add(h.id)}return n}function Ut(o){const n=new Map,h=new Map;for(const f of o??[]){const p=f.metadata?.liveAgentId;typeof p=="string"&&p&&(h.set(f.id,p),n.set(p,f.id))}return{liveToDev:n,devToLive:h}}function Xt(o,n){if(!o)return null;const h=o.metadata?.liveAgentId;if(typeof h=="string"&&h)return{mode:"dev",targetId:h};const f=(n??[]).find(p=>p.metadata?.liveAgentId===o.id);return f?{mode:"live",targetId:f.id}:null}function qt(o){return o.online?o.capabilities.includes("claude-code")||o.capabilities.includes("codex"):!1}function it({open:o,onOpenChange:n,onCreated:h}){const{org:f}=Se(),{data:p}=en.useSession(),{stdioEnabled:D}=un(),P=En(),R=rn(),d=nn(),z=tn(d,"").items,i=pn({resolver:mn(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:[]}}),y=i.watch("ui_type"),S=i.watch("connection_url"),M=i.watch("npx_package"),j=we({uiType:y,connectionUrl:S??"",npxPackage:M??""})??We({uiType:y,connectionUrl:S??"",registryItems:z}),l=s=>{const t=s.trim();if(!t)return;const c=!!i.formState.dirtyFields.title,v=!!i.formState.dirtyFields.description,_=!!i.formState.dirtyFields.env_vars,r=x=>{if(x&&(!c&&!i.getValues("title").trim()&&x.title&&i.setValue("title",x.title,{shouldDirty:!1}),!v&&!(i.getValues("description")??"").trim()&&x.description&&i.setValue("description",x.description,{shouldDirty:!1}),!_&&x.envVarKeys?.length)){const A=i.getValues("env_vars")??[],C=new Set(A.map(k=>k.key)),w=x.envVarKeys.filter(k=>!C.has(k));w.length>0&&i.setValue("env_vars",[...A,...w.map(k=>({key:k,value:""}))],{shouldDirty:!0})}},u=Gn(t);if(u&&D){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",u.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),r(we({uiType:"NPX",npxPackage:u.packageName}));return}if(t.startsWith("http://")||t.startsWith("https://")){const x=y==="HTTP"||y==="SSE"||y==="Websocket"?y:"HTTP";i.setValue("ui_type",x,{shouldDirty:!0}),i.setValue("connection_url",t,{shouldDirty:!0}),r(we({uiType:x,connectionUrl:t})??We({uiType:x,connectionUrl:t,registryItems:z}));return}y==="NPX"&&r(we({uiType:"NPX",npxPackage:t}))},H=s=>{s||i.reset(),n(s)},g=async s=>{let t,c=null,v=null,_=null;s.ui_type==="NPX"?(t="STDIO",c="",_=Qn(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(t="STDIO",c="",_=Wn(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(t=s.ui_type,c=s.connection_url||"",v=s.connection_token||null);const r=kn("conn");try{await R.create.mutateAsync({id:r,title:s.title,description:s.description||null,connection_type:t,connection_url:c,connection_token:v,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:s.icon??null,app_name:null,app_id:null,connection_headers:_,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),i.reset(),n(!1),h?.(r)}catch{X.error("Failed to create connection")}},F="Create Connection",I="Create a custom connection in your organization. Fill in the details below.",q=i.formState.isSubmitting?"Saving...":"Create Connection",K=e.jsxs("div",{className:"grid gap-4",children:[e.jsx(V,{control:i.control,name:"ui_type",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Type *"}),e.jsxs(Ln,{value:s.value,onValueChange:s.onChange,children:[e.jsx(L,{children:e.jsx(Bn,{children:e.jsx(Rn,{})})}),e.jsxs(zn,{children:[e.jsx(pe,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(pe,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(pe,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4"}),"Websocket"]})}),D&&e.jsxs(e.Fragment,{children:[e.jsx(pe,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ne,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(pe,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Kn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(B,{})]})}),y==="NPX"&&e.jsx(V,{control:i.control,name:"npx_package",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"NPM Package *"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"@perplexity-ai/mcp-server",...s,value:s.value??"",onPaste:t=>{const c=t.clipboardData.getData("text");c&&(t.preventDefault(),i.setValue("npx_package",c.trim(),{shouldDirty:!0}),l(c))},onBlur:t=>{l(t.target.value),s.onBlur()}})}),e.jsx(B,{})]})}),y==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(V,{control:i.control,name:"stdio_command",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Command *"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"node, bun, python...",...s,value:s.value??""})}),e.jsx(B,{})]})}),e.jsx(V,{control:i.control,name:"stdio_args",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Arguments"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"arg1 arg2 --flag value",...s,value:s.value??""})}),e.jsx(B,{})]})})]}),e.jsx(V,{control:i.control,name:"stdio_cwd",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Working Directory"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"/path/to/project (optional)",...s,value:s.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(B,{})]})})]}),(y==="NPX"||y==="STDIO")&&e.jsx(V,{control:i.control,name:"env_vars",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Environment Variables"}),e.jsx(L,{children:e.jsx(qn,{value:s.value??[],onChange:s.onChange})}),e.jsx(B,{})]})}),y!=="NPX"&&y!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(V,{control:i.control,name:"connection_url",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"URL *"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"https://example.com/mcp",...s,value:s.value??"",onPaste:t=>{const c=t.clipboardData.getData("text");c&&(t.preventDefault(),i.setValue("connection_url",c.trim(),{shouldDirty:!0}),l(c))},onBlur:t=>{l(t.target.value),s.onBlur()}})}),e.jsx(B,{})]})}),e.jsx(V,{control:i.control,name:"connection_token",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:j?.token?.label??"Token (optional)"}),e.jsx(L,{children:e.jsx(Y,{type:"password",placeholder:j?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...s,value:s.value??""})}),j?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.token.helperText,j.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(B,{})]})})]}),e.jsx(V,{control:i.control,name:"title",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Name *"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"My Connection",...s})}),e.jsx(B,{})]})}),e.jsx(V,{control:i.control,name:"description",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Description"}),e.jsx(L,{children:e.jsx(Hn,{placeholder:"A brief description of this connection",rows:3,...s,value:s.value??""})}),e.jsx(B,{})]})})]});return P?e.jsx(Dn,{open:o,onOpenChange:H,children:e.jsxs(Pn,{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(On,{children:F}),e.jsx(Mn,{className:"mt-1",children:I})]}),e.jsx(Vn,{asChild:!0,children:e.jsx(J,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:e.jsx(Un,{size:16})})})]})}),e.jsx(Qe,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(g),children:[e.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:K}),e.jsx($n,{children:e.jsx(J,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:q})})]})})]})}):e.jsx(on,{open:o,onOpenChange:H,children:e.jsxs(sn,{className:"sm:max-w-[525px]",children:[e.jsxs(an,{children:[e.jsx(cn,{children:F}),e.jsx(An,{children:I})]}),e.jsx(Qe,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(g),children:[e.jsx("div",{className:"py-4",children:K}),e.jsxs(Tn,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>H(!1),children:"Cancel"}),e.jsx(J,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:q})]})]})})]})})}function at(o){const n=gn.c(73),{mode:h,agentId:f,addedConnectionIds:p,onAdd:D,onCloneAndAdd:P,onConnectAndAdd:R,connectingItemId:d,search:b,onCreateConnection:z,onBrowseNavigate:i,defaultTab:y}=o,S=h===void 0?"add":h,M=y===void 0?"connected":y,{org:j}=Se(),l=le.useDeferredValue(b),H=b!==l,g=l.trim().toLowerCase();let F;n[0]!==M?(F=a=>a??M,n[0]=M,n[1]=F):F=n[1];const[I,q]=xn(jn.connectionsTab(j.slug)+(M==="all"?":home-modal":":agent-modal"),F);let K;n[2]!==I||n[3]!==q?(K=a=>{a!==I&&N("connections_dialog_tab_changed",{to_tab:a}),q(a)},n[2]=I,n[3]=q,n[4]=K):K=n[4];const s=K;let t;n[5]!==j.id||n[6]!==j.slug?(t={connectionId:Jn,orgId:j.id,orgSlug:j.slug},n[5]=j.id,n[6]=j.slug,n[7]=t):t=n[7];const c=Zn(t);let v,_,r;if(n[8]!==c||n[9]!==l||n[10]!==j.id){r=l?.trim()?{operator:"or",conditions:[{field:["title"],operator:"contains",value:l.trim()},{field:["description"],operator:"contains",value:l.trim()}]}:void 0;const a={...r&&{where:r},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},m=JSON.stringify(a);_=Yn,v=me.collectionListInfinite(c,j.id,"","CONNECTIONS",m),n[8]=c,n[9]=l,n[10]=j.id,n[11]=v,n[12]=_,n[13]=r}else v=n[11],_=n[12],r=n[13];let u;n[14]!==c||n[15]!==r?(u=async a=>{const{pageParam:m}=a,U=m===void 0?0:m;return(await c.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...r&&{where:r},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:U}})).structuredContent},n[14]=c,n[15]=r,n[16]=u):u=n[16];let x;n[17]!==v||n[18]!==u?(x={queryKey:v,queryFn:u,initialPageParam:0,getNextPageParam:pt,staleTime:3e4},n[17]=v,n[18]=u,n[19]=x):x=n[19];const{data:A,fetchNextPage:C,hasNextPage:w,isFetchingNextPage:k}=_(x),Ie=A?.pages.flatMap(ut)??[],he=Cn(Ie),ln=new Set(Ie.filter(dt).map(lt)),fe=nn(),Q=tn(fe,l),Ae=Ye(Q.loadMore,Q.hasMore,Q.isLoadingMore),Te=Ye(C,w??!1,k),O=I==="all"||!!g,qe=O?Q.items.filter(a=>{const m=Nn(a);if(m&&ln.has(m))return!1;if(!g)return!0;const U=a._meta?.["mcp.mesh"];return[a.title,a.description,a.name,a.server?.title,a.server?.description,a.server?.name,U?.friendly_name,U?.friendlyName].filter(Boolean).join(" ").toLowerCase().includes(g)}):[],de=qe.filter(rt),ue=qe.filter(ct);let ge;n[20]!==p?(ge=a=>a.some(m=>p.has(m.id)),n[20]=p,n[21]=ge):ge=n[21];const De=ge;let xe;n[22]!==p||n[23]!==f||n[24]!==d||n[25]!==De||n[26]!==S||n[27]!==D||n[28]!==i||n[29]!==P?(xe=(a,m,U,ce,G)=>{const Ce=De(G),re=G.find(W=>!p.has(W.id)),T=G[0];if(S==="browse"){const W=_n(T);return e.jsx(Le,{connection:{title:m,icon:U,description:G.length>1?`${G.length} instances`:ce??void 0},fallbackIcon:e.jsx(Ne,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs(be,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Connected"]}),onClick:()=>{N("connection_browse_clicked",{app_name:T.app_name??null,connection_id:T.id,instances_count:G.length}),i?.(W)}},a)}return e.jsx(Le,{connection:{title:m,icon:U,description:ce},fallbackIcon:e.jsx(Ne,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[Ce&&e.jsxs(be,{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:d!==null,onClick:W=>{W.stopPropagation(),re?(N("connection_add_clicked",{action:"use_existing",app_name:T.app_name??null,connection_id:re.id}),f&&N("agent_connection_attached",{agent_id:f,connection_id:re.id,app_name:T.app_name??null,mode:"existing"}),D(re.id)):(N("connection_add_clicked",{action:"clone",app_name:T.app_name??null,base_connection_id:T.id}),P(T))},children:"Add"})]})},a)},n[22]=p,n[23]=f,n[24]=d,n[25]=De,n[26]=S,n[27]=D,n[28]=i,n[29]=P,n[30]=xe):xe=n[30];const je=xe;let ye;n[31]!==d||n[32]!==S||n[33]!==R?(ye=a=>{const m=a._meta?.["mcp.mesh"],U=m?.friendlyName||m?.friendly_name||a.server?.title||a.title||a.server?.name||a.name||a.id||"",ce=a.server?.description||a.description||null,G=a.server?.icons?.[0]?.src||In(a.server?.repository)||null,Ce=m?.official===!0,re=m?.verified===!0,T=m?.owner==="deco";return e.jsx(Le,{connection:{title:U,description:ce,icon:G},fallbackIcon:e.jsx(Ne,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[T&&e.jsxs(Be,{children:[e.jsx(Re,{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(ze,{children:"Built and maintained by Deco"})]}),!T&&Ce&&e.jsxs(Be,{children:[e.jsx(Re,{asChild:!0,children:e.jsx(be,{variant:"outline",size:"icon",children:e.jsx(He,{})})}),e.jsx(ze,{children:"Built and maintained by the official vendor"})]}),!T&&!Ce&&re&&e.jsxs(Be,{children:[e.jsx(Re,{asChild:!0,children:e.jsx(be,{variant:"outline",size:"icon",children:e.jsx(He,{})})}),e.jsx(ze,{children:"Verified by the Deco team"})]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:W=>{W.stopPropagation(),N("connection_add_clicked",{action:"connect_new",registry_item_id:a.id,app_name:m?.friendlyName||a.server?.name||a.name||null}),R(a)},children:d===a.id?e.jsx(ke,{size:14,className:"animate-spin"}):S==="browse"?"Connect":"Add"})]})},`catalog-${a.id}`)},n[31]=d,n[32]=S,n[33]=R,n[34]=ye):ye=n[34];const Ge=ye,Pe=!g&&e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsx(bn,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:I,onTabChange:a=>s(a)}),e.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{N("connections_dialog_custom_clicked"),z()},children:[e.jsx(et,{size:12}),"Custom Connection"]})]}),Fe=H&&"opacity-50 pointer-events-none";let Z;n[35]!==Fe?(Z=yn("flex-1 overflow-auto p-5 transition-opacity duration-150",Fe),n[35]=Fe,n[36]=Z):Z=n[36];const dn="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ve;n[37]!==je?(ve=a=>{if(a.type==="group")return je(a.key,a.title,a.icon,null,a.connections);const m=a.connection;return je(m.id,m.title,m.icon,m.description??null,[m])},n[37]=je,n[38]=ve):ve=n[38];const Oe=he.map(ve);let ee;n[39]!==Te?(ee=e.jsx("div",{ref:Te,className:"col-span-full h-1"}),n[39]=Te,n[40]=ee):ee=n[40];let ne;n[41]!==k?(ne=k&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),n[41]=k,n[42]=ne):ne=n[42];const Me=O&&de.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx(He,{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"})]}),Ve=O&&de.map(Ge),$e=O&&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"})]}),Ee=O&&ue.map(Ge);let te;n[43]!==Ae||n[44]!==fe||n[45]!==O?(te=O&&fe.length>0&&e.jsx("div",{ref:Ae,className:"col-span-full h-1"}),n[43]=Ae,n[44]=fe,n[45]=O,n[46]=te):te=n[46];let oe;n[47]!==Q.isLoadingMore||n[48]!==O?(oe=O&&Q.isLoadingMore&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),n[47]=Q.isLoadingMore,n[48]=O,n[49]=oe):oe=n[49];let se;n[50]!==Oe||n[51]!==ee||n[52]!==ne||n[53]!==Me||n[54]!==Ve||n[55]!==$e||n[56]!==Ee||n[57]!==te||n[58]!==oe?(se=e.jsxs("div",{className:dn,children:[Oe,ee,ne,Me,Ve,$e,Ee,te,oe]}),n[50]=Oe,n[51]=ee,n[52]=ne,n[53]=Me,n[54]=Ve,n[55]=$e,n[56]=Ee,n[57]=te,n[58]=oe,n[59]=se):se=n[59];let ie;n[60]!==I||n[61]!==he.length||n[62]!==ue||n[63]!==b||n[64]!==de?(ie=he.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:b?`No connections match "${b}"`:I==="connected"?"No connections yet":"No connections available"}),n[60]=I,n[61]=he.length,n[62]=ue,n[63]=b,n[64]=de,n[65]=ie):ie=n[65];let ae;n[66]!==Z||n[67]!==se||n[68]!==ie?(ae=e.jsxs("div",{className:Z,children:[se,ie]}),n[66]=Z,n[67]=se,n[68]=ie,n[69]=ae):ae=n[69];let _e;return n[70]!==Pe||n[71]!==ae?(_e=e.jsxs(e.Fragment,{children:[Pe,ae]}),n[70]=Pe,n[71]=ae,n[72]=_e):_e=n[72],_e}function ct(o){return!o.verified&&!o._meta?.["mcp.mesh"]?.verified&&!o.meta?.verified}function rt(o){return o.verified||o._meta?.["mcp.mesh"]?.verified||o.meta?.verified}function lt(o){return o.app_name}function dt(o){return o.app_name}function ut(o){return o?.items??[]}function pt(o,n){if(o?.hasMore)return n.reduce(mt,0)}function mt(o,n){return o+(n?.items?.length??0)}function Gt({open:o,onOpenChange:n,defaultTab:h,initialSearch:f="",...p}){const D=p.mode??"add",P="agentId"in p?p.agentId:void 0,R="addedConnectionIds"in p?p.addedConnectionIds??new Set:new Set,d="onAdd"in p&&p.onAdd?p.onAdd:t=>{},b=(t,c,v)=>{P&&N("agent_connection_attached",{agent_id:P,connection_id:t,app_name:c,mode:v})},[z,i]=le.useState(null),[y,S]=le.useState(f),[M,j]=le.useState(!1),{org:l}=Se(),{data:H}=en.useSession(),g=rn(),F=hn(),I=fn(),q=t=>{n(!1),I({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:t}})},K=async t=>{i(t.app_name??t.id);try{const v=`${t.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,r=(await g.create.mutateAsync({title:v,description:t.description??null,connection_type:t.connection_type,connection_url:t.connection_url??null,connection_token:null,icon:t.icon??null,app_name:t.app_name??null,app_id:t.app_id??null,connection_headers:t.connection_headers??null})).id,u=new URL(`/api/${l.slug}/mcp/${r}`,window.location.origin),x=await Ue({url:u.href,token:null,orgId:l.id});if(x.supportsOAuth&&!x.isAuthenticated){const{token:A,tokenInfo:C,error:w}=await Xe({connectionId:r,orgSlug:l.slug,scope:"offline_access"});if(w||!A){N("connection_oauth_failed",{connection_id:r,flow:"clone",error:w??"no_token"}),X.error(`Authentication failed: ${w??"no token received"}`),await g.delete.mutateAsync(r);return}if(N("connection_oauth_succeeded",{connection_id:r,flow:"clone"}),C)try{(await fetch(`/api/${l.slug}/connections/${r}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})})).ok?await g.update.mutateAsync({id:r,data:{}}):await g.update.mutateAsync({id:r,data:{connection_token:A}})}catch{await g.update.mutateAsync({id:r,data:{connection_token:A}})}else await g.update.mutateAsync({id:r,data:{connection_token:A}});await F.invalidateQueries({queryKey:me.isMCPAuthenticated(u.href,null)})}b(r,t.app_name??null,"clone"),d(r)}catch(c){console.error("Failed to add connection:",c),X.error("Failed to add connection")}finally{i(null)}},s=async t=>{if(!(!l||!H?.user?.id)){i(t.id);try{const c=Sn(t,l.id,H.user.id,{remoteIndex:0}),v=c.connection_type==="STDIO",_=!!c.connection_url,r=v&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!_&&!r){X.error("This MCP Server cannot be connected: no connection method available"),i(null);return}const{id:u}=await g.create.mutateAsync(c),x=new URL(`/api/${l.slug}/mcp/${u}`,window.location.origin),A=await Ue({url:x.href,token:null,orgId:l.id});if(A.supportsOAuth&&!A.isAuthenticated){const{token:C,tokenInfo:w,error:k}=await Xe({connectionId:u,orgSlug:l.slug,scope:"offline_access"});if(k||!C){N("connection_oauth_failed",{connection_id:u,flow:"connect_new",error:k??"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. (${k??"no token received"})`}),b(u,c.app_name??null,"new"),d(u);return}if(N("connection_oauth_succeeded",{connection_id:u,flow:"connect_new"}),w)try{(await fetch(`/api/${l.slug}/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:w.accessToken,refreshToken:w.refreshToken,expiresIn:w.expiresIn,scope:w.scope,clientId:w.clientId,clientSecret:w.clientSecret,tokenEndpoint:w.tokenEndpoint})})).ok?await g.update.mutateAsync({id:u,data:{}}):await g.update.mutateAsync({id:u,data:{connection_token:C}})}catch{await g.update.mutateAsync({id:u,data:{connection_token:C}})}else await g.update.mutateAsync({id:u,data:{connection_token:C}});await F.invalidateQueries({queryKey:me.isMCPAuthenticated(x.href,null)}),X.success("Connected and authenticated")}else X.success("Connected");b(u,c.app_name??null,"new"),d(u)}catch(c){console.error("Failed to connect:",c),X.error("Failed to connect")}finally{i(null)}}};return e.jsxs(on,{open:o,onOpenChange:n,children:[e.jsxs(sn,{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(cn,{className:"text-base font-semibold",children:D==="browse"?"Connections":"Add Connection"})}),e.jsx("div",{className:"pt-3 shrink-0",children:e.jsx(wn,{value:y,onChange:S,placeholder:"Search connections..."})}),e.jsx(le.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:e.jsx(at,{mode:D,agentId:P,addedConnectionIds:R,onAdd:d,onCloneAndAdd:K,onConnectAndAdd:s,connectingItemId:z,search:y,onCreateConnection:()=>j(!0),onBrowseNavigate:q,defaultTab:h})})]}),e.jsx(it,{open:M,onOpenChange:j,onCreated:async t=>{j(!1);const c=new URL(`/api/${l.slug}/mcp/${t}`,window.location.origin),v=await Ue({url:c.href,token:null,orgId:l.id});if(v.supportsOAuth&&!v.isAuthenticated){const{token:_,tokenInfo:r,error:u}=await Xe({connectionId:t,orgSlug:l.slug,scope:"offline_access"});if(u||!_){N("connection_oauth_failed",{connection_id:t,flow:"custom_create",error:u??"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. (${u??"no token received"})`}),b(t,null,"custom"),d(t),n(!1);return}if(N("connection_oauth_succeeded",{connection_id:t,flow:"custom_create"}),r)try{(await fetch(`/api/${l.slug}/connections/${t}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:r.accessToken,refreshToken:r.refreshToken,expiresIn:r.expiresIn,scope:r.scope,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint})})).ok?await g.update.mutateAsync({id:t,data:{}}):await g.update.mutateAsync({id:t,data:{connection_token:_}})}catch{await g.update.mutateAsync({id:t,data:{connection_token:_}})}else await g.update.mutateAsync({id:t,data:{connection_token:_}});await F.invalidateQueries({queryKey:me.isMCPAuthenticated(c.href,null)})}b(t,null,"custom"),d(t),n(!1)}})]})}const Ze=new Map;function Qt(){const{org:o}=Se(),n=nt(),h=tt(),f=h.find(l=>l.providerId==="deco"),{data:p,isLoading:D,refetch:P,isFetching:R}=vn({queryKey:me.aiProviderCredits(o.id,"deco"),enabled:!!f,staleTime:6e4,queryFn:async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=p?.balanceCents??null,b=d!=null?d/100:null,z=le.useRef(new Map);if(d!=null){const l=Ze.get(o.id);z.current.get(o.id)&&l!=null&&d>l&&N("credits_topped_up_detected",{organization_id:o.id,delta_cents:d-l,previous_balance_cents:l,new_balance_cents:d}),Ze.set(o.id,d),z.current.set(o.id,!0)}const i=!!f,y=d!=null&&d>0,S=d!=null&&d===0,M=d!=null&&d===200,j=h.length>0&&h.every(l=>l.providerId==="deco");return{hasDecoKey:i,decoKeyId:f?.id??null,balanceCents:d,balanceDollars:b,hasCredits:y,isZeroBalance:S,isInitialFreeCredit:M,hasOnlyDecoProvider:j,isLoading:D,isFetching:R,refetch:P}}export{Gt as A,ot as a,Ut as b,st as c,zt as d,Ht as e,Xt as f,Kt as g,qt as h,Qt as u};
|
|
1
|
+
import{p as Se,b as en,u as un,x as pn,w as mn,j as e,B as J,n as X,r as le,F as hn,f as fn,l as ke,t as N,K as me,e as gn,o as xn,a2 as jn,c as yn,m as vn}from"./index-DtdRCqfT.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-tc4mvPkM.js";import{C as wn}from"./collection-search-t7pP-iq8.js";import{C as bn}from"./collection-tabs-DhaKOcMD.js";import{g as kn,a as Nn,e as Sn,b as In}from"./extract-connection-data-_MOrxDBF.js";import{d as on,c as sn,D as an,a as cn,b as An,e as Tn}from"./dialog-B5Fc7PcC.js";import{D as Dn,a as Pn,c as Fn,b as On,d as Mn,e as Vn,f as $n}from"./drawer-f0G1u50l.js";import{u as En,b as Be,T as Re,a as ze}from"./tooltip-D9vE3hJi.js";import{F as V,b as $,c as E,d as L,f as B,a as Qe}from"./form-DEWRKuCN.js";import{I as Y}from"./input-C6eDTm2J.js";import{d as Ln,b as Bn,c as Rn,S as zn,a as pe}from"./select-DViAZ6BX.js";import{T as Hn}from"./textarea-CgeTFjY8.js";import{b as rn}from"./use-connection-B-GnOxIe.js";import{n as Ne,c as He}from"./XCircle-CiWHFuXX.js";import{s as Ke}from"./Star01-Bi13YWhS.js";import{Y as Kn}from"./agent-icon-BvSYE4X0.js";import{s as Un}from"./XClose-Bod7oMvA.js";import{c as Xn,i as we,a as We,E as qn,p as Gn,b as Qn,d as Wn}from"./connection-form-helpers-C7CackfK.js";import{u as Ye}from"./use-infinite-scroll-tVsKkDwZ.js";import{u as Yn}from"./useSuspenseInfiniteQuery-DYDXgR3L.js";import{S as Jn,u as Zn}from"./use-mcp-client-00dhsiuh.js";import{i as Ue,a as Xe}from"./mcp-oauth-topkfZ98.js";import{B as be}from"./badge-F_XnDxyE.js";import{i as Je}from"./ChevronUp-ZNXmTuIH.js";import{s as et}from"./Plus-DP7MBDcr.js";import{u as nt}from"./studio-tools-C3pW43RI.js";import{u as tt}from"./use-ai-providers-BwFwpBOt.js";function ot(o){const n=o?.metadata?.githubRepo;return n?n.connectionId?o?.connections?.some(f=>f.connection_id===n.connectionId)?n:null:n:null}function zt(o){if(typeof o!="object"||o===null)return!1;const h=o.githubRepo?.url;return typeof h=="string"&&h.length>0}function st(o){return!!ot(o??null)?.connectionId}function Ht(o){return st(o)}function Kt(o){const n=new Set;for(const h of o??[]){const f=h.metadata?.liveAgentId;typeof f=="string"&&f&&n.add(h.id)}return n}function Ut(o){const n=new Map,h=new Map;for(const f of o??[]){const p=f.metadata?.liveAgentId;typeof p=="string"&&p&&(h.set(f.id,p),n.set(p,f.id))}return{liveToDev:n,devToLive:h}}function Xt(o,n){if(!o)return null;const h=o.metadata?.liveAgentId;if(typeof h=="string"&&h)return{mode:"dev",targetId:h};const f=(n??[]).find(p=>p.metadata?.liveAgentId===o.id);return f?{mode:"live",targetId:f.id}:null}function qt(o){return o.online?o.capabilities.includes("claude-code")||o.capabilities.includes("codex"):!1}function it({open:o,onOpenChange:n,onCreated:h}){const{org:f}=Se(),{data:p}=en.useSession(),{stdioEnabled:D}=un(),P=En(),R=rn(),d=nn(),z=tn(d,"").items,i=pn({resolver:mn(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:[]}}),y=i.watch("ui_type"),S=i.watch("connection_url"),M=i.watch("npx_package"),j=we({uiType:y,connectionUrl:S??"",npxPackage:M??""})??We({uiType:y,connectionUrl:S??"",registryItems:z}),l=s=>{const t=s.trim();if(!t)return;const c=!!i.formState.dirtyFields.title,v=!!i.formState.dirtyFields.description,_=!!i.formState.dirtyFields.env_vars,r=x=>{if(x&&(!c&&!i.getValues("title").trim()&&x.title&&i.setValue("title",x.title,{shouldDirty:!1}),!v&&!(i.getValues("description")??"").trim()&&x.description&&i.setValue("description",x.description,{shouldDirty:!1}),!_&&x.envVarKeys?.length)){const A=i.getValues("env_vars")??[],C=new Set(A.map(k=>k.key)),w=x.envVarKeys.filter(k=>!C.has(k));w.length>0&&i.setValue("env_vars",[...A,...w.map(k=>({key:k,value:""}))],{shouldDirty:!0})}},u=Gn(t);if(u&&D){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",u.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),r(we({uiType:"NPX",npxPackage:u.packageName}));return}if(t.startsWith("http://")||t.startsWith("https://")){const x=y==="HTTP"||y==="SSE"||y==="Websocket"?y:"HTTP";i.setValue("ui_type",x,{shouldDirty:!0}),i.setValue("connection_url",t,{shouldDirty:!0}),r(we({uiType:x,connectionUrl:t})??We({uiType:x,connectionUrl:t,registryItems:z}));return}y==="NPX"&&r(we({uiType:"NPX",npxPackage:t}))},H=s=>{s||i.reset(),n(s)},g=async s=>{let t,c=null,v=null,_=null;s.ui_type==="NPX"?(t="STDIO",c="",_=Qn(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(t="STDIO",c="",_=Wn(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(t=s.ui_type,c=s.connection_url||"",v=s.connection_token||null);const r=kn("conn");try{await R.create.mutateAsync({id:r,title:s.title,description:s.description||null,connection_type:t,connection_url:c,connection_token:v,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:s.icon??null,app_name:null,app_id:null,connection_headers:_,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),i.reset(),n(!1),h?.(r)}catch{X.error("Failed to create connection")}},F="Create Connection",I="Create a custom connection in your organization. Fill in the details below.",q=i.formState.isSubmitting?"Saving...":"Create Connection",K=e.jsxs("div",{className:"grid gap-4",children:[e.jsx(V,{control:i.control,name:"ui_type",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Type *"}),e.jsxs(Ln,{value:s.value,onValueChange:s.onChange,children:[e.jsx(L,{children:e.jsx(Bn,{children:e.jsx(Rn,{})})}),e.jsxs(zn,{children:[e.jsx(pe,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(pe,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(pe,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ke,{className:"w-4 h-4"}),"Websocket"]})}),D&&e.jsxs(e.Fragment,{children:[e.jsx(pe,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ne,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(pe,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Kn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(B,{})]})}),y==="NPX"&&e.jsx(V,{control:i.control,name:"npx_package",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"NPM Package *"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"@perplexity-ai/mcp-server",...s,value:s.value??"",onPaste:t=>{const c=t.clipboardData.getData("text");c&&(t.preventDefault(),i.setValue("npx_package",c.trim(),{shouldDirty:!0}),l(c))},onBlur:t=>{l(t.target.value),s.onBlur()}})}),e.jsx(B,{})]})}),y==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(V,{control:i.control,name:"stdio_command",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Command *"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"node, bun, python...",...s,value:s.value??""})}),e.jsx(B,{})]})}),e.jsx(V,{control:i.control,name:"stdio_args",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Arguments"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"arg1 arg2 --flag value",...s,value:s.value??""})}),e.jsx(B,{})]})})]}),e.jsx(V,{control:i.control,name:"stdio_cwd",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Working Directory"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"/path/to/project (optional)",...s,value:s.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(B,{})]})})]}),(y==="NPX"||y==="STDIO")&&e.jsx(V,{control:i.control,name:"env_vars",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Environment Variables"}),e.jsx(L,{children:e.jsx(qn,{value:s.value??[],onChange:s.onChange})}),e.jsx(B,{})]})}),y!=="NPX"&&y!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(V,{control:i.control,name:"connection_url",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"URL *"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"https://example.com/mcp",...s,value:s.value??"",onPaste:t=>{const c=t.clipboardData.getData("text");c&&(t.preventDefault(),i.setValue("connection_url",c.trim(),{shouldDirty:!0}),l(c))},onBlur:t=>{l(t.target.value),s.onBlur()}})}),e.jsx(B,{})]})}),e.jsx(V,{control:i.control,name:"connection_token",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:j?.token?.label??"Token (optional)"}),e.jsx(L,{children:e.jsx(Y,{type:"password",placeholder:j?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...s,value:s.value??""})}),j?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.token.helperText,j.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(B,{})]})})]}),e.jsx(V,{control:i.control,name:"title",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Name *"}),e.jsx(L,{children:e.jsx(Y,{placeholder:"My Connection",...s})}),e.jsx(B,{})]})}),e.jsx(V,{control:i.control,name:"description",render:({field:s})=>e.jsxs($,{children:[e.jsx(E,{children:"Description"}),e.jsx(L,{children:e.jsx(Hn,{placeholder:"A brief description of this connection",rows:3,...s,value:s.value??""})}),e.jsx(B,{})]})})]});return P?e.jsx(Dn,{open:o,onOpenChange:H,children:e.jsxs(Pn,{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(On,{children:F}),e.jsx(Mn,{className:"mt-1",children:I})]}),e.jsx(Vn,{asChild:!0,children:e.jsx(J,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:e.jsx(Un,{size:16})})})]})}),e.jsx(Qe,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(g),children:[e.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:K}),e.jsx($n,{children:e.jsx(J,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:q})})]})})]})}):e.jsx(on,{open:o,onOpenChange:H,children:e.jsxs(sn,{className:"sm:max-w-[525px]",children:[e.jsxs(an,{children:[e.jsx(cn,{children:F}),e.jsx(An,{children:I})]}),e.jsx(Qe,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(g),children:[e.jsx("div",{className:"py-4",children:K}),e.jsxs(Tn,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>H(!1),children:"Cancel"}),e.jsx(J,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:q})]})]})})]})})}function at(o){const n=gn.c(73),{mode:h,agentId:f,addedConnectionIds:p,onAdd:D,onCloneAndAdd:P,onConnectAndAdd:R,connectingItemId:d,search:b,onCreateConnection:z,onBrowseNavigate:i,defaultTab:y}=o,S=h===void 0?"add":h,M=y===void 0?"connected":y,{org:j}=Se(),l=le.useDeferredValue(b),H=b!==l,g=l.trim().toLowerCase();let F;n[0]!==M?(F=a=>a??M,n[0]=M,n[1]=F):F=n[1];const[I,q]=xn(jn.connectionsTab(j.slug)+(M==="all"?":home-modal":":agent-modal"),F);let K;n[2]!==I||n[3]!==q?(K=a=>{a!==I&&N("connections_dialog_tab_changed",{to_tab:a}),q(a)},n[2]=I,n[3]=q,n[4]=K):K=n[4];const s=K;let t;n[5]!==j.id||n[6]!==j.slug?(t={connectionId:Jn,orgId:j.id,orgSlug:j.slug},n[5]=j.id,n[6]=j.slug,n[7]=t):t=n[7];const c=Zn(t);let v,_,r;if(n[8]!==c||n[9]!==l||n[10]!==j.id){r=l?.trim()?{operator:"or",conditions:[{field:["title"],operator:"contains",value:l.trim()},{field:["description"],operator:"contains",value:l.trim()}]}:void 0;const a={...r&&{where:r},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},m=JSON.stringify(a);_=Yn,v=me.collectionListInfinite(c,j.id,"","CONNECTIONS",m),n[8]=c,n[9]=l,n[10]=j.id,n[11]=v,n[12]=_,n[13]=r}else v=n[11],_=n[12],r=n[13];let u;n[14]!==c||n[15]!==r?(u=async a=>{const{pageParam:m}=a,U=m===void 0?0:m;return(await c.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...r&&{where:r},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:U}})).structuredContent},n[14]=c,n[15]=r,n[16]=u):u=n[16];let x;n[17]!==v||n[18]!==u?(x={queryKey:v,queryFn:u,initialPageParam:0,getNextPageParam:pt,staleTime:3e4},n[17]=v,n[18]=u,n[19]=x):x=n[19];const{data:A,fetchNextPage:C,hasNextPage:w,isFetchingNextPage:k}=_(x),Ie=A?.pages.flatMap(ut)??[],he=Cn(Ie),ln=new Set(Ie.filter(dt).map(lt)),fe=nn(),Q=tn(fe,l),Ae=Ye(Q.loadMore,Q.hasMore,Q.isLoadingMore),Te=Ye(C,w??!1,k),O=I==="all"||!!g,qe=O?Q.items.filter(a=>{const m=Nn(a);if(m&&ln.has(m))return!1;if(!g)return!0;const U=a._meta?.["mcp.mesh"];return[a.title,a.description,a.name,a.server?.title,a.server?.description,a.server?.name,U?.friendly_name,U?.friendlyName].filter(Boolean).join(" ").toLowerCase().includes(g)}):[],de=qe.filter(rt),ue=qe.filter(ct);let ge;n[20]!==p?(ge=a=>a.some(m=>p.has(m.id)),n[20]=p,n[21]=ge):ge=n[21];const De=ge;let xe;n[22]!==p||n[23]!==f||n[24]!==d||n[25]!==De||n[26]!==S||n[27]!==D||n[28]!==i||n[29]!==P?(xe=(a,m,U,ce,G)=>{const Ce=De(G),re=G.find(W=>!p.has(W.id)),T=G[0];if(S==="browse"){const W=_n(T);return e.jsx(Le,{connection:{title:m,icon:U,description:G.length>1?`${G.length} instances`:ce??void 0},fallbackIcon:e.jsx(Ne,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs(be,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Connected"]}),onClick:()=>{N("connection_browse_clicked",{app_name:T.app_name??null,connection_id:T.id,instances_count:G.length}),i?.(W)}},a)}return e.jsx(Le,{connection:{title:m,icon:U,description:ce},fallbackIcon:e.jsx(Ne,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[Ce&&e.jsxs(be,{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:d!==null,onClick:W=>{W.stopPropagation(),re?(N("connection_add_clicked",{action:"use_existing",app_name:T.app_name??null,connection_id:re.id}),f&&N("agent_connection_attached",{agent_id:f,connection_id:re.id,app_name:T.app_name??null,mode:"existing"}),D(re.id)):(N("connection_add_clicked",{action:"clone",app_name:T.app_name??null,base_connection_id:T.id}),P(T))},children:"Add"})]})},a)},n[22]=p,n[23]=f,n[24]=d,n[25]=De,n[26]=S,n[27]=D,n[28]=i,n[29]=P,n[30]=xe):xe=n[30];const je=xe;let ye;n[31]!==d||n[32]!==S||n[33]!==R?(ye=a=>{const m=a._meta?.["mcp.mesh"],U=m?.friendlyName||m?.friendly_name||a.server?.title||a.title||a.server?.name||a.name||a.id||"",ce=a.server?.description||a.description||null,G=a.server?.icons?.[0]?.src||In(a.server?.repository)||null,Ce=m?.official===!0,re=m?.verified===!0,T=m?.owner==="deco";return e.jsx(Le,{connection:{title:U,description:ce,icon:G},fallbackIcon:e.jsx(Ne,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[T&&e.jsxs(Be,{children:[e.jsx(Re,{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(ze,{children:"Built and maintained by Deco"})]}),!T&&Ce&&e.jsxs(Be,{children:[e.jsx(Re,{asChild:!0,children:e.jsx(be,{variant:"outline",size:"icon",children:e.jsx(He,{})})}),e.jsx(ze,{children:"Built and maintained by the official vendor"})]}),!T&&!Ce&&re&&e.jsxs(Be,{children:[e.jsx(Re,{asChild:!0,children:e.jsx(be,{variant:"outline",size:"icon",children:e.jsx(He,{})})}),e.jsx(ze,{children:"Verified by the Deco team"})]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:W=>{W.stopPropagation(),N("connection_add_clicked",{action:"connect_new",registry_item_id:a.id,app_name:m?.friendlyName||a.server?.name||a.name||null}),R(a)},children:d===a.id?e.jsx(ke,{size:14,className:"animate-spin"}):S==="browse"?"Connect":"Add"})]})},`catalog-${a.id}`)},n[31]=d,n[32]=S,n[33]=R,n[34]=ye):ye=n[34];const Ge=ye,Pe=!g&&e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsx(bn,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:I,onTabChange:a=>s(a)}),e.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{N("connections_dialog_custom_clicked"),z()},children:[e.jsx(et,{size:12}),"Custom Connection"]})]}),Fe=H&&"opacity-50 pointer-events-none";let Z;n[35]!==Fe?(Z=yn("flex-1 overflow-auto p-5 transition-opacity duration-150",Fe),n[35]=Fe,n[36]=Z):Z=n[36];const dn="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ve;n[37]!==je?(ve=a=>{if(a.type==="group")return je(a.key,a.title,a.icon,null,a.connections);const m=a.connection;return je(m.id,m.title,m.icon,m.description??null,[m])},n[37]=je,n[38]=ve):ve=n[38];const Oe=he.map(ve);let ee;n[39]!==Te?(ee=e.jsx("div",{ref:Te,className:"col-span-full h-1"}),n[39]=Te,n[40]=ee):ee=n[40];let ne;n[41]!==k?(ne=k&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),n[41]=k,n[42]=ne):ne=n[42];const Me=O&&de.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx(He,{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"})]}),Ve=O&&de.map(Ge),$e=O&&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"})]}),Ee=O&&ue.map(Ge);let te;n[43]!==Ae||n[44]!==fe||n[45]!==O?(te=O&&fe.length>0&&e.jsx("div",{ref:Ae,className:"col-span-full h-1"}),n[43]=Ae,n[44]=fe,n[45]=O,n[46]=te):te=n[46];let oe;n[47]!==Q.isLoadingMore||n[48]!==O?(oe=O&&Q.isLoadingMore&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),n[47]=Q.isLoadingMore,n[48]=O,n[49]=oe):oe=n[49];let se;n[50]!==Oe||n[51]!==ee||n[52]!==ne||n[53]!==Me||n[54]!==Ve||n[55]!==$e||n[56]!==Ee||n[57]!==te||n[58]!==oe?(se=e.jsxs("div",{className:dn,children:[Oe,ee,ne,Me,Ve,$e,Ee,te,oe]}),n[50]=Oe,n[51]=ee,n[52]=ne,n[53]=Me,n[54]=Ve,n[55]=$e,n[56]=Ee,n[57]=te,n[58]=oe,n[59]=se):se=n[59];let ie;n[60]!==I||n[61]!==he.length||n[62]!==ue||n[63]!==b||n[64]!==de?(ie=he.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:b?`No connections match "${b}"`:I==="connected"?"No connections yet":"No connections available"}),n[60]=I,n[61]=he.length,n[62]=ue,n[63]=b,n[64]=de,n[65]=ie):ie=n[65];let ae;n[66]!==Z||n[67]!==se||n[68]!==ie?(ae=e.jsxs("div",{className:Z,children:[se,ie]}),n[66]=Z,n[67]=se,n[68]=ie,n[69]=ae):ae=n[69];let _e;return n[70]!==Pe||n[71]!==ae?(_e=e.jsxs(e.Fragment,{children:[Pe,ae]}),n[70]=Pe,n[71]=ae,n[72]=_e):_e=n[72],_e}function ct(o){return!o.verified&&!o._meta?.["mcp.mesh"]?.verified&&!o.meta?.verified}function rt(o){return o.verified||o._meta?.["mcp.mesh"]?.verified||o.meta?.verified}function lt(o){return o.app_name}function dt(o){return o.app_name}function ut(o){return o?.items??[]}function pt(o,n){if(o?.hasMore)return n.reduce(mt,0)}function mt(o,n){return o+(n?.items?.length??0)}function Gt({open:o,onOpenChange:n,defaultTab:h,initialSearch:f="",...p}){const D=p.mode??"add",P="agentId"in p?p.agentId:void 0,R="addedConnectionIds"in p?p.addedConnectionIds??new Set:new Set,d="onAdd"in p&&p.onAdd?p.onAdd:t=>{},b=(t,c,v)=>{P&&N("agent_connection_attached",{agent_id:P,connection_id:t,app_name:c,mode:v})},[z,i]=le.useState(null),[y,S]=le.useState(f),[M,j]=le.useState(!1),{org:l}=Se(),{data:H}=en.useSession(),g=rn(),F=hn(),I=fn(),q=t=>{n(!1),I({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:t}})},K=async t=>{i(t.app_name??t.id);try{const v=`${t.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,r=(await g.create.mutateAsync({title:v,description:t.description??null,connection_type:t.connection_type,connection_url:t.connection_url??null,connection_token:null,icon:t.icon??null,app_name:t.app_name??null,app_id:t.app_id??null,connection_headers:t.connection_headers??null})).id,u=new URL(`/api/${l.slug}/mcp/${r}`,window.location.origin),x=await Ue({url:u.href,token:null,orgId:l.id});if(x.supportsOAuth&&!x.isAuthenticated){const{token:A,tokenInfo:C,error:w}=await Xe({connectionId:r,orgSlug:l.slug,scope:"offline_access"});if(w||!A){N("connection_oauth_failed",{connection_id:r,flow:"clone",error:w??"no_token"}),X.error(`Authentication failed: ${w??"no token received"}`),await g.delete.mutateAsync(r);return}if(N("connection_oauth_succeeded",{connection_id:r,flow:"clone"}),C)try{(await fetch(`/api/${l.slug}/connections/${r}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})})).ok?await g.update.mutateAsync({id:r,data:{}}):await g.update.mutateAsync({id:r,data:{connection_token:A}})}catch{await g.update.mutateAsync({id:r,data:{connection_token:A}})}else await g.update.mutateAsync({id:r,data:{connection_token:A}});await F.invalidateQueries({queryKey:me.isMCPAuthenticated(u.href,null)})}b(r,t.app_name??null,"clone"),d(r)}catch(c){console.error("Failed to add connection:",c),X.error("Failed to add connection")}finally{i(null)}},s=async t=>{if(!(!l||!H?.user?.id)){i(t.id);try{const c=Sn(t,l.id,H.user.id,{remoteIndex:0}),v=c.connection_type==="STDIO",_=!!c.connection_url,r=v&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!_&&!r){X.error("This MCP Server cannot be connected: no connection method available"),i(null);return}const{id:u}=await g.create.mutateAsync(c),x=new URL(`/api/${l.slug}/mcp/${u}`,window.location.origin),A=await Ue({url:x.href,token:null,orgId:l.id});if(A.supportsOAuth&&!A.isAuthenticated){const{token:C,tokenInfo:w,error:k}=await Xe({connectionId:u,orgSlug:l.slug,scope:"offline_access"});if(k||!C){N("connection_oauth_failed",{connection_id:u,flow:"connect_new",error:k??"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. (${k??"no token received"})`}),b(u,c.app_name??null,"new"),d(u);return}if(N("connection_oauth_succeeded",{connection_id:u,flow:"connect_new"}),w)try{(await fetch(`/api/${l.slug}/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:w.accessToken,refreshToken:w.refreshToken,expiresIn:w.expiresIn,scope:w.scope,clientId:w.clientId,clientSecret:w.clientSecret,tokenEndpoint:w.tokenEndpoint})})).ok?await g.update.mutateAsync({id:u,data:{}}):await g.update.mutateAsync({id:u,data:{connection_token:C}})}catch{await g.update.mutateAsync({id:u,data:{connection_token:C}})}else await g.update.mutateAsync({id:u,data:{connection_token:C}});await F.invalidateQueries({queryKey:me.isMCPAuthenticated(x.href,null)}),X.success("Connected and authenticated")}else X.success("Connected");b(u,c.app_name??null,"new"),d(u)}catch(c){console.error("Failed to connect:",c),X.error("Failed to connect")}finally{i(null)}}};return e.jsxs(on,{open:o,onOpenChange:n,children:[e.jsxs(sn,{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(cn,{className:"text-base font-semibold",children:D==="browse"?"Connections":"Add Connection"})}),e.jsx("div",{className:"pt-3 shrink-0",children:e.jsx(wn,{value:y,onChange:S,placeholder:"Search connections..."})}),e.jsx(le.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:e.jsx(at,{mode:D,agentId:P,addedConnectionIds:R,onAdd:d,onCloneAndAdd:K,onConnectAndAdd:s,connectingItemId:z,search:y,onCreateConnection:()=>j(!0),onBrowseNavigate:q,defaultTab:h})})]}),e.jsx(it,{open:M,onOpenChange:j,onCreated:async t=>{j(!1);const c=new URL(`/api/${l.slug}/mcp/${t}`,window.location.origin),v=await Ue({url:c.href,token:null,orgId:l.id});if(v.supportsOAuth&&!v.isAuthenticated){const{token:_,tokenInfo:r,error:u}=await Xe({connectionId:t,orgSlug:l.slug,scope:"offline_access"});if(u||!_){N("connection_oauth_failed",{connection_id:t,flow:"custom_create",error:u??"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. (${u??"no token received"})`}),b(t,null,"custom"),d(t),n(!1);return}if(N("connection_oauth_succeeded",{connection_id:t,flow:"custom_create"}),r)try{(await fetch(`/api/${l.slug}/connections/${t}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:r.accessToken,refreshToken:r.refreshToken,expiresIn:r.expiresIn,scope:r.scope,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint})})).ok?await g.update.mutateAsync({id:t,data:{}}):await g.update.mutateAsync({id:t,data:{connection_token:_}})}catch{await g.update.mutateAsync({id:t,data:{connection_token:_}})}else await g.update.mutateAsync({id:t,data:{connection_token:_}});await F.invalidateQueries({queryKey:me.isMCPAuthenticated(c.href,null)})}b(t,null,"custom"),d(t),n(!1)}})]})}const Ze=new Map;function Qt(){const{org:o}=Se(),n=nt(),h=tt(),f=h.find(l=>l.providerId==="deco"),{data:p,isLoading:D,refetch:P,isFetching:R}=vn({queryKey:me.aiProviderCredits(o.id,"deco"),enabled:!!f,staleTime:6e4,queryFn:async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=p?.balanceCents??null,b=d!=null?d/100:null,z=le.useRef(new Map);if(d!=null){const l=Ze.get(o.id);z.current.get(o.id)&&l!=null&&d>l&&N("credits_topped_up_detected",{organization_id:o.id,delta_cents:d-l,previous_balance_cents:l,new_balance_cents:d}),Ze.set(o.id,d),z.current.set(o.id,!0)}const i=!!f,y=d!=null&&d>0,S=d!=null&&d===0,M=d!=null&&d===200,j=h.length>0&&h.every(l=>l.providerId==="deco");return{hasDecoKey:i,decoKeyId:f?.id??null,balanceCents:d,balanceDollars:b,hasCredits:y,isZeroBalance:S,isInitialFreeCredit:M,hasOnlyDecoProvider:j,isLoading:D,isFetching:R,refetch:P}}export{Gt as A,ot as a,Ut as b,st as c,zt as d,Ht as e,Xt as f,Kt as g,qt as h,Qt as u};
|