decocms 4.563.0 → 4.563.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-2LbzMVC9.js → AlertCircle-CwzXfYoA.js} +1 -1
- package/dist/client/assets/{AreaChart-qBz2MFzD.js → AreaChart-CH10Y7Yz.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BeuQwyHa.js → ArrowLeft-Bx1ut_i3.js} +1 -1
- package/dist/client/assets/{ArrowUp-DmxAfWhF.js → ArrowUp-CSNwEe86.js} +1 -1
- package/dist/client/assets/{CartesianChart-BSwxZ1ZU.js → CartesianChart-d2xsMa2S.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DVdTZlRq.js → CategoricalChart-CBfgG5dQ.js} +1 -1
- package/dist/client/assets/{CheckCircle-BzNTGMCW.js → CheckCircle-DTzUEt5T.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-XdbRnSsi.js → ChevronSelectorVertical-BuxcG5Z7.js} +1 -1
- package/dist/client/assets/{ChevronUp-aYmfXYet.js → ChevronUp-6wdRcgLZ.js} +1 -1
- package/dist/client/assets/{CreditCard01-yFcUZGe-.js → CreditCard01-BVdoi9MI.js} +1 -1
- package/dist/client/assets/{Globe04-RPMmcIuy.js → Globe04-Cfy9OZQt.js} +1 -1
- package/dist/client/assets/{Key01-jvDltRrN.js → Key01-GNhaSTKk.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Jybptj_M.js → LinkBroken01-CXrG3cPJ.js} +1 -1
- package/dist/client/assets/{Minus-BqtyYKKc.js → Minus-DhnWtznI.js} +1 -1
- package/dist/client/assets/{Monitor01-As0zpJLy.js → Monitor01-CIg2Sj9_.js} +1 -1
- package/dist/client/assets/{Play-CdlorRHF.js → Play-BqxIwmQg.js} +1 -1
- package/dist/client/assets/{Plus-CzoopYlU.js → Plus-D4KZ74f8.js} +1 -1
- package/dist/client/assets/{ReferenceLine-CJng4Q0_.js → ReferenceLine-MkuG-jhe.js} +1 -1
- package/dist/client/assets/{SearchMd-By2dNUiw.js → SearchMd-CcwkIY3R.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DhegylE0.js → ShoppingBag01-DxaoBiVQ.js} +1 -1
- package/dist/client/assets/{Sun-Hd0LHTxB.js → Sun-DQsKe0L3.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Czrqzt6f.js → SwitchHorizontal01-DlHWZAvk.js} +1 -1
- package/dist/client/assets/{Tool01-D38zOT0h.js → Tool01-a2PsH3IE.js} +1 -1
- package/dist/client/assets/{Tooltip-Dxjn-_yM.js → Tooltip-CqYyF5v7.js} +1 -1
- package/dist/client/assets/{Trash01-BxSWir9J.js → Trash01-Bnszm0uc.js} +1 -1
- package/dist/client/assets/{Upload01-C8sapTWh.js → Upload01-PtcH0kAe.js} +1 -1
- package/dist/client/assets/{UserSquare-CEg-eLCw.js → UserSquare-DzDVpCW-.js} +1 -1
- package/dist/client/assets/{Users01-CMreTMtq.js → Users01-VX23njqc.js} +1 -1
- package/dist/client/assets/{XClose-DGifUqyQ.js → XClose-DNdKf-oM.js} +1 -1
- package/dist/client/assets/{Zap-BLaVFWQx.js → Zap-R9XzJdCV.js} +1 -1
- package/dist/client/assets/{access-gate-BJSZ7nU5.js → access-gate-CPi0F3pV.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Dpu5ecJP.js → add-connection-dialog-B9PgjkEC.js} +1 -1
- package/dist/client/assets/agent-app-CD41sqOZ.js +1 -0
- package/dist/client/assets/{agent-assets-7nArEuts.js → agent-assets-DX0VobtQ.js} +1 -1
- package/dist/client/assets/{agent-automation-Dq1UMpQM.js → agent-automation-CCBIDSoG.js} +1 -1
- package/dist/client/assets/{agent-automations-DF3vcb3-.js → agent-automations-D9-lFEDH.js} +1 -1
- package/dist/client/assets/{agent-calendar-CsvxRBRw.js → agent-calendar-9CrOvVOX.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CaXbVMop.js → agent-capabilities-4B9K2McF.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-84FLUgzX.js → agent-connect-sources-3wo7IUk_.js} +1 -1
- package/dist/client/assets/agent-deck-BcOrnSqh.js +1 -0
- package/dist/client/assets/{agent-e2e-CfTkWgUa.js → agent-e2e-tcyKIUZc.js} +1 -1
- package/dist/client/assets/agent-experiments-CzacsAmE.js +1 -0
- package/dist/client/assets/{agent-file-C7mhhKFK.js → agent-file-BxqlJgVw.js} +1 -1
- package/dist/client/assets/{agent-hosting-BmtgVBqV.js → agent-hosting-BbJq_QrT.js} +1 -1
- package/dist/client/assets/{agent-icon-U2nlXoBG.js → agent-icon-D8xpO52d.js} +1 -1
- package/dist/client/assets/agent-library-DKnoLp7f.js +1 -0
- package/dist/client/assets/agent-library-file-BCBjNXeO.js +1 -0
- package/dist/client/assets/agent-overview-DuXIkh5Q.js +1 -0
- package/dist/client/assets/{agent-releases-DOPovy0S.js → agent-releases-CwIh9f4n.js} +2 -2
- package/dist/client/assets/agent-settings-BFhXBfUk.js +1 -0
- package/dist/client/assets/{agent-site-editor-Pg_WHlnv.js → agent-site-editor-BfGgD89K.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-BzSDmiCp.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CiUzg1mx.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Db0bcWHw.js +1 -0
- package/dist/client/assets/agent-view-Czv82aSz.js +1 -0
- package/dist/client/assets/{agent-view-guard-BFnkZyhp.js → agent-view-guard-C2HJoZw8.js} +1 -1
- package/dist/client/assets/{ai-providers-tFJSU00y.js → ai-providers-scREGOKN.js} +1 -1
- package/dist/client/assets/{alert-B52lXsYB.js → alert-1rQjthR5.js} +1 -1
- package/dist/client/assets/{analytics-sections-DgZGw207.js → analytics-sections-d7NbdG9Y.js} +1 -1
- package/dist/client/assets/{api-keys-Bc1E8umo.js → api-keys-CqCeYDdo.js} +1 -1
- package/dist/client/assets/api-keys-DSJJvnpT.js +1 -0
- package/dist/client/assets/{app-editor-a13s_yZZ.js → app-editor-DbRwfGV1.js} +1 -1
- package/dist/client/assets/{asset-utils-DxOK6Cj3.js → asset-utils-CUk0W9-V.js} +1 -1
- package/dist/client/assets/{auth-D991fBKg.js → auth-DiGMHweG.js} +1 -1
- package/dist/client/assets/{auth-catchall-CO4eQSBG.js → auth-catchall-BRESN97a.js} +1 -1
- package/dist/client/assets/{auth-entry-IOobChfY.js → auth-entry-C559wnYE.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Dn_4EroD.js → auth-split-layout-Dr--If_h.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CM3iiCDW.js → authenticate-and-persist-oauth-Bqdqhrz6.js} +1 -1
- package/dist/client/assets/{automation-list-row-sEGCpgiC.js → automation-list-row-wI-cPenk.js} +1 -1
- package/dist/client/assets/{automation-runs-DnhCJL7r.js → automation-runs-Bdx8IBJ7.js} +1 -1
- package/dist/client/assets/automations-Dk5d8hog.js +1 -0
- package/dist/client/assets/{autosend-D6GGYoeu.js → autosend-OHKM5N3O.js} +1 -1
- package/dist/client/assets/{badge-C9w1KAGQ.js → badge-c8yx6FPG.js} +1 -1
- package/dist/client/assets/{block-document-ExA3sDvi.js → block-document-CEoE6ykC.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Gbv7_zq8.js → blocks-preview-workspace-context-DSWAfbyA.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-oXZbJa9b.js → blocks-tab-states-Dar_PZ4t.js} +1 -1
- package/dist/client/assets/{blog-schema-4OEvCOpU.js → blog-schema-B9E_iiKV.js} +1 -1
- package/dist/client/assets/{buckets-DsGf5D8D.js → buckets-BOzsvNYq.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BpZBupFA.js → build-improve-prompt-doc-DBhPEpX6.js} +1 -1
- package/dist/client/assets/{calendar-ahGH-Iwe.js → calendar-BlWF2oxs.js} +1 -1
- package/dist/client/assets/{capability-load-error-BG7LprlO.js → capability-load-error-HbPV3BaM.js} +1 -1
- package/dist/client/assets/{category-editor-Ctbp0oQy.js → category-editor-C7X8Ub1u.js} +1 -1
- package/dist/client/assets/chart-BbpOIFKz.js +13 -0
- package/dist/client/assets/{chat-context-CCj5lauv.js → chat-context-DMttssjt.js} +1 -1
- package/dist/client/assets/{chat-draft-BtMWyLm7.js → chat-draft-BruwGPzv.js} +1 -1
- package/dist/client/assets/{checkbox-DB14k3TQ.js → checkbox-Ca6XzxFJ.js} +1 -1
- package/dist/client/assets/{choose-editor-D4zx1UJt.js → choose-editor-D845INdG.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DeaH4VUx.js → cli-auth-success-DlPh-eXo.js} +1 -1
- package/dist/client/assets/{client-icons-C4W9Kqhd.js → client-icons-BeUDxGkz.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-CcuLaEnU.js → cms-settings-editor-BF5-dw_o.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-BumH78UY.js → cms-store-drafts-D04W5QQr.js} +1 -1
- package/dist/client/assets/{collapsible-BPEhSNLz.js → collapsible-D7LdvP53.js} +1 -1
- package/dist/client/assets/{collection-detail-ralZDDkv.js → collection-detail-xBPJ-_UU.js} +1 -1
- package/dist/client/assets/{collection-display-button-CigTGx80.js → collection-display-button-DLEoUtU_.js} +1 -1
- package/dist/client/assets/{collection-search-D_oD-yY0.js → collection-search-Cbzsg59X.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C2dK4p_4.js → collection-table-wrapper-UgBDcU8v.js} +1 -1
- package/dist/client/assets/{collection-tabs-SAUXvS4g.js → collection-tabs-hoKbLtQZ.js} +1 -1
- package/dist/client/assets/{combobox-hVgdYGtQ.js → combobox-BQlPfXfQ.js} +1 -1
- package/dist/client/assets/{command-DiccrIM8.js → command-C1zYQCFE.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BUEyDlWy.js → companion-mcps-section-DuhURxb-.js} +1 -1
- package/dist/client/assets/{config-DgUlbPLE.js → config-CF-4bA6-.js} +1 -1
- package/dist/client/assets/{connect-DhpQ_i5Y.js → connect-CAMY_jwg.js} +3 -3
- package/dist/client/assets/{connect-layout-Dgb_j_Nn.js → connect-layout-AZr9lv1B.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Dga8Dh15.js → connect-source-dialog-ANkM0si_.js} +1 -1
- package/dist/client/assets/{connection-DF20RpK_.js → connection-BJnPzlsf.js} +1 -1
- package/dist/client/assets/{connection-card-DeCnJCAi.js → connection-card-BmLMVqvh.js} +1 -1
- package/dist/client/assets/{connection-detail-Dn5XmXHk.js → connection-detail-BaGld7Nb.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B4MG2Fy2.js → connection-form-helpers-BGRa1Kdc.js} +1 -1
- package/dist/client/assets/{connection-slug-tS8GnOSc.js → connection-slug-DMaQEd-J.js} +1 -1
- package/dist/client/assets/{connections-DREB4U2P.js → connections-CIsX6Cbk.js} +1 -1
- package/dist/client/assets/content-tab-CtfwUpN8.js +25 -0
- package/dist/client/assets/{context-Gpy7m9cw.js → context-CJYU1KXU.js} +1 -1
- package/dist/client/assets/{context-menu-vUs3I8Wh.js → context-menu-CHmnJt-C.js} +1 -1
- package/dist/client/assets/{context-shell-vU2YMH1K.js → context-shell-D3bqGa2E.js} +3 -3
- package/dist/client/assets/{core.esm-CWyzckxm.js → core.esm-D4MXeEs3.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-qsB5dfrW.js → create-organization-dialog-SpS3g8W_.js} +1 -1
- package/dist/client/assets/{device-hint-DMMaEP-p.js → device-hint-CVMGGa4C.js} +1 -1
- package/dist/client/assets/{discover-DN-I6i-O.js → discover-Dw4G36sL.js} +1 -1
- package/dist/client/assets/{domain-settings-FZeIPnhT.js → domain-settings-OVUl_2d3.js} +1 -1
- package/dist/client/assets/{drawer-CMTReHxa.js → drawer-CPGPJZrb.js} +1 -1
- package/dist/client/assets/{editor-C6CE2FNQ.js → editor-KIBaHlpL.js} +1 -1
- package/dist/client/assets/{editor-classes-DbMPYB4Z.js → editor-classes-D7ASsdMe.js} +1 -1
- package/dist/client/assets/{empty-state-ovRL7NEK.js → empty-state-CHtJK8D5.js} +1 -1
- package/dist/client/assets/{empty-state-DF9St1T6.js → empty-state-CnospRwJ.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-BXlwzycK.js → experiments-tab-choice-BVsxc1VU.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Q1k0ncm3.js → extract-connection-data-DF2sDmKO.js} +1 -1
- package/dist/client/assets/{feature-gate-DKF86Lcy.js → feature-gate-DAqSxTVg.js} +1 -1
- package/dist/client/assets/{feature-paywall-BoU9TII8.js → feature-paywall-K9lLaRod.js} +1 -1
- package/dist/client/assets/{feedback-f3MT17uD.js → feedback-C-V5wdWc.js} +1 -1
- package/dist/client/assets/{file-explorer-DmvPCizi.js → file-explorer-C-BYOp1D.js} +1 -1
- package/dist/client/assets/{file-preview-aD0sVwV5.js → file-preview-DldFQIaC.js} +1 -1
- package/dist/client/assets/{file-share-button-agT85qGG.js → file-share-button-CLaPOtBM.js} +1 -1
- package/dist/client/assets/{file-type-icon-CflTIvHJ.js → file-type-icon-dspcojW_.js} +1 -1
- package/dist/client/assets/{folder-icon-BKhbsJwX.js → folder-icon-CdxxpEKg.js} +1 -1
- package/dist/client/assets/{form-B_3ZthF3.js → form-D2bkJ4N7.js} +1 -1
- package/dist/client/assets/{general-BdjsCK2j.js → general-DRQx9Ygx.js} +1 -1
- package/dist/client/assets/{github-icon-M-2WiP3Y.js → github-icon-CjGkhTzQ.js} +1 -1
- package/dist/client/assets/{home-dTYjLEfm.js → home-AzYzcbPX.js} +1 -1
- package/dist/client/assets/{home-overview-BAVfF6qS.js → home-overview-Dlx7OfNy.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-B3o4dv7j.js → hosted-reconcile-B7OGDHH_.js} +1 -1
- package/dist/client/assets/{icon-button-DQuPTgIB.js → icon-button-Cfv3QkJS.js} +1 -1
- package/dist/client/assets/{index-mtR249ru.js → index-B1JNDOpD.js} +1 -1
- package/dist/client/assets/{index-D7Mi9FGh.js → index-BL6hNSG5.js} +1 -1
- package/dist/client/assets/{index-0kopV6YP.js → index-BPyIMHWG.js} +1 -1
- package/dist/client/assets/{index-DzmcFP3y.js → index-BVO2sd2Y.js} +1 -1
- package/dist/client/assets/{index-iezPx7cK.js → index-C66xsC6T.js} +1 -1
- package/dist/client/assets/{index-BZX-7ipZ.js → index-CMZ9oAw6.js} +48 -48
- package/dist/client/assets/{index-cmF_qGuq.js → index-CSY0qemw.js} +1 -1
- package/dist/client/assets/{index-Cjc_aSrk.js → index-CpgDz5vc.js} +1 -1
- package/dist/client/assets/{index-BM0DSfBG.js → index-DP9L0O8L.js} +1 -1
- package/dist/client/assets/{index-2bmOBUEF.js → index-DRaVWe9N.js} +1 -1
- package/dist/client/assets/{index-DT3lYd1R.js → index-DXustS3P.js} +1 -1
- package/dist/client/assets/{index-C81DBcO6.js → index-Dd5pvYT5.js} +1 -1
- package/dist/client/assets/{index-BvJNHE6H.js → index-DuD6ggKT.js} +1 -1
- package/dist/client/assets/{index-BlTJ0I-U.js → index-Mh75VgBs.js} +1 -1
- package/dist/client/assets/{index-C2-s3ia2.js → index-iCueXI_Q.js} +1 -1
- package/dist/client/assets/{index-DHMhIfTt.js → index-n3Zz9hBx.js} +1 -1
- package/dist/client/assets/{index-redirect-ay83YA5a.js → index-redirect-D_KDS07K.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CQGSlzKO.js → infiniteQueryObserver-Bu0pVzQK.js} +1 -1
- package/dist/client/assets/{infra-billing-DUjivW_p.js → infra-billing-V6BClyee.js} +1 -1
- package/dist/client/assets/{input-3OyhKW_c.js → input-C9tDQ6zc.js} +1 -1
- package/dist/client/assets/{input-CcFFY__7.js → input-CdXWKKg_.js} +3 -3
- package/dist/client/assets/{integration-icon-Btk7lWbK.js → integration-icon-B46dPZZ8.js} +1 -1
- package/dist/client/assets/{jira-icon-TeK8CaRV.js → jira-icon-t-haq74f.js} +1 -1
- package/dist/client/assets/{label-BGCn7A0y.js → label-q2layTqr.js} +1 -1
- package/dist/client/assets/{layout-XVKa9Y6f.js → layout-CmnDjQxf.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DksTbOzF.js → legacy-agents-deep-DTCkXADy.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-8kA2UC85.js → legacy-main-redirect-B6q24KFT.js} +1 -1
- package/dist/client/assets/library-DCwkwrev.js +1 -0
- package/dist/client/assets/{library-tab-DJKD7rUC.js → library-tab-DuSMiAny.js} +1 -1
- package/dist/client/assets/{login-CH5yud2M.js → login-BXdCJDLt.js} +1 -1
- package/dist/client/assets/{markdown-B6eeRWQb.js → markdown-CzGv6Im0.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DwuRGgZk.js → mcp-app-renderer-DIpFt6xA.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Bz1Lo9Pk.js → mcp-oauth-DDxSfG4Y.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BvqIKSqR.js → mcp-oauth-DWGAPnXF.js} +1 -1
- package/dist/client/assets/{members-FYjquUkN.js → members-uWNJRKAV.js} +1 -1
- package/dist/client/assets/{memory-CoUl94G3.js → memory-DSyTKuiR.js} +1 -1
- package/dist/client/assets/{mock-board-DvOE8ZQh.js → mock-board-J5O3JFtD.js} +3 -3
- package/dist/client/assets/{monaco-editor-vUgphdkE.js → monaco-editor-Sc2qTW63.js} +1 -1
- package/dist/client/assets/{monitoring-UUQquQf7.js → monitoring-BxeDWPgH.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BY92i-Bt.js → monitoring-stats-row-BFqOMsm6.js} +1 -1
- package/dist/client/assets/{multi-select-9ieJQPsD.js → multi-select-C0I86s_v.js} +1 -1
- package/dist/client/assets/{mustache-CgF6ozKS.js → mustache-CL_YuxAq.js} +3 -3
- package/dist/client/assets/{named-rule-view-CdhLqAy7.js → named-rule-view-BzHnEAog.js} +1 -1
- package/dist/client/assets/{new-project-dialog-EK9WMEhp.js → new-project-dialog-Cyi0FYdw.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cuv6PAYs.js → oauth-callback-Arq4hmXX.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BGc97raN.js → oauth-callback-ai-provider-CWjrMTZf.js} +1 -1
- package/dist/client/assets/{oauth-consent-fGbsmdGY.js → oauth-consent-BKA8xhrS.js} +1 -1
- package/dist/client/assets/{onboarding-DF5AGUdi.js → onboarding-By_QgOu7.js} +1 -1
- package/dist/client/assets/{openai-conversation-CMIme_Ur.js → openai-conversation-C4nE3ayj.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-mQ0HUqGi.js → optimistic-project-sidebar-views-DB1VtPPA.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BPx4Aihv.js → order-monitor-day-B2yNxbC8.js} +1 -1
- package/dist/client/assets/{organization-choice-KNGQur5O.js → organization-choice-BrCDjqZH.js} +1 -1
- package/dist/client/assets/{orgs-C5Zlwg3I.js → orgs-DIw8UPv7.js} +1 -1
- package/dist/client/assets/{own-accounts-section-C_F0-lzr.js → own-accounts-section-DxIQbLdT.js} +1 -1
- package/dist/client/assets/{pair-C5KKQk8r.js → pair-wp79QT6K.js} +1 -1
- package/dist/client/assets/{parse-sections-DE2O_vev.js → parse-sections-D3wB02g1.js} +3 -3
- package/dist/client/assets/{plan-DdvgvWt2.js → plan-BqpTsl69.js} +1 -1
- package/dist/client/assets/{plan-ladder-BQ0gcfdF.js → plan-ladder-5s5WQTbz.js} +1 -1
- package/dist/client/assets/{plan-usage-card-8-3zMqsW.js → plan-usage-card-Bw5XZ4NV.js} +2 -2
- package/dist/client/assets/{popover-CkuSZicN.js → popover-BqTy1uka.js} +1 -1
- package/dist/client/assets/{post-calendar-DVrcXuZq.js → post-calendar-qjv1INL7.js} +1 -1
- package/dist/client/assets/{post-editor-CG6NXsGN.js → post-editor-bkigjU6X.js} +1 -1
- package/dist/client/assets/{preview-content-xRBU7B3O.js → preview-content-B1aMbRRz.js} +1 -1
- package/dist/client/assets/{preview-dialog-D36kXBk6.js → preview-dialog-CK4kOsMi.js} +1 -1
- package/dist/client/assets/{preview-panel-Cp7F1lqp.js → preview-panel-CyGMfUOx.js} +1 -1
- package/dist/client/assets/preview-tab-C3oDuZAy.js +551 -0
- package/dist/client/assets/{product-picker-dialog-C2KLekZA.js → product-picker-dialog-C2IoIcG5.js} +1 -1
- package/dist/client/assets/{profile-BfDfzRPA.js → profile-mrSEJO_l.js} +1 -1
- package/dist/client/assets/project-app-view-BPIYnWGp.js +1 -0
- package/dist/client/assets/{project-apps-D47w7eJj.js → project-apps-CNMkR9si.js} +1 -1
- package/dist/client/assets/{project-icon-ofE-LDok.js → project-icon-_tJkWWYd.js} +1 -1
- package/dist/client/assets/{project-index-PpuyCKHe.js → project-index-CRa6_Q2q.js} +1 -1
- package/dist/client/assets/project-reports-DfqhJFNz.js +1 -0
- package/dist/client/assets/{project-sidebar-views-Dew_3OKS.js → project-sidebar-views-DK4w7stj.js} +1 -1
- package/dist/client/assets/project-tasks-DelZtDNx.js +1 -0
- package/dist/client/assets/{projects-Be7d593_.js → projects-6Lkf5xo_.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DpmH0sch.js → projects-empty-state-deDx1FV2.js} +1 -1
- package/dist/client/assets/{prompts-ClmMS_OK.js → prompts-wrl5zkBc.js} +1 -1
- package/dist/client/assets/record-editor-cuzSrqI6.js +1 -0
- package/dist/client/assets/{redirect-editor-W9B4A_h8.js → redirect-editor-BzZvh3kS.js} +1 -1
- package/dist/client/assets/reports-Bi52d9w2.js +1 -0
- package/dist/client/assets/{reports-DCsJlho1.js → reports-XaamGUeO.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CMTzWUTp.js → reports-onboarding-KzcZnvzI.js} +1 -1
- package/dist/client/assets/{reports-tab-BKnG1JmX.js → reports-tab-D2T8QqZY.js} +2 -2
- package/dist/client/assets/{repositories-KlUH4dUR.js → repositories-BWEao-uc.js} +1 -1
- package/dist/client/assets/repositories-CGogd4dT.js +1 -0
- package/dist/client/assets/{repository-binding-CqOunspI.js → repository-binding-CNthVEQi.js} +1 -1
- package/dist/client/assets/{repository-picker-DNdEQtlZ.js → repository-picker-CBdZ1k-_.js} +1 -1
- package/dist/client/assets/{require-capability-RYn3iksk.js → require-capability-DV3Z9rq4.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dfyc4Zas.js → required-auth-layout-DPCMMa8v.js} +1 -1
- package/dist/client/assets/{reset-password-CTGJ7V-t.js → reset-password-B6GdfBoM.js} +1 -1
- package/dist/client/assets/{resizable-BCGqPRic.js → resizable-Dn5e8SbP.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BnqDq-fY.js → resolve-tab-icon-DB07ohQI.js} +1 -1
- package/dist/client/assets/{review-settings-DvoYyrmi.js → review-settings-Bf-Q4aa1.js} +1 -1
- package/dist/client/assets/{role-color-cUMHSMVi.js → role-color-B3KrsRta.js} +1 -1
- package/dist/client/assets/{roles-x3B4vLKU.js → roles-DSh5YyTe.js} +1 -1
- package/dist/client/assets/route-CEqvUPp8.js +1 -0
- package/dist/client/assets/{route-PbputQp9.js → route-CfniLeBi.js} +1 -1
- package/dist/client/assets/{route-h-Fc_oVe.js → route-DqgVrbDY.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-CXwLCWvJ.js → sandbox-lifecycle-context-D9PXLFbL.js} +1 -1
- package/dist/client/assets/{schema-C1bLOk3P.js → schema-B_f---ws.js} +1 -1
- package/dist/client/assets/{schema-DHLwjAWR.js → schema-DZLTtoPU.js} +1 -1
- package/dist/client/assets/{scroll-area-rELMi4e6.js → scroll-area-duCAe4FD.js} +1 -1
- package/dist/client/assets/{search-input-Crult1Qo.js → search-input-CMW5R3Ug.js} +1 -1
- package/dist/client/assets/{search-toggle-DzMf9QP4.js → search-toggle-CnjiqRA1.js} +1 -1
- package/dist/client/assets/{secret-picker-CimF9dsx.js → secret-picker-BhctH79i.js} +1 -1
- package/dist/client/assets/{secrets-CZCnF6s4.js → secrets-DKvO5Tlm.js} +1 -1
- package/dist/client/assets/{section-array-field-C3Tpx16b.js → section-array-field-BwFg74zY.js} +1 -1
- package/dist/client/assets/{sections-346PcP2T.js → sections-Cf4o35Ox.js} +1 -1
- package/dist/client/assets/{sections-editor-DwV32_3f.js → sections-editor-CGZs3UDO.js} +1 -1
- package/dist/client/assets/{select-CwDmbwEv.js → select-BQQ02Iak.js} +1 -1
- package/dist/client/assets/{select-model-B1ocDBwF.js → select-model-D1Ll4UDt.js} +1 -1
- package/dist/client/assets/{seo-editor-D1gGpMMF.js → seo-editor-CbUxTYCd.js} +1 -1
- package/dist/client/assets/{separator-C05SxAdn.js → separator-BS-y0fmf.js} +1 -1
- package/dist/client/assets/settings-tab-Cc-GHrZO.js +1 -0
- package/dist/client/assets/{sheet-BYgfxL9i.js → sheet-Bcoclksa.js} +1 -1
- package/dist/client/assets/{shell-layout-BvJfyzsq.js → shell-layout-Cu50GNJe.js} +1 -1
- package/dist/client/assets/{site-draft-actions-CgeV78uL.js → site-draft-actions-B00p-YBY.js} +1 -1
- package/dist/client/assets/{site-draft-view-Dkq2XweK.js → site-draft-view-BALYthcd.js} +1 -1
- package/dist/client/assets/site-editor-b9HPg24u.js +1 -0
- package/dist/client/assets/site-editor-toast-8lkV6LJx.js +1 -0
- package/dist/client/assets/{skills-OVV2oEwU.js → skills-DTZd4OJj.js} +1 -1
- package/dist/client/assets/{slider-Ipy9G5jv.js → slider-BdU_kBkM.js} +1 -1
- package/dist/client/assets/{sortable.esm-DgwAq-fn.js → sortable.esm-D8Q8CQca.js} +1 -1
- package/dist/client/assets/{sso-C9cutlah.js → sso-_NkTd5cS.js} +1 -1
- package/dist/client/assets/{suggestion-Dwy6qysF.js → suggestion-CUbzMMC4.js} +1 -1
- package/dist/client/assets/{switch-BLkpF22m.js → switch-2wQ2Vvwm.js} +1 -1
- package/dist/client/assets/{synced-repos-orJHnVxs.js → synced-repos-DXQBaKmQ.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Co1M723I.js → tab-icon-glyph-CrNIzxAC.js} +1 -1
- package/dist/client/assets/{table-DPFxRA7S.js → table-D7O0pX0a.js} +1 -1
- package/dist/client/assets/{tabs--wmPR0cZ.js → tabs-D2wC_v8Y.js} +1 -1
- package/dist/client/assets/{task-board-DJtwkz3O.js → task-board-CX1XgfRa.js} +1 -1
- package/dist/client/assets/{task-route-vCMrJPp9.js → task-route-D6y2-XGv.js} +1 -1
- package/dist/client/assets/{task-status-msgu5x2s.js → task-status--1V-CrQr.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-5nxg7YXN.js → taskboard-analytics-D7oig3Wl.js} +1 -1
- package/dist/client/assets/{tasks-DpWVcTLT.js → tasks-BCu7YcxR.js} +3 -3
- package/dist/client/assets/tasks-PvfYwC67.js +1 -0
- package/dist/client/assets/{textarea-D5OF_Tld.js → textarea-CUmfqgLF.js} +1 -1
- package/dist/client/assets/{thread-analytics-CVsji2MZ.js → thread-analytics-D6sDU4He.js} +1 -1
- package/dist/client/assets/{thread-intent-DIce2mks.js → thread-intent-B1u6qFq5.js} +1 -1
- package/dist/client/assets/{thread-route-CP2TR6nw.js → thread-route-BGjODVvz.js} +1 -1
- package/dist/client/assets/{thread-route-CGqDFJ1K.js → thread-route-CU6rfK0i.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Cba15kJF.js → thread-sheet-body-CkxQ6ZNb.js} +1 -1
- package/dist/client/assets/{time-range-picker-OdWLHy9U.js → time-range-picker-ClaT2qu_.js} +1 -1
- package/dist/client/assets/{toggle-group-DbLOGwe7.js → toggle-group-DRvT_Mhl.js} +1 -1
- package/dist/client/assets/{tool-namespace-BQhkJpu9.js → tool-namespace-Ei4eDsId.js} +1 -1
- package/dist/client/assets/{tool-set-selector-BmAnaEsw.js → tool-set-selector-CZQU8Bnf.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BzIcnxXk.js → toolbar-icon-button-1L7HNhDo.js} +1 -1
- package/dist/client/assets/{tooltip--uPFG1gb.js → tooltip-D-7vfgux.js} +1 -1
- package/dist/client/assets/{tooltipContext-C8ArdkXW.js → tooltipContext-Cnc6hZ4u.js} +1 -1
- package/dist/client/assets/{track-Bb4064-s.js → track-BX_Nd8Wc.js} +1 -1
- package/dist/client/assets/{types-EjHtXl5u.js → types-C2FUcGBC.js} +1 -1
- package/dist/client/assets/{url-slug-rCJqhuIp.js → url-slug-ByoIBczZ.js} +1 -1
- package/dist/client/assets/{usage-stats-DaOtdhEm.js → usage-stats-BjGO-Kc2.js} +1 -1
- package/dist/client/assets/{use-ai-providers-C5rCFpU_.js → use-ai-providers-Dibaa4OS.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-zZmpVvRd.js → use-apply-named-rule-BWZOrqES.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-CWRPw-ps.js +1 -0
- package/dist/client/assets/{use-automations-CI7vvUzE.js → use-automations-BaFqeEuO.js} +1 -1
- package/dist/client/assets/{use-autosave-DUBcsRSH.js → use-autosave-9YC-1bYR.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-CsTP2Tnm.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-CZaSk8YF.js → use-chat-layout-state-BmNEHAsA.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BV2nwL3g.js → use-cms-publish-actions-CUL4qZOs.js} +5 -5
- package/dist/client/assets/{use-connect-companion-DC6UOpxV.js → use-connect-companion-Yh6vXxx5.js} +1 -1
- package/dist/client/assets/{use-connection-BEb786wf.js → use-connection-hvhQN5bP.js} +1 -1
- package/dist/client/assets/{use-content-sync-CtHfpBJp.js → use-content-sync-B8VlirA7.js} +1 -1
- package/dist/client/assets/{use-copy-DccRTYvG.js → use-copy-Cz1rPEPE.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DD1YxYKP.js → use-date-fns-locale-CvxxzjDH.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-clO2CzWE.js → use-debounced-autosave-C2H_KdvR.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CJpdUTvG.js → use-debounced-value-BYdl65Hf.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DtE2LNZs.js → use-deco-credits-CR-KQD-y.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DxBT3zOC.js → use-decopilot-events-CiuVtVhR.js} +1 -1
- package/dist/client/assets/{use-delete-connection-COvFjvtJ.js → use-delete-connection-CKBvC3Zw.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BSEuekHe.js → use-deployment-admin-DmCMt7Xa.js} +1 -1
- package/dist/client/assets/{use-entitlements-CWXMyUT0.js → use-entitlements-mN0-dWGF.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-D1xbdOeh.js +1 -0
- package/dist/client/assets/{use-file-configs-DsyBYIJw.js → use-file-configs-DQ6vrZrc.js} +1 -1
- package/dist/client/assets/{use-id-selection-6CmUdc1s.js → use-id-selection-Cg_nIt-P.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-okLCp4Pp.js → use-inbox-feed-CkKTcdDp.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-4e7tB3Vz.js → use-infinite-scroll-CZYpk3jy.js} +1 -1
- package/dist/client/assets/{use-join-requests-muPMmn0O.js → use-join-requests-DZC49hAE.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-DPwFSXra.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-D_TqnxnH.js → use-mcp-auth-status-DYIRWdxi.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CrdyqnFt.js → use-mcp-client-BSQtdogm.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C3SHzM_d.js → use-mcp-prompts-VlO6AIkq.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DQIJMlw-.js → use-mcp-tools-ACiLuM-U.js} +1 -1
- package/dist/client/assets/{use-mobile-BDWitdax.js → use-mobile-CUeZ8VwW.js} +1 -1
- package/dist/client/assets/use-move-blocks-Bt27AOpp.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-C3sX18jI.js → use-navigate-to-agent-DEfnXK6p.js} +1 -1
- package/dist/client/assets/{use-org-fs-BRERSVus.js → use-org-fs-CSmL-3B4.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BFFdo3jR.js → use-org-repo-syncs-BSOlGgDH.js} +1 -1
- package/dist/client/assets/{use-org-sso-BHDTii7j.js → use-org-sso-BFQ3hk5w.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DPCrcu8e.js → use-organization-settings-BlMRQM3v.js} +1 -1
- package/dist/client/assets/{use-project-scope-k7OaKjIm.js → use-project-scope-C6qihoSs.js} +1 -1
- package/dist/client/assets/{use-recent-apps-Buo9cWvj.js → use-recent-apps-CEGvj2ev.js} +1 -1
- package/dist/client/assets/use-reports-diagnostic-C0_QRLmg.js +1 -0
- package/dist/client/assets/use-sandbox-events-CMKrbt9g.js +2 -0
- package/dist/client/assets/{use-secrets-DlNiP0j4.js → use-secrets-Bj23yWC0.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CL9U3MEc.js → use-section-preview-base-BE8nlbEq.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-ByMTBVZc.js → use-sidebar-collapsed-By-Y5hbX.js} +1 -1
- package/dist/client/assets/{use-tags-CcJayzHf.js → use-tags-D_zG0dwR.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-0-6_3j_2.js → use-task-board-analytics-CQbeoUWv.js} +1 -1
- package/dist/client/assets/{use-task-board-events-CzDIUBok.js → use-task-board-events-BDKwr4kv.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DbHC-4Ry.js → use-task-board-item-prs-D3SUn_ey.js} +1 -1
- package/dist/client/assets/{use-task-board-items-COxHF7_K.js → use-task-board-items-BG4-CZGB.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-CKi9j8wF.js → use-task-board-prompts-Bk3rkyun.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BxcNhivS.js → use-task-metadata-BglqSfvJ.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-lMVF4bT2.js → use-thread-outputs-C3Iahp5Q.js} +1 -1
- package/dist/client/assets/{use-voice-input-DsJxHyTh.js → use-voice-input-CD7MBjXb.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DaNNrArk.js +1 -0
- package/dist/client/assets/{useQueries-BO8pZ9q-.js → useQueries-BHR4dAhO.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DPjy8xlu.js +1 -0
- package/dist/client/assets/{users-DCPPe9Uo.js → users-xjvKbxM5.js} +1 -1
- package/dist/client/assets/{utils-D0xixM8q.js → utils-BXdToff-.js} +1 -1
- package/dist/client/assets/{variant-calendar-C5r0ak32.js → variant-calendar-cJqO22ZG.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-QQd3tA7f.js → variant-matcher-override-CvU3Edz7.js} +1 -1
- package/dist/client/assets/{view-header-BPAnt0vh.js → view-header-BfGUcqLE.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Dzr3mFmO.js → virtual-mcp-CLGHoVY1.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-j0K-nQ0i.js → watch-sse-pool-C13AecKb.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-CHKycGm0.js +0 -1
- package/dist/client/assets/agent-deck-DEx4qeYv.js +0 -1
- package/dist/client/assets/agent-experiments-BMy2QOPP.js +0 -1
- package/dist/client/assets/agent-library-DIxeSWXa.js +0 -1
- package/dist/client/assets/agent-library-file-DQB6i5_0.js +0 -1
- package/dist/client/assets/agent-overview-D8ZTdoEM.js +0 -1
- package/dist/client/assets/agent-settings-x3yUV6x9.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DDscaXHP.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CBj6Azpl.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Doqukvwz.js +0 -1
- package/dist/client/assets/agent-view-CvpQlU18.js +0 -1
- package/dist/client/assets/api-keys-BEFmsf3L.js +0 -1
- package/dist/client/assets/automations-BopJHgke.js +0 -1
- package/dist/client/assets/chart-DnblhNHq.js +0 -13
- package/dist/client/assets/content-tab-kF-GtTU9.js +0 -25
- package/dist/client/assets/library-O1-Gs4qz.js +0 -1
- package/dist/client/assets/preview-tab-Dn0RGnhj.js +0 -551
- package/dist/client/assets/project-app-view-DVhAuH9N.js +0 -1
- package/dist/client/assets/project-reports-BuJS86vH.js +0 -1
- package/dist/client/assets/project-tasks-CZtVWSYo.js +0 -1
- package/dist/client/assets/record-editor-OoLxSu9R.js +0 -1
- package/dist/client/assets/reports-s2E9cwFc.js +0 -1
- package/dist/client/assets/repositories-Dj2kaTIN.js +0 -1
- package/dist/client/assets/route-wINBwrny.js +0 -1
- package/dist/client/assets/settings-tab-BImv5HgS.js +0 -1
- package/dist/client/assets/site-editor-B9ARkCiN.js +0 -1
- package/dist/client/assets/site-editor-toast-D83gMpdg.js +0 -1
- package/dist/client/assets/tasks-hbXv3hSd.js +0 -1
- package/dist/client/assets/use-ask-in-chat-BaG9i0zc.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-CXrKL60y.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-BCmBxVQg.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-BcP_qZl8.js +0 -1
- package/dist/client/assets/use-move-blocks-B48xFUbp.js +0 -1
- package/dist/client/assets/use-reports-diagnostic-B1lbI319.js +0 -1
- package/dist/client/assets/use-sandbox-events-BRJYKM54.js +0 -2
- package/dist/client/assets/useInfiniteQuery-B313haH3.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-07GrICuv.js +0 -1
package/dist/client/assets/{use-infinite-scroll-4e7tB3Vz.js → use-infinite-scroll-CZYpk3jy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-CMZ9oAw6.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,a5 as T,ak as v,av as A,K as I,i as _,q as J,b as Q,e as N,t as p}from"./index-
|
|
1
|
+
import{c as O,a5 as T,ak as v,av as A,K as I,i as _,q as J,b as Q,e as N,t as p}from"./index-CMZ9oAw6.js";function j(){const e=O.c(10),{org:u}=T(),d=v(),{capabilities:c,isPrivileged:f}=A(),s=f||!!c["members:manage"];let i;e[0]!==u.id?(i=I.organizationJoinRequests(u.id),e[0]=u.id,e[1]=i):i=e[1];let t;e[2]!==d?(t=()=>d.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=d,e[3]=t):t=e[3];const o=!!u.id&&s;let n;e[4]!==i||e[5]!==t||e[6]!==o?(n={queryKey:i,queryFn:t,enabled:o},e[4]=i,e[5]=t,e[6]=o,e[7]=n):n=e[7];const{data:a}=_(n);let l;return e[8]!==a?.requests?(l=a?.requests??[],e[8]=a?.requests,e[9]=l):l=e[9],l}function F(){const e=O.c(29),{org:u,locator:d}=T(),c=v(),f=J(),s=Q();let i;e[0]!==d||e[1]!==u||e[2]!==f?(i=()=>{f.invalidateQueries({queryKey:I.organizationJoinRequests(u.id)}),f.invalidateQueries({queryKey:I.members(d)})},e[0]=d,e[1]=u,e[2]=f,e[3]=i):i=e[3];const t=i;let o;e[4]!==c?(o=r=>c.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:r}),e[4]=c,e[5]=o):o=e[5];let n;e[6]!==t||e[7]!==s?(n=()=>{t(),p.success(s("settings.joinRequestsSection.approved"))},e[6]=t,e[7]=s,e[8]=n):n=e[8];let a;e[9]!==s?(a=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.approveFailed")),e[9]=s,e[10]=a):a=e[10];let l;e[11]!==o||e[12]!==n||e[13]!==a?(l={mutationFn:o,onSuccess:n,onError:a},e[11]=o,e[12]=n,e[13]=a,e[14]=l):l=e[14];const y=N(l);let q;e[15]!==c?(q=r=>c.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:r}),e[15]=c,e[16]=q):q=e[16];let R;e[17]!==t||e[18]!==s?(R=()=>{t(),p.success(s("settings.joinRequestsSection.denied"))},e[17]=t,e[18]=s,e[19]=R):R=e[19];let g;e[20]!==s?(g=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.denyFailed")),e[20]=s,e[21]=g):g=e[21];let E;e[22]!==q||e[23]!==R||e[24]!==g?(E={mutationFn:q,onSuccess:R,onError:g},e[22]=q,e[23]=R,e[24]=g,e[25]=E):E=e[25];const S=N(E);let m;return e[26]!==y||e[27]!==S?(m={approve:y,deny:S},e[26]=y,e[27]=S,e[28]=m):m=e[28],m}export{F as a,j as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Ee,b as He,u as Le,a5 as Oe,gZ as $e,g_ as Be,g$ as le,h0 as de,aj as Ke,ah as me,h1 as _e,h2 as Qe,r as X,eM as We,U as pe,h3 as Ze,h4 as qe}from"./index-CMZ9oAw6.js";import{a as ze}from"./use-chat-layout-state-BmNEHAsA.js";import{b as Ge}from"./agent-icon-D8xpO52d.js";import{i as Je}from"./Monitor01-CIg2Sj9_.js";import{u as Xe}from"./use-connection-hvhQN5bP.js";import{a as Ye}from"./use-mcp-client-BSQtdogm.js";import{u as et}from"./use-mcp-tools-ACiLuM-U.js";import{u as tt}from"./repository-binding-CNthVEQi.js";import{g as at}from"./types-C2FUcGBC.js";import{t as ot}from"./utils-CVEq3hMx.js";import{a as D}from"./agent-capabilities-4B9K2McF.js";import"./index-B1JNDOpD.js";import{u as nt}from"./use-sandbox-events-CMKrbt9g.js";import{F as ue}from"./file-type-icon-dspcojW_.js";import{a as st,u as it}from"./autosend-OHKM5N3O.js";import{r as Y}from"./resolve-tab-icon-DB07ohQI.js";import{u as ct}from"./use-task-metadata-BglqSfvJ.js";import{r as rt}from"./preview-source-BsRLGWUP.js";import{i as lt,r as dt,s as mt}from"./shell-layout-Cu50GNJe.js";import{u as pt}from"./use-voice-input-CD7MBjXb.js";import{u as ut}from"./use-organization-settings-BlMRQM3v.js";import{a as ft}from"./use-project-scope-C6qihoSs.js";import{b as bt,u as Tt,c as It,d as vt,e as ht}from"./project-sidebar-views-DK4w7stj.js";import{c as Pt}from"./chat-context-DMttssjt.js";import{r as gt}from"./virtual-mcp-CLGHoVY1.js";function Jt(o){const e=Ee.c(35),d=He(),{openPanel:f,closePanel:R}=st();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const fe=Le(b),ee=it(),te=ze(),i=tt(o.virtualMcpId),T=ct(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:I}=Pt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?$e(i.id):null,v=T?.expanded_tools??[],h=ut(),{scopeId:Te,project:Ie}=ft(),F=bt(Te,Ie,i),U=Tt(F.project),ae=It(F.resolvedScopeId,D(F.project?.metadata),U.presence);let P;e[1]===Symbol.for("react.memo_cache_sentinel")?(P={includeVirtual:!0},e[1]=P):P=e[1];const p=Xe(P),ve=nt(),x=I?.branch??be;let g;e[2]!==I?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==x?(g=rt({threadId:o.taskId,sandboxBranch:x,agentHasRepo:D(i?.metadata),threadHasRepo:D(T)||D(I?.metadata)}),e[2]=I?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=T,e[6]=x,e[7]=g):g=e[7];const he=g,E=ve.lifecycle.phase==="running",{runtime:Pe,resolved:oe}=pt(o.virtualMcpId),H=!!r&&E;let y;e[8]!==H?(y={enabled:H},e[8]=H,e[9]=y):y=e[9];const ne=Ye({connectionId:r,orgId:n.id,orgSlug:n.slug},y),L=ne,O=!!ne&&E;let k;e[10]!==L||e[11]!==O?(k={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=k):k=e[12];const{data:ge}=et(k),se=r&&E?(ge?.tools??[]).filter(Vt).map(t=>({connectionId:r,toolName:t.name,label:ot(t.name),icon:null})):[],$=se[0],ye=$?se:[],u=$&&r?{type:"ext-apps",id:r,toolName:$.toolName}:m?.defaultMainView??null,ke=gt(m),ie={assets:U.assetsPending,siteAccess:U.siteAccessPending},{activeTab:w,mainOpen:l}=Be({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:u||m?{defaultMainView:u,tabs:c.map(wt)}:null}),we=u||m?{defaultMainView:u,tabs:c.map(kt)}:null,V=dt({hasSource:he==="repo"||h,runtime:Pe,cmsMode:ke}),Ve=V.includes("content"),Ce=le(we),Me=u?.type,ce=vt(Me,ae,ie,V,oe),B=ce?le(null):Ce,Se=ht(w,ae,ie),Ne=!V.includes("code")&&oe&&de(w)!==null,a=!ee&&!te&&ce||w==="content"&&!Ve||Ne||Se?B:w,K=Ke(a);let C;e[13]!==d?(C=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=C):C=e[14];const je=C,_=new Map;for(const t of v){const s=me(t.appId,t.toolName);_.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ye){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);_.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const Q=_e(a),W=Q?Q.key.split("/").pop()??Q.key:null,Ae=W?[{id:a,title:W,kind:"file",icon:{kind:"component",Component:t=>X.createElement(ue,{filename:W,...t})}}]:[],M=Qe(a),De=M?[{id:a,title:(M.path.split("/").pop()??M.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>X.createElement(M.path.startsWith("pages/")?Ge:Je,t)}}]:[],Z=We(a),q=Z?Z.path.split("/").pop()??Z.path:null,Re=q?[{id:a,title:q,kind:"file",icon:{kind:"component",Component:t=>X.createElement(ue,{filename:q,...t})}}]:[],Fe=lt(a)?V.map(t=>({id:t==="code"&&de(a)?a:t,title:je(t),kind:"system",icon:Y({tabId:t,kind:"system",connections:p})})):[];let S;e[15]!==p?(S=t=>({id:Ze(t.id),title:t.title,kind:"agent",icon:Y({tabId:t.id,kind:"agent",appId:t.view.appId,connections:p})}),e[15]=p,e[16]=S):S=e[16];const Ue=[...Fe,...Ae,...De,...Re,...c.map(S),...Array.from(_.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Y({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:p})}))],re=new Set,z=Ue.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),xe=o.virtualMcpId;let N;e[17]!==n.id?(N=pe(n.id),e[17]=n.id,e[18]=N):N=e[18];const G=xe===N;let j;e[19]!==a||e[20]!==R||e[21]!==l||e[22]!==G||e[23]!==f||e[24]!==n.id||e[25]!==h?(j=t=>{if(mt({reportsOnly:h,onReportAgent:G,tabId:t})){f(t,{virtualmcpid:pe(n.id),search:yt});return}const s=qe({clickedId:t,activeTab:a,mainOpen:l});"close"in s?R():f(s.tabId)},e[19]=a,e[20]=R,e[21]=l,e[22]=G,e[23]=f,e[24]=n.id,e[25]=h,e[26]=j):j=e[26];const J=j;let A;return e[27]!==a||e[28]!==K||e[29]!==v||e[30]!==c||e[31]!==l||e[32]!==J||e[33]!==z?(A={activeTab:a,mainOpen:l,setActiveTab:J,layoutTabs:c,expandedTools:v,automationTabParsed:K,tabs:z},e[27]=a,e[28]=K,e[29]=v,e[30]=c,e[31]=l,e[32]=J,e[33]=z,e[34]=A):A=e[34],A}function yt(o){return{...o,thread:void 0}}function kt(o){return{id:o.id}}function wt(o){return{id:o.id}}function Vt(o){return!!at(o._meta)}export{Jt as u};
|
package/dist/client/assets/{use-mcp-auth-status-D_TqnxnH.js → use-mcp-auth-status-DYIRWdxi.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,b as k,a6 as N,b3 as S,j as o,a5 as $,K as A,V as L}from"./index-
|
|
1
|
+
import{c as I,b as k,a6 as N,b3 as S,j as o,a5 as $,K as A,V as L}from"./index-CMZ9oAw6.js";import{B as g}from"./badge-c8yx6FPG.js";import{c as v,T,a as b,b as _}from"./tooltip-D-7vfgux.js";import{g as H}from"./types-C2FUcGBC.js";import{s as O}from"./Tool01-a2PsH3IE.js";import{aC as P,aO as U}from"./agent-icon-D8xpO52d.js";import{i as w}from"./mcp-oauth-DDxSfG4Y.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:O,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:P,variant:"outline"}];function Q(y){const e=I.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=H(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=_,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(U,{})})}),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 V(y){const e=I.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.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=()=>w({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,V as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{dd as ce,de as le,df as de,dg as ue,dh as he,di as m,dj as g,dk as fe,dl as pe,dm as me,dn as M,dp as _e,dq as F,dr as we,ds as q,dt as ge,du as D,dv as Te,dw as ye,dx as ke,dy as z,dz as ve,dA as Se,dB as Ce,dC as ee,dD as be,dE as Re,dF as Ie,ci as Ee,dG as qe,dH as Pe,dI as A,dJ as $e,dK as Me,dL as Ae,dM as He,dN as Oe,dO as xe,dP as Ue,dQ as Ne,dR as je,dS as Fe,dT as De,dU as Le,dV as Ve,c9 as V,dW as Qe,dX as U,K as te,T as ze,c as se,V as Je,i as We}from"./index-BZX-7ipZ.js";import{U as P,b as H,c as J}from"./auth-D991fBKg.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{dd as ce,de as le,df as de,dg as ue,dh as he,di as m,dj as g,dk as fe,dl as pe,dm as me,dn as M,dp as _e,dq as F,dr as we,ds as q,dt as ge,du as D,dv as Te,dw as ye,dx as ke,dy as z,dz as ve,dA as Se,dB as Ce,dC as ee,dD as be,dE as Re,dF as Ie,ci as Ee,dG as qe,dH as Pe,dI as A,dJ as $e,dK as Me,dL as Ae,dM as He,dN as Oe,dO as xe,dP as Ue,dQ as Ne,dR as je,dS as Fe,dT as De,dU as Le,dV as Ve,c9 as V,dW as Qe,dX as U,K as te,T as ze,c as se,V as Je,i as We}from"./index-CMZ9oAw6.js";import{U as P,b as H,c as J}from"./auth-DiGMHweG.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,i as c,di as m,dj as f,V as y,K as n}from"./index-
|
|
1
|
+
import{c as l,i as c,di as m,dj as f,V as y,K as n}from"./index-CMZ9oAw6.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,V as p,i as q,K as m}from"./index-
|
|
1
|
+
import{c as f,V as p,i as q,K as m}from"./index-CMZ9oAw6.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-CMZ9oAw6.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as x,b as j,e as v,K as b,bn as B}from"./index-CMZ9oAw6.js";import{u as H}from"./use-voice-input-CD7MBjXb.js";import{o as U,c as A,u as F,U as J,ab as N,Z as R,X as S,Y as W,a4 as z,a5 as L,a6 as Y,a8 as G,aA as X,ah as Z,ag as _,q as C,$ as D}from"./site-editor-toast-8lkV6LJx.js";import{s as $}from"./sandbox-git-api-DcqI6XE4.js";import{u as g}from"./chat-context-DMttssjt.js";import{z as V,H as M}from"./hosted-reconcile-B7OGDHH_.js";import{b as O}from"./sandbox-url-D3mC8qhT.js";import{d as Q}from"./utils-BXdToff-.js";function fe({orgSlug:i,virtualMcpId:t,branch:o}){const s=x(),y=g()?.taskId??null,P=U(t),T=H(t).runtime==="cms",{url:q}=A(t),k=F(t,o),f=k.kind==="protocol"?k:null,d=J({orgSlug:i,virtualMcpId:t,branch:o}),m=b.decofile(d),K=j(),E=async(r,c)=>{if(q)return{ok:!0};if(T){const a=await Z({orgSlug:i,virtualMcpId:t,branch:o},{set:r,delete:c});return _(s,{orgSlug:i,virtualMcpId:t,branch:o},a),await s.invalidateQueries({queryKey:$({orgSlug:i,virtualMcpId:t,branch:o,threadId:y})}),a}const u={orgSlug:i,virtualMcpId:t,branch:o,threadId:y};for(const[a,n]of Object.entries(r)){const e=await fetch(O(u,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:C(P,Q(a)),content:JSON.stringify(n,null,2)})});if(!e.ok)return D(e,"Write")}for(const a of c){const n=await fetch(O(u,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:C(P,Q(a))})});if(!n.ok)return D(n,"Delete")}return{ok:!0}},p=v({mutationKey:W(i,t,o),scope:S(i,t,o),mutationFn:async({writes:r,deletes:c,copies:u,shown:a})=>{const n=f?.source==="github"?r:B(r);return f?.source==="github"?V({queryClient:s,backend:f,params:{orgSlug:i,virtualMcpId:t,branch:o},cacheKey:d},{writes:n,deletes:c.filter(e=>!(e in n))},u,a?.()):f?N(s,f,{orgSlug:i,virtualMcpId:t,branch:o},d,{set:n,delete:c.filter(e=>!(e in n))}):R({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:b.liveMeta(i,t,o)})}});return{move:async(r,c)=>{const u=[...Object.keys(r.writes),...r.deletes],a=s.getQueryData(m),n=new Map;for(const e of u)a&&e in a&&n.set(e,a[e]);s.setQueryData(m,e=>I(e,r)),s.cancelQueries({queryKey:m});try{return await p.mutateAsync({...r,copies:a,shown:c?.shown})}catch(e){throw e instanceof M?(z(K,e.deleted,e.deleted&&r.deletes.length>0&&r.deletes.every(l=>L(s,d,l))),e):(Y(K,e),f?.source==="github"&&(G(e)||e instanceof X)||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-C3sX18jI.js → use-navigate-to-agent-DEfnXK6p.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,ar as U,at as $,i as T,al as E,K as S,a5 as N,d as F,a as I,db as K,dc as q}from"./index-
|
|
1
|
+
import{c as m,ar as U,at as $,i as T,al as E,K as S,a5 as N,d as F,a as I,db as K,dc as q}from"./index-CMZ9oAw6.js";import{h as y,r as _,g as v,e as G,d as D}from"./repository-binding-CNthVEQi.js";import{p as H,u as Q,w as M}from"./thread-intent-B1u6qFq5.js";const b=[],Y=4;function z(t,e){return[e,...t.filter(n=>n!==e)].slice(0,Y)}function J(t){const e=m.c(9);let n;e[0]!==t?(n=$.recentProjects(t),e[0]=t,e[1]=n):n=e[1];const[s,r]=U(n,b),o=Array.isArray(s)?s:b;let a,l;e[2]!==r?(a=u=>r(c=>z(Array.isArray(c)?c:b,u)),l=u=>r(c=>(Array.isArray(c)?c:b).filter(h=>h!==u)),e[2]=r,e[3]=a,e[4]=l):(a=e[3],l=e[4]);let i;return e[5]!==o||e[6]!==a||e[7]!==l?(i={recent:o,remember:a,forget:l},e[5]=o,e[6]=a,e[7]=l,e[8]=i):i=e[8],i}function O(t,e){if(!e)return!0;if(t.partial)return!1;const n=H(t.metadata?.runtime);return n===null||n===e}function C(t,e,n,s,r){let o=null;for(const a of t)a.virtual_mcp_id===e&&a.created_by===n&&(a.hidden||O(a,s)&&(r&&a.branch===r||(!o||a.updated_at>o.updated_at)&&(o=a)));return o}function de(t,e,n,s){return t.find(r=>!r.hidden&&r.virtual_mcp_id===e&&r.created_by===n&&r.title==="New chat"&&!r.harness_id&&O(r,s))}function V(t,e,n,s,r,o){if(!r)return C(t,e,n,s)??void 0;const a=s==="cms"?new Set((o?.releases??[]).filter(i=>i.runtime==="sandbox").map(i=>i.branch)):null,l=a?.size?t.filter(i=>!i.branch||!a.has(i.branch)):t;return C(l,e,n,s,o?.baseBranch)??void 0}const W=6e4,w=3e4;function R(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 x(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:s,repo:r,branch:o}=t;return{queryKey:S.githubPrState(e,_(n),s,r,o),queryFn:()=>E(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&y(n)&&!!s&&!!r,refetchInterval:W,refetchIntervalInBackground:!1,staleTime:w}}function X(t){const e=m.c(4);let n;e[0]!==t?(n=k(t),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s={...n,select:Z},e[2]=n,e[3]=s):s=e[3],T(s)}function Z(t){return t.changeRequest?R(t.changeRequest):null}function fe(t){const e=m.c(4);let n;e[0]!==t?(n=k(t),e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s={...n,select:ee},e[2]=n,e[3]=s):s=e[3],T(s)}function ee(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(x):[]}const te=5*6e4;function he(t){const e=m.c(20),{orgSlug:n,target:s,owner:r,repo:o,base:a}=t;let l;e[0]!==a||e[1]!==n||e[2]!==r||e[3]!==o||e[4]!==s?(l=S.githubLastPublishedPr(n,_(s),r,o,a),e[0]=a,e[1]=n,e[2]=r,e[3]=o,e[4]=s,e[5]=l):l=e[5];let i;e[6]!==a||e[7]!==n||e[8]!==s?(i=()=>E(n,"CHANGE_REQUEST_LAST_MERGED",{...s,base:a}),e[6]=a,e[7]=n,e[8]=s,e[9]=i):i=e[9];let u;e[10]!==t.enabled||e[11]!==a||e[12]!==r||e[13]!==o||e[14]!==s?(u=(t.enabled??!0)&&!!a&&y(s)&&!!r&&!!o,e[10]=t.enabled,e[11]=a,e[12]=r,e[13]=o,e[14]=s,e[15]=u):u=e[15];let c;return e[16]!==l||e[17]!==i||e[18]!==u?(c={queryKey:l,queryFn:i,enabled:u,staleTime:te,select:ne},e[16]=l,e[17]=i,e[18]=u,e[19]=c):c=e[19],T(c)}function ne(t){return t.changeRequest?R(t.changeRequest):null}const se=50;function ge(t){const e=m.c(17),{orgSlug:n,target:s,owner:r,repo:o}=t;let a;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==s?(a=S.githubOpenPrs(n,_(s),r,o),e[0]=n,e[1]=r,e[2]=o,e[3]=s,e[4]=a):a=e[4];let l;e[5]!==n||e[6]!==s?(l=()=>E(n,"CHANGE_REQUEST_LIST_OPEN",{...s,limit:se}),e[5]=n,e[6]=s,e[7]=l):l=e[7];let i;e[8]!==t.enabled||e[9]!==r||e[10]!==o||e[11]!==s?(i=(t.enabled??!0)&&y(s)&&!!r&&!!o,e[8]=t.enabled,e[9]=r,e[10]=o,e[11]=s,e[12]=i):i=e[12];let u;return e[13]!==a||e[14]!==l||e[15]!==i?(u={queryKey:a,queryFn:l,enabled:i,staleTime:w,select:ae},e[13]=a,e[14]=l,e[15]=i,e[16]=u):u=e[16],T(u)}function ae(t){return t.changeRequests.map(R)}function re(t,e){const{org:n}=N(),s=v(t);return X({orgId:n.id,orgSlug:n.slug,target:G(s),owner:s?.owner??"",repo:s?.name??"",branch:e??null}).data?.base??"main"}const oe=[];function me(){const t=m.c(13),e=F(),{org:n,locator:s}=N(),r=D(),{data:o}=I.useSession(),a=Q(),l=re(void 0,null),{remember:i}=J(n.slug);let u;t[0]!==l||t[1]!==r||t[2]!==s||t[3]!==a?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==o?.user?.id?(u=(d,g,f)=>{if(K(g).kind==="org-destination"){q(e,{tabId:g,org:n.slug,agentId:d,replace:!1});return}const A=(r??[]).find(j=>j.id===d),B=!!(A&&v(A)),P=!f,L=P?void 0:V(a?.threads.get()??oe,d,o?.user?.id,f,B,{baseBranch:l}),p=P?void 0:L?.id??crypto.randomUUID();p&&!L&&f&&M(sessionStorage,s,p,{runtime:f}),q(e,{tabId:g,org:n.slug,agentId:d,search:()=>p?{thread:p}:{},replace:!1})},t[0]=l,t[1]=r,t[2]=s,t[3]=a?.threads,t[4]=e,t[5]=n.slug,t[6]=o?.user?.id,t[7]=u):u=t[7];const c=u;let h;return t[8]!==c||t[9]!==e||t[10]!==n.slug||t[11]!==i?(h=(d,g)=>{const f=g?.panel;if(!f){i(d),e(ie(n.slug,d));return}c(d,f,g?.runtime)},t[8]=c,t[9]=e,t[10]=n.slug,t[11]=i,t[12]=h):h=t[12],h}function ie(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})}}export{J as a,re as b,V as c,ge as d,X as e,de as f,he as g,fe as h,k as p,me as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as F,a5 as w,K as y,i as $,q as k,e as P}from"./index-BZX-7ipZ.js";import{u as x}from"./useInfiniteQuery-B313haH3.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function p(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}async function E(n,e,t){return(await(await h(p(n,e,"list",{path:t}))).json()).entries.toSorted((r,a)=>r.kind!==a.kind?r.kind==="dir"?-1:1:r.path.localeCompare(a.path))}function Z(n,e,t){const s=F.c(16),{org:i}=w(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==i.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?f:void 0,s[4]=i.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=()=>E(i.slug,n,e),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==r||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:r,queryKey:a,placeholderData:o,queryFn:c},s[11]=r,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}async function _(n,e,t){const s=await h(p(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=F.c(16),{org:i}=w();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=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]!==i.slug||s[7]!==e||s[8]!==n?(l=()=>_(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==r||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:r,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=r,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=F.c(9),s=n===void 0?60:n,{org:i}=w();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==i.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=o):o=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==o?(c={queryKey:r,enabled:a,queryFn:o},t[5]=r,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=F.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 i;e[3]!==t.slug||e[4]!==n?(i=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]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,initialPageParam:null,queryFn:i,getNextPageParam:C},e[6]=s,e[7]=i,e[8]=r):r=e[8],x(r)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=F.c(16),{org:s}=w();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=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]=i):i=t[4];const r=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]!==i||t[12]!==r||t[13]!==a||t[14]!==o?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:o},t[11]=i,t[12]=r,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=F.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 i=n?.enabled;let r;e[2]!==t.slug?(r=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]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,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 ie(){const n=F.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 i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function M(n,e,t){return(await h(p(n,e,"read",{path:t}))).text()}function re(n,e){const t=F.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,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}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(p(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&&r.length<D?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(i(u));return}f+=d.length,l.push({relPath:i(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=F.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 i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function le(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>p(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=F.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,i)=>p(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(p(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,i,r="text/markdown; charset=utf-8"){const a={"content-type":r};i&&"absent"in i?a["if-none-match"]="*":i&&(a["if-match"]=`"${i.contentHash}"`);const o=await fetch(p(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=F.c(18),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==n?(i=async l=>(await(await h(p(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]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=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]=r):r=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]!==i||e[14]!==r||e[15]!==a||e[16]!==o?(c={mutationFn:i,onMutate:r,onError:a,onSettled:o},e[13]=i,e[14]=r,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=F.c(33),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async S=>{const T=(await Promise.allSettled(S.files.map(L=>{const q=S.dir?`${S.dir}/${L.name}`:L.name;return h(p(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(Y);if(T)throw T.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==r||e[8]!==a?(o={mutationFn:a,onSettled:r},e[7]=r,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(p(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==r||e[14]!==l?(f={mutationFn:l,onSuccess:r},e[13]=r,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(p(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,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(p(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]!==r||e[26]!==m?(I={mutationFn:m,onSuccess:r},e[25]=r,e[26]=m,e[27]=I):I=e[27];const O=P(I);let K;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,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,re as h,E as i,ie as j,ge as k,ce as l,X as m,_ as n,M as o,ee as p,ne as q,oe as r,se as s,te as t,Z as u,fe as w};
|
|
1
|
+
import{c as F,a5 as w,K as y,i as $,q as k,e as P}from"./index-CMZ9oAw6.js";import{u as x}from"./useInfiniteQuery-DaNNrArk.js";function G(n){return n.contentHash??`${n.size}-${n.updatedAt}`}function p(n,e,t,s){const i=new URLSearchParams(s).toString();return`/api/${encodeURIComponent(n)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(n,e,t){const s=await fetch(n,e);if(s.ok||t?.allow404&&s.status===404)return s;let i="";try{i=(await s.json()).error??""}catch{}throw new Error(i||`HTTP ${s.status}`)}async function E(n,e,t){return(await(await h(p(n,e,"list",{path:t}))).json()).entries.toSorted((r,a)=>r.kind!==a.kind?r.kind==="dir"?-1:1:r.path.localeCompare(a.path))}function Z(n,e,t){const s=F.c(16),{org:i}=w(),r=t?.enabled??!0;let a;s[0]!==i.id||s[1]!==e||s[2]!==n?(a=y.orgFsList(i.id,n,e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=a):a=s[3];let o;s[4]!==i.id||s[5]!==n?(o=(f,u)=>u?.queryKey[1]===i.id&&u.queryKey[2]===n?f:void 0,s[4]=i.id,s[5]=n,s[6]=o):o=s[6];let c;s[7]!==i.slug||s[8]!==e||s[9]!==n?(c=()=>E(i.slug,n,e),s[7]=i.slug,s[8]=e,s[9]=n,s[10]=c):c=s[10];let l;return s[11]!==r||s[12]!==a||s[13]!==o||s[14]!==c?(l={enabled:r,queryKey:a,placeholderData:o,queryFn:c},s[11]=r,s[12]=a,s[13]=o,s[14]=c,s[15]=l):l=s[15],$(l)}async function _(n,e,t){const s=await h(p(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=F.c(16),{org:i}=w();let r;s[0]!==i.id||s[1]!==e||s[2]!==n?(r=y.orgFsStat(i.id,n??"",e),s[0]=i.id,s[1]=e,s[2]=n,s[3]=r):r=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]!==i.slug||s[7]!==e||s[8]!==n?(l=()=>_(i.slug,n??"",e),s[6]=i.slug,s[7]=e,s[8]=n,s[9]=l):l=s[9];let f;return s[10]!==r||s[11]!==a||s[12]!==o||s[13]!==c||s[14]!==l?(f={queryKey:r,enabled:a,staleTime:o,refetchInterval:c,queryFn:l},s[10]=r,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=F.c(9),s=n===void 0?60:n,{org:i}=w();let r;t[0]!==i.id?(r=y.orgFsRecent(i.id),t[0]=i.id,t[1]=r):r=t[1];const a=e?.enabled;let o;t[2]!==s||t[3]!==i.slug?(o=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${s}`)).json()).entries,t[2]=s,t[3]=i.slug,t[4]=o):o=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==o?(c={queryKey:r,enabled:a,queryFn:o},t[5]=r,t[6]=a,t[7]=o,t[8]=c):c=t[8],$(c)}const R=200;function te(n){const e=F.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 i;e[3]!==t.slug||e[4]!==n?(i=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]=i):i=e[5];let r;return e[6]!==s||e[7]!==i?(r={queryKey:s,initialPageParam:null,queryFn:i,getNextPageParam:C},e[6]=s,e[7]=i,e[8]=r):r=e[8],x(r)}function C(n){return n.next??void 0}const U=50;function se(n,e){const t=F.c(16),{org:s}=w();let i;t[0]!==s.id||t[1]!==n||t[2]!==e?.prefix||t[3]!==e?.volume?(i=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]=i):i=t[4];const r=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]!==i||t[12]!==r||t[13]!==a||t[14]!==o?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:o},t[11]=i,t[12]=r,t[13]=a,t[14]=o,t[15]=c):c=t[15],$(c)}function ne(n){const e=F.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 i=n?.enabled;let r;e[2]!==t.slug?(r=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]=r):r=e[3];let a;return e[4]!==s||e[5]!==i||e[6]!==r?(a={queryKey:s,enabled:i,queryFn:r},e[4]=s,e[5]=i,e[6]=r,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 ie(){const n=F.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 i;return n[4]!==t||n[5]!==s?(i={queryKey:t,queryFn:s,staleTime:6e4},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}async function M(n,e,t){return(await h(p(n,e,"read",{path:t}))).text()}function re(n,e){const t=F.c(8);let s;t[0]!==n?(s=y.fileText(n),t[0]=n,t[1]=s):s=t[1];const i=e?.enabled!==!1&&n!=="";let r;t[2]!==n?(r=async()=>{const o=await fetch(n,{credentials:"include"});return o.ok?await o.text():null},t[2]=n,t[3]=r):r=t[3];let a;return t[4]!==s||t[5]!==i||t[6]!==r?(a={queryKey:s,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=s,t[5]=i,t[6]=r,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}/`:"",i=u=>u.startsWith(s)?u.slice(s.length):u,r=[],a=[],o=[{path:t,depth:0}];for(;o.length>0;){const u=o.shift();if(!u)break;let g;try{g=(await(await h(p(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&&r.length<D?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>M(n,e,u).catch(()=>null))),l=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>H){a.push(i(u));return}f+=d.length,l.push({relPath:i(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=F.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 i;return n[4]!==t||n[5]!==s?(i={queryKey:t,staleTime:3e5,queryFn:s},n[4]=t,n[5]=s,n[6]=i):i=n[6],$(i)}function le(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t.slug||e[1]!==n?(s=i=>p(t.slug,n,"read",{path:i}),e[0]=t.slug,e[1]=n,e[2]=s):s=e[2],s}function ce(){const n=F.c(2),{org:e}=w();let t;return n[0]!==e.slug?(t=(s,i)=>p(e.slug,s,"read",{path:i}),n[0]=e.slug,n[1]=t):t=n[1],t}function ue(n){const e=F.c(3),{org:t}=w();let s;return e[0]!==t||e[1]!==n?(s={mutationFn:async i=>(await(await h(p(t.slug,n,"file",{path:i.path}),{method:"PUT",headers:{"content-type":i.contentType??"text/html; charset=utf-8"},body:i.body})).json()).entry},e[0]=t,e[1]=n,e[2]=s):s=e[2],P(s)}async function fe(n,e,t,s,i,r="text/markdown; charset=utf-8"){const a={"content-type":r};i&&"absent"in i?a["if-none-match"]="*":i&&(a["if-match"]=`"${i.contentHash}"`);const o=await fetch(p(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=F.c(18),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==n?(i=async l=>(await(await h(p(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]=i):i=e[2];let r;e[3]!==t||e[4]!==s||e[5]!==n?(r=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]=r):r=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]!==i||e[14]!==r||e[15]!==a||e[16]!==o?(c={mutationFn:i,onMutate:r,onError:a,onSettled:o},e[13]=i,e[14]=r,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=F.c(33),{org:t}=w(),s=k();let i;e[0]!==t||e[1]!==s||e[2]!==n?(i=()=>X(s,t.id,n),e[0]=t,e[1]=s,e[2]=n,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==n?(a=async S=>{const T=(await Promise.allSettled(S.files.map(L=>{const q=S.dir?`${S.dir}/${L.name}`:L.name;return h(p(t.slug,n,"file",{path:q}),{method:"PUT",headers:{"content-type":L.type||"application/octet-stream"},body:L})}))).find(Y);if(T)throw T.reason},e[4]=t,e[5]=n,e[6]=a):a=e[6];let o;e[7]!==r||e[8]!==a?(o={mutationFn:a,onSettled:r},e[7]=r,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(p(t.slug,n,"dir",{path:S}),{method:"POST"})},e[10]=t,e[11]=n,e[12]=l):l=e[12];let f;e[13]!==r||e[14]!==l?(f={mutationFn:l,onSuccess:r},e[13]=r,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(p(t.slug,n,"file",{path:S}),{method:"DELETE"})},e[16]=t,e[17]=n,e[18]=g):g=e[18];let d;e[19]!==r||e[20]!==g?(d={mutationFn:g,onSuccess:r},e[19]=r,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(p(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]!==r||e[26]!==m?(I={mutationFn:m,onSuccess:r},e[25]=r,e[26]=m,e[27]=I):I=e[27];const O=P(I);let K;return e[28]!==u||e[29]!==O||e[30]!==b||e[31]!==c?(K={upload:c,mkdir:u,remove:b,move:O},e[28]=u,e[29]=O,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,re as h,E as i,ie as j,ge as k,ce as l,X as m,_ as n,M as o,ee as p,ne as q,oe as r,se as s,te as t,Z as u,fe as w};
|
package/dist/client/assets/{use-org-repo-syncs-BFFdo3jR.js → use-org-repo-syncs-BSOlGgDH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,a5 as f,ak as y,K as S,i as _,q as d,e as R}from"./index-
|
|
1
|
+
import{c as r,a5 as f,ak as y,K as S,i as _,q as d,e as R}from"./index-CMZ9oAw6.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 i;e[0]!==n.id?(i=S.orgRepoSyncs(n.id),e[0]=n.id,e[1]=i):i=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]!==i||e[5]!==s?(o={queryKey:i,staleTime:6e4,refetchInterval:E,queryFn:s},e[4]=i,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(),i=d();let s;e[0]!==n||e[1]!==i?(s=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[0]=n,e[1]=i,e[2]=s):s=e[2];const o=s;let c;e[3]!==t?(c=async u=>(await t.call("ORG_REPO_SYNC_CREATE",u)).config,e[3]=t,e[4]=c):c=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]!==c||e[10]!==a?(l={mutationFn:c,onSuccess:a,onSettled:o},e[8]=o,e[9]=c,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(),i=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]!==i?(o=()=>i.invalidateQueries({queryKey:S.orgRepoSyncs(n.id)}),e[2]=n,e[3]=i,e[4]=o):o=e[4];let c;return e[5]!==s||e[6]!==o?(c={mutationFn:s,onSettled:o},e[5]=s,e[6]=o,e[7]=c):c=e[7],R(c)}export{P as a,q as b,T as c,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,i as S,q as r,e as y,K as c}from"./index-
|
|
1
|
+
import{c as u,i as S,q as r,e as y,K as c}from"./index-CMZ9oAw6.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 C(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 O(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 m(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{C as a,O as b,m as c,h as d,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,a as w,bU as y,a5 as E,i as F,al as M,K as b,ak as T,q as A,e as O}from"./index-
|
|
1
|
+
import{c as u,a as w,bU as y,a5 as E,i as F,al as M,K as b,ak as T,q as A,e as O}from"./index-CMZ9oAw6.js";import{D as C,o as G,a as $}from"./schema-B_f---ws.js";import{r as z}from"./task-board-CX1XgfRa.js";const I={organizationId:"",sidebar_items:null,coding_agent_mcp_excluded:null,simple_mode:null,default_home_agents:null,flags:null,submodule_credentials:null},x={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function P(t,e){return{queryKey:b.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function c(t){const e=u.c(7),{org:n}=E();let s;e[0]!==n.id||e[1]!==n.slug?(s=P(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],F(i)}function _(){const t=u.c(9),{org:e}=E(),n=T(),s=A();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(b.organizationSettings(e.id),r=>({...r??I,...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],O(i)}function R(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}}:x}function Y(){const{data:t}=c(D);return t??x}function D(t){return R(t.simple_mode)}function j(){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 B(){return d("reports_only")}function d(t){const e=u.c(5);let n;e[0]!==t?(n=a=>G(a.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=c(n);let o;return e[2]!==s||e[3]!==t?(o=s??C.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function V(t){const e=u.c(6);let n;e[0]!==t?(n=i=>G(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s,isError:o}=c(n);let a;return e[2]!==s||e[3]!==t||e[4]!==o?(a=s??(o?C.has(t):void 0),e[2]=s,e[3]=t,e[4]=o,e[5]=a):a=e[5],a}function W(){const t=d("chat_harness_sandbox_only");return y().runtime.agentSandbox&&t}function H(){const t=u.c(8),{org:e}=E(),n=T(),s=A();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(b.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],O(i)}function k(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function J(){const t=u.c(8),{data:e}=w.useSession(),n=y();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||k(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=d("hosting_enabled"),r=d("e2e_enabled"),m=d("monitor_enabled"),N=d("experiments_enabled"),g=o||a||l,S=o||a||r,p=o||i||m,h=o||a||N;let f;return t[3]!==g||t[4]!==S||t[5]!==p||t[6]!==h?(f={hosting:g,e2e:S,monitor:p,experiments:h},t[3]=g,t[4]=S,t[5]=p,t[6]=h,t[7]=f):f=t[7],f}function X(){const{data:t}=c(L);return t??!1}function L(t){return $(t.flags)}function tt(){const{data:t}=c(U);return t??!0}function U(t){return z(t.flags)}function et(){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 nt(){const t=u.c(2),{data:e}=c(q);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function q(t){return t.coding_agent_mcp_excluded}function st(){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 ot(){const t=u.c(2),{data:e}=c(Q);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Q(t){return t.submodule_credentials}function at(){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{d as a,W as b,V as c,Y as d,J as e,tt as f,H as g,X as h,et as i,nt as j,st as k,j as l,ot as m,at as n,B as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,f as P,u as T,d as N,ea as R,eb as E,dc as k,af as l}from"./index-
|
|
1
|
+
import{c as I,f as P,u as T,d as N,ea as R,eb as E,dc as k,af as l}from"./index-CMZ9oAw6.js";import{d as C,b as O,p as w}from"./repository-binding-CNthVEQi.js";const x=1;function _(e){return(e??[]).filter(E)}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=_(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 S=O(p),u=y??_(S?[S]:[])[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 b=n.org??"",h=V;if(i){k(o,{org:b,agentId:i,tabId:t==="board"||t==="reports"?t:"overview",search:h,replace:!1});return}if(t==="board"){o({to:l.tasks,params:{org:b,taskKey:void 0},search:h});return}const j=t==="files"?l.library:t==="monitoring"?l.monitoring:t==="plan"?l.plan:l.home;o({to:j,params:{org:b},search:h})},e[4]=t,e[5]=o,e[6]=n,e[7]=s,e[8]=m):m=e[8];const f=m,v=w(u),g=c.length>=x;let d;return e[9]!==u||e[10]!==c||e[11]!==s||e[12]!==f||e[13]!==v||e[14]!==g?(d={scopeId:s,project:u,repo:v,projects:c,hasProjects:g,setScope:f},e[9]=u,e[10]=c,e[11]=s,e[12]=f,e[13]=v,e[14]=g,e[15]=d):d=e[15],d}function V(e){return{...e,virtualmcpid:void 0,thread:void 0,mainpanel:void 0,path:void 0,preview:void 0,expanded:void 0}}export{D as a,_ as s,M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as m,c as f,l as I,ar as A,at as j,ah as y}from"./index-
|
|
1
|
+
import{r as m,c as f,l as I,ar as A,at as j,ah as y}from"./index-CMZ9oAw6.js";import{P as N}from"./project-apps-CNMkR9si.js";import{b}from"./repository-binding-CNthVEQi.js";function g(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 h(n,t){return n.filter(e=>!d(e,t))}function w(n,t,e){const c=n.findLast(l=>l.staticData.mainView);if(!c)return null;const{mainView:i,siteEditorView:s,local:r}=c.staticData;if(!i)return null;const o=c.params,a=o?.agentId;if(a&&i==="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":i;return t(p)?a?{app:p,projectId:a}:r?{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,i]=A(e,u),s=Array.isArray(c)?c:u;let r,o;t[2]!==i?(r=p=>i(l=>R(Array.isArray(l)?l:[],p)),o=p=>i(l=>h(Array.isArray(l)?l:[],p)),t[2]=i,t[3]=r,t[4]=o):(r=t[3],o=t[4]);let a;return t[5]!==s||t[6]!==r||t[7]!==o?(a={recent:s,remember:r,forget:o},t[5]=s,t[6]=r,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 w(n.matches,T,y)}function T(n){return n in N}function k(n){const{remember:t}=V(n),e=O(),c=b(e?.projectId),i=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,r=e?.connection&&{id:e.connection.id,toolName:e.connection.toolName,label:s?.label||e.connection.toolName,icon:s?.icon};m.useEffect(()=>{!e?.projectId||!i||t({app:e.app,projectId:e.projectId,projectTitle:i,...r&&{connection:r}})},[n,e?.app,e?.projectId,i,r?.label,r?.icon])}export{O as a,V as b,g as k,E as p,k as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as N,a5 as Q,W as F,T as U,i as f,K as R,gU as L,$ as A,U as K}from"./index-CMZ9oAw6.js";import{m as O}from"./use-mcp-client-BSQtdogm.js";import{u as h}from"./companions-core-DhUD88pR.js";function D(n){return n?n.scanned_at?"ready":n.run_in_progress?"generating":"none":"none"}function M(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 j(){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:U,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:R.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const _=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(_)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=R.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const _=await s.callTool({name:L,arguments:{}});return h(_).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,I=!!m;let a;n[9]!==y||n[10]!==u.isPending||n[11]!==r.isPending||n[12]!==I?(a=M({connectionQueryPending:u.isPending,hasConnection:I,cdClientFailed:y,diagnosticQueryPending:r.isPending}),n[9]=y,n[10]=u.isPending,n[11]=r.isPending,n[12]=I,n[13]=a):a=n[13];const S=typeof o=="string"&&o?o:null;let c;n[14]!==o?(c=q(o),n[14]=o,n[15]=c):c=n[15];const T=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==T||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:T},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=T,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&D(n.state.data)==="generating"?b:!1}function B(n,e){return{to:A.app,params:{org:n.slug,agentId:K(n.id),connectionId:e,toolName:L},search:{}}}export{D as d,B as r,j as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as fe,j as Y,r as a,a5 as he,q as Ee,K as C,d9 as G,a3 as pe}from"./index-CMZ9oAw6.js";import{i as ve,u as Se}from"./chat-context-DMttssjt.js";import{b as ge}from"./sandbox-url-D3mC8qhT.js";import{u as ye}from"./repository-binding-CNthVEQi.js";function J(t){return t==="installing"||t==="install-failed"||t==="starting"||t==="start-failed"||t==="running"||t==="crashed"}const me={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},I=a.createContext(me),W=16384;class be{data="";append(e){this.data+=e,this.data.length>W&&(this.data=this.data.slice(this.data.length-W))}get(){return this.data}clear(){this.data=""}}const De=1e3,Re=3e4,Te=3e3,z=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],X="log";function ke(t){if(!t)return null;try{return new URL("/_sandbox/events",t).href}catch{return null}}function xe(t){return t===404}async function Ce(t){try{const e=await fetch(t,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Te)});return await e.body?.cancel().catch(()=>{}),xe(e.status)}catch{return!1}}const Z=ve(I);function Ke(t){const e=fe.c(10);let i,f,c;e[0]!==t?({resetKey:c,children:i,...f}=t,e[0]=t,e[1]=i,e[2]=f,e[3]=c):(i=e[1],f=e[2],c=e[3]);let o;e[4]!==f||e[5]!==c?(o=Y.jsx(Le,{...f},c),e[4]=f,e[5]=c,e[6]=o):o=e[6];let h;return e[7]!==i||e[8]!==o?(h=Y.jsx(Z.Host,{source:o,children:i}),e[7]=i,e[8]=o,e[9]=h):h=e[9],h}function Le(t){return Z.usePublish(_e(t)),null}function _e({virtualMcpId:t,branch:e,previewUrl:i=null,enabled:f=!0}){const{org:c}=he(),o=Ee(),h=Se()?.taskId??null,[te,L]=a.useState(null),[ne,_]=a.useState({phase:"idle"}),[se,w]=a.useState({state:"running"}),[re,P]=a.useState({kind:"unknown"}),[ae,N]=a.useState(!1),[ce,O]=a.useState([]),[oe,B]=a.useState([]),[,ue]=a.useState(0),v=a.useRef(new Map),K=a.useRef(new Set),R=a.useRef(new Set),A=a.useRef(null),T=ke(i),Q=ye(t)?.metadata?.runtime?.selected==="deno",ie=l=>{let d=v.current.get(l);return d||(d=new be,v.current.set(l,d)),d};return a.useEffect(()=>{if(L(null),_({phase:"idle"}),w({state:"running"}),P({kind:"unknown"}),A.current=null,N(!1),O([]),B([]),v.current.clear(),!t||!e||!f)return;const l=ge({orgSlug:c.slug,virtualMcpId:t,branch:e,threadId:h??null},"events");let d=!1,S=0,k=null,g=null,y=null,p=null,E=null,x=null;const F=()=>{g&&clearTimeout(g),g=setTimeout(()=>{g=null,o.invalidateQueries({queryKey:C.liveMeta(c.slug,t,e)})},1e3)},le=n=>{try{const s=JSON.parse(n.data);L(s),s.kind!=="failed"&&(N(!1),S=0),s.kind==="ready"&&q()}catch(s){console.warn("[vm-events] bad phase payload",s)}},V=()=>{N(!0),L(null),_({phase:"idle"}),w({state:"running"}),P({kind:"unknown"}),O([]),B([]),v.current.clear()},$=n=>{try{const s=JSON.parse(n.data);if(typeof s.data!="string")return;S=0;const u=s.data.replace(/\r?\n/g,`\r
|
|
2
|
+
`);ie(s.source).append(u);for(const r of K.current)try{r(s.source,u)}catch{}ue(r=>r+1)}catch{}},j=n=>{const s=n.type;try{const u=JSON.parse(n.data);switch(S=0,s){case"lifecycle":{const r=u;_(r.state);const m=`${c.slug}/${t}/${e}`;if(J(r.state.phase)&&!(x&&J(x))){G(o,c.id);const D=C.decofile(m);o.getQueryData(D)===void 0&&o.invalidateQueries({queryKey:D})}r.state.phase==="running"&&x!=="running"&&(G(o,c.id),o.invalidateQueries({queryKey:C.decofile(m)}),F()),x=r.state.phase;const b=r.state.phase==="running"?r.state.port:null,U=A.current;if(A.current=b,U!==null&&b!==null&&U!==b)for(const D of R.current)try{D()}catch{}return}case"status":w(u);return;case"tasks":{const m=u.active.map(b=>b.logName??"").filter(Boolean);B(m);return}case"scripts":O(u.scripts);return;case"branch":{const r=u.meta;P(r);return}case"reload":for(const r of R.current)try{r()}catch{}return;case"file-changed":{const{path:r}=u,m=`${c.slug}/${t}/${e}`;if(r.startsWith(".deco/")||r.includes("/.deco/")){if(!(x==="running"))return;r.endsWith(".deco/meta.gen.json")&&F(),y&&clearTimeout(y),y=setTimeout(()=>{if(y=null,o.invalidateQueries({queryKey:C.decofile(m)}),Q)for(const D of R.current)try{D()}catch{}},500)}else F();return}}}catch{}};function M(){if(d)return;const n=new EventSource(l);p=n,n.onopen=()=>{},n.onerror=()=>{p===n&&n.readyState===EventSource.CLOSED&&H("studio")},n.addEventListener("phase",le),n.addEventListener("gone",V),n.addEventListener(X,$);for(const s of z)n.addEventListener(s,j)}function q(){if(d||!T||E)return;const n=new EventSource(T);E=n;let s=!1;n.onopen=()=>{if(d||E!==n)return;s=!0,S=0;const u=p;p=null,u?.close()},n.onerror=()=>{E===n&&n.readyState===EventSource.CLOSED&&de(n,s)},n.addEventListener(X,$);for(const u of z)n.addEventListener(u,j)}async function de(n,s){const u=T?await Ce(T):!1;if(!(d||E!==n)){if(n.close(),E=null,u){V(),p||M();return}s&&H("direct")}}function H(n){if(d||k)return;const s=pe(Re,De,S,2,0);S++,k=setTimeout(()=>{if(k=null,!d){if(n==="direct"){E?.close(),E=null,q();return}p?.close(),p=null,M()}},s)}return M(),()=>{d=!0,p?.close(),E?.close(),k&&clearTimeout(k),g&&clearTimeout(g),y&&clearTimeout(y)}},[t,e,c.slug,c.id,f,h,T,o,Q]),{phase:te,lifecycle:ne,status:se,branch:re,notFound:ae,scripts:ce,activeProcesses:oe,getBuffer:l=>v.current.get(l)?.get()??"",hasData:l=>(v.current.get(l)?.get().length??0)>0,subscribeChunks:l=>(K.current.add(l),()=>{K.current.delete(l)}),subscribeReload:l=>(R.current.add(l),()=>{R.current.delete(l)})}}function ee(){return a.use(I)}function Ae(t){const{subscribeChunks:e}=ee(),i=a.useRef(t);i.current=t,a.useEffect(()=>e((o,h)=>{i.current?.(o,h)}),[e])}function Fe(t){const{subscribeReload:e}=ee(),i=a.useRef(t);i.current=t,a.useEffect(()=>e(()=>{i.current?.()}),[e])}export{Ke as S,Ae as a,Fe as b,J as i,ee as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,a5 as c,ak as r,K as l,V as d,q as f,e as S}from"./index-
|
|
1
|
+
import{c as u,a5 as c,ak as r,K as l,V as d,q as f,e as S}from"./index-CMZ9oAw6.js";function C(){const e=u.c(7),{org:i}=c(),n=r();let a;e[0]!==i.id?(a=l.secrets(i.id),e[0]=i.id,e[1]=a):a=e[1];let t;e[2]!==n?(t=async()=>await n.call("SECRET_LIST",{}),e[2]=n,e[3]=t):t=e[3];let s;e[4]!==a||e[5]!==t?(s={queryKey:a,staleTime:6e4,queryFn:t},e[4]=a,e[5]=t,e[6]=s):s=e[6];const{data:o}=d(s);return o.secrets}function m(){const e=u.c(8),{org:i}=c(),n=r(),a=f();let t;e[0]!==n?(t=async y=>await n.call("SECRET_CREATE",{...y}),e[0]=n,e[1]=t):t=e[1];let s;e[2]!==i||e[3]!==a?(s=()=>{a.invalidateQueries({queryKey:l.secrets(i.id)})},e[2]=i,e[3]=a,e[4]=s):s=e[4];let o;return e[5]!==t||e[6]!==s?(o={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=o):o=e[7],S(o)}export{m as a,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i2 as ee,bf as te,c as M,b as re,r as b,j as i,m as se,be as oe,D as ie,v as le,x as ne,I as ce,w as ae}from"./index-CMZ9oAw6.js";import{a as F,e as G}from"./UserSquare-DzDVpCW-.js";import{b as fe}from"./agent-icon-D8xpO52d.js";import{i as ue}from"./SearchMd-CcwkIY3R.js";import{J as Y,K as de,O as _}from"./parse-sections-D3wB02g1.js";import{a2 as me,k as ve,an as pe}from"./blocks-tab-states-Dar_PZ4t.js";import{aV as X,c as xe,u as he,m as ge,A as we}from"./site-editor-toast-8lkV6LJx.js";import{u as Se}from"./use-voice-input-CD7MBjXb.js";function be(r){return r.schema?.definitions??r.schema?.$defs??{}}function Z(r,e){const t=be(e),s=t[btoa(r)];if(!s)return[];const o=[s];if(Array.isArray(s.allOf)){const n=s.allOf.find(l=>typeof l.$ref=="string")?.$ref;if(typeof n=="string"){const l=t[n.replace("#/definitions/","")];l&&o.push(l)}}return o}function je(r,e){for(const t of Z(r,e)){const s=typeof t.image=="string"?t.image:void 0;if(s?.includes("{{{"))return s}}function ze(r,e){if(!e)return;const t=ee(r,te(e));if(!t)return;const s=je(t.resolveType,e);if(!s)return;const o=de(s,t.data);if(o)return Y(o)}function ye(r,e){for(const t of Z(r,e)){const s=typeof t.image=="string"?t.image:void 0;if(s&&!s.includes("{{"))return Y(s)}}const Ne=12,z=new Set,q=new Set;function Re(){for(const r of q)r()}function Pe(r){return z.has(r)?!0:z.size>=Ne?!1:(z.add(r),!0)}function Q(r){z.delete(r)&&Re()}function Ie(r){return q.add(r),()=>{q.delete(r)}}function Te(r,e){const t=b.useRef(!1),[s,o]=b.useState(!1),n=b.useRef(null),l=b.useRef(null),f=b.useRef(null),c=b.useRef(r);c.current=r;const[p]=b.useState(()=>{const u=()=>{f.current?.(),f.current=null},d=()=>t.current?!0:Pe(e)?(t.current=!0,o(!0),u(),!0):!1;return a=>{if(l.current=a,n.current&&(n.current.disconnect(),n.current=null),u(),!a){t.current&&(Q(e),t.current=!1,o(!1));return}queueMicrotask(()=>{if(l.current!==a)return;const w=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!d()&&!f.current&&(f.current=Ie(()=>{l.current===a&&d()}));return}u(),t.current&&(Q(e),t.current=!1,o(!1))},{root:c.current.current,rootMargin:"160px 0px"});w.observe(a),n.current=w})}});return{ref:p,iframeActive:s}}function Ce(r){const e=M.c(9),{previewUrl:t,title:s,scrollRootRef:o,slotId:n}=r,{ref:l,iframeActive:f}=Te(o,n),[c,p]=b.useState(!1),u=_()?G:F;let d;e[0]!==u||e[1]!==f||e[2]!==c||e[3]!==t||e[4]!==s?(d=f?i.jsxs(i.Fragment,{children:[!c&&i.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:i.jsx(u,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),i.jsx("iframe",{src:t,title:`Preview ${s}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>p(!0)})]}):i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx(u,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=u,e[1]=f,e[2]=c,e[3]=t,e[4]=s,e[5]=d):d=e[5];let a;return e[6]!==l||e[7]!==d?(a=i.jsx("div",{ref:l,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:d}),e[6]=l,e[7]=d,e[8]=a):a=e[8],a}function Ue(r){const e=M.c(3),{image:t}=r,s=_()?G:F;let o;return e[0]!==s||e[1]!==t?(o=i.jsx("div",{className:"relative flex aspect-[16/10] w-full items-center justify-center overflow-hidden bg-muted/40",children:t?i.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):i.jsx(s,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=s,e[1]=t,e[2]=o):o=e[2],o}function ke(r){const e=M.c(28),{entry:t,previewUrl:s,image:o,scrollRootRef:n,onSelect:l}=r,c=_()?t.isSavedBlock?fe:G:F,p=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let u;e[0]!==p?(u=se("group flex flex-col overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-lg))] border bg-card text-left transition-colors shadow-edge","hover:border-primary/40 hover:bg-accent",p),e[0]=p,e[1]=u):u=e[1];let d;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==o||e[5]!==s||e[6]!==n?(d=s?i.jsx(Ce,{previewUrl:s,title:t.title,scrollRootRef:n,slotId:t.resolveType}):i.jsx(Ue,{image:o}),e[2]=t.resolveType,e[3]=t.title,e[4]=o,e[5]=s,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==t.isSavedBlock?(a=t.isSavedBlock?{color:oe}:void 0,e[8]=t.isSavedBlock,e[9]=a):a=e[9];let w;e[10]!==c||e[11]!==a?(w=i.jsx(c,{className:"h-4 w-4 shrink-0",style:a}),e[10]=c,e[11]=a,e[12]=w):w=e[12];let m;e[13]!==t.title?(m=i.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[13]=t.title,e[14]=m):m=e[14];let x;e[15]!==t.description?(x=t.description&&i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[15]=t.description,e[16]=x):x=e[16];let h;e[17]!==m||e[18]!==x?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[m,x]}),e[17]=m,e[18]=x,e[19]=h):h=e[19];let g;e[20]!==w||e[21]!==h?(g=i.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[w,h]}),e[20]=w,e[21]=h,e[22]=g):g=e[22];let S;return e[23]!==l||e[24]!==u||e[25]!==d||e[26]!==g?(S=i.jsxs("button",{type:"button",onClick:l,className:u,children:[d,g]}),e[23]=l,e[24]=u,e[25]=d,e[26]=g,e[27]=S):S=e[27],S}function Ve(r){const e=M.c(51),{open:t,onOpenChange:s,meta:o,decofile:n,previewBaseUrl:l,onSelect:f}=r,c=re(),[p,u]=b.useState(""),[d,a]=b.useState(t),w=b.useRef(null);t!==d&&(a(t),t&&u(""));let m,x,h,g,S,y,N,R,j,P,I;if(e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==f||e[4]!==t||e[5]!==l||e[6]!==p||e[7]!==c){const V=t&&o&&n?me(o,n):[],W=o?ve(o):"",H=n?pe(n):void 0,J=new Map;if(t&&W&&l)for(const v of V)J.set(v.resolveType,X(l,W,v.previewBlock,H));const E=p.trim().toLowerCase(),K=E?V.filter(v=>v.title.toLowerCase().includes(E)||v.resolveType.toLowerCase().includes(E)||v.description?.toLowerCase().includes(E)):V;x=ie,P=t,I=s,m=le,N="top-3 right-3",R="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let k;e[19]!==c?(k=c("sectionsEditor.addSectionModal.title"),e[19]=c,e[20]=k):k=e[20];let A;e[21]!==k?(A=i.jsx(ne,{children:k}),e[21]=k,e[22]=A):A=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=i.jsx(ue,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=$):$=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=v=>u(v.target.value),e[24]=D):D=e[24];let B;e[25]!==c?(B=c("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=c,e[26]=B):B=e[26];let L;e[27]!==p||e[28]!==B?(L=i.jsxs("div",{className:"relative pt-2",children:[$,i.jsx(ce,{value:p,onChange:D,placeholder:B,className:"h-9 pl-8"})]}),e[27]=p,e[28]=B,e[29]=L):L=e[29],e[30]!==A||e[31]!==L?(j=i.jsxs(ae,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,L]}),e[30]=A,e[31]=L,e[32]=j):j=e[32],S=w,y="min-h-0 flex-1 overflow-y-auto",h="p-4",g=K.length===0?i.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:c("sectionsEditor.addSectionModal.noSectionsFound")}):i.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:K.map(v=>i.jsx(ke,{entry:v,scrollRootRef:w,previewUrl:l?J.get(v.resolveType)??X(l,W,v.previewBlock,H):null,image:l||!o?void 0:ye(v.resolveType,o),onSelect:()=>f(v)},v.resolveType))}),e[0]=n,e[1]=o,e[2]=s,e[3]=f,e[4]=t,e[5]=l,e[6]=p,e[7]=c,e[8]=m,e[9]=x,e[10]=h,e[11]=g,e[12]=S,e[13]=y,e[14]=N,e[15]=R,e[16]=j,e[17]=P,e[18]=I}else m=e[8],x=e[9],h=e[10],g=e[11],S=e[12],y=e[13],N=e[14],R=e[15],j=e[16],P=e[17],I=e[18];let T;e[33]!==h||e[34]!==g?(T=i.jsx("div",{className:h,children:g}),e[33]=h,e[34]=g,e[35]=T):T=e[35];let C;e[36]!==T||e[37]!==S||e[38]!==y?(C=i.jsx("div",{ref:S,className:y,children:T}),e[36]=T,e[37]=S,e[38]=y,e[39]=C):C=e[39];let U;e[40]!==m||e[41]!==C||e[42]!==N||e[43]!==R||e[44]!==j?(U=i.jsxs(m,{closeButtonClassName:N,className:R,children:[j,C]}),e[40]=m,e[41]=C,e[42]=N,e[43]=R,e[44]=j,e[45]=U):U=e[45];let O;return e[46]!==x||e[47]!==U||e[48]!==P||e[49]!==I?(O=i.jsx(x,{open:P,onOpenChange:I,children:U}),e[46]=x,e[47]=U,e[48]=P,e[49]=I,e[50]=O):O=e[50],O}function We(r){const e=M.c(4),{previewServerUrl:t,runtime:s}=Se(r.virtualMcpId),{url:o}=xe(r.virtualMcpId),n=he(r.virtualMcpId,r.branch),l=s==="cms";if(ge(n))return null;if(o)return o;let f;return e[0]!==l||e[1]!==r.sandboxUrl||e[2]!==t?(f=we({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:l}),e[0]=l,e[1]=r.sandboxUrl,e[2]=t,e[3]=f):f=e[3],f}export{Ve as A,ze as g,Z as s,We as u};
|
package/dist/client/assets/{use-sidebar-collapsed-ByMTBVZc.js → use-sidebar-collapsed-By-Y5hbX.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as y,c as j,j as o,m as C,cs as A,ct as R,a7 as H,bQ as L,b as V,d as W,a5 as F}from"./index-BZX-7ipZ.js";import{m as q}from"./use-chat-layout-state-CZaSk8YF.js";import{L as Q}from"./agent-icon-U2nlXoBG.js";import{b as G,a as E,T as P,c as z}from"./tooltip--uPFG1gb.js";import{T as J}from"./toolbar-icon-button-BzIcnxXk.js";import{a as K}from"./shell-layout-BvJfyzsq.js";import{u as U}from"./use-mobile-BDWitdax.js";import{b as X,c as Y,S as Z,d as ee,a as te}from"./sheet-BYgfxL9i.js";const se="15rem",ae="18rem",ie="4.5rem",D=y.createContext(null);function I(){const s=y.useContext(D);if(!s)throw new Error("useSidebar must be used within a SidebarProvider.");return s}function ge(s){const e=j.c(19),{children:t,defaultOpen:a,open:i,onOpenChange:n}=s,d=a===void 0?!1:a,r=U(),[l,c]=y.useState(d),[b,v]=y.useState(!1),u=i!==void 0,f=u?i:l;let h;e[0]!==u||e[1]!==n?(h=M=>{u||c(M),n?.(M)},e[0]=u,e[1]=n,e[2]=h):h=e[2];const p=h;let w;e[3]!==r||e[4]!==f||e[5]!==p?(w=()=>{r?v(ne):p(!f)},e[3]=r,e[4]=f,e[5]=p,e[6]=w):w=e[6];const N=w,x=f?"expanded":"collapsed";let m;e[7]!==r||e[8]!==f||e[9]!==b||e[10]!==p||e[11]!==x||e[12]!==N?(m={state:x,open:f,setOpen:p,isMobile:r,openMobile:b,setOpenMobile:v,toggleSidebar:N},e[7]=r,e[8]=f,e[9]=b,e[10]=p,e[11]=x,e[12]=N,e[13]=m):m=e[13];const S=m;let g;e[14]!==t?(g=o.jsx(G,{delayDuration:0,children:t}),e[14]=t,e[15]=g):g=e[15];let T;return e[16]!==S||e[17]!==g?(T=o.jsx(D.Provider,{value:S,children:g}),e[16]=S,e[17]=g,e[18]=T):T=e[18],T}function ne(s){return!s}function ve(s){const e=j.c(14);let t,a,i,n;e[0]!==s?({className:a,style:n,children:t,...i}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n):(t=e[1],a=e[2],i=e[3],n=e[4]);let d;e[5]!==n?(d={"--sidebar-width":se,"--sidebar-width-icon":ie,...n},e[5]=n,e[6]=d):d=e[6];const r=d;let l;e[7]!==a?(l=C("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=l):l=e[8];let c;return e[9]!==t||e[10]!==i||e[11]!==r||e[12]!==l?(c=o.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:l,...i,children:t}),e[9]=t,e[10]=i,e[11]=r,e[12]=l,e[13]=c):c=e[13],c}function Se(s){const e=j.c(36);let t,a,i,n,d;e[0]!==s?({side:n,variant:d,className:a,children:t,...i}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n,e[5]=d):(t=e[1],a=e[2],i=e[3],n=e[4],d=e[5]);const r=n===void 0?"left":n,l=d===void 0?"sidebar":d,{isMobile:c,state:b,openMobile:v,setOpenMobile:u}=I();if(c){let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T={"--sidebar-width":ae},e[6]=T):T=e[6];let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsxs(Y,{className:"sr-only",children:[o.jsx(Z,{children:"Sidebar"}),o.jsx(ee,{children:"Displays the mobile sidebar."})]}),e[7]=M):M=e[7];let $;e[8]!==t?($=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let _;e[10]!==r||e[11]!==$?(_=o.jsxs(te,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:T,side:r,children:[M,$]}),e[10]=r,e[11]=$,e[12]=_):_=e[12];let B;return e[13]!==v||e[14]!==i||e[15]!==u||e[16]!==_?(B=o.jsx(X,{open:v,onOpenChange:u,...i,children:_}),e[13]=v,e[14]=i,e[15]=u,e[16]=_,e[17]=B):B=e[17],B}const f=b==="expanded",h=f?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let p;e[18]!==h?(p=C("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",h),e[18]=h,e[19]=p):p=e[19];const w=f?void 0:"icon",N=f?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let x;e[20]!==a||e[21]!==N?(x=C("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",N,a),e[20]=a,e[21]=N,e[22]=x):x=e[22];let m;e[23]!==t?(m=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=m):m=e[24];let S;e[25]!==i||e[26]!==x||e[27]!==m?(S=o.jsx("div",{"data-slot":"sidebar-container",className:x,...i,children:m}),e[25]=i,e[26]=x,e[27]=m,e[28]=S):S=e[28];let g;return e[29]!==r||e[30]!==b||e[31]!==p||e[32]!==w||e[33]!==S||e[34]!==l?(g=o.jsx("div",{className:p,"data-state":b,"data-collapsible":w,"data-variant":l,"data-side":r,"data-slot":"sidebar",children:S}),e[29]=r,e[30]=b,e[31]=p,e[32]=w,e[33]=S,e[34]=l,e[35]=g):g=e[35],g}function je(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("main",{"data-slot":"sidebar-inset",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function we(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Ne(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Te(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Ce(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}const le=R("peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm focus-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground hover:[&_svg:not([class*='text-'])]:text-sidebar-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm group-data-[state=collapsed]/sidebar:size-8! group-data-[state=collapsed]/sidebar:rounded-full",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ye(s){const e=j.c(28);let t,a,i,n,d,r,l;e[0]!==s?({asChild:i,isActive:n,variant:d,size:r,tooltip:l,className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n,e[5]=d,e[6]=r,e[7]=l):(t=e[1],a=e[2],i=e[3],n=e[4],d=e[5],r=e[6],l=e[7]);const c=i===void 0?!1:i,b=n===void 0?!1:n,v=d===void 0?"default":d,u=r===void 0?"default":r,f=c?A:"button",{isMobile:h}=I();let p;e[8]!==t||e[9]!==u||e[10]!==v?(p=C(le({variant:v,size:u}),t),e[8]=t,e[9]=u,e[10]=v,e[11]=p):p=e[11];let w;e[12]!==f||e[13]!==b||e[14]!==a||e[15]!==u||e[16]!==p?(w=o.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":b,className:p,...a}),e[12]=f,e[13]=b,e[14]=a,e[15]=u,e[16]=p,e[17]=w):w=e[17];const N=w;if(!l)return N;if(typeof l=="string"){let g;e[18]!==l?(g={children:l},e[18]=l,e[19]=g):g=e[19],l=g}let x;e[20]!==N?(x=o.jsx(P,{asChild:!0,children:N}),e[20]=N,e[21]=x):x=e[21];let m;e[22]!==h||e[23]!==l?(m=o.jsx(E,{side:"right",align:"center",hidden:h,...l}),e[22]=h,e[23]=l,e[24]=m):m=e[24];let S;return e[25]!==x||e[26]!==m?(S=o.jsxs(z,{children:[x,m]}),e[25]=x,e[26]=m,e[27]=S):S=e[27],S}function re(){const s=j.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},s[0]=e):e=s[0],!!H(e)}const O=y.createContext(null);function Me(s){const e=j.c(5),{children:t}=s,[a,i]=y.useState(null);let n;e[0]!==a?(n={target:a,setTarget:i},e[0]=a,e[1]=n):n=e[1];let d;return e[2]!==t||e[3]!==n?(d=o.jsx(O,{value:n,children:t}),e[2]=t,e[3]=n,e[4]=d):d=e[4],d}function oe(){const s=y.use(O);if(!s)throw new Error("Sidebar thread controls require a Layout");return s}function k(s){const e=j.c(17),{open:t,onToggle:a}=s,i=V(),{isMobile:n,setOpenMobile:d}=I(),r=t?"page.closeThread":"page.openThread";let l;e[0]!==i||e[1]!==r?(l=i(r),e[0]=i,e[1]=r,e[2]=l):l=e[2];const c=l;let b;e[3]!==n||e[4]!==a||e[5]!==d?(b=()=>{a(),n&&d(!1)},e[3]=n,e[4]=a,e[5]=d,e[6]=b):b=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Q,{size:16}),e[7]=v):v=e[7];let u;e[8]!==c||e[9]!==t||e[10]!==b?(u=o.jsx(P,{asChild:!0,children:o.jsx(J,{"aria-label":c,"aria-pressed":t,active:t,className:"size-7 shrink-0 group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:size-8",onClick:b,children:v})}),e[8]=c,e[9]=t,e[10]=b,e[11]=u):u=e[11];let f;e[12]!==c?(f=o.jsx(E,{side:"right",children:c}),e[12]=c,e[13]=f):f=e[13];let h;return e[14]!==u||e[15]!==f?(h=o.jsxs(z,{children:[u,f]}),e[14]=u,e[15]=f,e[16]=h):h=e[16],h}function $e(s){const e=j.c(3),t=y.use(O);let a;return e[0]!==s||e[1]!==t?(a=t?.target?L.createPortal(o.jsx(k,{...s}),t.target):null,e[0]=s,e[1]=t,e[2]=a):a=e[2],a}function _e(){const s=j.c(11),{setTarget:e}=oe(),t=re(),{isMobile:a}=I(),i=W(),{org:n}=F(),{openSidePanel:d}=K();let r;s[0]!==e?(r=o.jsx("div",{ref:e,className:"peer/thread-button contents empty:hidden"}),s[0]=e,s[1]=r):r=s[1];let l;s[2]!==t||s[3]!==a||s[4]!==i||s[5]!==d||s[6]!==n?(l=o.jsx("div",{className:"hidden peer-empty/thread-button:contents",children:o.jsx(k,{open:!1,onToggle:()=>{t?i({to:"/$org/home",params:{org:n.slug},search:{sidepanel:!0,mainpanel:!a}}):a?i({to:".",search:de,replace:!0}):d()}})}),s[2]=t,s[3]=a,s[4]=i,s[5]=d,s[6]=n,s[7]=l):l=s[7];let c;return s[8]!==r||s[9]!==l?(c=o.jsxs(o.Fragment,{children:[r,l]}),s[8]=r,s[9]=l,s[10]=c):c=s[10],c}function de(s){return{...s,...q("chat")}}function Ie(){const{state:s,isMobile:e}=I();return s==="collapsed"&&!e}export{ye as S,Te as a,Ce as b,I as c,we as d,_e as e,Ne as f,Se as g,re as h,ge as i,ve as j,Me as k,je as l,$e as m,Ie as u};
|
|
1
|
+
import{r as y,c as j,j as o,m as C,cs as A,ct as R,a7 as H,bQ as L,b as V,d as W,a5 as F}from"./index-CMZ9oAw6.js";import{m as q}from"./use-chat-layout-state-BmNEHAsA.js";import{L as Q}from"./agent-icon-D8xpO52d.js";import{b as G,a as E,T as P,c as z}from"./tooltip-D-7vfgux.js";import{T as J}from"./toolbar-icon-button-1L7HNhDo.js";import{a as K}from"./shell-layout-Cu50GNJe.js";import{u as U}from"./use-mobile-CUeZ8VwW.js";import{b as X,c as Y,S as Z,d as ee,a as te}from"./sheet-Bcoclksa.js";const se="15rem",ae="18rem",ie="4.5rem",D=y.createContext(null);function I(){const s=y.useContext(D);if(!s)throw new Error("useSidebar must be used within a SidebarProvider.");return s}function ge(s){const e=j.c(19),{children:t,defaultOpen:a,open:i,onOpenChange:n}=s,d=a===void 0?!1:a,r=U(),[l,c]=y.useState(d),[b,v]=y.useState(!1),u=i!==void 0,f=u?i:l;let h;e[0]!==u||e[1]!==n?(h=M=>{u||c(M),n?.(M)},e[0]=u,e[1]=n,e[2]=h):h=e[2];const p=h;let w;e[3]!==r||e[4]!==f||e[5]!==p?(w=()=>{r?v(ne):p(!f)},e[3]=r,e[4]=f,e[5]=p,e[6]=w):w=e[6];const N=w,x=f?"expanded":"collapsed";let m;e[7]!==r||e[8]!==f||e[9]!==b||e[10]!==p||e[11]!==x||e[12]!==N?(m={state:x,open:f,setOpen:p,isMobile:r,openMobile:b,setOpenMobile:v,toggleSidebar:N},e[7]=r,e[8]=f,e[9]=b,e[10]=p,e[11]=x,e[12]=N,e[13]=m):m=e[13];const S=m;let g;e[14]!==t?(g=o.jsx(G,{delayDuration:0,children:t}),e[14]=t,e[15]=g):g=e[15];let T;return e[16]!==S||e[17]!==g?(T=o.jsx(D.Provider,{value:S,children:g}),e[16]=S,e[17]=g,e[18]=T):T=e[18],T}function ne(s){return!s}function ve(s){const e=j.c(14);let t,a,i,n;e[0]!==s?({className:a,style:n,children:t,...i}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n):(t=e[1],a=e[2],i=e[3],n=e[4]);let d;e[5]!==n?(d={"--sidebar-width":se,"--sidebar-width-icon":ie,...n},e[5]=n,e[6]=d):d=e[6];const r=d;let l;e[7]!==a?(l=C("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=l):l=e[8];let c;return e[9]!==t||e[10]!==i||e[11]!==r||e[12]!==l?(c=o.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:l,...i,children:t}),e[9]=t,e[10]=i,e[11]=r,e[12]=l,e[13]=c):c=e[13],c}function Se(s){const e=j.c(36);let t,a,i,n,d;e[0]!==s?({side:n,variant:d,className:a,children:t,...i}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n,e[5]=d):(t=e[1],a=e[2],i=e[3],n=e[4],d=e[5]);const r=n===void 0?"left":n,l=d===void 0?"sidebar":d,{isMobile:c,state:b,openMobile:v,setOpenMobile:u}=I();if(c){let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T={"--sidebar-width":ae},e[6]=T):T=e[6];let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsxs(Y,{className:"sr-only",children:[o.jsx(Z,{children:"Sidebar"}),o.jsx(ee,{children:"Displays the mobile sidebar."})]}),e[7]=M):M=e[7];let $;e[8]!==t?($=o.jsx("div",{className:"flex h-full w-full flex-col",children:t}),e[8]=t,e[9]=$):$=e[9];let _;e[10]!==r||e[11]!==$?(_=o.jsxs(te,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:T,side:r,children:[M,$]}),e[10]=r,e[11]=$,e[12]=_):_=e[12];let B;return e[13]!==v||e[14]!==i||e[15]!==u||e[16]!==_?(B=o.jsx(X,{open:v,onOpenChange:u,...i,children:_}),e[13]=v,e[14]=i,e[15]=u,e[16]=_,e[17]=B):B=e[17],B}const f=b==="expanded",h=f?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let p;e[18]!==h?(p=C("group/sidebar peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","transition-[width] duration-150 ease-out motion-reduce:transition-none",h),e[18]=h,e[19]=p):p=e[19];const w=f?void 0:"icon",N=f?"w-(--sidebar-width)":"w-(--sidebar-width-icon)";let x;e[20]!==a||e[21]!==N?(x=C("flex flex-col h-full transition-[width] duration-150 ease-out motion-reduce:transition-none",N,a),e[20]=a,e[21]=N,e[22]=x):x=e[22];let m;e[23]!==t?(m=o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col",children:t}),e[23]=t,e[24]=m):m=e[24];let S;e[25]!==i||e[26]!==x||e[27]!==m?(S=o.jsx("div",{"data-slot":"sidebar-container",className:x,...i,children:m}),e[25]=i,e[26]=x,e[27]=m,e[28]=S):S=e[28];let g;return e[29]!==r||e[30]!==b||e[31]!==p||e[32]!==w||e[33]!==S||e[34]!==l?(g=o.jsx("div",{className:p,"data-state":b,"data-collapsible":w,"data-variant":l,"data-side":r,"data-slot":"sidebar",children:S}),e[29]=r,e[30]=b,e[31]=p,e[32]=w,e[33]=S,e[34]=l,e[35]=g):g=e[35],g}function je(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("main",{"data-slot":"sidebar-inset",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function we(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("flex flex-col gap-2 p-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Ne(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("flex min-h-0 flex-1 flex-col gap-2",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Te(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("flex w-full min-w-0 list-none flex-col gap-1 group-data-[state=collapsed]/sidebar:items-center",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}function Ce(s){const e=j.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let i;e[3]!==t?(i=C("group/menu-item relative w-full list-none",t),e[3]=t,e[4]=i):i=e[4];let n;return e[5]!==a||e[6]!==i?(n=o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...a}),e[5]=a,e[6]=i,e[7]=n):n=e[7],n}const le=R("peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-lg py-0 pr-0.5 pl-1.5 text-left text-sm focus-ring transition-[width,height,padding] duration-150 ease-out motion-reduce:transition-none active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate group-data-[state=collapsed]/sidebar:[&>span:last-child]:hidden [&>svg]:size-4 [&>svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground hover:[&_svg:not([class*='text-'])]:text-sidebar-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background ring-1 ring-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:ring-sidebar-accent"},size:{default:"group-data-[state=expanded]/sidebar:h-8 group-data-[state=expanded]/sidebar:px-2 group-data-[state=collapsed]/sidebar:p-0! group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:justify-center text-sm group-data-[state=collapsed]/sidebar:size-8! group-data-[state=collapsed]/sidebar:rounded-full",sm:"h-7 text-xs",lg:"h-12 text-sm p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ye(s){const e=j.c(28);let t,a,i,n,d,r,l;e[0]!==s?({asChild:i,isActive:n,variant:d,size:r,tooltip:l,className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=i,e[4]=n,e[5]=d,e[6]=r,e[7]=l):(t=e[1],a=e[2],i=e[3],n=e[4],d=e[5],r=e[6],l=e[7]);const c=i===void 0?!1:i,b=n===void 0?!1:n,v=d===void 0?"default":d,u=r===void 0?"default":r,f=c?A:"button",{isMobile:h}=I();let p;e[8]!==t||e[9]!==u||e[10]!==v?(p=C(le({variant:v,size:u}),t),e[8]=t,e[9]=u,e[10]=v,e[11]=p):p=e[11];let w;e[12]!==f||e[13]!==b||e[14]!==a||e[15]!==u||e[16]!==p?(w=o.jsx(f,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":b,className:p,...a}),e[12]=f,e[13]=b,e[14]=a,e[15]=u,e[16]=p,e[17]=w):w=e[17];const N=w;if(!l)return N;if(typeof l=="string"){let g;e[18]!==l?(g={children:l},e[18]=l,e[19]=g):g=e[19],l=g}let x;e[20]!==N?(x=o.jsx(P,{asChild:!0,children:N}),e[20]=N,e[21]=x):x=e[21];let m;e[22]!==h||e[23]!==l?(m=o.jsx(E,{side:"right",align:"center",hidden:h,...l}),e[22]=h,e[23]=l,e[24]=m):m=e[24];let S;return e[25]!==x||e[26]!==m?(S=o.jsxs(z,{children:[x,m]}),e[25]=x,e[26]=m,e[27]=S):S=e[27],S}function re(){const s=j.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings",shouldThrow:!1},s[0]=e):e=s[0],!!H(e)}const O=y.createContext(null);function Me(s){const e=j.c(5),{children:t}=s,[a,i]=y.useState(null);let n;e[0]!==a?(n={target:a,setTarget:i},e[0]=a,e[1]=n):n=e[1];let d;return e[2]!==t||e[3]!==n?(d=o.jsx(O,{value:n,children:t}),e[2]=t,e[3]=n,e[4]=d):d=e[4],d}function oe(){const s=y.use(O);if(!s)throw new Error("Sidebar thread controls require a Layout");return s}function k(s){const e=j.c(17),{open:t,onToggle:a}=s,i=V(),{isMobile:n,setOpenMobile:d}=I(),r=t?"page.closeThread":"page.openThread";let l;e[0]!==i||e[1]!==r?(l=i(r),e[0]=i,e[1]=r,e[2]=l):l=e[2];const c=l;let b;e[3]!==n||e[4]!==a||e[5]!==d?(b=()=>{a(),n&&d(!1)},e[3]=n,e[4]=a,e[5]=d,e[6]=b):b=e[6];let v;e[7]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Q,{size:16}),e[7]=v):v=e[7];let u;e[8]!==c||e[9]!==t||e[10]!==b?(u=o.jsx(P,{asChild:!0,children:o.jsx(J,{"aria-label":c,"aria-pressed":t,active:t,className:"size-7 shrink-0 group-data-[state=collapsed]/sidebar:mx-auto group-data-[state=collapsed]/sidebar:size-8",onClick:b,children:v})}),e[8]=c,e[9]=t,e[10]=b,e[11]=u):u=e[11];let f;e[12]!==c?(f=o.jsx(E,{side:"right",children:c}),e[12]=c,e[13]=f):f=e[13];let h;return e[14]!==u||e[15]!==f?(h=o.jsxs(z,{children:[u,f]}),e[14]=u,e[15]=f,e[16]=h):h=e[16],h}function $e(s){const e=j.c(3),t=y.use(O);let a;return e[0]!==s||e[1]!==t?(a=t?.target?L.createPortal(o.jsx(k,{...s}),t.target):null,e[0]=s,e[1]=t,e[2]=a):a=e[2],a}function _e(){const s=j.c(11),{setTarget:e}=oe(),t=re(),{isMobile:a}=I(),i=W(),{org:n}=F(),{openSidePanel:d}=K();let r;s[0]!==e?(r=o.jsx("div",{ref:e,className:"peer/thread-button contents empty:hidden"}),s[0]=e,s[1]=r):r=s[1];let l;s[2]!==t||s[3]!==a||s[4]!==i||s[5]!==d||s[6]!==n?(l=o.jsx("div",{className:"hidden peer-empty/thread-button:contents",children:o.jsx(k,{open:!1,onToggle:()=>{t?i({to:"/$org/home",params:{org:n.slug},search:{sidepanel:!0,mainpanel:!a}}):a?i({to:".",search:de,replace:!0}):d()}})}),s[2]=t,s[3]=a,s[4]=i,s[5]=d,s[6]=n,s[7]=l):l=s[7];let c;return s[8]!==r||s[9]!==l?(c=o.jsxs(o.Fragment,{children:[r,l]}),s[8]=r,s[9]=l,s[10]=c):c=s[10],c}function de(s){return{...s,...q("chat")}}function Ie(){const{state:s,isMobile:e}=I();return s==="collapsed"&&!e}export{ye as S,Te as a,Ce as b,I as c,we as d,_e as e,Ne as f,Se as g,re as h,ge as i,ve as j,Me as k,je as l,$e as m,Ie as u};
|