decocms 4.542.0 → 4.542.1
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/{ActiveShapeUtils-ppN64tl0.js → ActiveShapeUtils-CTNIR1uo.js} +1 -1
- package/dist/client/assets/{AlertCircle-RV4AM_8y.js → AlertCircle-Hdww5hle.js} +1 -1
- package/dist/client/assets/{AreaChart-B5eHYCMZ.js → AreaChart-C_-vf7HG.js} +1 -1
- package/dist/client/assets/{ArrowLeft-XO66B9Td.js → ArrowLeft-BdhX_ELF.js} +1 -1
- package/dist/client/assets/{ArrowUp-DpQ-09y4.js → ArrowUp-B0V8Iire.js} +1 -1
- package/dist/client/assets/{BarChart-rvb3yNLn.js → BarChart-CGQa-jmR.js} +1 -1
- package/dist/client/assets/{Building02-NRzC_IEp.js → Building02-CIOqUK8u.js} +1 -1
- package/dist/client/assets/{CartesianChart-BVsrzbFJ.js → CartesianChart-CJ4c9OjY.js} +1 -1
- package/dist/client/assets/{CategoricalChart-64zykerQ.js → CategoricalChart-B7pVoKsa.js} +1 -1
- package/dist/client/assets/{CheckCircle-CfYD_Bi6.js → CheckCircle-Oy-r5wrn.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-C5MARPJN.js → ChevronSelectorVertical-4o-RZGZG.js} +1 -1
- package/dist/client/assets/{ChevronUp-xR4eZngE.js → ChevronUp-yEhXqYsc.js} +1 -1
- package/dist/client/assets/{Copy01-Dy1KrWO0.js → Copy01-DZu9JdFR.js} +1 -1
- package/dist/client/assets/{CreditCard01-DVN26JVZ.js → CreditCard01-e2iuA4b6.js} +1 -1
- package/dist/client/assets/{DotsVertical-CncVW4wJ.js → DotsVertical-2jz8M_Ab.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-C5dp8Quc.js → ErrorBarContext-pdbVvNIr.js} +1 -1
- package/dist/client/assets/{Globe04-BxFc3HLH.js → Globe04-Dv-Q1UFe.js} +1 -1
- package/dist/client/assets/{Image01-CaawlkVR.js → Image01-Csw8Eb7F.js} +1 -1
- package/dist/client/assets/{Key01-FaGRi3tG.js → Key01-nj-094nh.js} +1 -1
- package/dist/client/assets/{Link01-B_YWUHoH.js → Link01-DIQIHWyZ.js} +1 -1
- package/dist/client/assets/{LinkBroken01-z_Mm0CSf.js → LinkBroken01-DiqXlFxy.js} +1 -1
- package/dist/client/assets/{Minus-yAYwM_Ty.js → Minus-DGpW2R_Y.js} +1 -1
- package/dist/client/assets/{Monitor01-Bl7f7T5L.js → Monitor01-6lmVgqwN.js} +1 -1
- package/dist/client/assets/{Play-OByKGnTy.js → Play-Bw1hrhzw.js} +1 -1
- package/dist/client/assets/{Plus-Ccck99Do.js → Plus-BQ-ZwSoF.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BxNBuCjR.js → ReferenceLine-D96IaFnI.js} +1 -1
- package/dist/client/assets/{SearchMd-BAGHgvYw.js → SearchMd-CcFldd9q.js} +1 -1
- package/dist/client/assets/{Sector-BCmuavOw.js → Sector-Lv3mbSoh.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BhoOjVkp.js → ShoppingBag01-Dt2W1jQn.js} +1 -1
- package/dist/client/assets/{Sun-CZRF_565.js → Sun-BCEy54hJ.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Ce37vA9c.js → SwitchHorizontal01-ZVZ1PW_K.js} +1 -1
- package/dist/client/assets/{Tool01-CHLDtlIL.js → Tool01-DamUcObd.js} +1 -1
- package/dist/client/assets/{Trash01-BQBP0tUM.js → Trash01-CA_m_Fs0.js} +1 -1
- package/dist/client/assets/{Upload01-D_q00M49.js → Upload01-COlXo8Rs.js} +1 -1
- package/dist/client/assets/{UserSquare-BSsT3MHy.js → UserSquare-TWw3zsr7.js} +1 -1
- package/dist/client/assets/{Users01-C6bE7RDt.js → Users01-CqKKJKeH.js} +1 -1
- package/dist/client/assets/{XClose-BjZnEBvF.js → XClose-BLrzcEcC.js} +1 -1
- package/dist/client/assets/{Zap-CHuT8W6R.js → Zap-CbyRjfWs.js} +1 -1
- package/dist/client/assets/{ZoomOut-CBOWQYet.js → ZoomOut-C8TxwIPG.js} +1 -1
- package/dist/client/assets/{access-gate-BU0Til0A.js → access-gate-RZ9GSyUJ.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BB5lDWHR.js → add-connection-dialog-BVaDiahz.js} +1 -1
- package/dist/client/assets/{agent-analytics-DvRSJxx0.js → agent-analytics-Cdw0YBIV.js} +1 -1
- package/dist/client/assets/agent-app-CgNxZEzb.js +1 -0
- package/dist/client/assets/{agent-assets-DtVY4a5g.js → agent-assets-C6qXUWEv.js} +1 -1
- package/dist/client/assets/{agent-automation-DcUA7Zto.js → agent-automation-N0vyewKq.js} +1 -1
- package/dist/client/assets/{agent-automations-C9tGxGRj.js → agent-automations-U4KLp_Jm.js} +1 -1
- package/dist/client/assets/{agent-calendar-D4_LWZH3.js → agent-calendar-VlbI2j-J.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BJ3ZDaf3.js → agent-connect-sources-DzR95Lay.js} +1 -1
- package/dist/client/assets/agent-deck-SnZhc8k8.js +1 -0
- package/dist/client/assets/{agent-e2e-Cn5SS6MS.js → agent-e2e-7b8bEJgs.js} +1 -1
- package/dist/client/assets/agent-experiments-DqhQbvgt.js +1 -0
- package/dist/client/assets/{agent-file-W_Lb3P1H.js → agent-file-qAGeJ5wq.js} +1 -1
- package/dist/client/assets/{agent-hosting-CP_GZV0j.js → agent-hosting-ZktfT8aB.js} +1 -1
- package/dist/client/assets/{agent-icon-nQ1AH9dU.js → agent-icon-rBB7-3Iv.js} +1 -1
- package/dist/client/assets/agent-library-5yOHhp5F.js +1 -0
- package/dist/client/assets/agent-library-file-Cj3Cwkh2.js +1 -0
- package/dist/client/assets/agent-monitor-Bywg_SMe.js +1 -0
- package/dist/client/assets/{agent-overview-BlaBQIjD.js → agent-overview-C1fHYueD.js} +1 -1
- package/dist/client/assets/{agent-releases-CAYqdnuz.js → agent-releases-BUlnts0m.js} +1 -1
- package/dist/client/assets/agent-settings-CQR-A0mU.js +1 -0
- package/dist/client/assets/{agent-site-editor-dBOL06nH.js → agent-site-editor-BxGyQ1GG.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-lC9bSMmG.js +2 -0
- package/dist/client/assets/agent-site-editor-content-Bshm0mLR.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DnlcRwFX.js +1 -0
- package/dist/client/assets/agent-view-DbVFezEQ.js +1 -0
- package/dist/client/assets/{agent-view-guard-B4NqxjMv.js → agent-view-guard-CrSlBYGa.js} +1 -1
- package/dist/client/assets/{agents-list-DYMJQcr6.js → agents-list-DQMpcCgV.js} +1 -1
- package/dist/client/assets/{ai-providers-Ci2k4cWf.js → ai-providers-DmJhCIXK.js} +1 -1
- package/dist/client/assets/{alert-Bsjmz-OK.js → alert-Bg73iQHm.js} +1 -1
- package/dist/client/assets/{analytics-sections-Nw_65a4t.js → analytics-sections-COL0BtKA.js} +1 -1
- package/dist/client/assets/api-keys-l4aX0wsP.js +1 -0
- package/dist/client/assets/{api-keys-D4BF_tKg.js → api-keys-yf9_DOP2.js} +1 -1
- package/dist/client/assets/{app-editor-hRLD7Ehq.js → app-editor-BoAUsCRl.js} +1 -1
- package/dist/client/assets/{asset-utils-BSDCnt-j.js → asset-utils-BrDvPrYv.js} +1 -1
- package/dist/client/assets/{auth-CK6AyRu5.js → auth-DPUc_dnx.js} +1 -1
- package/dist/client/assets/{auth-catchall-CJTrtQsq.js → auth-catchall-3vQklB_P.js} +1 -1
- package/dist/client/assets/{auth-entry-CPeTN7o5.js → auth-entry-DzHbwDpa.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BGf8-EnP.js → auth-split-layout-CrNUjCQ4.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bb8BBbsA.js → authenticate-and-persist-oauth-RWTag1bK.js} +1 -1
- package/dist/client/assets/{automation-list-row-B9IR9kWn.js → automation-list-row-DJWeWPbv.js} +1 -1
- package/dist/client/assets/{automation-runs-DnR9pxm5.js → automation-runs-C9XEPlIV.js} +1 -1
- package/dist/client/assets/{automations-Bxg30h3H.js → automations-Dhk5JOxd.js} +1 -1
- package/dist/client/assets/{autosend-DTWIjCgK.js → autosend-Bw00xJf9.js} +1 -1
- package/dist/client/assets/{badge-BV7rxTvN.js → badge-BWAFo8iB.js} +1 -1
- package/dist/client/assets/{block-document-CQARMaA2.js → block-document-D_ARyc6Z.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-C2nnj0H9.js → blocks-preview-workspace-context-Bhzld3G9.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-DhR3pyff.js → blocks-tab-states-Bujj2Oag.js} +1 -1
- package/dist/client/assets/{blog-schema-YJUL-tEX.js → blog-schema-B3FO_Ydd.js} +1 -1
- package/dist/client/assets/{buckets-C4JU-8qW.js → buckets-D-TerXqE.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Bv3kayMV.js → build-improve-prompt-doc-D_iuDFLq.js} +1 -1
- package/dist/client/assets/{calendar-ym6zGcEl.js → calendar-BRFOK1aQ.js} +1 -1
- package/dist/client/assets/{capability-load-error-7V5aWr5c.js → capability-load-error-BNI4R8XO.js} +1 -1
- package/dist/client/assets/{category-editor-CdId4wR5.js → category-editor-bZgzbes6.js} +1 -1
- package/dist/client/assets/{cdn-tab-2DyF7VRR.js → cdn-tab-BqJVJvQQ.js} +1 -1
- package/dist/client/assets/{chart-eh3rIFzp.js → chart-Q09A7KSZ.js} +1 -1
- package/dist/client/assets/{chat-context-kqrW-XPR.js → chat-context-DR3uLV2w.js} +1 -1
- package/dist/client/assets/{chat-draft-CRTo5XoS.js → chat-draft-CKNXk7gm.js} +1 -1
- package/dist/client/assets/{checkbox-aDQexY19.js → checkbox-b8t24adl.js} +1 -1
- package/dist/client/assets/{choose-editor-D9t0sU_N.js → choose-editor-TtuwIl9O.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BSvz1123.js → cli-auth-success-Dt-ivrkY.js} +1 -1
- package/dist/client/assets/{client-icons-DGnfsAP4.js → client-icons-3S2BKupf.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-BCSWQ-Po.js → cms-settings-editor-CoL1CtIi.js} +1 -1
- package/dist/client/assets/{collapsible-Cx6KFD5C.js → collapsible-BHetx99z.js} +1 -1
- package/dist/client/assets/{collection-detail-ZxhaHEpw.js → collection-detail-C551YHre.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bswg3uCR.js → collection-display-button-BjEhoX6t.js} +1 -1
- package/dist/client/assets/{collection-search-B3vfcK1n.js → collection-search-2lwiZ_Gf.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cs4FMkXQ.js → collection-table-wrapper-TIbTouTp.js} +1 -1
- package/dist/client/assets/{collection-tabs-BdhCjBRd.js → collection-tabs-DNvFQjqm.js} +1 -1
- package/dist/client/assets/{combobox-DXDZmm8e.js → combobox-CMpxb7Mm.js} +1 -1
- package/dist/client/assets/{command-De9pJLwH.js → command-CermhoTd.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-B-ueLE1c.js → companion-mcps-section-CM4OIzwX.js} +1 -1
- package/dist/client/assets/{companions-core-DzyeM-yJ.js → companions-core-PpXpxfgQ.js} +1 -1
- package/dist/client/assets/{config-Bakd4Y8w.js → config-VQsUFgqz.js} +1 -1
- package/dist/client/assets/{connect-BMYdSTT8.js → connect-BfWqzz_9.js} +1 -1
- package/dist/client/assets/{connect-layout-BpMetD5F.js → connect-layout-F601-RNu.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BkUskMwn.js → connect-source-dialog-CBx-6nzq.js} +1 -1
- package/dist/client/assets/{connection-C-NllGni.js → connection-DrOf5a8e.js} +1 -1
- package/dist/client/assets/{connection-card-DZD_rAWh.js → connection-card-CZBuUPP_.js} +1 -1
- package/dist/client/assets/{connection-detail-BRz9FZ83.js → connection-detail-DPF8YmLk.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DmavsUyJ.js → connection-form-helpers-D3sfjZA_.js} +1 -1
- package/dist/client/assets/{connections-Cj6HJEn1.js → connections-lrErrE5H.js} +1 -1
- package/dist/client/assets/{content-tab-DkKuIDyy.js → content-tab-DruH5Km_.js} +3 -3
- package/dist/client/assets/{context-C2r290S4.js → context-DmRBBX5q.js} +1 -1
- package/dist/client/assets/{context-menu-CiH3Gj0R.js → context-menu-Biz9RPI-.js} +1 -1
- package/dist/client/assets/{context-shell-BwT70eIn.js → context-shell-CnZGomwI.js} +3 -3
- package/dist/client/assets/{core.esm-DQyn-kJS.js → core.esm-Dennsttt.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CiZys2Ku.js → create-organization-dialog-wSFwPaJG.js} +1 -1
- package/dist/client/assets/{daily-pulse-CMy69HGI.js → daily-pulse-A6f95wwZ.js} +1 -1
- package/dist/client/assets/{discover-DQ9dXI7n.js → discover-DU-Rzely.js} +1 -1
- package/dist/client/assets/{domain-settings-5g_MWfwe.js → domain-settings-Bnb_ZtIt.js} +1 -1
- package/dist/client/assets/{drawer-DDmudFbW.js → drawer-CuUzaTfw.js} +1 -1
- package/dist/client/assets/{editor-BqqnxL88.js → editor-CJ37wKUc.js} +1 -1
- package/dist/client/assets/{editor-classes-D-ez-qBv.js → editor-classes-yEQ_KPvG.js} +1 -1
- package/dist/client/assets/{empty-state-iEpXVBwd.js → empty-state-DXBACaDC.js} +1 -1
- package/dist/client/assets/{empty-state-C7LII3ZM.js → empty-state-DhRsvQHO.js} +1 -1
- package/dist/client/assets/{experiments-tab-DGo_lvyv.js → experiments-tab-Bx6GaOJU.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-B_rL9_Nx.js → experiments-tab-choice-B1sDnY5T.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DYwFbKkm.js → extract-connection-data-DOpfeyzI.js} +1 -1
- package/dist/client/assets/{feature-gate-E1LoWMx3.js → feature-gate-FbVbvaij.js} +1 -1
- package/dist/client/assets/{feature-paywall-CDMJv8wq.js → feature-paywall-CdkGt72v.js} +1 -1
- package/dist/client/assets/{file-explorer-CsD267WS.js → file-explorer-BfjvwZGe.js} +1 -1
- package/dist/client/assets/{file-preview-Cj5pBQv2.js → file-preview-CpUVcTEC.js} +1 -1
- package/dist/client/assets/{file-share-button-DOup2WzD.js → file-share-button-BFGgw9L9.js} +1 -1
- package/dist/client/assets/{file-type-icon-BgzyV542.js → file-type-icon-BkRHeWVz.js} +1 -1
- package/dist/client/assets/{folder-icon-DY3kBxQc.js → folder-icon-CEWb3RvH.js} +1 -1
- package/dist/client/assets/{form-gDNfP07W.js → form-RFg7ydwN.js} +1 -1
- package/dist/client/assets/{general-CWpdg4Hl.js → general-CCnErHaD.js} +1 -1
- package/dist/client/assets/{github-icon-DAxkwypb.js → github-icon-CfOxQ_kk.js} +1 -1
- package/dist/client/assets/github-repo-scope-CiKlF-H0.js +1 -0
- package/dist/client/assets/{held-block-view-C3Ird9F-.js → held-block-view-B1ZTgtaf.js} +3 -3
- package/dist/client/assets/{home-TaMnsEq5.js → home-d4IkLgAU.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-CVQKURab.js → hosted-publish-feedback-CaaC9Yio.js} +1 -1
- package/dist/client/assets/{icon-button-CTmBGRaQ.js → icon-button-DUX8uev-.js} +1 -1
- package/dist/client/assets/{index-D3fuewCp.js → index-AhdOdumU.js} +1 -1
- package/dist/client/assets/{index-Cbe7caeT.js → index-BN1wxwBE.js} +1 -1
- package/dist/client/assets/{index-DGoeX32I.js → index-BU3lM1Xe.js} +1 -1
- package/dist/client/assets/{index-CFDA2Gyk.js → index-CYvmYTza.js} +1 -1
- package/dist/client/assets/{index-CzqNFJgA.js → index-CaPLCDO_.js} +1 -1
- package/dist/client/assets/{index-Cjtut9JA.js → index-CuP8z21G.js} +1 -1
- package/dist/client/assets/{index-BWpKrclg.js → index-Cw6ilRLN.js} +3 -3
- package/dist/client/assets/{index-G8_ivZDF.js → index-DF_kVaV9.js} +1 -1
- package/dist/client/assets/{index-DKRm_nGH.js → index-DiHVaqTW.js} +1 -1
- package/dist/client/assets/{index-C-GH7ZUH.js → index-DiqyTQYB.js} +1 -1
- package/dist/client/assets/{index-CXhEXTV0.js → index-DnZM2vOx.js} +1 -1
- package/dist/client/assets/{index-15xKR9ar.js → index-GbZ7cHim.js} +1 -1
- package/dist/client/assets/{index-Qn_AZuwz.js → index-KnmovUVi.js} +1 -1
- package/dist/client/assets/{index-ylByMMZI.js → index-ZjFFuBzo.js} +1 -1
- package/dist/client/assets/{index-lchr3O79.js → index-nea5NUvS.js} +1 -1
- package/dist/client/assets/{index-redirect-COc2iMJs.js → index-redirect-D8gnMr4D.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CbIPWgZj.js → infiniteQueryObserver-r2g3Rufl.js} +1 -1
- package/dist/client/assets/{infra-billing-gMBDswwS.js → infra-billing-xKdFu2DK.js} +1 -1
- package/dist/client/assets/{input-CgS5sNmj.js → input-B3t37gB5.js} +1 -1
- package/dist/client/assets/{input-Cf50b9sU.js → input-BiNlRIkN.js} +3 -3
- package/dist/client/assets/{integration-icon-BQ9jVlvt.js → integration-icon-BvuUEHwl.js} +1 -1
- package/dist/client/assets/{jira-icon-CzGOnWKo.js → jira-icon-C17_Jc2B.js} +1 -1
- package/dist/client/assets/{label-DzRNwB_s.js → label-DvonkoXD.js} +1 -1
- package/dist/client/assets/{layout-d2_2jbV9.js → layout-BiaPlBt-.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CyFzwt79.js → legacy-agents-deep-DV5Zxfa8.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-B0hY-Z0B.js → legacy-main-redirect-3QdAqV_c.js} +1 -1
- package/dist/client/assets/library-DNyXivcG.js +1 -0
- package/dist/client/assets/{library-tab-cQd24fFO.js → library-tab-Nfz-0YaQ.js} +1 -1
- package/dist/client/assets/{login-BB7FreRC.js → login-bITsid_u.js} +1 -1
- package/dist/client/assets/{markdown-CkZaCBow.js → markdown-Bnq_rauO.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BVLr3WK6.js → mcp-app-renderer-D9bP7Uyj.js} +1 -1
- package/dist/client/assets/{mcp-oauth-KJGfGjkD.js → mcp-oauth-B1sQYgh4.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DWlxkjKx.js → mcp-oauth-zW9MaFGn.js} +1 -1
- package/dist/client/assets/{members-BvQ1xqU5.js → members-CXI65xvm.js} +1 -1
- package/dist/client/assets/{memory-_Oguj4if.js → memory-C-guhabj.js} +1 -1
- package/dist/client/assets/{mini-report-page-BC7L0ipE.js → mini-report-page-C9o2eyOe.js} +1 -1
- package/dist/client/assets/{mock-board-BC3rEvaU.js → mock-board-BShoWwXR.js} +3 -3
- package/dist/client/assets/{monaco-editor-zzUPRyBn.js → monaco-editor-DP1-rJ0v.js} +1 -1
- package/dist/client/assets/{monitoring-ilB7hU6H.js → monitoring-CqLCuFHk.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DZ9HvRuy.js → monitoring-stats-row-BRnhkE0A.js} +1 -1
- package/dist/client/assets/{multi-select-D2pKycte.js → multi-select-ID8vWjv8.js} +1 -1
- package/dist/client/assets/{mustache-BBgPaDqo.js → mustache-nJjvu1VV.js} +1 -1
- package/dist/client/assets/{named-rule-uses-8PEXqP7W.js → named-rule-uses-BHC4DlIQ.js} +1 -1
- package/dist/client/assets/{new-project-dialog-Dd5pVssc.js → new-project-dialog-4twV8Y4C.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-zp6PPNfP.js → oauth-callback-ai-provider-Da3_ca8D.js} +1 -1
- package/dist/client/assets/{oauth-callback-DIj2YLwh.js → oauth-callback-h0NUpdOX.js} +1 -1
- package/dist/client/assets/{onboarding-CSUeJ8OK.js → onboarding-CvFXVvAB.js} +1 -1
- package/dist/client/assets/{openai-conversation-CT9LWWrS.js → openai-conversation-9-S9iWS8.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BhoNMrVo.js → optimistic-project-sidebar-views-B65im_4W.js} +1 -1
- package/dist/client/assets/{order-monitor-day-D-Ti4NDE.js → order-monitor-day-GXa0K2fU.js} +1 -1
- package/dist/client/assets/{organization-choice-Bs2Llr3r.js → organization-choice-DKpl7kTn.js} +1 -1
- package/dist/client/assets/{orgs-Bs_15YVG.js → orgs-Dt-LNqWF.js} +1 -1
- package/dist/client/assets/{page-seo-form-DizfAl8r.js → page-seo-form-DzjOyYJI.js} +1 -1
- package/dist/client/assets/{pair-BFVxcKKp.js → pair-BwKW0A4I.js} +1 -1
- package/dist/client/assets/{parse-sections-BVn3AvAz.js → parse-sections-C3Hmwt0I.js} +1 -1
- package/dist/client/assets/{plan-_57doTJd.js → plan-BJIbgrS0.js} +1 -1
- package/dist/client/assets/{plan-ladder-DVSwNgR2.js → plan-ladder-DIPGMFy3.js} +1 -1
- package/dist/client/assets/{plan-usage-card-B64WjIMI.js → plan-usage-card-OrJ6ndWB.js} +1 -1
- package/dist/client/assets/{popover-ClEv7Zyf.js → popover-N-Tbv2Q_.js} +1 -1
- package/dist/client/assets/{post-calendar-CMHuZuip.js → post-calendar-BN2880sO.js} +1 -1
- package/dist/client/assets/{post-editor-CqgW2_fW.js → post-editor-SZ0T52l-.js} +1 -1
- package/dist/client/assets/{preview-content-BSsfQ6ZE.js → preview-content-BrY4N22Q.js} +1 -1
- package/dist/client/assets/{preview-dialog-DBnDC8gE.js → preview-dialog-DNkXNQe2.js} +1 -1
- package/dist/client/assets/{preview-panel-DQBuS4_f.js → preview-panel-BeRdNuZC.js} +1 -1
- package/dist/client/assets/{preview-tab-_86kIh0E.js → preview-tab-EJWXb_JS.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-C8oMVTn6.js → product-picker-dialog-DJW0OQ7t.js} +1 -1
- package/dist/client/assets/{profile-Bsx5sLNH.js → profile-p2CkJE0T.js} +1 -1
- package/dist/client/assets/{project-app-view-C5QghQe6.js → project-app-view-C_EMPbo0.js} +1 -1
- package/dist/client/assets/{project-apps-oe6VMb11.js → project-apps-CbCNo3Qh.js} +1 -1
- package/dist/client/assets/{project-feed-DAjFP_Ib.js → project-feed-BOoFoesM.js} +1 -1
- package/dist/client/assets/{project-icon-BKeF243f.js → project-icon-BRvDYuEF.js} +1 -1
- package/dist/client/assets/project-reports-Ckw4gPRj.js +1 -0
- package/dist/client/assets/project-tasks-DIs0LJKu.js +1 -0
- package/dist/client/assets/{projects-BaKJExhs.js → projects-DxaWyr4c.js} +1 -1
- package/dist/client/assets/{projects-empty-state-B_kHw_MZ.js → projects-empty-state-q_kUg5xI.js} +1 -1
- package/dist/client/assets/{prompts-Br3MvaH9.js → prompts-ORkU8nSR.js} +1 -1
- package/dist/client/assets/{provision-repo-scoped-github-connection-lckxpDHD.js → provision-repo-scoped-github-connection-DoOuHltS.js} +1 -1
- package/dist/client/assets/record-editor-C9Hk9gzX.js +1 -0
- package/dist/client/assets/{redirect-editor-CSg_SJ3I.js → redirect-editor-DTFg1kOc.js} +1 -1
- package/dist/client/assets/{releases-api-DwHPczFb.js → releases-api-MmQe-HE4.js} +1 -1
- package/dist/client/assets/{reports-iqRQlH1z.js → reports-C3nGzDLE.js} +1 -1
- package/dist/client/assets/reports-DpW566Gg.js +1 -0
- package/dist/client/assets/{reports-onboarding-Bm9Wvkaq.js → reports-onboarding-D8qOl7n6.js} +1 -1
- package/dist/client/assets/{reports-tab-DesQ1SQx.js → reports-tab-BRsFQ8_g.js} +2 -2
- package/dist/client/assets/{repositories-DUBWep32.js → repositories-DWS1FNsz.js} +1 -1
- package/dist/client/assets/repositories-rpqjpzkl.js +1 -0
- package/dist/client/assets/{repository-binding-Bpq6heaQ.js → repository-binding-PeMGXqSl.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DxJJpcCz.js → repository-import-picker-BMJ3biNs.js} +1 -1
- package/dist/client/assets/{repository-picker-P8Asvsk4.js → repository-picker-XiErYA7B.js} +1 -1
- package/dist/client/assets/{require-capability-B-uxpRvL.js → require-capability-42JNP4Dw.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DYZU5vk_.js → required-auth-layout-DsfiOlyN.js} +1 -1
- package/dist/client/assets/{reset-password-Bs_JmNWK.js → reset-password-CsAEO5bw.js} +1 -1
- package/dist/client/assets/{resizable-vbjrp9Su.js → resizable-XQP8BK4_.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CzFxm7IQ.js → resolve-tab-icon-CguQjH43.js} +1 -1
- package/dist/client/assets/{review-settings-CsHCgNLm.js → review-settings-U2xSoSbC.js} +1 -1
- package/dist/client/assets/{roles-C-6Op6OQ.js → roles-DZFrq3cC.js} +1 -1
- package/dist/client/assets/route-BeAt5Jxq.js +1 -0
- package/dist/client/assets/{route-Cr42SuLO.js → route-C-GIqs4Z.js} +1 -1
- package/dist/client/assets/{route-Bdui6QXz.js → route-DKXnO--k.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-D9eDp86x.js → sandbox-lifecycle-context-DB7MI-hA.js} +1 -1
- package/dist/client/assets/{schema-DzZBw0EW.js → schema-CB30E7Gi.js} +1 -1
- package/dist/client/assets/{schema-Cd1llToh.js → schema-DGh8triY.js} +1 -1
- package/dist/client/assets/{scroll-area-CwuazZb5.js → scroll-area-BhjyScQp.js} +1 -1
- package/dist/client/assets/{search-input-D2iQ_3lu.js → search-input-CnMfC6Ib.js} +1 -1
- package/dist/client/assets/{search-toggle-Cw7hl_Xx.js → search-toggle-BsT7rhT7.js} +1 -1
- package/dist/client/assets/{secret-picker-Ct1DoTR9.js → secret-picker-DRe1iXLV.js} +1 -1
- package/dist/client/assets/{secrets-CBPyw7ba.js → secrets-Cm-nUiVG.js} +1 -1
- package/dist/client/assets/{section-array-field-BXLl3jB0.js → section-array-field-CowajgIO.js} +1 -1
- package/dist/client/assets/{sections-DRD1aU5D.js → sections-DN1XjEty.js} +1 -1
- package/dist/client/assets/{sections-editor-B628EbZ4.js → sections-editor-KyiXwNg4.js} +1 -1
- package/dist/client/assets/{select-BMteQTWS.js → select-IRnWfSEI.js} +1 -1
- package/dist/client/assets/{select-model-ujDDmA_R.js → select-model-_tURUtw8.js} +1 -1
- package/dist/client/assets/{seo-editor-nXgc_X38.js → seo-editor-DQuBtXMq.js} +1 -1
- package/dist/client/assets/{separator-l2LsOpLi.js → separator-AD4s_4vt.js} +1 -1
- package/dist/client/assets/settings-tab-Cyi9Dt5w.js +1 -0
- package/dist/client/assets/{sheet-BW-FxyJZ.js → sheet-CLT2kz10.js} +1 -1
- package/dist/client/assets/{shell-layout-BbFvnpcf.js → shell-layout-CdKs-SVX.js} +1 -1
- package/dist/client/assets/{site-draft-actions-9GNFURGo.js → site-draft-actions-K5CCMVX6.js} +1 -1
- package/dist/client/assets/{site-draft-view-DhCorNAk.js → site-draft-view-Dzca4Bar.js} +2 -2
- package/dist/client/assets/site-editor-B1tNbOKR.js +1 -0
- package/dist/client/assets/{site-editor-toast-QHleRFN5.js → site-editor-toast-MdEv_oKc.js} +1 -1
- package/dist/client/assets/{skills-ApZ_uT4M.js → skills-DIJP95gf.js} +1 -1
- package/dist/client/assets/{slider-DtzvJZ1j.js → slider-BOLJxYF2.js} +1 -1
- package/dist/client/assets/{sortable.esm-DNzjY6xb.js → sortable.esm-CIFqofWL.js} +1 -1
- package/dist/client/assets/{sso-Con6Y9JD.js → sso-DqMDaenE.js} +1 -1
- package/dist/client/assets/{suggestion-BgdlUdcB.js → suggestion-tz-f65fQ.js} +1 -1
- package/dist/client/assets/{switch-Bv0wLEBx.js → switch-D45dHrK3.js} +1 -1
- package/dist/client/assets/{symbol-CJoI4vsX.js → symbol-Femlxd_m.js} +1 -1
- package/dist/client/assets/{synced-repos-Bdx0Lzti.js → synced-repos-45QejDcI.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CSlj-TVq.js → tab-icon-glyph-pt4s2Grb.js} +1 -1
- package/dist/client/assets/{table-CheWM6KL.js → table-Daq1_j7m.js} +1 -1
- package/dist/client/assets/{tabs-CjWwohzM.js → tabs-DBG72Yee.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-DwSiTsoy.js → task-assignee-avatar-DrrfJr__.js} +1 -1
- package/dist/client/assets/{task-board-L6ZGzY-s.js → task-board-DSKYQnUa.js} +1 -1
- package/dist/client/assets/{task-route-D7Tzzgt_.js → task-route-D46EYWzc.js} +1 -1
- package/dist/client/assets/{task-status-FHJjKh4u.js → task-status-CJpXljEZ.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-kV8i_37N.js → taskboard-analytics-COtnoUXH.js} +1 -1
- package/dist/client/assets/{tasks-3fvPlwxK.js → tasks-D5O8k4au.js} +1 -1
- package/dist/client/assets/tasks-Dkj9k49d.js +1 -0
- package/dist/client/assets/{textarea-BNvvIWSZ.js → textarea-B3VJ1IVc.js} +1 -1
- package/dist/client/assets/{thread-analytics-DOn_63z0.js → thread-analytics-yTtiboMK.js} +1 -1
- package/dist/client/assets/{thread-intent-DjvP3GsU.js → thread-intent-CAWCzeoG.js} +1 -1
- package/dist/client/assets/{thread-route-BOOkt7de.js → thread-route-BZQyZ1gL.js} +1 -1
- package/dist/client/assets/{thread-route-B3uNqVbb.js → thread-route-C3He_naw.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-sjcfE700.js → thread-sheet-body-vk26kAGI.js} +1 -1
- package/dist/client/assets/{time-range-picker-BostqQTB.js → time-range-picker-Dwtk68FK.js} +1 -1
- package/dist/client/assets/{toggle-group-BAFBdL9F.js → toggle-group-BtOmVjMF.js} +1 -1
- package/dist/client/assets/{tool-namespace-CG1Oreso.js → tool-namespace-COirY7s5.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CnXJyVJt.js → toolbar-icon-button-as98rium.js} +1 -1
- package/dist/client/assets/{tooltip-D2ANqV2w.js → tooltip-g1j6c67B.js} +1 -1
- package/dist/client/assets/{tooltipContext-DvKfbID4.js → tooltipContext-CLvPoHx0.js} +1 -1
- package/dist/client/assets/{track-BA-6upge.js → track-CbG7q0Jx.js} +1 -1
- package/dist/client/assets/{types-BNmsSext.js → types-C_kLVB_R.js} +1 -1
- package/dist/client/assets/{url-slug-DcB6_J0W.js → url-slug-DFbBJdJJ.js} +1 -1
- package/dist/client/assets/{usage-stats-I2nqy87E.js → usage-stats-CO_PzmjR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BcLfhqAn.js → use-ai-providers-UYArMe6s.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-CdtINk0A.js → use-apply-named-rule-DjUylbM_.js} +1 -1
- package/dist/client/assets/{use-automations-DX8SlLEI.js → use-automations-fhgNtkrI.js} +1 -1
- package/dist/client/assets/{use-autosave-c4cGzjJa.js → use-autosave-VNB60wel.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-CyqukwDV.js → use-chat-layout-state-uzyWoT7E.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CXtcWsca.js → use-clock-tick-Bbl4jizB.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BDOdjoX5.js → use-cms-publish-actions-Oa0EZQ0t.js} +1 -1
- package/dist/client/assets/{use-connect-companion-pjD5dMZl.js → use-connect-companion-BinIX0nI.js} +1 -1
- package/dist/client/assets/{use-connection-CZNQu-z2.js → use-connection-BeEdNRHa.js} +1 -1
- package/dist/client/assets/{use-copy-Bq-mz0ld.js → use-copy-Dk3cEiBB.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BVwiobb2.js → use-create-virtual-mcp-CcnOX0WT.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CLYhNSnw.js → use-date-fns-locale-CpjJIfQT.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Cxe8yde_.js → use-debounced-autosave-QN0_xGaq.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CqLWq6L2.js → use-debounced-value-Cg3pn3hJ.js} +1 -1
- package/dist/client/assets/{use-deco-credits-C26dK60_.js → use-deco-credits-C5r8tKZH.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Dg011Qgn.js → use-decopilot-events-D7GIEyuu.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DzeFDNj4.js → use-delete-connection-Cx5vGSZR.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-COukxauw.js → use-deployment-admin-DVUkJw7-.js} +1 -1
- package/dist/client/assets/{use-entitlements-Bxptpo8e.js → use-entitlements-C4tNpLNZ.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DWrGmO4E.js → use-fast-preview-draft-url-C2yv-JdA.js} +1 -1
- package/dist/client/assets/{use-file-configs-DAoix9gu.js → use-file-configs-C8WLQuJ_.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CEHyMhUC.js → use-inbox-feed-CmYEHjcJ.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CojsIRJO.js → use-infinite-scroll-dtUi5Sm6.js} +1 -1
- package/dist/client/assets/{use-join-requests-GMVGPaSk.js → use-join-requests-CACMdSxj.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DXx3VvH2.js → use-main-panel-tabs-6UM-eEDy.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CvV54_ol.js → use-mcp-auth-status-nCZ8OnbU.js} +1 -1
- package/dist/client/assets/{use-mcp-client-zIBQco5Q.js → use-mcp-client-CvhC1TIJ.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-XayY9yfQ.js → use-mcp-prompts-BWsIl6wX.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BmZF8fTN.js → use-mcp-tools-I_UsR8Xf.js} +1 -1
- package/dist/client/assets/{use-mobile-CoPLJ8cu.js → use-mobile-CKqq0hw6.js} +1 -1
- package/dist/client/assets/{use-move-blocks-Ck5rS_vn.js → use-move-blocks-D5l0lx5X.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DqWY18b4.js → use-navigate-to-agent-X54xBbs-.js} +1 -1
- package/dist/client/assets/{use-org-fs-B4wvUwJj.js → use-org-fs-wk2PRaOo.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-D-0WnIj6.js → use-org-repo-syncs-ON_B-I08.js} +1 -1
- package/dist/client/assets/{use-org-sso-sTi3oL5_.js → use-org-sso-1YltyqLi.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DXXkhsvq.js → use-organization-roles-CxgWGtCR.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D_5fr-OI.js → use-organization-settings-BFBXS4UG.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-nriEb2Qz.js → use-panel-navigate-DzWclIwL.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-Bdl4n5BM.js → use-project-native-view-presence-B8VDwbCS.js} +1 -1
- package/dist/client/assets/{use-project-scope-CdqclLu1.js → use-project-scope-Bq5GrrDd.js} +1 -1
- package/dist/client/assets/{use-recent-apps-6oU0G5sy.js → use-recent-apps-DBlZNiUD.js} +1 -1
- package/dist/client/assets/{use-releases-CjPNvHz7.js → use-releases-Dth9LHEU.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CbLn3JeW.js → use-reports-diagnostic-Do0xVL-L.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-C3mgE5Ut.js → use-sandbox-events-vz4ehPML.js} +1 -1
- package/dist/client/assets/{use-secrets-DMgYR7J2.js → use-secrets-Byq7_LZ0.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CJSLbEeV.js → use-section-preview-base-Bi-N531T.js} +1 -1
- package/dist/client/assets/{use-session-runtime-HJpkQoy0.js → use-session-runtime-C29BLCO5.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DGKLEITN.js → use-sidebar-collapsed-CC40xbK2.js} +1 -1
- package/dist/client/assets/{use-tags-C5S50qhF.js → use-tags-DsgZua5i.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BhLHNvA-.js → use-task-board-analytics-BTfxOx5Z.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CWQQpnEy.js → use-task-board-events-BQ73Mjf5.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-a7ezuDRL.js → use-task-board-item-prs-D1aN1p6d.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-DonCfR5m.js → use-task-board-prompts-CaMiqHjx.js} +1 -1
- package/dist/client/assets/{use-task-metadata-MAOPH7xT.js → use-task-metadata-RAKFvADU.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-B2fKyMxQ.js → use-thread-analytics-UYwynn2f.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-vH0sJUqm.js → use-thread-outputs-DsSeydeQ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-qZeYk4so.js +1 -0
- package/dist/client/assets/{useQueries-Qve4MUYw.js → useQueries-BxilFdP8.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CTPa_bH3.js +1 -0
- package/dist/client/assets/{users-DHtbHEKw.js → users-CfzZpC_f.js} +1 -1
- package/dist/client/assets/{utils-BoR7m7ir.js → utils-CFwQd3Dj.js} +1 -1
- package/dist/client/assets/{variant-calendar-DSZCP6Sl.js → variant-calendar-DAzhjaCK.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Cvh79vYa.js → variant-matcher-override-KA8G6wne.js} +1 -1
- package/dist/client/assets/{view-header-DTW0kjf6.js → view-header-D4T3g6Y4.js} +1 -1
- package/dist/client/assets/{virtual-mcp-RiqyMxQd.js → virtual-mcp-CJAqxDe2.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-6veZzsu7.js → watch-sse-pool-BxinXtVa.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/agent-app-B0uhmcWv.js +0 -1
- package/dist/client/assets/agent-deck-CACa1iZR.js +0 -1
- package/dist/client/assets/agent-experiments-TwOhraCy.js +0 -1
- package/dist/client/assets/agent-library-BvH-Q75b.js +0 -1
- package/dist/client/assets/agent-library-file-BC8zk1Dl.js +0 -1
- package/dist/client/assets/agent-monitor-UYQNblqG.js +0 -1
- package/dist/client/assets/agent-settings-Lu1EqGNe.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BAyfkSPu.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CKgCOX3-.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-B9oFLAt2.js +0 -1
- package/dist/client/assets/agent-view-D-sscasX.js +0 -1
- package/dist/client/assets/api-keys-D_tuzPJP.js +0 -1
- package/dist/client/assets/github-repo-scope-ByTYKy_L.js +0 -1
- package/dist/client/assets/library-CS74d8fl.js +0 -1
- package/dist/client/assets/project-reports-uzkOMqSE.js +0 -1
- package/dist/client/assets/project-tasks-jNTlksUk.js +0 -1
- package/dist/client/assets/record-editor-B5oAS_5D.js +0 -1
- package/dist/client/assets/reports-CL4pYm69.js +0 -1
- package/dist/client/assets/repositories-C-WO-gxz.js +0 -1
- package/dist/client/assets/route-BlJ-TDEK.js +0 -1
- package/dist/client/assets/settings-tab-Cj4D3Abl.js +0 -1
- package/dist/client/assets/site-editor-8rMP2pUf.js +0 -1
- package/dist/client/assets/tasks-BImUOCfZ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CFafSHXd.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D_oVQ9bL.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as G,a4 as N,gB as z,q as J,a as Z,aJ as Y,b as K,e as T,C as O,t as x,j as t,K as I,D as H,s as _,v as k,w as $,x as W,y as X,B as q,aL as ee,c as V,ap as U,aA as se,m as te}from"./index-
|
|
1
|
+
import{r as G,a4 as N,gB as z,q as J,a as Z,aJ as Y,b as K,e as T,C as O,t as x,j as t,K as I,D as H,s as _,v as k,w as $,x as W,y as X,B as q,aL as ee,c as V,ap as U,aA as se,m as te}from"./index-Cw6ilRLN.js";import{a as ie,F as w,b as P,c as ne,d as L,f as B}from"./form-RFg7ydwN.js";import{S as oe,b as re,a as le,d as ae,c as ce}from"./select-IRnWfSEI.js";import{T as me}from"./textarea-B3VJ1IVc.js";import{u as ue}from"./use-organization-roles-CxgWGtCR.js";const de=ee().email("Invalid email address");function ge(e){if(!e.trim())return[];const o=e.split(/[,;\n]/).map(l=>l.trim().toLowerCase()).filter(l=>l.length>0);return Array.from(new Set(o))}class Q extends Error{constructor(o){super("Failed to invite members"),this.failures=o}failures}function fe(e,{email:o,code:l}){switch(l){case"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION":return e("common.inviteMemberDialog.errorAlreadyInvited",{email:o});case"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION":return e("common.inviteMemberDialog.errorAlreadyMember",{email:o});default:return e("common.inviteMemberDialog.errorInviteEmail",{email:o})}}function je({trigger:e}){const[o,l]=G.useState(!1),{locator:h}=N(),j=z(),a=J(),{data:u}=Z.useSession(),m=u?.user?.email,{roles:g,isLoading:d}=ue(),f=g.filter(n=>n.role!=="owner"),r=Y({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),A=r.watch("emailsText"),S=r.watch("role"),p=ge(A).filter(n=>{const s=de.safeParse(n).success,c=!m||n!==m.toLowerCase();return s&&c}),i=K(),b=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const c=await Promise.allSettled(n.map(E=>j.organization.inviteMember({email:E,role:s}))),D=c.flatMap((E,M)=>{const y=n[M]??"";if(E.status==="rejected")return[{email:y,code:void 0}];const{error:F}=E.value;return F?[{email:y,code:F.code}]:[]});if(D.length>0)throw new Q(D);return c},onSettled:()=>{a.invalidateQueries({queryKey:I.members(h)}),a.invalidateQueries({queryKey:I.invitations(h)})},onSuccess:(n,{emails:s,role:c})=>{O("member_invited",{count:s.length,role:c}),x.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),r.reset({emailsText:"",role:"user"}),l(!1)},onError:(n,{emails:s,role:c})=>{const D=n instanceof Q?n.failures:[];if(O("member_invite_failed",{count:s.length,role:c,error:D.length>0?D.map(M=>M.code??"UNKNOWN").join(","):n.message}),D.length===0){x.error(n.message||i("common.inviteMemberDialog.errorGeneric"));return}const E=D.map(M=>fe(i,M));if(E.length===1){x.error(E[0]);return}x.error(i("common.inviteMemberDialog.errorFailedInvite",{count:D.length}),{description:t.jsx("ul",{children:E.map(M=>t.jsx("li",{children:M},M))})})}}),R=n=>{if(p.length===0){x.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){x.error(i("common.inviteMemberDialog.errorSelectRole"));return}b.mutate({emails:p,role:n.role})},v=p.length>0&&!!S;return t.jsxs(H,{open:o,onOpenChange:l,children:[t.jsx(_,{asChild:!0,children:e}),t.jsxs(k,{className:"sm:max-w-lg",children:[t.jsx($,{children:t.jsx(W,{children:i("common.inviteMemberDialog.title")})}),t.jsx(ie,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(R),className:"space-y-4",children:[t.jsx(w,{control:r.control,name:"emailsText",render:({field:n})=>t.jsxs(P,{children:[t.jsx(ne,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(L,{children:t.jsx(me,{...n,disabled:b.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(B,{})]})}),t.jsx(w,{control:r.control,name:"role",render:({field:n})=>t.jsxs(P,{children:[t.jsx(L,{children:t.jsxs(oe,{value:n.value,onValueChange:n.onChange,disabled:b.isPending||d,children:[t.jsx(re,{className:"w-full",children:t.jsx(le,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ae,{children:f.map(s=>{const c=[];return s.isBuiltin||(s.allowsAllStaticPermissions?c.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&c.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?c.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&c.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?c.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&c.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(ce,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&c.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:c.join(", ")})]})},s.role)})})]})}),t.jsx(B,{})]})}),t.jsxs(X,{children:[t.jsx(q,{variant:"outline",onClick:()=>{r.reset({emailsText:"",role:"user"}),l(!1)},type:"button",disabled:b.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(q,{type:"submit",disabled:b.isPending||!v,children:b.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function Se(){const e=V.c(10),{org:o}=N(),l=U(),{capabilities:h,isPrivileged:j}=se(),a=j||!!h["members:manage"];let u;e[0]!==o.id?(u=I.organizationJoinRequests(o.id),e[0]=o.id,e[1]=u):u=e[1];let m;e[2]!==l?(m=()=>l.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=l,e[3]=m):m=e[3];const g=!!o.id&&a;let d;e[4]!==u||e[5]!==m||e[6]!==g?(d={queryKey:u,queryFn:m,enabled:g},e[4]=u,e[5]=m,e[6]=g,e[7]=d):d=e[7];const{data:f}=te(d);let r;return e[8]!==f?.requests?(r=f?.requests??[],e[8]=f?.requests,e[9]=r):r=e[9],r}function De(){const e=V.c(29),{org:o,locator:l}=N(),h=U(),j=J(),a=K();let u;e[0]!==l||e[1]!==o||e[2]!==j?(u=()=>{j.invalidateQueries({queryKey:I.organizationJoinRequests(o.id)}),j.invalidateQueries({queryKey:I.members(l)})},e[0]=l,e[1]=o,e[2]=j,e[3]=u):u=e[3];const m=u;let g;e[4]!==h?(g=v=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:v}),e[4]=h,e[5]=g):g=e[5];let d;e[6]!==m||e[7]!==a?(d=()=>{m(),x.success(a("settings.joinRequestsSection.approved"))},e[6]=m,e[7]=a,e[8]=d):d=e[8];let f;e[9]!==a?(f=v=>x.error(v instanceof Error?v.message:a("settings.joinRequestsSection.approveFailed")),e[9]=a,e[10]=f):f=e[10];let r;e[11]!==g||e[12]!==d||e[13]!==f?(r={mutationFn:g,onSuccess:d,onError:f},e[11]=g,e[12]=d,e[13]=f,e[14]=r):r=e[14];const A=T(r);let S;e[15]!==h?(S=v=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:v}),e[15]=h,e[16]=S):S=e[16];let C;e[17]!==m||e[18]!==a?(C=()=>{m(),x.success(a("settings.joinRequestsSection.denied"))},e[17]=m,e[18]=a,e[19]=C):C=e[19];let p;e[20]!==a?(p=v=>x.error(v instanceof Error?v.message:a("settings.joinRequestsSection.denyFailed")),e[20]=a,e[21]=p):p=e[21];let i;e[22]!==S||e[23]!==C||e[24]!==p?(i={mutationFn:S,onSuccess:C,onError:p},e[22]=S,e[23]=C,e[24]=p,e[25]=i):i=e[25];const b=T(i);let R;return e[26]!==A||e[27]!==b?(R={approve:A,deny:b},e[26]=A,e[27]=b,e[28]=R):R=e[28],R}export{je as I,De as a,Se as u};
|
package/dist/client/assets/{use-main-panel-tabs-DXx3VvH2.js → use-main-panel-tabs-6UM-eEDy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Ue,b as He,u as Le,a4 as Oe,gI as Ke,gJ as Be,gK as le,gL as de,an as $e,al as me,gM as Je,gN as Qe,r as Y,eN as We,T as pe,gO as _e,gP as qe}from"./index-
|
|
1
|
+
import{c as Ue,b as He,u as Le,a4 as Oe,gI as Ke,gJ as Be,gK as le,gL as de,an as $e,al as me,gM as Je,gN as Qe,r as Y,eN as We,T as pe,gO as _e,gP as qe}from"./index-Cw6ilRLN.js";import{a as ze}from"./use-chat-layout-state-uzyWoT7E.js";import{b as Ge}from"./agent-icon-rBB7-3Iv.js";import{i as Xe}from"./Monitor01-6lmVgqwN.js";import{u as Ye}from"./use-connection-BeEdNRHa.js";import{a as Ze}from"./use-mcp-client-CvhC1TIJ.js";import{u as et}from"./use-mcp-tools-I_UsR8Xf.js";import{a as tt}from"./repository-binding-PeMGXqSl.js";import{g as at}from"./types-C_kLVB_R.js";import{t as ot}from"./utils-CVEq3hMx.js";import{u as nt,a as F}from"./experiments-tab-choice-B1sDnY5T.js";import"./index-CaPLCDO_.js";import{u as st}from"./use-sandbox-events-vz4ehPML.js";import{F as ue}from"./file-type-icon-BkRHeWVz.js";import{a as it,u as ct}from"./use-panel-navigate-DzWclIwL.js";import{r as Z}from"./resolve-tab-icon-CguQjH43.js";import{u as rt}from"./use-task-metadata-RAKFvADU.js";import{r as lt}from"./preview-source-BsRLGWUP.js";import{i as dt,r as mt,s as pt}from"./shell-layout-CdKs-SVX.js";import{u as ut}from"./use-session-runtime-C29BLCO5.js";import{u as ft}from"./use-organization-settings-BFBXS4UG.js";import{u as bt}from"./use-project-scope-Bq5GrrDd.js";import{b as Tt,u as It,c as vt,d as gt,f as Pt}from"./use-project-native-view-presence-B8VDwbCS.js";import{c as yt}from"./chat-context-DR3uLV2w.js";import{r as kt}from"./virtual-mcp-CJAqxDe2.js";function Yt(o){const e=Ue.c(35),d=He(),{openPanel:b,closePanel:x}=it();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T={strict:!1},e[0]=T):T=e[0];const fe=Le(T),ee=ct(),te=ze(),i=tt(o.virtualMcpId),I=rt(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:v}=yt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Ke(i.id):null,g=I?.expanded_tools??[],P=ft(),{scopeId:Te,project:Ie}=bt(),y=Tt(Te,Ie,i),p=It(y.project);nt(y.project?.id);const ae=vt(y.resolvedScopeId,F(y.project?.metadata),p.presence);let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k={includeVirtual:!0},e[1]=k):k=e[1];const u=Ye(k),ve=st(),E=v?.branch??be;let w;e[2]!==v?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==I||e[6]!==E?(w=lt({threadId:o.taskId,sandboxBranch:E,agentHasRepo:F(i?.metadata),threadHasRepo:F(I)||F(v?.metadata)}),e[2]=v?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=I,e[6]=E,e[7]=w):w=e[7];const ge=w,U=ve.lifecycle.phase==="running",{runtime:Pe,resolved:oe}=ut(o.virtualMcpId),H=!!r&&U;let h;e[8]!==H?(h={enabled:H},e[8]=H,e[9]=h):h=e[9];const ne=Ze({connectionId:r,orgId:n.id,orgSlug:n.slug},h),L=ne,O=!!ne&&U;let V;e[10]!==L||e[11]!==O?(V={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=V):V=e[12];const{data:ye}=et(V),se=r&&U?(ye?.tools??[]).filter(Mt).map(t=>({connectionId:r,toolName:t.name,label:ot(t.name),icon:null})):[],K=se[0],ke=K?se:[],f=K&&r?{type:"ext-apps",id:r,toolName:K.toolName}:m?.defaultMainView??null,we=kt(m),ie={assets:p.assetsPending,siteAccess:p.siteAccessPending,releases:p.releasesPending,calendar:p.calendarPending},{activeTab:M,mainOpen:l}=Be({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:f||m?{defaultMainView:f,tabs:c.map(Vt)}:null}),he=f||m?{defaultMainView:f,tabs:c.map(ht)}:null,C=mt({hasSource:ge==="repo"||P,runtime:Pe,cmsMode:we}),Ve=C.includes("content"),Me=le(he),Ce=f?.type,ce=gt(Ce,ae,ie,C,oe),B=ce?le(null):Me,Se=Pt(M,ae,ie),Ne=!C.includes("code")&&oe&&de(M)!==null,a=!ee&&!te&&ce||M==="content"&&!Ve||Ne||Se?B:M,$=$e(a);let S;e[13]!==d?(S=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=S):S=e[14];const je=S,J=new Map;for(const t of g){const s=me(t.appId,t.toolName);J.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ke){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);J.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const Q=Je(a),W=Q?Q.key.split("/").pop()??Q.key:null,Ae=W?[{id:a,title:W,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:W,...t})}}]:[],N=Qe(a),De=N?[{id:a,title:(N.path.split("/").pop()??N.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(N.path.startsWith("pages/")?Ge:Xe,t)}}]:[],_=We(a),q=_?_.path.split("/").pop()??_.path:null,Re=q?[{id:a,title:q,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:q,...t})}}]:[],Fe=dt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:je(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:u})})):[];let j;e[15]!==u?(j=t=>({id:_e(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:u})}),e[15]=u,e[16]=j):j=e[16];const xe=[...Fe,...Ae,...De,...Re,...c.map(j),...Array.from(J.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:u})}))],re=new Set,z=xe.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),Ee=o.virtualMcpId;let A;e[17]!==n.id?(A=pe(n.id),e[17]=n.id,e[18]=A):A=e[18];const G=Ee===A;let D;e[19]!==a||e[20]!==x||e[21]!==l||e[22]!==G||e[23]!==b||e[24]!==n.id||e[25]!==P?(D=t=>{if(pt({reportsOnly:P,onReportAgent:G,tabId:t})){b(t,{virtualmcpid:pe(n.id),search:wt});return}const s=qe({clickedId:t,activeTab:a,mainOpen:l});"close"in s?x():b(s.tabId)},e[19]=a,e[20]=x,e[21]=l,e[22]=G,e[23]=b,e[24]=n.id,e[25]=P,e[26]=D):D=e[26];const X=D;let R;return e[27]!==a||e[28]!==$||e[29]!==g||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==z?(R={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:g,automationTabParsed:$,tabs:z},e[27]=a,e[28]=$,e[29]=g,e[30]=c,e[31]=l,e[32]=X,e[33]=z,e[34]=R):R=e[34],R}function wt(o){return{...o,thread:void 0}}function ht(o){return{id:o.id}}function Vt(o){return{id:o.id}}function Mt(o){return!!at(o._meta)}export{Yt as u};
|
package/dist/client/assets/{use-mcp-auth-status-CvV54_ol.js → use-mcp-auth-status-nCZ8OnbU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,b as k,a5 as L,b8 as N,j as o,a4 as S,K as $,U as A}from"./index-
|
|
1
|
+
import{c as I,b as k,a5 as L,b8 as N,j as o,a4 as S,K as $,U as A}from"./index-Cw6ilRLN.js";import{B as g}from"./badge-BWAFo8iB.js";import{c as v,T,a as b,b as U}from"./tooltip-g1j6c67B.js";import{g as _}from"./types-C_kLVB_R.js";import{s as w}from"./Image01-Csw8Eb7F.js";import{w as H,aL as P}from"./agent-icon-rBB7-3Iv.js";import{i as O}from"./mcp-oauth-zW9MaFGn.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:w,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:L,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:H,variant:"outline"}];function Q(y){const e=I.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=_(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=U,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(P,{})})}),o.jsx(b,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(b,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function Y(y){const e=I.c(11),{connectionId:c}=y,{org:r}=S();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=A,l=$.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{Q as T,Y as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d9 as ce,da as le,db as de,dc as ue,dd as he,de as m,df as g,dg as fe,dh as pe,di as me,dj as M,dk as _e,dl as F,dm as we,dn as q,dp as ge,dq as D,dr as Te,ds as ye,dt as ke,du as z,dv as ve,dw as Se,dx as Ce,dy as ee,dz as be,dA as Re,dB as Ie,ch as Ee,dC as qe,dD as Pe,dE as A,dF as $e,dG as Me,dH as Ae,dI as He,dJ as Oe,dK as xe,dL as Ue,dM as Ne,dN as je,dO as Fe,dP as De,dQ as Le,dR as Ve,c8 as V,dS as Qe,dT as U,K as te,R as ze,c as se,U as Je,m as We}from"./index-BWpKrclg.js";import{U as P,b as H,c as J}from"./auth-CK6AyRu5.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ke(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(ue,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const d=i.message,p=d.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(d);else{const h=d,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,d=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&d&&await d.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:d,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(d){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(d);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const d=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,d)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:d}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),d&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:d}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const u=d?.taskId;if(u){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(u,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(d=>this._onerror(d))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const d=z.parse({method:"notifications/tasks/status",params:i});await this.notification(d),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const d=await s.getTask(r,t);if(d){const p=z.parse({method:"notifications/tasks/status",params:d});await this.notification(p),R(d.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}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 st{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 d of n){if(d.type==="result"&&i){const p=d.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield d}}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 rt(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 ot(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 at(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 nt=class extends Be{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 tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(d,p)=>{const l=b(je,d);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(d,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,u=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&u&&this._capabilities.elicitation?.form?.applyDefaults)try{O(u,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(d,p)=>{const l=b(De,d);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(d,p));if(h.task){const k=b(D,f);if(!k.success){const u=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${u}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ne.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:d}=s,p=async()=>{if(!n){d(null,null);return}try{const h=await r();d(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));d(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const N=a=>[{type:"text",text:a}];function it(a){const e=V(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=d=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${d}`,e).href,r=async d=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(d.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(d.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:N(f),isError:!0}}if(!p.ok){let h=`${d.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:N(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:N(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const d=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return d.ok?await d.json():{tools:[]}},n=d=>()=>Promise.reject(new Error(`RestSelfClient: ${d} 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 ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function dt(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=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,d="",p=0,l;function h(u){if(n&&(n=!1,u.charCodeAt(0)===239&&u.charCodeAt(1)===187&&u.charCodeAt(2)===191&&(u=u.slice(3))),o.length===0){const v=f(u);v!==""&&o.push(v);return}if(u.indexOf(`
|
|
1
|
+
import{d9 as ce,da as le,db as de,dc as ue,dd as he,de as m,df as g,dg as fe,dh as pe,di as me,dj as M,dk as _e,dl as F,dm as we,dn as q,dp as ge,dq as D,dr as Te,ds as ye,dt as ke,du as z,dv as ve,dw as Se,dx as Ce,dy as ee,dz as be,dA as Re,dB as Ie,ch as Ee,dC as qe,dD as Pe,dE as A,dF as $e,dG as Me,dH as Ae,dI as He,dJ as Oe,dK as xe,dL as Ue,dM as Ne,dN as je,dO as Fe,dP as De,dQ as Le,dR as Ve,c8 as V,dS as Qe,dT as U,K as te,R as ze,c as se,U as Je,m as We}from"./index-Cw6ilRLN.js";import{U as P,b as H,c as J}from"./auth-DPUc_dnx.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ke(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(ue,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const d=i.message,p=d.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(d);else{const h=d,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,d=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&d&&await d.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:d,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(d){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(d);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const d=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,d)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:d}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),d&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:d}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const u=d?.taskId;if(u){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(u,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(d=>this._onerror(d))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const d=z.parse({method:"notifications/tasks/status",params:i});await this.notification(d),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const d=await s.getTask(r,t);if(d){const p=z.parse({method:"notifications/tasks/status",params:d});await this.notification(p),R(d.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}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 st{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 d of n){if(d.type==="result"&&i){const p=d.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield d}}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 rt(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 ot(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 at(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 nt=class extends Be{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 tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(d,p)=>{const l=b(je,d);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(d,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,u=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&u&&this._capabilities.elicitation?.form?.applyDefaults)try{O(u,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(d,p)=>{const l=b(De,d);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(d,p));if(h.task){const k=b(D,f);if(!k.success){const u=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${u}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ue,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ne.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:d}=s,p=async()=>{if(!n){d(null,null);return}try{const h=await r();d(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));d(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const N=a=>[{type:"text",text:a}];function it(a){const e=V(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=d=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${d}`,e).href,r=async d=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(d.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(d.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:N(f),isError:!0}}if(!p.ok){let h=`${d.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:N(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:N(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const d=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return d.ok?await d.json():{tools:[]}},n=d=>()=>Promise.reject(new Error(`RestSelfClient: ${d} 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 ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function dt(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=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,d="",p=0,l;function h(u){if(n&&(n=!1,u.charCodeAt(0)===239&&u.charCodeAt(1)===187&&u.charCodeAt(2)===191&&(u=u.slice(3))),o.length===0){const v=f(u);v!==""&&o.push(v);return}if(u.indexOf(`
|
|
2
2
|
`)===-1&&u.indexOf("\r")===-1){o.push(u);return}o.push(u);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(u){let c=0;if(u.indexOf("\r")===-1){let _=u.indexOf(`
|
|
3
3
|
`,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:d}),i=void 0,d="",p=0,l=void 0,c=_+1,_=u.indexOf(`
|
|
4
4
|
`,c);continue}const v=u.charCodeAt(c);if(Y(u,c,v)){const S=u.charCodeAt(c+5)===I?c+6:c+5,C=u.slice(S,_);if(p===0&&u.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,d="",l=void 0,c=_+2,_=u.indexOf(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,m as c,de as m,df as f,U as y,K as n}from"./index-
|
|
1
|
+
import{c as l,m as c,de as m,df as f,U as y,K as n}from"./index-Cw6ilRLN.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 d(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,d as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,U as p,m as q,K as m}from"./index-
|
|
1
|
+
import{c as f,U as p,m as q,K as m}from"./index-Cw6ilRLN.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-Cw6ilRLN.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as x,b as F,e as H,K as C,bq as j}from"./index-
|
|
1
|
+
import{q as x,b as F,e as H,K as C,bq as j}from"./index-Cw6ilRLN.js";import{u as v}from"./use-session-runtime-C29BLCO5.js";import{o as B,c as J,u as N,D as R,W,H as S,F as U,G as A,N as G,O as L,P as z,R as Y,al as _,a0 as $,$ as V,q as D,J as b}from"./site-editor-toast-MdEv_oKc.js";import{s as X}from"./sandbox-git-api-DcqI6XE4.js";import{u as Z}from"./chat-context-DR3uLV2w.js";import{F as g,H as M}from"./blocks-tab-states-Bujj2Oag.js";import{b as O}from"./sandbox-url-D3mC8qhT.js";import{d as Q}from"./utils-CFwQd3Dj.js";function fe({orgSlug:i,virtualMcpId:t,branch:o}){const s=x(),y=Z()?.taskId??null,P=B(t),q=v(t).runtime==="cms",{url:T}=J(t),k=N(t,o),f=k.kind==="protocol"?k:null,d=R({orgSlug:i,virtualMcpId:t,branch:o}),m=C.decofile(d),K=F(),E=async(a,c)=>{if(T)return{ok:!0};if(q){const r=await $({orgSlug:i,virtualMcpId:t,branch:o},{set:a,delete:c});return V(s,{orgSlug:i,virtualMcpId:t,branch:o},r),await s.invalidateQueries({queryKey:X({orgSlug:i,virtualMcpId:t,branch:o,threadId:y})}),r}const u={orgSlug:i,virtualMcpId:t,branch:o,threadId:y};for(const[r,n]of Object.entries(a)){const e=await fetch(O(u,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:D(P,Q(r)),content:JSON.stringify(n,null,2)})});if(!e.ok)return b(e,"Write")}for(const r of c){const n=await fetch(O(u,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:D(P,Q(r))})});if(!n.ok)return b(n,"Delete")}return{ok:!0}},p=H({mutationKey:A(i,t,o),scope:U(i,t,o),mutationFn:async({writes:a,deletes:c,copies:u,shown:r})=>{const n=f?.source==="github"?a:j(a);return f?.source==="github"?g({queryClient:s,backend:f,params:{orgSlug:i,virtualMcpId:t,branch:o},cacheKey:d},{writes:n,deletes:c.filter(e=>!(e in n))},u,r?.()):f?W(s,f,{orgSlug:i,virtualMcpId:t,branch:o},d,{set:n,delete:c.filter(e=>!(e in n))}):S({queryClient:s,orgSlug:i,virtualMcpId:t,branch:o,backend:k,cacheKey:d},{kind:"edit",write:()=>E(n,c)})},onSuccess:()=>{f?.source!=="github"&&s.invalidateQueries({queryKey:C.liveMeta(i,t,o)})}});return{move:async(a,c)=>{const u=[...Object.keys(a.writes),...a.deletes],r=s.getQueryData(m),n=new Map;for(const e of u)r&&e in r&&n.set(e,r[e]);s.setQueryData(m,e=>I(e,a)),s.cancelQueries({queryKey:m});try{return await p.mutateAsync({...a,copies:r,shown:c?.shown})}catch(e){throw e instanceof M?(G(K,e.deleted,e.deleted&&a.deletes.length>0&&a.deletes.every(l=>L(s,d,l))),e):(z(K,e),f?.source==="github"&&(Y(e)||e instanceof _)||s.setQueryData(m,l=>{if(!l)return l;const w={...l};for(const h of u)n.has(h)?w[h]=n.get(h):delete w[h];return w}),e)}},isPending:p.isPending,isError:p.isError}}function I(i,{writes:t,deletes:o}){const s={...i??{},...t};for(const y of o)y in t||delete s[y];return s}export{I as a,fe as u};
|
package/dist/client/assets/{use-navigate-to-agent-DqWY18b4.js → use-navigate-to-agent-X54xBbs-.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,aw as I,ay as D,m as S,ar as A,K as L,a4 as _,d as Y,q as V,a as J,ad as F,e7 as j,e8 as k,ed as W}from"./index-
|
|
1
|
+
import{c as g,aw as I,ay as D,m as S,ar as A,K as L,a4 as _,d as Y,q as V,a as J,ad as F,e7 as j,e8 as k,ed as W}from"./index-Cw6ilRLN.js";import{h as v,r as C,g as $,f as x,e as z,i as X}from"./repository-binding-PeMGXqSl.js";import{p as Z,u as M,d as P,w as ee}from"./thread-intent-CAWCzeoG.js";const E=[],te=4;function ne(t,e){return[e,...t.filter(n=>n!==e)].slice(0,te)}function ae(t){const e=g.c(9);let n;e[0]!==t?(n=D.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[a,r]=I(n,E),o=Array.isArray(a)?a:E;let s,i;e[2]!==r?(s=c=>r(l=>ne(Array.isArray(l)?l:E,c)),i=c=>r(l=>(Array.isArray(l)?l:E).filter(m=>m!==c)),e[2]=r,e[3]=s,e[4]=i):(s=e[3],i=e[4]);let u;return e[5]!==o||e[6]!==s||e[7]!==i?(u={recent:o,remember:s,forget:i},e[5]=o,e[6]=s,e[7]=i,e[8]=u):u=e[8],u}function B(t,e){if(!e)return!0;if(t.partial)return!1;const n=Z(t.metadata?.runtime);return n===null||n===e}function O(t,e,n,a,r){let o=null;for(const s of t)s.virtual_mcp_id===e&&s.created_by===n&&(s.hidden||B(s,a)&&(r&&s.branch===r||(!o||s.updated_at>o.updated_at)&&(o=s)));return o}function Re(t,e,n,a){return t.find(r=>!r.hidden&&r.virtual_mcp_id===e&&r.created_by===n&&r.title==="New chat"&&!r.harness_id&&B(r,a))}function re(t,e,n,a,r,o){return r?O(t,e,n,a,o?.baseBranch)??void 0:O(t,e,n,a)??void 0}const se=6e4,U=3e4;function N(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function oe(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function K(t){const{orgSlug:e,target:n,owner:a,repo:r,branch:o}=t;return{queryKey:L.githubPrState(e,C(n),a,r,o),queryFn:()=>A(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&v(n)&&!!a&&!!r,refetchInterval:se,refetchIntervalInBackground:!1,staleTime:U}}function ie(t){const e=g.c(4);let n;e[0]!==t?(n=K(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ue},e[2]=n,e[3]=a):a=e[3],S(a)}function ue(t){return t.changeRequest?N(t.changeRequest):null}function Ee(t){const e=g.c(4);let n;e[0]!==t?(n=K(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ce},e[2]=n,e[3]=a):a=e[3],S(a)}function ce(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(oe):[]}const le=5*6e4;function Se(t){const e=g.c(20),{orgSlug:n,target:a,owner:r,repo:o,base:s}=t;let i;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==o||e[4]!==a?(i=L.githubLastPublishedPr(n,C(a),r,o,s),e[0]=s,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==s||e[7]!==n||e[8]!==a?(u=()=>A(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:s}),e[6]=s,e[7]=n,e[8]=a,e[9]=u):u=e[9];let c;e[10]!==t.enabled||e[11]!==s||e[12]!==r||e[13]!==o||e[14]!==a?(c=(t.enabled??!0)&&!!s&&v(a)&&!!r&&!!o,e[10]=t.enabled,e[11]=s,e[12]=r,e[13]=o,e[14]=a,e[15]=c):c=e[15];let l;return e[16]!==i||e[17]!==u||e[18]!==c?(l={queryKey:i,queryFn:u,enabled:c,staleTime:le,select:de},e[16]=i,e[17]=u,e[18]=c,e[19]=l):l=e[19],S(l)}function de(t){return t.changeRequest?N(t.changeRequest):null}const fe=50;function Pe(t){const e=g.c(17),{orgSlug:n,target:a,owner:r,repo:o}=t;let s;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==a?(s=L.githubOpenPrs(n,C(a),r,o),e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=s):s=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>A(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:fe}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==r||e[10]!==o||e[11]!==a?(u=(t.enabled??!0)&&v(a)&&!!r&&!!o,e[8]=t.enabled,e[9]=r,e[10]=o,e[11]=a,e[12]=u):u=e[12];let c;return e[13]!==s||e[14]!==i||e[15]!==u?(c={queryKey:s,queryFn:i,enabled:u,staleTime:U,select:he},e[13]=s,e[14]=i,e[15]=u,e[16]=c):c=e[16],S(c)}function he(t){return t.changeRequests.map(N)}function ge(t,e){const{org:n}=_(),a=$(t);return ie({orgId:n.id,orgSlug:n.slug,target:x(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const me=[];function Ae(){const t=g.c(15),e=Y(),{org:n,locator:a}=_(),r=V(),o=z(),{data:s}=J.useSession(),i=M(),u=ge(void 0,null),c=F(),{remember:l}=ae(n.slug);let m;t[0]!==u||t[1]!==o||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==c||t[7]!==l||t[8]!==s?.user?.id?(m=(d,f,y)=>{if(c&&!f?.panel){l(d),e(G(n.slug,d));return}const h=f?.panel??"overview";if(j(h).kind==="org-destination"){k(e,{tabId:h,org:n.slug,agentId:d,replace:!1});return}const p=(o??[]).find(H=>H.id===d),Q=!!(p&&$(p)),q=!f?.runtime,w=q?void 0:re(i?.threads.get()??me,d,s?.user?.id,y??(p?P(p.metadata):void 0),Q,{baseBranch:u}),R=q?void 0:w?.id??crypto.randomUUID();R&&!w&&f?.runtime&&ee(sessionStorage,a,R,{runtime:f.runtime}),k(e,{tabId:h,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=o,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=c,t[7]=l,t[8]=s?.user?.id,t[9]=m):m=t[9];const b=m;let T;return t[10]!==o||t[11]!==b||t[12]!==n||t[13]!==r?(T=(d,f)=>{if(j(f?.panel??"overview").kind==="org-destination")return b(d,f,void 0);const y=o.find(h=>h.id===d);if(f?.runtime)return b(d,f,f.runtime);if(y)return b(d,f,P(y.metadata));X(r,n).then(h=>h.find(p=>p.id===d)).catch(be).then(h=>b(d,f,h?P(h.metadata):void 0))},t[10]=o,t[11]=b,t[12]=n,t[13]=r,t[14]=T):T=t[14],T}function be(){}function G(t,e){return{to:"/$org/projects/$agentId",params:{org:t,agentId:e},search:n=>({...n,project:void 0,virtualmcpid:void 0,thread:void 0,mainpanel:void 0})}}function Le(){const t=g.c(3),{org:e}=_(),n=F();let a;return t[0]!==e.slug||t[1]!==n?(a=(r,o)=>{if(n&&!o)return G(e.slug,r);const s=W({tabId:o??"overview",org:e.slug,agentId:r});return{to:s.to,params:s.params,search:s.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{Le as a,ae as b,ge as c,re as d,Pe as e,Re as f,ie as g,Se as h,Ee as i,K as p,Ae as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,a4 as w,K as y,m as $,q as L,e as P}from"./index-BWpKrclg.js";import{u as _}from"./useInfiniteQuery-CFafSHXd.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function F(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let r="";try{r=(await s.json()).error??""}catch{}throw new Error(r||`HTTP ${s.status}`)}function Z(n,e,t){const s=p.c(16),{org:r}=w(),i=t?.enabled??!0;let a;s[0]!==r.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(r.id,n,e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==r.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===r.id&&u.queryKey[2]===n?f:void 0,s[4]=r.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==r.slug||s[8]!==e||s[9]!==n?(c=async()=>(await(await h(F(r.slug,n,"list",{path:e}))).json()).entries.toSorted(x),s[7]=r.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==i||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:i,queryKey:a,placeholderData:o,queryFn:c},s[11]=i,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}function x(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}async function E(n,e,t){const s=await h(F(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=p.c(16),{org:r}=w();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=y.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==r.slug||s[7]!==e||s[8]!==n?(l=()=>E(r.slug,n??"",e),s[6]=r.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==i||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:i,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=i,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=p.c(9),s=n===void 0?60:n,{org:r}=w();let i;t[0]!==r.id?(i=y.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==r.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=o):o=t[4];let c;return t[5]!==i||t[6]!==a||t[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},t[5]=i,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=p.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,initialPageParam:null,queryFn:r,getNextPageParam:C},e[6]=s,e[7]=r,e[8]=i):i=e[8],_(i)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=p.c(16),{org:s}=w();let r;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(r=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=r):r=t[4];const i=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==r||t[12]!==i||t[13]!==a||t[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},t[11]=r,t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=p.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function re(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}async function M(n,e,t){return(await h(F(n,e,"read",{path:t}))).text()}function ie(n,e){const t=p.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const r=e?.enabled!==!1&&n!=="";let i;t[2]!==n?(i=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==s||t[5]!==r||t[6]!==i?(a={queryKey:s,enabled:r,staleTime:6e4,retry:!1,queryFn:i},t[4]=s,t[5]=r,t[6]=i,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(F(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&i.length<D?i.push(d.path):a.push(r(d.path))}}const c=await Promise.all(i.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return i.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(r(u));return}f+=d.length,l.push({relPath:r(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}function le(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>F(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=p.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,r)=>F(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await h(F(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,r,i="text/markdown; charset=utf-8"){const a={"content-type":i};r&&"absent"in r?a["if-none-match"]="*":r&&(a["if-match"]=`"${r.contentHash}"`);const o=await fetch(F(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=p.c(18),{org:t}=w(),s=L();let r;e[0]!==t||e[1]!==n?(r=async l=>(await(await h(F(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=p.c(33),{org:t}=w(),s=L();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async S=>{const q=(await Promise.allSettled(S.files.map(T=>{const O=S.dir?`${S.dir}/${T.name}`:T.name;return h(F(t.slug,n,"file",{path:O}),{method:"PUT",headers:{"content-type":T.type||"application/octet-stream"},body:T})}))).find(Y);if(q)throw q.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==i||e[8]!==a?(o={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(F(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==i||e[14]!==l?(f={mutationFn:l,onSuccess:i},e[13]=i,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(F(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==i||e[20]!==g?(d={mutationFn:g,onSuccess:i},e[19]=i,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(F(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==i||e[26]!==m?(I={mutationFn:m,onSuccess:i},e[25]=i,e[26]=m,e[27]=I):I=e[27];const k=P(I);let K;return e[28]!==u||e[29]!==k||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:k},e[28]=u,e[29]=k,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{le as a,Q as b,v as c,ue as d,G as e,ae as f,de as g,ie as h,re as i,ge as j,ce as k,X as l,E as m,M as n,ee as o,ne as p,oe as q,se as r,te as s,Z as u,fe as w};
|
|
1
|
+
import{c as p,a4 as w,K as y,m as $,q as L,e as P}from"./index-Cw6ilRLN.js";import{u as _}from"./useInfiniteQuery-qZeYk4so.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function F(n,e,t,s){const r=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${r?`?${r}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let r="";try{r=(await s.json()).error??""}catch{}throw new Error(r||`HTTP ${s.status}`)}function Z(n,e,t){const s=p.c(16),{org:r}=w(),i=t?.enabled??!0;let a;s[0]!==r.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(r.id,n,e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==r.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===r.id&&u.queryKey[2]===n?f:void 0,s[4]=r.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==r.slug||s[8]!==e||s[9]!==n?(c=async()=>(await(await h(F(r.slug,n,"list",{path:e}))).json()).entries.toSorted(x),s[7]=r.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==i||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:i,queryKey:a,placeholderData:o,queryFn:c},s[11]=i,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}function x(n,e){return n.kind!==e.kind?n.kind==="dir"?-1:1:n.path.localeCompare(e.path)}async function E(n,e,t){const s=await h(F(n,e,"stat",{path:t}),void 0,{allow404:!0});return s.status===404?null:(await s.json()).entry}function v(n,e,t){const s=p.c(16),{org:r}=w();let i;s[0]!==r.id||s[1]!==e||s[2]!==n?(i=y.orgFsStat(r.id,n??"",e),s[0]=r.id,s[1]=e,s[2]=n,s[3]=i):i=s[3];const a=n!==null,o=t?.staleTime;let c;s[4]!==t?(c=t?.refetchIntervalWhenAbsent?u=>u.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,s[4]=t,s[5]=c):c=s[5];let l;s[6]!==r.slug||s[7]!==e||s[8]!==n?(l=()=>E(r.slug,n??"",e),s[6]=r.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==i||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:i,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=i,s[11]=a,s[12]=o,s[13]=c,s[14]=l,s[15]=f):f=s[15],$(f)}function ee(n,e){const t=p.c(9),s=n===void 0?60:n,{org:r}=w();let i;t[0]!==r.id?(i=y.orgFsRecent(r.id),t[0]=r.id,t[1]=i):i=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==r.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=r.slug,t[4]=o):o=t[4];let c;return t[5]!==i||t[6]!==a||t[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},t[5]=i,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=p.c(9),{org:t}=w();let s;e[0]!==t.id||e[1]!==n?(s=y.orgFsVolumeFiles(t.id,n),e[0]=t.id,e[1]=n,e[2]=s):s=e[2];let r;e[3]!==t.slug||e[4]!==n?(r=async a=>{const{pageParam:o}=a,c=new URLSearchParams({limit:String(R)});return o&&c.set("before",o),await(await h(`/api/${encodeURIComponent(t.slug)}/fs/${encodeURIComponent(n)}/files?${c}`)).json()},e[3]=t.slug,e[4]=n,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==r?(i={queryKey:s,initialPageParam:null,queryFn:r,getNextPageParam:C},e[6]=s,e[7]=r,e[8]=i):i=e[8],_(i)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=p.c(16),{org:s}=w();let r;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(r=y.orgFsSearch(s.id,n,e?.volume??"",e?.prefix??""),t[0]=s.id,t[1]=n,t[2]=e?.prefix,t[3]=e?.volume,t[4]=r):r=t[4];const i=n.length>0;let a;t[5]!==s.id?(a=(l,f)=>f?.queryKey[1]===s.id?l:void 0,t[5]=s.id,t[6]=a):a=t[6];let o;t[7]!==s.slug||t[8]!==n||t[9]!==e?(o=async()=>{const l=new URLSearchParams({q:n,limit:String(U)});return e&&(l.set("volume",e.volume),e.prefix&&l.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(s.slug)}/fs/search?${l}`)).json()).entries},t[7]=s.slug,t[8]=n,t[9]=e,t[10]=o):o=t[10];let c;return t[11]!==r||t[12]!==i||t[13]!==a||t[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},t[11]=r,t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=p.c(8),{org:t}=w();let s;e[0]!==t.id?(s=y.orgFsSkills(t.id),e[0]=t.id,e[1]=s):s=e[1];const r=n?.enabled;let i;e[2]!==t.slug?(i=async()=>{const o=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(j)},e[2]=t.slug,e[3]=i):i=e[3];let a;return e[4]!==s||e[5]!==r||e[6]!==i?(a={queryKey:s,enabled:r,queryFn:i},e[4]=s,e[5]=r,e[6]=i,e[7]=a):a=e[7],$(a)}function j(n){return{volume:n.volume,path:n.path}}async function Q(n){const e=await h(`/api/${encodeURIComponent(n)}/fs/skills`),{skills:t}=await e.json();return t}function re(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.slashSkills(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=()=>Q(e.slug),n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}async function M(n,e,t){return(await h(F(n,e,"read",{path:t}))).text()}function ie(n,e){const t=p.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const r=e?.enabled!==!1&&n!=="";let i;t[2]!==n?(i=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==s||t[5]!==r||t[6]!==i?(a={queryKey:s,enabled:r,staleTime:6e4,retry:!1,queryFn:i},t[4]=s,t[5]=r,t[6]=i,t[7]=a):a=t[7],$(a)}const A=new Set(["md","mdx","markdown","txt","text"]),D=25,N=64*1024,H=256*1024,V=4;function W(n){const e=n.lastIndexOf(".");return e===-1?!1:A.has(n.slice(e+1).toLowerCase())}async function ae(n,e,t){const s=t?`${t}/`:"",r=u=>u.startsWith(s)?u.slice(s.length):u,i=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(F(n,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((b,m)=>b.path.localeCompare(m.path))){if(d.kind==="dir"){u.depth<V&&o.push({path:d.path,depth:u.depth+1});continue}W(d.path)&&d.size<=N&&i.length<D?i.push(d.path):a.push(r(d.path))}}const c=await Promise.all(i.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return i.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(r(u));return}f+=d.length,l.push({relPath:r(u),content:d})}),l.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:l,omittedPaths:a}}function oe(){const n=p.c(7),{org:e}=w();let t;n[0]!==e.id?(t=y.orgFsPublicSets(e.id),n[0]=e.id,n[1]=t):t=n[1];let s;n[2]!==e.slug?(s=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,n[2]=e.slug,n[3]=s):s=n[3];let r;return n[4]!==t||n[5]!==s?(r={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=r):r=n[6],$(r)}function le(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=r=>F(t.slug,n,"read",{path:r}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=p.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,r)=>F(e.slug,s,"read",{path:r}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=p.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async r=>(await(await h(F(t.slug,n,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,r,i="text/markdown; charset=utf-8"){const a={"content-type":i};r&&"absent"in r?a["if-none-match"]="*":r&&(a["if-match"]=`"${r.contentHash}"`);const o=await fetch(F(n,e,"file",{path:t}),{method:"PUT",headers:a,body:s});if(o.status===412)return{ok:!1,reason:"conflict"};if(o.status===403)return{ok:!1,reason:"forbidden"};if(!o.ok)throw new Error(`HTTP ${o.status}`);return{ok:!0,entry:(await o.json()).entry}}function de(n){const e=p.c(18),{org:t}=w(),s=L();let r;e[0]!==t||e[1]!==n?(r=async l=>(await(await h(F(t.slug,n,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,e[0]=t,e[1]=n,e[2]=r):r=e[2];let i;e[3]!==t||e[4]!==s||e[5]!==n?(i=async l=>{const f=y.orgFsStat(t.id,n,l.path);await s.cancelQueries({queryKey:f});const u=s.getQueryData(f),g=l.mode!=="private";return s.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:l.mode}),{key:f,previous:u}},e[3]=t,e[4]=s,e[5]=n,e[6]=i):i=e[6];let a;e[7]!==s?(a=(l,f,u)=>{u&&s.setQueryData(u.key,u.previous)},e[7]=s,e[8]=a):a=e[8];let o;e[9]!==t||e[10]!==s||e[11]!==n?(o=(l,f,u)=>{s.invalidateQueries({queryKey:y.orgFsStat(t.id,n,u.path)}),s.invalidateQueries({queryKey:y.orgFsVolume(t.id,n)}),s.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),s.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=s,e[11]=n,e[12]=o):o=e[12];let c;return e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=c):c=e[17],P(c)}function X(n,e,t){n.invalidateQueries({queryKey:y.orgFsVolume(e,t)}),n.invalidateQueries({queryKey:y.orgFsRecent(e)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e)})}function ge(n){const e=p.c(33),{org:t}=w(),s=L();let r;e[0]!==t||e[1]!==s||e[2]!==n?(r=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=r):r=e[3];const i=r;let a;e[4]!==t||e[5]!==n?(a=async S=>{const q=(await Promise.allSettled(S.files.map(T=>{const O=S.dir?`${S.dir}/${T.name}`:T.name;return h(F(t.slug,n,"file",{path:O}),{method:"PUT",headers:{"content-type":T.type||"application/octet-stream"},body:T})}))).find(Y);if(q)throw q.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==i||e[8]!==a?(o={mutationFn:a,onSettled:i},e[7]=i,e[8]=a,e[9]=o):o=e[9];const c=P(o);let l;e[10]!==t||e[11]!==n?(l=async S=>{await h(F(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==i||e[14]!==l?(f={mutationFn:l,onSuccess:i},e[13]=i,e[14]=l,e[15]=f):f=e[15];const u=P(f);let g;e[16]!==t||e[17]!==n?(g=async S=>{await h(F(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==i||e[20]!==g?(d={mutationFn:g,onSuccess:i},e[19]=i,e[20]=g,e[21]=d):d=e[21];const b=P(d);let m;e[22]!==t||e[23]!==n?(m=async S=>{await h(F(t.slug,n,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})},e[22]=t,e[23]=n,e[24]=m):m=e[24];let I;e[25]!==i||e[26]!==m?(I={mutationFn:m,onSuccess:i},e[25]=i,e[26]=m,e[27]=I):I=e[27];const k=P(I);let K;return e[28]!==u||e[29]!==k||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:k},e[28]=u,e[29]=k,e[30]=b,e[31]=c,e[32]=K):K=e[32],K}function Y(n){return n.status==="rejected"}export{le as a,Q as b,v as c,ue as d,G as e,ae as f,de as g,ie as h,re as i,ge as j,ce as k,X as l,E as m,M as n,ee as o,ne as p,oe as q,se as r,te as s,Z as u,fe as w};
|
package/dist/client/assets/{use-org-repo-syncs-D-0WnIj6.js → use-org-repo-syncs-ON_B-I08.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,a4 as f,ap as y,K as S,m as _,q as d,e as R}from"./index-
|
|
1
|
+
import{c as r,a4 as f,ap as y,K as S,m as _,q as d,e as R}from"./index-Cw6ilRLN.js";const p=5e3;function m(e){return(e??[]).some(n=>!n.lastSyncedAt&&!n.lastSyncError)}function g(){const e=r.c(7),{org:n}=f(),t=y();let c;e[0]!==n.id?(c=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=c):c=e[1];let s;e[2]!==t?(s=async()=>(await t.call("ORG_REPO_SYNC_LIST",{})).configs,e[2]=t,e[3]=s):s=e[3];let o;return e[4]!==c||e[5]!==s?(o={queryKey:c,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=c,e[5]=s,e[6]=o):o=e[6],_(o)}function E(e){return m(e.state.data)?p:!1}function P(){const e=r.c(2),n=g();let t;return e[0]!==n.data?(t=new Set((n.data??[]).map(O)),e[0]=n.data,e[1]=t):t=e[1],t}function O(e){return e.volume}function q(){const e=r.c(12),{org:n}=f(),t=y(),c=d();let s;e[0]!==n||e[1]!==c?(s=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=c,e[2]=s):s=e[2];const o=s;let i;e[3]!==t?(i=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==t?(a=u=>{t.call("ORG_REPO_SYNC_RUN",{id:u.id}).catch(C).then(o)},e[5]=o,e[6]=t,e[7]=a):a=e[7];let l;return e[8]!==o||e[9]!==i||e[10]!==a?(l={mutationFn:i,onSuccess:a,onSettled:o},e[8]=o,e[9]=i,e[10]=a,e[11]=l):l=e[11],R(l)}function C(){return null}function T(){const e=r.c(8),{org:n}=f(),t=y(),c=d();let s;e[0]!==t?(s=a=>t.call("ORG_REPO_SYNC_DELETE",{id:a}),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==c?(o=()=>c.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=c,e[4]=o):o=e[4];let i;return e[5]!==s||e[6]!==o?(i={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=i):i=e[7],R(i)}export{P as a,q as b,T as c,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,m as S,q as r,e as y,K as c}from"./index-
|
|
1
|
+
import{c as u,m as S,q as r,e as y,K as c}from"./index-Cw6ilRLN.js";async function f(i,a,e){const s=await fetch(i,a);if(!s.ok){const t=await s.json().catch(()=>null);throw new Error(t?.error||e)}return s.json()}function q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoStatus(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/status`,void 0,"Failed to check SSO status"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function m(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{m as a,C as b,O as c,h as d,q as u};
|
package/dist/client/assets/{use-organization-roles-DXXkhsvq.js → use-organization-roles-CxgWGtCR.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a4 as E,gB as I,aA as N,m as B,K as _}from"./index-
|
|
1
|
+
import{a4 as E,gB as I,aA as N,m as B,K as _}from"./index-Cw6ilRLN.js";const v="connections",d="*",m="!";function P(o){return`${m}${o}`}function F(o){return o.startsWith(m)?o.slice(m.length):null}function R(o){if(o.includes(P(d)))return{kind:"only",names:[]};const n=new Set,i=new Set;for(const l of o){const t=F(l);t!==null?n.add(t):l!==d&&i.add(l)}return o.includes(d)?n.size===0?{kind:"all"}:{kind:"except",names:[...n]}:{kind:"only",names:[...i].filter(l=>!n.has(l))}}function L(o){return[d,...o.names.map(P)]}const S="projects";function j(o){if(!o)return null;const n=o[S];return Array.isArray(n)?n:null}function K(o){return o===null?{kind:"all"}:R(o)}const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function T(o){return o.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function k(o){if(!o)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const l=[];let t=!1;const u=new Set;let a=!1,r=0,f=!1;for(const[e,s]of Object.entries(o)){if(e==="self"){s.includes("*")?i=!0:n.push(...s);continue}if(e==="models"){s.includes("*:*")?f=!0:r=s.length;continue}if(e!==S){if(e===v){R(s).kind!=="only"&&(t=!0,a=!0);continue}if(e==="*"){if(t=!0,s.includes("*"))a=!0;else for(const c of s)u.add(c);continue}if(l.push(e),s.includes("*"))a=!0;else for(const c of s)u.add(c)}}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:l,allowsAllConnections:t,toolNames:Array.from(u),allowsAllTools:a,modelCount:r,allowsAllModels:f}}function M(){const{locator:o}=E(),n=I(),{isPrivileged:i}=N(),{data:l,isLoading:t,error:u,refetch:a}=B({queryKey:_.organizationRoles(o),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),[]}},enabled:i,staleTime:3e4}),r=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(l&&Array.isArray(l))for(const e of l){const s=e.role;if(!s||w.some(b=>b.value===s))continue;const{staticPermissions:c,allowsAllStaticPermissions:A,connectionIds:y,allowsAllConnections:p,toolNames:h,allowsAllTools:C,modelCount:O,allowsAllModels:g}=k(e.permission);r.push({id:e.id,role:s,label:T(s),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:A?-1:c.length,allowsAllStaticPermissions:A,connectionCount:p?-1:y.length,allowsAllConnections:p,toolCount:C?-1:h.length,allowsAllTools:C,modelCount:g?-1:O,allowsAllModels:g})}const f=r.filter(e=>!e.isBuiltin);return{roles:r,customRoles:f,builtinRoles:r.filter(e=>e.isBuiltin),isLoading:t,error:u,refetch:a}}export{v as C,S as P,d as a,R as b,P as d,j as g,L as l,K as p,M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T,c as u,bU as A,a4 as b,m as z,ar as D,K as E,ap as O,q as C,e as I}from"./index-
|
|
1
|
+
import{a as T,c as u,bU as A,a4 as b,m as z,ar as D,K as E,ap as O,q as C,e as I}from"./index-Cw6ilRLN.js";import{D as G,o as x,a as P}from"./schema-CB30E7Gi.js";import{r as R}from"./task-board-DSKYQnUa.js";const F={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},N={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function k(t,e){return{queryKey:E.organizationSettings(e),queryFn:async()=>{try{return await D(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...F,organizationId:e}}},staleTime:6e4}}function d(t){const e=u.c(7),{org:n}=b();let s;e[0]!==n.id||e[1]!==n.slug?(s=k(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t,a=!!n.id;let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i={...s,select:o,enabled:a},e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],z(i)}function _(){const t=u.c(9),{org:e}=b(),n=O(),s=C();let o;t[0]!==e||t[1]!==n?(o=async l=>{const r=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!r)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return r},t[0]=e,t[1]=n,t[2]=o):o=t[2];let a;t[3]!==e||t[4]!==s?(a=l=>{s.setQueryData(E.organizationSettings(e.id),r=>({...r??F,...l}))},t[3]=e,t[4]=s,t[5]=a):a=t[5];let i;return t[6]!==o||t[7]!==a?(i={mutationFn:o,onSuccess:a},t[6]=o,t[7]=a,t[8]=i):i=t[8],I(i)}function L(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:N}function B(){const{data:t}=d(U);return t??N}function U(t){return L(t.simple_mode)}function V(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i)=>e.mutate({simple_mode:a},i),s=(a,i)=>e.mutateAsync({simple_mode:a},i),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function W(){return c("reports_only")}function c(t){const e=u.c(5);let n;e[0]!==t?(n=a=>x(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(n);let o;return e[2]!==s||e[3]!==t?(o=s??G.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function H(t){const e=u.c(6);let n;e[0]!==t?(n=i=>x(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=d(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?G.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function J(){const t=c("chat_harness_sandbox_only");return A().runtime.agentSandbox&&t}function X(){const t=u.c(8),{org:e}=b(),n=O(),s=C();let o;t[0]!==n?(o=l=>n.call("ORGANIZATION_BLOCKS_EDITOR_SET",{enabled:l}),t[0]=n,t[1]=o):o=t[1];let a;t[2]!==e||t[3]!==s?(a=l=>{const{enabled:r}=l;s.setQueryData(E.organizationSettings(e.id),m=>m&&{...m,flags:{...m.flags,new_blocks_editor:r}})},t[2]=e,t[3]=s,t[4]=a):a=t[4];let i;return t[5]!==o||t[6]!==a?(i={mutationFn:o,onSuccess:a},t[5]=o,t[6]=a,t[7]=i):i=t[7],I(i)}function w(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function tt(){const{data:t}=T.useSession();return w(t?.user?.email)}function et(){const t=u.c(9),{data:e}=T.useSession(),n=A();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||w(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,a=n.hostingControlPlaneGa===!0,i=n.monitorGa===!0,l=c("hosting_enabled"),r=c("deco_analytics_enabled"),m=c("e2e_enabled"),M=c("monitor_enabled"),$=c("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||a||m,y=o||i||M,h=o||a||$;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==y||t[7]!==h?(f={hosting:g,analytics:S,e2e:p,monitor:y,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=y,t[7]=h,t[8]=f):f=t[8],f}function nt(){const{data:t}=d(q);return t??!1}function q(t){return P(t.flags)}function st(){const{data:t}=d(Q);return t??!0}function Q(t){return R(t.flags)}function ot(){const t=u.c(7),e=_();let n,s;t[0]!==e?(n=(a,i,l)=>e.mutate({flags:{[a]:i}},l),s=(a,i,l)=>e.mutateAsync({flags:{[a]:i}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function at(){const t=u.c(2),{data:e}=d(K);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function K(t){return t.coding_agent_mcp_excluded}function it(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutate({coding_agent_mcp_excluded:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function lt(){const t=u.c(2),{data:e}=d(Z);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Z(t){return t.submodule_credentials}function ut(){const t=u.c(5),e=_();let n;t[0]!==e?(n=(o,a)=>e.mutateAsync({submodule_credentials:o},a),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutateAsync:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}export{c as a,J as b,H as c,B as d,et as e,st as f,X as g,nt as h,ot as i,at as j,it as k,V as l,lt as m,ut as n,tt as o,W as u};
|
package/dist/client/assets/{use-panel-navigate-nriEb2Qz.js → use-panel-navigate-DzWclIwL.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,f as g,u as S,e6 as _,d as k,k as b,e7 as P,e8 as E}from"./index-
|
|
1
|
+
import{c as p,f as g,u as S,e6 as _,d as k,k as b,e7 as P,e8 as E}from"./index-Cw6ilRLN.js";import{b as I}from"./thread-route-BZQyZ1gL.js";import{a as R}from"./use-project-scope-Bq5GrrDd.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function T(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:j},e[0]=t):t=e[0],b(t)}function j(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=T();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(d,c)=>{const h=P(d),v=c?.virtualmcpid!==void 0||s!==null?"project":"organization",y=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",V=w=>x({previous:w,destination:y?"organization":"agent",update:c?.search});E(t,{org:r,agentId:c?.virtualmcpid??i,tabId:d,destinationScope:v,taskKey:c?.taskKey,search:V,replace:c?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let l;e[6]!==t?(l=d=>t({to:".",search:z,replace:d?.replace??!0}),e[6]=t,e[7]=l):l=e[7];const f=l;let u;return e[8]!==f||e[9]!==m?(u={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=u):u=e[10],u}function z(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,a4 as F,bU as k,m as q,K as L}from"./index-
|
|
1
|
+
import{c as K,a4 as F,bU as k,m as q,K as L}from"./index-Cw6ilRLN.js";import{m as Q}from"./match-site-slug-config-D3fUJ6vX.js";import{u as Y}from"./use-file-configs-C8WLQuJ_.js";import{e as z}from"./use-organization-settings-BFBXS4UG.js";import{d as G,e as U,f as H}from"./experiments-tab-choice-B1sDnY5T.js";import{r as X,a as Z}from"./site-slug-DebpOoQq.js";const P=["overview","reports","board","site-editor","calendar","experiments","assets","releases","hosting","e2e","analytics","cdn","automations"],M=["overview","reports","board","site-editor"],ee=1,N=["calendar","experiments"];function ue(t,e){if(!e)return[];const n=new Set(t??[]);return N.filter(s=>!n.has(s))}function me(t,e){if(!e)return t===null?null:t&&[...t];const n=new Set([...t??[],...N]);return P.filter(s=>n.has(s))}const te=["calendar","experiments","assets","releases","hosting","e2e","analytics","cdn"];function Pe(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const s=e?.id===t?e:n?.id===t?n:null;return{project:s,resolvedScopeId:s?t:null}}function Se(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function $(t,e,n=[]){const s=new Set(t??[]);if(e!==ee)for(const r of M)s.add(r);for(const r of n)s.add(r);return P.filter(r=>s.has(r))}function se(t){return P.some(e=>e===t)}function ne(t){return te.some(e=>e===t)}function re(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,releases:t&&e.releases,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,experiments:t&&e.experiments,calendar:t&&e.calendar,automations:!0}}function pe(t,e,n){const s=re(e,n);return t?s:{...s,overview:!0,reports:!0,board:!0}}function Ve(t,e,n,s=[]){const r=new Set($(t,n,s));return P.filter(o=>e[o]&&r.has(o))}function be(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ge(t){return P.filter(e=>t[e])}function ie(t,e,n){return!se(t)||e[t]?!1:ne(t)?t==="releases"?!n.releases:t==="calendar"||t==="experiments"?!n.calendar:!(t==="assets"?n.assets:n.siteAccess):!0}function we(t,e,n,s,r){return ie(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!s.includes("content")||t==="code"&&r&&!s.includes("code")}function Ee(t,e,n,s){const r=new Set($(t,s));return n?r.add(e):r.delete(e),P.filter(o=>r.has(o))}function ye(t){const e=K.c(35),{org:n}=F(),s=k(),r=z(),o=Y(),i=G(t),p=i==="v8";let V;e[0]!==t?(V=X(t),e[0]=t,e[1]=V):V=e[1];const a=V,b=s.hostingEnabled===!0,S=s.monitorEnabled===!0||s.auth.localMode===!0,B=(b||S)&&!!a,O=J(n.slug,a,B);let g;e[2]!==t?(g=Z(t),e[2]=t,e[3]=g):g=e[3];const y=g,A=S&&!!y&&y!==a,W=J(n.slug,y,A),c=O.data?.owned===!0,x=A?W.data?.owned===!0:c;let l;e[4]!==o.data?.configs?(l=o.data?.configs??[],e[4]=o.data?.configs,e[5]=l):l=e[5];let w;e[6]!==a||e[7]!==l?(w=Q(l,a),e[6]=a,e[7]=l,e[8]=w):w=e[8];const _=!!w,h=p&&!!t?.metadata?.siteSlug,I=b&&c&&r.hosting,R=b&&c&&r.e2e,j=b&&c&&r.analytics;let d;e[9]!==r.monitor||e[10]!==i||e[11]!==S||e[12]!==x||e[13]!==c?(d=S&&(U(i)?c:x)&&r.monitor,e[9]=r.monitor,e[10]=i,e[11]=S,e[12]=x,e[13]=c,e[14]=d):d=e[14];let f;e[15]!==r.experiments||e[16]!==i?(f=H(r.experiments,i),e[15]=r.experiments,e[16]=i,e[17]=f):f=e[17];let u;e[18]!==i?(u=U(i),e[18]=i,e[19]=u):u=e[19];let m;e[20]!==f||e[21]!==u||e[22]!==_||e[23]!==h||e[24]!==I||e[25]!==R||e[26]!==j||e[27]!==d?(m={assets:_,releases:h,hosting:I,e2e:R,analytics:j,cdn:d,experiments:f,calendar:u},e[20]=f,e[21]=u,e[22]=_,e[23]=h,e[24]=I,e[25]=R,e[26]=j,e[27]=d,e[28]=m):m=e[28];const D=!!a&&o.isPending,C=!!t?.metadata?.siteSlug&&(i==="loading"||i==="error"),v=!!t&&i==="loading",T=B&&O.isPending||A&&W.isPending;let E;return e[29]!==m||e[30]!==D||e[31]!==C||e[32]!==v||e[33]!==T?(E={presence:m,assetsPending:D,releasesPending:C,calendarPending:v,siteAccessPending:T},e[29]=m,e[30]=D,e[31]=C,e[32]=v,e[33]=T,e[34]=E):E=e[34],E}function J(t,e,n){const s=K.c(10);let r;s[0]!==t||s[1]!==e?(r=L.hostingAccess(t,e??""),s[0]=t,s[1]=e,s[2]=r):r=s[2];let o;s[3]!==t||s[4]!==e?(o=async()=>{const p=await fetch(`/api/${t}/hosting/${encodeURIComponent(e??"")}/access`);return p.ok?await p.json():{owned:!1,canWrite:!1}},s[3]=t,s[4]=e,s[5]=o):o=s[5];let i;return s[6]!==n||s[7]!==r||s[8]!==o?(i={queryKey:r,queryFn:o,enabled:n,staleTime:6e4},s[6]=n,s[7]=r,s[8]=o,s[9]=i):i=s[9],q(i)}export{te as P,ee as a,Pe as b,pe as c,we as d,$ as e,ie as f,ge as g,me as h,be as i,ue as o,re as p,Se as r,Ve as s,Ee as t,ye as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,f as P,u as T,d as N,ak as R,e9 as k,e8 as E,af as l}from"./index-
|
|
1
|
+
import{c as I,f as P,u as T,d as N,ak as R,e9 as k,e8 as E,af as l}from"./index-Cw6ilRLN.js";import{e as C,c as O,p as w}from"./repository-binding-PeMGXqSl.js";const x=1;function b(e){return(e??[]).filter(k)}function M(){const e=I.c(4);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const r=P(o);let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[1]=n):n=e[1];const t=T(n);if(r.agentId)return r.agentId;let a;return e[2]!==t?(a="virtualmcpid"in t&&typeof t.virtualmcpid=="string"?t.virtualmcpid.trim():void 0,e[2]=t,e[3]=a):a=e[3],a||null}function D(){const e=I.c(16),o=N();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const n=P(r),t=R(),a=C(),c=b(a),s=M(),y=c.find(i=>i.id===s)??null;let p;e[1]!==a||e[2]!==s?(p=s&&a.length>0&&!a.some(i=>i.id===s)?s:null,e[1]=a,e[2]=s,e[3]=p):p=e[3];const _=O(p),u=y??b(_?[_]:[])[0]??null;let m;e[4]!==t||e[5]!==o||e[6]!==n||e[7]!==s?(m=i=>{if(i===s&&t!==void 0)return;const h=n.org??"",S=V;if(i){E(o,{org:h,agentId:i,tabId:t==="board"||t==="reports"?t:"overview",search:S,replace:!1});return}if(t==="board"){o({to:l.tasks,params:{org:h,taskKey:void 0},search:S});return}const j=t==="files"?l.library:t==="monitoring"?l.monitoring:t==="plan"?l.plan:l.home;o({to:j,params:{org:h},search:S})},e[4]=t,e[5]=o,e[6]=n,e[7]=s,e[8]=m):m=e[8];const d=m,v=w(u),g=c.length>=x;let f;return e[9]!==u||e[10]!==c||e[11]!==s||e[12]!==d||e[13]!==v||e[14]!==g?(f={scopeId:s,project:u,repo:v,projects:c,hasProjects:g,setScope:d},e[9]=u,e[10]=c,e[11]=s,e[12]=d,e[13]=v,e[14]=g,e[15]=f):f=e[15],f}function V(e){return{...e,virtualmcpid:void 0,thread:void 0,mainpanel:void 0,path:void 0,preview:void 0,expanded:void 0}}export{M as a,b as s,D as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,c as f,k as I,aw as A,ay as j,al as y}from"./index-
|
|
1
|
+
import{r as m,c as f,k as I,aw as A,ay as j,al as y}from"./index-Cw6ilRLN.js";import{P as N}from"./project-apps-CbCNo3Qh.js";import{c as b}from"./repository-binding-PeMGXqSl.js";function C(n,t){const e=new Set(t);return e.size===0?n:n.filter(c=>e.has(c.connectionId))}function E(n){const t=n.metadata?.ui;return Array.isArray(t?.pinnedViews)?t.pinnedViews.filter(e=>!!e&&typeof e=="object"&&typeof e.connectionId=="string"&&typeof e.toolName=="string"&&["undefined","string"].includes(typeof e.label)&&(e.icon==null||typeof e.icon=="string")):[]}const P=4;function d(n,t){return n.app===t.app&&n.projectId===t.projectId}function R(n,t,e=P){return[t,...n.filter(c=>!d(c,t))].slice(0,e)}function w(n,t){return n.filter(e=>!d(e,t))}function h(n,t,e){const c=n.findLast(l=>l.staticData.mainView);if(!c)return null;const{mainView:r,siteEditorView:s,local:i}=c.staticData;if(!r)return null;const o=c.params,a=o?.agentId;if(a&&r==="app"&&o.connectionId&&o.toolName)return{app:e(o.connectionId,o.toolName),projectId:a,connection:{id:o.connectionId,toolName:o.toolName}};const p=s?"site-editor":r;return t(p)?a?{app:p,projectId:a}:i?{app:p,projectId:null}:null:null}const u=[];function V(n){const t=f.c(9);let e;t[0]!==n?(e=j.recentApps(n),t[0]=n,t[1]=e):e=t[1];const[c,r]=A(e,u),s=Array.isArray(c)?c:u;let i,o;t[2]!==r?(i=p=>r(l=>R(Array.isArray(l)?l:[],p)),o=p=>r(l=>w(Array.isArray(l)?l:[],p)),t[2]=r,t[3]=i,t[4]=o):(i=t[3],o=t[4]);let a;return t[5]!==s||t[6]!==i||t[7]!==o?(a={recent:s,remember:i,forget:o},t[5]=s,t[6]=i,t[7]=o,t[8]=a):a=t[8],a}function O(){const n=f.c(1);let t;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:S,structuralSharing:!0},n[0]=t):t=n[0],I(t)}function S(n){return h(n.matches,T,y)}function T(n){return n in N}function g(n){const{remember:t}=V(n),e=O(),c=b(e?.projectId),r=e?.projectId&&c?.id===e.projectId?c.title:null,s=e?.connection&&c?E(c).find(o=>o.connectionId===e.connection?.id&&o.toolName===e.connection.toolName):void 0,i=e?.connection&&{id:e.connection.id,toolName:e.connection.toolName,label:s?.label||e.connection.toolName,icon:s?.icon};m.useEffect(()=>{!e?.projectId||!r||t({app:e.app,projectId:e.projectId,projectTitle:r,...i&&{connection:i}})},[n,e?.app,e?.projectId,r,i?.label,i?.icon])}export{O as a,V as b,C as k,E as p,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Q,a4 as _,q as k}from"./index-
|
|
1
|
+
import{c as Q,a4 as _,q as k}from"./index-Cw6ilRLN.js";import{a as E,d as P}from"./repository-binding-PeMGXqSl.js";import{r as z}from"./serial-task-queue-CGOeQgpr.js";function O(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function F(t){return t?.name||t?.email?.split("@")[0]||void 0}function K(t){const e=O(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function T(t,e){return t.some(s=>s.branch===e.branch)?t:[...t,e]}function V(t,e){return t.filter(s=>s.branch!==e)}function j(t,e,s){return t.map(r=>r.branch===e?{...r,name:s}:r)}const w=["orange","violet","blue","pink","amber","teal"];function W(t){return w[t%w.length]}function G(t,e){const s=`${e} `,r=t.reduce((c,m)=>{if(!m.name.startsWith(s))return c;const n=Number(m.name.slice(s.length));return Number.isInteger(n)&&n>c?n:c},0);return`${e} ${r+1}`}const q={orange:"bg-orange-500",violet:"bg-violet-500",blue:"bg-blue-500",pink:"bg-pink-500",amber:"bg-amber-500",teal:"bg-teal-500"};function H(t){return t&&q[t]||"bg-muted-foreground"}function J(t){const e=Q.c(27),s=E(t);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={silent:!0},e[0]=r):r=e[0];const c=P(r),{org:m}=_(),n=k();let b;e[1]!==s?.metadata?.releases?(b=s?.metadata?.releases??[],e[1]=s?.metadata?.releases,e[2]=b):b=e[2];const f=b;let d;e[3]!==m||e[4]!==t?(d=a=>a[1]===m.id&&a[3]==="collection"&&a[4]==="VIRTUAL_MCP"&&a[5]===t,e[3]=m,e[4]=t,e[5]=d):d=e[5];const u=d;let p;e[6]!==u||e[7]!==n||e[8]!==f?(p=()=>{for(const[,a]of n.getQueriesData({predicate:o=>u(o.queryKey)}))if(a?.item)return a.item.metadata?.releases??[];return f},e[6]=u,e[7]=n,e[8]=f,e[9]=p):p=e[9];const $=p;let h;e[10]!==c||e[11]!==u||e[12]!==n||e[13]!==$||e[14]!==t?(h=a=>z(`vm-releases:${t}`,async()=>{const o=$(),g=a(o);if(g!==o){n.setQueriesData({predicate:l=>u(l.queryKey)},l=>l?.item?{item:{...l.item,metadata:{...l.item.metadata,releases:g}}}:l);try{await c.update.mutateAsync({id:t,data:{metadata:{releases:g}}})}catch(l){const A=l;throw n.invalidateQueries({predicate:N=>u(N.queryKey)}),A}}}),e[10]=c,e[11]=u,e[12]=n,e[13]=$,e[14]=t,e[15]=h):h=e[15];const i=h;let R;e[16]!==i?(R=a=>i(o=>T(o,a)),e[16]=i,e[17]=R):R=e[17];const D=R;let C;e[18]!==i?(C=(a,o)=>i(g=>j(g,a,o)),e[18]=i,e[19]=C):C=e[19];const S=C;let x;e[20]!==i?(x=a=>i(o=>V(o,a)),e[20]=i,e[21]=x):x=e[21];const L=x;let y;return e[22]!==D||e[23]!==L||e[24]!==f||e[25]!==S?(y={releases:f,createRelease:D,renameRelease:S,deleteRelease:L},e[22]=D,e[23]=L,e[24]=f,e[25]=S,e[26]=y):y=e[26],y}export{G as a,F as b,K as g,W as n,H as r,J as u};
|
package/dist/client/assets/{use-reports-diagnostic-CbLn3JeW.js → use-reports-diagnostic-Do0xVL-L.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as N,a4 as Q,W as F,R as A,m as f,K as T,gD as L,_ as D,T as K}from"./index-
|
|
1
|
+
import{c as N,a4 as Q,W as F,R as A,m as f,K as T,gD as L,_ as D,T as K}from"./index-Cw6ilRLN.js";import{m as O}from"./use-mcp-client-CvhC1TIJ.js";import{u as h}from"./companions-core-PpXpxfgQ.js";function M(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function U(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function B(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:T.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const S=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(S)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=T.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const S=await s.callTool({name:L,arguments:{}});return h(S).diagnostic??null},n[3]=s,n[4]=i):i=n[4];let d;n[5]!==C||n[6]!==E||n[7]!==i?(d={queryKey:C,enabled:E,retry:1,refetchInterval:v,queryFn:i},n[5]=C,n[6]=E,n[7]=i,n[8]=d):d=n[8];const r=f(d),o=m?.metadata?.siteUrl,P=r.data??null,w=r.isSuccess,_=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==_?(a=U({connectionQueryPending:u.isPending,hasConnection:_,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=_,n[13]=a):a=n[13];const I=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const R=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==R||n[20]!==P||n[21]!==a||n[22]!==I?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:I,host:c,connectionId:t,cdClient:R},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=R,n[20]=P,n[21]=a,n[22]=I,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&M(n.state.data)==="generating"?b:!1}function J(n,e){return{to:D.app,params:{org:n.slug,agentId:K(n.id),connectionId:e,toolName:L},search:{}}}export{M as d,J as r,B as u};
|