decocms 4.371.5 → 4.372.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-DvBbVFl2.js → AlertCircle-DbwtWnTP.js} +1 -1
- package/dist/client/assets/{AreaChart-CNXBC2N-.js → AreaChart-tdrxZdfF.js} +1 -1
- package/dist/client/assets/{ArrowLeft-wI4krJ9Y.js → ArrowLeft-CyH6aWpS.js} +1 -1
- package/dist/client/assets/{ArrowRight-CJoVEu8j.js → ArrowRight-Bv0iX4wy.js} +1 -1
- package/dist/client/assets/{ArrowUp-C1e0rkBx.js → ArrowUp-Scf6R8DX.js} +1 -1
- package/dist/client/assets/{CartesianChart-B1JNpS0v.js → CartesianChart-D1MxLL7k.js} +1 -1
- package/dist/client/assets/{Check-Cxzkl-yh.js → Check-BZE0WrNL.js} +1 -1
- package/dist/client/assets/{CheckCircle-DDBAaANE.js → CheckCircle-BKb1RVrA.js} +1 -1
- package/dist/client/assets/{ChevronRight-Di63O0-s.js → ChevronRight-DNrwFBnC.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-UUOgZ2AB.js → ChevronSelectorVertical-oXn0cTzk.js} +1 -1
- package/dist/client/assets/{ChevronUp-C3BACdf2.js → ChevronUp-D5_IWEtB.js} +1 -1
- package/dist/client/assets/{Copy01-Bv1k7w6n.js → Copy01-DTHuBaTA.js} +1 -1
- package/dist/client/assets/{CreditCard01-CccHRTMw.js → CreditCard01-CwX6pA0M.js} +1 -1
- package/dist/client/assets/{Database01-DVg7hkmv.js → Database01-RGlwXHSd.js} +1 -1
- package/dist/client/assets/{DotsVertical-lajzikiZ.js → DotsVertical-DE9eZKrJ.js} +1 -1
- package/dist/client/assets/{Download01-BNWtA4eM.js → Download01-qX3hmvr5.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CnWQDTNc.js → ErrorBarContext-9sp0Dc4M.js} +1 -1
- package/dist/client/assets/{Eye-BZdMUyFo.js → Eye-DXUjft5i.js} +1 -1
- package/dist/client/assets/{File02-a9yLOR3g.js → File02-g-xJPix_.js} +1 -1
- package/dist/client/assets/{GitBranch01-D5TBCGBU.js → GitBranch01-ddoPQdPH.js} +1 -1
- package/dist/client/assets/{Globe01-APrZahgX.js → Globe01-DIy8wXF6.js} +1 -1
- package/dist/client/assets/{HardDrive-CG35ynrA.js → HardDrive-DU_z1AQw.js} +1 -1
- package/dist/client/assets/{Image01-BhGz13Q2.js → Image01-DfaxHjlV.js} +1 -1
- package/dist/client/assets/{Key01-CFB1jqqu.js → Key01-mqjfsZRe.js} +1 -1
- package/dist/client/assets/{Line-DDrDkd01.js → Line-D02_6GXf.js} +1 -1
- package/dist/client/assets/{Link01-Cd_6IOej.js → Link01-C656VtHx.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Bf93S5X1.js → LinkExternal01-BkRUjBAn.js} +1 -1
- package/dist/client/assets/{MessageCircle01-D8e4seU4.js → MessageCircle01-CgotMmLL.js} +1 -1
- package/dist/client/assets/{Monitor01-DFIqZEjO.js → Monitor01-CQ6Zk1oP.js} +1 -1
- package/dist/client/assets/{Package-BO4bTpkD.js → Package-t6euxYcP.js} +1 -1
- package/dist/client/assets/{Palette-BXvQWS6f.js → Palette-oECS8j3l.js} +1 -1
- package/dist/client/assets/{Play-2DhOE_I8.js → Play-DQgzDnaW.js} +1 -1
- package/dist/client/assets/{Plus-mTbvMfTr.js → Plus-D2HOi_DD.js} +1 -1
- package/dist/client/assets/{Printer-BXAxYkki.js → Printer-BpZBiqyG.js} +1 -1
- package/dist/client/assets/{SearchLg-Dhcwbcep.js → SearchLg-DbX4T5E-.js} +1 -1
- package/dist/client/assets/{SearchMd-odD-lg41.js → SearchMd-FDCJM3CR.js} +1 -1
- package/dist/client/assets/{Sector-DGpJVCkP.js → Sector-BW9tyobX.js} +1 -1
- package/dist/client/assets/{Settings02-Ky6GgfHc.js → Settings02-CFcKewXh.js} +1 -1
- package/dist/client/assets/{Share07-Di5cvJUV.js → Share07-CxuHcmnM.js} +1 -1
- package/dist/client/assets/{Shield01-DGqn0GF7.js → Shield01-HrKG6yUn.js} +1 -1
- package/dist/client/assets/{Stars01-D7Yd9FWF.js → Stars01-B_nM3FYf.js} +1 -1
- package/dist/client/assets/{Sun-lw0EfACM.js → Sun-SBoG-e9B.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DFrX1mB1.js → SwitchHorizontal01-hHr6GOmU.js} +1 -1
- package/dist/client/assets/{Tool01-CRVAydql.js → Tool01-DHi_Z7zo.js} +1 -1
- package/dist/client/assets/{Tool02-C5SroA8Z.js → Tool02-JY0gm8cg.js} +1 -1
- package/dist/client/assets/{Trash01-CpkPv_9i.js → Trash01-C6bziN5X.js} +1 -1
- package/dist/client/assets/{TrendUp01-BKZoyaLF.js → TrendUp01-Bkdgpfn7.js} +1 -1
- package/dist/client/assets/{Upload01-DrX9It_D.js → Upload01-DC2spim9.js} +1 -1
- package/dist/client/assets/{User01-KomMNUAk.js → User01-BbOpA84p.js} +1 -1
- package/dist/client/assets/{UserSquare-CiYReCPp.js → UserSquare-qgzToKNd.js} +1 -1
- package/dist/client/assets/{Users01-CUkpRrgA.js → Users01-BOsDT0Jv.js} +1 -1
- package/dist/client/assets/{Users03-Q8n4oEYP.js → Users03-BP-0DNhp.js} +1 -1
- package/dist/client/assets/{X-xvdY-IP3.js → X-Bzh3NI3m.js} +1 -1
- package/dist/client/assets/{XCircle-Cm0q40Bp.js → XCircle-CuK2q_XU.js} +1 -1
- package/dist/client/assets/{XClose-B0out0G8.js → XClose-Cvyz3reC.js} +1 -1
- package/dist/client/assets/{Zap-Ds3cA-1E.js → Zap-DXNovEva.js} +1 -1
- package/dist/client/assets/{ZoomOut-CkKqfrID.js → ZoomOut-BRjMa-04.js} +1 -1
- package/dist/client/assets/{access-gate-blDozGWR.js → access-gate-NMf18NsK.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BDIrfhzH.js → add-connection-dialog-GfufFuLz.js} +1 -1
- package/dist/client/assets/{agent-analytics-BV5JC5r_.js → agent-analytics-DKvARLL3.js} +1 -1
- package/dist/client/assets/agent-app-CQgi_fkJ.js +1 -0
- package/dist/client/assets/{agent-assets-CXjf1pVc.js → agent-assets-DePuap3v.js} +1 -1
- package/dist/client/assets/{agent-automation-E1FJgffp.js → agent-automation-NvLs9ax2.js} +1 -1
- package/dist/client/assets/{agent-automations-B_nM6Hcl.js → agent-automations-BV3f-ekl.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-D4-tWFb-.js → agent-connect-sources-DtqgR_Ib.js} +1 -1
- package/dist/client/assets/agent-deck-Dx12NQ18.js +1 -0
- package/dist/client/assets/{agent-e2e-C-OQSGO4.js → agent-e2e-CHL03ziT.js} +1 -1
- package/dist/client/assets/{agent-experiments-BI4okidg.js → agent-experiments-CWfra8gc.js} +1 -1
- package/dist/client/assets/agent-file-B5qivcOi.js +1 -0
- package/dist/client/assets/{agent-git-Dvq8Seyv.js → agent-git-CU-dqFim.js} +1 -1
- package/dist/client/assets/{agent-hosting-DrvWjfNg.js → agent-hosting-x-9xTx9o.js} +1 -1
- package/dist/client/assets/{agent-icon-CqLreCFl.js → agent-icon-BD4DM2Lv.js} +1 -1
- package/dist/client/assets/agent-library-file-OKK2mnnF.js +1 -0
- package/dist/client/assets/{agent-monitor-C5-kms7W.js → agent-monitor-CpVDwlgY.js} +1 -1
- package/dist/client/assets/{agent-overview-6rkN6b2F.js → agent-overview-SQDEg6Zv.js} +1 -1
- package/dist/client/assets/agent-settings-BraxsXkL.js +1 -0
- package/dist/client/assets/{agent-site-editor-D4WEaCig.js → agent-site-editor-BXrb3i4T.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-03I9o24S.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-BwEtJ4T2.js → agent-site-editor-content-C3uy2bqp.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-C_JrP8iZ.js → agent-site-editor-preview-BB-KqzfI.js} +3 -3
- package/dist/client/assets/agent-view-74_Cuyp8.js +1 -0
- package/dist/client/assets/{agent-view-guard-02MPEKYe.js → agent-view-guard-q_9RifUL.js} +1 -1
- package/dist/client/assets/{agents-list-DkNhFhW5.js → agents-list-BCgsEzHh.js} +1 -1
- package/dist/client/assets/{ai-providers-D-k5TiHj.js → ai-providers-DGgtE9F7.js} +1 -1
- package/dist/client/assets/{alert-BpxB9H28.js → alert-Cnsh1M35.js} +1 -1
- package/dist/client/assets/{alert-dialog-DvlBeRZ8.js → alert-dialog-Bi9Cy1y8.js} +1 -1
- package/dist/client/assets/{api-keys-CFO0TqPw.js → api-keys-BlYGdiam.js} +1 -1
- package/dist/client/assets/api-keys-ClN6LoeU.js +1 -0
- package/dist/client/assets/app-editor-CaCDGdiz.js +1 -0
- package/dist/client/assets/{asset-utils-Bo7_Zche.js → asset-utils-syVIRo9d.js} +1 -1
- package/dist/client/assets/{auth-CKeyq_SN.js → auth-D-2jYpOE.js} +1 -1
- package/dist/client/assets/{auth-catchall-BRUglBJo.js → auth-catchall-C3GEml6h.js} +1 -1
- package/dist/client/assets/{auth-entry-C8956edt.js → auth-entry-CJhH7CHs.js} +1 -1
- package/dist/client/assets/{auth-split-layout-TYbK0F1z.js → auth-split-layout-B3xBkE6i.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BXCIEb9M.js → authenticate-and-persist-oauth-2yRhuiER.js} +1 -1
- package/dist/client/assets/{automation-list-row-DlgjVXhV.js → automation-list-row-DVPV4sOa.js} +1 -1
- package/dist/client/assets/{automation-runs-D2wLuras.js → automation-runs-DnDgp3GT.js} +1 -1
- package/dist/client/assets/automations-XsBsFuGM.js +1 -0
- package/dist/client/assets/{autosend-CIiCHHwS.js → autosend-D-BN-cv5.js} +1 -1
- package/dist/client/assets/{avatar-DbDjz_Du.js → avatar-Duu5Gg02.js} +1 -1
- package/dist/client/assets/{badge-Du_nFAw4.js → badge-BNBGXxmC.js} +1 -1
- package/dist/client/assets/{block-document-BuKCa_oz.js → block-document-BT-7XjFG.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-COtWJivz.js → blocks-preview-workspace-context-BvM2Da4n.js} +1 -1
- package/dist/client/assets/{breadcrumb-BWN1-eL-.js → breadcrumb-sWWxibcS.js} +1 -1
- package/dist/client/assets/{buckets-KfTJhT70.js → buckets-Biauz5yB.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-1MAYpXbX.js → build-improve-prompt-doc-RalyChXZ.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-Be3E453p.js → bulk-category-panel-CODUgRdO.js} +1 -1
- package/dist/client/assets/{calendar-gEz3T8Nx.js → calendar-Dyov14Y_.js} +1 -1
- package/dist/client/assets/{capability-load-error-CCrUkwjh.js → capability-load-error-L3ivCxmO.js} +1 -1
- package/dist/client/assets/{cards-DH_a9rYw.js → cards-ojW-Mo-n.js} +1 -1
- package/dist/client/assets/category-editor-CFCxetoB.js +1 -0
- package/dist/client/assets/{chart-Ddl0aS6X.js → chart-Con9xnVz.js} +1 -1
- package/dist/client/assets/{chat-context--wnB8OwP.js → chat-context-BBVkwd3p.js} +1 -1
- package/dist/client/assets/{chat-draft-BcKBBuxe.js → chat-draft-bAtYgASI.js} +1 -1
- package/dist/client/assets/{checkbox-CDn9FtiK.js → checkbox-Dkejdmst.js} +1 -1
- package/dist/client/assets/{choose-editor-DXATx_XM.js → choose-editor-BKF6XAA7.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C_Hu_E3J.js → cli-auth-success-BUl2RZMr.js} +1 -1
- package/dist/client/assets/{client-icons-BJCNad4R.js → client-icons-DLMNndDc.js} +1 -1
- package/dist/client/assets/{collapsible-BXxfSgrJ.js → collapsible-n44mVpiB.js} +1 -1
- package/dist/client/assets/{collection-detail-TcNGooD4.js → collection-detail-B7MXGdLU.js} +1 -1
- package/dist/client/assets/{collection-display-button-DX_tFbek.js → collection-display-button-C3iXY6zC.js} +1 -1
- package/dist/client/assets/{collection-search-QXxUQBEV.js → collection-search-CeA9TK20.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BHPLfSHM.js → collection-table-wrapper-SWoJua5h.js} +1 -1
- package/dist/client/assets/{collection-tabs-Djjl9DeE.js → collection-tabs-3kW0qDG6.js} +1 -1
- package/dist/client/assets/{combobox-C2v7IR1r.js → combobox-Px3Uvt7K.js} +1 -1
- package/dist/client/assets/{command-DiiYEOpg.js → command-D2fiEFer.js} +1 -1
- package/dist/client/assets/{command-palette-store-BWoPJ6nr.js → command-palette-store-LVCQ6fRv.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-B1Bzna9Q.js → companion-mcps-section-BcoKVpmX.js} +1 -1
- package/dist/client/assets/{connect-DX5HC2F6.js → connect-DlipH902.js} +1 -1
- package/dist/client/assets/{connect-layout-CpgVqqqj.js → connect-layout-BQblJmFQ.js} +1 -1
- package/dist/client/assets/{connection-IJKDt107.js → connection-BfiO32wM.js} +1 -1
- package/dist/client/assets/{connection-card-CGNRKyOF.js → connection-card-83VJQMov.js} +1 -1
- package/dist/client/assets/{connection-detail-DZ9RTovJ.js → connection-detail-j_CvFKhd.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C-g1JeOF.js → connection-form-helpers-Ms_1nBbP.js} +1 -1
- package/dist/client/assets/{connections-D8guU7fO.js → connections-CERSp27f.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BLuhxE_t.js → create-organization-dialog-D0myNU26.js} +1 -1
- package/dist/client/assets/{decofile-api-CmVJnPGm.js → decofile-api-BVqR93jw.js} +1 -1
- package/dist/client/assets/{decopilot-CUS1CMeB.js → decopilot-72HlEf1U.js} +1 -1
- package/dist/client/assets/{dialog-P7nKOpzv.js → dialog-DbzCN1O8.js} +1 -1
- package/dist/client/assets/{discover-HGKN31xL.js → discover-D5kdY2vL.js} +1 -1
- package/dist/client/assets/{domain-settings-BVsB1XPJ.js → domain-settings-uVxQd7aQ.js} +1 -1
- package/dist/client/assets/{download-app-dialog-BL1dFfWU.js → download-app-dialog-Bsig7tOs.js} +1 -1
- package/dist/client/assets/{drawer-CxIpjRdt.js → drawer-CBdcJytm.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BfsxnUa0.js → dropdown-menu-Dd8nakK9.js} +1 -1
- package/dist/client/assets/{editor-CXcyGlES.js → editor-CpBx0ZCm.js} +1 -1
- package/dist/client/assets/{empty-state-DMD6mNdW.js → empty-state-BIcQyeij.js} +1 -1
- package/dist/client/assets/{empty-state-CjDpy9eU.js → empty-state-ClEXvr10.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DwqsKwas.js → extract-connection-data-CM8c_Wvw.js} +1 -1
- package/dist/client/assets/{feature-gate-DIfFBquO.js → feature-gate-BURkiaEd.js} +1 -1
- package/dist/client/assets/{feature-paywall-tbozEC7n.js → feature-paywall-BOwjYKin.js} +1 -1
- package/dist/client/assets/{file-explorer-Djy00IuA.js → file-explorer-BgbzlNyO.js} +1 -1
- package/dist/client/assets/{file-preview-C_SJoE1r.js → file-preview-BOFvyeTK.js} +1 -1
- package/dist/client/assets/{file-share-button-BZYG01SF.js → file-share-button-Doj91OJi.js} +1 -1
- package/dist/client/assets/{file-type-icon-CgWpVSlD.js → file-type-icon-C37FwvPU.js} +1 -1
- package/dist/client/assets/{folder-icon-_n7socYy.js → folder-icon-Dox5xEXV.js} +1 -1
- package/dist/client/assets/{form-D306U3SV.js → form-B7dtslOD.js} +1 -1
- package/dist/client/assets/{gateway-client-DGCwfPrr.js → gateway-client-CFIpVRaR.js} +1 -1
- package/dist/client/assets/{general-CogkCEuK.js → general-BcnikUr3.js} +1 -1
- package/dist/client/assets/{github-icon-BUCFfahn.js → github-icon-BcrkxW36.js} +1 -1
- package/dist/client/assets/{home-Dc8EKy9y.js → home-MrzklFP0.js} +1 -1
- package/dist/client/assets/{hooks-CUNvs2La.js → hooks-CkL4R3Tj.js} +1 -1
- package/dist/client/assets/{hooks-ChkSy8jk.js → hooks-D09Ti1PG.js} +1 -1
- package/dist/client/assets/{index-DX2SQGmg.js → index-B46P4HkV.js} +1 -1
- package/dist/client/assets/{index-xqCO1OT5.js → index-BFjKFLU3.js} +1 -1
- package/dist/client/assets/{index-DzTKEAfr.js → index-BwuwoN1w.js} +1 -1
- package/dist/client/assets/{index-CfyT02p0.js → index-C9w15wdL.js} +1 -1
- package/dist/client/assets/{index-BtBksYaT.js → index-CULK6hDm.js} +1 -1
- package/dist/client/assets/{index-CExp-jpH.js → index-CuiP-22D.js} +1 -1
- package/dist/client/assets/{index-BE-bpB6s.js → index-Cyoz5tz5.js} +1 -1
- package/dist/client/assets/{index-Bpw3Y5k_.js → index-D-XXgZ8p.js} +1 -1
- package/dist/client/assets/{index-Dn6rpyBU.js → index-D68Q2TT2.js} +1 -1
- package/dist/client/assets/{index-JwT2j16o.js → index-DLxUQ-f9.js} +1 -1
- package/dist/client/assets/{index-7M-DdZrv.js → index-DZOe0ODJ.js} +1 -1
- package/dist/client/assets/{index-CLL08oUq.js → index-G9Ugx8pT.js} +1 -1
- package/dist/client/assets/{index-B2zzbmky.js → index-KOGfrBZR.js} +1 -1
- package/dist/client/assets/{index-CWU70Bsp.js → index-NrvdR10n.js} +1 -1
- package/dist/client/assets/{index-redirect-BPc0IGq8.js → index-redirect-AuU1lkcv.js} +1 -1
- package/dist/client/assets/{index-BAe_o13_.js → index-z4bKt11m.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-DEPfmhJT.js → infiniteQueryObserver-BjcfJE2O.js} +1 -1
- package/dist/client/assets/{infra-billing-Dv5K2K4U.js → infra-billing-Blv1R6xm.js} +1 -1
- package/dist/client/assets/{input-DAZB1IQp.js → input-C7XH8Uj_.js} +1 -1
- package/dist/client/assets/{input-BSxVBqme.js → input-CSQboV8k.js} +1 -1
- package/dist/client/assets/{input-B12R82KE.js → input-I71U33T1.js} +1 -1
- package/dist/client/assets/{integration-icon-CCLad1Hm.js → integration-icon-DOHTaQ6D.js} +1 -1
- package/dist/client/assets/{label-B2x-OzbQ.js → label-8juC5J-g.js} +1 -1
- package/dist/client/assets/{last-preview-page-Dj534Vr-.js → last-preview-page-C8M_ayBL.js} +1 -1
- package/dist/client/assets/{layout-C0GUxl-u.js → layout-fdXIUmGR.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BT2pSszW.js → legacy-agents-deep-CIQ2cOBs.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BvTDuMyT.js → legacy-main-redirect-DdrzU7Xj.js} +1 -1
- package/dist/client/assets/{library-BVxjfVxJ.js → library-DyrbEVfm.js} +1 -1
- package/dist/client/assets/{login-41LOFYrM.js → login-BhC3su0G.js} +1 -1
- package/dist/client/assets/{markdown-DfzYqcpd.js → markdown-BhLIBmBv.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DsTkInwc.js → mcp-app-renderer-DjwQ0S-h.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cyin1NWl.js → mcp-oauth-DiqQlKOx.js} +1 -1
- package/dist/client/assets/{members-CXUn6k7f.js → members-PF8wxsqA.js} +1 -1
- package/dist/client/assets/{message-templates-Dfmfd__o.js → message-templates-BvR8vQvs.js} +1 -1
- package/dist/client/assets/{mini-report-page-BUlZ1nk_.js → mini-report-page-D2etEugE.js} +1 -1
- package/dist/client/assets/{mock-board-Dunv2jbB.js → mock-board-jCiKK3gA.js} +3 -3
- package/dist/client/assets/{monaco-editor-BaJ_FwkQ.js → monaco-editor-BHu8MLvz.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Dggp83t3.js → monitoring-stats-row-2QEp_Jld.js} +1 -1
- package/dist/client/assets/{multi-select-BjZuNC8-.js → multi-select-DcF09HV8.js} +1 -1
- package/dist/client/assets/{mustache-Lt-oOxg-.js → mustache-DtVu96DY.js} +1 -1
- package/dist/client/assets/{oauth-callback-DMNislTd.js → oauth-callback-CwSlt3mo.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DxK2zKq2.js → oauth-callback-ai-provider-Co0a0HMU.js} +1 -1
- package/dist/client/assets/{onboarding-izENNi1v.js → onboarding-D-ej0NPt.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BP4ZudiL.js → optimistic-project-sidebar-views-yjPJnhEG.js} +1 -1
- package/dist/client/assets/{org-file-open-context-D1pGpxmw.js → org-file-open-context-BgiBbqKQ.js} +1 -1
- package/dist/client/assets/{organization-choice-B0W7tTUR.js → organization-choice-loyQwhEZ.js} +1 -1
- package/dist/client/assets/{orgs-CzAPfqci.js → orgs-DkENMfud.js} +1 -1
- package/dist/client/assets/{page-seo-form-CdpRcwf1.js → page-seo-form-BBCLz5m0.js} +1 -1
- package/dist/client/assets/{pair-BaO4UX6i.js → pair-B2TMNGEX.js} +1 -1
- package/dist/client/assets/{plan-ladder-exGKO-OT.js → plan-ladder-C80Qcxkm.js} +1 -1
- package/dist/client/assets/{popover-D_Th7_sq.js → popover-CsEsUqbZ.js} +1 -1
- package/dist/client/assets/{post-calendar-2LAkL10X.js → post-calendar-gswoVxcp.js} +1 -1
- package/dist/client/assets/{post-editor-q7_zlPtJ.js → post-editor-5tYPjO0c.js} +1 -1
- package/dist/client/assets/{preview-content-CuRTn8bu.js → preview-content-D5E6-qEP.js} +1 -1
- package/dist/client/assets/{preview-dialog-BjUtwhAH.js → preview-dialog-D1qWdONG.js} +1 -1
- package/dist/client/assets/{primitives-CywJUIZZ.js → primitives-Dy5hA1_y.js} +1 -1
- package/dist/client/assets/{profile-DbHfcC2F.js → profile-9GEyG1R7.js} +1 -1
- package/dist/client/assets/{project-app-view-DXHuBtnA.js → project-app-view-CsjjG0iu.js} +1 -1
- package/dist/client/assets/{project-feed-CpBgUN64.js → project-feed-CEhr0jA4.js} +1 -1
- package/dist/client/assets/{project-icon-FeJ0RNfM.js → project-icon-Cw3la58q.js} +1 -1
- package/dist/client/assets/project-reports-D83XbTn5.js +1 -0
- package/dist/client/assets/project-tasks-IrwgrDaD.js +1 -0
- package/dist/client/assets/{prompts-BRFYOtU6.js → prompts-DQaXCBzS.js} +1 -1
- package/dist/client/assets/record-editor-C02fIlfV.js +1 -0
- package/dist/client/assets/{redirect-editor-BMuUFVWa.js → redirect-editor-B2uGI7FY.js} +1 -1
- package/dist/client/assets/registry-CORfkc_Z.js +2 -0
- package/dist/client/assets/{registry-layout-C6u19jo2.js → registry-layout-tJiz4Tt0.js} +1 -1
- package/dist/client/assets/{reports-CzNOD1PK.js → reports-DvgXBdzM.js} +1 -1
- package/dist/client/assets/reports-X2I2m9Nu.js +1 -0
- package/dist/client/assets/{reports-onboarding-BfzJa5Gk.js → reports-onboarding-BLUSVbkd.js} +1 -1
- package/dist/client/assets/{reports-tab-DVUKm5d7.js → reports-tab-DSknxHUH.js} +2 -2
- package/dist/client/assets/{repositories-BPfbQo8S.js → repositories-cOMgIGPf.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DgYZBVUY.js → repository-import-picker-C0YugeGx.js} +1 -1
- package/dist/client/assets/{repository-picker-DtNB3YXJ.js → repository-picker-BaqWNwxf.js} +1 -1
- package/dist/client/assets/{require-capability-DhnY1zOU.js → require-capability-CjU7EXPP.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D4NtQ8aQ.js → required-auth-layout-WkX8CtfT.js} +1 -1
- package/dist/client/assets/{reset-password-CGZ1xzBE.js → reset-password-FnA2kczZ.js} +1 -1
- package/dist/client/assets/{resizable-BCFQ8_mU.js → resizable-7umHaFcH.js} +1 -1
- package/dist/client/assets/{review-settings-BYSEbbhD.js → review-settings-BHAkNdHq.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-Cr4zLCon.js → rich-text-link-control-DgGIjR0I.js} +1 -1
- package/dist/client/assets/{roles-DvnyQ4R5.js → roles-iNTzpIoS.js} +1 -1
- package/dist/client/assets/{route-DBoaNcGA.js → route-BdFq2Icl.js} +1 -1
- package/dist/client/assets/{route-BnDGKN7C.js → route-D2mgsDfh.js} +1 -1
- package/dist/client/assets/{route-DyU2SqNZ.js → route-DQ3O_pQ7.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-CiMMS_WZ.js → runnable-block-editor-CCXhy-vO.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DayGvfz9.js → sandbox-lifecycle-context-DL9kkwoa.js} +1 -1
- package/dist/client/assets/{schema-DbE0ILDN.js → schema-D0xfowSf.js} +1 -1
- package/dist/client/assets/{scroll-area-DHkadmMB.js → scroll-area-BqCCUXvj.js} +1 -1
- package/dist/client/assets/{search-input-BY84D0zC.js → search-input-DpLbMQRj.js} +1 -1
- package/dist/client/assets/{secrets-BnRWms7m.js → secrets-B9E8fieV.js} +1 -1
- package/dist/client/assets/{sections-editor-DtnTsXnj.js → sections-editor-D24EQfD8.js} +1 -1
- package/dist/client/assets/{select-CSMuQolx.js → select-cIekAVlM.js} +1 -1
- package/dist/client/assets/{select-model-CVcpSBbf.js → select-model-DcwphIdD.js} +1 -1
- package/dist/client/assets/{seo-editor-Dl4ztoqk.js → seo-editor-BRYLT6tF.js} +1 -1
- package/dist/client/assets/{settings-tab-Czy9lzY6.js → settings-tab-DKZf7OJg.js} +1 -1
- package/dist/client/assets/{sheet-B28ugFTA.js → sheet-DhNzwMUj.js} +1 -1
- package/dist/client/assets/{shell-layout-CIzHgA5L.js → shell-layout-DMJSwXH6.js} +1 -1
- package/dist/client/assets/{sidebar-DYn95fz3.js → sidebar-BCim0GYP.js} +1 -1
- package/dist/client/assets/{skill-preview-CwkocLtc.js → skill-preview-eH_MzYft.js} +1 -1
- package/dist/client/assets/{skills-DRD-wA_C.js → skills-BtiwGp2Q.js} +1 -1
- package/dist/client/assets/{sso-D0V9h73e.js → sso-BOpSC7cb.js} +1 -1
- package/dist/client/assets/{store-CweiCCMm.js → store-DmrioYP8.js} +1 -1
- package/dist/client/assets/store-registry-B398fyC0.js +2 -0
- package/dist/client/assets/{switch-BqxMQqEk.js → switch-9PLadaw_.js} +1 -1
- package/dist/client/assets/{synced-repos-Dx6hMZYH.js → synced-repos-gfJnKqre.js} +1 -1
- package/dist/client/assets/{table-CncpY_U9.js → table-B6mPp07a.js} +1 -1
- package/dist/client/assets/{tabs-phpgyu6t.js → tabs-Co2GUrNY.js} +1 -1
- package/dist/client/assets/{task-board-B1w2Rkog.js → task-board-lQZGfEfb.js} +1 -1
- package/dist/client/assets/{task-route-BW82nSL6.js → task-route-Btltx00G.js} +1 -1
- package/dist/client/assets/{task-status-BZUo5ULn.js → task-status-CLlOhQGx.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BteSA91N.js → taskboard-analytics-CCRKXVH2.js} +1 -1
- package/dist/client/assets/tasks-BqLnbtfB.js +1 -0
- package/dist/client/assets/{tasks-BAYMSKYS.js → tasks-D_kcQmbi.js} +1 -1
- package/dist/client/assets/{textarea-A-sh80rP.js → textarea-BEOceSll.js} +1 -1
- package/dist/client/assets/{thread-intent-C55s0pEB.js → thread-intent-9fI0jPLV.js} +1 -1
- package/dist/client/assets/{thread-route-DPIYNBsG.js → thread-route-B1EuqJlg.js} +1 -1
- package/dist/client/assets/{thread-route-6-bE9uXL.js → thread-route-DG6kj-ho.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-lUFbUTLU.js → thread-sheet-body-CbIiPC8V.js} +1 -1
- package/dist/client/assets/{toggle-group-kiZeVeGT.js → toggle-group-Ck5f9XVv.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Bq1hfOJh.js → toolbar-icon-button-8ctMGgIP.js} +1 -1
- package/dist/client/assets/{tooltip-CIXbcLPC.js → tooltip-BuKeolDX.js} +1 -1
- package/dist/client/assets/{track-BLssb4CV.js → track-B7aLvyYR.js} +1 -1
- package/dist/client/assets/{types-C5ReWHjT.js → types-Bh4jNqv3.js} +1 -1
- package/dist/client/assets/{usage-stats-BX9N4kgl.js → usage-stats-waRf4dtg.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BdaCm75P.js → use-ai-providers-B0bxSHYG.js} +1 -1
- package/dist/client/assets/{use-automations-DvotSKoK.js → use-automations-BdS9yl-d.js} +1 -1
- package/dist/client/assets/{use-autosave-DjhzKyb5.js → use-autosave-CfERN5UF.js} +1 -1
- package/dist/client/assets/{use-connect-companion-D7p0UoHt.js → use-connect-companion-_GDNSGRN.js} +1 -1
- package/dist/client/assets/{use-connection-BULo2w2y.js → use-connection-CPQUKm0a.js} +1 -1
- package/dist/client/assets/{use-copy-GCjFNzMF.js → use-copy-DUiBegp6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BfPzako8.js → use-create-virtual-mcp-BRT9hKZ3.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CUcTqWo5.js → use-date-fns-locale-PFUAQIxr.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DDwH2i40.js → use-debounced-autosave-CyDohN_c.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CxG5RnfF.js → use-debounced-value-DeY1TNRX.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Q7VBtSbi.js → use-deco-credits-Du6WCMYS.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BkBya-2Z.js → use-decopilot-events-_O_0AHeH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D4Qlsjvp.js → use-delete-connection-kqt66yqS.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BJZdPo88.js → use-deployment-admin-MznxNIiy.js} +1 -1
- package/dist/client/assets/{use-entitlements-CmLmpU7O.js → use-entitlements-BWaaNeuI.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CDCgyRCo.js → use-fast-preview-draft-url-BrZtKg6o.js} +1 -1
- package/dist/client/assets/{use-file-configs-BIxnU35a.js → use-file-configs-sqbLS09v.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CiHJK8Fp.js → use-infinite-scroll-RrOnf-fI.js} +1 -1
- package/dist/client/assets/{use-join-requests-BFNe-8vJ.js → use-join-requests-BZzsbvb0.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DFwbOSWr.js → use-main-panel-tabs-CyT7yQAB.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CVk4lVgD.js → use-mcp-auth-status-DvQCYJw0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BZQknWjD.js → use-mcp-client-B1u2B39v.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CVcqO70A.js → use-mcp-prompts-DxT8Kz-M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Bib1tK8U.js → use-mcp-tools-Ch_j97A3.js} +1 -1
- package/dist/client/assets/{use-members-CIJ6YEXF.js → use-members-H3oi0qPu.js} +1 -1
- package/dist/client/assets/{use-mobile-BxTk3Oju.js → use-mobile-CV7f0Wqe.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CJb4YZhI.js → use-navigate-to-agent-BMSyO1iB.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Bw8fLJ97.js → use-open-billing-url-BGn9Wkis.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Dkurnb6X.js → use-org-auth-client-ZxEGrzhh.js} +1 -1
- package/dist/client/assets/{use-org-fs-C1mbGTyD.js → use-org-fs-D6lKuMAi.js} +1 -1
- package/dist/client/assets/{use-org-notice-BJTFU8Ij.js → use-org-notice-C5thI8aD.js} +1 -1
- package/dist/client/assets/{use-org-sso-Ba23AHpT.js → use-org-sso-vHIufIoJ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-gZMLdZFL.js → use-organization-roles-DmWmnvDm.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D7GHyVHo.js → use-organization-settings-C-XY0Wze.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-oG67IXer.js → use-panel-navigate-BG4d0Vrr.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-X2YAvfNz.js → use-project-native-view-presence-0NQTfFQT.js} +1 -1
- package/dist/client/assets/{use-project-scope-CIXN10BN.js → use-project-scope-DRope0ob.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CeDuSPRn.js → use-registry-connections-D_a0MIjQ.js} +1 -1
- package/dist/client/assets/{use-releases-BIbWCMyU.js → use-releases-BPrtCiPS.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DPKlaDs-.js → use-reports-diagnostic-BtS3SpeX.js} +1 -1
- package/dist/client/assets/{use-route-default-main-A4wWyyYE.js → use-route-default-main-DBXt2fvS.js} +1 -1
- package/dist/client/assets/{use-secrets-BsJeTPlj.js → use-secrets-C5iKdreo.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DzysJ_ub.js → use-section-preview-base-Dwn5dF7B.js} +1 -1
- package/dist/client/assets/{use-session-runtime-DEXgUSVy.js → use-session-runtime-DU2zS-3V.js} +1 -1
- package/dist/client/assets/{use-tags-Cy707gRp.js → use-tags-BvskEBAC.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BDsFgilp.js → use-task-board-analytics-DjIJHPkR.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CSJCHVe3.js → use-task-metadata-9gheSHac.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CeLGBWMi.js → use-thread-outputs-DAcljy5D.js} +1 -1
- package/dist/client/assets/{use-view-mode-DZAJ8Ezx.js → use-view-mode-CTt0Tykp.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-5_LmHClQ.js → use-virtual-mcp-Bq1RMGPF.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C6OBOha-.js +1 -0
- package/dist/client/assets/{useQueries-D6QI0O0n.js → useQueries-DMqJmHGu.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-XFcbI_PD.js +1 -0
- package/dist/client/assets/{users-YoYfh25Z.js → users-B0Y-7Aab.js} +1 -1
- package/dist/client/assets/{utils-DouGzYPl.js → utils-CU3t1jst.js} +1 -1
- package/dist/client/assets/{variant-calendar-BfGXAz3H.js → variant-calendar-Bp201sXA.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-C3nTKSL4.js → variant-matcher-override-DUPu0vkW.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BiIuGK5N.js → view-mode-toggle-DaZN0qXY.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CSWeSKXb.js → virtual-mcp-BYPZngzy.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +223 -211
- package/dist/server/server.js +212 -200
- package/package.json +1 -1
- package/dist/client/assets/agent-app-B3LVEWM9.js +0 -1
- package/dist/client/assets/agent-deck-CUDniMqu.js +0 -1
- package/dist/client/assets/agent-file-QbD9SRv2.js +0 -1
- package/dist/client/assets/agent-library-file-JlNcL2FU.js +0 -1
- package/dist/client/assets/agent-settings-ySUyWCOK.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Bh_ZZ7R1.js +0 -2
- package/dist/client/assets/agent-view-Dl1hyNsP.js +0 -1
- package/dist/client/assets/api-keys-19zucl3O.js +0 -1
- package/dist/client/assets/app-editor-B6yi7Dq3.js +0 -1
- package/dist/client/assets/automations-C1tjCxH0.js +0 -1
- package/dist/client/assets/category-editor-C9vS3rZZ.js +0 -1
- package/dist/client/assets/project-reports-CGHkLS5V.js +0 -1
- package/dist/client/assets/project-tasks-B2mVIUT1.js +0 -1
- package/dist/client/assets/record-editor-shDJTvt5.js +0 -1
- package/dist/client/assets/registry-_INwJVQ0.js +0 -2
- package/dist/client/assets/reports-7EiX8-Jn.js +0 -1
- package/dist/client/assets/store-registry-B1zHPePT.js +0 -2
- package/dist/client/assets/tasks-Cc643FEA.js +0 -1
- package/dist/client/assets/useInfiniteQuery-6UUyLG5q.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DxuXEhD8.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ab as L,r as V,M as q,n as Q,a as z,ad as G,b as B,e as T,o as F,t as S,K as M,j as t,B as P,c as J,_ as K,a6 as U,m as Z}from"./index-
|
|
1
|
+
import{ab as L,r as V,M as q,n as Q,a as z,ad as G,b as B,e as T,o as F,t as S,K as M,j as t,B as P,c as J,_ as K,a6 as U,m as Z}from"./index-z4bKt11m.js";import{D as k,a as Y,b as $,c as H,d as W,e as X}from"./dialog-DbzCN1O8.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-B7dtslOD.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-cIekAVlM.js";import{T as re}from"./textarea-BEOceSll.js";import{u as ae}from"./use-org-auth-client-ZxEGrzhh.js";import{u as le}from"./use-organization-roles-DmWmnvDm.js";const ce=L().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=V.useState(!1),{locator:h}=q(),x=ae(),r=Q(),{data:m}=z.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=G({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),v=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async R=>{const y=await x.organization.inviteMember({email:R,role:s});if(y.error)throw new Error(y.error.message);return y.data})),w=a.filter(R=>R.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}v.mutate({emails:p,role:n.role})},b=p.length>0&&!!j;return t.jsxs(k,{open:d,onOpenChange:c,children:[t.jsx(Y,{asChild:!0,children:e}),t.jsxs($,{className:"sm:max-w-lg",children:[t.jsx(H,{children:t.jsx(W,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:v.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:v.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs(X,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:v.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:v.isPending||!b,children:v.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:x}=U(),r=x||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=Z(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function je(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),x=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==x?(m=()=>{x.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),x.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=x,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=b=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:b}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=b=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:b}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=b=>S.error(b instanceof Error?b.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const v=T(i);let D;return e[26]!==E||e[27]!==v?(D={approve:E,deny:v},e[26]=E,e[27]=v,e[28]=D):D=e[28],D}export{ve as I,je as a,xe as u};
|
package/dist/client/assets/{use-main-panel-tabs-DFwbOSWr.js → use-main-panel-tabs-CyT7yQAB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ot,b as st,u as it,M as rt,dQ as ct,dR as lt,dS as we,dT as Se,a4 as dt,a3 as Ce,dU as pt,dV as mt,r as ce,dz as ut,y as Me,dW as ft,dX as bt}from"./index-
|
|
1
|
+
import{c as ot,b as st,u as it,M as rt,dQ as ct,dR as lt,dS as we,dT as Se,a4 as dt,a3 as Ce,dU as pt,dV as mt,r as ce,dz as ut,y as Me,dW as ft,dX as bt}from"./index-z4bKt11m.js";import{u as Tt}from"./use-route-default-main-DBXt2fvS.js";import{i as Ae}from"./Globe01-DIy8wXF6.js";import{i as It}from"./Monitor01-CQ6Zk1oP.js";import{u as vt}from"./use-connection-CPQUKm0a.js";import{b as gt}from"./use-mcp-client-B1u2B39v.js";import{u as kt}from"./use-mcp-tools-Ch_j97A3.js";import{a as yt}from"./use-virtual-mcp-Bq1RMGPF.js";import{g as ht}from"./types-Bh4jNqv3.js";import{t as Pt}from"./utils-CVEq3hMx.js";import{d as wt,u as St,b as B}from"./use-project-scope-DRope0ob.js";import"./index-BFjKFLU3.js";import{g as Ct,a as Mt}from"./github-repo-BknN0SVI.js";import{d as Vt}from"./use-navigate-to-agent-BMSyO1iB.js";import{c as Rt,d as At}from"./sandbox-lifecycle-context-DL9kkwoa.js";import{F as Ve}from"./file-type-icon-C37FwvPU.js";import{a as Nt,u as Dt}from"./use-panel-navigate-BG4d0Vrr.js";import{h as jt,e as $t,j as Et,aw as Ut,c as xt,aC as Ot,f as Ht,aD as Ft,a2 as Bt}from"./agent-icon-BD4DM2Lv.js";import{e as Lt}from"./TrendUp01-Bkdgpfn7.js";import{i as Gt}from"./File02-g-xJPix_.js";import{i as Kt}from"./Share07-CxuHcmnM.js";import{i as Qt}from"./GitBranch01-ddoPQdPH.js";import{a as _t}from"./Package-t6euxYcP.js";import{u as Wt}from"./use-task-metadata-9gheSHac.js";import{i as Yt,r as zt,s as Xt}from"./use-org-notice-C5thI8aD.js";import{u as qt}from"./use-session-runtime-DU2zS-3V.js";import{u as Jt}from"./use-is-desktop-app-BNujXJc_.js";import{u as Zt}from"./use-organization-settings-C-XY0Wze.js";import{b as en,u as tn,c as nn,d as an,f as on}from"./use-project-native-view-presence-0NQTfFQT.js";import{b as sn}from"./chat-context-BBVkwd3p.js";import{r as rn}from"./virtual-mcp-BYPZngzy.js";const Ne={overview:Ht,settings:Ot,automations:xt,"site-editor":Ae,code:Ut,content:Gt,assets:_t,hosting:Et,e2e:Lt,analytics:$t,cdn:jt,git:Qt,files:Kt};function cn(n){return n in Ne}const ln=new Set(["site-editor","content"]);function Re(n){const e=Ft(n);if(e.type==="icon"){const s=Bt(e.name);return s?{kind:"component",Component:s}:null}return e.type==="url"?{kind:"url",src:e.url}:null}function L(n){if(n.kind==="system")return cn(n.tabId)?ln.has(n.tabId)?{kind:"none"}:{kind:"component",Component:Ne[n.tabId]}:{kind:"fallback"};const e=Re(n.iconUrl);if(e)return e;if(!n.appId)return{kind:"fallback"};const s=n.connections.find(I=>I.id===n.appId);if(!s)return{kind:"fallback"};const c=Re(s.icon);return c||{kind:"fallback"}}function dn(n,e){return!!n&&!!e&&e===`thread:${n}`}function pn(n){return n.threadHasRepo?"repo":dn(n.threadId,n.sandboxBranch)?"none":n.agentHasRepo?"repo":"none"}function Wn(n){const e=ot.c(52),s=st(),{openPanel:c,closePanel:I}=Nt();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={strict:!1},e[0]=y):y=e[0];const De=it(y),le=Dt(),de=Tt(),i=yt(n.virtualMcpId),h=Wt(n.taskId),{org:o}=rt(),{currentBranch:pe,activeTask:P}=sn(),me=Jt();let l,p,m,u,w;e[1]!==i||e[2]!==o.id||e[3]!==o.slug?(l=Ct(i),w=Vt,p=o.id,m=o.slug,u=Mt(l),e[1]=i,e[2]=o.id,e[3]=o.slug,e[4]=l,e[5]=p,e[6]=m,e[7]=u,e[8]=w):(l=e[4],p=e[5],m=e[6],u=e[7],w=e[8]);const G=l?.owner??"",K=l?.name??"",Q=l?pe:null;let S;e[9]!==p||e[10]!==m||e[11]!==u||e[12]!==G||e[13]!==K||e[14]!==Q?(S={orgId:p,orgSlug:m,target:u,owner:G,repo:K,branch:Q},e[9]=p,e[10]=m,e[11]=u,e[12]=G,e[13]=K,e[14]=Q,e[15]=S):S=e[15];const C=w(S),je=C.data?.state==="open",v=i?.metadata.ui?.layout??null,f=v?.tabs??[],g=i?.id?ct(i.id):null,M=h?.expanded_tools??[],$e=wt(i),V=Zt(),{scopeId:Ee,project:Ue}=St(),_=en(Ee,Ue,i),W=tn(_.project),ue=nn(_.resolvedScopeId,B(_.project?.metadata),W.presence);let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R={includeVirtual:!0},e[16]=R):R=e[16];const b=vt(R),xe=Rt(),{vmEntry:fe,previewUrl:be}=At(),Y=P?.branch??pe;let A;e[17]!==P?.metadata||e[18]!==n.taskId||e[19]!==i?.metadata||e[20]!==h||e[21]!==Y?(A=pn({threadId:n.taskId,sandboxBranch:Y,agentHasRepo:B(i?.metadata),threadHasRepo:B(h)||B(P?.metadata)}),e[17]=P?.metadata,e[18]=n.taskId,e[19]=i?.metadata,e[20]=h,e[21]=Y,e[22]=A):A=e[22];const Oe=A,Te=xe.lifecycle.phase==="running",{runtime:He,resolved:Ie}=qt(n.virtualMcpId);let N;e[23]!==me||e[24]!==be||e[25]!==fe?(N=void 0,e[23]=me,e[24]=be,e[25]=fe,e[26]=N):N=e[26];const Fe=N,ve=gt({connectionId:g??void 0,orgId:o.id,orgSlug:o.slug,mcpUrl:Fe}),z=ve,X=!!ve&&Te;let D;e[27]!==z||e[28]!==X?(D={client:z,enabled:X},e[27]=z,e[28]=X,e[29]=D):D=e[29];const{data:Be}=kt(D),ge=g&&Te?(Be?.tools??[]).filter(bn).map(t=>({connectionId:g,toolName:t.name,label:Pt(t.name),icon:null})):[],q=ge[0],Le=q?ge:[],k=q&&g?{type:"ext-apps",id:g,toolName:q.toolName}:v?.defaultMainView??null,Ge=rn(v),ke={assets:W.assetsPending,siteAccess:W.siteAccessPending},{activeTab:d,mainOpen:Ke}=lt({panelTabId:le,mainPanelParam:De.mainpanel,routeDefaultMain:de,metadata:k||v?{defaultMainView:k,tabs:f.map(fn)}:null}),J=$e&&(je||C.isPending&&d==="git"),Qe=k||v?{defaultMainView:k,tabs:f.map(un)}:null,j=zt({hasSource:Oe==="repo"||V,runtime:He,cmsMode:Ge}),_e=j.includes("content"),We=we(Qe),Ye=k?.type,ye=an(Ye,ue,ke,j,Ie),$=ye?we(null):We,ze=on(d,ue,ke),Xe=!j.includes("code")&&Ie&&Se(d)!==null,a=!le&&!de&&ye||d==="git"&&!J&&!C.isPending||d==="content"&&!_e||Xe||ze?$:d,T=d==="git"&&!J&&!C.isPending?!1:Ke,Z=dt(a);let E;e[30]!==s?(E=t=>s(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[30]=s,e[31]=E):E=e[31];const qe=E,he=[];J&&he.push({id:"git",title:s("common.mainPanelTabs.reviewChanges")});const ee=new Map;for(const t of M){const r=Ce(t.appId,t.toolName);ee.set(r,{id:r,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of Le){if(t.toolName==="fetch_assets")continue;const r=Ce(t.connectionId,t.toolName);ee.set(r,{id:r,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const te=pt(a),ne=te?te.key.split("/").pop()??te.key:null,Je=ne?[{id:a,title:ne,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Ve,{filename:ne,...t})}}]:[],U=mt(a),Ze=U?[{id:a,title:(U.path.split("/").pop()??U.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>ce.createElement(U.path.startsWith("pages/")?Ae:It,t)}}]:[],ae=ut(a),oe=ae?ae.path.split("/").pop()??ae.path:null,et=oe?[{id:a,title:oe,kind:"file",icon:{kind:"component",Component:t=>ce.createElement(Ve,{filename:oe,...t})}}]:[],tt=Yt(a)?j.map(t=>({id:t==="code"&&Se(a)?a:t,title:qe(t),kind:"system",icon:L({tabId:t,kind:"system",connections:b})})):[];let x;e[32]!==b?(x=t=>({id:ft(t.id),title:t.title,kind:"agent",icon:L({tabId:t.id,kind:"agent",appId:t.view.appId,connections:b})}),e[32]=b,e[33]=x):x=e[33];const nt=[...tt,...he.map(t=>({id:t.id,title:t.title,kind:"system",icon:L({tabId:t.id,kind:"system",connections:b})})),...Je,...Ze,...et,...f.map(x),...Array.from(ee.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:L({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:b})}))],Pe=new Set,se=nt.filter(t=>Pe.has(t.id)?!1:(Pe.add(t.id),!0)),at=n.virtualMcpId;let O;e[34]!==o.id?(O=Me(o.id),e[34]=o.id,e[35]=O):O=e[35];const ie=at===O;let H;e[36]!==a||e[37]!==I||e[38]!==T||e[39]!==ie||e[40]!==c||e[41]!==o.id||e[42]!==V?(H=t=>{if(Xt({reportsOnly:V,onReportAgent:ie,tabId:t})){c(t,{virtualmcpid:Me(o.id),search:mn});return}const r=bt({clickedId:t,activeTab:a,mainOpen:T});"close"in r?I():c(r.tabId)},e[36]=a,e[37]=I,e[38]=T,e[39]=ie,e[40]=c,e[41]=o.id,e[42]=V,e[43]=H):H=e[43];const re=H;let F;return e[44]!==a||e[45]!==Z||e[46]!==M||e[47]!==f||e[48]!==T||e[49]!==re||e[50]!==se?(F={activeTab:a,mainOpen:T,setActiveTab:re,layoutTabs:f,expandedTools:M,automationTabParsed:Z,tabs:se},e[44]=a,e[45]=Z,e[46]=M,e[47]=f,e[48]=T,e[49]=re,e[50]=se,e[51]=F):F=e[51],F}function mn(n){return{...n,thread:void 0}}function un(n){return{id:n.id}}function fn(n){return{id:n.id}}function bn(n){return!!ht(n._meta)}export{pn as r,Wn as u};
|
package/dist/client/assets/{use-mcp-auth-status-CVk4lVgD.js → use-mcp-auth-status-DvQCYJw0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,b as k,F as N,as as S,j as o,M as $,K as A,z as L}from"./index-
|
|
1
|
+
import{c as b,b as k,F as N,as as S,j as o,M as $,K as A,z as L}from"./index-z4bKt11m.js";import{B as g}from"./badge-BNBGXxmC.js";import{c as v,T,a as I,b as _}from"./tooltip-BuKeolDX.js";import{g as H}from"./types-Bh4jNqv3.js";import{s as P}from"./Eye-DXUjft5i.js";import{h as U,ay as w}from"./agent-icon-BD4DM2Lv.js";import{i as O}from"./mcp-oauth-DiqQlKOx.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:P,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function Q(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=H(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=_,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function Y(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{Q as T,Y as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{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-BAe_o13_.js";import{U as P,b as H,c as K}from"./auth-CKeyq_SN.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{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-z4bKt11m.js";import{U as P,b as H,c as K}from"./auth-D-2jYpOE.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(`
|
|
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
4
|
`,c);continue}const v=h.charCodeAt(c);if(ee(h,c,v)){const S=h.charCodeAt(c+5)===I?c+6:c+5,b=h.slice(S,w);if(p===0&&h.charCodeAt(w+1)===X){e({id:i,event:l,data:b}),i=void 0,u="",l=void 0,c=w+2,w=h.indexOf(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,m as c,bO as m,bP as f,z as y,K as n}from"./index-
|
|
1
|
+
import{c as l,m as c,bO as m,bP as f,z as y,K as n}from"./index-z4bKt11m.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],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=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{q as a,b as g,u as l,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,z as p,m as q,K as T}from"./index-
|
|
1
|
+
import{c as m,z as p,m as q,K as T}from"./index-z4bKt11m.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,M as m,m as b,z as M,K as f}from"./index-
|
|
1
|
+
import{c,M as m,m as b,z as M,K as f}from"./index-z4bKt11m.js";import{u as y}from"./use-org-auth-client-ZxEGrzhh.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-z4bKt11m.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
|
package/dist/client/assets/{use-navigate-to-agent-CJb4YZhI.js → use-navigate-to-agent-BMSyO1iB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,m as b,K as T,ap as E,M as U,d as K,n as $,a as H,cC as N,cD as k}from"./index-
|
|
1
|
+
import{c as m,m as b,K as T,ap as E,M as U,d as K,n as $,a as H,cC as N,cD as k}from"./index-z4bKt11m.js";import{e as Q,f as D}from"./use-virtual-mcp-Bq1RMGPF.js";import{u as I}from"./hooks-CkL4R3Tj.js";import{p as V,d as _,w as j}from"./thread-intent-9fI0jPLV.js";import{r as S,h as P,g as B,a as x}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 Y(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 J(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 M(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(J):[]}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:Z},e[2]=n,e[3]=a):a=e[3],b(a)}function Z(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 M({orgId:n.id,orgSlug:n.slug,target:x(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:Y(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&&j(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,Y as b,ye as c,M as d,pe as e,me as f,ge as g,Re as h,be as i,q as p,Te as u};
|
package/dist/client/assets/{use-open-billing-url-Bw8fLJ97.js → use-open-billing-url-BGn9Wkis.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,_ as f,b as p,e as T,t as _}from"./index-
|
|
1
|
+
import{c as l,_ as f,b as p,e as T,t as _}from"./index-z4bKt11m.js";function g(t,u){const s=l.c(9),i=f(),c=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:a}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return a},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==c?(n=r=>_.error(c(u,{message:r.message})),s[3]=u,s[4]=c,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:m,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function m(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
|
package/dist/client/assets/{use-org-auth-client-Dkurnb6X.js → use-org-auth-client-ZxEGrzhh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,M as j,a as i}from"./index-
|
|
1
|
+
import{c as x,M as j,a as i}from"./index-z4bKt11m.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let p;e[0]!==o?(p=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=p):p=e[1];const t=p;let z;e[2]!==o?(z=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=z):z=e[3];const n=z;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,M;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),M=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]=M):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],M=e[16]);let b;e[17]!==n?(b=n("getActiveMember"),e[17]=n,e[18]=b):b=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==b||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==M?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:M,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:b,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]=b,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=M,e[31]=I):I=e[31],I}export{A as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,M as S,K as y,m as $,n as T,e as K}from"./index-
|
|
1
|
+
import{c as p,M as S,K as y,m as $,n as T,e as K}from"./index-z4bKt11m.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"]),M=25,Q=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<=Q&&r.length<M?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,z as l,G as m,se as n,J as o,v as p,C as q,B as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,m as a,K as u}from"./index-
|
|
1
|
+
import{c,m as a,K as u}from"./index-z4bKt11m.js";function f(e){return e!=="off"}function y(e){if(!e.hasSource)return[];const t=["site-editor"];return f(e.cmsMode)&&t.push("content"),e.runtime==="sandbox"&&t.push("code"),t}function d(e){return e==="site-editor"||e==="content"||e==="code"||e.startsWith("code:")}function b(e){return e.reportsOnly&&!e.onReportAgent&&d(e.tabId)}function p(e){const t=c.c(8);let n;t[0]!==e?(n=u.orgNotice(e??""),t[0]=e,t[1]=n):n=t[1];let s;t[2]!==e?(s=async()=>{const r=await fetch(`/api/${e}/notice`,{credentials:"include"});return r.ok?(await r.json()).notice??null:null},t[2]=e,t[3]=s):s=t[3];const o=!!e;let i;return t[4]!==n||t[5]!==s||t[6]!==o?(i={queryKey:n,queryFn:s,enabled:o,staleTime:6e4},t[4]=n,t[5]=s,t[6]=o,t[7]=i):i=t[7],a(i)}export{f as a,d as i,y as r,b as s,p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,m as S,n as r,e as y,K as c}from"./index-
|
|
1
|
+
import{c as u,m as S,n as r,e as y,K as c}from"./index-z4bKt11m.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};
|
package/dist/client/assets/{use-organization-roles-gZMLdZFL.js → use-organization-roles-DmWmnvDm.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as R}from"./use-org-auth-client-
|
|
1
|
+
import{u as R}from"./use-org-auth-client-ZxEGrzhh.js";import{M as b,m as P,K as y}from"./index-z4bKt11m.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,c as r,ay as w,M as E,m as T,ap as x,K as A,W as F,_ as N,n as P,e as $}from"./index-
|
|
1
|
+
import{a as h,c as r,ay as w,M as E,m as T,ap as x,K as A,W as F,_ as N,n as P,e as $}from"./index-z4bKt11m.js";import{D as z,o as D,a as U}from"./schema-D0xfowSf.js";import{r as k}from"./task-board-lQZGfEfb.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(v);return t??O}function v(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 M(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function tt(){const{data:t}=h.useSession();return M(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||M(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"),G=c("e2e_enabled"),I=c("monitor_enabled"),R=c("experiments_enabled"),g=o||i||l,_=o||i||u,p=o||i||G,y=o||a||I,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(K);return t??!1}function K(t){return U(t.flags)}function st(){const{data:t}=d(Q);return t??!0}function Q(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-oG67IXer.js → use-panel-navigate-BG4d0Vrr.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,f as g,u as S,cB as _,d as b,k,cC as P,cD as E}from"./index-
|
|
1
|
+
import{c as p,f as g,u as S,cB as _,d as b,k,cC as P,cD as E}from"./index-z4bKt11m.js";import{b as I}from"./thread-route-B1EuqJlg.js";import{a as R}from"./use-project-scope-DRope0ob.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 $(){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 A(){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{A as a,x as r,$ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h,M as x,ay as A,m as _,K as I}from"./index-
|
|
1
|
+
import{c as h,M as x,ay as A,m as _,K as I}from"./index-z4bKt11m.js";import{m as R}from"./match-site-slug-config-D3fUJ6vX.js";import{a as C}from"./use-file-configs-sqbLS09v.js";import{c as v}from"./use-organization-settings-C-XY0Wze.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,f as y,u as R,d as T,a2 as k,cE as C,cF as E,cG as N,cD as j,a1 as b}from"./index-
|
|
1
|
+
import{c as A,f as y,u as R,d as T,a2 as k,cE as C,cF as E,cG as N,cD as j,a1 as b}from"./index-z4bKt11m.js";import{e as D,d as w}from"./use-virtual-mcp-Bq1RMGPF.js";import{b as P,p as G}from"./github-repo-BknN0SVI.js";function $(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 P(t).status==="attached"}function K(t){const e=P(t).status;return e==="attached"||e==="detached"}function H(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 O=1;function S(t){const e=t??[],s=H(e);return e.filter(n=>!s.has(n.id)&&!C(n.id)&&!E(n.id)&&!N(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=y(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=y(s),o=k(),a=D(),c=S(a),i=M(),_=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=w(l),u=_??S(I?[I]:[])[0]??null;let d;t[4]!==o||t[5]!==e||t[6]!==n||t[7]!==i?(d=r=>{if(r===i&&o!==void 0)return;const v=n.org??"",h=V;if(r){j(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]=d):d=t[8];const m=d,g=G(u),p=c.length>=O;let f;return t[9]!==u||t[10]!==c||t[11]!==i||t[12]!==m||t[13]!==g||t[14]!==p?(f={scopeId:i,project:u,repo:g,projects:c,hasProjects:p,setScope:m},t[9]=u,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,$ as b,K as c,J as d,L as f,H as g,S as s,U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,M as R,W as a}from"./index-
|
|
1
|
+
import{c as C,M as R,W as a}from"./index-z4bKt11m.js";import{u as y}from"./use-connection-CPQUKm0a.js";import{f as I}from"./use-organization-settings-C-XY0Wze.js";function x(){const e=C.c(19),{org:i}=R(),o=I();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.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 u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=y();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.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{x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as N,M as Q,n as k}from"./index-
|
|
1
|
+
import{c as N,M as Q,n as k}from"./index-z4bKt11m.js";import{a as E,c as P}from"./use-virtual-mcp-Bq1RMGPF.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};
|
package/dist/client/assets/{use-reports-diagnostic-DPKlaDs-.js → use-reports-diagnostic-BtS3SpeX.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as N,M as Q,W as F,m as f,K as T,x as A,dC as L,C as K,y as M}from"./index-
|
|
1
|
+
import{c as N,M as Q,W as F,m as f,K as T,x as A,dC as L,C as K,y as M}from"./index-z4bKt11m.js";import{m as O}from"./use-mcp-client-B1u2B39v.js";import{u as h}from"./companions-core-WMNDPuPs.js";function x(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}function D(n){return n.connectionQueryPending?!0:!n.hasConnection||n.cdClientFailed?!1:n.diagnosticQueryPending}const U=2e4;function b(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function B(){const n=N.c(24),{org:e}=Q(),t=F.REPORTS(e.id);let l;n[0]!==e.id||n[1]!==e.slug?(l=O({connectionId:A,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=l):l=n[2];const{data:p}=f(l),u=f({queryKey:T.reportsConnection(e.id,t),enabled:!!p,retry:!1,staleTime:6e4,queryFn:async()=>{if(!p)throw new Error("selfClient not ready");const R=await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}});return h(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:L,arguments:{}});return h(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:q,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=D({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=b(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 q(n){return n.state.status!=="error"&&x(n.state.data)==="generating"?U:!1}function J(n,e){return{to:K.app,params:{org:n.slug,agentId:M(n.id),connectionId:e,toolName:L},search:{}}}export{x as d,J as r,B as u};
|
package/dist/client/assets/{use-route-default-main-A4wWyyYE.js → use-route-default-main-DBXt2fvS.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,k as o}from"./index-
|
|
1
|
+
import{c as a,k as o}from"./index-z4bKt11m.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,M as c,_ as r,K as l,z as d,n as f,e as S}from"./index-
|
|
1
|
+
import{c as a,M as c,_ as r,K as l,z as d,n as f,e as S}from"./index-z4bKt11m.js";function C(){const e=a.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=l.secrets(n.id),e[0]=n.id,e[1]=i):i=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]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:u}=d(s);return u.secrets}function m(){const e=a.c(8),{org:n}=c(),o=r(),i=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]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:l.secrets(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let u;return e[5]!==t||e[6]!==s?(u={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=u):u=e[7],S(u)}export{m as a,C as u};
|