decocms 3.35.7 → 3.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BIYTfeei.js → AlertCircle-sZfVKKIU.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BGqBIDum.js → ArrowUpRight-CnGG2N1Q.js} +1 -1
- package/dist/client/assets/{Check-LvE_sA_T.js → Check-eedT9M4f.js} +1 -1
- package/dist/client/assets/{CheckCircle-B0oBxRpb.js → CheckCircle-CAOK_nhg.js} +1 -1
- package/dist/client/assets/{ChevronDown-DHa3IqAQ.js → ChevronDown-D6-hnD5Z.js} +1 -1
- package/dist/client/assets/{ChevronLeft-X1rMYFmV.js → ChevronLeft-k-DiQ61D.js} +1 -1
- package/dist/client/assets/{ChevronRight-BpOFC9UY.js → ChevronRight-CBibu88R.js} +1 -1
- package/dist/client/assets/{ChevronUp-CLtd7-t0.js → ChevronUp-D19kYmIs.js} +1 -1
- package/dist/client/assets/{Container-6Ia5IPn9.js → Container-Z2j0OuNG.js} +1 -1
- package/dist/client/assets/{DotsVertical-CAhIPJgX.js → DotsVertical-tAZhaZW5.js} +1 -1
- package/dist/client/assets/{Eye-efxxq50W.js → Eye-BMnHz-k1.js} +1 -1
- package/dist/client/assets/{FilterLines-CKVrZUkw.js → FilterLines-K_WBOHf8.js} +1 -1
- package/dist/client/assets/{Globe01-CjvlAfxx.js → Globe01-KlLmxZ2g.js} +1 -1
- package/dist/client/assets/{HardDrive-C-TQ9655.js → HardDrive-C7yJ_w8P.js} +1 -1
- package/dist/client/assets/{Key01-CM-woE_3.js → Key01-CckfZB0A.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BmVC9DfI.js → LayoutLeft-ZmlpRdpE.js} +1 -1
- package/dist/client/assets/{LinkExternal01-G3vtJN4n.js → LinkExternal01-N2hkztS6.js} +1 -1
- package/dist/client/assets/{Monitor01-DGw3VSEj.js → Monitor01-Bn333I91.js} +1 -1
- package/dist/client/assets/{Palette-e1wrOTVP.js → Palette-CcCpCoEe.js} +1 -1
- package/dist/client/assets/{Play-DmzTJXzi.js → Play-CsIlBltu.js} +1 -1
- package/dist/client/assets/{Plus-tVXcrY0B.js → Plus-D9X97D1u.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-BY57sDsA.js → RefreshCcw01-DaIOSJey.js} +1 -1
- package/dist/client/assets/{SearchMd-Dnr7mDHJ.js → SearchMd-DuNbf8h_.js} +1 -1
- package/dist/client/assets/{Settings02-vpvzCEqI.js → Settings02-Dg39zp7t.js} +1 -1
- package/dist/client/assets/{Shield01-kHOUdgzv.js → Shield01-MKov2U7D.js} +1 -1
- package/dist/client/assets/{Star01-DJobPrMv.js → Star01-5MkCH9IF.js} +1 -1
- package/dist/client/assets/{Stars01-C5oxzVSS.js → Stars01-BAVDvS6u.js} +1 -1
- package/dist/client/assets/{Stars02-Jq5Pm_Dt.js → Stars02-DHgD3n9i.js} +1 -1
- package/dist/client/assets/{Sun-BxAwIgVe.js → Sun-DY49aLCe.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Bs5IR9Wx.js → SwitchHorizontal01-BuDlamMt.js} +1 -1
- package/dist/client/assets/{Tool01-DF4tFmg4.js → Tool01-CiezpOWI.js} +1 -1
- package/dist/client/assets/{Trash01-DqblPjZX.js → Trash01-DLl5cvJP.js} +1 -1
- package/dist/client/assets/{Upload01-D7EnwNsF.js → Upload01-CXSIztYx.js} +1 -1
- package/dist/client/assets/{User01-CASt-NvR.js → User01-eSBkatOS.js} +1 -1
- package/dist/client/assets/{Users01-DH1hmdgk.js → Users01-BYl8o0Rk.js} +1 -1
- package/dist/client/assets/{Users03-Bu2EMbkq.js → Users03--pS_AKxh.js} +1 -1
- package/dist/client/assets/{X-CbJVsm7w.js → X-Br2l6mA-.js} +1 -1
- package/dist/client/assets/{XCircle-B2BGaOFD.js → XCircle-RMZbZptd.js} +1 -1
- package/dist/client/assets/{XClose-CCcsmvcf.js → XClose-WgHqvoCp.js} +1 -1
- package/dist/client/assets/{Zap-CR9V8BtC.js → Zap-04Dx-3Fy.js} +1 -1
- package/dist/client/assets/{ZapSquare-uGoXnGDV.js → ZapSquare-B5l4FlG5.js} +1 -1
- package/dist/client/assets/{ZoomOut-v_pNeFH6.js → ZoomOut-rJJ-xaWS.js} +1 -1
- package/dist/client/assets/{access-gate-nK_lXbty.js → access-gate-BfYLjAxI.js} +1 -1
- package/dist/client/assets/{accordion-Cus64fCZ.js → accordion-VLPWQbMf.js} +1 -1
- package/dist/client/assets/{add-section-modal-DITNxgbg.js → add-section-modal-DwhDzMiU.js} +1 -1
- package/dist/client/assets/{agent-capabilities-C3qeiPXc.js → agent-capabilities-Bp0VRyoH.js} +1 -1
- package/dist/client/assets/{agent-icon-BfnzytvB.js → agent-icon-DWieO6vE.js} +1 -1
- package/dist/client/assets/{agents-list-D9brrkMe.js → agents-list-vq1mZM9e.js} +1 -1
- package/dist/client/assets/{ai-providers-CRqSB3uJ.js → ai-providers-MJsvCa64.js} +1 -1
- package/dist/client/assets/{alert-BDRU9ZC5.js → alert-HqJ_IB4U.js} +1 -1
- package/dist/client/assets/{alert-dialog-D1rj4aCK.js → alert-dialog-DieQSpJJ.js} +1 -1
- package/dist/client/assets/app-editor-8FQlu5Bg.js +1 -0
- package/dist/client/assets/{auth-CoZ_uLWv.js → auth-CEd3xQ2M.js} +1 -1
- package/dist/client/assets/{auth-catchall-gtW4LUF8.js → auth-catchall-C-8kcQ7W.js} +1 -1
- package/dist/client/assets/{auth-split-layout-ubD2g2LB.js → auth-split-layout-CX30rRHT.js} +1 -1
- package/dist/client/assets/{automation-list-row-BI0nMiQE.js → automation-list-row-Ch8kIzZ2.js} +1 -1
- package/dist/client/assets/{automation-runs-DkxIxGFl.js → automation-runs-C8idnx0B.js} +1 -1
- package/dist/client/assets/{automations-P2Rmg-KW.js → automations-jJXUtE3E.js} +1 -1
- package/dist/client/assets/{avatar-B9Rc9EUw.js → avatar-C15JHojT.js} +1 -1
- package/dist/client/assets/{badge-CHEpx28S.js → badge-JwkDS5Iu.js} +1 -1
- package/dist/client/assets/{brand-context-CnXcQYQU.js → brand-context-BT47WAzQ.js} +1 -1
- package/dist/client/assets/{buckets-DDp0mVPy.js → buckets-CyuvSdAu.js} +1 -1
- package/dist/client/assets/{calendar-DghLpU44.js → calendar-CWIwfYwe.js} +1 -1
- package/dist/client/assets/{capability-load-error-BHy5hyOG.js → capability-load-error-BKOu-NPD.js} +1 -1
- package/dist/client/assets/{card-Coyfi-jZ.js → card-CgBn2dE1.js} +1 -1
- package/dist/client/assets/{chat-context-DgDbSHT-.js → chat-context-DqZ1Ibm0.js} +1 -1
- package/dist/client/assets/{checkbox-CUxwz-XI.js → checkbox-qrM9_H9O.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BtcIy2e1.js → cli-auth-success-Bs1vaEZW.js} +1 -1
- package/dist/client/assets/{collection-detail-CwOqNemJ.js → collection-detail-gZtr1UQJ.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bzvi-K9j.js → collection-display-button-DLfQMrjc.js} +1 -1
- package/dist/client/assets/{collection-search-BOTBd9nH.js → collection-search-D1oAy2sU.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DFw9302z.js → collection-table-wrapper-C2gSo7v5.js} +1 -1
- package/dist/client/assets/{collection-tabs-DutpbC-B.js → collection-tabs-BIQAfryC.js} +1 -1
- package/dist/client/assets/{collections-B4qynpTl.js → collections-D0YZfwq6.js} +1 -1
- package/dist/client/assets/{command-BV689sDo.js → command-BLE2ssDn.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-Bt_ZSEjM.js → connect-desktop-dialog-CrC9Oh0l.js} +1 -1
- package/dist/client/assets/{connection-card-BeSS5FDA.js → connection-card-CHJN3shf.js} +1 -1
- package/dist/client/assets/{connection-detail-CpBssSKg.js → connection-detail-C48cRXbS.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DJLyD-fy.js → connection-form-helpers-Drt7n4SC.js} +1 -1
- package/dist/client/assets/{connections-CXNczWT3.js → connections-4mKaz-pj.js} +1 -1
- package/dist/client/assets/{decopilot-MIVpVAhi.js → decopilot-DvM9Gb5y.js} +1 -1
- package/dist/client/assets/decopilot-sse-pool-BvjD1ex-.js +1 -0
- package/dist/client/assets/{dialog-DQXXelJD.js → dialog-DK12sdoJ.js} +1 -1
- package/dist/client/assets/{domain-settings-Bfk16G5p.js → domain-settings-BlIFrkY9.js} +1 -1
- package/dist/client/assets/{drawer-DPsQ_RSi.js → drawer-CIXkng7i.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DE0jtqcA.js → dropdown-menu-BLKuf1Kf.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-B6SLKYUw.js → dynamic-plugin-layout-Cao3Fk3O.js} +1 -1
- package/dist/client/assets/{empty-state-DkmJ5Aqv.js → empty-state-BbCSQSCb.js} +1 -1
- package/dist/client/assets/{empty-state-DjKgE-Pk.js → empty-state-tzNEOnER.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BlNJcpyN.js → extract-connection-data-CQzU46AZ.js} +1 -1
- package/dist/client/assets/{features-BLPRBAAS.js → features-DdBVqCME.js} +1 -1
- package/dist/client/assets/{file-explorer-BrHhoR9d.js → file-explorer-DnZXmyKJ.js} +1 -1
- package/dist/client/assets/{file-type-icon-B4sc4oJu.js → file-type-icon-BQHeWto0.js} +1 -1
- package/dist/client/assets/{files-Bp-rzOpe.js → files-BsjLUCm4.js} +1 -1
- package/dist/client/assets/{form-544HFX7E.js → form-FCvC7hbQ.js} +1 -1
- package/dist/client/assets/{general-SURYQd03.js → general-Dd6sqRin.js} +1 -1
- package/dist/client/assets/{generate-id-DWTKLmsP.js → generate-id-zSg_956X.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CAJFaa_5.js → github-repo-picker-CTRiJHmK.js} +1 -1
- package/dist/client/assets/{header-tab-button-nXsETNd4.js → header-tab-button-B1HaLlT-.js} +1 -1
- package/dist/client/assets/{hover-card-CFl8ktry.js → hover-card-D0jPa1wE.js} +1 -1
- package/dist/client/assets/{image-field-BGI67qng.js → image-field-mUCDr9Zc.js} +1 -1
- package/dist/client/assets/{index-La6GAxQQ.js → index-8TuYuCCk.js} +1 -1
- package/dist/client/assets/{index-CwhrOxXk.js → index-B-btDb3P.js} +1 -1
- package/dist/client/assets/{index-BWEcSbo6.js → index-BD1xF-xP.js} +1 -1
- package/dist/client/assets/{index-C1_XAkwo.js → index-BaVV-6LB.js} +1 -1
- package/dist/client/assets/{index-yJUFKnzQ.js → index-C8Oy1v-k.js} +1 -1
- package/dist/client/assets/{index-BiPry9Eg.js → index-CaaIYkny.js} +1 -1
- package/dist/client/assets/{index-BZA2K9l8.js → index-CeLy70Xu.js} +1 -1
- package/dist/client/assets/{index-CQPehUqM.js → index-D8rSD1e2.js} +1 -1
- package/dist/client/assets/{index-8tXBMeIK.js → index-DElySjov.js} +3 -3
- package/dist/client/assets/{index-C7hbEX42.js → index-DOUSj-_V.js} +1 -1
- package/dist/client/assets/{index-NDFo3Mew.js → index-DiZRyNnN.js} +1 -1
- package/dist/client/assets/{index-BRoAqb49.js → index-jep-xxRB.js} +1 -1
- package/dist/client/assets/{index-TDcAzuSs.js → index-p33ao2cf.js} +1 -1
- package/dist/client/assets/{index-redirect-BYnxpCc2.js → index-redirect-C9ZhbisF.js} +1 -1
- package/dist/client/assets/{index-bvkMWHxC.js → index-tV6K0vzd.js} +1 -1
- package/dist/client/assets/{index-BJW2k06q.js → index-zawK8irL.js} +4 -4
- package/dist/client/assets/{input-C4KTJyA0.js → input-Cdm1NEie.js} +1 -1
- package/dist/client/assets/{integration-icon-BykvWwAZ.js → integration-icon-hz4amrfY.js} +1 -1
- package/dist/client/assets/{label-BHauIX0M.js → label-Vh7XtQX1.js} +1 -1
- package/dist/client/assets/{layout-lz847Nyb.js → layout-C4bROUGO.js} +1 -1
- package/dist/client/assets/{login-CLS37Owv.js → login-BbHLsX9y.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BOevDVjh.js → mcp-oauth-DIztaHu2.js} +1 -1
- package/dist/client/assets/{members-CfcfbKhF.js → members-uiNPsB6a.js} +1 -1
- package/dist/client/assets/{monaco-editor-CthqrNYr.js → monaco-editor-CzCLI82l.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CqZVa71v.js → monitoring-stats-row-BS4JmiNh.js} +1 -1
- package/dist/client/assets/{oauth-callback-BZ0HY_I9.js → oauth-callback-C-boMM2j.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Cl1KMX--.js → oauth-callback-ai-provider-b_VkYeBz.js} +1 -1
- package/dist/client/assets/{onboarding-ruQ3ExNI.js → onboarding-B4lsc8p6.js} +1 -1
- package/dist/client/assets/{org-install-4mo6vwWZ.js → org-install-BqE8DCpi.js} +1 -1
- package/dist/client/assets/{org-layout-Bk_DX0xY.js → org-layout-CuY9xdZF.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-CtDHjWlv.js → org-plugin-layout-BoXoiIeY.js} +1 -1
- package/dist/client/assets/{page-seo-form-BCeF78ys.js → page-seo-form-BAxbjdXf.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BmI1u_IU.js +1 -0
- package/dist/client/assets/{pair-C7vZKi4N.js → pair-BMgj9p8o.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-B9oNmWVA.js → plugin-empty-state-DEB-1M8s.js} +1 -1
- package/dist/client/assets/{plugin-header-DLHKmNhY.js → plugin-header-tcd0nLNy.js} +1 -1
- package/dist/client/assets/{plugin-layout-D6Br2fpA.js → plugin-layout-Ba8uQ5F9.js} +1 -1
- package/dist/client/assets/{popover-DJWCo8Vd.js → popover-CQUbCY9L.js} +1 -1
- package/dist/client/assets/{post-editor-Dlsk3kzy.js → post-editor-h8Kl9Dat.js} +1 -1
- package/dist/client/assets/{primitives-HSATajDh.js → primitives-DMqPWXCZ.js} +1 -1
- package/dist/client/assets/{profile-DqSdE9wJ.js → profile-BX6NyJ96.js} +1 -1
- package/dist/client/assets/project-app-view-C-BhQ4Z6.js +1 -0
- package/dist/client/assets/record-editor-vpJHbkV7.js +1 -0
- package/dist/client/assets/registry-B-LobrAM.js +2 -0
- package/dist/client/assets/{registry-layout-C4BBelJQ.js → registry-layout-Dr55jSnu.js} +1 -1
- package/dist/client/assets/{require-capability-DmyLmLDX.js → require-capability-CMu5fNDT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dxuok_Oj.js → required-auth-layout-D9j7jy0d.js} +1 -1
- package/dist/client/assets/{reset-password-CV_mxpkk.js → reset-password-neZebU-f.js} +1 -1
- package/dist/client/assets/{resizable-C7mpEwlp.js → resizable-_yQxq9nx.js} +1 -1
- package/dist/client/assets/{roles-oRuXLnwx.js → roles-B4FWWYZy.js} +1 -1
- package/dist/client/assets/save-referenced-block-D7Am-8ol.js +1 -0
- package/dist/client/assets/{save-status-BgSlaaCs.js → save-status-C6xYTbl3.js} +1 -1
- package/dist/client/assets/{schema-form-Da4995bk.js → schema-form-DAx4_84I.js} +1 -1
- package/dist/client/assets/{scroll-area-CmHcbXMX.js → scroll-area-C_pJDhCx.js} +1 -1
- package/dist/client/assets/{search-input-B9MwoGwA.js → search-input-wftXnsYu.js} +1 -1
- package/dist/client/assets/{secrets-BAMGlxeq.js → secrets-C0HtJ-0L.js} +1 -1
- package/dist/client/assets/{sections-editor-D3ApReLv.js → sections-editor-CQQfy9r_.js} +1 -1
- package/dist/client/assets/{select-LnPBQlwq.js → select-CvY3LM8v.js} +1 -1
- package/dist/client/assets/{select-model-ePGHlOjM.js → select-model-DzBvb94i.js} +1 -1
- package/dist/client/assets/{seo-editor-C6Dd35Oh.js → seo-editor-BPGCTV6C.js} +1 -1
- package/dist/client/assets/{settings-layout-mD1kpjDi.js → settings-layout-DY5er7_5.js} +1 -1
- package/dist/client/assets/{settings-section-k7IrKbz0.js → settings-section-bgBc23Sj.js} +1 -1
- package/dist/client/assets/{sheet-Da8oGaXl.js → sheet-CUbQ8u3K.js} +1 -1
- package/dist/client/assets/{shell-controls-Ce3YbGzv.js → shell-controls-Cz7KRwiK.js} +1 -1
- package/dist/client/assets/{shell-layout-BppWbDed.js → shell-layout-CTILiI6W.js} +1 -1
- package/dist/client/assets/{shell-route-loading-CHDF1PQc.js → shell-route-loading-ByskgJGc.js} +1 -1
- package/dist/client/assets/{sidebar-Dq7ywuwS.js → sidebar-DUDIX5oW.js} +1 -1
- package/dist/client/assets/{skeleton-Bs5gkyp5.js → skeleton-DOuDuLeH.js} +1 -1
- package/dist/client/assets/{sortable.esm-4vTXIsSP.js → sortable.esm-BRp5_cYM.js} +1 -1
- package/dist/client/assets/{spinner-X0P6H8XF.js → spinner-Ct4FnHpR.js} +1 -1
- package/dist/client/assets/{sso-DAt1PrT3.js → sso-BdyN6bt5.js} +1 -1
- package/dist/client/assets/{store-CFDS2nCg.js → store-B1cXtP5r.js} +1 -1
- package/dist/client/assets/store-registry-DmabX9qc.js +2 -0
- package/dist/client/assets/{studio-tools-DA1cqt_R.js → studio-tools-BniDnWv9.js} +1 -1
- package/dist/client/assets/{switch-BfYG3ZgX.js → switch-DKWXZfes.js} +1 -1
- package/dist/client/assets/{tab-id-D-V9CLoC.js → tab-id-CidWBQZm.js} +1 -1
- package/dist/client/assets/{table-iiadVZtP.js → table-Dey_Txdo.js} +1 -1
- package/dist/client/assets/{tabs-C3ewzjce.js → tabs-Hef74NAR.js} +1 -1
- package/dist/client/assets/{task-status-8O-9w38P.js → task-status-CMI8T9Bj.js} +1 -1
- package/dist/client/assets/{textarea-CSY57hUQ.js → textarea-DI0l_iOE.js} +1 -1
- package/dist/client/assets/{toggle-group-BMs6XIZt.js → toggle-group-CKd_s4i6.js} +1 -1
- package/dist/client/assets/{toolbar-RrHrj-wA.js → toolbar-I4LrNcZp.js} +1 -1
- package/dist/client/assets/{tools-list-BZ21f-qw.js → tools-list-BqO9ZnTK.js} +1 -1
- package/dist/client/assets/{tooltip-C5K2_SxZ.js → tooltip-BJIwJ20V.js} +1 -1
- package/dist/client/assets/{types-By3Vc6ET.js → types-DkSHL0JO.js} +1 -1
- package/dist/client/assets/{use-ai-providers-yQU6QFt7.js → use-ai-providers-BgB6wf9K.js} +1 -1
- package/dist/client/assets/{use-automations-EnJ_KtpR.js → use-automations-C2phvVRr.js} +1 -1
- package/dist/client/assets/{use-capability-IPmcsvJ7.js → use-capability-C2a1p0-_.js} +1 -1
- package/dist/client/assets/{use-clock-tick--JSADwca.js → use-clock-tick-BsB0gkiC.js} +1 -1
- package/dist/client/assets/{use-collections-gQX1aIBb.js → use-collections-CSzXbKpT.js} +1 -1
- package/dist/client/assets/{use-connection-3AMSWY4d.js → use-connection-DWiJ60zQ.js} +1 -1
- package/dist/client/assets/{use-copy-BrRxB_CX.js → use-copy-B92V5YyR.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DbJaPibs.js → use-create-virtual-mcp-CznuB8H8.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-9Ai91Koh.js → use-debounced-autosave-Dlx1T484.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DFI3Wjrd.js → use-delete-connection-DflATvAp.js} +1 -1
- package/dist/client/assets/{use-file-configs-CgPTWHYk.js → use-file-configs-SLkVSBqH.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BdWMzn-I.js → use-infinite-scroll-BovhyqJC.js} +1 -1
- package/dist/client/assets/{use-list-state-C_Png9rc.js → use-list-state-Bq0IeuWL.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DNWGF-S6.js → use-mcp-client-4hZRsKeH.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BFE67i8g.js → use-mcp-prompts-DW6p58bx.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DCnrwBcx.js → use-mcp-tools-DahL_-yT.js} +1 -1
- package/dist/client/assets/{use-members-DdhBt1i2.js → use-members-CJ3raof8.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BGaWNHVu.js → use-navigate-to-agent-CG5oz4s3.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BKj503w6.js → use-org-auth-client-CUK5hmPG.js} +1 -1
- package/dist/client/assets/{use-org-sso-DcIpAKt9.js → use-org-sso-B2AgOe3M.js} +1 -1
- package/dist/client/assets/{use-organization-roles-mEVELLYq.js → use-organization-roles-k4iypw0t.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D-mp9Nom.js → use-organization-settings-C5AMVC8s.js} +1 -1
- package/dist/client/assets/{use-registry-connections-UDMbBrhr.js → use-registry-connections-YslMFzn6.js} +1 -1
- package/dist/client/assets/{use-secrets-CCok2kdj.js → use-secrets-D9xuZ4ne.js} +1 -1
- package/dist/client/assets/{use-status-sounds-C-cdLbOI.js → use-status-sounds-BZklskfJ.js} +1 -1
- package/dist/client/assets/{use-view-mode-DggEE1xi.js → use-view-mode-D5aD93Zo.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C8Cvizcb.js → use-virtual-mcp-Csq3tX42.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DFIrNW-C.js +1 -0
- package/dist/client/assets/{useRouterState-Bu9FaaK6.js → useRouterState-C9mG29tS.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-kjS8l72l.js +1 -0
- package/dist/client/assets/{user-vuU-47pc.js → user-BLO2fGFf.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CSvU0t8g.js → view-mode-toggle-4w01MVLK.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CI_P_tLE.js → watch-sse-pool-DpnWhDEt.js} +1 -1
- package/dist/client/assets/{workflow-BRFJAXXv.js → workflow-D13SKBQn.js} +1 -1
- package/dist/client/assets/workflow-detail-W7As-1ka.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +663 -696
- package/dist/server/server.js +340 -346
- package/package.json +5 -3
- package/dist/client/assets/app-editor-CIhW2hZX.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-DysvnVnY.js +0 -1
- package/dist/client/assets/page-seo-sheet-DEGkKhJQ.js +0 -1
- package/dist/client/assets/project-app-view-C130Qk03.js +0 -1
- package/dist/client/assets/record-editor-ClcHc-Yc.js +0 -1
- package/dist/client/assets/registry-KKV5dp-0.js +0 -2
- package/dist/client/assets/save-referenced-block-C8W_58KS.js +0 -1
- package/dist/client/assets/store-registry-J5_Yu_3b.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BxZ0ZIEY.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BaHJXY7X.js +0 -1
- package/dist/client/assets/workflow-detail-BV03DzYj.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as h,p as I,K as T,q as b,s as C,z as k,j as o}from"./index-
|
|
1
|
+
import{e as h,p as I,K as T,q as b,s as C,z as k,j as o}from"./index-DElySjov.js";import{i as N}from"./mcp-oauth-DIztaHu2.js";import{B as x}from"./badge-JwkDS5Iu.js";import{b as y,T as j,a as g,c as S}from"./tooltip-BJIwJ20V.js";import{g as _}from"./types-DkSHL0JO.js";import{s as $}from"./Eye-BMnHz-k1.js";import{s as A}from"./Star01-5MkCH9IF.js";import{a9 as w}from"./agent-icon-DWieO6vE.js";function M(m){const e=h.c(11),{connectionId:a}=m,{org:r}=I();let i,t,l;e[0]!==a||e[1]!==r.slug?(i=new URL(`/api/${r.slug}/mcp/${a}`,window.location.origin),l=b,t=T.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=()=>N({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}const H=[{key:"readOnlyHint",label:"Read-only",Icon:$,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:C,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:k,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:A,variant:"outline"}];function D(m){const e=h.c(18),{annotations:a,_meta:r}=m;let i;e[0]!==r?(i=_(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=S,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(w,{})})}),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)}export{D as T,M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as c,a4 as H,bf as Z,be as ee,du as te,bu as $,dv as oe,a5 as b,bh as G,dw as re,dx as z,dy as ne,dz as se,ad as ae,dA as ie,dB as le,e as _,c as ce}from"./index-
|
|
1
|
+
import{r as a,j as c,a4 as H,bf as Z,be as ee,du as te,bu as $,dv as oe,a5 as b,bh as G,dw as re,dx as z,dy as ne,dz as se,ad as ae,dA as ie,dB as le,e as _,c as ce}from"./index-DElySjov.js";var ue=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",B=a.forwardRef((o,e)=>c.jsx(H.span,{...o,ref:e,style:{...ue,...o.style}}));B.displayName=de;var pe=B,[O]=ae("Tooltip",[z]),D=z(),V="TooltipProvider",fe=700,A="tooltip.open",[ve,k]=O(V),F=o=>{const{__scopeTooltip:e,delayDuration:t=fe,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,i=a.useRef(!0),d=a.useRef(!1),l=a.useRef(0);return a.useEffect(()=>{const p=l.current;return()=>window.clearTimeout(p)},[]),c.jsx(ve,{scope:e,isOpenDelayedRef:i,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};F.displayName=V;var R="Tooltip",[he,j]=O(R),Y=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:i,delayDuration:d}=o,l=k(R,o.__scopeTooltip),p=D(e),[u,v]=a.useState(null),h=Z(),f=a.useRef(0),x=i??l.disableHoverableContent,m=d??l.delayDuration,g=a.useRef(!1),[y,T]=ee({prop:r,defaultProp:n??!1,onChange:S=>{S?(l.onOpen(),document.dispatchEvent(new CustomEvent(A))):l.onClose(),s?.(S)},caller:R}),w=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,T(!0)},[T]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),N=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,T(!0),f.current=0},m)},[m,T]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(te,{...p,children:c.jsx(he,{scope:e,contentId:h,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{l.isOpenDelayedRef.current?N():E()},[l.isOpenDelayedRef,N,E]),onTriggerLeave:a.useCallback(()=>{x?P():(window.clearTimeout(f.current),f.current=0)},[P,x]),onOpen:E,onClose:P,disableHoverableContent:x,children:t})})};Y.displayName=R;var M="TooltipTrigger",U=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=j(M,t),s=k(M,t),i=D(t),d=a.useRef(null),l=$(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(oe,{asChild:!0,...i,children:c.jsx(H.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:l,onPointerMove:b(o.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:b(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:b(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:b(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:b(o.onBlur,n.onClose),onClick:b(o.onClick,n.onClose)})})});U.displayName=M;var I="TooltipPortal",[xe,ge]=O(I,{forceMount:void 0}),q=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=j(I,e);return c.jsx(xe,{scope:e,forceMount:t,children:c.jsx(G,{present:t||s.open,children:c.jsx(re,{asChild:!0,container:n,children:r})})})};q.displayName=I;var C="TooltipContent",W=a.forwardRef((o,e)=>{const t=ge(C,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,i=j(C,o.__scopeTooltip);return c.jsx(G,{present:r||i.open,children:i.disableHoverableContent?c.jsx(K,{side:n,...s,ref:e}):c.jsx(me,{side:n,...s,ref:e})})}),me=a.forwardRef((o,e)=>{const t=j(C,o.__scopeTooltip),r=k(C,o.__scopeTooltip),n=a.useRef(null),s=$(e,n),[i,d]=a.useState(null),{trigger:l,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,h=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((x,m)=>{const g=x.currentTarget,y={x:x.clientX,y:x.clientY},T=Ce(y,g.getBoundingClientRect()),w=we(y,T),E=Ee(m.getBoundingClientRect()),P=Re([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(l&&u){const x=g=>f(g,u),m=g=>f(g,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",m)}}},[l,u,f,h]),a.useEffect(()=>{if(i){const x=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},T=l?.contains(g)||u?.contains(g),w=!Pe(y,i);T?h():w&&(h(),p())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,i,p,h]),c.jsx(K,{...o,ref:s})}),[Te,ye]=O(R,{isInside:!1}),be=ie("TooltipContent"),K=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:i,...d}=o,l=j(C,t),p=D(t),{onClose:u}=l;return a.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),a.useEffect(()=>{if(l.trigger){const v=h=>{h.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[l.trigger,u]),c.jsx(ne,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(se,{"data-state":l.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(be,{children:r}),c.jsx(Te,{scope:t,isInside:!0,children:c.jsx(pe,{id:l.contentId,role:"tooltip",children:n||r})})]})})});W.displayName=C;var X="TooltipArrow",J=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return ye(X,t).isInside?null:c.jsx(le,{...n,...r,ref:e})});J.displayName=X;function Ce(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function we(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function Ee(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function Pe(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const d=e[s],l=e[i],p=d.x,u=d.y,v=l.x,h=l.y;u>r!=h>r&&t<(v-p)*(r-u)/(h-u)+p&&(n=!n)}return n}function Re(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),_e(e)}function _e(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(n.y-i.y)>=(s.y-i.y)*(n.x-i.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(n.y-i.y)>=(s.y-i.y)*(n.x-i.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var je=F,Oe=Y,De=U,Le=q,Ae=W,Me=J;const Q=768,L=()=>globalThis.innerWidth<Q;function Ne(){const o=_.c(2),[e,t]=a.useState(L);let r,n;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const s=()=>t(L),i=globalThis.matchMedia(`(max-width: ${Q-1}px)`);return i.addEventListener("change",s),t(L),()=>i.removeEventListener("change",s)},n=[],o[0]=r,o[1]=n):(r=o[0],n=o[1]),a.useEffect(r,n),e}function ke(o){const e=_.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(je,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Se(o){const e=_.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(ke,{children:c.jsx(Oe,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function He(o){const e=_.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(De,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function $e(o){const e=_.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const i=s===void 0?0:s;let d;e[5]!==r?(d=ce("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(Me,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=l):l=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==i||e[11]!==d?(p=c.jsx(Le,{children:c.jsxs(Ae,{"data-slot":"tooltip-content",sideOffset:i,className:d,...n,children:[t,l]})}),e[8]=t,e[9]=n,e[10]=i,e[11]=d,e[12]=p):p=e[12],p}export{He as T,ue as V,$e as a,Se as b,ke as c,Ne as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bS as p,bm as t,aG as y,R as a,bT as q,P as s,aH as f,aE as u,Q as m,b7 as x,bU as O,bV as fe,bW as ge,bX as $,bY as j,bZ as be,b_ as ye,b$ as B,c0 as Se,c1 as _e,c2 as He,c3 as Me,c4 as ke,c5 as Pe,c6 as qe,c7 as Te,c8 as Ie,c9 as Ee,ca as Le,cb as ze,cc as Ue,cd as Ae,ce as De,cf as Ne,cg as Oe,r as te,e as V,j as b,ch as je,ci as $e,t as Be,c as oe}from"./index-
|
|
1
|
+
import{bS as p,bm as t,aG as y,R as a,bT as q,P as s,aH as f,aE as u,Q as m,b7 as x,bU as O,bV as fe,bW as ge,bX as $,bY as j,bZ as be,b_ as ye,b$ as B,c0 as Se,c1 as _e,c2 as He,c3 as Me,c4 as ke,c5 as Pe,c6 as qe,c7 as Te,c8 as Ie,c9 as Ee,ca as Le,cb as ze,cc as Ue,cd as Ae,ce as De,cf as Ne,cg as Oe,r as te,e as V,j as b,ch as je,ci as $e,t as Be,c as oe}from"./index-DElySjov.js";import{P as Ve}from"./use-mcp-client-4hZRsKeH.js";const le=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function Fe(r,e={}){const i=`<meta http-equiv="Content-Security-Policy" content="${Ke(e)}">`,n=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,l=r.match(n);if(l){const g=(l.index??0)+l[0].length;return r.slice(0,g)+`
|
|
2
2
|
`+i+r.slice(g)}const c=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,d=r.match(c);if(d){const g=(d.index??0)+d[0].length;return r.slice(0,g)+`
|
|
3
3
|
<head>
|
|
4
4
|
`+i+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as g,p as f,q as _,K as m,m as I}from"./index-
|
|
1
|
+
import{e as g,p as f,q as _,K as m,m as I}from"./index-DElySjov.js";import{a as S,u as P}from"./use-mcp-client-4hZRsKeH.js";function A(t,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>(await t.callTool({name:"AI_PROVIDER_KEY_LIST",arguments:{}})).structuredContent??null}}function p(){const t=g.c(10),{org:e}=f();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:S,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=P(s);let i;t[3]!==e.id?(i=m.aiProviders(e.id),t[3]=e.id,t[4]=i):i=t[4];let l;t[5]!==o?(l=async()=>(await o.callTool({name:"AI_PROVIDERS_LIST",arguments:{}})).structuredContent,t[5]=o,t[6]=l):l=t[6];let n;t[7]!==i||t[8]!==l?(n={queryKey:i,staleTime:1/0,queryFn:l},t[7]=i,t[8]=l,t[9]=n):n=t[9];const{data:r}=_(n);return r}function q(){const t=g.c(8),{org:e}=f();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:S,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=P(s);let i;t[3]!==o||t[4]!==e.id?(i=A(o,e.id),t[3]=o,t[4]=e.id,t[5]=i):i=t[5];const{data:l}=_(i);let n;return t[6]!==l?.keys?(n=l?.keys??[],t[6]=l?.keys,t[7]=n):n=t[7],n}function v(t){const e=g.c(18),{org:s}=f();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:S,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const i=P(o);let l;e[3]!==t||e[4]!==s.id?(l=m.aiProviderModels(s.id,t??""),e[3]=t,e[4]=s.id,e[5]=l):l=e[5];const n=!!t;let r;e[6]!==i||e[7]!==t?(r=async()=>(await i.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[6]=i,e[7]=t,e[8]=r):r=e[8];let u;e[9]!==l||e[10]!==n||e[11]!==r?(u={queryKey:l,enabled:n,staleTime:6e4,queryFn:r},e[9]=l,e[10]=n,e[11]=r,e[12]=u):u=e[12];const{data:a,isLoading:T}=I(u);let c;e[13]!==a?.models?(c=a?.models??[],e[13]=a?.models,e[14]=c):c=e[14];const y=!!t&&T;let d;return e[15]!==c||e[16]!==y?(d={models:c,isLoading:y},e[15]=c,e[16]=y,e[17]=d):d=e[17],d}function R(t){const e=g.c(14),{org:s}=f();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:S,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const i=P(o);let l;e[3]!==t||e[4]!==s.id?(l=m.aiProviderModels(s.id,t),e[3]=t,e[4]=s.id,e[5]=l):l=e[5];let n;e[6]!==i||e[7]!==t?(n=async()=>(await i.callTool({name:"AI_PROVIDERS_LIST_MODELS",arguments:{keyId:t}})).structuredContent??null,e[6]=i,e[7]=t,e[8]=n):n=e[8];let r;e[9]!==l||e[10]!==n?(r={queryKey:l,staleTime:6e4,queryFn:n},e[9]=l,e[10]=n,e[11]=r):r=e[11];const{data:u}=_(r);let a;return e[12]!==u?.models?(a=u?.models??[],e[12]=u?.models,e[13]=a):a=e[13],a}export{A as a,v as b,p as c,R as d,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as U,p as q,K as T,m as x,F as V,a as f,n as g}from"./index-
|
|
1
|
+
import{e as U,p as q,K as T,m as x,F as V,a as f,n as g}from"./index-DElySjov.js";import{a as D,u as G}from"./use-mcp-client-4hZRsKeH.js";function Y(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),o=t??D;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==o?(a={connectionId:o,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o,e[3]=a):a=e[3];const u=G(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let r;e[6]!==u?(r=async()=>{const d=await u.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(Y)},e[6]=u,e[7]=r):r=e[7];const l=!!t;let c;return e[8]!==n||e[9]!==r||e[10]!==l?(c={queryKey:n,queryFn:r,enabled:l,staleTime:3e4},e[8]=n,e[9]=r,e[10]=l,e[11]=c):c=e[11],x(c)}function nt(t){const e=U.c(12),{org:s}=q();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:D,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const a=G(o);let u;e[3]!==s.id||e[4]!==t?(u=T.automations(s.id,t),e[3]=s.id,e[4]=t,e[5]=u):u=e[5];let n;e[6]!==a||e[7]!==t?(n=async()=>{const l=t!=null?{virtual_mcp_id:t}:{},c=await a.callTool({name:"AUTOMATION_LIST",arguments:l});return(c.structuredContent??c).automations},e[6]=a,e[7]=t,e[8]=n):n=e[8];let r;return e[9]!==u||e[10]!==n?(r={queryKey:u,queryFn:n,staleTime:1e4},e[9]=u,e[10]=n,e[11]=r):r=e[11],x(r)}function ot(t){const e=U.c(13),{org:s}=q();let o;e[0]!==s.id||e[1]!==s.slug?(o={connectionId:D,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=o):o=e[2];const a=G(o);let u;e[3]!==t||e[4]!==s.id?(u=T.automation(s.id,t),e[3]=t,e[4]=s.id,e[5]=u):u=e[5];let n;e[6]!==a||e[7]!==t?(n=async()=>{const c=await a.callTool({name:"AUTOMATION_GET",arguments:{id:t}});return(c.structuredContent??c).automation},e[6]=a,e[7]=t,e[8]=n):n=e[8];const r=!!t;let l;return e[9]!==u||e[10]!==n||e[11]!==r?(l={queryKey:u,queryFn:n,enabled:r,staleTime:1e4},e[9]=u,e[10]=n,e[11]=r,e[12]=l):l=e[12],x(l)}function it(t,e){const s=U.c(15),{org:o}=q();let a;s[0]!==o.id||s[1]!==o.slug?(a={connectionId:D,orgId:o.id,orgSlug:o.slug},s[0]=o.id,s[1]=o.slug,s[2]=a):a=s[2];const u=G(a);let n;s[3]!==t||s[4]!==o.id||s[5]!==e?(n=T.automationRunStats(o.id,t,JSON.stringify(e??{})),s[3]=t,s[4]=o.id,s[5]=e,s[6]=n):n=s[6];let r;s[7]!==t||s[8]!==u||s[9]!==e?(r=async()=>{const d=await u.callTool({name:"AUTOMATION_RUN_STATS",arguments:{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}});return d.structuredContent??d},s[7]=t,s[8]=u,s[9]=e,s[10]=r):r=s[10];const l=!!t;let c;return s[11]!==n||s[12]!==r||s[13]!==l?(c={queryKey:n,queryFn:r,enabled:l,staleTime:3e4},s[11]=n,s[12]=r,s[13]=l,s[14]=c):c=s[14],x(c)}function at(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function rt(){const t=U.c(67),{org:e}=q();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:D,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const o=G(s),a=V();let u;t[3]!==e.id||t[4]!==a?(u=()=>a.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[3]=e.id,t[4]=a,t[5]=u):u=t[5];const n=u;let r;t[6]!==e.id||t[7]!==a?(r=m=>a.invalidateQueries({queryKey:T.automation(e.id,m)}),t[6]=e.id,t[7]=a,t[8]=r):r=t[8];const l=r;let c;t[9]!==o?(c=async m=>{const i=await o.callTool({name:"AUTOMATION_CREATE",arguments:m});return i.structuredContent??i},t[9]=o,t[10]=c):c=t[10];let d;t[11]!==n?(d=()=>{n(),g.success("Automation created successfully")},t[11]=n,t[12]=d):d=t[12];let N;t[13]!==c||t[14]!==d?(N={mutationFn:c,onSuccess:d,onError:Z},t[13]=c,t[14]=d,t[15]=N):N=t[15];const k=f(N);let y;t[16]!==o?(y=async m=>{const i=await o.callTool({name:"AUTOMATION_UPDATE",arguments:m});return i.structuredContent??i},t[16]=o,t[17]=y):y=t[17];let _;t[18]!==n||t[19]!==l?(_=(m,i)=>{n(),typeof i.id=="string"&&l(i.id),g.success("Automation updated successfully")},t[18]=n,t[19]=l,t[20]=_):_=t[20];let $;t[21]!==y||t[22]!==_?($={mutationFn:y,onSuccess:_,onError:X},t[21]=y,t[22]=_,t[23]=$):$=t[23];const Q=f($);let A;t[24]!==o?(A=async m=>{const i=await o.callTool({name:"AUTOMATION_DELETE",arguments:{id:m}});return i.structuredContent??i},t[24]=o,t[25]=A):A=t[25];let p;t[26]!==n||t[27]!==e.id||t[28]!==a?(p=(m,i)=>{a.removeQueries({queryKey:T.automation(e.id,i)}),n(),g.success("Automation deleted successfully")},t[26]=n,t[27]=e.id,t[28]=a,t[29]=p):p=t[29];let K;t[30]!==p||t[31]!==A?(K={mutationFn:A,onSuccess:p,onError:W},t[30]=p,t[31]=A,t[32]=K):K=t[32];const j=f(K);let E;t[33]!==o?(E=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:m});if(i.isError){const I=i.content?.[0]?.text??"Failed to add trigger";throw new Error(I)}return i.structuredContent??i},t[33]=o,t[34]=E):E=t[34];let S;t[35]!==n||t[36]!==l?(S=m=>{n(),l(m.automation_id)},t[35]=n,t[36]=l,t[37]=S):S=t[37];let w;t[38]!==E||t[39]!==S?(w={mutationFn:E,onSuccess:S},t[38]=E,t[39]=S,t[40]=w):w=t[40];const P=f(w);let O;t[41]!==o?(O=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_ROTATE_TOKEN",arguments:{trigger_id:m.trigger_id}});if(i.isError){const I=i.content?.[0]?.text??"Failed to rotate token";throw new Error(I)}return i.structuredContent??i},t[41]=o,t[42]=O):O=t[42];let F;t[43]!==n||t[44]!==l?(F=(m,i)=>{n(),l(i.automation_id)},t[43]=n,t[44]=l,t[45]=F):F=t[45];let b;t[46]!==O||t[47]!==F?(b={mutationFn:O,onSuccess:F},t[46]=O,t[47]=F,t[48]=b):b=t[48];const v=f(b);let R;t[49]!==o?(R=async m=>{const i=await o.callTool({name:"AUTOMATION_TRIGGER_REMOVE",arguments:{trigger_id:m.trigger_id}});return i.structuredContent??i},t[49]=o,t[50]=R):R=t[50];let C;t[51]!==n||t[52]!==l?(C=(m,i)=>{n(),l(i.automation_id)},t[51]=n,t[52]=l,t[53]=C):C=t[53];let L;t[54]!==R||t[55]!==C?(L={mutationFn:R,onSuccess:C},t[54]=R,t[55]=C,t[56]=L):L=t[56];const z=f(L);let M;t[57]!==o?(M={mutationFn:async m=>{const i=await o.callTool({name:"AUTOMATION_RUN",arguments:{id:m}});if(i.isError){const I=i.content?.[0]?.text??"Failed to run automation";throw new Error(I)}return i.structuredContent??i},onSuccess:H,onError:B},t[57]=o,t[58]=M):M=t[58];const J=f(M);let h;return t[59]!==k||t[60]!==j||t[61]!==J||t[62]!==P||t[63]!==z||t[64]!==v||t[65]!==Q?(h={create:k,update:Q,remove:j,triggerAdd:P,triggerRemove:z,triggerRotateToken:v,run:J},t[59]=k,t[60]=j,t[61]=J,t[62]=P,t[63]=z,t[64]=v,t[65]=Q,t[66]=h):h=t[66],h}function B(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to run automation: ${e}`)}function H(t){t.skipped?g.info(`Automation skipped: ${t.skipped}`):t.error?g.error(`Automation failed: ${t.error}`):g.success("Automation triggered")}function W(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to delete automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to update automation: ${e}`)}function Z(t){const e=t instanceof Error?t.message:String(t);g.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,nt as c,at as d,it as e,rt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as u,p as m,m as g,K as p}from"./index-
|
|
1
|
+
import{e as u,p as m,m as g,K as p}from"./index-DElySjov.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let o;e[0]!==c?(o=p.myCapabilities(c),e[0]=c,e[1]=o):o=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==o||e[5]!==a?(i={queryKey:o,queryFn:a,staleTime:3e4,retry:2},e[4]=o,e[5]=a,e[6]=i):i=e[6];const{data:s,isLoading:l,isError:n}=g(i);let t;return e[7]!==s||e[8]!==n||e[9]!==l?(t={data:s,loading:l,error:n},e[7]=s,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:o,error:a}=d();if(o){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const s=c?.capabilities?.[e]===!0,l=s?"role":"denied";let n;return r[5]!==s||r[6]!==l?(n={granted:s,loading:!1,error:!1,reason:l},r[5]=s,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:o}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const s=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:o,isPrivileged:s,roleSlug:a},e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a}from"./differenceInSeconds-NQ4PDo0z.js";import{e as u,r as f}from"./index-
|
|
1
|
+
import{d as a}from"./differenceInSeconds-NQ4PDo0z.js";import{e as u,r as f}from"./index-DElySjov.js";function p(r){const t=a(new Date,r);return t<60?"<1m":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:t<604800?`${Math.floor(t/86400)}d ago`:t<2592e3?`${Math.floor(t/604800)}w ago`:t<31536e3?`${Math.floor(t/2592e3)}mo ago`:`${Math.floor(t/31536e3)}y ago`}function g(r){if(r==null||r==="")return null;const t=r instanceof Date?r.getTime():Date.parse(r);return Number.isFinite(t)?t:null}function h(r,t){const e=t-r;return e>0?e:0}function M(r){if(r<60)return`${r.toFixed(1)}s`;const t=Math.round(r%60*10)/10,e=t>=60?1:0;return`${Math.floor(r/60)+e}m ${(e?0:t).toFixed(1)}s`}const s=new Map;function i(r){let t=s.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},s.set(r,t)),t}function l(r,t){const e=i(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const n of e.subscribers)n()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function $(r){const t=u.c(3),e=r===void 0?6e4:r;let n,o;return t[0]!==e?(n=c=>l(e,c),o=()=>i(e).tick,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),f.useSyncExternalStore(n,o,m)}function m(){return 0}export{M as a,h as c,p as f,g as t,$ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as q,F as b,a as A,q as v,aL as x,n as _}from"./index-
|
|
1
|
+
import{e as q,F as b,a as A,q as v,aL as x,n as _}from"./index-DElySjov.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:x.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=q.c(5);let r;n[0]!==t||n[1]!==s||n[2]!==o||n[3]!==e?(r=D(e,s,o,t),n[0]=t,n[1]=s,n[2]=o,n[3]=e,n[4]=r):r=n[4];const{data:a}=v(r);return a?.item??null}const K={structuredContent:{items:[]},isError:!1};function z(e,s,o,t={}){const{searchTerm:n,filters:r,sortKey:a,sortDirection:L,searchFields:S=["title","description"],defaultSortKey:h="updated_at",pageSize:g=100,additionalToolArgs:c}=t,l=s.toUpperCase(),f=`COLLECTION_${l}_LIST`,p=Q(n,r,S),T=k(a,L,h),u={...p&&{where:p},...T&&{orderBy:T},limit:g,offset:0,...c},m=JSON.stringify(u),C=x.collectionList(o,e,"",l,m),{data:w}=v({queryKey:C,queryFn:async()=>o?await o.callTool({name:f,arguments:u}):K,staleTime:3e4,retry:!1,select:d=>O(d??{})?.items??[]});return w}function G(e,s,o){const t=q.c(34),n=b();let r;t[0]!==s?(r=s.toUpperCase(),t[0]=s,t[1]=r):r=t[1];const a=r,L=`COLLECTION_${a}_CREATE`,S=`COLLECTION_${a}_UPDATE`,h=`COLLECTION_${a}_DELETE`;let g;t[2]!==n||t[3]!==e||t[4]!==a?(g=()=>{n.invalidateQueries({predicate:E=>{const i=E.queryKey;return i[1]===e&&i[3]==="collection"&&i[4]===a}})},t[2]=n,t[3]=e,t[4]=a,t[5]=g):g=t[5];const c=g;let l;t[6]!==o||t[7]!==L?(l=async E=>{const i=await o.callTool({name:L,arguments:{data:E}});if(i.isError)throw new Error(Array.isArray(i.content)?i.content[0]?.text:String(i.content));return O(i).item},t[6]=o,t[7]=L,t[8]=l):l=t[8];let f;t[9]!==c?(f=()=>{c(),_.success("Item created successfully")},t[9]=c,t[10]=f):f=t[10];let p;t[11]!==l||t[12]!==f?(p={mutationFn:l,onSuccess:f,onError:B},t[11]=l,t[12]=f,t[13]=p):p=t[13];const T=A(p);let u;t[14]!==o||t[15]!==S?(u=async E=>{const{id:i,data:$}=E,U=await o.callTool({name:S,arguments:{id:i,data:$}});return O(U).item},t[14]=o,t[15]=S,t[16]=u):u=t[16];let m;t[17]!==c?(m=()=>{c(),_.success("Item updated successfully")},t[17]=c,t[18]=m):m=t[18];let C;t[19]!==u||t[20]!==m?(C={mutationFn:u,onSuccess:m,onError:R},t[19]=u,t[20]=m,t[21]=C):C=t[21];const w=A(C);let d;t[22]!==o||t[23]!==h?(d=async E=>{const i=await o.callTool({name:h,arguments:{id:E}});return O(i).item.id},t[22]=o,t[23]=h,t[24]=d):d=t[24];let y;t[25]!==c?(y=()=>{c(),_.success("Item deleted successfully")},t[25]=c,t[26]=y):y=t[26];let 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 F=A(N);let I;return t[30]!==T||t[31]!==F||t[32]!==w?(I={create:T,update:w,delete:F},t[30]=T,t[31]=F,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,D as c,j as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as f,p as C}from"./index-
|
|
1
|
+
import{e as f,p as C}from"./index-DElySjov.js";import{u as N,b as O,a as S}from"./use-collections-CSzXbKpT.js";import{a as I,u as p}from"./use-mcp-client-4hZRsKeH.js";function E(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const m=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=p(a);return O(u.id,"CONNECTIONS",A,m)}function _(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=p(n);return N(i.id,"CONNECTIONS",t,l)}function x(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=p(i);return S(o.id,"CONNECTIONS",n)}export{_ as a,x as b,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c,r as n}from"./index-
|
|
1
|
+
import{e as c,r as n}from"./index-DElySjov.js";function p(){const e=c.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async i=>{await navigator.clipboard.writeText(i),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
|
package/dist/client/assets/{use-create-virtual-mcp-DbJaPibs.js → use-create-virtual-mcp-CznuB8H8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as g}from"./index-
|
|
1
|
+
import{e as g}from"./index-DElySjov.js";import{b as f}from"./use-virtual-mcp-Csq3tX42.js";import{l as p}from"./use-navigate-to-agent-CG5oz4s3.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,r=u===void 0?!1:u,t=f(),c=p();let s;e[2]!==t.create||e[3]!==r||e[4]!==c?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return r&&c(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=r,e[4]=c,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
|
package/dist/client/assets/{use-debounced-autosave-9Ai91Koh.js → use-debounced-autosave-Dlx1T484.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u}from"./index-
|
|
1
|
+
import{r as u}from"./index-DElySjov.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-delete-connection-DFI3Wjrd.js → use-delete-connection-DflATvAp.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as H,j as t,p as Q,F as J,r as M,n as F,bi as P,bj as Y}from"./index-
|
|
1
|
+
import{e as H,j as t,p as Q,F as J,r as M,n as F,bi as P,bj as Y}from"./index-DElySjov.js";import{c as I,b as L,d as R,f as q,e as U,g as k,a as K,A as $}from"./alert-dialog-DieQSpJJ.js";import{u as z}from"./studio-tools-BniDnWv9.js";function W(T){const e=H.c(41),{deleteState:s,cancelDelete:i,confirmDelete:c,confirmForceDelete:l}=T,N=s.mode==="deleting";let r;e[0]!==i?(r=w=>{w||i()},e[0]=i,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]!==c?(h=t.jsxs(U,{children:[E,t.jsx(k,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=c,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]!==i?(d=w=>{w||i()},e[15]=i,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 O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=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]=O):O=e[25];let D;e[26]!==C?(D=t.jsxs(L,{children:[m,t.jsx(R,{asChild:!0,children:t.jsxs("div",{children:[C,O]})})]}),e[26]=C,e[27]=D):D=e[27];let b;e[28]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(q,{children:"Cancel"}),e[28]=b):b=e[28];let j;e[29]!==l?(j=t.jsxs(U,{children:[b,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(),i=z(),[c,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:c,requestDelete:n=>{l({mode:"deleting",connection:n})},cancelDelete:()=>{l({mode:"idle"})},confirmDelete:async()=>{if(c.mode!=="deleting")return;const n=c.connection;l({mode:"idle"});try{await i.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(c.mode!=="force-deleting")return;const n=c.connection.id;l({mode:"idle"});try{await i.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as u,p as c,K as r,q as d,m as y,F as C,a as F}from"./index-
|
|
1
|
+
import{e as u,p as c,K as r,q as d,m as y,F as C,a as F}from"./index-DElySjov.js";import{u as f}from"./studio-tools-BniDnWv9.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}=d(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],y(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],F(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],F(l)}export{q as a,_ as b,I as c,E as u};
|
package/dist/client/assets/{use-infinite-scroll-BdWMzn-I.js → use-infinite-scroll-BovhyqJC.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{as as d,dJ as l,dK as v,r as i}from"./index-
|
|
1
|
+
import{as as d,dJ as l,dK as v,r as i}from"./index-DElySjov.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{r as u,e as w}from"./index-
|
|
1
|
+
import{r as u,e as w}from"./index-DElySjov.js";import{u as E}from"./use-view-mode-D5aD93Zo.js";function J(a){const e=`deco-filters-${a}`,[s,i]=u.useState(()=>{try{const t=globalThis.localStorage?.getItem(e);if(t)return JSON.parse(t)}catch(t){console.error("Failed to parse stored filters:",t)}return[]});return[s,t=>{i(t);try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch(l){console.error("Failed to save filters:",l)}}]}function N(a){const e=w.c(7),[s,i]=u.useState(a),[r,t]=u.useState(a?"desc":null);let l;e[0]!==r||e[1]!==s?(l=S=>{s!==S?(i(S),t("asc")):r==="asc"?t("desc"):r==="desc"&&(i(void 0),t(null))},e[0]=r,e[1]=s,e[2]=l):l=e[2];const d=l;let o;return e[3]!==d||e[4]!==r||e[5]!==s?(o={sortKey:s,sortDirection:r,handleSort:d},e[3]=d,e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function W(a){const e=w.c(20),{namespace:s,resource:i,defaultSortKey:r,defaultViewMode:t}=a,l=r===void 0?"title":r,d=t===void 0?"table":t,[o,S]=u.useState(""),b=u.useDeferredValue(o),D=`${s}-${i}`,[p,F]=J(D),c=`mesh-${i}-filter-visible-${s}`;let g;e[0]!==c?(g=()=>globalThis.localStorage?.getItem(c)==="true",e[0]=c,e[1]=g):g=e[1];const[n,x]=u.useState(g);let h;e[2]!==c?(h=T=>{x(T),globalThis.localStorage?.setItem(c,String(T))},e[2]=c,e[3]=h):h=e[3];const f=h;let m;e[4]!==n||e[5]!==f?(m=()=>{f(!n)},e[4]=n,e[5]=f,e[6]=m):m=e[6];const V=m,[$,K]=E(`mesh-${i}-${s}`,d),{sortKey:I,sortDirection:v,handleSort:B}=N(l),M=I;let y;return e[7]!==n||e[8]!==p||e[9]!==B||e[10]!==o||e[11]!==b||e[12]!==f||e[13]!==F||e[14]!==K||e[15]!==v||e[16]!==M||e[17]!==V||e[18]!==$?(y={search:o,searchTerm:b,setSearch:S,filters:p,setFilters:F,filterBarVisible:n,setFilterBarVisible:f,toggleFilterBar:V,viewMode:$,setViewMode:K,sortKey:M,sortDirection:v,handleSort:B},e[7]=n,e[8]=p,e[9]=B,e[10]=o,e[11]=b,e[12]=f,e[13]=F,e[14]=K,e[15]=v,e[16]=M,e[17]=V,e[18]=$,e[19]=y):y=e[19],y}export{W as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cT as le,cU as ue,cV as de,c1 as he,cW as fe,bE as m,bF as w,cX as pe,cY as me,cZ as _e,c_ as A,c$ as ge,d0 as j,d1 as we,d2 as q,d3 as Te,d4 as F,d5 as ye,d6 as ke,d7 as ve,d8 as z,bz as Se,d9 as Ce,da as be,bY as ee,c9 as Re,cf as Ie,cd as Ee,cH as qe,db as Pe,dc as $e,dd as M,de as Ae,df as Me,ce as He,ca as Oe,cb as Ne,cc as xe,c8 as Ue,dg as De,dh as je,di as Fe,c3 as Le,dj as Ve,dk as We,dl as ze,cg as x,e as te,q as se,aL as V}from"./index-8tXBMeIK.js";import{U as P,b as H,c as Q}from"./auth-CoZ_uLWv.js";function N(a){return!!a._zod}function b(a,e){return N(a)?le(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(N(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Qe(a){if(N(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 G(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Qe(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function J(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Je{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(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,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,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,p=new m(h.error.code,h.error.message,h.error.data);l(p)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(w.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(me,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(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(w.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(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(w.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(w.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),A(o)||ge(o)?this._onresponse(o):j(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(w.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:w.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=Te(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={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,p)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...p,relatedRequestId:e.id};o&&!g.relatedTask&&(g.relatedTask={taskId:o});const y=g.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},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,f)).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:w.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),A(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(A(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),A(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(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,F,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(w.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(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(w.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(f=>setTimeout(f,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((f,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 p=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:p};s?.onprogress&&(this._progressHandlers.set(p,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,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(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(p,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(p,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(p);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(p),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,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},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,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=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=J(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=G(e);this._notificationHandlers.set(s,r=>{const o=J(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"&&j(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(w.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(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(w.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(w.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=z.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(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(w.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 f=z.parse({method:"notifications/tasks/status",params:u});await this.notification(f),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function K(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ke(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];K(n)&&K(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Ce();const Be=Se(Ye);function Ze(){const a=new Be({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class Xe{constructor(e){this._ajv=e??Ze()}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 f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new m(w.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(w.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 at=class extends Je{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",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,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=Ke(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(N(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,f)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:p,supportsUrlMode:g}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!p)throw new m(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new m(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,f));if(h.task){const c=b(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(w.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(w.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,f)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,p=await Promise.resolve(t(u,f));if(h.task){const k=b(F,p);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(w.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Ve:We,T=b(y,p);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.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:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.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"},M,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},M,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},He,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Oe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ne,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},M,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},M,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(w.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(w.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(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(w.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},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=De.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,f=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const p=h instanceof Error?h:new Error(String(h));u(p,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const p=setTimeout(f,i);this._listChangedDebounceTimers.set(e,p)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const Ct={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`},ot="self";function nt(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function it(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null},pinned:!1,connections:[]}}const ae=nt("decopilot_"),bt=ae.is,ct=ae.get;function Rt(a){return it({id:ct(a),organizationId:a,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"})}const It={AGENT_MANAGER:a=>`studio-agent-manager_${a}`,AUTOMATION_MANAGER:a=>`studio-automation-manager_${a}`,CONNECTION_MANAGER:a=>`studio-connection-manager_${a}`,STORE_MANAGER:a=>`studio-store-manager_${a}`,BRAND_MANAGER:a=>`studio-brand-manager_${a}`,USAGE_MANAGER:a=>`studio-usage-manager_${a}`};function Et(a){return a?a.startsWith("studio-agent-manager_")||a.startsWith("studio-automation-manager_")||a.startsWith("studio-connection-manager_")||a.startsWith("studio-store-manager_")||a.startsWith("studio-brand-manager_")||a.startsWith("studio-usage-manager_"):!1}const U=a=>[{type:"text",text:a}];function lt(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 f;try{f=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const p=h instanceof Error?h.message:"Network error";return{content:U(p),isError:!0}}if(!f.ok){let h=`${u.name} failed (${f.status})`;try{const p=await f.json();p?.error&&(h=p.error)}catch{}return{content:U(h),isError:!0}}const l=await f.json().catch(()=>({}));return{content:U(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 ut(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 Y 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 B=10,dt=13,I=32;function D(a){}function ht(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=D,onError:t=D,onRetry:s=D,onComment:r}=a,o=[];let n=!0,i,u="",f=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=p(d);v!==""&&o.push(v);return}if(d.indexOf(`
|
|
1
|
+
import{cT as le,cU as ue,cV as de,c1 as he,cW as fe,bE as m,bF as w,cX as pe,cY as me,cZ as _e,c_ as A,c$ as ge,d0 as j,d1 as we,d2 as q,d3 as Te,d4 as F,d5 as ye,d6 as ke,d7 as ve,d8 as z,bz as Se,d9 as Ce,da as be,bY as ee,c9 as Re,cf as Ie,cd as Ee,cH as qe,db as Pe,dc as $e,dd as M,de as Ae,df as Me,ce as He,ca as Oe,cb as Ne,cc as xe,c8 as Ue,dg as De,dh as je,di as Fe,c3 as Le,dj as Ve,dk as We,dl as ze,cg as x,e as te,q as se,aL as V}from"./index-DElySjov.js";import{U as P,b as H,c as Q}from"./auth-CEd3xQ2M.js";function N(a){return!!a._zod}function b(a,e){return N(a)?le(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(N(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Qe(a){if(N(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 G(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Qe(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function J(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Je{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(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,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,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,p=new m(h.error.code,h.error.message,h.error.data);l(p)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(w.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(me,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(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(w.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(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(w.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(w.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),A(o)||ge(o)?this._onresponse(o):j(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(w.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:w.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=Te(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={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,p)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...p,relatedRequestId:e.id};o&&!g.relatedTask&&(g.relatedTask={taskId:o});const y=g.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},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,f)).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:w.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),A(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(A(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),A(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(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,F,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(w.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(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(w.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(f=>setTimeout(f,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((f,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 p=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:p};s?.onprogress&&(this._progressHandlers.set(p,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,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(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(p,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(p,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(p);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(p),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,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},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,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=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=J(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=G(e);this._notificationHandlers.set(s,r=>{const o=J(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"&&j(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(w.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(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(w.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(w.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=z.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(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(w.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 f=z.parse({method:"notifications/tasks/status",params:u});await this.notification(f),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function K(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ke(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];K(n)&&K(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Ce();const Be=Se(Ye);function Ze(){const a=new Be({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class Xe{constructor(e){this._ajv=e??Ze()}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 f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new m(w.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(w.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 at=class extends Je{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",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,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=Ke(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(N(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,f)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:p,supportsUrlMode:g}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!p)throw new m(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new m(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,f));if(h.task){const c=b(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(w.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(w.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,f)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,p=await Promise.resolve(t(u,f));if(h.task){const k=b(F,p);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(w.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Ve:We,T=b(y,p);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.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:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.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"},M,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},M,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},He,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Oe,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ne,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},M,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},M,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(w.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(w.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(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(w.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},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=De.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,f=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const p=h instanceof Error?h:new Error(String(h));u(p,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const p=setTimeout(f,i);this._listChangedDebounceTimers.set(e,p)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const Ct={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`},ot="self";function nt(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function it(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null},pinned:!1,connections:[]}}const ae=nt("decopilot_"),bt=ae.is,ct=ae.get;function Rt(a){return it({id:ct(a),organizationId:a,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"})}const It={AGENT_MANAGER:a=>`studio-agent-manager_${a}`,AUTOMATION_MANAGER:a=>`studio-automation-manager_${a}`,CONNECTION_MANAGER:a=>`studio-connection-manager_${a}`,STORE_MANAGER:a=>`studio-store-manager_${a}`,BRAND_MANAGER:a=>`studio-brand-manager_${a}`,USAGE_MANAGER:a=>`studio-usage-manager_${a}`};function Et(a){return a?a.startsWith("studio-agent-manager_")||a.startsWith("studio-automation-manager_")||a.startsWith("studio-connection-manager_")||a.startsWith("studio-store-manager_")||a.startsWith("studio-brand-manager_")||a.startsWith("studio-usage-manager_"):!1}const U=a=>[{type:"text",text:a}];function lt(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 f;try{f=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const p=h instanceof Error?h.message:"Network error";return{content:U(p),isError:!0}}if(!f.ok){let h=`${u.name} failed (${f.status})`;try{const p=await f.json();p?.error&&(h=p.error)}catch{}return{content:U(h),isError:!0}}const l=await f.json().catch(()=>({}));return{content:U(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 ut(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 Y 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 B=10,dt=13,I=32;function D(a){}function ht(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=D,onError:t=D,onRetry:s=D,onComment:r}=a,o=[];let n=!0,i,u="",f=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=p(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 _=p(c);_!==""&&o.push(_)}function p(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
|
|
3
3
|
`,c);for(;_!==-1;){if(c===_){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0,c=_+1,_=d.indexOf(`
|
|
4
4
|
`,c);continue}const v=d.charCodeAt(c);if(Z(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(f===0&&d.charCodeAt(_+1)===B){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l,m as c,bE as m,bF as f,q as y,aL as n}from"./index-
|
|
1
|
+
import{e as l,m as c,bE as m,bF as f,q as y,aL as n}from"./index-DElySjov.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{g as a,b as g,u as l,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as m,m as p,q,aL as T,a as C}from"./index-
|
|
1
|
+
import{e as m,m as p,q,aL as T,a as C}from"./index-DElySjov.js";function K(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],q(n)}function M(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],p(n)}function O(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=q,i=s,n=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==r||e[19]!==y?(c={...i,queryKey:n,queryFn:r,staleTime:y,retry:!1},e[16]=i,e[17]=n,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function w(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=p,i=s,n=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==r||e[19]!==y?(c={...i,queryKey:n,queryFn:r,staleTime:y,retry:!1},e[16]=i,e[17]=n,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function F(a){const e=m.c(8);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async i=>await t.callTool(i),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{K as a,M as b,O as c,F as d,w as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,p as i,q as l,K as m}from"./index-
|
|
1
|
+
import{e as n,p as i,q as l,K as m}from"./index-DElySjov.js";import{u as a}from"./use-org-auth-client-CUK5hmPG.js";function f(){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{f as u};
|
package/dist/client/assets/{use-navigate-to-agent-BGaWNHVu.js → use-navigate-to-agent-CG5oz4s3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as v,r as f,e as C,j,f as N,p as D,b as F}from"./index-
|
|
1
|
+
import{L as v,r as f,e as C,j,f as N,p as D,b as F}from"./index-DElySjov.js";import{a as q}from"./use-virtual-mcp-Csq3tX42.js";const h="__tool_call_runs__",U=["requires_action","in_progress","failed","expired","completed"];function ee(e){const t=new Map(U.map(r=>[r,[]]));for(const r of e){const n=r.status??"completed";(t.get(n)??t.get("completed")).push(r)}return U.map(r=>({status:r,threads:t.get(r)}))}function te(e,t){const r=new Map;for(const u of e){if(u.id.startsWith("thrd_welcome_"))continue;const c=u.virtual_mcp_id??h,a=r.get(c);a?(a.threads.push(u),(u.updated_at??"")>a.latestUpdatedAt&&(a.latestUpdatedAt=u.updated_at??"")):r.set(c,{virtualMcpId:c,threads:[u],latestUpdatedAt:u.updated_at??""})}const n=t!==null?r.get(t):void 0;n&&t&&r.delete(t);const s=r.get(h);s&&r.delete(h);const o=[...r.values()].sort((u,c)=>c.latestUpdatedAt.localeCompare(u.latestUpdatedAt)),i=[];return n&&n.threads.length>0&&i.push(n),i.push(...o),s&&s.threads.length>0&&i.push(s),i}const R=new Map,A=new Map;function P(e){return`${e.orgId}:${e.userId}`}function E(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(n=>typeof n=="string"):[]}catch{return[]}}function T(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function k(e){const t=P(e),r=R.get(t);if(r)return r;const n=v.sidebarGroupOrder(e.orgId,e.userId);let s=!1;try{s=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!s&&o.length===0&&e.userId!=="anon"){const i=O(E(e.orgId));i.length>0&&(o=i)}return R.set(t,o),o}function p(e,t){const r=new Set(t);return k(e).filter(n=>!r.has(n))}function g(e,t){R.set(P(e),t),T(v.sidebarGroupOrder(e.orgId,e.userId),t)}function m(e){const t=A.get(e);if(t)return t;const r=O(v.sidebarOrgPinnedOrder(e));return A.set(e,r),r}function S(e,t){A.set(e,t),T(v.sidebarOrgPinnedOrder(e),t)}function re(e,t){g(e,t)}function ne(e,t){S(e,t)}function L(e,t){return e===t||e===h}function w(e,t){return t.includes(e)}function B(e,t){return e.map(r=>r.virtualMcpId).filter(r=>!L(r,t))}function se(e,t,r,n){const s=new Set(n);return B(e,r).filter(o=>t==="org"?s.has(o):!s.has(o))}function J(e,t){const r=new Set(e),n=t.filter(s=>!r.has(s));return n.length===0?e:[...e,...n]}function oe(e,t,r){const n=new Set(r),s=[],o=[];let i,u;for(const c of e){const a=c.virtualMcpId;if(t&&a===t){i=c;continue}if(a===h){u=c;continue}if(n.has(a)){s.push(c);continue}o.push(c)}return{decopilot:i,orgPinned:s,user:o,toolCallRuns:u}}function $(e,t,r,n=[],s=[]){const o=r?e.find(d=>d.virtualMcpId===r):void 0,i=e.find(d=>d.virtualMcpId===h),u=new Set(n),c=n.filter(d=>!L(d,r)),a=J(s,c),l=t.filter(d=>!u.has(d)),_=new Map(e.map(d=>[d.virtualMcpId,d])),b=d=>{const I=_.get(d);return I||{virtualMcpId:d,threads:[],latestUpdatedAt:""}},G=a.filter(d=>u.has(d)).map(b),K=l.map(b),x=[];return o&&x.push(o),x.push(...G,...K),i&&x.push(i),{groups:x,userOrder:l,orgOrder:G.map(d=>d.virtualMcpId)}}function Y(e,t){const r=new Set(t);m(e.orgId).length===0&&t.length>0&&S(e.orgId,[...t]);const s=v.sidebarGroupOrder(e.orgId,e.userId);if(O(s).length>0)return;const o=O(E(e.orgId));if(o.length===0)return;const i=o.filter(u=>!r.has(u));g(e,i)}function M(e,t){const r=new Set(t),n=k(e),s=n.filter(o=>!r.has(o));s.length!==n.length&&g(e,s)}function ie(e,t,r,n=[]){Y(e,n),M(e,n);const s=p(e,n),o=m(e.orgId),{userOrder:i,orgOrder:u}=$(t,s,r,n,o);(i.length!==s.length||i.some((c,a)=>c!==s[a]))&&g(e,i),(u.length!==o.length||u.some((c,a)=>c!==o[a]))&&S(e.orgId,u)}function ue(e,t,r,n=[]){const s=p(e,n),o=m(e.orgId);return $(t,s,r,n,o).groups}function ae(e,t,r){if(r){const o=p(e,[t]).filter(u=>u!==t);g(e,o);const i=m(e.orgId);i.includes(t)||S(e.orgId,[...i,t]);return}const n=m(e.orgId).filter(o=>o!==t);S(e.orgId,n);const s=p(e,[]);s.includes(t)||g(e,[...s,t])}function W(e,t,r=[]){if(r.includes(t))return;const n=p(e,r);n.includes(t)||g(e,[t,...n])}function ce(e,t,r=[]){const n=p(e,r),s=n.filter(o=>o!==t);s.length!==n.length&&g(e,s)}function de(e,t,r){const n=e.indexOf(t),s=e.indexOf(r);if(n===-1||s===-1||n===s)return e;const o=[...e],[i]=o.splice(n,1);return i===void 0?e:(o.splice(s,0,i),o)}function le(e,t,r,n){if(e==="org")return n;const s=p(t,r),o=new Set(n),i=s.filter(u=>!o.has(u));return[...n,...i]}function fe(e,t,r){const n=w(e,r),s=w(t,r);return n===s}const y=f.createContext(null);function ge(e){const t=C.c(7),{children:r}=e,[n,s]=f.useState(!1),[o,i]=f.useState(0);let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i(z),t[0]=u):u=t[0];const c=u;let a;t[1]!==n||t[2]!==o?(a={empty:n,setEmpty:s,orderRevision:o,bumpOrderRevision:c},t[1]=n,t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==r||t[5]!==a?(l=j.jsx(y.Provider,{value:a,children:r}),t[4]=r,t[5]=a,t[6]=l):l=t[6],l}function z(e){return e+1}function pe(){return f.useContext(y)?.empty??!1}function he(){return f.useContext(y)?.orderRevision??0}function H(){return f.useContext(y)?.bumpOrderRevision??Q}function Q(){}function Oe(e){const{value:t}=e,r=f.useContext(y),[n,s]=f.useState(null);return r&&n!==t&&(r.setEmpty(t),s(t)),null}function X(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function me(){const e=C.c(9),t=N(),{org:r}=D(),n=q(),{data:s}=F.useSession(),o=s?.user?.id??"anon";let i;e[0]!==n?(i=X(n),e[0]=n,e[1]=i):i=e[1];const u=i,c=H();let a;return e[2]!==c||e[3]!==t||e[4]!==r.id||e[5]!==r.slug||e[6]!==u||e[7]!==o?(a=(l,_)=>{W({orgId:r.id,userId:o},l,u),c();const b=crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:b},search:{..._?.search??{},virtualmcpid:l}})},e[2]=c,e[3]=t,e[4]=r.id,e[5]=r.slug,e[6]=u,e[7]=o,e[8]=a):a=e[8],a}export{Oe as S,h as T,H as a,W as b,fe as c,le as d,ne as e,re as f,X as g,ie as h,ue as i,he as j,te as k,me as l,ee as m,ce as n,ae as o,oe as p,ge as q,de as r,se as s,pe as u};
|
package/dist/client/assets/{use-org-auth-client-BKj503w6.js → use-org-auth-client-CUK5hmPG.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as x,p as j,b as i}from"./index-
|
|
1
|
+
import{e as x,p as j,b as i}from"./index-DElySjov.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as u,m as S,F as l,a as y,K as c}from"./index-
|
|
1
|
+
import{e as u,m as S,F as l,a as y,K as c}from"./index-DElySjov.js";function w(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoStatus(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/status`);if(!r.ok)throw new Error("Failed to check SSO status");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function m(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoConfig(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`);if(!r.ok)throw new Error("Failed to fetch SSO config");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function q(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!f.ok){const p=await f.json();throw new Error(p.error||"Failed to save SSO config")}return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function C(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`,{method:"DELETE"});if(!r.ok)throw new Error("Failed to delete SSO config");return r.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function O(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:r})});if(!f.ok)throw new Error("Failed to toggle SSO enforcement");return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}export{m as a,q as b,C as c,O as d,w as u};
|
package/dist/client/assets/{use-organization-roles-mEVELLYq.js → use-organization-roles-k4iypw0t.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as R}from"./use-org-auth-client-
|
|
1
|
+
import{u as R}from"./use-org-auth-client-CUK5hmPG.js";import{p as b,m as P,K as y}from"./index-DElySjov.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:p,allowsAllConnections:m,toolNames:g,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:p.length,allowsAllConnections:m,toolCount:d?-1:g.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
|