decocms 4.372.3 → 4.373.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CMjsP_Tk.js → AlertCircle-2L7lI8NL.js} +1 -1
- package/dist/client/assets/{AreaChart-Bh_grNQZ.js → AreaChart-BSJ08P7a.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CjYy5Nhj.js → ArrowLeft-8rouBEwC.js} +1 -1
- package/dist/client/assets/{ArrowRight-CLncCNat.js → ArrowRight-DCA5zjxW.js} +1 -1
- package/dist/client/assets/{ArrowUp-Cii1LHW7.js → ArrowUp-BtksDHBQ.js} +1 -1
- package/dist/client/assets/{CartesianChart-CD-5y_pX.js → CartesianChart-BbOaLmfq.js} +1 -1
- package/dist/client/assets/{CheckCircle-DHXQFnpK.js → CheckCircle-BmVuh1xp.js} +1 -1
- package/dist/client/assets/{ChevronUp-DiYhGG4T.js → ChevronUp-fg9sod-H.js} +1 -1
- package/dist/client/assets/{Copy01-nMxlBfeT.js → Copy01-BgwuTJFm.js} +1 -1
- package/dist/client/assets/{CreditCard01-CWXVH3ZM.js → CreditCard01-CIt471eG.js} +1 -1
- package/dist/client/assets/DotsVertical-CE2o6L6N.js +1 -0
- package/dist/client/assets/{Download01-BRrSA3Yx.js → Download01-DNhEQzg0.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-fXvhmekg.js → ErrorBarContext-DxNax47N.js} +1 -1
- package/dist/client/assets/{Eye-Dyg2WPG4.js → Eye-Dq6Vw6FI.js} +1 -1
- package/dist/client/assets/{Globe01-D6FaaFR2.js → Globe01-g_y8gAs1.js} +1 -1
- package/dist/client/assets/{Users03-Y0Jco4zL.js → Globe04-GFiRExL0.js} +1 -1
- package/dist/client/assets/{Image01-CxnjAzbb.js → Image01-QB6twEDu.js} +1 -1
- package/dist/client/assets/{Key01-CIXwHMRo.js → Key01-CO_i2QPb.js} +1 -1
- package/dist/client/assets/LayoutLeft-BfySK4h8.js +1 -0
- package/dist/client/assets/{Line-YO4Ozgbt.js → Line-Cr57fOtp.js} +1 -1
- package/dist/client/assets/{Link01-C0FvgZZB.js → Link01-BIFMl_M0.js} +1 -1
- package/dist/client/assets/{LinkExternal01-AWlhN5o7.js → LinkExternal01-DQD59o7F.js} +1 -1
- package/dist/client/assets/{Monitor01-Ccs1gh2Z.js → Monitor01-Ddm2yOG6.js} +1 -1
- package/dist/client/assets/{Package-nTbucmaQ.js → Package-CvzEol5_.js} +1 -1
- package/dist/client/assets/{Palette-DSdn1Xis.js → Palette-DT856bn6.js} +1 -1
- package/dist/client/assets/{Play-lMuWOObF.js → Play-wYDcJhBq.js} +1 -1
- package/dist/client/assets/{Plus-CVauOqLT.js → Plus-BSp00qOC.js} +1 -1
- package/dist/client/assets/{SearchLg-BrrPVuXr.js → SearchLg-DFD1t2UL.js} +1 -1
- package/dist/client/assets/{SearchMd-C45D2PMI.js → SearchMd-Bb5gjLcX.js} +1 -1
- package/dist/client/assets/{Sector-9mXbxJ9i.js → Sector-wViCnB96.js} +5 -5
- package/dist/client/assets/{Settings02-Cyf85ea0.js → Settings02-D9Qv7BDm.js} +1 -1
- package/dist/client/assets/{Share07-wC47qn2E.js → Share07-CZ7JzYs9.js} +1 -1
- package/dist/client/assets/{Stars01-oAh9h5b5.js → Stars01-D-wYuyik.js} +1 -1
- package/dist/client/assets/{Sun-0Ied-kyZ.js → Sun-DLRcOzSd.js} +1 -1
- package/dist/client/assets/Tool01-Dwy1nlT9.js +1 -0
- package/dist/client/assets/{Tool02-CATStXCy.js → Tool02-CvlAGFBM.js} +1 -1
- package/dist/client/assets/{Trash01-nl-t4IoV.js → Trash01-DtE0n00a.js} +1 -1
- package/dist/client/assets/{TrendUp01-BFAEMx9E.js → TrendUp01-BCriuXJd.js} +1 -1
- package/dist/client/assets/{Upload01-B4Fqdkae.js → Upload01-Ba-RLxE1.js} +1 -1
- package/dist/client/assets/{User01-ClMaVCaJ.js → User01-DHd46PZp.js} +1 -1
- package/dist/client/assets/{UserSquare-B2lKdt4w.js → UserSquare-CcF49LHs.js} +1 -1
- package/dist/client/assets/{Users01-BFhxJVhO.js → Users01-B8gdz27Y.js} +1 -1
- package/dist/client/assets/{X-CFCE4a-Q.js → X-BtMi8Qau.js} +1 -1
- package/dist/client/assets/{XCircle-CleKT0Id.js → XCircle-BLCHBIhx.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DpXsFGyJ.js → XClose-CvcHLHe2.js} +1 -1
- package/dist/client/assets/{Zap-B6zkqKWB.js → Zap-DZAIluO6.js} +1 -1
- package/dist/client/assets/ZoomOut-DUFJq3-K.js +1 -0
- package/dist/client/assets/{access-gate-Ds4n25mC.js → access-gate-C9Dl5e5c.js} +1 -1
- package/dist/client/assets/add-connection-dialog-DA05asFs.js +1 -0
- package/dist/client/assets/agent-analytics-CDo5Hugr.js +2 -0
- package/dist/client/assets/agent-app-lfl4wDqj.js +1 -0
- package/dist/client/assets/agent-assets-6UK-ev9d.js +1 -0
- package/dist/client/assets/agent-automation-BC-cMvrG.js +20 -0
- package/dist/client/assets/agent-automations-CnHTcvU7.js +1 -0
- package/dist/client/assets/agent-connect-sources-CJ8artss.js +1 -0
- package/dist/client/assets/agent-deck-BCZ0G4O2.js +1 -0
- package/dist/client/assets/agent-e2e-Cj1Q_JS0.js +1 -0
- package/dist/client/assets/agent-experiments-DJ13yAp9.js +1 -0
- package/dist/client/assets/agent-file-DbKP1r-4.js +1 -0
- package/dist/client/assets/{agent-git-D4IYczGa.js → agent-git-B8LMQ2zl.js} +2 -2
- package/dist/client/assets/agent-hosting-Bm-WxahY.js +1 -0
- package/dist/client/assets/agent-icon-CTsmTxHg.js +1 -0
- package/dist/client/assets/agent-library-file-DvybgEEZ.js +1 -0
- package/dist/client/assets/agent-monitor-DgVt0zbx.js +1 -0
- package/dist/client/assets/agent-overview-pOglhwpN.js +1 -0
- package/dist/client/assets/agent-settings-Bx-Ya3hQ.js +1 -0
- package/dist/client/assets/{agent-site-editor-DJSdtoNU.js → agent-site-editor-DVT-M9T0.js} +13 -13
- package/dist/client/assets/agent-site-editor-code-DpPWdLwT.js +2 -0
- package/dist/client/assets/agent-site-editor-content-eM0WchN0.js +2 -0
- package/dist/client/assets/agent-site-editor-preview-3VO_kTqr.js +518 -0
- package/dist/client/assets/{agent-view-guard-DHJpzCVR.js → agent-view-guard-BNYKK-x9.js} +1 -1
- package/dist/client/assets/agent-view-v-h5B6vN.js +1 -0
- package/dist/client/assets/agents-list-BXPjUzIN.js +1 -0
- package/dist/client/assets/{ai-providers-jxGd6MbV.js → ai-providers-BAmCFPvS.js} +2 -2
- package/dist/client/assets/{alert-U2IStW1f.js → alert-C8o4-kn8.js} +1 -1
- package/dist/client/assets/{alert-dialog-BI-B_8hq.js → alert-dialog-9n2p5SCQ.js} +2 -2
- package/dist/client/assets/api-keys-Cu1KdEtK.js +1 -0
- package/dist/client/assets/api-keys-DCurVLgh.js +1 -0
- package/dist/client/assets/app-editor-C3QSidsO.js +1 -0
- package/dist/client/assets/asset-utils-CK3Em4fb.js +1 -0
- package/dist/client/assets/{auth-DhzAq_9m.js → auth-BBW3DF0r.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dar7OygY.js → auth-catchall-Bva2z4Gj.js} +1 -1
- package/dist/client/assets/auth-entry-BuHqwUIr.js +1 -0
- package/dist/client/assets/{auth-split-layout-DLFqjvPt.js → auth-split-layout-DMgxvbll.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DkJ4g-X5.js → authenticate-and-persist-oauth-Pk9b2m8R.js} +1 -1
- package/dist/client/assets/automation-list-row-D-zBLXA-.js +1 -0
- package/dist/client/assets/automation-runs-C8Wbje-n.js +1 -0
- package/dist/client/assets/automations-D69ikqKh.js +1 -0
- package/dist/client/assets/{autosend-BberXmli.js → autosend-CVNOmzPu.js} +1 -1
- package/dist/client/assets/{avatar-C9HiP4eS.js → avatar-BzRNaDEk.js} +1 -1
- package/dist/client/assets/badge-C5M6nZd4.js +1 -0
- package/dist/client/assets/block-document-UPtnFOJG.js +3 -0
- package/dist/client/assets/{blocks-preview-workspace-context-Bwmvvd4S.js → blocks-preview-workspace-context-DAFMxzU6.js} +1 -1
- package/dist/client/assets/breadcrumb-0yy48vm9.js +1 -0
- package/dist/client/assets/{buckets-BndbOAGO.js → buckets-CktpbsrB.js} +1 -1
- package/dist/client/assets/build-improve-prompt-doc-C-SX02eL.js +2 -0
- package/dist/client/assets/bulk-category-panel-MrIv4eD2.js +1 -0
- package/dist/client/assets/calendar-QcX36iLy.js +1 -0
- package/dist/client/assets/capability-load-error-BVb3VEU2.js +1 -0
- package/dist/client/assets/category-editor-DZThBJlF.js +1 -0
- package/dist/client/assets/{chart-8nXuVw9P.js → chart-BVjaATZw.js} +5 -5
- package/dist/client/assets/{chat-context-tZCX_cqt.js → chat-context-ELO8A2Ar.js} +6 -6
- package/dist/client/assets/{chat-draft-BCeqPSxA.js → chat-draft-tDfZTlxU.js} +1 -1
- package/dist/client/assets/checkbox-iGlb02v9.js +1 -0
- package/dist/client/assets/choose-editor-CWLAiGtz.js +1 -0
- package/dist/client/assets/{cli-auth-success-D39z_FO3.js → cli-auth-success-DyNW_Pmq.js} +1 -1
- package/dist/client/assets/{client-icons-DpcP1bht.js → client-icons-BuRYGGKe.js} +1 -1
- package/dist/client/assets/collapsible-PyJ2NOzW.js +1 -0
- package/dist/client/assets/collection-detail-DXmBNKMr.js +1 -0
- package/dist/client/assets/collection-display-button-Cz5AkuIg.js +1 -0
- package/dist/client/assets/{collection-search-J9Bt25gS.js → collection-search-DM8MkJfo.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DBeauaNS.js → collection-table-wrapper-cBr_X4Jo.js} +1 -1
- package/dist/client/assets/collection-tabs-aKKPIP9M.js +1 -0
- package/dist/client/assets/combobox-CQBdlQef.js +1 -0
- package/dist/client/assets/command-CZcxzTcw.js +1 -0
- package/dist/client/assets/{companion-mcps-section-xmRpNJBK.js → companion-mcps-section-B7qgbnOZ.js} +1 -1
- package/dist/client/assets/connect-D6Wz7x6C.js +8 -0
- package/dist/client/assets/connect-layout-DzSDvFP2.js +1 -0
- package/dist/client/assets/{connection-DD0omVHZ.js → connection-DStV2sLP.js} +1 -1
- package/dist/client/assets/connection-card-CpIJKLp3.js +1 -0
- package/dist/client/assets/connection-detail-junbbrHX.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CHlcdgAK.js → connection-form-helpers-DM_wSOEJ.js} +1 -1
- package/dist/client/assets/connections-DvjnCZJT.js +1 -0
- package/dist/client/assets/{create-organization-dialog-1mI4Ad1B.js → create-organization-dialog-CvXOAbwA.js} +1 -1
- package/dist/client/assets/{decofile-api-BNWbEMR6.js → decofile-api-zRlIvvNL.js} +1 -1
- package/dist/client/assets/{decopilot-BvepxP_-.js → decopilot-BI8eOOPY.js} +2 -2
- package/dist/client/assets/dialog-AoC07APJ.js +1 -0
- package/dist/client/assets/discover-zo2iAYFW.js +1 -0
- package/dist/client/assets/domain-settings-C6kSznIr.js +1 -0
- package/dist/client/assets/download-app-dialog-CsiIuf7j.js +1 -0
- package/dist/client/assets/{drawer-BIjkXMV3.js → drawer-DGzquxJ8.js} +1 -1
- package/dist/client/assets/{editor-D4Ls62vg.js → editor-oL1B7LVJ.js} +1 -1
- package/dist/client/assets/{empty-state-BdiOfgle.js → empty-state-DxJQDjCw.js} +1 -1
- package/dist/client/assets/{empty-state-CyICQznD.js → empty-state-Y08kvU5o.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Dbm_cKaX.js → extract-connection-data-C7Wh9xkI.js} +1 -1
- package/dist/client/assets/{feature-gate-Bp7Cydio.js → feature-gate-C1d068b1.js} +1 -1
- package/dist/client/assets/feature-paywall-BoABVlUQ.js +1 -0
- package/dist/client/assets/file-explorer-DG5Gvb-w.js +2 -0
- package/dist/client/assets/{file-preview-CARebwHJ.js → file-preview-iaqpqUYi.js} +1 -1
- package/dist/client/assets/file-share-button-D0lT5ixf.js +3 -0
- package/dist/client/assets/{file-type-icon-C9Qn36v4.js → file-type-icon-lZW2ows7.js} +1 -1
- package/dist/client/assets/{folder-icon-BLBZBD_a.js → folder-icon-DVG7PK8X.js} +1 -1
- package/dist/client/assets/{form-CSXgIHLz.js → form-CYsJTpNM.js} +1 -1
- package/dist/client/assets/{gateway-client-BuiOykcN.js → gateway-client-CnYYocwu.js} +1 -1
- package/dist/client/assets/general-BiYLEv2o.js +1 -0
- package/dist/client/assets/{github-icon-huXDOAgf.js → github-icon-swNUSpAU.js} +1 -1
- package/dist/client/assets/home-BbjS-573.js +1 -0
- package/dist/client/assets/{hooks-BoX5BC-f.js → hooks-BlE0QZwR.js} +2 -2
- package/dist/client/assets/{hooks-DZOMRp7D.js → hooks-D0dDgrIf.js} +1 -1
- package/dist/client/assets/icon-button-7c--Wy5B.js +1 -0
- package/dist/client/assets/{index-BWpNlf6e.js → index-0-s9o3tr.js} +1 -1
- package/dist/client/assets/index-BDYXeKzz.js +1 -0
- package/dist/client/assets/index-BOHOyAF8.css +1 -0
- package/dist/client/assets/{index-tj4CWdxr.js → index-BUfoj27y.js} +1 -1
- package/dist/client/assets/index-BchRuDAc.js +26 -0
- package/dist/client/assets/{index-BD213WLU.js → index-C97O3ClY.js} +1 -1
- package/dist/client/assets/index-CutV0Ygc.js +1 -0
- package/dist/client/assets/{index-DqT4mG5l.js → index-DGY2nhhI.js} +1 -1
- package/dist/client/assets/index-DItj2r3e.js +5 -0
- package/dist/client/assets/index-DKXWNSdB.js +1 -0
- package/dist/client/assets/{index-Bb-Re5q8.js → index-DllcfiZL.js} +1 -1
- package/dist/client/assets/{index-DiULBiX9.js → index-DyCAAYSx.js} +1 -1
- package/dist/client/assets/index-EcuFIS2a.js +235 -0
- package/dist/client/assets/{index-DWw5wi2G.js → index-Exw_Yjch.js} +1 -1
- package/dist/client/assets/{index-2gtoysbs.js → index-fN6RkMSD.js} +1 -1
- package/dist/client/assets/{index-redirect-BQTLrDGT.js → index-redirect-Bm4zqVUy.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CjWlcBHD.js → infiniteQueryObserver-3RxH1tr-.js} +1 -1
- package/dist/client/assets/infra-billing-CmY2herT.js +1 -0
- package/dist/client/assets/input-BrPa4I3Z.js +8 -0
- package/dist/client/assets/input-Buz_7xoG.js +1 -0
- package/dist/client/assets/input-C5klQNJJ.js +1 -0
- package/dist/client/assets/{integration-icon-BeEdjsn9.js → integration-icon-D3FHJbYu.js} +1 -1
- package/dist/client/assets/{label-BMxIRiEr.js → label-BX1BwzZ4.js} +1 -1
- package/dist/client/assets/{last-preview-page-B_H0ubHa.js → last-preview-page-BSVfE6AT.js} +1 -1
- package/dist/client/assets/layout-030aDjqi.js +1 -0
- package/dist/client/assets/legacy-agents-deep-BblX_qPq.js +1 -0
- package/dist/client/assets/legacy-main-redirect-BDaODIKZ.js +1 -0
- package/dist/client/assets/library-CmkU9fCT.js +161 -0
- package/dist/client/assets/{login-C4Dx9xMO.js → login-BpUdj6Fq.js} +1 -1
- package/dist/client/assets/{markdown-DGWjAeXL.js → markdown-VKlC4_bJ.js} +3 -3
- package/dist/client/assets/{mcp-app-renderer-BTjC7Gse.js → mcp-app-renderer-wS7imsel.js} +2 -2
- package/dist/client/assets/{mcp-oauth-C4khbNJJ.js → mcp-oauth-B7YJNr4N.js} +1 -1
- package/dist/client/assets/members-2ZkimP3H.js +1 -0
- package/dist/client/assets/message-templates-DyGM313y.js +1 -0
- package/dist/client/assets/{mini-report-page-Ci4cxCz8.js → mini-report-page-CYdef8vQ.js} +1 -1
- package/dist/client/assets/mock-board-Dk2mRFCa.js +90 -0
- package/dist/client/assets/{monaco-editor-CMRYkmyb.js → monaco-editor-ChRh_qus.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-PncjnNwy.js → monitoring-stats-row-DirMMFq2.js} +1 -1
- package/dist/client/assets/multi-select-CYKeAXVo.js +1 -0
- package/dist/client/assets/{mustache-CPZS2ebG.js → mustache-BpzqsH6c.js} +1 -1
- package/dist/client/assets/{oauth-callback-CETK2WZB.js → oauth-callback-CLQttSb2.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DqbbngEF.js → oauth-callback-ai-provider-C5AqSldx.js} +1 -1
- package/dist/client/assets/{onboarding-B5zAGi2B.js → onboarding-BYeSkDcE.js} +1 -1
- package/dist/client/assets/optimistic-project-sidebar-views-hB0JGrCs.js +1 -0
- package/dist/client/assets/{org-file-open-context-BCUpiY_R.js → org-file-open-context-D26BTBiX.js} +1 -1
- package/dist/client/assets/{organization-choice-BNulT5zU.js → organization-choice-sm9k2ko4.js} +1 -1
- package/dist/client/assets/orgs-BT6gh3Sc.js +1 -0
- package/dist/client/assets/{page-seo-form-BrHgBXF1.js → page-seo-form-Bhk-2qvu.js} +1 -1
- package/dist/client/assets/{pair-B46EBBjF.js → pair-Bh73YYpe.js} +8 -8
- package/dist/client/assets/plan-ladder-B-hb17ya.js +1 -0
- package/dist/client/assets/{popover-yk_ePqAA.js → popover-Bff85VlI.js} +1 -1
- package/dist/client/assets/post-calendar-BUJnl75O.js +1 -0
- package/dist/client/assets/post-editor-B8ClYTJb.js +1 -0
- package/dist/client/assets/{preview-content-CfbsbElk.js → preview-content-C4FuOpTi.js} +1 -1
- package/dist/client/assets/{preview-dialog-CA2C3DS4.js → preview-dialog-DY1kQ4y_.js} +1 -1
- package/dist/client/assets/primitives-BCCkMTJb.js +1 -0
- package/dist/client/assets/profile-T7ySaz_t.js +1 -0
- package/dist/client/assets/project-app-view-D4HCSkue.js +1 -0
- package/dist/client/assets/project-feed-CRHprIgj.js +1 -0
- package/dist/client/assets/{project-icon-MWmzrrm8.js → project-icon-D_oHwik9.js} +1 -1
- package/dist/client/assets/project-reports-CzVFjEoR.js +1 -0
- package/dist/client/assets/project-tasks-c_cBe8VF.js +1 -0
- package/dist/client/assets/{prompts-4lILOzK9.js → prompts-BuPAnA4R.js} +1 -1
- package/dist/client/assets/record-editor-CHfqyrFA.js +1 -0
- package/dist/client/assets/redirect-editor-BrEMZWAU.js +1 -0
- package/dist/client/assets/registry-4kJYrulU.js +2 -0
- package/dist/client/assets/registry-layout-o90YrVKa.js +27 -0
- package/dist/client/assets/reports-COffkxyo.js +1 -0
- package/dist/client/assets/{reports-BpxYdv2_.js → reports-DEVutxJq.js} +2 -2
- package/dist/client/assets/reports-onboarding-Dt5mvf07.js +1 -0
- package/dist/client/assets/reports-tab-C6PZg0b6.js +2 -0
- package/dist/client/assets/repositories-DBFrDUwl.js +1 -0
- package/dist/client/assets/repository-import-picker-ftg0FRzY.js +1 -0
- package/dist/client/assets/repository-picker-BKj90hIS.js +1 -0
- package/dist/client/assets/{require-capability-CmtOZnXt.js → require-capability-gpVnF6U4.js} +1 -1
- package/dist/client/assets/{required-auth-layout-RoMNnMPO.js → required-auth-layout-BhdxJMdb.js} +1 -1
- package/dist/client/assets/{reset-password-BeUL8IgX.js → reset-password-DD2ixVIR.js} +1 -1
- package/dist/client/assets/resizable-wU1MiASn.js +1 -0
- package/dist/client/assets/review-settings-3uLiRV1J.js +1 -0
- package/dist/client/assets/{rich-text-link-control-CHsxXHIo.js → rich-text-link-control-Bn-QsIS6.js} +2 -2
- package/dist/client/assets/roles-DX_ap2B0.js +1 -0
- package/dist/client/assets/route-Bdqr734y.js +1 -0
- package/dist/client/assets/route-Cg6AOuOY.js +1 -0
- package/dist/client/assets/route-DGhKwFXa.js +1 -0
- package/dist/client/assets/route-page-header-DKm5kHtX.js +1 -0
- package/dist/client/assets/runnable-block-editor-9i5DpxOA.js +16 -0
- package/dist/client/assets/{sandbox-lifecycle-context-C7VKOJoV.js → sandbox-lifecycle-context-BHn9YFEW.js} +2 -2
- package/dist/client/assets/{schema-1zAO-l7e.js → schema-FDf70VFI.js} +1 -1
- package/dist/client/assets/{scroll-area-C-wtbVS1.js → scroll-area-DMmJ7JtI.js} +1 -1
- package/dist/client/assets/search-input-BHVk6m6A.js +1 -0
- package/dist/client/assets/search-toggle-CCC7TvwN.js +1 -0
- package/dist/client/assets/secrets-BNtrMaDs.js +1 -0
- package/dist/client/assets/sections-editor-HtflyYMM.js +2 -0
- package/dist/client/assets/select-DBfOOW9i.js +1 -0
- package/dist/client/assets/select-model-2C5Fdpra.js +1 -0
- package/dist/client/assets/seo-editor-CFULobkJ.js +1 -0
- package/dist/client/assets/separator-8fswVHAH.js +1 -0
- package/dist/client/assets/settings-tab-s3d5MtS-.js +5 -0
- package/dist/client/assets/{sheet-i72Qx7sL.js → sheet-DWSThpSZ.js} +1 -1
- package/dist/client/assets/shell-layout-BQnbNNla.js +1 -0
- package/dist/client/assets/{shell-layout-CuFt8bor.css → shell-layout-CE2Eihra.css} +1 -1
- package/dist/client/assets/sidebar-CoC2_Nad.js +1 -0
- package/dist/client/assets/{skill-preview-gfYVdSdM.js → skill-preview-QgrtYNqp.js} +1 -1
- package/dist/client/assets/skills-BVINvlqv.js +1 -0
- package/dist/client/assets/sso-CSqM_F3b.js +1 -0
- package/dist/client/assets/store-DBNpNTVQ.js +1 -0
- package/dist/client/assets/store-registry-DLmFNBij.js +2 -0
- package/dist/client/assets/{switch-BQFtt3BH.js → switch-BIfmgDHS.js} +1 -1
- package/dist/client/assets/synced-repos-CG_pm_Ch.js +1 -0
- package/dist/client/assets/{table-6I6YKvFY.js → table-CEVOOGGz.js} +1 -1
- package/dist/client/assets/{tabs-CLziM0Ww.js → tabs-Dd0IWElc.js} +1 -1
- package/dist/client/assets/{task-board-DrUf5p-Z.js → task-board-Dip4Wu9j.js} +1 -1
- package/dist/client/assets/task-route-SKFoAFiU.js +1 -0
- package/dist/client/assets/task-status-k7EGfTLN.js +1 -0
- package/dist/client/assets/taskboard-analytics-C3lk9wb7.js +1 -0
- package/dist/client/assets/tasks-Sl_c9zFF.js +1 -0
- package/dist/client/assets/{tasks-Drgd6az8.js → tasks-ebQIYdwz.js} +4 -4
- package/dist/client/assets/textarea-D5v3ol7T.js +1 -0
- package/dist/client/assets/thread-button-C3YUAV-G.js +1 -0
- package/dist/client/assets/{thread-intent-F-sZEflj.js → thread-intent-CTSjhfEo.js} +1 -1
- package/dist/client/assets/thread-route-B57JfaL5.js +1 -0
- package/dist/client/assets/thread-route-CHwqHPf_.js +1 -0
- package/dist/client/assets/thread-sheet-body-Hqh1hVbj.js +1 -0
- package/dist/client/assets/toggle-group-CwAn2mKr.js +1 -0
- package/dist/client/assets/toolbar-icon-button-ChZE-2zp.js +1 -0
- package/dist/client/assets/{tooltip-DV2xHesQ.js → tooltip-nr5oS_bm.js} +1 -1
- package/dist/client/assets/{track-ZuOMvhd2.js → track-BDYWN4z3.js} +1 -1
- package/dist/client/assets/{types-27TVsPN_.js → types-7UQ7SDxU.js} +3 -3
- package/dist/client/assets/usage-stats-YafP0g9G.js +1 -0
- package/dist/client/assets/use-ai-providers-D-abiIwe.js +1 -0
- package/dist/client/assets/use-automations-D_y1YNke.js +1 -0
- package/dist/client/assets/{use-autosave-DOzyZumC.js → use-autosave-z8cIzzdm.js} +1 -1
- package/dist/client/assets/use-connect-companion-jQzCS0Na.js +1 -0
- package/dist/client/assets/use-connection-BKZRi94S.js +1 -0
- package/dist/client/assets/{use-copy-C_ctOeuP.js → use-copy-Cp_DyXH6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D1w9d4ex.js → use-create-virtual-mcp-nvoTomrD.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-onM9TTf8.js → use-date-fns-locale-CNoKSvxx.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DqyNKPJM.js → use-debounced-autosave-B0HBbqeX.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B9nG3bW5.js → use-debounced-value-BgYHDTDk.js} +1 -1
- package/dist/client/assets/use-deco-credits-CqbkXgA9.js +1 -0
- package/dist/client/assets/{use-decopilot-events-BpuQrfKN.js → use-decopilot-events-qaEKsixC.js} +1 -1
- package/dist/client/assets/use-delete-connection-CqvqqWgS.js +1 -0
- package/dist/client/assets/{use-deployment-admin-BVfgEagI.js → use-deployment-admin-DzkF6L4b.js} +1 -1
- package/dist/client/assets/{use-entitlements-Dl7pAsQ5.js → use-entitlements-kPr6KRf9.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-mcfOeAAq.js → use-fast-preview-draft-url-BBBDyhsD.js} +1 -1
- package/dist/client/assets/use-file-configs-6ygOocDG.js +1 -0
- package/dist/client/assets/use-in-settings-BCDqA2EC.js +1 -0
- package/dist/client/assets/{use-infinite-scroll-PhBGPm8H.js → use-infinite-scroll-D0T36z_V.js} +1 -1
- package/dist/client/assets/use-join-requests-BBovhUnp.js +1 -0
- package/dist/client/assets/use-main-panel-tabs-BghanH6r.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-h4sAecTI.js +1 -0
- package/dist/client/assets/{use-mcp-client-e_hCatGm.js → use-mcp-client-B_gcvvCy.js} +6 -6
- package/dist/client/assets/{use-mcp-prompts-DJRXjL4_.js → use-mcp-prompts-DfSKL4Gu.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-g86k4oib.js → use-mcp-tools-DC47roTz.js} +1 -1
- package/dist/client/assets/use-members-C6brpkJ1.js +1 -0
- package/dist/client/assets/{use-mobile-hIijCK0k.js → use-mobile-BZ15DgEB.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-B8SXI0oO.js +1 -0
- package/dist/client/assets/use-open-billing-url-BAg3ZeFq.js +1 -0
- package/dist/client/assets/use-org-auth-client-8fDIgHEZ.js +1 -0
- package/dist/client/assets/use-org-fs-Bf6n51Xm.js +1 -0
- package/dist/client/assets/use-org-repo-syncs-CnBqiATM.js +8 -0
- package/dist/client/assets/{use-org-sso-BvfIL0yq.js → use-org-sso-QeqdMaIa.js} +1 -1
- package/dist/client/assets/use-organization-roles-tuKknI1K.js +1 -0
- package/dist/client/assets/use-organization-settings-DvtBymY3.js +1 -0
- package/dist/client/assets/{use-panel-navigate-WrD0KEYx.js → use-panel-navigate-IItrbgmN.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-WwnxvZuP.js +1 -0
- package/dist/client/assets/use-project-scope-CCxyXvEU.js +1 -0
- package/dist/client/assets/use-registry-connections-Bd4wJHbx.js +1 -0
- package/dist/client/assets/use-releases-DZvNer89.js +1 -0
- package/dist/client/assets/use-reports-diagnostic-BeTEI2FZ.js +1 -0
- package/dist/client/assets/{use-route-default-main-Djaj_cL9.js → use-route-default-main-BhbKsXCz.js} +1 -1
- package/dist/client/assets/use-secrets-Bq9yyXHE.js +1 -0
- package/dist/client/assets/{use-section-preview-base-BOFovHh4.js → use-section-preview-base--XbKHK2U.js} +1 -1
- package/dist/client/assets/{use-session-runtime-BR1aW1y5.js → use-session-runtime-B5wMaHtP.js} +1 -1
- package/dist/client/assets/use-tags-Do2tDPSO.js +1 -0
- package/dist/client/assets/use-task-board-analytics-MK_Z2cUq.js +1 -0
- package/dist/client/assets/use-task-metadata-CQjLXps1.js +1 -0
- package/dist/client/assets/use-thread-outputs-DYukUH5N.js +1 -0
- package/dist/client/assets/{use-view-mode-B0LeaJg7.js → use-view-mode-BEPkb8x0.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-Ji9vcgUj.js +1 -0
- package/dist/client/assets/useInfiniteQuery-CzQJkRT9.js +1 -0
- package/dist/client/assets/{useQueries-C-SV8tD7.js → useQueries-D0xhxw7a.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D9iG0Y5m.js +1 -0
- package/dist/client/assets/{users-BiOPZ43X.js → users-DzwkCv2F.js} +1 -1
- package/dist/client/assets/utils-y2q6u6PK.js +4 -0
- package/dist/client/assets/variant-calendar-D1R9xk7D.js +1 -0
- package/dist/client/assets/{variant-matcher-override-BFQoXu82.js → variant-matcher-override-qHzE4baz.js} +1 -1
- package/dist/client/assets/view-mode-toggle-Ca0bFull.js +1 -0
- package/dist/client/assets/{virtual-mcp-ldxphi5G.js → virtual-mcp-Dji-1ojO.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +3 -3
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/Check-B3RSsr_D.js +0 -1
- package/dist/client/assets/ChevronRight-USKkhEpL.js +0 -1
- package/dist/client/assets/ChevronSelectorVertical-DpRb2z1l.js +0 -1
- package/dist/client/assets/Database01-C0YJpjc3.js +0 -1
- package/dist/client/assets/DotsVertical-CsjwfYzf.js +0 -1
- package/dist/client/assets/File02-BvR-HYxK.js +0 -1
- package/dist/client/assets/GitBranch01-rWb2SJK9.js +0 -1
- package/dist/client/assets/HardDrive-DNTPLPT4.js +0 -1
- package/dist/client/assets/MessageCircle01-DBcg2aiD.js +0 -1
- package/dist/client/assets/Printer-CvyxF9Jo.js +0 -1
- package/dist/client/assets/Shield01-CqB4I7qm.js +0 -1
- package/dist/client/assets/Tool01-DouqPjim.js +0 -1
- package/dist/client/assets/XClose-BgzK-Dwz.js +0 -1
- package/dist/client/assets/ZoomOut-BPxprY2s.js +0 -1
- package/dist/client/assets/add-connection-dialog-DZjTm9W3.js +0 -1
- package/dist/client/assets/agent-analytics-DmvdLg8B.js +0 -2
- package/dist/client/assets/agent-app-BvmFdS4C.js +0 -1
- package/dist/client/assets/agent-assets-czUGY90q.js +0 -1
- package/dist/client/assets/agent-automation-C5Kr5Oj3.js +0 -20
- package/dist/client/assets/agent-automations-D-3-Opoc.js +0 -1
- package/dist/client/assets/agent-connect-sources-CjhmYssY.js +0 -1
- package/dist/client/assets/agent-deck-BC5MWVm-.js +0 -1
- package/dist/client/assets/agent-e2e-DkL4Ltr6.js +0 -1
- package/dist/client/assets/agent-experiments--rXT-2aB.js +0 -1
- package/dist/client/assets/agent-file-C3XkHLMm.js +0 -1
- package/dist/client/assets/agent-hosting-DaIfm8Hu.js +0 -1
- package/dist/client/assets/agent-icon-CczrFEe7.js +0 -1
- package/dist/client/assets/agent-library-file-Dji653pU.js +0 -1
- package/dist/client/assets/agent-monitor-C-HIyaF_.js +0 -1
- package/dist/client/assets/agent-overview-cm15sxNU.js +0 -1
- package/dist/client/assets/agent-settings-XmhY1FOi.js +0 -1
- package/dist/client/assets/agent-site-editor-code-_Tz57RqE.js +0 -2
- package/dist/client/assets/agent-site-editor-content-DOAcxz0t.js +0 -2
- package/dist/client/assets/agent-site-editor-preview-mg5Q6hoW.js +0 -518
- package/dist/client/assets/agent-view-ClMILC98.js +0 -1
- package/dist/client/assets/agents-list-rKFF5b3o.js +0 -1
- package/dist/client/assets/anchors-yqDzZN4K.js +0 -1
- package/dist/client/assets/api-keys-AIfL76r6.js +0 -1
- package/dist/client/assets/api-keys-B6ry5Bc6.js +0 -1
- package/dist/client/assets/app-editor-BZKFeBmU.js +0 -1
- package/dist/client/assets/asset-utils-DhbLEVKo.js +0 -1
- package/dist/client/assets/auth-entry-CwWjlqGu.js +0 -1
- package/dist/client/assets/automation-list-row-Btr-Kty6.js +0 -1
- package/dist/client/assets/automation-runs-CnOOOwZJ.js +0 -1
- package/dist/client/assets/automations-CtLmB1Eo.js +0 -1
- package/dist/client/assets/badge-Bu51Hlti.js +0 -1
- package/dist/client/assets/block-document-BLCekKXO.js +0 -3
- package/dist/client/assets/breadcrumb-Dhdru7Jh.js +0 -1
- package/dist/client/assets/build-improve-prompt-doc-Cedp3vV1.js +0 -2
- package/dist/client/assets/bulk-category-panel-D3c_qJDk.js +0 -1
- package/dist/client/assets/calendar-DIQx67oO.js +0 -1
- package/dist/client/assets/capability-load-error-CJMvYDf4.js +0 -1
- package/dist/client/assets/cards-BVw8sRdW.js +0 -8
- package/dist/client/assets/category-editor-C7sRrVfl.js +0 -1
- package/dist/client/assets/checkbox-jLf7fBuW.js +0 -1
- package/dist/client/assets/choose-editor-Cbu3-nVC.js +0 -1
- package/dist/client/assets/collapsible-CTgXdVQa.js +0 -1
- package/dist/client/assets/collection-detail-BF7WM7Gn.js +0 -1
- package/dist/client/assets/collection-display-button-C-4xB6xx.js +0 -1
- package/dist/client/assets/collection-tabs-CrXIJeNf.js +0 -1
- package/dist/client/assets/combobox-BHrqHmge.js +0 -1
- package/dist/client/assets/command-B-XD29Nx.js +0 -1
- package/dist/client/assets/command-palette-store-DK-56E2K.js +0 -1
- package/dist/client/assets/connect-D4qCE3TM.js +0 -8
- package/dist/client/assets/connect-layout-DGO84ImO.js +0 -1
- package/dist/client/assets/connection-card-fcMCwbTh.js +0 -1
- package/dist/client/assets/connection-detail-DS015J4e.js +0 -1
- package/dist/client/assets/connections-C98FMYyY.js +0 -1
- package/dist/client/assets/dialog-llvhXw2o.js +0 -1
- package/dist/client/assets/discover-DNPHmIfF.js +0 -1
- package/dist/client/assets/domain-settings-CXxEmIjB.js +0 -1
- package/dist/client/assets/download-app-dialog-D_4eQbbs.js +0 -1
- package/dist/client/assets/dropdown-menu-C5iafa8S.js +0 -1
- package/dist/client/assets/feature-paywall-DEy2mpV2.js +0 -1
- package/dist/client/assets/file-explorer-Bs7B2-rr.js +0 -2
- package/dist/client/assets/file-share-button-Dk1ugrdV.js +0 -3
- package/dist/client/assets/general-BYFfG0fF.js +0 -1
- package/dist/client/assets/home-DTaaCW3K.js +0 -1
- package/dist/client/assets/index-2eKztu7k.js +0 -5
- package/dist/client/assets/index-BH7uCYoT.js +0 -1
- package/dist/client/assets/index-CSd_k8Np.js +0 -1
- package/dist/client/assets/index-CiMUXLco.js +0 -26
- package/dist/client/assets/index-CpNTsElB.css +0 -1
- package/dist/client/assets/index-D4RUT3q0.js +0 -1
- package/dist/client/assets/index-D_X-LIyA.js +0 -1
- package/dist/client/assets/index-Dc7hzqoi.js +0 -235
- package/dist/client/assets/infra-billing-D6jrbNxA.js +0 -1
- package/dist/client/assets/input-DXlaTX4w.js +0 -1
- package/dist/client/assets/input-D_FfvHr0.js +0 -8
- package/dist/client/assets/input-uIV5S_EX.js +0 -1
- package/dist/client/assets/layout-Dli4i2a0.js +0 -1
- package/dist/client/assets/legacy-agents-deep-CoiLV3QJ.js +0 -1
- package/dist/client/assets/legacy-main-redirect-BZ4nzqkQ.js +0 -1
- package/dist/client/assets/library-Dste3SFA.js +0 -161
- package/dist/client/assets/members-CRtKrUle.js +0 -1
- package/dist/client/assets/message-templates-B8kOo0Kk.js +0 -1
- package/dist/client/assets/mock-board-DRa60E6i.js +0 -90
- package/dist/client/assets/multi-select-DzAZ8Rb8.js +0 -1
- package/dist/client/assets/optimistic-project-sidebar-views-CrZ9OeIk.js +0 -1
- package/dist/client/assets/orgs-B1TBklWZ.js +0 -1
- package/dist/client/assets/plan-ladder-B2pv9Y73.js +0 -1
- package/dist/client/assets/post-calendar-Bx8YiCbs.js +0 -1
- package/dist/client/assets/post-editor-B1fD7o8C.js +0 -1
- package/dist/client/assets/primitives-JiGRyPkw.js +0 -1
- package/dist/client/assets/profile-CDR0JVtv.js +0 -1
- package/dist/client/assets/project-app-view-8VWdrWMf.js +0 -1
- package/dist/client/assets/project-feed-ChJRKxhk.js +0 -1
- package/dist/client/assets/project-reports-D31utlHg.js +0 -1
- package/dist/client/assets/project-tasks-D2AAgqxo.js +0 -1
- package/dist/client/assets/record-editor-DPAL8Tq5.js +0 -1
- package/dist/client/assets/redirect-editor-EPs_GX-_.js +0 -1
- package/dist/client/assets/registry-Dw8UrRRZ.js +0 -2
- package/dist/client/assets/registry-layout-CC2lewiS.js +0 -27
- package/dist/client/assets/reports-Ch9UvBcS.js +0 -1
- package/dist/client/assets/reports-onboarding-Dhm8IBuD.js +0 -1
- package/dist/client/assets/reports-tab-BJWrZp37.js +0 -2
- package/dist/client/assets/repositories-CMIGVJwC.js +0 -1
- package/dist/client/assets/repository-import-picker-DhVniDI2.js +0 -1
- package/dist/client/assets/repository-picker-BkoSI-jm.js +0 -1
- package/dist/client/assets/resizable-Bt7dvMCc.js +0 -1
- package/dist/client/assets/review-settings-Cx_Yzx40.js +0 -1
- package/dist/client/assets/roles-BNleKwt9.js +0 -1
- package/dist/client/assets/route-CHqG9ihd.js +0 -1
- package/dist/client/assets/route-DqJoK5dW.js +0 -1
- package/dist/client/assets/route-x8jgkj5T.js +0 -1
- package/dist/client/assets/runnable-block-editor-xmOnaiFL.js +0 -16
- package/dist/client/assets/search-input-Pobww52G.js +0 -1
- package/dist/client/assets/secrets-BF5nuoR4.js +0 -1
- package/dist/client/assets/sections-editor-B1LpXw4X.js +0 -2
- package/dist/client/assets/select-BkKPcZFe.js +0 -1
- package/dist/client/assets/select-model-DPv-zVVj.js +0 -1
- package/dist/client/assets/seo-editor-9G7mQFJ5.js +0 -1
- package/dist/client/assets/settings-tab-D1V5Uszb.js +0 -5
- package/dist/client/assets/shell-layout-Ce0aCJuX.js +0 -1
- package/dist/client/assets/sidebar-C5KRz1Pj.js +0 -1
- package/dist/client/assets/skills-CgTiBPyO.js +0 -1
- package/dist/client/assets/sso-BK-aRT5P.js +0 -1
- package/dist/client/assets/store-Nm6KtwbD.js +0 -1
- package/dist/client/assets/store-registry-Cs6bPPkP.js +0 -2
- package/dist/client/assets/synced-repos-B1z4DDCt.js +0 -1
- package/dist/client/assets/task-route-BCTCy27Q.js +0 -1
- package/dist/client/assets/task-status-DhCT2ly_.js +0 -1
- package/dist/client/assets/taskboard-analytics-Cf1r1f7I.js +0 -1
- package/dist/client/assets/tasks-BNvHI7hJ.js +0 -1
- package/dist/client/assets/textarea-BU6xemAP.js +0 -1
- package/dist/client/assets/thread-route-BBf64Mwk.js +0 -1
- package/dist/client/assets/thread-route-BSYRqZDg.js +0 -1
- package/dist/client/assets/thread-sheet-body-B4OUWlMn.js +0 -1
- package/dist/client/assets/toggle-group-BiU_UDOq.js +0 -1
- package/dist/client/assets/toolbar-icon-button-PuQFE8Y9.js +0 -1
- package/dist/client/assets/usage-stats-vMRDbAUM.js +0 -1
- package/dist/client/assets/use-ai-providers-BnF5Rw_n.js +0 -1
- package/dist/client/assets/use-automations-Bo0S3g8m.js +0 -1
- package/dist/client/assets/use-connect-companion-CClQCUMS.js +0 -1
- package/dist/client/assets/use-connection-Ba04fHwa.js +0 -1
- package/dist/client/assets/use-deco-credits-BGBshlLi.js +0 -1
- package/dist/client/assets/use-delete-connection-Cns6x8UC.js +0 -1
- package/dist/client/assets/use-file-configs-DYGSdjth.js +0 -1
- package/dist/client/assets/use-join-requests-DjeVFQr9.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-sSRGo66A.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-I377R0Kg.js +0 -1
- package/dist/client/assets/use-members-DPYHJDe2.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-C8pu0B4z.js +0 -1
- package/dist/client/assets/use-open-billing-url-Df7K1DCF.js +0 -1
- package/dist/client/assets/use-org-auth-client-DbPU3bA-.js +0 -1
- package/dist/client/assets/use-org-fs-Du-ErRPs.js +0 -1
- package/dist/client/assets/use-org-notice-CyiiFkRG.js +0 -1
- package/dist/client/assets/use-organization-roles-FAEtbpE5.js +0 -1
- package/dist/client/assets/use-organization-settings-CKbX2SdA.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-DWzPH-Sc.js +0 -1
- package/dist/client/assets/use-project-scope-DU0-JxYr.js +0 -1
- package/dist/client/assets/use-registry-connections-SLFMHpqj.js +0 -1
- package/dist/client/assets/use-releases-CFNTwgY3.js +0 -1
- package/dist/client/assets/use-reports-diagnostic-8BvW2in8.js +0 -1
- package/dist/client/assets/use-secrets-DVry--sz.js +0 -1
- package/dist/client/assets/use-tags-CZXCbbwL.js +0 -1
- package/dist/client/assets/use-task-board-analytics-Ci1AhxvH.js +0 -1
- package/dist/client/assets/use-task-metadata-Dt9l5S_a.js +0 -1
- package/dist/client/assets/use-thread-outputs-Dq-RN0P_.js +0 -1
- package/dist/client/assets/use-virtual-mcp-DkK7ErtB.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CspLjV7h.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BiQYAhJn.js +0 -1
- package/dist/client/assets/utils-DsvmRe8M.js +0 -4
- package/dist/client/assets/variant-calendar-DImnsJnP.js +0 -1
- package/dist/client/assets/view-mode-toggle-DvGhnpsV.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{bJ as ue,bK as de,bL as he,bM as fe,bN as pe,bO as _,bP as g,bQ as me,bR as _e,bS as we,bT as M,bU as ge,bV as L,bW as Te,bX as q,bY as ye,bZ as D,b_ as ke,b$ as ve,c0 as Se,c1 as W,c2 as be,c3 as Ce,c4 as Re,c5 as se,c6 as Ie,c7 as Ee,c8 as qe,aF as Pe,c9 as $e,ca as Me,cb as A,cc as Ae,cd as He,ce as Oe,cf as Ue,cg as xe,ch as Ne,ci as je,cj as Fe,ck as Le,cl as De,cm as Ve,cn as Qe,co as ze,aB as U,cp as Je,cq as N,c as Q,z as re,K as z,m as We,x as Ke}from"./index-Dc7hzqoi.js";import{U as P,b as H,c as K}from"./auth-DhzAq_9m.js";function x(a){return!!a._zod}function C(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(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 Ge(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 G(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=C(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{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(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} 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 _(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(_e,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 _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(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 _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(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),_.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)||ge(o)?this._onresponse(o):L(o)?this._onrequest(o,n):Te(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=_.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(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={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:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(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=_.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 _?n:new _(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 _(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 _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=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 w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=C(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{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},ke,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},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=B(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"&&L(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(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 _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(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 _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(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];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=Ce();const et=be(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}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 rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(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 _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(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 at(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 nt(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 it=class extends Ze{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 st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=C(Le,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=C(D,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=C(De,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=C(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=C(D,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?Qe:ze,y=C(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.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:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.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){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(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},Ae,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},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,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=se,s){if(this.isToolTaskRequired(e.name))throw new _(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 _(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 _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(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},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=U(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=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const X=10,ut=13,I=32;function F(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=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
|
|
1
|
+
import{c3 as ue,c4 as de,c5 as he,c6 as fe,c7 as pe,c8 as _,c9 as g,ca as me,cb as _e,cc as we,cd as M,ce as ge,cf as D,cg as Te,ch as q,ci as ye,cj as L,ck as ke,cl as ve,cm as Se,cn as W,co as Ce,cp as be,cq as Re,cr as se,cs as Ie,ct as Ee,cu as qe,b3 as Pe,cv as $e,cw as Me,cx as A,cy as Ae,cz as He,cA as Oe,cB as Ue,cC as xe,cD as Ne,cE as je,cF as Fe,cG as De,cH as Le,cI as Ve,cJ as ze,cK as Qe,aW as U,cL as Je,cM as N,c as z,m as We,K as Q,z as Ke,D as re}from"./index-EcuFIS2a.js";import{U as P,b as H,c as K}from"./auth-BBW3DF0r.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ue(a,e):a.safeParse(e)}function oe(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 Ge(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 G(a){const t=oe(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ge(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function B(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Be=6e4;class Ze{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(de,t=>{this._oncancel(t)}),this.setNotificationHandler(he,t=>{this._onprogress(t)}),this.setRequestHandler(fe,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(me,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} 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 _(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(_e,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 _(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(we,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new _(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 _(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof _?r:new _(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),_.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)||ge(o)?this._onresponse(o):D(o)?this._onrequest(o,n):Te(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=_.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(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ye(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(g.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};o&&!m.relatedTask&&(m.relatedTask={taskId:o});const T=m.relatedTask?.taskId??o;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={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:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new _(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=_.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 _?n:new _(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(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 _(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[q]:u}});const T=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 w=c instanceof _?c:new _(g.RequestTimeout,String(c));l(w)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const w=b(t,c.result);w.success?p(w.data):l(w.error)}catch(w){l(w)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??Be,k=()=>T(_.fromError(g.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=w=>{const v=this._responseHandlers.get(f);v?v(w):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(f),l(w)})}else this._transport.send(m,{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},ke,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},ve,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Se,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=B(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=B(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"&&D(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new _(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 _(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new _(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 _(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=W.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new _(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=W.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function Z(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ye(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];Z(n)&&Z(o)?t[r]={...n,...o}:t[r]=o}return t}var Xe=be();const et=Ce(Xe);function tt(){const a=new et({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Re(a),a}class st{constructor(e){this._ajv=e??tt()}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 rt{constructor(e){this._client=e}async*callToolStream(e,t=se,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(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 _(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function ot(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 at(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 nt(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 it=class extends Ze{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 st,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Ie,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ee,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",qe,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new rt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ye(this._capabilities,e)}setRequestHandler(e,t){const r=oe(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=nt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(g.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(g.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=b(L,T);if(!c.success){const w=c.error instanceof Error?c.error.message:String(c.error);throw new _(g.InvalidParams,`Invalid task creation result: ${w}`)}return c.data}const y=b(Le,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&k.action==="accept"&&k.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{O(h,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Ve,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new _(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const k=b(L,f);if(!k.success){const h=k.error instanceof Error?k.error.message:String(k.error);throw new _(g.InvalidParams,`Invalid task creation result: ${h}`)}return k.data}const T=d.tools||d.toolChoice?ze:Qe,y=b(T,f);if(!y.success){const k=y.error instanceof Error?y.error.message:String(y.error);throw new _(g.InvalidParams,`Invalid sampling result: ${k}`)}return y.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:Pe,capabilities:this._capabilities,clientInfo:this._clientInfo}},$e,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Me.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){ot(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&at(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},Ae,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},He,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Ue,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},xe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,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=se,s){if(this.isToolTaskRequired(e.name))throw new _(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 _(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 _(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(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},je,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Fe.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const j=a=>[{type:"text",text:a}];function ct(a){const e=U(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=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:j(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:j(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:j(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function V(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function lt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...V(e.headers),...V(s.headers)}:e.headers};return a(t,r)}:a}class Y extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const X=10,ut=13,I=32;function F(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=F,onError:t=F,onRetry:s=F,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),o.length===0){const v=f(h);v!==""&&o.push(v);return}if(h.indexOf(`
|
|
2
2
|
`)===-1&&h.indexOf("\r")===-1){o.push(h);return}o.push(h);const c=o.join("");o.length=0;const w=f(c);w!==""&&o.push(w)}function f(h){let c=0;if(h.indexOf("\r")===-1){let w=h.indexOf(`
|
|
3
3
|
`,c);for(;w!==-1;){if(c===w){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=w+1,w=h.indexOf(`
|
|
4
|
-
`,c);continue}const v=h.charCodeAt(c);if(ee(h,c,v)){const S=h.charCodeAt(c+5)===I?c+6:c+5,
|
|
5
|
-
`,c);continue}u=p===0?
|
|
6
|
-
${
|
|
4
|
+
`,c);continue}const v=h.charCodeAt(c);if(ee(h,c,v)){const S=h.charCodeAt(c+5)===I?c+6:c+5,C=h.slice(S,w);if(p===0&&h.charCodeAt(w+1)===X){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=w+2,w=h.indexOf(`
|
|
5
|
+
`,c);continue}u=p===0?C:`${u}
|
|
6
|
+
${C}`,p++}else te(h,c,v)?l=h.slice(h.charCodeAt(c+6)===I?c+7:c+6,w)||void 0:m(h,c,w);c=w+1,w=h.indexOf(`
|
|
7
7
|
`,c)}return h.slice(c)}for(;c<h.length;){const w=h.indexOf("\r",c),v=h.indexOf(`
|
|
8
8
|
`,c);let S=-1;if(w!==-1&&v!==-1?S=w<v?w:v:w!==-1?w===h.length-1?S=-1:S=w:v!==-1&&(S=v),S===-1)break;m(h,c,S),c=S+1,h.charCodeAt(c-1)===ut&&h.charCodeAt(c)===X&&c++}return h.slice(c)}function m(h,c,w){if(c===w){y();return}const v=h.charCodeAt(c);if(ee(h,c,v)){const E=h.charCodeAt(c+5)===I?c+6:c+5,J=h.slice(E,w);u=p===0?J:`${u}
|
|
9
|
-
${J}`,p++;return}if(te(h,c,v)){l=h.slice(h.charCodeAt(c+6)===I?c+7:c+6,w)||void 0;return}if(v===105&&h.charCodeAt(c+1)===100&&h.charCodeAt(c+2)===58){const E=h.slice(h.charCodeAt(c+3)===I?c+4:c+3,w);i=E.includes("\0")?void 0:E;return}if(v===58){if(r){const E=h.slice(c,w);r(E.slice(h.charCodeAt(c+1)===I?2:1))}return}const S=h.slice(c,w),
|
|
10
|
-
${c}`,p++;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?s(parseInt(c,10)):t(new Y(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:w}));break;default:t(new Y(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:c,line:w}));break}}function y(){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0}function k(h={}){if(h.consume&&o.length>0){const c=o.join("");m(c,0,c.length)}n=!0,i=void 0,u="",p=0,l=void 0,o.length=0}return{feed:d,reset:k}}function ee(a,e,t){return t===100&&a.charCodeAt(e+1)===97&&a.charCodeAt(e+2)===116&&a.charCodeAt(e+3)===97&&a.charCodeAt(e+4)===58}function te(a,e,t){return t===101&&a.charCodeAt(e+1)===118&&a.charCodeAt(e+2)===101&&a.charCodeAt(e+3)===110&&a.charCodeAt(e+4)===116&&a.charCodeAt(e+5)===58}class ht extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(o){r=dt({onEvent:n=>{o.enqueue(n)},onError(n){e==="terminate"?o.error(n):typeof e=="function"&&e(n)},onRetry:t,onComment:s})},transform(o){r.feed(o)}})}}const ft={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $ extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let pt=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=lt(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??ft}async _authThenStart(){if(!this._authProvider)throw new P("No auth provider");let e;try{e=await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new P;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=V(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),t&&s.set("last-event-id",t);const r=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new $(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(s){throw this.onerror?.(s),s}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(s,e),r)}_scheduleReconnection(e,t=0){const s=this._reconnectionOptions.maxRetries;if(t>=s){this.onerror?.(new Error(`Maximum reconnection attempts (${s}) exceeded.`));return}const r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,s){if(!e)return;const{onresumptiontoken:r,replayMessageId:o}=t;let n,i=!1,u=!1;(async()=>{try{const l=e.pipeThrough(new TextDecoderStream).pipeThrough(new ht({onRetry:m=>{this._serverRetryMs=m}})).getReader();for(;;){const{value:m,done:T}=await l.read();if(T)break;if(m.id&&(n=m.id,i=!0,r?.(m.id)),!!m.data&&(!m.event||m.event==="message"))try{const y=N.parse(JSON.parse(m.data));M(y)&&(u=!0,o!==void 0&&(y.id=o)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(m){this.onerror?.(new Error(`Failed to reconnect: ${m instanceof Error?m.message:String(m)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new P("No auth provider");if(await H(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:s,onresumptiontoken:r}=t||{};if(s){this._startOrAuthSse({resumptionToken:s,replayMessageId:L(e)?e.id:void 0}).catch(f=>this.onerror?.(f));return}const o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");const n={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,n),u=i.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!i.ok){const f=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:m,scope:T}=K(i);if(this._resourceMetadataUrl=m,this._scope=T,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P;return this._hasCompletedAuthFlow=!0,this.send(e)}if(i.status===403&&this._authProvider){const{resourceMetadataUrl:m,scope:T,error:y}=K(i);if(y==="insufficient_scope"){const k=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===k)throw new $(403,"Server returned 403 after trying upscoping");if(T&&(this._scope=T),m&&(this._resourceMetadataUrl=m),this._lastUpscopingHeader=k??void 0,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new P;return this.send(e)}}throw new $(i.status,`Error POSTing to endpoint: ${f}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,i.status===202){await i.body?.cancel(),Je(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(f=>this.onerror?.(f));return}const l=(Array.isArray(e)?e:[e]).filter(f=>"method"in f&&"id"in f&&f.id!==void 0).length>0,d=i.headers.get("content-type");if(l)if(d?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(d?.includes("application/json")){const f=await i.json(),m=Array.isArray(f)?f.map(T=>N.parse(T)):[N.parse(f)];for(const T of m)this.onmessage?.(T)}else throw await i.body?.cancel(),new $(-1,`Unexpected content type: ${d}`);else await i.body?.cancel()}catch(s){throw this.onerror?.(s),s}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,t);if(await s.body?.cancel(),!s.ok&&s.status!==405)throw new $(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};class mt extends pt{constructor(e,t){super(e,t)}send(e,t){const s=_t(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function _t(a){const e=a;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"studio-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const wt={name:"studio-sdk",version:"1.0.0"};function gt(a,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either studioUrl or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,o=a?`${r}/mcp/${a}`:`${r}/mcp`;return new URL(o,s).href}async function ae({connectionId:a,orgId:e,orgSlug:t,token:s,studioUrl:r,meshUrl:o,mcpUrl:n}){const i=U({studioUrl:r,meshUrl:o}),u=z.mcpClient(e,a??"self",s??"",n??i??"");if(!n&&(!a||a===Ke))return ct({orgSlug:t,token:s,studioUrl:i,toJSONString:`mcp-client:${u.join(":")}`});const p=n??gt(a,t,i),l=new it(wt,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),d=new mt(new URL(p),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});return await l.connect(d),l.toJSON=()=>`mcp-client:${u.join(":")}`,l}function ne(a){const{connectionId:e,token:t,studioUrl:s,meshUrl:r,mcpUrl:o,orgId:n}=a,i=U({studioUrl:s,meshUrl:r});return{queryKey:z.mcpClient(n,e??"self",t??"",o??i??""),queryFn:()=>ae(a),staleTime:1/0,gcTime:6e4}}function St(a){const e=Q.c(2);let t;e[0]!==a?(t=ne(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=re(t);return s}function bt(a){const e=Q.c(2);let t;e[0]!==a?(t=ne(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=We(t);return s??null}function Ct(a){const e=Q.c(19),{connectionId:t,orgId:s,orgSlug:r,token:o,studioUrl:n,meshUrl:i,mcpUrl:u}=a;let p;e[0]!==i||e[1]!==n?(p=U({studioUrl:n,meshUrl:i}),e[0]=i,e[1]=n,e[2]=p):p=e[2];const l=p;let d;e[3]!==t||e[4]!==u||e[5]!==s||e[6]!==l||e[7]!==o?(d=t!==void 0?z.mcpClient(s,t??"self",o??"",u??l??""):["mcp","client","skip",s],e[3]=t,e[4]=u,e[5]=s,e[6]=l,e[7]=o,e[8]=d):d=e[8];const f=d;let m;e[9]!==t||e[10]!==u||e[11]!==s||e[12]!==r||e[13]!==l||e[14]!==o?(m=async()=>t===void 0?null:ae({connectionId:t,orgId:s,orgSlug:r,token:o,studioUrl:l,mcpUrl:u}),e[9]=t,e[10]=u,e[11]=s,e[12]=r,e[13]=l,e[14]=o,e[15]=m):m=e[15];let T;e[16]!==f||e[17]!==m?(T={queryKey:f,queryFn:m,staleTime:1/0,gcTime:6e4},e[16]=f,e[17]=m,e[18]=T):T=e[18];const{data:y}=re(T);return y??null}export{et as A,it as C,Ze as P,pt as S,bt as a,Ct as b,ae as c,dt as d,lt as e,ne as m,V as n,St as u};
|
|
9
|
+
${J}`,p++;return}if(te(h,c,v)){l=h.slice(h.charCodeAt(c+6)===I?c+7:c+6,w)||void 0;return}if(v===105&&h.charCodeAt(c+1)===100&&h.charCodeAt(c+2)===58){const E=h.slice(h.charCodeAt(c+3)===I?c+4:c+3,w);i=E.includes("\0")?void 0:E;return}if(v===58){if(r){const E=h.slice(c,w);r(E.slice(h.charCodeAt(c+1)===I?2:1))}return}const S=h.slice(c,w),C=S.indexOf(":");if(C===-1){T(S,"",S);return}const ie=S.slice(0,C),ce=S.charCodeAt(C+1)===I?2:1,le=S.slice(C+ce);T(ie,le,S)}function T(h,c,w){switch(h){case"event":l=c||void 0;break;case"data":u=p===0?c:`${u}
|
|
10
|
+
${c}`,p++;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?s(parseInt(c,10)):t(new Y(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:w}));break;default:t(new Y(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:c,line:w}));break}}function y(){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0}function k(h={}){if(h.consume&&o.length>0){const c=o.join("");m(c,0,c.length)}n=!0,i=void 0,u="",p=0,l=void 0,o.length=0}return{feed:d,reset:k}}function ee(a,e,t){return t===100&&a.charCodeAt(e+1)===97&&a.charCodeAt(e+2)===116&&a.charCodeAt(e+3)===97&&a.charCodeAt(e+4)===58}function te(a,e,t){return t===101&&a.charCodeAt(e+1)===118&&a.charCodeAt(e+2)===101&&a.charCodeAt(e+3)===110&&a.charCodeAt(e+4)===116&&a.charCodeAt(e+5)===58}class ht extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(o){r=dt({onEvent:n=>{o.enqueue(n)},onError(n){e==="terminate"?o.error(n):typeof e=="function"&&e(n)},onRetry:t,onComment:s})},transform(o){r.feed(o)}})}}const ft={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $ extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let pt=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=lt(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??ft}async _authThenStart(){if(!this._authProvider)throw new P("No auth provider");let e;try{e=await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new P;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=V(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),t&&s.set("last-event-id",t);const r=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new $(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(s){throw this.onerror?.(s),s}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(s,e),r)}_scheduleReconnection(e,t=0){const s=this._reconnectionOptions.maxRetries;if(t>=s){this.onerror?.(new Error(`Maximum reconnection attempts (${s}) exceeded.`));return}const r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,s){if(!e)return;const{onresumptiontoken:r,replayMessageId:o}=t;let n,i=!1,u=!1;(async()=>{try{const l=e.pipeThrough(new TextDecoderStream).pipeThrough(new ht({onRetry:m=>{this._serverRetryMs=m}})).getReader();for(;;){const{value:m,done:T}=await l.read();if(T)break;if(m.id&&(n=m.id,i=!0,r?.(m.id)),!!m.data&&(!m.event||m.event==="message"))try{const y=N.parse(JSON.parse(m.data));M(y)&&(u=!0,o!==void 0&&(y.id=o)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(m){this.onerror?.(new Error(`Failed to reconnect: ${m instanceof Error?m.message:String(m)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new P("No auth provider");if(await H(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:s,onresumptiontoken:r}=t||{};if(s){this._startOrAuthSse({resumptionToken:s,replayMessageId:D(e)?e.id:void 0}).catch(f=>this.onerror?.(f));return}const o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");const n={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,n),u=i.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!i.ok){const f=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:m,scope:T}=K(i);if(this._resourceMetadataUrl=m,this._scope=T,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P;return this._hasCompletedAuthFlow=!0,this.send(e)}if(i.status===403&&this._authProvider){const{resourceMetadataUrl:m,scope:T,error:y}=K(i);if(y==="insufficient_scope"){const k=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===k)throw new $(403,"Server returned 403 after trying upscoping");if(T&&(this._scope=T),m&&(this._resourceMetadataUrl=m),this._lastUpscopingHeader=k??void 0,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new P;return this.send(e)}}throw new $(i.status,`Error POSTing to endpoint: ${f}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,i.status===202){await i.body?.cancel(),Je(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(f=>this.onerror?.(f));return}const l=(Array.isArray(e)?e:[e]).filter(f=>"method"in f&&"id"in f&&f.id!==void 0).length>0,d=i.headers.get("content-type");if(l)if(d?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(d?.includes("application/json")){const f=await i.json(),m=Array.isArray(f)?f.map(T=>N.parse(T)):[N.parse(f)];for(const T of m)this.onmessage?.(T)}else throw await i.body?.cancel(),new $(-1,`Unexpected content type: ${d}`);else await i.body?.cancel()}catch(s){throw this.onerror?.(s),s}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,t);if(await s.body?.cancel(),!s.ok&&s.status!==405)throw new $(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};class mt extends pt{constructor(e,t){super(e,t)}send(e,t){const s=_t(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function _t(a){const e=a;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"studio-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const wt={name:"studio-sdk",version:"1.0.0"};function gt(a,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either studioUrl or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,o=a?`${r}/mcp/${a}`:`${r}/mcp`;return new URL(o,s).href}async function ae({connectionId:a,orgId:e,orgSlug:t,token:s,studioUrl:r,meshUrl:o,mcpUrl:n}){const i=U({studioUrl:r,meshUrl:o}),u=Q.mcpClient(e,a??"self",s??"",n??i??"");if(!n&&(!a||a===Ke))return ct({orgSlug:t,token:s,studioUrl:i,toJSONString:`mcp-client:${u.join(":")}`});const p=n??gt(a,t,i),l=new it(wt,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),d=new mt(new URL(p),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});return await l.connect(d),l.toJSON=()=>`mcp-client:${u.join(":")}`,l}function ne(a){const{connectionId:e,token:t,studioUrl:s,meshUrl:r,mcpUrl:o,orgId:n}=a,i=U({studioUrl:s,meshUrl:r});return{queryKey:Q.mcpClient(n,e??"self",t??"",o??i??""),queryFn:()=>ae(a),staleTime:1/0,gcTime:6e4}}function St(a){const e=z.c(2);let t;e[0]!==a?(t=ne(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=re(t);return s}function Ct(a){const e=z.c(2);let t;e[0]!==a?(t=ne(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=We(t);return s??null}function bt(a){const e=z.c(19),{connectionId:t,orgId:s,orgSlug:r,token:o,studioUrl:n,meshUrl:i,mcpUrl:u}=a;let p;e[0]!==i||e[1]!==n?(p=U({studioUrl:n,meshUrl:i}),e[0]=i,e[1]=n,e[2]=p):p=e[2];const l=p;let d;e[3]!==t||e[4]!==u||e[5]!==s||e[6]!==l||e[7]!==o?(d=t!==void 0?Q.mcpClient(s,t??"self",o??"",u??l??""):["mcp","client","skip",s],e[3]=t,e[4]=u,e[5]=s,e[6]=l,e[7]=o,e[8]=d):d=e[8];const f=d;let m;e[9]!==t||e[10]!==u||e[11]!==s||e[12]!==r||e[13]!==l||e[14]!==o?(m=async()=>t===void 0?null:ae({connectionId:t,orgId:s,orgSlug:r,token:o,studioUrl:l,mcpUrl:u}),e[9]=t,e[10]=u,e[11]=s,e[12]=r,e[13]=l,e[14]=o,e[15]=m):m=e[15];let T;e[16]!==f||e[17]!==m?(T={queryKey:f,queryFn:m,staleTime:1/0,gcTime:6e4},e[16]=f,e[17]=m,e[18]=T):T=e[18];const{data:y}=re(T);return y??null}export{et as A,it as C,Ze as P,pt as S,Ct as a,bt as b,ae as c,dt as d,lt as e,ne as m,V as n,St as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,m as
|
|
1
|
+
import{c as l,m as u,c8 as m,c9 as f,D as y,K as n}from"./index-EcuFIS2a.js";async function c(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 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=()=>c(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 q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(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],u(a)}export{q as a,b as g,c as l,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,
|
|
1
|
+
import{c as m,D as p,m as q,K as T}from"./index-EcuFIS2a.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function w(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,O as b,w as c,K as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c,a0 as m,m as b,D as M,K as f}from"./index-EcuFIS2a.js";import{u as y}from"./use-org-auth-client-8fDIgHEZ.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],M(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],b(l)}export{d as a,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r}from"./index-
|
|
1
|
+
import{c as m,r}from"./index-EcuFIS2a.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as m,m as b,K as T,aE as E,a0 as U,d as K,o as $,a as H,cY as N,cZ as k}from"./index-EcuFIS2a.js";import{e as Q,f as D}from"./use-virtual-mcp-Ji9vcgUj.js";import{u as I}from"./hooks-D0dDgrIf.js";import{p as V,d as _,w as Y}from"./thread-intent-CTSjhfEo.js";import{r as S,h as P,g as B,a as j}from"./github-repo-BknN0SVI.js";function O(t,e){if(!e)return!0;if(t.partial)return!1;const n=V(t.metadata?.runtime);return n===null||n===e}function w(t,e,n,a,s){let o=null;for(const r of t)r.virtual_mcp_id===e&&r.created_by===n&&(r.hidden||O(r,a)&&(s&&r.branch===s||(!o||r.updated_at>o.updated_at)&&(o=r)));return o}function me(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&O(s,a))}function x(t,e,n,a,s,o){return s?w(t,e,n,a,o?.baseBranch)??void 0:w(t,e,n,a)??void 0}const Z=6e4,A=3e4;function C(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 z(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 q(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:o}=t;return{queryKey:T.githubPrState(e,S(n),a,s,o),queryFn:()=>E(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&P(n)&&!!a&&!!s,refetchInterval:Z,refetchIntervalInBackground:!1,staleTime:A}}function J(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:W},e[2]=n,e[3]=a):a=e[3],b(a)}function W(t){return t.changeRequest?C(t.changeRequest):null}function ge(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:X},e[2]=n,e[3]=a):a=e[3],b(a)}function X(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(z):[]}function be(t){const e=m.c(4);let n;e[0]!==t?(n=q(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:M},e[2]=n,e[3]=a):a=e[3],b(a)}function M(t){return(t.changeRequest?.comments??[]).map(ee)}function ee(t){return{id:t.id,author:t.author,body:t.body,createdAt:t.createdAt,htmlUrl:t.url}}const te=5*6e4;function pe(t){const e=m.c(20),{orgSlug:n,target:a,owner:s,repo:o,base:r}=t;let u;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(u=T.githubLastPublishedPr(n,S(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=u):u=e[5];let i;e[6]!==r||e[7]!==n||e[8]!==a?(i=()=>E(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=i):i=e[9];let l;e[10]!==t.enabled||e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==a?(l=(t.enabled??!0)&&!!r&&P(a)&&!!s&&!!o,e[10]=t.enabled,e[11]=r,e[12]=s,e[13]=o,e[14]=a,e[15]=l):l=e[15];let c;return e[16]!==u||e[17]!==i||e[18]!==l?(c={queryKey:u,queryFn:i,enabled:l,staleTime:te,select:ne},e[16]=u,e[17]=i,e[18]=l,e[19]=c):c=e[19],b(c)}function ne(t){return t.changeRequest?C(t.changeRequest):null}const ae=50;function ye(t){const e=m.c(17),{orgSlug:n,target:a,owner:s,repo:o}=t;let r;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==a?(r=T.githubOpenPrs(n,S(a),s,o),e[0]=n,e[1]=s,e[2]=o,e[3]=a,e[4]=r):r=e[4];let u;e[5]!==n||e[6]!==a?(u=()=>E(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:ae}),e[5]=n,e[6]=a,e[7]=u):u=e[7];let i;e[8]!==t.enabled||e[9]!==s||e[10]!==o||e[11]!==a?(i=(t.enabled??!0)&&P(a)&&!!s&&!!o,e[8]=t.enabled,e[9]=s,e[10]=o,e[11]=a,e[12]=i):i=e[12];let l;return e[13]!==r||e[14]!==u||e[15]!==i?(l={queryKey:r,queryFn:u,enabled:i,staleTime:A,select:se},e[13]=r,e[14]=u,e[15]=i,e[16]=l):l=e[16],b(l)}function se(t){return t.changeRequests.map(C)}function Re(t){const e=m.c(14),{orgSlug:n,target:a,owner:s,repo:o,checkRunId:r}=t;let u;e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==o||e[4]!==a?(u=T.githubCheckRun(n,S(a),s,o,r),e[0]=r,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=u):u=e[5];let i;e[6]!==r||e[7]!==n||e[8]!==a?(i=()=>E(n,"CHANGE_REQUEST_CHECK_LOG",{...a,checkId:r}),e[6]=r,e[7]=n,e[8]=a,e[9]=i):i=e[9];const l=t.enabled&&!!r;let c;return e[10]!==u||e[11]!==i||e[12]!==l?(c={queryKey:u,queryFn:i,enabled:l,staleTime:A,select:re},e[10]=u,e[11]=i,e[12]=l,e[13]=c):c=e[13],b(c)}function re(t){return{title:null,summary:t.report,text:null}}function oe(t,e){const{org:n}=U(),a=B(t);return J({orgId:n.id,orgSlug:n.slug,target:j(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ue=[];function Te(){const t=m.c(13),e=K(),{org:n,locator:a}=U(),s=$(),o=Q(),{data:r}=H.useSession(),u=I(),i=oe(void 0,null);let l;t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==u?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==r?.user?.id?(l=(f,d,y)=>{const h=d?.panel??"overview";if(N(h).kind==="org-destination"){k(e,{tabId:h,org:n.slug,agentId:f,replace:!1});return}const g=(o??[]).find(G=>G.id===f),F=!!(g&&B(g)),L=!d?.runtime,v=L?void 0:x(u?.threads.get()??ue,f,r?.user?.id,y??(g?_(g.metadata):void 0),F,{baseBranch:i}),R=L?void 0:v?.id??crypto.randomUUID();R&&!v&&d?.runtime&&Y(sessionStorage,a,R,{runtime:d.runtime}),k(e,{tabId:h,org:n.slug,agentId:f,search:()=>R?{thread:R}:{},replace:!1})},t[0]=i,t[1]=o,t[2]=a,t[3]=u?.threads,t[4]=e,t[5]=n.slug,t[6]=r?.user?.id,t[7]=l):l=t[7];const c=l;let p;return t[8]!==o||t[9]!==c||t[10]!==n||t[11]!==s?(p=(f,d)=>{if(N(d?.panel??"overview").kind==="org-destination")return c(f,d,void 0);const y=o.find(h=>h.id===f);if(d?.runtime)return c(f,d,d.runtime);if(y)return c(f,d,_(y.metadata));D(s,n).then(h=>h.find(g=>g.id===f)).catch(ie).then(h=>c(f,d,h?_(h.metadata):void 0))},t[8]=o,t[9]=c,t[10]=n,t[11]=s,t[12]=p):p=t[12],p}function ie(){}export{oe as a,x as b,ye as c,J as d,pe as e,me as f,ge as g,Re as h,be as i,q as p,Te as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as l,a6 as f,b as p,e as T,t as m}from"./index-EcuFIS2a.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as x,a0 as j,a as i}from"./index-EcuFIS2a.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as p,a0 as S,K as y,m as $,o as T,e as K}from"./index-EcuFIS2a.js";function Y(s){return s.contentHash??`${s.size}-${s.updatedAt}`}function F(s,e,t,n){const i=new URLSearchParams(n).toString();return`/api/${encodeURIComponent(s)}/fs/${encodeURIComponent(e)}/${t}${i?`?${i}`:""}`}async function h(s,e,t){const n=await fetch(s,e);if(n.ok||t?.allow404&&n.status===404)return n;let i="";try{i=(await n.json()).error??""}catch{}throw new Error(i||`HTTP ${n.status}`)}function z(s,e){const t=p.c(15),{org:n}=S();let i;t[0]!==n.id||t[1]!==e||t[2]!==s?(i=y.orgFsList(n.id,s,e),t[0]=n.id,t[1]=e,t[2]=s,t[3]=i):i=t[3];let r;t[4]!==n.id||t[5]!==s?(r=(c,o)=>o?.queryKey[1]===n.id&&o.queryKey[2]===s?c:void 0,t[4]=n.id,t[5]=s,t[6]=r):r=t[6];let a;t[7]!==n.slug||t[8]!==e||t[9]!==s?(a=async()=>(await(await h(F(n.slug,s,"list",{path:e}))).json()).entries.toSorted(x),t[7]=n.slug,t[8]=e,t[9]=s,t[10]=a):a=t[10];let l;return t[11]!==i||t[12]!==r||t[13]!==a?(l={queryKey:i,placeholderData:r,queryFn:a},t[11]=i,t[12]=r,t[13]=a,t[14]=l):l=t[14],$(l)}function x(s,e){return s.kind!==e.kind?s.kind==="dir"?-1:1:s.path.localeCompare(e.path)}async function C(s,e,t){const n=await h(F(s,e,"stat",{path:t}),void 0,{allow404:!0});return n.status===404?null:(await n.json()).entry}function B(s,e,t){const n=p.c(15),{org:i}=S();let r;n[0]!==i.id||n[1]!==e||n[2]!==s?(r=y.orgFsStat(i.id,s??"",e),n[0]=i.id,n[1]=e,n[2]=s,n[3]=r):r=n[3];const a=s!==null;let l;n[4]!==t?(l=t?.refetchIntervalWhenAbsent?f=>f.state.data?!1:t.refetchIntervalWhenAbsent??!1:void 0,n[4]=t,n[5]=l):l=n[5];let c;n[6]!==i.slug||n[7]!==e||n[8]!==s?(c=()=>C(i.slug,s??"",e),n[6]=i.slug,n[7]=e,n[8]=s,n[9]=c):c=n[9];let o;return n[10]!==r||n[11]!==a||n[12]!==l||n[13]!==c?(o={queryKey:r,enabled:a,refetchInterval:l,queryFn:c},n[10]=r,n[11]=a,n[12]=l,n[13]=c,n[14]=o):o=n[14],$(o)}function J(s){const e=p.c(9),{org:t}=S();let n;e[0]!==t.id||e[1]!==s?(n=y.orgFsUsage(t.id,s),e[0]=t.id,e[1]=s,e[2]=n):n=e[2];let i;e[3]!==t.slug||e[4]!==s?(i=async()=>await(await h(F(t.slug,s,"usage"))).json(),e[3]=t.slug,e[4]=s,e[5]=i):i=e[5];let r;return e[6]!==n||e[7]!==i?(r={queryKey:n,queryFn:i},e[6]=n,e[7]=i,e[8]=r):r=e[8],$(r)}function V(s,e){const t=p.c(9),n=s===void 0?60:s,{org:i}=S();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 l;t[2]!==n||t[3]!==i.slug?(l=async()=>(await(await h(`/api/${encodeURIComponent(i.slug)}/fs/recent?limit=${n}`)).json()).entries,t[2]=n,t[3]=i.slug,t[4]=l):l=t[4];let c;return t[5]!==r||t[6]!==a||t[7]!==l?(c={queryKey:r,enabled:a,queryFn:l},t[5]=r,t[6]=a,t[7]=l,t[8]=c):c=t[8],$(c)}const _=50;function G(s,e){const t=p.c(16),{org:n}=S();let i;t[0]!==n.id||t[1]!==s||t[2]!==e?.prefix||t[3]!==e?.volume?(i=y.orgFsSearch(n.id,s,e?.volume??"",e?.prefix??""),t[0]=n.id,t[1]=s,t[2]=e?.prefix,t[3]=e?.volume,t[4]=i):i=t[4];const r=s.length>0;let a;t[5]!==n.id?(a=(o,f)=>f?.queryKey[1]===n.id?o:void 0,t[5]=n.id,t[6]=a):a=t[6];let l;t[7]!==n.slug||t[8]!==s||t[9]!==e?(l=async()=>{const o=new URLSearchParams({q:s,limit:String(_)});return e&&(o.set("volume",e.volume),e.prefix&&o.set("prefix",e.prefix)),(await(await h(`/api/${encodeURIComponent(n.slug)}/fs/search?${o}`)).json()).entries},t[7]=n.slug,t[8]=s,t[9]=e,t[10]=l):l=t[10];let c;return t[11]!==i||t[12]!==r||t[13]!==a||t[14]!==l?(c={queryKey:i,enabled:r,placeholderData:a,queryFn:l},t[11]=i,t[12]=r,t[13]=a,t[14]=l,t[15]=c):c=t[15],$(c)}function Z(s){const e=p.c(8),{org:t}=S();let n;e[0]!==t.id?(n=y.orgFsSkills(t.id),e[0]=t.id,e[1]=n):n=e[1];const i=s?.enabled;let r;e[2]!==t.slug?(r=async()=>{const l=await h(`/api/${encodeURIComponent(t.slug)}/fs/skills`),{skills:c}=await l.json();return c.map(j)},e[2]=t.slug,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==i||e[6]!==r?(a={queryKey:n,enabled:i,queryFn:r},e[4]=n,e[5]=i,e[6]=r,e[7]=a):a=e[7],$(a)}function j(s){return{volume:s.volume,path:s.path}}async function E(s){const e=await h(`/api/${encodeURIComponent(s)}/fs/skills`),{skills:t}=await e.json();return t}function v(){const s=p.c(7),{org:e}=S();let t;s[0]!==e.id?(t=y.slashSkills(e.id),s[0]=e.id,s[1]=t):t=s[1];let n;s[2]!==e.slug?(n=()=>E(e.slug),s[2]=e.slug,s[3]=n):n=s[3];let i;return s[4]!==t||s[5]!==n?(i={queryKey:t,queryFn:n,staleTime:6e4},s[4]=t,s[5]=n,s[6]=i):i=s[6],$(i)}async function R(s,e,t){return(await h(F(s,e,"read",{path:t}))).text()}function ee(s,e){const t=p.c(8);let n;t[0]!==s?(n=y.fileText(s),t[0]=s,t[1]=n):n=t[1];const i=e?.enabled!==!1&&s!=="";let r;t[2]!==s?(r=async()=>{const l=await fetch(s,{credentials:"include"});return l.ok?await l.text():null},t[2]=s,t[3]=r):r=t[3];let a;return t[4]!==n||t[5]!==i||t[6]!==r?(a={queryKey:n,enabled:i,staleTime:6e4,retry:!1,queryFn:r},t[4]=n,t[5]=i,t[6]=r,t[7]=a):a=t[7],$(a)}const U=new Set(["md","mdx","markdown","txt","text"]),Q=25,M=64*1024,A=256*1024,D=4;function N(s){const e=s.lastIndexOf(".");return e===-1?!1:U.has(s.slice(e+1).toLowerCase())}async function te(s,e,t){const n=t?`${t}/`:"",i=u=>u.startsWith(n)?u.slice(n.length):u,r=[],a=[],l=[{path:t,depth:0}];for(;l.length>0;){const u=l.shift();if(!u)break;let g;try{g=(await(await h(F(s,e,"list",{path:u.path}))).json()).entries}catch{continue}for(const d of[...g].sort((I,q)=>I.path.localeCompare(q.path))){if(d.kind==="dir"){u.depth<D&&l.push({path:d.path,depth:u.depth+1});continue}N(d.path)&&d.size<=M&&r.length<Q?r.push(d.path):a.push(i(d.path))}}const c=await Promise.all(r.map(u=>R(s,e,u).catch(()=>null))),o=[];let f=0;return r.forEach((u,g)=>{const d=c[g];if(d==null||f+d.length>A){a.push(i(u));return}f+=d.length,o.push({relPath:i(u),content:d})}),o.sort((u,g)=>u.relPath==="SKILL.md"?-1:g.relPath==="SKILL.md"?1:u.relPath.localeCompare(g.relPath)),a.sort(),{files:o,omittedPaths:a}}function se(){const s=p.c(7),{org:e}=S();let t;s[0]!==e.id?(t=y.orgFsPublicSets(e.id),s[0]=e.id,s[1]=t):t=s[1];let n;s[2]!==e.slug?(n=async()=>(await(await h(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,s[2]=e.slug,s[3]=n):n=s[3];let i;return s[4]!==t||s[5]!==n?(i={queryKey:t,staleTime:3e5,queryFn:n},s[4]=t,s[5]=n,s[6]=i):i=s[6],$(i)}function ne(s){const e=p.c(3),{org:t}=S();let n;return e[0]!==t.slug||e[1]!==s?(n=i=>F(t.slug,s,"read",{path:i}),e[0]=t.slug,e[1]=s,e[2]=n):n=e[2],n}function ie(){const s=p.c(2),{org:e}=S();let t;return s[0]!==e.slug?(t=(n,i)=>F(e.slug,n,"read",{path:i}),s[0]=e.slug,s[1]=t):t=s[1],t}function re(s){const e=p.c(3),{org:t}=S();let n;return e[0]!==t||e[1]!==s?(n={mutationFn:async i=>(await(await h(F(t.slug,s,"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]=s,e[2]=n):n=e[2],K(n)}function ae(s){const e=p.c(18),{org:t}=S(),n=T();let i;e[0]!==t||e[1]!==s?(i=async o=>(await(await h(F(t.slug,s,"public",{path:o.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:o.mode,password:o.password})})).json()).entry,e[0]=t,e[1]=s,e[2]=i):i=e[2];let r;e[3]!==t||e[4]!==n||e[5]!==s?(r=async o=>{const f=y.orgFsStat(t.id,s,o.path);await n.cancelQueries({queryKey:f});const u=n.getQueryData(f),g=o.mode!=="private";return n.setQueryData(f,d=>d&&{...d,readPublic:g,effectivePublic:g,shareMode:o.mode}),{key:f,previous:u}},e[3]=t,e[4]=n,e[5]=s,e[6]=r):r=e[6];let a;e[7]!==n?(a=(o,f,u)=>{u&&n.setQueryData(u.key,u.previous)},e[7]=n,e[8]=a):a=e[8];let l;e[9]!==t||e[10]!==n||e[11]!==s?(l=(o,f,u)=>{n.invalidateQueries({queryKey:y.orgFsStat(t.id,s,u.path)}),n.invalidateQueries({queryKey:y.orgFsVolume(t.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[9]=t,e[10]=n,e[11]=s,e[12]=l):l=e[12];let c;return e[13]!==i||e[14]!==r||e[15]!==a||e[16]!==l?(c={mutationFn:i,onMutate:r,onError:a,onSettled:l},e[13]=i,e[14]=r,e[15]=a,e[16]=l,e[17]=c):c=e[17],K(c)}function le(s){const e=p.c(33),{org:t}=S(),n=T();let i;e[0]!==t||e[1]!==n||e[2]!==s?(i=()=>{n.invalidateQueries({queryKey:y.orgFsVolume(t.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(t.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(t.id)})},e[0]=t,e[1]=n,e[2]=s,e[3]=i):i=e[3];const r=i;let a;e[4]!==t||e[5]!==s?(a=async w=>{const k=(await Promise.allSettled(w.files.map(O=>{const P=w.dir?`${w.dir}/${O.name}`:O.name;return h(F(t.slug,s,"file",{path:P}),{method:"PUT",headers:{"content-type":O.type||"application/octet-stream"},body:O})}))).find(X);if(k)throw k.reason},e[4]=t,e[5]=s,e[6]=a):a=e[6];let l;e[7]!==r||e[8]!==a?(l={mutationFn:a,onSettled:r},e[7]=r,e[8]=a,e[9]=l):l=e[9];const c=K(l);let o;e[10]!==t||e[11]!==s?(o=async w=>{await h(F(t.slug,s,"dir",{path:w}),{method:"POST"})},e[10]=t,e[11]=s,e[12]=o):o=e[12];let f;e[13]!==r||e[14]!==o?(f={mutationFn:o,onSuccess:r},e[13]=r,e[14]=o,e[15]=f):f=e[15];const u=K(f);let g;e[16]!==t||e[17]!==s?(g=async w=>{await h(F(t.slug,s,"file",{path:w}),{method:"DELETE"})},e[16]=t,e[17]=s,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 I=K(d);let q;e[22]!==t||e[23]!==s?(q=async w=>{await h(F(t.slug,s,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(w)})},e[22]=t,e[23]=s,e[24]=q):q=e[24];let m;e[25]!==r||e[26]!==q?(m={mutationFn:q,onSuccess:r},e[25]=r,e[26]=q,e[27]=m):m=e[27];const b=K(m);let L;return e[28]!==u||e[29]!==b||e[30]!==I||e[31]!==c?(L={upload:c,mkdir:u,remove:I,move:b},e[28]=u,e[29]=b,e[30]=I,e[31]=c,e[32]=L):L=e[32],L}function X(s){return s.status==="rejected"}export{E as a,ne as b,ee as c,re as d,Y as e,te as f,ae as g,le as h,ie as i,V as j,Z as k,G as l,se as m,z as n,J as o,v as p,C as q,B as u};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as S,b as M,l as F,j as a,G as T,F as Y,B as H,H as V,I as Q,r as P,m as W,K as R,a0 as L,a6 as A,o as J,e as Z}from"./index-EcuFIS2a.js";import{c as X}from"./use-org-fs-Bf6n51Xm.js";import{i as ee}from"./DotsVertical-CE2o6L6N.js";import{n as re}from"./Download01-DNhEQzg0.js";import{i as le,a as ie}from"./Share07-CZ7JzYs9.js";import{i as oe}from"./Globe01-g_y8gAs1.js";import{i as ae}from"./Key01-CO_i2QPb.js";import{a as ce}from"./Palette-DT856bn6.js";import{s as te}from"./Trash01-DtE0n00a.js";import{i as fe}from"./Zap-DZAIluO6.js";import{F as O,d as G}from"./file-type-icon-lZW2ows7.js";import{F as de}from"./folder-icon-DVG7PK8X.js";import{p as ue}from"./skill-md-ChfVs4uF.js";function me(t,e,s){return e?"color":s?"font":/^--brand-(text|fw|leading|tracking)/i.test(t)?"type":/^--brand-space/i.test(t)?"space":/^--brand-radius/i.test(t)?"radius":/^--brand-shadow/i.test(t)?"shadow":/^--brand-(duration|delay|ease)/i.test(t)?"motion":"other"}const pe=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,xe=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,he=["svg","png","jpg","jpeg","webp","avif","gif"];function ge(t){return t.split(".").pop()?.toLowerCase()??""}function be(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(t){const e=t.trim();return xe.test(e)||pe.test(e)}function it(t){const e=t.trim(),s=e.match(/^#([0-9a-f]{3})$/i);return s?.[1]?`#${[...s[1]].map(i=>i+i).join("")}`:e}function je(t){const e=[],s=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let n;for(;(n=i.exec(t))!==null;){const r=n[1],l=n[2].trim();s.has(r)||e.push(r),s.set(r,l)}return e.map(r=>{const l=s.get(r),c=ye(l),o=/^--brand-font/i.test(r);return{name:r,value:l,isColor:c,isFont:o,kind:me(r,c,o)}})}const K=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function we(t){return t.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??t}function ot(t){const e=[],s=new Map;for(const n of t){if(n.kind!=="color")continue;const r=we(n.name);s.has(r)||(e.push(r),s.set(r,[])),s.get(r).push(n)}return e.map(n=>{const r=s.get(n);return{family:n,tokens:r,isRamp:r.filter(l=>/-\d+$/.test(l.name)).length>=5}}).sort((n,r)=>{const l=K.indexOf(n.family),c=K.indexOf(r.family);return l===-1&&c===-1?0:l===-1?1:c===-1?-1:l-c})}function at(t,e,s){const i=new RegExp(`(${be(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(t))return t.replace(i,(l,c,o)=>`${c}${s}${o}`);const n=t.search(/:root\s*\{/);if(n!==-1){const l=t.indexOf("{",n)+1;return`${t.slice(0,l)}
|
|
2
|
+
${e}: ${s};${t.slice(l)}`}const r=t.length>0&&!t.endsWith(`
|
|
3
|
+
`)?`
|
|
4
|
+
`:"";return`${t}${r}:root {
|
|
5
|
+
${e}: ${s};
|
|
6
|
+
}
|
|
7
|
+
`}function ct(t){const e=t.filter(i=>i.kind==="file"),s=e.find(i=>/(^|\/)logo\.(svg|png|jpe?g|webp|avif|gif)$/i.test(i.path));return s?s.path:e.find(i=>he.includes(ge(i.path)))?.path??null}const ve=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Se=new Set(["csv","tsv"]),_e=new Set(["mp4","webm","mov","m4v"]),Ne=new Set(["txt","md","markdown","json","log","yaml","yml","xml","html","htm"]),$e=256*1024;function E(t){const e=new Date(t);if(Number.isNaN(e.getTime()))return"";const s=Date.now()-e.getTime(),i=Math.floor(s/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const n=Math.floor(i/60);if(n<24)return`${n}h ago`;const r=Math.floor(n/24);return r<30?`${r}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ce(t){return t.split(".").pop()?.toLowerCase()??""}async function ke(t,e){const s=await fetch(t,{credentials:"include",...e});if(!s.ok)throw new Error(`fetch failed: ${s.status}`);return s.text()}function se(t){const e=S.c(6),{onShare:s,t:i}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(ie,{size:14}),e[0]=n):n=e[0];let r;e[1]!==i?(r=i("library.cards.share"),e[1]=i,e[2]=r):r=e[2];let l;return e[3]!==s||e[4]!==r?(l=a.jsxs(T,{onClick:s,children:[n,r]}),e[3]=s,e[4]=r,e[5]=l):l=e[5],l}function ne(t){const e=S.c(12),{state:s,t:i}=t;let n;e[0]!==s||e[1]!==i?(n=i(s==="password"?"library.cards.passwordProtected":s==="inherited"?"library.cards.sharedViaParent":"library.cards.publicBadge"),e[0]=s,e[1]=i,e[2]=n):n=e[2];const r=n,l=s==="password"?ae:oe,c=s==="inherited"?"text-muted-foreground/60":"text-primary";let o;e[3]!==c?(o=F(c),e[3]=c,e[4]=o):o=e[4];let f;e[5]!==l||e[6]!==r||e[7]!==o?(f=a.jsx(l,{size:12,className:o,"aria-label":r}),e[5]=l,e[6]=r,e[7]=o,e[8]=f):f=e[8];let u;return e[9]!==r||e[10]!==f?(u=a.jsx("span",{title:r,className:"mt-0.5 flex shrink-0 items-center",children:f}),e[9]=r,e[10]=f,e[11]=u):u=e[11],u}function U(t){const e=S.c(26),{downloadUrl:s,filename:i,onShare:n,onDelete:r,t:l}=t;let c;e[0]!==i||e[1]!==l?(c=l("library.cards.actionsFor",{filename:i}),e[0]=i,e[1]=l,e[2]=c):c=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(ee,{size:14}),e[3]=o):o=e[3];let f;e[4]!==c?(f=a.jsx(Y,{asChild:!0,children:a.jsx(H,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Te,"aria-label":c,children:o})}),e[4]=c,e[5]=f):f=e[5];let u;e[6]!==n||e[7]!==l?(u=n&&a.jsx(se,{onShare:n,t:l}),e[6]=n,e[7]=l,e[8]=u):u=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(re,{size:14}),e[9]=m):m=e[9];let x;e[10]!==l?(x=l("library.cards.download"),e[10]=l,e[11]=x):x=e[11];let d;e[12]!==s||e[13]!==i||e[14]!==x?(d=a.jsx(T,{asChild:!0,children:a.jsxs("a",{href:s,download:i,children:[m,x]})}),e[12]=s,e[13]=i,e[14]=x,e[15]=d):d=e[15];let p;e[16]!==r||e[17]!==l?(p=r&&a.jsxs(T,{variant:"destructive",onClick:r,children:[a.jsx(te,{size:14}),l("library.cards.delete")]}),e[16]=r,e[17]=l,e[18]=p):p=e[18];let h;e[19]!==u||e[20]!==d||e[21]!==p?(h=a.jsxs(V,{align:"end",onClick:De,children:[u,d,p]}),e[19]=u,e[20]=d,e[21]=p,e[22]=h):h=e[22];let b;return e[23]!==f||e[24]!==h?(b=a.jsxs(Q,{children:[f,h]}),e[23]=f,e[24]=h,e[25]=b):b=e[25],b}function De(t){return t.stopPropagation()}function Te(t){return t.stopPropagation()}function q(t){const e=S.c(22),{label:s,onBrowse:i,onShare:n,onDelete:r,t:l}=t;if(!i&&!n&&!r)return;let c;e[0]!==s||e[1]!==l?(c=l("library.cards.actionsFor",{label:s}),e[0]=s,e[1]=l,e[2]=c):c=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(ee,{size:14}),e[3]=o):o=e[3];let f;e[4]!==c?(f=a.jsx(Y,{asChild:!0,children:a.jsx(H,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Ee,"aria-label":c,children:o})}),e[4]=c,e[5]=f):f=e[5];let u;e[6]!==i||e[7]!==l?(u=i&&a.jsxs(T,{onClick:i,children:[a.jsx(le,{size:14}),l("library.cards.browseFiles")]}),e[6]=i,e[7]=l,e[8]=u):u=e[8];let m;e[9]!==n||e[10]!==l?(m=n&&a.jsx(se,{onShare:n,t:l}),e[9]=n,e[10]=l,e[11]=m):m=e[11];let x;e[12]!==r||e[13]!==l?(x=r&&a.jsxs(T,{variant:"destructive",onClick:r,children:[a.jsx(te,{size:14}),l("library.cards.delete")]}),e[12]=r,e[13]=l,e[14]=x):x=e[14];let d;e[15]!==u||e[16]!==m||e[17]!==x?(d=a.jsxs(V,{align:"end",onClick:Oe,children:[u,m,x]}),e[15]=u,e[16]=m,e[17]=x,e[18]=d):d=e[18];let p;return e[19]!==f||e[20]!==d?(p=a.jsxs(Q,{children:[f,d]}),e[19]=f,e[20]=d,e[21]=p):p=e[21],p}function Oe(t){return t.stopPropagation()}function Ee(t){return t.stopPropagation()}function z(t){const e=S.c(23),{onOpen:s,children:i,className:n,draggable:r,onDragStart:l,onContextMenu:c,onDragOver:o,onDrop:f,onDragLeave:u}=t,[m,x]=P.useState(!1);let d;e[0]!==s?(d=g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s())},e[0]=s,e[1]=d):d=e[1];let p;e[2]!==o||e[3]!==f?(p=g=>{o?.(g),f&&(g.preventDefault(),x(!0))},e[2]=o,e[3]=f,e[4]=p):p=e[4];let h;e[5]!==u?(h=g=>{u?.(g),x(!1)},e[5]=u,e[6]=h):h=e[6];let b;e[7]!==f?(b=g=>{f?.(g),x(!1)},e[7]=f,e[8]=b):b=e[8];const y=m&&f&&"border-primary bg-primary/5";let w;e[9]!==n||e[10]!==y?(w=F("group/card flex cursor-pointer flex-col gap-3 rounded-2xl border border-border bg-background p-4 text-left transition-colors hover:border-border hover:bg-muted/40",y,n),e[9]=n,e[10]=y,e[11]=w):w=e[11];let j;return e[12]!==i||e[13]!==r||e[14]!==c||e[15]!==l||e[16]!==s||e[17]!==d||e[18]!==p||e[19]!==h||e[20]!==b||e[21]!==w?(j=a.jsx("div",{role:"button",tabIndex:0,draggable:r,onClick:s,onKeyDown:d,onDragStart:l,onContextMenu:c,onDragOver:p,onDragLeave:h,onDrop:b,className:w,children:i}),e[12]=i,e[13]=r,e[14]=c,e[15]=l,e[16]=s,e[17]=d,e[18]=p,e[19]=h,e[20]=b,e[21]=w,e[22]=j):j=e[22],j}function I(t){const e=S.c(20),{icon:s,name:i,meta:n,subtitle:r,publicState:l,actions:c,t:o}=t;let f;e[0]!==i?(f=a.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",title:i,children:i}),e[0]=i,e[1]=f):f=e[1];let u;e[2]!==l||e[3]!==o?(u=l&&a.jsx(ne,{state:l,t:o}),e[2]=l,e[3]=o,e[4]=u):u=e[4];let m;e[5]!==n?(m=n&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:n}),e[5]=n,e[6]=m):m=e[6];let x;e[7]!==f||e[8]!==u||e[9]!==m?(x=a.jsxs("div",{className:"flex items-start gap-3",children:[f,u,m]}),e[7]=f,e[8]=u,e[9]=m,e[10]=x):x=e[10];let d;e[11]!==r?(d=r&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",title:r,children:r}),e[11]=r,e[12]=d):d=e[12];let p;e[13]!==x||e[14]!==d?(p=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[x,d]}),e[13]=x,e[14]=d,e[15]=p):p=e[15];let h;return e[16]!==c||e[17]!==s||e[18]!==p?(h=a.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s,p,c]}),e[16]=c,e[17]=s,e[18]=p,e[19]=h):h=e[19],h}function ft(t){const e=S.c(24),{name:s,meta:i,subtitle:n,glyph:r,tone:l,readOnly:c,publicState:o,onOpen:f,onShare:u,onDelete:m,draggable:x,onDragStart:d,onContextMenu:p,onDrop:h}=t,b=M();let y;e[0]!==r||e[1]!==c||e[2]!==l?(y=a.jsx(de,{glyph:r,tone:l,readOnly:c,className:"size-8 shrink-0"}),e[0]=r,e[1]=c,e[2]=l,e[3]=y):y=e[3];let w;e[4]!==s||e[5]!==m||e[6]!==u||e[7]!==b?(w=a.jsx(q,{label:s,onShare:u,onDelete:m,t:b}),e[4]=s,e[5]=m,e[6]=u,e[7]=b,e[8]=w):w=e[8];let j;e[9]!==i||e[10]!==s||e[11]!==o||e[12]!==n||e[13]!==b||e[14]!==y||e[15]!==w?(j=a.jsx(I,{icon:y,name:s,meta:i,subtitle:n,publicState:o,actions:w,t:b}),e[9]=i,e[10]=s,e[11]=o,e[12]=n,e[13]=b,e[14]=y,e[15]=w,e[16]=j):j=e[16];let g;return e[17]!==x||e[18]!==p||e[19]!==d||e[20]!==h||e[21]!==f||e[22]!==j?(g=a.jsx(z,{onOpen:f,draggable:x,onDragStart:d,onContextMenu:p,onDrop:h,children:j}),e[17]=x,e[18]=p,e[19]=d,e[20]=h,e[21]=f,e[22]=j,e[23]=g):g=e[23],g}function dt(t){const e=S.c(25),{layout:s,size:i,filename:n,updatedAt:r,downloadUrl:l,subtitle:c,publicState:o,onOpen:f,onShare:u,onDelete:m,draggable:x,onDragStart:d,onContextMenu:p}=t,h=s===void 0?"card":s,b=i===void 0?0:i,y=M(),w=h==="row"&&"flex-row items-center gap-3 rounded-none border-0 border-b border-border/60 px-3 py-3";let j;e[0]!==w?(j=F(w),e[0]=w,e[1]=j):j=e[1];let g;e[2]!==l||e[3]!==n||e[4]!==h||e[5]!==m||e[6]!==u||e[7]!==o||e[8]!==c||e[9]!==y||e[10]!==r?(g=h==="row"?a.jsxs(a.Fragment,{children:[a.jsx(O,{filename:n,className:"h-7 w-6 shrink-0"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[a.jsx("span",{className:"truncate",children:n}),o&&a.jsx(ne,{state:o,t:y})]}),c&&a.jsx("p",{className:"truncate text-xs text-muted-foreground",children:c})]}),a.jsx("span",{className:"hidden w-32 shrink-0 truncate text-xs text-muted-foreground @min-xl/library-files:block",children:G(n)}),a.jsx("span",{className:"w-20 shrink-0 text-right text-xs text-muted-foreground",children:E(r)}),a.jsx(U,{downloadUrl:l,filename:n,onShare:u,onDelete:m,t:y})]}):a.jsx(I,{icon:a.jsx(O,{filename:n,className:"h-8 w-6.5 shrink-0"}),name:n,meta:E(r),subtitle:c??G(n),publicState:o,actions:a.jsx(U,{downloadUrl:l,filename:n,onShare:u,onDelete:m,t:y}),t:y}),e[2]=l,e[3]=n,e[4]=h,e[5]=m,e[6]=u,e[7]=o,e[8]=c,e[9]=y,e[10]=r,e[11]=g):g=e[11];let v;e[12]!==l||e[13]!==n||e[14]!==h||e[15]!==b?(v=h==="media"&&a.jsx(Le,{filename:n,size:b,downloadUrl:l}),e[12]=l,e[13]=n,e[14]=h,e[15]=b,e[16]=v):v=e[16];let _;return e[17]!==x||e[18]!==p||e[19]!==d||e[20]!==f||e[21]!==j||e[22]!==g||e[23]!==v?(_=a.jsxs(z,{onOpen:f,draggable:x,onDragStart:d,onContextMenu:p,className:j,children:[g,v]}),e[17]=x,e[18]=p,e[19]=d,e[20]=f,e[21]=j,e[22]=g,e[23]=v,e[24]=_):_=e[24],_}function ut(t){const e=S.c(29),{dirName:s,updatedAt:i,skillMdUrl:n,publicState:r,onOpen:l,onBrowse:c,onShare:o,onDelete:f,draggable:u,onDragStart:m,onContextMenu:x}=t,d=M(),{data:p}=X(n);let h;e[0]!==p?(h=p?ue(p):null,e[0]=p,e[1]=h):h=e[1];const b=h;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:a.jsx(fe,{size:16})}),e[2]=y):y=e[2];const w=b?.name??s;let j;e[3]!==i?(j=E(i),e[3]=i,e[4]=j):j=e[4];let g;e[5]!==d?(g=d("library.cards.skill"),e[5]=d,e[6]=g):g=e[6];let v;e[7]!==s||e[8]!==c||e[9]!==f||e[10]!==o||e[11]!==d?(v=a.jsx(q,{label:s,onBrowse:c,onShare:o,onDelete:f,t:d}),e[7]=s,e[8]=c,e[9]=f,e[10]=o,e[11]=d,e[12]=v):v=e[12];let _;e[13]!==r||e[14]!==d||e[15]!==w||e[16]!==j||e[17]!==g||e[18]!==v?(_=a.jsx(I,{icon:y,name:w,meta:j,subtitle:g,publicState:r,actions:v,t:d}),e[13]=r,e[14]=d,e[15]=w,e[16]=j,e[17]=g,e[18]=v,e[19]=_):_=e[19];const D=b?.description??"";let N;e[20]!==D?(N=a.jsx("p",{className:"line-clamp-2 min-h-8 text-xs leading-4 text-muted-foreground",children:D}),e[20]=D,e[21]=N):N=e[21];let $;return e[22]!==u||e[23]!==x||e[24]!==m||e[25]!==l||e[26]!==_||e[27]!==N?($=a.jsxs(z,{onOpen:l,draggable:u,onDragStart:m,onContextMenu:x,children:[_,N]}),e[22]=u,e[23]=x,e[24]=m,e[25]=l,e[26]=_,e[27]=N,e[28]=$):$=e[28],$}function mt(t){const e=S.c(45),{dirName:s,updatedAt:i,tokensUrl:n,onOpen:r,onBrowse:l,onDelete:c,draggable:o,onDragStart:f,onContextMenu:u}=t,m=M(),{data:x}=X(n);let d,p,h,b,y,w,j,g;if(e[0]!==x||e[1]!==s||e[2]!==o||e[3]!==l||e[4]!==u||e[5]!==c||e[6]!==f||e[7]!==r||e[8]!==m||e[9]!==i){const D=x?je(x).filter(Fe).slice(0,6):[];d=z,b=r,y=o,w=f,j=u;let N;e[18]===Symbol.for("react.memo_cache_sentinel")?(N=a.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:a.jsx(ce,{size:16})}),e[18]=N):N=e[18];let $;e[19]!==i?($=E(i),e[19]=i,e[20]=$):$=e[20];let C;e[21]!==m?(C=m("library.cards.brand"),e[21]=m,e[22]=C):C=e[22];let k;e[23]!==s||e[24]!==l||e[25]!==c||e[26]!==m?(k=a.jsx(q,{label:s,onBrowse:l,onDelete:c,t:m}),e[23]=s,e[24]=l,e[25]=c,e[26]=m,e[27]=k):k=e[27],e[28]!==s||e[29]!==m||e[30]!==C||e[31]!==k||e[32]!==$?(g=a.jsx(I,{icon:N,name:s,meta:$,subtitle:C,actions:k,t:m}),e[28]=s,e[29]=m,e[30]=C,e[31]=k,e[32]=$,e[33]=g):g=e[33],p="flex min-h-5 items-center gap-1.5",h=D.map(Me),e[0]=x,e[1]=s,e[2]=o,e[3]=l,e[4]=u,e[5]=c,e[6]=f,e[7]=r,e[8]=m,e[9]=i,e[10]=d,e[11]=p,e[12]=h,e[13]=b,e[14]=y,e[15]=w,e[16]=j,e[17]=g}else d=e[10],p=e[11],h=e[12],b=e[13],y=e[14],w=e[15],j=e[16],g=e[17];let v;e[34]!==p||e[35]!==h?(v=a.jsx("div",{className:p,children:h}),e[34]=p,e[35]=h,e[36]=v):v=e[36];let _;return e[37]!==d||e[38]!==b||e[39]!==y||e[40]!==w||e[41]!==j||e[42]!==g||e[43]!==v?(_=a.jsxs(d,{onOpen:b,draggable:y,onDragStart:w,onContextMenu:j,children:[g,v]}),e[37]=d,e[38]=b,e[39]=y,e[40]=w,e[41]=j,e[42]=g,e[43]=v,e[44]=_):_=e[44],_}function Me(t){return a.jsx("span",{className:"size-5 rounded-full border border-border/60",style:{backgroundColor:t.value},title:`${t.name}: ${t.value}`},t.name)}function Fe(t){return t.isColor}function B(t){const e=S.c(4),{children:s}=t,[i,n]=P.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>o=>{if(!o)return;const f=new IntersectionObserver(u=>{const[m]=u;m?.isIntersecting&&(n(!0),f.disconnect())},{rootMargin:"200px"});f.observe(o)},e[0]=r):r=e[0];const[l]=P.useState(r);if(i){let o;return e[1]!==s?(o=a.jsx(a.Fragment,{children:s}),e[1]=s,e[2]=o):o=e[2],o}let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("div",{ref:l,className:"h-full w-full"}),e[3]=c):c=e[3],c}function Re(t){const e=S.c(4),{url:s}=t,{data:i}=X(s);if(!i)return null;let n;e[0]!==i?(n=i.slice(0,2e3),e[0]=i,e[1]=n):n=e[1];let r;return e[2]!==n?(r=a.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:n}),e[2]=n,e[3]=r):r=e[3],r}function ze(t){const e=S.c(23),{url:s,ext:i}=t;let n;e[0]!==s?(n=R.csvThumb(s),e[0]=s,e[1]=n):n=e[1];let r;e[2]!==s?(r=()=>ke(s,{headers:{Range:"bytes=0-8191"}}),e[2]=s,e[3]=r):r=e[3];let l;e[4]!==n||e[5]!==r?(l={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=l):l=e[6];const{data:c}=W(l);if(!c)return null;const o=i==="tsv"?" ":",";let f,u,m,x;if(e[7]!==c||e[8]!==o){x=Symbol.for("react.early_return_sentinel");e:{let b;e[13]!==o?(b=w=>w.split(o).slice(0,6).map(Pe),e[13]=o,e[14]=b):b=e[14];const y=c.split(`
|
|
8
|
+
`).filter(Boolean).slice(0,7).map(b);if(y.length===0){x=null;break e}m="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",u="w-full border-collapse",f=y.map(Ie)}e[7]=c,e[8]=o,e[9]=f,e[10]=u,e[11]=m,e[12]=x}else f=e[9],u=e[10],m=e[11],x=e[12];if(x!==Symbol.for("react.early_return_sentinel"))return x;let d;e[15]!==f?(d=a.jsx("tbody",{children:f}),e[15]=f,e[16]=d):d=e[16];let p;e[17]!==u||e[18]!==d?(p=a.jsx("table",{className:u,children:d}),e[17]=u,e[18]=d,e[19]=p):p=e[19];let h;return e[20]!==m||e[21]!==p?(h=a.jsx("div",{className:m,children:p}),e[20]=m,e[21]=p,e[22]=h):h=e[22],h}function Ie(t,e){return a.jsx("tr",{className:F(e===0&&"bg-muted/50 font-medium"),children:t.map(Be)},e)}function Be(t,e){return a.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:a.jsx("span",{className:"block truncate",children:t})},e)}function Pe(t){return t.trim().replace(/^"|"$/g,"")}function Le(t){const e=S.c(14),{filename:s,size:i,downloadUrl:n}=t;let r;if(e[0]!==n||e[1]!==s||e[2]!==i){const l=Ce(s);let c;if(ve.has(l)){let o;e[4]!==n?(o=a.jsx("img",{src:n,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=n,e[5]=o):o=e[5],c=o}else if(_e.has(l)){const o=`${n}#t=0.1`;let f;e[6]!==o?(f=a.jsx(B,{children:a.jsx("video",{src:o,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=o,e[7]=f):f=e[7],c=f}else if(l==="pdf"){let o;e[8]!==s?(o=a.jsx("div",{className:"flex h-full w-full items-center justify-center",children:a.jsx(O,{filename:s,className:"h-14 w-11 opacity-60"})}),e[8]=s,e[9]=o):o=e[9],c=o}else if(Se.has(l))c=a.jsx(B,{children:a.jsx(ze,{url:n,ext:l})});else if(Ne.has(l)&&i<=$e){let o;e[10]!==n?(o=a.jsx(B,{children:a.jsx(Re,{url:n})}),e[10]=n,e[11]=o):o=e[11],c=o}else{let o;e[12]!==s?(o=a.jsx("div",{className:"flex h-full w-full items-center justify-center",children:a.jsx(O,{filename:s,className:"h-14 w-11 opacity-60"})}),e[12]=s,e[13]=o):o=e[13],c=o}r=a.jsx("div",{className:"aspect-[400/265] w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",children:c}),e[0]=n,e[1]=s,e[2]=i,e[3]=r}else r=e[3];return r}const Ae=5e3;function Xe(t){return(t??[]).some(e=>!e.lastSyncedAt&&!e.lastSyncError)}function qe(){const t=S.c(7),{org:e}=L(),s=A();let i;t[0]!==e.id?(i=R.orgRepoSyncs(e.id),t[0]=e.id,t[1]=i):i=t[1];let n;t[2]!==s?(n=async()=>(await s.call("ORG_REPO_SYNC_LIST",{})).configs,t[2]=s,t[3]=n):n=t[3];let r;return t[4]!==i||t[5]!==n?(r={queryKey:i,staleTime:6e4,refetchInterval:Ge,queryFn:n},t[4]=i,t[5]=n,t[6]=r):r=t[6],W(r)}function Ge(t){return Xe(t.state.data)?Ae:!1}function pt(){const t=S.c(2),e=qe();let s;return t[0]!==e.data?(s=new Set((e.data??[]).map(Ke)),t[0]=e.data,t[1]=s):s=t[1],s}function Ke(t){return t.volume}function xt(){const t=S.c(12),{org:e}=L(),s=A(),i=J();let n;t[0]!==e||t[1]!==i?(n=()=>i.invalidateQueries({queryKey:R.orgRepoSyncs(e.id)}),t[0]=e,t[1]=i,t[2]=n):n=t[2];const r=n;let l;t[3]!==s?(l=async f=>(await s.call("ORG_REPO_SYNC_CREATE",f)).config,t[3]=s,t[4]=l):l=t[4];let c;t[5]!==r||t[6]!==s?(c=f=>{s.call("ORG_REPO_SYNC_RUN",{id:f.id}).catch(Ue).then(r)},t[5]=r,t[6]=s,t[7]=c):c=t[7];let o;return t[8]!==r||t[9]!==l||t[10]!==c?(o={mutationFn:l,onSuccess:c,onSettled:r},t[8]=r,t[9]=l,t[10]=c,t[11]=o):o=t[11],Z(o)}function Ue(){return null}function ht(){const t=S.c(8),{org:e}=L(),s=A(),i=J();let n;t[0]!==s?(n=c=>s.call("ORG_REPO_SYNC_DELETE",{id:c}),t[0]=s,t[1]=n):n=t[1];let r;t[2]!==e||t[3]!==i?(r=()=>i.invalidateQueries({queryKey:R.orgRepoSyncs(e.id)}),t[2]=e,t[3]=i,t[4]=r):r=t[4];let l;return t[5]!==n||t[6]!==r?(l={mutationFn:n,onSettled:r},t[5]=n,t[6]=r,t[7]=l):l=t[7],Z(l)}export{mt as B,ft as F,ut as S,dt as a,at as b,pt as c,xt as d,it as e,ct as f,ot as g,ht as h,je as p,E as t,qe as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,m as S,
|
|
1
|
+
import{c as u,m as S,o as r,e as y,K as c}from"./index-EcuFIS2a.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 m(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 q(i,a){const e=u.c(8);let s;e[0]!==i?(s=c.orgSsoConfig(i??""),e[0]=i,e[1]=s):s=e[1];let t;e[2]!==a?(t=()=>f(`/api/${a}/sso/config`,void 0,"Failed to fetch SSO config"),e[2]=a,e[3]=t):t=e[3];const n=!!i&&!!a;let o;return e[4]!==s||e[5]!==t||e[6]!==n?(o={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=o):o=e[7],S(o)}function C(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)},"Failed to save SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function O(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=()=>f(`/api/${a}/sso/config`,{method:"DELETE"},"Failed to delete SSO config"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}function h(i,a){const e=u.c(8),s=r();let t;e[0]!==a?(t=l=>f(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:l})},"Failed to toggle SSO enforcement"),e[0]=a,e[1]=t):t=e[1];let n;e[2]!==i||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(i)}),s.invalidateQueries({queryKey:c.orgSsoStatus(i)})},e[2]=i,e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=o):o=e[7],y(o)}export{q as a,C as b,O as c,h as d,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as R}from"./use-org-auth-client-8fDIgHEZ.js";import{a0 as b,m as P,K as y}from"./index-EcuFIS2a.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h,c as r,aQ as w,a0 as E,m as T,aE as x,K as A,W as F,a6 as N,o as P,e as $}from"./index-EcuFIS2a.js";import{D as z,o as D,a as U}from"./schema-FDf70VFI.js";import{r as k}from"./task-board-Dip4Wu9j.js";const b={organizationId:"",sidebar_items:null,enabled_plugins:null,coding_agent_mcp_excluded:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null},O={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function C(t,e){return{queryKey:A.organizationSettings(e),queryFn:async()=>{try{return await x(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...b,organizationId:e}}},staleTime:6e4}}function d(t){const e=r.c(6),{org:n}=E();let s;e[0]!==n.id||e[1]!==n.slug?(s=C(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let i;return e[3]!==s||e[4]!==o?(i={...s,select:o},e[3]=s,e[4]=o,e[5]=i):i=e[5],T(i)}function V(t,e){const n=r.c(3);let s;n[0]!==t||n[1]!==e?(s=C(e,t),n[0]=t,n[1]=e,n[2]=s):s=n[2];const{data:o}=T(s);return o??null}function m(){const t=r.c(9),{org:e}=E(),n=N(),s=P();let o;t[0]!==e||t[1]!==n?(o=async l=>{const u=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!u)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return u},t[0]=e,t[1]=n,t[2]=o):o=t[2];let i;t[3]!==e||t[4]!==s?(i=l=>{s.setQueryData(A.organizationSettings(e.id),u=>({...u??b,...l}))},t[3]=e,t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==o||t[7]!==i?(a={mutationFn:o,onSuccess:i},t[6]=o,t[7]=i,t[8]=a):a=t[8],$(a)}function L(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:O}function H(){const{data:t}=d(Q);return t??O}function Q(t){return L(t.simple_mode)}function J(){const t=r.c(7),e=m();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({simple_mode:i},a),s=(i,a)=>e.mutateAsync({simple_mode:i},a),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 X(){return c("reports_only")}function c(t){const e=r.c(5);let n;e[0]!==t?(n=i=>D(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=d(n);let o;return e[2]!==s||e[3]!==t?(o=s??z.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function G(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function tt(){const{data:t}=h.useSession();return G(t?.user?.email)}function et(){const t=r.c(9),{data:e}=h.useSession(),n=w();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||G(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,i=n.hostingControlPlaneGa===!0,a=n.monitorGa===!0,l=c("hosting_enabled"),u=c("deco_analytics_enabled"),I=c("e2e_enabled"),M=c("monitor_enabled"),R=c("experiments_enabled"),g=o||i||l,_=o||i||u,p=o||i||I,y=o||a||M,S=o||i||R;let f;return t[3]!==g||t[4]!==_||t[5]!==p||t[6]!==y||t[7]!==S?(f={hosting:g,analytics:_,e2e:p,monitor:y,experiments:S},t[3]=g,t[4]=_,t[5]=p,t[6]=y,t[7]=S,t[8]=f):f=t[8],f}function nt(){const{data:t}=d(v);return t??!1}function v(t){return U(t.flags)}function st(){const{data:t}=d(K);return t??!0}function K(t){return k(t.flags)}function ot(){const t=r.c(7),e=m();let n,s;t[0]!==e?(n=(i,a,l)=>e.mutate({flags:{[i]:a}},l),s=(i,a,l)=>e.mutateAsync({flags:{[i]:a}},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 it(){const t=r.c(2),{data:e}=d(Y);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function Y(t){return t.coding_agent_mcp_excluded}function at(){const t=r.c(5),e=m();let n;t[0]!==e?(n=(o,i)=>e.mutate({coding_agent_mcp_excluded:o},i),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 q(){const{data:t}=d(W);return t??null}function W(t){return t.registry_config}function lt(){const t=r.c(7),e=m();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({registry_config:i},a),s=(i,a)=>e.mutateAsync({registry_config:i},a),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 rt(){const t=r.c(5),{org:e}=E(),n=q();let s;t[0]!==e.id?(s=F.REGISTRY(e.id),t[0]=e.id,t[1]=s):s=t[1];const o=s;let i;return t[2]!==o||t[3]!==n?(i=a=>{if(!n)return a===o;const l=n.registries[a];return l?l.enabled:a===o},t[2]=o,t[3]=n,t[4]=i):i=t[4],i}export{c as a,V as b,et as c,H as d,rt as e,q as f,st as g,nt as h,ot as i,it as j,at as k,J as l,lt as m,tt as n,X as u};
|
package/dist/client/assets/{use-panel-navigate-WrD0KEYx.js → use-panel-navigate-IItrbgmN.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,f as g,u as S,
|
|
1
|
+
import{c as p,f as g,u as S,cX as _,d as b,k,cY as P,cZ as E}from"./index-EcuFIS2a.js";import{b as I}from"./thread-route-CHwqHPf_.js";import{a as R}from"./use-project-scope-CCxyXvEU.js";function x(e){const t=e.destination==="agent",a={thread:t?e.previous.thread:void 0,sidepanel:e.previous.sidepanel,autosend:t?e.previous.autosend:void 0};return{...e.update?e.update(a):a,mainpanel:void 0}}function T(){const e=p.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={structuralSharing:!0,select:j},e[0]=t):t=e[0],k(t)}function j(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData;if(a?.mainView||a?.siteEditorView)return{mainView:a.mainView,siteEditorView:a.siteEditorView}}return{mainView:void 0,siteEditorView:void 0}}function A(){const e=p.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=g(t);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[1]=o):o=e[1];const i=S(o),s={file:"file"in i&&typeof i.file=="string"?i.file:void 0,key:"key"in i&&typeof i.key=="string"?i.key:void 0,path:"path"in i&&typeof i.path=="string"?i.path:void 0},{mainView:r,siteEditorView:n}=T();return _({mainView:r,siteEditorView:n,params:a,search:s})}function D(){const e=p.c(11),t=b();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const o=g(a),i=I(),s=R(),r=o.org??"";let n;e[1]!==t||e[2]!==r||e[3]!==i||e[4]!==s?(n=(u,d)=>{const h=P(u),v=d?.virtualmcpid!==void 0||s!==null?"project":"organization",V=h.kind==="org-destination"||h.kind==="project-destination"&&v==="organization",w=y=>x({previous:y,destination:V?"organization":"agent",update:d?.search});E(t,{org:r,agentId:d?.virtualmcpid??i,tabId:u,destinationScope:v,search:w,replace:d?.replace??!0})},e[1]=t,e[2]=r,e[3]=i,e[4]=s,e[5]=n):n=e[5];const m=n;let c;e[6]!==t?(c=u=>t({to:".",search:z,replace:u?.replace??!0}),e[6]=t,e[7]=c):c=e[7];const f=c;let l;return e[8]!==f||e[9]!==m?(l={openPanel:m,closePanel:f},e[8]=f,e[9]=m,e[10]=l):l=e[10],l}function z(e){return{...e,mainpanel:!1,sidepanel:!0}}export{D as a,x as r,A as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as h,a0 as x,aQ as A,m as _,K as I}from"./index-EcuFIS2a.js";import{m as R}from"./match-site-slug-config-D3fUJ6vX.js";import{a as C}from"./use-file-configs-6ygOocDG.js";import{c as v}from"./use-organization-settings-DvtBymY3.js";import{r as D}from"./site-slug-uya6Wp4-.js";const a=["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations","experiments"],O=["overview","reports","board","site-editor"],T=1,W=["assets","hosting","e2e","analytics","cdn","experiments"];function k(t,e,s){if(!t)return{project:s??null,resolvedScopeId:null};const n=e?.id===t?e:s?.id===t?s:null;return{project:n,resolvedScopeId:n?t:null}}function L(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function y(t,e){const s=new Set(t??[]);if(e!==T)for(const n of O)s.add(n);return a.filter(n=>s.has(n))}function J(t){return a.some(e=>e===t)}function N(t){return W.some(e=>e===t)}function U(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,experiments:e.experiments,automations:!0}}function Y(t,e,s){const n=U(e,s);return t?n:{...n,overview:!0,reports:!0,board:!0}}function z(t,e,s){const n=new Set(y(t,s));return a.filter(r=>e[r]&&n.has(r))}function G(t,e,s){return s||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function H(t){return a.filter(e=>t[e])}function B(t,e,s){return!J(t)||e[t]?!1:N(t)?!(t==="assets"?s.assets:s.siteAccess):!0}function X(t,e,s,n,r){return B(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,s)||t==="content"&&!n.includes("content")||t==="code"&&r&&!n.includes("code")}function Z(t,e,s,n){const r=new Set(y(t,n));return s?r.add(e):r.delete(e),a.filter(i=>r.has(i))}function M(t){const e=h.c(11),{org:s}=x(),n=A(),r=v(),i=C(),c=D(t),u=n.hostingEnabled===!0,V=n.monitorEnabled===!0||n.auth.localMode===!0,w=(u||V)&&!!c,E=_({queryKey:I.hostingAccess(s.slug,c??""),queryFn:async()=>{const j=await fetch(`/api/${s.slug}/hosting/${encodeURIComponent(c??"")}/access`);return j.ok?await j.json():{owned:!1,canWrite:!1}},enabled:w,staleTime:6e4}),l=E.data?.owned===!0,f=!!R(i.data?.configs??[],c),p=u&&l&&r.hosting,g=u&&l&&r.e2e,m=u&&l&&r.analytics,S=V&&l&&r.monitor;let o;e[0]!==r.experiments||e[1]!==f||e[2]!==p||e[3]!==g||e[4]!==m||e[5]!==S?(o={assets:f,hosting:p,e2e:g,analytics:m,cdn:S,experiments:r.experiments},e[0]=r.experiments,e[1]=f,e[2]=p,e[3]=g,e[4]=m,e[5]=S,e[6]=o):o=e[6];const b=!!c&&i.isPending,P=w&&E.isPending;let d;return e[7]!==o||e[8]!==b||e[9]!==P?(d={presence:o,assetsPending:b,siteAccessPending:P},e[7]=o,e[8]=b,e[9]=P,e[10]=d):d=e[10],d}export{W as P,T as a,k as b,Y as c,X as d,y as e,B as f,H as g,G as h,U as p,L as r,z as s,Z as t,M as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as A,f as _,u as R,d as T,ab as k,c_ as C,c$ as N,d0 as j,cZ as E,aa as b}from"./index-EcuFIS2a.js";import{e as w,d as D}from"./use-virtual-mcp-Ji9vcgUj.js";import{b as y,p as H}from"./github-repo-BknN0SVI.js";function F(t){if(typeof t!="object"||t===null)return!1;const s=t.githubRepo?.url;return typeof s=="string"&&s.length>0}function J(t){return y(t).status==="attached"}function K(t){const e=y(t).status;return e==="attached"||e==="detached"}function O(t){const e=new Set;for(const s of t??[]){const n=s.metadata?.liveAgentId;typeof n=="string"&&n&&e.add(s.id)}return e}function L(t,e){if(!t)return null;const s=t.metadata?.liveAgentId;if(typeof s=="string"&&s)return(e??[]).find(a=>a.id===s)?{mode:"dev",targetId:s}:null;const n=(e??[]).find(o=>o.metadata?.liveAgentId===t.id);return n?{mode:"live",targetId:n.id}:null}const G=1;function S(t){const e=t??[],s=O(e);return e.filter(n=>!s.has(n.id)&&!C(n.id)&&!N(n.id)&&!j(n.id))}function M(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=_(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[1]=n):n=t[1];const o=R(n);if(s.agentId)return s.agentId;let a;return t[2]!==o?(a="virtualmcpid"in o&&typeof o.virtualmcpid=="string"?o.virtualmcpid.trim():void 0,t[2]=o,t[3]=a):a=t[3],a||null}function U(){const t=A.c(16),e=T();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=_(s),o=k(),a=w(),c=S(a),i=M(),P=c.find(r=>r.id===i)??null;let l;t[1]!==a||t[2]!==i?(l=i&&a.length>0&&!a.some(r=>r.id===i)?i:null,t[1]=a,t[2]=i,t[3]=l):l=t[3];const I=D(l),d=P??S(I?[I]:[])[0]??null;let u;t[4]!==o||t[5]!==e||t[6]!==n||t[7]!==i?(u=r=>{if(r===i&&o!==void 0)return;const v=n.org??"",h=V;if(r){E(e,{org:v,agentId:r,tabId:o==="board"||o==="reports"?o:"overview",search:h,replace:!1});return}if(o==="board"){e({to:b.tasks,params:{org:v,taskKey:void 0},search:h});return}e({to:b.home,params:{org:v},search:h})},t[4]=o,t[5]=e,t[6]=n,t[7]=i,t[8]=u):u=t[8];const m=u,g=H(d),p=c.length>=G;let f;return t[9]!==d||t[10]!==c||t[11]!==i||t[12]!==m||t[13]!==g||t[14]!==p?(f={scopeId:i,project:d,repo:g,projects:c,hasProjects:p,setScope:m},t[9]=d,t[10]=c,t[11]=i,t[12]=m,t[13]=g,t[14]=p,t[15]=f):f=t[15],f}function V(t){return{...t,virtualmcpid:void 0,thread:void 0,mainpanel:void 0}}export{M as a,F as b,K as c,J as d,L as f,O as g,S as s,U as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as C,a0 as R,W as u}from"./index-EcuFIS2a.js";import{u as y}from"./use-connection-BKZRi94S.js";import{f as I}from"./use-organization-settings-DvtBymY3.js";function E(){const e=C.c(19),{org:i}=R(),o=I();let l;e[0]!==i.id?(l=u.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=u.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const m of s)t.add(m)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const a=y();let n;e[12]!==a?(n=a??[],e[12]=a,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=m=>t.has(m.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{E as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as N,a0 as Q,o as k}from"./index-EcuFIS2a.js";import{a as E,c as P}from"./use-virtual-mcp-Ji9vcgUj.js";import{r as z}from"./serial-task-queue-CGOeQgpr.js";function O(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function B(t){return t?.name||t?.email?.split("@")[0]||void 0}function F(t){const e=O(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function T(t,e){return t.some(s=>s.branch===e.branch)?t:[...t,e]}function V(t,e){return t.filter(s=>s.branch!==e)}function _(t,e,s){return t.map(o=>o.branch===e?{...o,name:s}:o)}const S=["orange","violet","blue","pink","amber","teal"];function K(t){return S[t%S.length]}function W(t,e){const s=`${e} `,o=t.reduce((u,n)=>{if(!n.name.startsWith(s))return u;const l=Number(n.name.slice(s.length));return Number.isInteger(l)&&l>u?l:u},0);return`${e} ${o+1}`}const j={orange:"bg-orange-500",violet:"bg-violet-500",blue:"bg-blue-500",pink:"bg-pink-500",amber:"bg-amber-500",teal:"bg-teal-500"};function G(t){return t&&j[t]||"bg-muted-foreground"}function H(t){const e=N.c(26),s=E(t),o=P(),{org:u}=Q(),n=k();let l;e[0]!==s?.metadata?.releases?(l=s?.metadata?.releases??[],e[0]=s?.metadata?.releases,e[1]=l):l=e[1];const f=l;let b;e[2]!==u||e[3]!==t?(b=a=>a[1]===u.id&&a[3]==="collection"&&a[4]==="VIRTUAL_MCP"&&a[5]===t,e[2]=u,e[3]=t,e[4]=b):b=e[4];const m=b;let d;e[5]!==m||e[6]!==n||e[7]!==f?(d=()=>{for(const[,a]of n.getQueriesData({predicate:r=>m(r.queryKey)}))if(a?.item)return a.item.metadata?.releases??[];return f},e[5]=m,e[6]=n,e[7]=f,e[8]=d):d=e[8];const $=d;let p;e[9]!==o||e[10]!==m||e[11]!==n||e[12]!==$||e[13]!==t?(p=a=>z(`vm-releases:${t}`,async()=>{const r=$(),g=a(r);if(g!==r){n.setQueriesData({predicate:c=>m(c.queryKey)},c=>c?.item?{item:{...c.item,metadata:{...c.item.metadata,releases:g}}}:c);try{await o.update.mutateAsync({id:t,data:{metadata:{releases:g}}})}catch(c){const w=c;throw n.invalidateQueries({predicate:A=>m(A.queryKey)}),w}}}),e[9]=o,e[10]=m,e[11]=n,e[12]=$,e[13]=t,e[14]=p):p=e[14];const i=p;let R;e[15]!==i?(R=a=>i(r=>T(r,a)),e[15]=i,e[16]=R):R=e[16];const y=R;let h;e[17]!==i?(h=(a,r)=>i(g=>_(g,a,r)),e[17]=i,e[18]=h):h=e[18];const D=h;let C;e[19]!==i?(C=a=>i(r=>V(r,a)),e[19]=i,e[20]=C):C=e[20];const L=C;let x;return e[21]!==y||e[22]!==L||e[23]!==f||e[24]!==D?(x={releases:f,createRelease:y,renameRelease:D,deleteRelease:L},e[21]=y,e[22]=L,e[23]=f,e[24]=D,e[25]=x):x=e[25],x}export{W as a,B as b,F as g,K as n,G as r,H as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as N,a0 as Q,W as F,z as A,m as f,K as T,dL as h,J as K,C as D}from"./index-EcuFIS2a.js";import{m as O}from"./use-mcp-client-B_gcvvCy.js";import{u as L}from"./companions-core-WMNDPuPs.js";function M(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}function U(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const b=2e4;function q(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function 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:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:T.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const R=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return L(R)}}),m=u.data?.item??null,{data:s,isError:y}=f({...O({connectionId:t,orgId:e.id,orgSlug:e.slug}),enabled:!!m}),C=T.reportsDiagnostic(e.id,t),E=!!s;let i;n[3]!==s?(i=async()=>{if(!s)throw new Error("cdClient not ready");const R=await s.callTool({name:h,arguments:{}});return L(R).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=U({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 _=s??null;let g;return n[16]!==t||n[17]!==r.isSuccess||n[18]!==c||n[19]!==_||n[20]!==P||n[21]!==a||n[22]!==S?(g={diagnostic:P,isSuccess:w,isLoading:a,siteUrl:S,host:c,connectionId:t,cdClient:_},n[16]=t,n[17]=r.isSuccess,n[18]=c,n[19]=_,n[20]=P,n[21]=a,n[22]=S,n[23]=g):g=n[23],g}function v(n){return n.state.status!=="error"&&M(n.state.data)==="generating"?b:!1}function z(n,e){return{to:K.app,params:{org:n.slug,agentId:D(n.id),connectionId:e,toolName:h},search:{}}}export{M as d,z as r,j as u};
|
package/dist/client/assets/{use-route-default-main-Djaj_cL9.js → use-route-default-main-BhbKsXCz.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,k as o}from"./index-
|
|
1
|
+
import{c as a,k as o}from"./index-EcuFIS2a.js";function c(){const e=a.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:r},e[0]=t):t=e[0],o(t)}function r(e){for(let t=e.matches.length-1;t>=0;t--){const n=e.matches[t]?.staticData.defaultMain;if(n)return n}return null}export{c as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,a0 as c,a6 as r,K as l,D as d,o as f,e as S}from"./index-EcuFIS2a.js";function C(){const e=u.c(7),{org:i}=c(),o=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]!==o?(t=async()=>await o.call("SECRET_LIST",{}),e[2]=o,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:n}=d(s);return n.secrets}function m(){const e=u.c(8),{org:i}=c(),o=r(),a=f();let t;e[0]!==o?(t=async y=>await o.call("SECRET_CREATE",{...y}),e[0]=o,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 n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{m as a,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as D,b as K,r as w,j as r,l as Q}from"./index-EcuFIS2a.js";import{z as q}from"./agent-icon-CTsmTxHg.js";import{i as Y}from"./SearchMd-Bb5gjLcX.js";import{D as Z,b as ee,d as te,c as re}from"./dialog-AoC07APJ.js";import{I as se}from"./input-Buz_7xoG.js";import{V as le,k as oe,W as ie,G as ne}from"./claim-phase-copy-0btUuJoC.js";import{d as X,r as ce}from"./section-preview-url-Csj0_ZDg.js";import{u as ae}from"./use-session-runtime-B5wMaHtP.js";const fe=12,z=new Set,F=new Set;function ue(){for(const s of F)s()}function de(s){return z.has(s)?!0:z.size>=fe?!1:(z.add(s),!0)}function J(s){z.delete(s)&&ue()}function me(s){return F.add(s),()=>{F.delete(s)}}function ve(s,e){const t=w.useRef(!1),[d,i]=w.useState(!1),o=w.useRef(null),f=w.useRef(null),c=w.useRef(null),l=w.useRef(s);l.current=s;const[a]=w.useState(()=>{const n=()=>{c.current?.(),c.current=null},u=()=>t.current?!0:de(e)?(t.current=!0,i(!0),n(),!0):!1;return v=>{if(f.current=v,o.current&&(o.current.disconnect(),o.current=null),n(),!v){t.current&&(J(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(f.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!c.current&&(c.current=me(()=>{f.current===v&&u()}));return}n(),t.current&&(J(e),t.current=!1,i(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),o.current=x})}});return{ref:a,iframeActive:d}}function pe(s){const e=D.c(8),{previewUrl:t,title:d,scrollRootRef:i,slotId:o}=s,{ref:f,iframeActive:c}=ve(i,o),[l,a]=w.useState(!1);let n;e[0]!==c||e[1]!==l||e[2]!==t||e[3]!==d?(n=c?r.jsxs(r.Fragment,{children:[!l&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(q,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${d}`,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:()=>a(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(q,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=c,e[1]=l,e[2]=t,e[3]=d,e[4]=n):n=e[4];let u;return e[5]!==f||e[6]!==n?(u=r.jsx("div",{ref:f,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:n}),e[5]=f,e[6]=n,e[7]=u):u=e[7],u}function xe(s){const e=D.c(26),{entry:t,previewUrl:d,scrollRootRef:i,onSelect:o}=s,f=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let c;e[0]!==f?(c=Q("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",f),e[0]=f,e[1]=c):c=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==d||e[5]!==i?(l=r.jsx(pe,{previewUrl:d,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=d,e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t.isSavedBlock?(a=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=a):a=e[8];let n;e[9]!==a?(n=r.jsx(q,{className:"h-4 w-4 shrink-0",style:a}),e[9]=a,e[10]=n):n=e[10];let u;e[11]!==t.title?(u=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=r.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==n||e[19]!==x?(m=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,x]}),e[18]=n,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==o||e[22]!==c||e[23]!==l||e[24]!==m?(h=r.jsxs("button",{type:"button",onClick:o,className:c,children:[l,m]}),e[21]=o,e[22]=c,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function ye(s){const e=D.c(51),{open:t,onOpenChange:d,meta:i,decofile:o,previewBaseUrl:f,onSelect:c}=s,l=K(),[a,n]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&n(""));let m,h,S,b,j,N,R,y,g,C,T;if(e[0]!==o||e[1]!==i||e[2]!==d||e[3]!==c||e[4]!==t||e[5]!==f||e[6]!==a||e[7]!==l){const W=t&&i&&o?le(i,o):[],_=i?oe(i):"",G=o?ie(o):void 0,V=new Map;if(t&&_)for(const p of W)V.set(p.resolveType,X(f,_,p.previewBlock,G));const M=a.trim().toLowerCase(),H=M?W.filter(p=>p.title.toLowerCase().includes(M)||p.resolveType.toLowerCase().includes(M)||p.description?.toLowerCase().includes(M)):W;h=Z,C=t,T=d,m=ee,R="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=r.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=O):O=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>n(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let k;e[27]!==a||e[28]!==B?(k=r.jsxs("div",{className:"relative pt-2",children:[O,r.jsx(se,{value:a,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=a,e[28]=B,e[29]=k):k=e[29],e[30]!==A||e[31]!==k?(g=r.jsxs(re,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,k]}),e[30]=A,e[31]=k,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=H.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:H.map(p=>r.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:V.get(p.resolveType)??X(f,_,p.previewBlock,G),onSelect:()=>c(p)},p.resolveType))}),e[0]=o,e[1]=i,e[2]=d,e[3]=c,e[4]=t,e[5]=f,e[6]=a,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=g,e[17]=C,e[18]=T}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],R=e[14],y=e[15],g=e[16],C=e[17],T=e[18];let P;e[33]!==S||e[34]!==b?(P=r.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=P):P=e[35];let I;e[36]!==P||e[37]!==j||e[38]!==N?(I=r.jsx("div",{ref:j,className:N,children:P}),e[36]=P,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==R||e[43]!==y||e[44]!==g?(L=r.jsxs(m,{closeButtonClassName:R,className:y,children:[g,I]}),e[40]=m,e[41]=I,e[42]=R,e[43]=y,e[44]=g,e[45]=L):L=e[45];let E;return e[46]!==h||e[47]!==L||e[48]!==C||e[49]!==T?(E=r.jsx(h,{open:C,onOpenChange:T,children:L}),e[46]=h,e[47]=L,e[48]=C,e[49]=T,e[50]=E):E=e[50],E}function Ce(s){const e=D.c(4),{previewServerUrl:t,runtime:d}=ae(s.virtualMcpId),i=d==="cms";let o;return e[0]!==i||e[1]!==s.sandboxUrl||e[2]!==t?(o=ce({sandboxUrl:s.sandboxUrl,previewServerUrl:t,fastPreviewActive:i}),e[0]=i,e[1]=s.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{ye as A,Ce as u};
|
package/dist/client/assets/{use-session-runtime-BR1aW1y5.js → use-session-runtime-B5wMaHtP.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h}from"./index-
|
|
1
|
+
import{c as h}from"./index-EcuFIS2a.js";import{r as R,d as T,a as k,p as S}from"./thread-intent-CTSjhfEo.js";import{u as j}from"./chat-context-ELO8A2Ar.js";import{a as w}from"./use-virtual-mcp-Ji9vcgUj.js";function D(d){const t=h.c(14),u=w(d),p=j(),e=u?.metadata,o=p?.activeTask,m=o?.metadata?.runtime;let i;t[0]!==m?(i=S(m),t[0]=m,t[1]=i):i=t[1];const f=i,v=!!o&&!o.partial,l=o?.metadata;let a;t[2]!==e||t[3]!==l?(a=R(l,e),t[2]=e,t[3]=l,t[4]=a):a=t[4];const c=!!f||v&&!!u;let r;t[5]!==e?(r=T(e),t[5]=e,t[6]=r):r=t[6];let s;t[7]!==e?(s=k(e),t[7]=e,t[8]=s):s=t[8];let n;return t[9]!==a||t[10]!==c||t[11]!==r||t[12]!==s?(n={runtime:a,resolved:c,projectDefault:r,previewServerUrl:s},t[9]=a,t[10]=c,t[11]=r,t[12]=s,t[13]=n):n=t[13],n}export{D as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,a0 as f,a6 as y,m,o as g,e as T,K as l,t as E}from"./index-EcuFIS2a.js";function K(){const e=u.c(7),{locator:t}=f(),o=y();let n;e[0]!==t?(n=l.tags(t),e[0]=t,e[1]=n):n=e[1];let s;e[2]!==o?(s=async()=>{const{tags:r}=await o.call("TAGS_LIST",{});return r},e[2]=o,e[3]=s):s=e[3];let a;return e[4]!==n||e[5]!==s?(a={queryKey:n,queryFn:s,staleTime:3e4},e[4]=n,e[5]=s,e[6]=a):a=e[6],m(a)}function p(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{tag:i}=await n.call("TAGS_CREATE",typeof c=="string"?{name:c}:c);return i},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:S},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function S(e){E.error(e instanceof Error?e.message:"Failed to create tag")}function C(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{await n.call("TAGS_DELETE",{tagId:c})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=()=>{t.invalidateQueries({queryKey:l.tags(o)}),t.invalidateQueries({queryKey:l.taskBoardItems(o)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:q},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function q(e){E.error(e instanceof Error?e.message:"Failed to delete tag")}function M(e){const t=u.c(10),{locator:o}=f(),n=y();let s;t[0]!==o||t[1]!==e?(s=l.memberTags(o,e),t[0]=o,t[1]=e,t[2]=s):s=t[2];let a;t[3]!==e||t[4]!==n?(a=async()=>{const{tags:i}=await n.call("MEMBER_TAGS_GET",{memberId:e});return i},t[3]=e,t[4]=n,t[5]=a):a=t[5];const r=!!e;let c;return t[6]!==s||t[7]!==a||t[8]!==r?(c={queryKey:s,queryFn:a,staleTime:3e4,enabled:r},t[6]=s,t[7]=a,t[8]=r,t[9]=c):c=t[9],m(c)}function A(){const e=u.c(8),t=g(),{locator:o}=f(),n=y();let s;e[0]!==n?(s=async c=>{const{memberId:i,tagIds:d}=c;return await n.call("MEMBER_TAGS_SET",{memberId:i,tagIds:d})},e[0]=n,e[1]=s):s=e[1];let a;e[2]!==o||e[3]!==t?(a=(c,i)=>{t.invalidateQueries({queryKey:l.memberTags(o,i.memberId)})},e[2]=o,e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r={mutationFn:s,onSuccess:a,onError:_},e[5]=s,e[6]=a,e[7]=r):r=e[7],T(r)}function _(e){E.error(e instanceof Error?e.message:"Failed to update member tags")}export{p as a,C as b,M as c,A as d,K as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as i,f as T,m as l,a0 as S,a6 as _,K as u,aE as O}from"./index-EcuFIS2a.js";const R=["TASK_BOARD_DELIVERY","TASK_BOARD_STUCK","TASK_BOARD_COST","TASK_BOARD_QUALITY","TASK_BOARD_ERRORS","TASK_BOARD_TENANTS"];function K(){const t=i.c(8),s=T({strict:!1}).org??"";let e;t[0]!==s?(e=u.taskBoardAdminOrgs(s),t[0]=s,t[1]=e):e=t[1];const n=!!s;let A;t[2]!==s?(A=()=>O(s,"TASK_BOARD_ADMIN_ORG_LIST",{}),t[2]=s,t[3]=A):A=t[3];let o;return t[4]!==e||t[5]!==n||t[6]!==A?(o={queryKey:e,enabled:n,queryFn:A,staleTime:3e5},t[4]=e,t[5]=n,t[6]=A,t[7]=o):o=t[7],l(o)}function a(t,s){const e=i.c(13),{locator:n}=S(),A=_();let o;e[0]!==n||e[1]!==s.from||e[2]!==s.org||e[3]!==s.to||e[4]!==t?(o=u.taskBoardAnalytics(n,t,s.org,s.from,s.to),e[0]=n,e[1]=s.from,e[2]=s.org,e[3]=s.to,e[4]=t,e[5]=o):o=e[5];let r;e[6]!==s||e[7]!==A||e[8]!==t?(r=()=>A.call(t,s),e[6]=s,e[7]=A,e[8]=t,e[9]=r):r=e[9];let c;return e[10]!==o||e[11]!==r?(c={queryKey:o,queryFn:r},e[10]=o,e[11]=r,e[12]=c):c=e[12],l(c)}export{R as A,a,K as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a0 as o,a6 as c,r as i,D as d,K as m}from"./index-EcuFIS2a.js";import{a as T}from"./hooks-D0dDgrIf.js";function h(e){const{org:n}=o(),r=c(),a=T(),s=i.useSyncExternalStore(a.threads.subscribe,a.threads.get),u=e===null?null:s.find(t=>t.id===e)??null,{data:l}=d({queryKey:m.ensureTask(n.id,e),queryFn:async()=>{if(e===null)return null;try{const{item:t}=await r.call("COLLECTION_THREADS_GET",{id:e});return t??null}catch{return null}},select:t=>t?.metadata??null,staleTime:3e4});return u?.metadata??l??null}export{h as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c,a0 as i,m as l,K as p}from"./index-EcuFIS2a.js";import{f}from"./chat-context-ELO8A2Ar.js";async function m(e,s){const t=await fetch(`/api/${s}/threads/${encodeURIComponent(e)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function $(){const e=c.c(2),s=f()?.messages??[];let t;return e[0]!==s?(t=s.some(y),e[0]=s,e[1]=t):t=e[1],t}function y(e){return e.parts?.some(b)}function b(e){const s=e;return(s.type==="tool-bash"||s.type==="tool-write")&&s.state==="output-available"}function g(e,s){const t=c.c(9),{org:u}=i();let o;t[0]!==e?(o=p.threadOutputs(e??""),t[0]=e,t[1]=o):o=t[1];let n;t[2]!==u||t[3]!==e?(n=()=>m(e??"",u.slug),t[2]=u,t[3]=e,t[4]=n):n=t[4];const r=!!e&&(s?.enabled??!0);let a;return t[5]!==o||t[6]!==n||t[7]!==r?(a={queryKey:o,queryFn:n,enabled:r,staleTime:0},t[5]=o,t[6]=n,t[7]=r,t[8]=a):a=t[8],l(a)}export{g as a,$ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,r as f}from"./index-
|
|
1
|
+
import{c as p,r as f}from"./index-EcuFIS2a.js";import{u as w}from"./use-mobile-BZ15DgEB.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
|