decocms 4.76.76 → 4.76.78
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-BVlB73Gd.js → AlertCircle-DBEuJvXd.js} +1 -1
- package/dist/client/assets/{AreaChart-C1SgmDdh.js → AreaChart-RJnPaDTO.js} +1 -1
- package/dist/client/assets/{ArrowUp-BcoNWaDn.js → ArrowUp-OqBYOpu3.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-COlnzfbE.js → ArrowUpRight-3xkp-kWm.js} +1 -1
- package/dist/client/assets/{Check-ylcp47jh.js → Check-Oxo5mPeL.js} +1 -1
- package/dist/client/assets/{CheckCircle-jaIqf58w.js → CheckCircle-DAvZWWWn.js} +1 -1
- package/dist/client/assets/{ChevronDown-DorDM-K-.js → ChevronDown-DCZlSvzQ.js} +1 -1
- package/dist/client/assets/{ChevronRight-NJ1RHqa7.js → ChevronRight-L_rxCnv3.js} +1 -1
- package/dist/client/assets/{ChevronUp-C85SxyPM.js → ChevronUp-BXrO8J56.js} +1 -1
- package/dist/client/assets/{Circle-BGJOKhru.js → Circle-DLL8alCD.js} +1 -1
- package/dist/client/assets/{Copy01-C5M0y3sD.js → Copy01-uwiMYWRU.js} +1 -1
- package/dist/client/assets/{DotsVertical-Ckk9mZsT.js → DotsVertical-B0IViKUD.js} +1 -1
- package/dist/client/assets/{Eye-ByzbJOuX.js → Eye-DVo1_Pm2.js} +1 -1
- package/dist/client/assets/{FilterLines-hGzDxUbQ.js → FilterLines-CAdlDh3I.js} +1 -1
- package/dist/client/assets/{Flag01-D6FA8Gqb.js → Flag01-fXAeu3l9.js} +1 -1
- package/dist/client/assets/{Globe01-DwjnaG3m.js → Globe01-By9gtoyg.js} +1 -1
- package/dist/client/assets/{Globe04-KMRfe3Ap.js → Globe04-uOyvHHk7.js} +1 -1
- package/dist/client/assets/{HardDrive-BLW7r-EP.js → HardDrive-D38nWE_J.js} +1 -1
- package/dist/client/assets/{Image01-DID7YK1H.js → Image01-B-uMMK1I.js} +1 -1
- package/dist/client/assets/{Key01-BNdv9d9e.js → Key01-ChBXFLCM.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DP-M8mno.js → LayoutLeft-DPtsS7J4.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CJELREUW.js → LinkExternal01-C3luIiQr.js} +1 -1
- package/dist/client/assets/{List-B6zsWjbc.js → List-CgvHjjyd.js} +1 -1
- package/dist/client/assets/{Monitor01-DGMiqS2G.js → Monitor01-BbnHlrzQ.js} +1 -1
- package/dist/client/assets/{Package-Cys9wdnk.js → Package-CJkGCd9M.js} +1 -1
- package/dist/client/assets/{Palette-CjpYx7Ii.js → Palette-Dem2eeFJ.js} +1 -1
- package/dist/client/assets/{Play-BIDZ3Qx4.js → Play-02R_l1hm.js} +1 -1
- package/dist/client/assets/{Plus-OGxa0fdn.js → Plus-D8fSfWhL.js} +1 -1
- package/dist/client/assets/{SearchLg-BkGBAC6u.js → SearchLg-BKY8fQrj.js} +1 -1
- package/dist/client/assets/{SearchMd-DhGVvJ2r.js → SearchMd-Di7fRkvt.js} +1 -1
- package/dist/client/assets/{Settings02-s4dN6VnR.js → Settings02-CJygIZBg.js} +1 -1
- package/dist/client/assets/{Shield01-C2gwqyT0.js → Shield01-bU8ewL-C.js} +1 -1
- package/dist/client/assets/{Star01-CdWOUCGL.js → Star01-CAO22TgC.js} +1 -1
- package/dist/client/assets/{Stars01-Ce7N7beA.js → Stars01-BbGPjqZd.js} +1 -1
- package/dist/client/assets/{Stars02-Brbdnmc2.js → Stars02-Bs0TEaNy.js} +1 -1
- package/dist/client/assets/{Sun-DrhefHVP.js → Sun-BZaKEOLT.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CQC-VHSM.js → SwitchHorizontal01-DqE-u_vC.js} +1 -1
- package/dist/client/assets/{Tool01-CQ5Yi4Y5.js → Tool01-DHJpebK1.js} +1 -1
- package/dist/client/assets/{Tool02-B5mtXP4w.js → Tool02-DlSNNbnL.js} +1 -1
- package/dist/client/assets/{Trash01-9Yhy1NDp.js → Trash01-BGwW4PUs.js} +1 -1
- package/dist/client/assets/{TrendUp01-CUYb4fKq.js → TrendUp01-Lnwj2rUh.js} +1 -1
- package/dist/client/assets/{Upload01-BGaIkl8C.js → Upload01-DVcY511n.js} +1 -1
- package/dist/client/assets/{User01-DY8EdPzH.js → User01-joygJQdk.js} +1 -1
- package/dist/client/assets/{UserPlus01-ByXfLuOW.js → UserPlus01-DvdLIpOn.js} +1 -1
- package/dist/client/assets/{Users01-DnUyZ4sc.js → Users01-BVTwFHJb.js} +1 -1
- package/dist/client/assets/{Users03-DQHSM-ip.js → Users03-FhX9tiey.js} +1 -1
- package/dist/client/assets/{X-8dZUy9dd.js → X-Bs0u_0yh.js} +1 -1
- package/dist/client/assets/{XCircle-DY5ehXOb.js → XCircle-DGorVz-d.js} +1 -1
- package/dist/client/assets/{XClose-IT2oT79e.js → XClose-hq2LkF75.js} +1 -1
- package/dist/client/assets/{Zap-UNZ6wjOU.js → Zap-CT4kcBoV.js} +1 -1
- package/dist/client/assets/{ZapSquare-CIT8HcpR.js → ZapSquare-DivgtbPr.js} +1 -1
- package/dist/client/assets/{ZoomOut-DoDMe5dD.js → ZoomOut-B2C9WPW-.js} +1 -1
- package/dist/client/assets/{access-gate-BjqlcKiO.js → access-gate-B4pZWmwl.js} +1 -1
- package/dist/client/assets/{add-section-modal-C8E813YY.js → add-section-modal-JBdSC8cO.js} +1 -1
- package/dist/client/assets/{agent-icon-DCK7PpQ3.js → agent-icon-Xdz_mRuJ.js} +1 -1
- package/dist/client/assets/{agents-list-Bwjyc61n.js → agents-list-2gWOzqrw.js} +1 -1
- package/dist/client/assets/{ai-providers-peEIA4y0.js → ai-providers-N4FbEwVk.js} +1 -1
- package/dist/client/assets/{alert-dialog-iGippWYX.js → alert-dialog-CWlVUd73.js} +1 -1
- package/dist/client/assets/{alert-CMPxdRHq.js → alert-j61mFoia.js} +1 -1
- package/dist/client/assets/{app-editor-CuUlGlJd.js → app-editor-BRpM18eX.js} +1 -1
- package/dist/client/assets/{auth-BBryGktV.js → auth-DDOP_TUe.js} +1 -1
- package/dist/client/assets/{auth-catchall-CVb1uch8.js → auth-catchall-B0LUMpZy.js} +1 -1
- package/dist/client/assets/{auth-entry-C6Y1Coh9.js → auth-entry-wtr1fLwN.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C7bMt_tF.js → auth-split-layout-Bifmzv2W.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BVhm4ZHQ.js → authenticate-and-persist-oauth-BcKcvBur.js} +1 -1
- package/dist/client/assets/{automation-list-row-CW2Mr4ne.js → automation-list-row-CWbyvM3t.js} +1 -1
- package/dist/client/assets/{automation-runs-DtF_plhA.js → automation-runs-ewxrJgPk.js} +1 -1
- package/dist/client/assets/automations-C5v25H5e.js +1 -0
- package/dist/client/assets/{autosend-YOQ-CO-z.js → autosend-sntJRLit.js} +1 -1
- package/dist/client/assets/{avatar-6ZpKSJQ1.js → avatar-BumqAYVV.js} +1 -1
- package/dist/client/assets/{badge-Brm7dRFm.js → badge-DuwyDvgL.js} +1 -1
- package/dist/client/assets/{block-document-BE7E93rt.js → block-document-COkNQDU1.js} +1 -1
- package/dist/client/assets/{brand-context-CMCsnbCM.js → brand-context-DJ55kBWm.js} +1 -1
- package/dist/client/assets/{buckets-sTBT-mWR.js → buckets-CZaQ9-E2.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CnXvOLen.js → bulk-category-panel-C4UbsY4X.js} +1 -1
- package/dist/client/assets/{calendar-C8mrI2UH.js → calendar-Dpt7QB2d.js} +1 -1
- package/dist/client/assets/{capability-load-error-u8-vFMPG.js → capability-load-error-CVQ-0IvS.js} +1 -1
- package/dist/client/assets/{card-DmJEBNvh.js → card-whir3-TU.js} +1 -1
- package/dist/client/assets/{category-editor-BS7auS6b.js → category-editor-DSjyTevO.js} +1 -1
- package/dist/client/assets/{chat-context-DeX0VT17.js → chat-context-CZYpc7lP.js} +1 -1
- package/dist/client/assets/{checkbox-YjFOYgvp.js → checkbox-DbEZ6b_D.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CYFaZSY8.js → cli-auth-success-DhmnJDJJ.js} +1 -1
- package/dist/client/assets/{collection-detail-DM2ekT5E.js → collection-detail-B32MmFU7.js} +1 -1
- package/dist/client/assets/{collection-display-button-B5vJJ8M2.js → collection-display-button--OVhArve.js} +1 -1
- package/dist/client/assets/{collection-search-BebQySxJ.js → collection-search-26JlKJRJ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D1lST78v.js → collection-table-wrapper-DPtPbXkO.js} +1 -1
- package/dist/client/assets/{collection-tabs-DhPjZGgE.js → collection-tabs-CMkX9SJV.js} +1 -1
- package/dist/client/assets/{command-DgNLNLpt.js → command-BoNCgAXF.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Di2Fzvlr.js → commerce-onboarding-DbO5ycXJ.js} +1 -1
- package/dist/client/assets/{companions-core-BXSVQzy2.js → companions-core-C3l18hJe.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BFe8wpxN.js → connect-desktop-dialog-DR3AZpl6.js} +1 -1
- package/dist/client/assets/{connection-card-B0Odymge.js → connection-card-ClbjHgoq.js} +1 -1
- package/dist/client/assets/{connection-detail-B00fRni_.js → connection-detail-B8ktqErv.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Cfzc9ntz.js → connection-form-helpers-CkjvvPa_.js} +1 -1
- package/dist/client/assets/{connections-CDGkbkgV.js → connections-BcUWe8c_.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DpwU6Fnw.js → decopilot-sse-pool-ByDpDqQ2.js} +1 -1
- package/dist/client/assets/{dialog-C6_0qLBU.js → dialog-hBUfi5DB.js} +1 -1
- package/dist/client/assets/{domain-settings-Bhf5R19l.js → domain-settings-DnawB_fV.js} +1 -1
- package/dist/client/assets/{drawer-BtRJAb0M.js → drawer-CrQJ-4Ry.js} +1 -1
- package/dist/client/assets/{dropdown-menu-96rpJkjm.js → dropdown-menu-BDW1EJyx.js} +1 -1
- package/dist/client/assets/{empty-state-jjn-bhGa.js → empty-state-LUctNkh2.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BKfZXo3n.js → extract-connection-data-BFgBaCrk.js} +1 -1
- package/dist/client/assets/{file-explorer-CeKeprFE.js → file-explorer-1FqRLQQ5.js} +1 -1
- package/dist/client/assets/{file-type-icon-cPIVgg9x.js → file-type-icon-CaoqUw2g.js} +1 -1
- package/dist/client/assets/{files-Bn3ru1FT.js → files-BpPo_clL.js} +1 -1
- package/dist/client/assets/{form-BLqlEubb.js → form-B8zhOVR3.js} +1 -1
- package/dist/client/assets/{general-CKz0uKhP.js → general-DxlJNW0F.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CiS_eOYq.js → github-repo-picker-D93GRlsF.js} +1 -1
- package/dist/client/assets/{hooks-B5swj9vo.js → hooks-DNLn_ut2.js} +1 -1
- package/dist/client/assets/{index-Dliz359x.js → index-BUTM8e7t.js} +1 -1
- package/dist/client/assets/{index-DPSWF_0V.js → index-CWrnaczo.js} +1 -1
- package/dist/client/assets/{index-CqkHhPgZ.js → index-Cag8mnTh.js} +1 -1
- package/dist/client/assets/{index-CM-AY9Fy.js → index-CdyljS_N.js} +1 -1
- package/dist/client/assets/{index-Bb3luPLV.js → index-DArYfizl.js} +1 -1
- package/dist/client/assets/{index-BUWOf6-H.js → index-DGQdC8j6.js} +3 -3
- package/dist/client/assets/{index-BYdleGn4.js → index-DTiOXvtP.js} +1 -1
- package/dist/client/assets/{index-C_fgqMB7.js → index-F-ZMCKP-.js} +2 -2
- package/dist/client/assets/{index-_AfOMAmM.js → index-MnX4iOa5.js} +1 -1
- package/dist/client/assets/{index-gNz_kq5D.js → index-gpoC3ssJ.js} +28 -28
- package/dist/client/assets/{index-CWxmaANj.js → index-ivY09p7e.js} +1 -1
- package/dist/client/assets/{index-BdUl5bJN.js → index-qg-bT8JA.js} +1 -1
- package/dist/client/assets/{index-redirect-CmPVrw8O.js → index-redirect-UnLDnJlQ.js} +1 -1
- package/dist/client/assets/{index-C9TMdwOy.js → index-sveg7vlb.js} +1 -1
- package/dist/client/assets/{index-Qvw8OnY1.js → index-vt02LGOF.js} +1 -1
- package/dist/client/assets/{input-C2XNQcRH.js → input-DwWe5Hqk.js} +1 -1
- package/dist/client/assets/{integration-icon-IezBYdjm.js → integration-icon-CfaWXLBn.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DdEYWFzF.js → invite-member-dialog-D3eUhcy1.js} +1 -1
- package/dist/client/assets/{label-CK1XiDPB.js → label-DdsuSm6M.js} +1 -1
- package/dist/client/assets/{layout-DdW7yJtW.js → layout-Bts6NJ_J.js} +1 -1
- package/dist/client/assets/{login-dKsCPJDm.js → login-Dd4NGdu8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BtnOcT8N.js → mcp-oauth-SHxAJnkD.js} +1 -1
- package/dist/client/assets/{members-OHD_cH5V.js → members-6mHVnRNm.js} +1 -1
- package/dist/client/assets/{monaco-editor-45RX9-wa.js → monaco-editor-DGONpAoN.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Pf0PyiYb.js → monitoring-stats-row-CfSW2sgf.js} +1 -1
- package/dist/client/assets/{multi-select-B1IegP8Y.js → multi-select-CD32kF2s.js} +1 -1
- package/dist/client/assets/{oauth-callback-NJnfVzCp.js → oauth-callback-Bzq_-z2r.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CTrqu6Je.js → oauth-callback-ai-provider-DxKql_z0.js} +1 -1
- package/dist/client/assets/{onboarding-VNgiRiDL.js → onboarding-BwDunMKX.js} +1 -1
- package/dist/client/assets/{org-install-DH3udQUZ.js → org-install-BR62T5jO.js} +1 -1
- package/dist/client/assets/{org-layout-BwVt-wlI.js → org-layout-BHG4t6-u.js} +1 -1
- package/dist/client/assets/{organization-choice-CA519nnl.js → organization-choice-DlY0QjY5.js} +1 -1
- package/dist/client/assets/{orgs-CyzbToZq.js → orgs-Bsar34iG.js} +1 -1
- package/dist/client/assets/{page-seo-form-txb12Kn3.js → page-seo-form-D8JddRAG.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CaWQpVxd.js +1 -0
- package/dist/client/assets/{popover-B2zk9niv.js → popover-BoSjy_J9.js} +1 -1
- package/dist/client/assets/{post-editor-DrrNmiiH.js → post-editor-BeOF_jnK.js} +1 -1
- package/dist/client/assets/{primitives-DlChEJzy.js → primitives-cDJctbRp.js} +1 -1
- package/dist/client/assets/{profile-Ds0StJLd.js → profile-BpIHCO3e.js} +1 -1
- package/dist/client/assets/project-app-view-CD4EGdca.js +1 -0
- package/dist/client/assets/record-editor-DpnQ11Qy.js +1 -0
- package/dist/client/assets/redirect-editor-DTyzzd3k.js +1 -0
- package/dist/client/assets/registry-B76hNPE7.js +2 -0
- package/dist/client/assets/{registry-layout-Dalyr-dX.js → registry-layout-BTDmQem2.js} +1 -1
- package/dist/client/assets/{reports-zmHYxym4.js → reports-rH-WO9Po.js} +1 -1
- package/dist/client/assets/{require-capability-qkGmH7NG.js → require-capability--U_vi60H.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DJSVKequ.js → required-auth-layout-B-_kB-P-.js} +1 -1
- package/dist/client/assets/{reset-password-BQvQW_Yc.js → reset-password-BbwEGkWF.js} +1 -1
- package/dist/client/assets/{roles-BO1zYp8H.js → roles-BRucDg6D.js} +1 -1
- package/dist/client/assets/{search-input-DoQewDAM.js → search-input-B0lumlG7.js} +1 -1
- package/dist/client/assets/{secrets-CwEm2qB4.js → secrets-Cx316kN4.js} +1 -1
- package/dist/client/assets/{sections-editor-CeZVcic7.js → sections-editor-DUBW607x.js} +1 -1
- package/dist/client/assets/{select-model-w8ZEBOqQ.js → select-model-BltF0usx.js} +1 -1
- package/dist/client/assets/{select-BVg_AKhS.js → select-vVirKMnE.js} +1 -1
- package/dist/client/assets/{self-tool-result-8XOi1iaO.js → self-tool-result-hAvB5Ojq.js} +1 -1
- package/dist/client/assets/{seo-editor-Ctu5yT8I.js → seo-editor-CWtXZnRQ.js} +1 -1
- package/dist/client/assets/{settings-layout-Dpo54nzI.js → settings-layout-Bew9lvu0.js} +1 -1
- package/dist/client/assets/{settings-section-Cd7MHbmE.js → settings-section-CvpT3RW4.js} +1 -1
- package/dist/client/assets/{shell-controls-IB_xzFFr.js → shell-controls-C-g_XIqJ.js} +1 -1
- package/dist/client/assets/{shell-layout-BDvpeGAX.js → shell-layout-b2wj0DO7.js} +1 -1
- package/dist/client/assets/{sidebar-Bg21lFNS.js → sidebar-C_llE2r0.js} +1 -1
- package/dist/client/assets/{skeleton-JjNP43lD.js → skeleton-CB7DUvyX.js} +1 -1
- package/dist/client/assets/{sso-C_5vX52P.js → sso-CUBuMbRD.js} +1 -1
- package/dist/client/assets/{store-DDBShmzT.js → store-B1pmnLUq.js} +1 -1
- package/dist/client/assets/store-registry-UxzRtugx.js +2 -0
- package/dist/client/assets/{studio-tools-JGMjsS9V.js → studio-tools-DII0jqi8.js} +1 -1
- package/dist/client/assets/{switch-Dbe5CgqQ.js → switch-DW7tjnTv.js} +1 -1
- package/dist/client/assets/{table-kChvW90I.js → table-DqN44BtI.js} +1 -1
- package/dist/client/assets/{tabs-D6exMqkv.js → tabs-DoePSWje.js} +1 -1
- package/dist/client/assets/{textarea-C-upgcvq.js → textarea-BH3kgWLk.js} +1 -1
- package/dist/client/assets/{toggle-group-CSfYzN1e.js → toggle-group-Dbv18C0K.js} +1 -1
- package/dist/client/assets/{toolbar-CdhDSP7U.js → toolbar-CFkubGs8.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button--2c5nPA5.js → toolbar-icon-button-B2gRcy3Z.js} +1 -1
- package/dist/client/assets/{tooltip-cXMPTvhQ.js → tooltip-CO1zVhUs.js} +1 -1
- package/dist/client/assets/{use-ai-providers-cFLtai6A.js → use-ai-providers-DuJIHuvT.js} +1 -1
- package/dist/client/assets/{use-automations-ljR2TnPA.js → use-automations-CjVm1klr.js} +1 -1
- package/dist/client/assets/{use-autosave-hI5b40ec.js → use-autosave-IhKsmyqJ.js} +1 -1
- package/dist/client/assets/{use-capability-BI2Ao-_m.js → use-capability-CEIYeJxR.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BJ7X5vRI.js → use-clock-tick-BDXFn1B6.js} +1 -1
- package/dist/client/assets/{use-collections-7ERyEkIU.js → use-collections-BqfJEMNR.js} +1 -1
- package/dist/client/assets/{use-connection-CD2Fnptb.js → use-connection-DM8eKjeN.js} +1 -1
- package/dist/client/assets/{use-copy-BhzNp8tf.js → use-copy-eCXRBbSs.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C-AFRt9S.js → use-create-virtual-mcp-C4Sbw3ia.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CZ0xTx2w.js → use-debounced-autosave-DQFgMtID.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B52whIH7.js → use-debounced-value-CMoeorqx.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Cfgq3ZjW.js → use-deco-credits-C0lExqRa.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BNjf3dpu.js → use-decopilot-events-qGOD1WG0.js} +1 -1
- package/dist/client/assets/{use-delete-connection-zsTP85HZ.js → use-delete-connection-BOFCmtMj.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C6GJURpg.js → use-deployment-admin-Cwn49qZM.js} +1 -1
- package/dist/client/assets/{use-file-configs-1u4ZUq9F.js → use-file-configs-Nmeyll7B.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DiSaAQPl.js → use-infinite-scroll-DW-B2iyn.js} +1 -1
- package/dist/client/assets/{use-join-requests-U5r9xSzr.js → use-join-requests-Dz8x0kbW.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dq4wRd85.js → use-mcp-auth-status-D-ki6Fzr.js} +1 -1
- package/dist/client/assets/{use-mcp-client-qnk43eG1.js → use-mcp-client-Csg0Ohl1.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-SncKc9ct.js → use-mcp-tools-DF4E3rLo.js} +1 -1
- package/dist/client/assets/{use-members-Dey3M7mC.js → use-members-B1t5oiJJ.js} +1 -1
- package/dist/client/assets/{use-mobile-oSorlQMv.js → use-mobile-DVuyUrh-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-7gJqLFkE.js → use-navigate-to-agent-BL2c2hni.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-aAeyG-Cs.js → use-org-auth-client-dM7W8lCQ.js} +1 -1
- package/dist/client/assets/{use-org-sso-De26T__u.js → use-org-sso-w2vntLws.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DNlG9eUj.js → use-organization-roles-7B2EryzT.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DrhRsJWG.js → use-organization-settings-Dfv3IVMe.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CmItta1b.js → use-registry-connections-DMVj_IUs.js} +1 -1
- package/dist/client/assets/{use-secrets-DDzz0qxd.js → use-secrets-j8nq_pg4.js} +1 -1
- package/dist/client/assets/{use-status-sounds-4kB8txsU.js → use-status-sounds-CQv-RBYC.js} +1 -1
- package/dist/client/assets/{use-view-mode-CtgJ6di_.js → use-view-mode-DJr2m2Jz.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BJxeG1T-.js → use-virtual-mcp-6yApsgIW.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CzbwdXBh.js +1 -0
- package/dist/client/assets/{useRouterState-DRz1wrvb.js → useRouterState-D5zTQX9l.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-0mVVL1tH.js +1 -0
- package/dist/client/assets/{users-CUTUKT6m.js → users-Dji-ZHlw.js} +1 -1
- package/dist/client/assets/{variant-calendar-HHl2ENnf.js → variant-calendar-UBPoL6eu.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DqoxH_gE.js → view-mode-toggle-BxM9Rzzk.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/automations-TF-uE_JU.js +0 -1
- package/dist/client/assets/page-seo-sheet-B7-vAcY0.js +0 -1
- package/dist/client/assets/project-app-view-Dtfecj3R.js +0 -1
- package/dist/client/assets/record-editor-5g7SCJ1d.js +0 -1
- package/dist/client/assets/redirect-editor-BVp57v49.js +0 -1
- package/dist/client/assets/registry-ddiHAuZI.js +0 -2
- package/dist/client/assets/store-registry-D43DIoAy.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C6UXsGIP.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cn5B2KcA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as U,C as q,K as T,m as I,n as x,d as y,t as m}from"./index-
|
|
1
|
+
import{c as U,C as q,K as T,m as I,n as x,d as y,t as m}from"./index-DGQdC8j6.js";import{u as z}from"./use-mcp-client-Csg0Ohl1.js";import{S as J}from"./constants-D_FQAPnt.js";import{u as Q}from"./studio-tools-DII0jqi8.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 it(t){const e=U.c(12),{org:s}=q(),l=t??J;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=z(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 r=!!t;let c;return e[8]!==n||e[9]!==o||e[10]!==r?(c={queryKey:n,queryFn:o,enabled:r,staleTime:3e4},e[8]=n,e[9]=o,e[10]=r,e[11]=c):c=e[11],I(c)}function ot(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 at(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 nt(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 r;return s[8]!==i||s[9]!==n||s[10]!==o?(r={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=r):r=s[11],I(r)}function lt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function ut(){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 r;t[6]!==s?(r=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=r):r=t[7];let c;t[8]!==i?(c=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=c):c=t[9];let d;t[10]!==r||t[11]!==c?(d={mutationFn:r,onSuccess:c,onError:X},t[10]=r,t[11]=c,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 C;t[35]!==S||t[36]!==E?(C={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=C):C=t[37];const P=y(C);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 K;t[43]!==O||t[44]!==R?(K={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=K):K=t[45];const h=y(K);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{it as a,at as b,ot as c,lt as d,nt as e,ut as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,r as o}from"./index-
|
|
1
|
+
import{c as T,r as o}from"./index-DGQdC8j6.js";const y=700;function x(r,l,_){const e=T.c(7),f=y,[a,m]=o.useState(r),[i,S]=o.useState(r),[A,d]=o.useState(!1),t=o.useRef(null);r!==i&&(S(r),A||m(r));let s;e[0]!==f||e[1]!==l?(s=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},f)},e[0]=f,e[1]=l,e[2]=s):s=e[2];const p=s;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==a||e[5]!==p?(n=[a,p,E],e[4]=a,e[5]=p,e[6]=n):n=e[6],n}export{x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,C as m,m as g,K as p}from"./index-
|
|
1
|
+
import{c as u,C as m,m as g,K as p}from"./index-DGQdC8j6.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{i as a}from"./AlertCircle-
|
|
1
|
+
import{i as a}from"./AlertCircle-DBEuJvXd.js";import{i as c}from"./CheckCircle-DAvZWWWn.js";import{i as u}from"./Circle-DLL8alCD.js";import{av as m}from"./agent-icon-Xdz_mRuJ.js";import{i as b,c as d,r as f}from"./index-DGQdC8j6.js";import{a as p}from"./XCircle-DGorVz-d.js";const g={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:a,iconClassName:"text-warning",labelColor:"text-warning"},failed:{label:"Failed",verb:"Something went wrong",icon:p,iconClassName:"text-destructive",labelColor:"text-destructive"},expired:{label:"Timed out",verb:"Stopped responding",icon:m,iconClassName:"text-warning",labelColor:"text-warning"},in_progress:{label:"Running",verb:"Agent is working",icon:b,iconClassName:"text-primary",labelColor:"text-primary"},completed:{label:"Done",verb:"Completed",icon:c,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},v={label:"Unknown",verb:"Unknown status",icon:u,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function y(r){return g[r??"completed"]??v}const i=new Map;function s(r){let t=i.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},i.set(r,t)),t}function x(r,t){const e=s(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const o of e.subscribers)o()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function T(r){const t=d.c(3),e=r===void 0?6e4:r;let o,n;return t[0]!==e?(o=l=>x(e,l),n=()=>s(e).tick,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),f.useSyncExternalStore(o,n,C)}function C(){return 0}export{g as S,y as g,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as F,c as x,n as b,d as A,al as q,t as _}from"./index-
|
|
1
|
+
import{v as F,c as x,n as b,d as A,al as q,t as _}from"./index-DGQdC8j6.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}=F(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}=F({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:v}=E,U=await o.callTool({name:S,arguments:{id:i,data:v}});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 N;t[27]!==d||t[28]!==y?(N={mutationFn:d,onSuccess:y,onError:P},t[27]=d,t[28]=y,t[29]=N):N=t[29];const $=A(N);let I;return t[30]!==T||t[31]!==$||t[32]!==w?(I={create:T,update:w,delete:$},t[30]=T,t[31]=$,t[32]=w,t[33]=I):I=t[33],I}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,j as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,C}from"./index-
|
|
1
|
+
import{c as f,C}from"./index-DGQdC8j6.js";import{a as N,b as O,u as S}from"./use-collections-BqfJEMNR.js";import{u as I}from"./use-mcp-client-Csg0Ohl1.js";import{S as m}from"./constants-D_FQAPnt.js";function _(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 p=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:m,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=I(a);return O(u.id,"CONNECTIONS",A,p)}function x(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:m,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=I(n);return S(i.id,"CONNECTIONS",t,l)}function L(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:m,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=I(i);return N(o.id,"CONNECTIONS",n)}export{x as a,L as b,_ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as i,r as n}from"./index-
|
|
1
|
+
import{c as i,r as n}from"./index-DGQdC8j6.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),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-C-AFRt9S.js → use-create-virtual-mcp-C4Sbw3ia.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g}from"./index-
|
|
1
|
+
import{c as g}from"./index-DGQdC8j6.js";import{b as f}from"./use-virtual-mcp-6yApsgIW.js";import{c as p}from"./use-navigate-to-agent-BL2c2hni.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,c=u===void 0?!1:u,t=f(),r=p();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(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 c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,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-CZ0xTx2w.js → use-debounced-autosave-DQFgMtID.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u}from"./index-
|
|
1
|
+
import{r as u}from"./index-DGQdC8j6.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};
|
package/dist/client/assets/{use-debounced-value-B52whIH7.js → use-debounced-value-CMoeorqx.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r as n}from"./index-
|
|
1
|
+
import{c as m,r as n}from"./index-DGQdC8j6.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as Ie,a as en,z as un,M as mn,J as pn,j as e,B as J,t as U,c as hn,r as de,G as fn,D as xn,K as Ke,l as gn,i as we,p as S,n as jn,b as vn,m as yn}from"./index-BUWOf6-H.js";import{C as _n}from"./collection-search-BebQySxJ.js";import{g as Cn,a as bn,b as Nn,e as wn}from"./extract-connection-data-BKfZXo3n.js";import{u as nn,a as tn,g as Sn,C as Me}from"./connection-card-B0Odymge.js";import{e as sn,d as on,D as an,a as rn,h as In,c as kn}from"./dialog-C6_0qLBU.js";import{D as An,a as Dn,c as Tn,b as Pn,d as Fn,e as Vn,f as Bn}from"./drawer-BtRJAb0M.js";import{u as On}from"./use-mobile-oSorlQMv.js";import{F as O,b as M,c as L,d as E,f as z,a as We}from"./form-BLqlEubb.js";import{I as Y}from"./input-C2XNQcRH.js";import{S as Mn,a as Ln,b as En,c as zn,d as pe}from"./select-BVg_AKhS.js";import{T as Rn}from"./textarea-C-upgcvq.js";import{b as cn}from"./use-connection-CD2Fnptb.js";import{n as Se,i as Le}from"./Tool02-B5mtXP4w.js";import{s as Ee}from"./Star01-CdWOUCGL.js";import{ag as $n}from"./agent-icon-DCK7PpQ3.js";import{s as Hn}from"./XClose-IT2oT79e.js";import{c as Kn,i as be,a as Qe,E as Un,p as Xn,b as Gn,d as qn}from"./connection-form-helpers-Cfzc9ntz.js";import{a as ze}from"./authenticate-and-persist-oauth-BVhm4ZHQ.js";import{g as Wn}from"./connection-slug-eyAPH6o3.js";import{C as Qn}from"./collection-tabs-DhPjZGgE.js";import{u as Ye}from"./use-infinite-scroll-DiSaAQPl.js";import{B as Ne}from"./badge-Brm7dRFm.js";import{b as Re,T as $e,a as He}from"./tooltip-cXMPTvhQ.js";import{u as Yn}from"./useSuspenseInfiniteQuery-Cn5B2KcA.js";import{u as Jn}from"./use-mcp-client-qnk43eG1.js";import{S as Zn}from"./constants-D_FQAPnt.js";import{i as Je}from"./Check-ylcp47jh.js";import{s as et}from"./Plus-OGxa0fdn.js";import{u as nt}from"./studio-tools-JGMjsS9V.js";import{u as tt}from"./use-ai-providers-cFLtai6A.js";function Ue(s){const n=s?.metadata?.githubRepo;if(!n?.url)return{status:"none"};const u=n.connectionId;return!!u&&!!s?.connections?.some(N=>N.connection_id===u)?{status:"attached",repo:n,connectionId:u}:!!u||n.installationId!=null?{status:"detached",repo:n}:{status:"public-clone",repo:n}}function Ht(s){const n=Ue(s);return n.status==="attached"||n.status==="public-clone"?n.repo:null}function Kt(s){if(typeof s!="object"||s===null)return!1;const u=s.githubRepo?.url;return typeof u=="string"&&u.length>0}function Ut(s){return Ue(s).status==="attached"}function Xt(s){const n=Ue(s).status;return n==="attached"||n==="detached"}function Gt(s){const n=new Set;for(const u of s??[]){const v=u.metadata?.liveAgentId;typeof v=="string"&&v&&n.add(u.id)}return n}function qt(s,n){if(!s)return null;const u=s.metadata?.liveAgentId;if(typeof u=="string"&&u)return{mode:"dev",targetId:u};const v=(n??[]).find(h=>h.metadata?.liveAgentId===s.id);return v?{mode:"live",targetId:v.id}:null}function st({open:s,onOpenChange:n,onCreated:u}){const{org:v}=Ie(),{data:h}=en.useSession(),{stdioEnabled:N}=un(),k=On(),R=cn(),l=nn(),A=tn(l,"").items,o=mn({resolver:pn(Kn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=o.watch("ui_type"),w=o.watch("connection_url"),F=o.watch("npx_package"),j=be({uiType:f,connectionUrl:w??"",npxPackage:F??""})??Qe({uiType:f,connectionUrl:w??"",registryItems:A}),c=t=>{const d=t.trim();if(!d)return;const x=!!o.formState.dirtyFields.title,i=!!o.formState.dirtyFields.description,r=!!o.formState.dirtyFields.env_vars,g=m=>{if(m&&(!x&&!o.getValues("title").trim()&&m.title&&o.setValue("title",m.title,{shouldDirty:!1}),!i&&!(o.getValues("description")??"").trim()&&m.description&&o.setValue("description",m.description,{shouldDirty:!1}),!r&&m.envVarKeys?.length)){const y=o.getValues("env_vars")??[],T=new Set(y.map(V=>V.key)),Z=m.envVarKeys.filter(V=>!T.has(V));Z.length>0&&o.setValue("env_vars",[...y,...Z.map(V=>({key:V,value:""}))],{shouldDirty:!0})}},G=Xn(d);if(G&&N){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",G.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),g(be({uiType:"NPX",npxPackage:G.packageName}));return}if(d.startsWith("http://")||d.startsWith("https://")){const m=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";o.setValue("ui_type",m,{shouldDirty:!0}),o.setValue("connection_url",d,{shouldDirty:!0}),g(be({uiType:m,connectionUrl:d})??Qe({uiType:m,connectionUrl:d,registryItems:A}));return}f==="NPX"&&g(be({uiType:"NPX",npxPackage:d}))},$=t=>{t||o.reset(),n(t)},b=async t=>{let d,x=null,i=null,r=null;t.ui_type==="NPX"?(d="STDIO",x="",r=Gn(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(d="STDIO",x="",r=qn(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(d=t.ui_type,x=t.connection_url||"",i=t.connection_token||null);const g=Cn("conn");try{await R.create.mutateAsync({id:g,title:t.title,description:t.description||null,connection_type:d,connection_url:x,connection_token:i,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:h?.user?.id||"system",organization_id:v.id,icon:t.icon??null,app_name:null,app_id:null,connection_headers:r,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),o.reset(),n(!1),u?.(g)}catch{U.error("Failed to create connection")}},D="Create Connection",H="Create a custom connection in your organization. Fill in the details below.",C=o.formState.isSubmitting?"Saving...":"Create Connection",X=e.jsxs("div",{className:"grid gap-4",children:[e.jsx(O,{control:o.control,name:"ui_type",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Type *"}),e.jsxs(Mn,{value:t.value,onValueChange:t.onChange,children:[e.jsx(E,{children:e.jsx(Ln,{children:e.jsx(En,{})})}),e.jsxs(zn,{children:[e.jsx(pe,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(pe,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(pe,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx(pe,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Se,{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($n,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(z,{})]})}),f==="NPX"&&e.jsx(O,{control:o.control,name:"npx_package",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"NPM Package *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:d=>{const x=d.clipboardData.getData("text");x&&(d.preventDefault(),o.setValue("npx_package",x.trim(),{shouldDirty:!0}),c(x))},onBlur:d=>{c(d.target.value),t.onBlur()}})}),e.jsx(z,{})]})}),f==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(O,{control:o.control,name:"stdio_command",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Command *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"stdio_args",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Arguments"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(z,{})]})})]}),e.jsx(O,{control:o.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Working Directory"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(z,{})]})})]}),(f==="NPX"||f==="STDIO")&&e.jsx(O,{control:o.control,name:"env_vars",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Environment Variables"}),e.jsx(E,{children:e.jsx(Un,{value:t.value??[],onChange:t.onChange})}),e.jsx(z,{})]})}),f!=="NPX"&&f!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(O,{control:o.control,name:"connection_url",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"URL *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:d=>{const x=d.clipboardData.getData("text");x&&(d.preventDefault(),o.setValue("connection_url",x.trim(),{shouldDirty:!0}),c(x))},onBlur:d=>{c(d.target.value),t.onBlur()}})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"connection_token",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:j?.token?.label??"Token (optional)"}),e.jsx(E,{children:e.jsx(Y,{type:"password",placeholder:j?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...t,value:t.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(z,{})]})})]}),e.jsx(O,{control:o.control,name:"title",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Name *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"My Connection",...t})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"description",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Description"}),e.jsx(E,{children:e.jsx(Rn,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(z,{})]})})]});return k?e.jsx(An,{open:s,onOpenChange:$,children:e.jsxs(Dn,{className:"max-h-[90vh]",children:[e.jsx(Tn,{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(Pn,{children:D}),e.jsx(Fn,{className:"mt-1",children:H})]}),e.jsx(Vn,{asChild:!0,children:e.jsx(J,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:e.jsx(Hn,{size:16})})})]})}),e.jsx(We,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(b),children:[e.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),e.jsx(Bn,{children:e.jsx(J,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):e.jsx(sn,{open:s,onOpenChange:$,children:e.jsxs(on,{className:"sm:max-w-[525px]",children:[e.jsxs(an,{children:[e.jsx(rn,{children:D}),e.jsx(In,{children:H})]}),e.jsx(We,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(b),children:[e.jsx("div",{className:"py-4",children:X}),e.jsxs(kn,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>$(!1),children:"Cancel"}),e.jsx(J,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function ot(s){const n=hn.c(68),{mode:u,agentId:v,addedConnectionIds:h,onAdd:N,onCloneAndAdd:k,onConnectAndAdd:R,connectingItemId:l,search:_,onCreateConnection:A,onBrowseNavigate:o,defaultTab:f}=s,w=u===void 0?"add":u,F=f===void 0?"connected":f,{org:j}=Ie(),c=de.useDeferredValue(_),$=_!==c;let b;n[0]!==c?(b=c.trim().toLowerCase(),n[0]=c,n[1]=b):b=n[1];const D=b;let H;n[2]!==F?(H=a=>a??F,n[2]=F,n[3]=H):H=n[3];const[C,X]=fn(xn.connectionsTab(j.slug)+(F==="all"?":home-modal":":agent-modal"),H);let t;n[4]!==C||n[5]!==X?(t=a=>{a!==C&&S("connections_dialog_tab_changed",{to_tab:a}),X(a)},n[4]=C,n[5]=X,n[6]=t):t=n[6];const d=t;let x;n[7]!==j.id||n[8]!==j.slug?(x={connectionId:Zn,orgId:j.id,orgSlug:j.slug},n[7]=j.id,n[8]=j.slug,n[9]=x):x=n[9];const i=Jn(x),r=c?.trim().split(/\s+/).filter(Boolean)??[],g=r.length>0?{operator:"or",conditions:r.flatMap(mt)}:void 0,G={...g&&{where:g},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},m=JSON.stringify(G),{data:y,fetchNextPage:T,hasNextPage:Z,isFetchingNextPage:V}=Yn({queryKey:Ke.collectionListInfinite(i,j.id,"","CONNECTIONS",m),queryFn:async a=>{const{pageParam:p}=a,K=p===void 0?0:p;return(await i.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...g&&{where:g},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:K}})).structuredContent},initialPageParam:0,getNextPageParam:dt,staleTime:3e4}),Xe=y?.pages.flatMap(lt)??[],he=Sn(Xe),ln=new Set(Xe.filter(ct).map(rt)),fe=nn(),q=tn(fe,c),ke=Ye(q.loadMore,q.hasMore,q.isLoadingMore),Ae=Ye(T,Z??!1,V),P=C==="all"||!!D,Ge=P?q.items.filter(a=>{const p=bn(a);if(p&&ln.has(p))return!1;if(!D)return!0;const K=a._meta?.["mcp.mesh"],W=[a.title,a.description,a.name,a.server?.title,a.server?.description,a.server?.name,K?.friendly_name,K?.friendlyName].filter(Boolean).join(" ").toLowerCase();return r.some(B=>W.includes(B.toLowerCase()))}):[],ue=Ge.filter(it),me=Ge.filter(at);let xe;n[10]!==h?(xe=a=>a.some(p=>h.has(p.id)),n[10]=h,n[11]=xe):xe=n[11];const De=xe;let ge;n[12]!==h||n[13]!==v||n[14]!==l||n[15]!==De||n[16]!==w||n[17]!==N||n[18]!==o||n[19]!==k?(ge=(a,p,K,W,B)=>{const Ce=De(B),le=B.find(Q=>!h.has(Q.id)),I=B[0];if(w==="browse"){const Q=Wn(I);return e.jsx(Me,{connection:{title:p,icon:K,description:B.length>1?`${B.length} instances`:W??void 0},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Connected"]}),onClick:()=>{S("connection_browse_clicked",{app_name:I.app_name??null,connection_id:I.id,instances_count:B.length}),o?.(Q)}},a)}return e.jsx(Me,{connection:{title:p,icon:K,description:W},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[Ce&&e.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Added"]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Q=>{Q.stopPropagation(),le?(S("connection_add_clicked",{action:"use_existing",app_name:I.app_name??null,connection_id:le.id}),v&&S("agent_connection_attached",{agent_id:v,connection_id:le.id,app_name:I.app_name??null,mode:"existing"}),N(le.id)):(S("connection_add_clicked",{action:"clone",app_name:I.app_name??null,base_connection_id:I.id}),k(I))},children:"Add"})]})},a)},n[12]=h,n[13]=v,n[14]=l,n[15]=De,n[16]=w,n[17]=N,n[18]=o,n[19]=k,n[20]=ge):ge=n[20];const je=ge;let ve;n[21]!==l||n[22]!==w||n[23]!==R?(ve=a=>{const p=a._meta?.["mcp.mesh"],K=p?.friendlyName||p?.friendly_name||a.server?.title||a.title||a.server?.name||a.name||a.id||"",W=a.server?.description||a.description||null,B=a.server?.icons?.[0]?.src||Nn(a.server?.repository)||null,Ce=p?.official===!0,le=p?.verified===!0,I=p?.owner==="deco";return e.jsx(Me,{connection:{title:K,description:W,icon:B},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[I&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Made by Deco",className:"size-3"})})}),e.jsx(He,{children:"Built and maintained by Deco"})]}),!I&&Ce&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx(Ne,{variant:"outline",size:"icon",children:e.jsx(Le,{})})}),e.jsx(He,{children:"Built and maintained by the official vendor"})]}),!I&&!Ce&&le&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx(Ne,{variant:"outline",size:"icon",children:e.jsx(Le,{})})}),e.jsx(He,{children:"Verified by the Deco team"})]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Q=>{Q.stopPropagation(),S("connection_add_clicked",{action:"connect_new",registry_item_id:a.id,app_name:p?.friendlyName||a.server?.name||a.name||null}),R(a)},children:l===a.id?e.jsx(we,{size:14,className:"animate-spin"}):w==="browse"?"Connect":"Add"})]})},`catalog-${a.id}`)},n[21]=l,n[22]=w,n[23]=R,n[24]=ve):ve=n[24];const qe=ve;let ee;n[25]!==C||n[26]!==d||n[27]!==A||n[28]!==D?(ee=!D&&e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsx(Qn,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:C,onTabChange:a=>d(a)}),e.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{S("connections_dialog_custom_clicked"),A()},children:[e.jsx(et,{size:12}),"Custom Connection"]})]}),n[25]=C,n[26]=d,n[27]=A,n[28]=D,n[29]=ee):ee=n[29];const Te=$&&"opacity-50 pointer-events-none";let ne;n[30]!==Te?(ne=gn("flex-1 overflow-auto p-5 transition-opacity duration-150",Te),n[30]=Te,n[31]=ne):ne=n[31];const dn="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ye;n[32]!==je?(ye=a=>{if(a.type==="group")return je(a.key,a.title,a.icon,null,a.connections);const p=a.connection;return je(p.id,p.title,p.icon,p.description??null,[p])},n[32]=je,n[33]=ye):ye=n[33];const Pe=he.map(ye);let te;n[34]!==Ae?(te=e.jsx("div",{ref:Ae,className:"col-span-full h-1"}),n[34]=Ae,n[35]=te):te=n[35];let se;n[36]!==V?(se=V&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),n[36]=V,n[37]=se):se=n[37];const Fe=P&&ue.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx(Le,{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=P&&ue.map(qe),Be=P&&me.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),e.jsx("div",{className:"flex-1 h-px bg-border"})]}),Oe=P&&me.map(qe);let oe;n[38]!==ke||n[39]!==fe||n[40]!==P?(oe=P&&fe.length>0&&e.jsx("div",{ref:ke,className:"col-span-full h-1"}),n[38]=ke,n[39]=fe,n[40]=P,n[41]=oe):oe=n[41];let ae;n[42]!==q.isLoadingMore||n[43]!==P?(ae=P&&q.isLoadingMore&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),n[42]=q.isLoadingMore,n[43]=P,n[44]=ae):ae=n[44];let ie;n[45]!==Pe||n[46]!==te||n[47]!==se||n[48]!==Fe||n[49]!==Ve||n[50]!==Be||n[51]!==Oe||n[52]!==oe||n[53]!==ae?(ie=e.jsxs("div",{className:dn,children:[Pe,te,se,Fe,Ve,Be,Oe,oe,ae]}),n[45]=Pe,n[46]=te,n[47]=se,n[48]=Fe,n[49]=Ve,n[50]=Be,n[51]=Oe,n[52]=oe,n[53]=ae,n[54]=ie):ie=n[54];let re;n[55]!==C||n[56]!==he.length||n[57]!==me||n[58]!==_||n[59]!==ue?(re=he.length===0&&ue.length===0&&me.length===0&&e.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:_?`No connections match "${_}"`:C==="connected"?"No connections yet":"No connections available"}),n[55]=C,n[56]=he.length,n[57]=me,n[58]=_,n[59]=ue,n[60]=re):re=n[60];let ce;n[61]!==ne||n[62]!==ie||n[63]!==re?(ce=e.jsxs("div",{className:ne,children:[ie,re]}),n[61]=ne,n[62]=ie,n[63]=re,n[64]=ce):ce=n[64];let _e;return n[65]!==ee||n[66]!==ce?(_e=e.jsxs(e.Fragment,{children:[ee,ce]}),n[65]=ee,n[66]=ce,n[67]=_e):_e=n[67],_e}function at(s){return!s.verified&&!s._meta?.["mcp.mesh"]?.verified&&!s.meta?.verified}function it(s){return s.verified||s._meta?.["mcp.mesh"]?.verified||s.meta?.verified}function rt(s){return s.app_name}function ct(s){return s.app_name}function lt(s){return s?.items??[]}function dt(s,n){if(s?.hasMore)return n.reduce(ut,0)}function ut(s,n){return s+(n?.items?.length??0)}function mt(s){return[{field:["title"],operator:"contains",value:s},{field:["description"],operator:"contains",value:s}]}function Wt({open:s,onOpenChange:n,defaultTab:u,initialSearch:v="",...h}){const N=h.mode??"add",k="agentId"in h?h.agentId:void 0,R="addedConnectionIds"in h?h.addedConnectionIds??new Set:new Set,l="onAdd"in h&&h.onAdd?h.onAdd:i=>{},_=(i,r,g)=>{k&&S("agent_connection_attached",{agent_id:k,connection_id:i,app_name:r,mode:g})},[A,o]=de.useState(null),[f,w]=de.useState(v),[F,j]=de.useState(!1),{org:c}=Ie(),{data:$}=en.useSession(),b=cn(),D=jn(),H=vn(),C=i=>{n(!1),H({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:i}})},X=()=>{D.invalidateQueries({predicate:i=>{const r=i.queryKey;return r[1]===c.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},t=async(i,r)=>{S("connection_oauth_succeeded",{connection_id:i,flow:r});const g=new URL(`/api/${c.slug}/mcp/${i}`,window.location.origin);await D.invalidateQueries({queryKey:Ke.isMCPAuthenticated(g.href,null)}),X()},d=async i=>{o(i.app_name??i.id);try{const g=`${i.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,m=(await b.create.mutateAsync({title:g,description:i.description??null,connection_type:i.connection_type,connection_url:i.connection_url??null,connection_token:null,icon:i.icon??null,app_name:i.app_name??null,app_id:i.app_id??null,connection_headers:i.connection_headers??null})).id,y=await ze({connectionId:m,orgId:c.id,orgSlug:c.slug,persistFallback:T=>b.update.mutateAsync({id:m,data:{connection_token:T}}).then(()=>{})});if(y.ran&&!y.ok){S("connection_oauth_failed",{connection_id:m,flow:"clone",error:y.error??"no_token"}),U.error(`Authentication failed: ${y.error??"no token received"}`),await b.delete.mutateAsync(m);return}y.ran&&await t(m,"clone"),_(m,i.app_name??null,"clone"),l(m)}catch(r){console.error("Failed to add connection:",r),U.error("Failed to add connection")}finally{o(null)}},x=async i=>{if(!(!c||!$?.user?.id)){o(i.id);try{const r=wn(i,c.id,$.user.id,{remoteIndex:0}),g=r.connection_type==="STDIO",G=!!r.connection_url,m=g&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!G&&!m){U.error("This MCP Server cannot be connected: no connection method available"),o(null);return}const{id:y}=await b.create.mutateAsync(r),T=await ze({connectionId:y,orgId:c.id,orgSlug:c.slug,persistFallback:Z=>b.update.mutateAsync({id:y,data:{connection_token:Z}}).then(()=>{})});if(T.ran&&!T.ok){S("connection_oauth_failed",{connection_id:y,flow:"connect_new",error:T.error??"no_token"}),U.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. (${T.error??"no token received"})`}),_(y,r.app_name??null,"new"),l(y);return}T.ran?(await t(y,"connect_new"),U.success("Connected and authenticated")):U.success("Connected"),_(y,r.app_name??null,"new"),l(y)}catch(r){console.error("Failed to connect:",r),U.error("Failed to connect")}finally{o(null)}}};return e.jsxs(sn,{open:s,onOpenChange:n,children:[e.jsxs(on,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[e.jsx(an,{className:"px-6 pt-5 pb-0 shrink-0",children:e.jsx(rn,{className:"text-base font-semibold",children:N==="browse"?"Connections":"Add Connection"})}),e.jsx("div",{className:"pt-3 shrink-0",children:e.jsx(_n,{value:f,onChange:w,placeholder:"Search connections..."})}),e.jsx(de.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),children:e.jsx(ot,{mode:N,agentId:k,addedConnectionIds:R,onAdd:l,onCloneAndAdd:d,onConnectAndAdd:x,connectingItemId:A,search:f,onCreateConnection:()=>j(!0),onBrowseNavigate:C,defaultTab:u})})]}),e.jsx(st,{open:F,onOpenChange:j,onCreated:async i=>{j(!1);const r=await ze({connectionId:i,orgId:c.id,orgSlug:c.slug,persistFallback:g=>b.update.mutateAsync({id:i,data:{connection_token:g}}).then(()=>{})});if(r.ran&&!r.ok){S("connection_oauth_failed",{connection_id:i,flow:"custom_create",error:r.error??"no_token"}),U.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. (${r.error??"no token received"})`}),_(i,null,"custom"),l(i),n(!1);return}r.ran&&await t(i,"custom_create"),_(i,null,"custom"),l(i),n(!1)}})]})}const Ze=new Map;function Qt(){const{org:s}=Ie(),n=nt(),u=tt(),v=u.find(c=>c.providerId==="deco"),{data:h,isLoading:N,refetch:k,isFetching:R}=yn({queryKey:Ke.aiProviderCredits(s.id,"deco"),enabled:!!v,staleTime:6e4,queryFn:async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=h?.balanceCents??null,_=l!=null?l/100:null,A=de.useRef(new Map);if(l!=null){const c=Ze.get(s.id);A.current.get(s.id)&&c!=null&&l>c&&S("credits_topped_up_detected",{organization_id:s.id,delta_cents:l-c,previous_balance_cents:c,new_balance_cents:l}),Ze.set(s.id,l),A.current.set(s.id,!0)}const o=!!v,f=l!=null&&l>0,w=l!=null&&l===0,F=l!=null&&l===200,j=u.length>0&&u.every(c=>c.providerId==="deco");return{hasDecoKey:o,decoKeyId:v?.id??null,balanceCents:l,balanceDollars:_,hasCredits:f,isZeroBalance:w,isInitialFreeCredit:F,hasOnlyDecoProvider:j,isLoading:N,isFetching:R,refetch:k}}export{Wt as A,Kt as a,Ht as b,Ut as c,Xt as d,qt as f,Gt as g,Ue as r,Qt as u};
|
|
1
|
+
import{C as Ie,a as en,z as un,M as mn,J as pn,j as e,B as J,t as U,c as hn,r as de,G as fn,D as xn,K as Ke,l as gn,i as we,p as S,n as jn,b as vn,m as yn}from"./index-DGQdC8j6.js";import{C as _n}from"./collection-search-26JlKJRJ.js";import{g as Cn,a as bn,b as Nn,e as wn}from"./extract-connection-data-BFgBaCrk.js";import{u as nn,a as tn,g as Sn,C as Me}from"./connection-card-ClbjHgoq.js";import{e as sn,d as on,D as an,a as rn,h as In,c as kn}from"./dialog-hBUfi5DB.js";import{D as An,a as Dn,c as Tn,b as Pn,d as Fn,e as Vn,f as Bn}from"./drawer-CrQJ-4Ry.js";import{u as On}from"./use-mobile-DVuyUrh-.js";import{F as O,b as M,c as L,d as E,f as z,a as We}from"./form-B8zhOVR3.js";import{I as Y}from"./input-DwWe5Hqk.js";import{S as Mn,a as Ln,b as En,c as zn,d as pe}from"./select-vVirKMnE.js";import{T as Rn}from"./textarea-BH3kgWLk.js";import{b as cn}from"./use-connection-DM8eKjeN.js";import{n as Se,i as Le}from"./Tool02-DlSNNbnL.js";import{s as Ee}from"./Star01-CAO22TgC.js";import{ag as $n}from"./agent-icon-Xdz_mRuJ.js";import{s as Hn}from"./XClose-hq2LkF75.js";import{c as Kn,i as be,a as Qe,E as Un,p as Xn,b as Gn,d as qn}from"./connection-form-helpers-CkjvvPa_.js";import{a as ze}from"./authenticate-and-persist-oauth-BcKcvBur.js";import{g as Wn}from"./connection-slug-eyAPH6o3.js";import{C as Qn}from"./collection-tabs-CMkX9SJV.js";import{u as Ye}from"./use-infinite-scroll-DW-B2iyn.js";import{B as Ne}from"./badge-DuwyDvgL.js";import{b as Re,T as $e,a as He}from"./tooltip-CO1zVhUs.js";import{u as Yn}from"./useSuspenseInfiniteQuery-0mVVL1tH.js";import{u as Jn}from"./use-mcp-client-Csg0Ohl1.js";import{S as Zn}from"./constants-D_FQAPnt.js";import{i as Je}from"./Check-Oxo5mPeL.js";import{s as et}from"./Plus-D8fSfWhL.js";import{u as nt}from"./studio-tools-DII0jqi8.js";import{u as tt}from"./use-ai-providers-DuJIHuvT.js";function Ue(s){const n=s?.metadata?.githubRepo;if(!n?.url)return{status:"none"};const u=n.connectionId;return!!u&&!!s?.connections?.some(N=>N.connection_id===u)?{status:"attached",repo:n,connectionId:u}:!!u||n.installationId!=null?{status:"detached",repo:n}:{status:"public-clone",repo:n}}function Ht(s){const n=Ue(s);return n.status==="attached"||n.status==="public-clone"?n.repo:null}function Kt(s){if(typeof s!="object"||s===null)return!1;const u=s.githubRepo?.url;return typeof u=="string"&&u.length>0}function Ut(s){return Ue(s).status==="attached"}function Xt(s){const n=Ue(s).status;return n==="attached"||n==="detached"}function Gt(s){const n=new Set;for(const u of s??[]){const v=u.metadata?.liveAgentId;typeof v=="string"&&v&&n.add(u.id)}return n}function qt(s,n){if(!s)return null;const u=s.metadata?.liveAgentId;if(typeof u=="string"&&u)return{mode:"dev",targetId:u};const v=(n??[]).find(h=>h.metadata?.liveAgentId===s.id);return v?{mode:"live",targetId:v.id}:null}function st({open:s,onOpenChange:n,onCreated:u}){const{org:v}=Ie(),{data:h}=en.useSession(),{stdioEnabled:N}=un(),k=On(),R=cn(),l=nn(),A=tn(l,"").items,o=mn({resolver:pn(Kn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=o.watch("ui_type"),w=o.watch("connection_url"),F=o.watch("npx_package"),j=be({uiType:f,connectionUrl:w??"",npxPackage:F??""})??Qe({uiType:f,connectionUrl:w??"",registryItems:A}),c=t=>{const d=t.trim();if(!d)return;const x=!!o.formState.dirtyFields.title,i=!!o.formState.dirtyFields.description,r=!!o.formState.dirtyFields.env_vars,g=m=>{if(m&&(!x&&!o.getValues("title").trim()&&m.title&&o.setValue("title",m.title,{shouldDirty:!1}),!i&&!(o.getValues("description")??"").trim()&&m.description&&o.setValue("description",m.description,{shouldDirty:!1}),!r&&m.envVarKeys?.length)){const y=o.getValues("env_vars")??[],T=new Set(y.map(V=>V.key)),Z=m.envVarKeys.filter(V=>!T.has(V));Z.length>0&&o.setValue("env_vars",[...y,...Z.map(V=>({key:V,value:""}))],{shouldDirty:!0})}},G=Xn(d);if(G&&N){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",G.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),g(be({uiType:"NPX",npxPackage:G.packageName}));return}if(d.startsWith("http://")||d.startsWith("https://")){const m=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";o.setValue("ui_type",m,{shouldDirty:!0}),o.setValue("connection_url",d,{shouldDirty:!0}),g(be({uiType:m,connectionUrl:d})??Qe({uiType:m,connectionUrl:d,registryItems:A}));return}f==="NPX"&&g(be({uiType:"NPX",npxPackage:d}))},$=t=>{t||o.reset(),n(t)},b=async t=>{let d,x=null,i=null,r=null;t.ui_type==="NPX"?(d="STDIO",x="",r=Gn(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(d="STDIO",x="",r=qn(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(d=t.ui_type,x=t.connection_url||"",i=t.connection_token||null);const g=Cn("conn");try{await R.create.mutateAsync({id:g,title:t.title,description:t.description||null,connection_type:d,connection_url:x,connection_token:i,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:h?.user?.id||"system",organization_id:v.id,icon:t.icon??null,app_name:null,app_id:null,connection_headers:r,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),o.reset(),n(!1),u?.(g)}catch{U.error("Failed to create connection")}},D="Create Connection",H="Create a custom connection in your organization. Fill in the details below.",C=o.formState.isSubmitting?"Saving...":"Create Connection",X=e.jsxs("div",{className:"grid gap-4",children:[e.jsx(O,{control:o.control,name:"ui_type",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Type *"}),e.jsxs(Mn,{value:t.value,onValueChange:t.onChange,children:[e.jsx(E,{children:e.jsx(Ln,{children:e.jsx(En,{})})}),e.jsxs(zn,{children:[e.jsx(pe,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(pe,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(pe,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx(pe,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Se,{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($n,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(z,{})]})}),f==="NPX"&&e.jsx(O,{control:o.control,name:"npx_package",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"NPM Package *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:d=>{const x=d.clipboardData.getData("text");x&&(d.preventDefault(),o.setValue("npx_package",x.trim(),{shouldDirty:!0}),c(x))},onBlur:d=>{c(d.target.value),t.onBlur()}})}),e.jsx(z,{})]})}),f==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(O,{control:o.control,name:"stdio_command",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Command *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"stdio_args",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Arguments"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(z,{})]})})]}),e.jsx(O,{control:o.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Working Directory"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(z,{})]})})]}),(f==="NPX"||f==="STDIO")&&e.jsx(O,{control:o.control,name:"env_vars",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Environment Variables"}),e.jsx(E,{children:e.jsx(Un,{value:t.value??[],onChange:t.onChange})}),e.jsx(z,{})]})}),f!=="NPX"&&f!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(O,{control:o.control,name:"connection_url",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"URL *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:d=>{const x=d.clipboardData.getData("text");x&&(d.preventDefault(),o.setValue("connection_url",x.trim(),{shouldDirty:!0}),c(x))},onBlur:d=>{c(d.target.value),t.onBlur()}})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"connection_token",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:j?.token?.label??"Token (optional)"}),e.jsx(E,{children:e.jsx(Y,{type:"password",placeholder:j?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...t,value:t.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(z,{})]})})]}),e.jsx(O,{control:o.control,name:"title",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Name *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"My Connection",...t})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"description",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Description"}),e.jsx(E,{children:e.jsx(Rn,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(z,{})]})})]});return k?e.jsx(An,{open:s,onOpenChange:$,children:e.jsxs(Dn,{className:"max-h-[90vh]",children:[e.jsx(Tn,{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(Pn,{children:D}),e.jsx(Fn,{className:"mt-1",children:H})]}),e.jsx(Vn,{asChild:!0,children:e.jsx(J,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:e.jsx(Hn,{size:16})})})]})}),e.jsx(We,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(b),children:[e.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),e.jsx(Bn,{children:e.jsx(J,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):e.jsx(sn,{open:s,onOpenChange:$,children:e.jsxs(on,{className:"sm:max-w-[525px]",children:[e.jsxs(an,{children:[e.jsx(rn,{children:D}),e.jsx(In,{children:H})]}),e.jsx(We,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(b),children:[e.jsx("div",{className:"py-4",children:X}),e.jsxs(kn,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>$(!1),children:"Cancel"}),e.jsx(J,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function ot(s){const n=hn.c(68),{mode:u,agentId:v,addedConnectionIds:h,onAdd:N,onCloneAndAdd:k,onConnectAndAdd:R,connectingItemId:l,search:_,onCreateConnection:A,onBrowseNavigate:o,defaultTab:f}=s,w=u===void 0?"add":u,F=f===void 0?"connected":f,{org:j}=Ie(),c=de.useDeferredValue(_),$=_!==c;let b;n[0]!==c?(b=c.trim().toLowerCase(),n[0]=c,n[1]=b):b=n[1];const D=b;let H;n[2]!==F?(H=a=>a??F,n[2]=F,n[3]=H):H=n[3];const[C,X]=fn(xn.connectionsTab(j.slug)+(F==="all"?":home-modal":":agent-modal"),H);let t;n[4]!==C||n[5]!==X?(t=a=>{a!==C&&S("connections_dialog_tab_changed",{to_tab:a}),X(a)},n[4]=C,n[5]=X,n[6]=t):t=n[6];const d=t;let x;n[7]!==j.id||n[8]!==j.slug?(x={connectionId:Zn,orgId:j.id,orgSlug:j.slug},n[7]=j.id,n[8]=j.slug,n[9]=x):x=n[9];const i=Jn(x),r=c?.trim().split(/\s+/).filter(Boolean)??[],g=r.length>0?{operator:"or",conditions:r.flatMap(mt)}:void 0,G={...g&&{where:g},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},m=JSON.stringify(G),{data:y,fetchNextPage:T,hasNextPage:Z,isFetchingNextPage:V}=Yn({queryKey:Ke.collectionListInfinite(i,j.id,"","CONNECTIONS",m),queryFn:async a=>{const{pageParam:p}=a,K=p===void 0?0:p;return(await i.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...g&&{where:g},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:K}})).structuredContent},initialPageParam:0,getNextPageParam:dt,staleTime:3e4}),Xe=y?.pages.flatMap(lt)??[],he=Sn(Xe),ln=new Set(Xe.filter(ct).map(rt)),fe=nn(),q=tn(fe,c),ke=Ye(q.loadMore,q.hasMore,q.isLoadingMore),Ae=Ye(T,Z??!1,V),P=C==="all"||!!D,Ge=P?q.items.filter(a=>{const p=bn(a);if(p&&ln.has(p))return!1;if(!D)return!0;const K=a._meta?.["mcp.mesh"],W=[a.title,a.description,a.name,a.server?.title,a.server?.description,a.server?.name,K?.friendly_name,K?.friendlyName].filter(Boolean).join(" ").toLowerCase();return r.some(B=>W.includes(B.toLowerCase()))}):[],ue=Ge.filter(it),me=Ge.filter(at);let xe;n[10]!==h?(xe=a=>a.some(p=>h.has(p.id)),n[10]=h,n[11]=xe):xe=n[11];const De=xe;let ge;n[12]!==h||n[13]!==v||n[14]!==l||n[15]!==De||n[16]!==w||n[17]!==N||n[18]!==o||n[19]!==k?(ge=(a,p,K,W,B)=>{const Ce=De(B),le=B.find(Q=>!h.has(Q.id)),I=B[0];if(w==="browse"){const Q=Wn(I);return e.jsx(Me,{connection:{title:p,icon:K,description:B.length>1?`${B.length} instances`:W??void 0},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Connected"]}),onClick:()=>{S("connection_browse_clicked",{app_name:I.app_name??null,connection_id:I.id,instances_count:B.length}),o?.(Q)}},a)}return e.jsx(Me,{connection:{title:p,icon:K,description:W},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[Ce&&e.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Added"]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Q=>{Q.stopPropagation(),le?(S("connection_add_clicked",{action:"use_existing",app_name:I.app_name??null,connection_id:le.id}),v&&S("agent_connection_attached",{agent_id:v,connection_id:le.id,app_name:I.app_name??null,mode:"existing"}),N(le.id)):(S("connection_add_clicked",{action:"clone",app_name:I.app_name??null,base_connection_id:I.id}),k(I))},children:"Add"})]})},a)},n[12]=h,n[13]=v,n[14]=l,n[15]=De,n[16]=w,n[17]=N,n[18]=o,n[19]=k,n[20]=ge):ge=n[20];const je=ge;let ve;n[21]!==l||n[22]!==w||n[23]!==R?(ve=a=>{const p=a._meta?.["mcp.mesh"],K=p?.friendlyName||p?.friendly_name||a.server?.title||a.title||a.server?.name||a.name||a.id||"",W=a.server?.description||a.description||null,B=a.server?.icons?.[0]?.src||Nn(a.server?.repository)||null,Ce=p?.official===!0,le=p?.verified===!0,I=p?.owner==="deco";return e.jsx(Me,{connection:{title:K,description:W,icon:B},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[I&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Made by Deco",className:"size-3"})})}),e.jsx(He,{children:"Built and maintained by Deco"})]}),!I&&Ce&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx(Ne,{variant:"outline",size:"icon",children:e.jsx(Le,{})})}),e.jsx(He,{children:"Built and maintained by the official vendor"})]}),!I&&!Ce&&le&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx(Ne,{variant:"outline",size:"icon",children:e.jsx(Le,{})})}),e.jsx(He,{children:"Verified by the Deco team"})]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Q=>{Q.stopPropagation(),S("connection_add_clicked",{action:"connect_new",registry_item_id:a.id,app_name:p?.friendlyName||a.server?.name||a.name||null}),R(a)},children:l===a.id?e.jsx(we,{size:14,className:"animate-spin"}):w==="browse"?"Connect":"Add"})]})},`catalog-${a.id}`)},n[21]=l,n[22]=w,n[23]=R,n[24]=ve):ve=n[24];const qe=ve;let ee;n[25]!==C||n[26]!==d||n[27]!==A||n[28]!==D?(ee=!D&&e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsx(Qn,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:C,onTabChange:a=>d(a)}),e.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{S("connections_dialog_custom_clicked"),A()},children:[e.jsx(et,{size:12}),"Custom Connection"]})]}),n[25]=C,n[26]=d,n[27]=A,n[28]=D,n[29]=ee):ee=n[29];const Te=$&&"opacity-50 pointer-events-none";let ne;n[30]!==Te?(ne=gn("flex-1 overflow-auto p-5 transition-opacity duration-150",Te),n[30]=Te,n[31]=ne):ne=n[31];const dn="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ye;n[32]!==je?(ye=a=>{if(a.type==="group")return je(a.key,a.title,a.icon,null,a.connections);const p=a.connection;return je(p.id,p.title,p.icon,p.description??null,[p])},n[32]=je,n[33]=ye):ye=n[33];const Pe=he.map(ye);let te;n[34]!==Ae?(te=e.jsx("div",{ref:Ae,className:"col-span-full h-1"}),n[34]=Ae,n[35]=te):te=n[35];let se;n[36]!==V?(se=V&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),n[36]=V,n[37]=se):se=n[37];const Fe=P&&ue.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx(Le,{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=P&&ue.map(qe),Be=P&&me.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),e.jsx("div",{className:"flex-1 h-px bg-border"})]}),Oe=P&&me.map(qe);let oe;n[38]!==ke||n[39]!==fe||n[40]!==P?(oe=P&&fe.length>0&&e.jsx("div",{ref:ke,className:"col-span-full h-1"}),n[38]=ke,n[39]=fe,n[40]=P,n[41]=oe):oe=n[41];let ae;n[42]!==q.isLoadingMore||n[43]!==P?(ae=P&&q.isLoadingMore&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),n[42]=q.isLoadingMore,n[43]=P,n[44]=ae):ae=n[44];let ie;n[45]!==Pe||n[46]!==te||n[47]!==se||n[48]!==Fe||n[49]!==Ve||n[50]!==Be||n[51]!==Oe||n[52]!==oe||n[53]!==ae?(ie=e.jsxs("div",{className:dn,children:[Pe,te,se,Fe,Ve,Be,Oe,oe,ae]}),n[45]=Pe,n[46]=te,n[47]=se,n[48]=Fe,n[49]=Ve,n[50]=Be,n[51]=Oe,n[52]=oe,n[53]=ae,n[54]=ie):ie=n[54];let re;n[55]!==C||n[56]!==he.length||n[57]!==me||n[58]!==_||n[59]!==ue?(re=he.length===0&&ue.length===0&&me.length===0&&e.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:_?`No connections match "${_}"`:C==="connected"?"No connections yet":"No connections available"}),n[55]=C,n[56]=he.length,n[57]=me,n[58]=_,n[59]=ue,n[60]=re):re=n[60];let ce;n[61]!==ne||n[62]!==ie||n[63]!==re?(ce=e.jsxs("div",{className:ne,children:[ie,re]}),n[61]=ne,n[62]=ie,n[63]=re,n[64]=ce):ce=n[64];let _e;return n[65]!==ee||n[66]!==ce?(_e=e.jsxs(e.Fragment,{children:[ee,ce]}),n[65]=ee,n[66]=ce,n[67]=_e):_e=n[67],_e}function at(s){return!s.verified&&!s._meta?.["mcp.mesh"]?.verified&&!s.meta?.verified}function it(s){return s.verified||s._meta?.["mcp.mesh"]?.verified||s.meta?.verified}function rt(s){return s.app_name}function ct(s){return s.app_name}function lt(s){return s?.items??[]}function dt(s,n){if(s?.hasMore)return n.reduce(ut,0)}function ut(s,n){return s+(n?.items?.length??0)}function mt(s){return[{field:["title"],operator:"contains",value:s},{field:["description"],operator:"contains",value:s}]}function Wt({open:s,onOpenChange:n,defaultTab:u,initialSearch:v="",...h}){const N=h.mode??"add",k="agentId"in h?h.agentId:void 0,R="addedConnectionIds"in h?h.addedConnectionIds??new Set:new Set,l="onAdd"in h&&h.onAdd?h.onAdd:i=>{},_=(i,r,g)=>{k&&S("agent_connection_attached",{agent_id:k,connection_id:i,app_name:r,mode:g})},[A,o]=de.useState(null),[f,w]=de.useState(v),[F,j]=de.useState(!1),{org:c}=Ie(),{data:$}=en.useSession(),b=cn(),D=jn(),H=vn(),C=i=>{n(!1),H({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:i}})},X=()=>{D.invalidateQueries({predicate:i=>{const r=i.queryKey;return r[1]===c.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},t=async(i,r)=>{S("connection_oauth_succeeded",{connection_id:i,flow:r});const g=new URL(`/api/${c.slug}/mcp/${i}`,window.location.origin);await D.invalidateQueries({queryKey:Ke.isMCPAuthenticated(g.href,null)}),X()},d=async i=>{o(i.app_name??i.id);try{const g=`${i.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,m=(await b.create.mutateAsync({title:g,description:i.description??null,connection_type:i.connection_type,connection_url:i.connection_url??null,connection_token:null,icon:i.icon??null,app_name:i.app_name??null,app_id:i.app_id??null,connection_headers:i.connection_headers??null})).id,y=await ze({connectionId:m,orgId:c.id,orgSlug:c.slug,persistFallback:T=>b.update.mutateAsync({id:m,data:{connection_token:T}}).then(()=>{})});if(y.ran&&!y.ok){S("connection_oauth_failed",{connection_id:m,flow:"clone",error:y.error??"no_token"}),U.error(`Authentication failed: ${y.error??"no token received"}`),await b.delete.mutateAsync(m);return}y.ran&&await t(m,"clone"),_(m,i.app_name??null,"clone"),l(m)}catch(r){console.error("Failed to add connection:",r),U.error("Failed to add connection")}finally{o(null)}},x=async i=>{if(!(!c||!$?.user?.id)){o(i.id);try{const r=wn(i,c.id,$.user.id,{remoteIndex:0}),g=r.connection_type==="STDIO",G=!!r.connection_url,m=g&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!G&&!m){U.error("This MCP Server cannot be connected: no connection method available"),o(null);return}const{id:y}=await b.create.mutateAsync(r),T=await ze({connectionId:y,orgId:c.id,orgSlug:c.slug,persistFallback:Z=>b.update.mutateAsync({id:y,data:{connection_token:Z}}).then(()=>{})});if(T.ran&&!T.ok){S("connection_oauth_failed",{connection_id:y,flow:"connect_new",error:T.error??"no_token"}),U.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. (${T.error??"no token received"})`}),_(y,r.app_name??null,"new"),l(y);return}T.ran?(await t(y,"connect_new"),U.success("Connected and authenticated")):U.success("Connected"),_(y,r.app_name??null,"new"),l(y)}catch(r){console.error("Failed to connect:",r),U.error("Failed to connect")}finally{o(null)}}};return e.jsxs(sn,{open:s,onOpenChange:n,children:[e.jsxs(on,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[e.jsx(an,{className:"px-6 pt-5 pb-0 shrink-0",children:e.jsx(rn,{className:"text-base font-semibold",children:N==="browse"?"Connections":"Add Connection"})}),e.jsx("div",{className:"pt-3 shrink-0",children:e.jsx(_n,{value:f,onChange:w,placeholder:"Search connections..."})}),e.jsx(de.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),children:e.jsx(ot,{mode:N,agentId:k,addedConnectionIds:R,onAdd:l,onCloneAndAdd:d,onConnectAndAdd:x,connectingItemId:A,search:f,onCreateConnection:()=>j(!0),onBrowseNavigate:C,defaultTab:u})})]}),e.jsx(st,{open:F,onOpenChange:j,onCreated:async i=>{j(!1);const r=await ze({connectionId:i,orgId:c.id,orgSlug:c.slug,persistFallback:g=>b.update.mutateAsync({id:i,data:{connection_token:g}}).then(()=>{})});if(r.ran&&!r.ok){S("connection_oauth_failed",{connection_id:i,flow:"custom_create",error:r.error??"no_token"}),U.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. (${r.error??"no token received"})`}),_(i,null,"custom"),l(i),n(!1);return}r.ran&&await t(i,"custom_create"),_(i,null,"custom"),l(i),n(!1)}})]})}const Ze=new Map;function Qt(){const{org:s}=Ie(),n=nt(),u=tt(),v=u.find(c=>c.providerId==="deco"),{data:h,isLoading:N,refetch:k,isFetching:R}=yn({queryKey:Ke.aiProviderCredits(s.id,"deco"),enabled:!!v,staleTime:6e4,queryFn:async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=h?.balanceCents??null,_=l!=null?l/100:null,A=de.useRef(new Map);if(l!=null){const c=Ze.get(s.id);A.current.get(s.id)&&c!=null&&l>c&&S("credits_topped_up_detected",{organization_id:s.id,delta_cents:l-c,previous_balance_cents:c,new_balance_cents:l}),Ze.set(s.id,l),A.current.set(s.id,!0)}const o=!!v,f=l!=null&&l>0,w=l!=null&&l===0,F=l!=null&&l===200,j=u.length>0&&u.every(c=>c.providerId==="deco");return{hasDecoKey:o,decoKeyId:v?.id??null,balanceCents:l,balanceDollars:_,hasCredits:f,isZeroBalance:w,isInitialFreeCredit:F,hasOnlyDecoProvider:j,isLoading:N,isFetching:R,refetch:k}}export{Wt as A,Kt as a,Ht as b,Ut as c,Xt as d,qt as f,Gt as g,Ue as r,Qt as u};
|
package/dist/client/assets/{use-decopilot-events-BNjf3dpu.js → use-decopilot-events-qGOD1WG0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-DGQdC8j6.js";import{d as R,D as u}from"./decopilot-sse-pool-ByDpDqQ2.js";const f=()=>0;function g(E){const{orgSlug:t,taskId:a,enabled:n=!0,onStep:o,onFinish:S,onTaskStatus:i}=E,l=s.useRef({taskId:a,onStep:o,onFinish:S,onTaskStatus:i});l.current={taskId:a,onStep:o,onFinish:S,onTaskStatus:i};const c=s.useRef(null),p=s.useRef(n),b=s.useRef(t);(!c.current||p.current!==n||b.current!==t)&&(p.current=n,b.current=t,c.current=d=>{if(!n||!t)return()=>{};const k=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=l.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}d()}};return R.subscribe(t,k)}),s.useSyncExternalStore(c.current,f,f)}export{g as u};
|
package/dist/client/assets/{use-delete-connection-zsTP85HZ.js → use-delete-connection-BOFCmtMj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as H,j as t,C as Q,n as J,r as M,t as F,bb as P,bc as Y}from"./index-
|
|
1
|
+
import{c as H,j as t,C as Q,n as J,r as M,t as F,bb as P,bc as Y}from"./index-DGQdC8j6.js";import{c as I,b as L,d as R,A as q,e as U,g as k,a as K,f as $}from"./alert-dialog-CWlVUd73.js";import{u as z}from"./studio-tools-DII0jqi8.js";function W(T){const e=H.c(41),{deleteState:s,cancelDelete:c,confirmDelete:i,confirmForceDelete:l}=T,N=s.mode==="deleting";let r;e[0]!==c?(r=w=>{w||c()},e[0]=c,e[1]=r):r=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(I,{children:"Delete Connection?"}),e[2]=f):f=e[2];const S=s.mode==="deleting"&&s.connection.title;let u;e[3]!==S?(u=t.jsxs(L,{children:[f,t.jsxs(R,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:S}),"."]})]}),e[3]=S,e[4]=u):u=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(q,{children:"Cancel"}),e[5]=E):E=e[5];let h;e[6]!==i?(h=t.jsxs(U,{children:[E,t.jsx(k,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=i,e[7]=h):h=e[7];let n;e[8]!==u||e[9]!==h?(n=t.jsxs(K,{children:[u,h]}),e[8]=u,e[9]=h,e[10]=n):n=e[10];let o;e[11]!==N||e[12]!==r||e[13]!==n?(o=t.jsx($,{open:N,onOpenChange:r,children:n}),e[11]=N,e[12]=r,e[13]=n,e[14]=o):o=e[14];const a=s.mode==="force-deleting";let d;e[15]!==c?(d=w=>{w||c()},e[15]=c,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(I,{children:"Connection Used by Agents"}),e[17]=m):m=e[17];const _=s.mode==="force-deleting"&&s.connection.title;let g;e[18]!==_?(g=t.jsx("span",{className:"font-medium text-foreground",children:_}),e[18]=_,e[19]=g):g=e[19];const A=s.mode==="force-deleting"&&s.agentNames;let x;e[20]!==A?(x=t.jsx("span",{className:"font-medium text-foreground",children:A}),e[20]=A,e[21]=x):x=e[21];let C;e[22]!==g||e[23]!==x?(C=t.jsxs("p",{children:["The connection"," ",g," ","is currently used by the following agent(s):"," ",x,"."]}),e[22]=g,e[23]=x,e[24]=C):C=e[24];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."}),e[25]=b):b=e[25];let D;e[26]!==C?(D=t.jsxs(L,{children:[m,t.jsx(R,{asChild:!0,children:t.jsxs("div",{children:[C,b]})})]}),e[26]=C,e[27]=D):D=e[27];let O;e[28]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(q,{children:"Cancel"}),e[28]=O):O=e[28];let j;e[29]!==l?(j=t.jsxs(U,{children:[O,t.jsx(k,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]}),e[29]=l,e[30]=j):j=e[30];let p;e[31]!==D||e[32]!==j?(p=t.jsxs(K,{children:[D,j]}),e[31]=D,e[32]=j,e[33]=p):p=e[33];let y;e[34]!==a||e[35]!==d||e[36]!==p?(y=t.jsx($,{open:a,onOpenChange:d,children:p}),e[34]=a,e[35]=d,e[36]=p,e[37]=y):y=e[37];let v;return e[38]!==y||e[39]!==o?(v=t.jsxs(t.Fragment,{children:[o,y]}),e[38]=y,e[39]=o,e[40]=v):v=e[40],v}function X({onSuccess:T}={}){const{org:e}=Q(),s=J(),c=z(),[i,l]=M.useState({mode:"idle"}),N=()=>{s.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===e.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},r=n=>{P(n),s.invalidateQueries({predicate:o=>o.queryKey[1]===Y&&o.queryKey[3]===n})},f=n=>{N(),r(n),F.success("Connection deleted successfully"),l({mode:"idle"}),T?.()};return{deleteState:i,requestDelete:n=>{l({mode:"deleting",connection:n})},cancelDelete:()=>{l({mode:"idle"})},confirmDelete:async()=>{if(i.mode!=="deleting")return;const n=i.connection;l({mode:"idle"});try{await c.call("COLLECTION_CONNECTIONS_DELETE",{id:n.id}),f(n.id)}catch(o){const a=o instanceof Error?o.message:String(o),d=a.replace(/^Error:\s*/,"");try{const m=JSON.parse(d);if(m.code==="CONNECTION_IN_USE"&&m.agentNames){l({mode:"force-deleting",connection:n,agentNames:m.agentNames.map(_=>`"${_}"`).join(", ")});return}}catch{}F.error(`Failed to delete connection: ${a}`)}},confirmForceDelete:async()=>{if(i.mode!=="force-deleting")return;const n=i.connection.id;l({mode:"idle"});try{await c.call("COLLECTION_CONNECTIONS_DELETE",{id:n,force:!0}),f(n)}catch(o){const a=o instanceof Error?o.message:String(o);F.error(`Failed to delete connection: ${a}`)}}}}export{W as D,X as u};
|
package/dist/client/assets/{use-deployment-admin-C6GJURpg.js → use-deployment-admin-Cwn49qZM.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,m,K as c}from"./index-
|
|
1
|
+
import{c as s,m,K as c}from"./index-DGQdC8j6.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,C as c,K as r,v as y,n as C,d,m as F}from"./index-
|
|
1
|
+
import{c as u,C as c,K as r,v as y,n as C,d,m as F}from"./index-DGQdC8j6.js";import{u as f}from"./studio-tools-DII0jqi8.js";function E(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],F(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,q as b,_ as c,E as u};
|
package/dist/client/assets/{use-infinite-scroll-DiSaAQPl.js → use-infinite-scroll-DW-B2iyn.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as d,dI as l,dJ as v,r as i}from"./index-
|
|
1
|
+
import{a1 as d,dI as l,dJ as v,r as i}from"./index-DGQdC8j6.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,C as N,K as y,m as _,n as A,d as I,t as q}from"./index-
|
|
1
|
+
import{c as g,C as N,K as y,m as _,n as A,d as I,t as q}from"./index-DGQdC8j6.js";import{a as S}from"./use-capability-CEIYeJxR.js";import{u as O}from"./studio-tools-DII0jqi8.js";function C(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function F(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{F as a,C as u};
|
package/dist/client/assets/{use-mcp-auth-status-dq4wRd85.js → use-mcp-auth-status-D-ki6Fzr.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h,x as I,aL as T,j as o,C,K as b,v as k}from"./index-
|
|
1
|
+
import{c as h,x as I,aL as T,j as o,C,K as b,v as k}from"./index-DGQdC8j6.js";import{B as x}from"./badge-DuwyDvgL.js";import{b as y,T as j,a as g,c as N}from"./tooltip-CO1zVhUs.js";import{g as S}from"./index-BUTM8e7t.js";import{s as _}from"./Eye-DVo1_Pm2.js";import{s as $}from"./Star01-CAO22TgC.js";import{am as A}from"./agent-icon-Xdz_mRuJ.js";import{i as w}from"./mcp-oauth-SHxAJnkD.js";const H=[{key:"readOnlyHint",label:"Read-only",Icon:_,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:I,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:T,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:$,variant:"outline"}];function L(m){const e=h.c(18),{annotations:a,_meta:r}=m;let i;e[0]!==r?(i=S(r),e[0]=r,e[1]=i):i=e[1];const t=!!i;let l,s,n,c,u;if(e[2]!==a||e[3]!==t){u=Symbol.for("react.early_return_sentinel");e:{const f=a?H.filter(v=>a[v.key]===!0):[];if(f.length===0&&!t){u=null;break e}l=N,s="flex gap-1 flex-nowrap",e[9]!==t?(n=t&&o.jsxs(y,{children:[o.jsx(j,{asChild:!0,children:o.jsx(x,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(A,{})})}),o.jsx(g,{children:"Interactive"})]}),e[9]=t,e[10]=n):n=e[10],c=f.map(P)}e[2]=a,e[3]=t,e[4]=l,e[5]=s,e[6]=n,e[7]=c,e[8]=u}else l=e[4],s=e[5],n=e[6],c=e[7],u=e[8];if(u!==Symbol.for("react.early_return_sentinel"))return u;let d;e[11]!==s||e[12]!==n||e[13]!==c?(d=o.jsxs("div",{className:s,children:[n,c]}),e[11]=s,e[12]=n,e[13]=c,e[14]=d):d=e[14];let p;return e[15]!==l||e[16]!==d?(p=o.jsx(l,{children:d}),e[15]=l,e[16]=d,e[17]=p):p=e[17],p}function P(m){const{label:e,Icon:a,variant:r}=m;return o.jsxs(y,{children:[o.jsx(j,{asChild:!0,children:o.jsx(x,{asChild:!0,variant:r,className:"size-6 p-1",children:o.jsx(a,{})})}),o.jsx(g,{children:e})]},e)}function M(m){const e=h.c(11),{connectionId:a}=m,{org:r}=C();let i,t,l;e[0]!==a||e[1]!==r.slug?(i=new URL(`/api/${r.slug}/mcp/${a}`,window.location.origin),l=k,t=b.isMCPAuthenticated(i.href,null),e[0]=a,e[1]=r.slug,e[2]=i,e[3]=t,e[4]=l):(i=e[2],t=e[3],l=e[4]);let s;e[5]!==i||e[6]!==r.id?(s=()=>w({url:i.href,token:null,orgId:r.id}),e[5]=i,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==t||e[9]!==s?(n={queryKey:t,queryFn:s},e[8]=t,e[9]=s,e[10]=n):n=e[10];const{data:c}=l(n);return c}export{L as T,M as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d3 as ce,d4 as le,d5 as ue,cb as de,d6 as he,bR as m,bS as g,d7 as fe,d8 as pe,d9 as me,da as M,db as _e,dc as F,dd as we,de as q,df as ge,dg as D,dh as Te,di as ye,dj as ke,dk as Q,bx as ve,bz as Se,be as Ce,c6 as ee,ci as be,co as Re,cm as Ie,cw as Ee,dl as qe,dm as Pe,dn as A,dp as $e,dq as Me,cn as Ae,cj as He,ck as Oe,cl as xe,bu as Ne,dr as je,ds as Ue,dt as Fe,cd as De,du as Le,dv as Ve,dw as ze,bt as N,c as te,v as se,al as V}from"./index-BUWOf6-H.js";import{S as Qe}from"./constants-D_FQAPnt.js";import{U as P,a as H,e as J}from"./auth-BBryGktV.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Je(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Je(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const We=6e4;class Ke{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??We,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=Q.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=Q.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ge(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Be=Se();const Ze=ve(Be);function Ye(){const a=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class Xe{constructor(e){this._ajv=e??Ye()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class et{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function tt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function rt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let ot=class extends Ke{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Xe,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new et(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ge(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(Ue,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){tt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&st(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=je.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function at(a){const e=a.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:j(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function nt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,it=13,I=32;function U(a){}function ct(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=U,onError:t=U,onRetry:s=U,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
|
|
1
|
+
import{d3 as ce,d4 as le,d5 as ue,cb as de,d6 as he,bR as m,bS as g,d7 as fe,d8 as pe,d9 as me,da as M,db as _e,dc as F,dd as we,de as q,df as ge,dg as D,dh as Te,di as ye,dj as ke,dk as Q,bx as ve,bz as Se,be as Ce,c6 as ee,ci as be,co as Re,cm as Ie,cw as Ee,dl as qe,dm as Pe,dn as A,dp as $e,dq as Me,cn as Ae,cj as He,ck as Oe,cl as xe,bu as Ne,dr as je,ds as Ue,dt as Fe,cd as De,du as Le,dv as Ve,dw as ze,bt as N,c as te,v as se,al as V}from"./index-DGQdC8j6.js";import{S as Qe}from"./constants-D_FQAPnt.js";import{U as P,a as H,e as J}from"./auth-DDOP_TUe.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Je(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Je(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const We=6e4;class Ke{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??We,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=Q.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=Q.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ge(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Be=Se();const Ze=ve(Be);function Ye(){const a=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class Xe{constructor(e){this._ajv=e??Ye()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class et{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function tt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function rt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let ot=class extends Ke{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Xe,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new et(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ge(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(Ue,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){tt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&st(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=je.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function at(a){const e=a.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:j(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function nt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,it=13,I=32;function U(a){}function ct(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=U,onError:t=U,onRetry:s=U,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
|
|
2
2
|
`)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
|
|
3
3
|
`,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=_+1,_=d.indexOf(`
|
|
4
4
|
`,c);continue}const v=d.charCodeAt(c);if(Y(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(p===0&&d.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,m as p,v as q,al as T}from"./index-
|
|
1
|
+
import{c as m,m as p,v as q,al as T}from"./index-DGQdC8j6.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,w as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,C as i,v as l,K as m}from"./index-
|
|
1
|
+
import{c as n,C as i,v as l,K as m}from"./index-DGQdC8j6.js";import{u as a}from"./use-org-auth-client-dM7W8lCQ.js";function p(){const e=n.c(7),{locator:o}=i(),u=a();let t;e[0]!==o?(t=m.members(o),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.organization.listMembers(),e[2]=u,e[3]=s):s=e[3];let r;return e[4]!==t||e[5]!==s?(r={queryKey:t,queryFn:s},e[4]=t,e[5]=s,e[6]=r):r=e[6],l(r)}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r}from"./index-
|
|
1
|
+
import{c as m,r}from"./index-DGQdC8j6.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
|
package/dist/client/assets/{use-navigate-to-agent-7gJqLFkE.js → use-navigate-to-agent-BL2c2hni.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as y,r as c,c as b,j as R,b as A,C as E,a as $}from"./index-
|
|
1
|
+
import{D as y,r as c,c as b,j as R,b as A,C as E,a as $}from"./index-DGQdC8j6.js";import{u as _}from"./use-virtual-mcp-6yApsgIW.js";import{c as P}from"./hooks-DNLn_ut2.js";import{f as w}from"./reusable-new-chat-CouMjkYR.js";const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function G(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(s=>typeof s=="string"):[]}catch{return[]}}function N(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function U(e){const t=I(e),r=h.get(t);if(r)return r;const s=y.sidebarGroupOrder(e.orgId,e.userId);let a=!1;try{a=localStorage.getItem(s)!==null}catch{}let o=O(s);if(!a&&o.length===0&&e.userId!=="anon"){const i=O(G(e.orgId));i.length>0&&(o=i)}return h.set(t,o),o}function T(e,t){const r=new Set(t);return U(e).filter(s=>!r.has(s))}function j(e,t){h.set(I(e),t),N(y.sidebarGroupOrder(e.orgId,e.userId),t)}function K(e,t,r=[]){if(r.includes(t))return;const s=T(e,r);s.includes(t)||j(e,[t,...s])}const S=c.createContext(null);function Q(e){const t=b.c(7),{children:r}=e,[s,a]=c.useState(!1),[o,i]=c.useState(0);let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>i(k),t[0]=d):d=t[0];const l=d;let n;t[1]!==s||t[2]!==o?(n={empty:s,setEmpty:a,orderRevision:o,bumpOrderRevision:l},t[1]=s,t[2]=o,t[3]=n):n=t[3];let u;return t[4]!==r||t[5]!==n?(u=R.jsx(S.Provider,{value:n,children:r}),t[4]=r,t[5]=n,t[6]=u):u=t[6],u}function k(e){return e+1}function W(){return c.useContext(S)?.empty??!1}function D(){return c.useContext(S)?.bumpOrderRevision??J}function J(){}const v=[],L=()=>()=>{};function B(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=b.c(15),t=A(),{org:r}=E(),s=_(),{data:a}=$.useSession(),o=a?.user?.id??"anon";let i;e[0]!==s?(i=B(s),e[0]=s,e[1]=i):i=e[1];const d=i,l=D(),n=P();let u;e[2]!==n?.threads.get?(u=n?.threads.get??V,e[2]=n?.threads.get,e[3]=u):u=e[3];let f;e[4]!==n?.threads.get?(f=n?.threads.get??H,e[4]=n?.threads.get,e[5]=f):f=e[5];const m=c.useSyncExternalStore(n?.threads.subscribe??L,u,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==d||e[11]!==a?.user?.id||e[12]!==o||e[13]!==m?(g=(p,x)=>{K({orgId:r.id,userId:o},p,d),l();const C=w(m,p,a?.user?.id)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:C},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=d,e[11]=a?.user?.id,e[12]=o,e[13]=m,e[14]=g):g=e[14],g}function H(){return v}function V(){return v}export{Q as S,D as a,K as b,X as c,B as g,W as u};
|