@decocms/mesh 2.138.2 → 2.138.3
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-COCPzruB.js → AlertCircle-D8UIpq37.js} +1 -1
- package/dist/client/assets/{AlignLeft-BXEQaqkm.js → AlignLeft-BtXg7P0e.js} +1 -1
- package/dist/client/assets/{ArrowDown-CWZOxMGB.js → ArrowDown-D7A05Pqz.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D9yt1ohq.js → ArrowLeft-CFfxbhXN.js} +1 -1
- package/dist/client/assets/{ArrowUp-CxJFPww9.js → ArrowUp-BHnUcKjj.js} +1 -1
- package/dist/client/assets/{Check-BxmpGgJO.js → Check-DnflcDgh.js} +1 -1
- package/dist/client/assets/{CheckCircle-CTJxivs_.js → CheckCircle-BfTaFQXT.js} +1 -1
- package/dist/client/assets/{CheckDone01-Dcp2FYQ-.js → CheckDone01-B8Vo5lqI.js} +1 -1
- package/dist/client/assets/{CheckVerified02-D11ceW2n.js → CheckVerified02-CWpuqjel.js} +1 -1
- package/dist/client/assets/{ChevronDown-DMBKkJDw.js → ChevronDown-BdRzf7AV.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CSMOvegR.js → ChevronLeft-BENcbD0N.js} +1 -1
- package/dist/client/assets/{ChevronRight-H9Yc9f7O.js → ChevronRight-B6krViGL.js} +1 -1
- package/dist/client/assets/{Clock-CKhQI6RG.js → Clock-BahX3Ppr.js} +1 -1
- package/dist/client/assets/{Code01-YTmJoKH0.js → Code01-DAiaTcLi.js} +1 -1
- package/dist/client/assets/{Container-yYsRLnMs.js → Container-Bhk6-bJW.js} +1 -1
- package/dist/client/assets/{Copy01-CBbaVNcV.js → Copy01-IhjKnzZh.js} +1 -1
- package/dist/client/assets/{Dataflow03-D7alrCgq.js → Dataflow03-CplqbZiq.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-Bs1LoWL0.js → DotsHorizontal-ol0p2nBi.js} +1 -1
- package/dist/client/assets/{DotsVertical-JTzIXbI1.js → DotsVertical-DaFbwRBO.js} +1 -1
- package/dist/client/assets/{Download01-BfbmibGe.js → Download01-CpdZoaWE.js} +1 -1
- package/dist/client/assets/{Edit01-86XeEa-K.js → Edit01-B2tEsq4Y.js} +1 -1
- package/dist/client/assets/{Edit05-D2Mr1uN2.js → Edit05-D1q7xT-x.js} +1 -1
- package/dist/client/assets/{Eye-CH7m62Q9.js → Eye-D7y1c_jY.js} +1 -1
- package/dist/client/assets/{File02-D5MLfFax.js → File02-BBBrx8D7.js} +1 -1
- package/dist/client/assets/{File06-BsPa6yJC.js → File06-BXEc3PLa.js} +1 -1
- package/dist/client/assets/{FilterLines-CCRMwRH-.js → FilterLines-DQzwn6mr.js} +1 -1
- package/dist/client/assets/{Globe01-DkkMg0kW.js → Globe01-DxOhGk1c.js} +1 -1
- package/dist/client/assets/{Globe02-C9h9OvDn.js → Globe02-CK23mV4o.js} +1 -1
- package/dist/client/assets/{Grid01-BJl2SMz4.js → Grid01--89xjjlS.js} +1 -1
- package/dist/client/assets/{Hash02-fUOm6jU-.js → Hash02-GHgct6qe.js} +1 -1
- package/dist/client/assets/{Home02-Css4Iepc.js → Home02-CtaUTS4r.js} +1 -1
- package/dist/client/assets/{Image01-DcPksOlo.js → Image01-DV4WJck5.js} +1 -1
- package/dist/client/assets/{Inbox01-B-u4MXdb.js → Inbox01-DJZPgIPT.js} +1 -1
- package/dist/client/assets/{InfoCircle-Ix7ZTvJi.js → InfoCircle-D5uH0MNf.js} +1 -1
- package/dist/client/assets/{Key01-Df3Idqiz.js → Key01-caSA-Yw4.js} +1 -1
- package/dist/client/assets/{LayersTwo01-B5E2fqo_.js → LayersTwo01-PpQdLoEG.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bc53fB6X.js → LayoutLeft-Cf-N8SYH.js} +1 -1
- package/dist/client/assets/{Link01-DL7ePw82.js → Link01-DMneZx2j.js} +1 -1
- package/dist/client/assets/{LinkExternal01-b8VjDApC.js → LinkExternal01-BrnXDZEp.js} +1 -1
- package/dist/client/assets/{List-DurPU5xB.js → List-C5_6cfio.js} +1 -1
- package/dist/client/assets/{Loading01-BSgt365L.js → Loading01-BCzCCK_W.js} +1 -1
- package/dist/client/assets/{Lock01-Kbe8uq9Q.js → Lock01-jPvo4nA0.js} +1 -1
- package/dist/client/assets/{Play-C_XCWv-e.js → Play-CkKt4QCZ.js} +1 -1
- package/dist/client/assets/{Plus-DyccoR76.js → Plus--co7BTa1.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-C5LHek4w.js → RefreshCcw01-CbOhHOko.js} +1 -1
- package/dist/client/assets/{Save01-DB_m4T10.js → Save01-BTh64p14.js} +1 -1
- package/dist/client/assets/{SearchMd-C9PpmA7c.js → SearchMd-m173J65G.js} +1 -1
- package/dist/client/assets/{Settings01-C8nyLh4e.js → Settings01-CZOfcAS6.js} +1 -1
- package/dist/client/assets/{Shield01-D3qnwTrp.js → Shield01-BI5amJl0.js} +1 -1
- package/dist/client/assets/{Terminal-BQ8QYOY1.js → Terminal-CtGvt6je.js} +1 -1
- package/dist/client/assets/{Trash01-CJ60cufT.js → Trash01-HuotuXJH.js} +1 -1
- package/dist/client/assets/{Upload01-CPuUtuFU.js → Upload01-C7rpQkkP.js} +1 -1
- package/dist/client/assets/{Users03-TzAql3be.js → Users03-DlGbW_jR.js} +1 -1
- package/dist/client/assets/{X-CpYNC6lo.js → X-TCHNS2KI.js} +1 -1
- package/dist/client/assets/{XCircle-BjAJVHDF.js → XCircle-B9lbeJth.js} +1 -1
- package/dist/client/assets/{XClose-Rpsc-3OA.js → XClose-zAWwTjC9.js} +1 -1
- package/dist/client/assets/{Zap-BZ3UCYjM.js → Zap-CgMlO3IL.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-DIiP1L_8.js → agent-connections-preview-CBD487Ew.js} +1 -1
- package/dist/client/assets/{agent-detail-J2F2tRbj.js → agent-detail-BILNtrP7.js} +1 -1
- package/dist/client/assets/{agents-Cd6HGWat.js → agents-8Xh54Wv-.js} +1 -1
- package/dist/client/assets/{alert-dialog-CjulzWr7.js → alert-dialog-BifPyCni.js} +1 -1
- package/dist/client/assets/{auth-catchall-BnImxdbW.js → auth-catchall-CBObZF31.js} +1 -1
- package/dist/client/assets/{avatar-COttSggk.js → avatar-B3kSzLTz.js} +1 -1
- package/dist/client/assets/{badge-DeKjEqoU.js → badge-ndLAVsnC.js} +1 -1
- package/dist/client/assets/{binder-JBklfnkZ.js → binder-GTmFyrCu.js} +1 -1
- package/dist/client/assets/{breadcrumb-DZ4K3wPr.js → breadcrumb-iZbBQmAw.js} +1 -1
- package/dist/client/assets/{card-DkMC4yhp.js → card-CyJvSJWb.js} +1 -1
- package/dist/client/assets/{chart-oCbiVl3J.js → chart-BAb0wVHC.js} +1 -1
- package/dist/client/assets/{checkbox-DOpKFROJ.js → checkbox-D9hw1y4e.js} +1 -1
- package/dist/client/assets/{circle-alert-vyafkPY9.js → circle-alert-MDHm-xpi.js} +1 -1
- package/dist/client/assets/{collapsible-BqhrFzzR.js → collapsible-JmR8gcL1.js} +1 -1
- package/dist/client/assets/{collection-detail-CnE9tdFz.js → collection-detail-DPhTZmU2.js} +1 -1
- package/dist/client/assets/{collection-display-button-B5-Qbe51.js → collection-display-button-DKSbWUip.js} +1 -1
- package/dist/client/assets/{collection-search-BqJoX17Q.js → collection-search-CoyqU1D4.js} +1 -1
- package/dist/client/assets/{collection-tab-CalpHH6o.js → collection-tab-BhUGnesV.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BTjazYQf.js → collection-table-wrapper-DB-0Sbir.js} +1 -1
- package/dist/client/assets/{collection-tabs-EEOW6GRL.js → collection-tabs-CMDCQky7.js} +1 -1
- package/dist/client/assets/{command-BEFS8ANg.js → command-B1E9omIC.js} +1 -1
- package/dist/client/assets/{connect-DfPT2YCY.js → connect-VZjoVrkN.js} +1 -1
- package/dist/client/assets/{connection-card-BdnPGsex.js → connection-card-D1wFGPSt.js} +1 -1
- package/dist/client/assets/{connection-detail-CLUQ4ftB.js → connection-detail-BKyATRjq.js} +1 -1
- package/dist/client/assets/{connection-status-C-QmdjUW.js → connection-status-Djf9yQEZ.js} +1 -1
- package/dist/client/assets/{connections-kkqT0K5k.js → connections-B2qIhAsK.js} +1 -1
- package/dist/client/assets/constants-CJIMg126.js +1 -0
- package/dist/client/assets/{constants-BDiSPTuo.js → constants-CQia8SG0.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-jAyzYeAn.js → create-organization-dialog-BeY9othQ.js} +1 -1
- package/dist/client/assets/{create-project-dialog-D33xriWJ.js → create-project-dialog-BEdRfc9R.js} +1 -1
- package/dist/client/assets/{danger-Cha4pSGh.js → danger-B_y0n4gO.js} +1 -1
- package/dist/client/assets/{danger-zone-DADmz_4H.js → danger-zone-BgWu6tp3.js} +1 -1
- package/dist/client/assets/{decopilot-events-D0o8qF4i.js → decopilot-events-Cxyg_szC.js} +1 -1
- package/dist/client/assets/{dependencies-WKnlxG4W.js → dependencies-DHfx0ASL.js} +1 -1
- package/dist/client/assets/{dialog-DZh8Ph30.js → dialog-CRMnu4D5.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Z-xkakKz.js → dropdown-menu-C89udqdU.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-1VL-Nq0v.js → dynamic-plugin-layout-CJepJHId.js} +1 -1
- package/dist/client/assets/{editable-task-title-BtM8Y_i0.js → editable-task-title-Dftwn0Jq.js} +1 -1
- package/dist/client/assets/{empty-state-Bs6ZvT13.js → empty-state-SPMY63O9.js} +1 -1
- package/dist/client/assets/{env-vars-editor-C_fpQu3r.js → env-vars-editor-B-wGdKWy.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BvxOwwOc.js → extract-connection-data-B9XYD2id.js} +1 -1
- package/dist/client/assets/{file-browser-COkzPlsr.js → file-browser-WuEQLf3l.js} +2 -2
- package/dist/client/assets/{form-u0JM0zFo.js → form-D5fEmRYW.js} +1 -1
- package/dist/client/assets/{general-fg_RS0yr.js → general-CTvWH7rg.js} +1 -1
- package/dist/client/assets/{grid-view-D9Ic3afI.js → grid-view-BnX1z_Ch.js} +1 -1
- package/dist/client/assets/{home-C0wm8Ra0.js → home-C7YK5fqh.js} +1 -1
- package/dist/client/assets/{icon-picker-BYggeY9I.js → icon-picker-z3hf23Xc.js} +1 -1
- package/dist/client/assets/{index-BjjNfFZO.js → index-BdSTuQz3.js} +1 -1
- package/dist/client/assets/{index-DtzYx0E6.js → index-BtrcIP0U.js} +1 -1
- package/dist/client/assets/{index-D_0ZYhFs.js → index-BvccbczP.js} +1 -1
- package/dist/client/assets/{index-B6H1H8GZ.js → index-CFro8UN2.js} +3 -3
- package/dist/client/assets/{index-D-QI-if6.js → index-Dcd2vOoh.js} +1 -1
- package/dist/client/assets/{index-C-FConRx.js → index-TAv8a7S6.js} +1 -1
- package/dist/client/assets/{index-DGzQM1h1.js → index-UT-OKuyW.js} +1 -1
- package/dist/client/assets/{index-BTGfXm3p.js → index-v8sm2sIL.js} +1 -1
- package/dist/client/assets/{index-C21sEs5P.js → index-yK-spAaO.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B4_Pq1jp.js → infiniteQueryObserver-DRNwzQ2J.js} +1 -1
- package/dist/client/assets/{input-DL82FsGU.js → input-DHT-dQ79.js} +1 -1
- package/dist/client/assets/{integration-icon-lbcrIfEl.js → integration-icon-BIEcJDPc.js} +1 -1
- package/dist/client/assets/{label-CiV91E3T.js → label-DTRd2hOl.js} +1 -1
- package/dist/client/assets/{layout-DyQEA0SZ.js → layout-CoyjPych.js} +1 -1
- package/dist/client/assets/{layout-Be7WHnRk.js → layout-DSQJF_Qw.js} +1 -1
- package/dist/client/assets/{localstorage-keys-B-P4Lkkc.js → localstorage-keys-C6UNhMX3.js} +1 -1
- package/dist/client/assets/{login-B3dPe2uq.js → login-DRo1nfCX.js} +1 -1
- package/dist/client/assets/{markdown-Bf8aDiE3.js → markdown-C_NNKbxL.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BnVKlKcJ.js → mcp-app-renderer-Npg6Irre.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DZcgEuH9.js → mcp-server-card-_9Ad8GQZ.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Bt5RaPnX.js → mcp-server-detail-DiUTX-4T.js} +2 -2
- package/dist/client/assets/{members-BJawTGLR.js → members-CTLVZ_UU.js} +1 -1
- package/dist/client/assets/{monaco-editor-BQM0x1VO.js → monaco-editor-kBsXk8Uv.js} +1 -1
- package/dist/client/assets/{monitoring-blJKyDvA.js → monitoring-BxvRioe2.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-BDHHepNV.js → monitoring-dashboard-edit-BavhlQSN.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-ipSeoz8O.js → monitoring-dashboard-view-cCvR45k2.js} +1 -1
- package/dist/client/assets/{oauth-callback-BrSHCBQX.js → oauth-callback-Ut8wMr5A.js} +1 -1
- package/dist/client/assets/{page-CA_pelN-.js → page-ByhxsSXs.js} +1 -1
- package/dist/client/assets/{page-Kq0I6KKP.js → page-Can2Mcvy.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-RaKROIGH.js → plugin-empty-state-Bfx2fgKl.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-C4w1L8kt.js → plugin-empty-state-Cosz1pwR.js} +1 -1
- package/dist/client/assets/{plugin-header-BhtUXHbX.js → plugin-header-D7qmYXR-.js} +1 -1
- package/dist/client/assets/{plugin-header-sixzd3Ma.js → plugin-header-DhF4rvJU.js} +1 -1
- package/dist/client/assets/plugins-CExOue8T.js +1 -0
- package/dist/client/assets/{popover-BsBq580h.js → popover-CcXiFLG0.js} +1 -1
- package/dist/client/assets/{project-app-view-BJtfzuHN.js → project-app-view-C8owlFW4.js} +1 -1
- package/dist/client/assets/{project-layout-RD2qGV-x.js → project-layout-BILGWikD.js} +1 -1
- package/dist/client/assets/{project-plugins-COU6htGE.js → project-plugins-DUyruksA.js} +1 -1
- package/dist/client/assets/{projects-list-D9xGyghY.js → projects-list-BB9cD3_q.js} +1 -1
- package/dist/client/assets/{readme-viewer-BbXjdtG9.js → readme-viewer-D7DlvuHz.js} +1 -1
- package/dist/client/assets/{registry-layout-DeFY3kKT.js → registry-layout-CzqzSWVI.js} +1 -1
- package/dist/client/assets/{registry-utils-Bl8qAIIE.js → registry-utils-BM82D6MS.js} +1 -1
- package/dist/client/assets/{reports-layout-DEPJi7t7.js → reports-layout-DgIgiik2.js} +1 -1
- package/dist/client/assets/{reset-password-CCjN8Der.js → reset-password-C4PRxfSd.js} +1 -1
- package/dist/client/assets/{resizable-Dyz8Ueqx.js → resizable-BASq3Pgk.js} +1 -1
- package/dist/client/assets/{save-actions-BY0Prlb4.js → save-actions-wlTs7EAc.js} +1 -1
- package/dist/client/assets/{scroll-area-7QhPLRXH.js → scroll-area-C6nUo9wy.js} +1 -1
- package/dist/client/assets/{select-BNpARAGJ.js → select-aCEgiwRG.js} +1 -1
- package/dist/client/assets/{shell-layout-7XeOm_ax.js → shell-layout-BkdF_E4v.js} +2 -2
- package/dist/client/assets/{sidebar-settings-B9cT50kt.js → sidebar-settings-JiGQZ3fp.js} +1 -1
- package/dist/client/assets/{skeleton-BS-CeywH.js → skeleton-C5VDRx_S.js} +1 -1
- package/dist/client/assets/{spinner-DBhlROgw.js → spinner-D5-FOXs-.js} +1 -1
- package/dist/client/assets/{store-invite-e1T7z82O.js → store-invite-h96iSwsC.js} +1 -1
- package/dist/client/assets/{switch-wuXa1Kvf.js → switch-CzRdWsOb.js} +1 -1
- package/dist/client/assets/{table-ls4zjAkQ.js → table-DbeCzOFv.js} +1 -1
- package/dist/client/assets/{tabs-BpharFFf.js → tabs-Ml-lETIv.js} +1 -1
- package/dist/client/assets/tasks-CmzV6y78.js +1 -0
- package/dist/client/assets/{tasks-panel-Ct2D_gmM.js → tasks-panel-U539gk-l.js} +1 -1
- package/dist/client/assets/{textarea-DM9DH5x9.js → textarea-B8s-zfsk.js} +1 -1
- package/dist/client/assets/{time-range-picker-CdtxSNYv.js → time-range-picker-BS12ZDuS.js} +1 -1
- package/dist/client/assets/{toggle-group-BRFTG6MH.js → toggle-group-xYK4IM-u.js} +1 -1
- package/dist/client/assets/{tools-list-UPWCb7T0.js → tools-list-DUTGV-gT.js} +1 -1
- package/dist/client/assets/{tooltip-j8kTHx55.js → tooltip-oZyiLpuc.js} +1 -1
- package/dist/client/assets/{topbar-portal-BUJnfe9A.js → topbar-portal-Dioc5LFm.js} +1 -1
- package/dist/client/assets/{types-jFDozJe3.js → types-BwtK0SDt.js} +1 -1
- package/dist/client/assets/{use-binding-BfnusZ1F.js → use-binding-BSR1JqIQ.js} +1 -1
- package/dist/client/assets/{use-collections-D-dYas4g.js → use-collections-BPrRt-ii.js} +1 -1
- package/dist/client/assets/{use-connection-C6mRcJDK.js → use-connection-DG_OWqAP.js} +1 -1
- package/dist/client/assets/{use-copy-CVnO_3mM.js → use-copy-CXa-kk7H.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Dn5aJHho.js → use-create-virtual-mcp-Jzi9Oo3B.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-Ci2mnCpP.js → use-install-from-registry-D7-6zhi-.js} +1 -1
- package/dist/client/assets/{use-list-state-Cs0Vw1fn.js → use-list-state-CmyPcBg7.js} +1 -1
- package/dist/client/assets/{use-llm-C2ec2VVQ.js → use-llm-CCXNkRzc.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-C0pasPvz.js → use-mcp-resources-DE_pqa4e.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CMrxqGk3.js → use-mcp-tools-CZWduBUe.js} +1 -1
- package/dist/client/assets/{use-members-DyNTppwq.js → use-members-D0qifzUt.js} +1 -1
- package/dist/client/assets/{use-mobile-TplPgiBS.js → use-mobile-iIf5uj_e.js} +1 -1
- package/dist/client/assets/{use-project-BJg-zw4z.js → use-project-BZNqM_qN.js} +1 -1
- package/dist/client/assets/{use-settings-modal-nlOCOvru.js → use-settings-modal-DKqeXV5B.js} +1 -1
- package/dist/client/assets/{use-view-mode-Csk7hnWi.js → use-view-mode-F92r7fn5.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Dbh6kzyX.js → use-virtual-mcp-Duh8bmbW.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CirhN3j-.js +1 -0
- package/dist/client/assets/{useMutation-CJ6jjC2l.js → useMutation-DjbNdewa.js} +1 -1
- package/dist/client/assets/useQuery-DXBnvbwb.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BOauSLbt.js +1 -0
- package/dist/client/assets/{user-DoJm1uYf.js → user-B9NsMy7x.js} +1 -1
- package/dist/client/assets/{workflow-BypiKv8P.js → workflow-C-92M3XD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +3 -3
- package/dist/server/migrate.js +1 -1
- package/dist/server/node_modules/@esbuild/linux-x64/README.md +3 -0
- package/dist/server/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
- package/dist/server/node_modules/@esbuild/linux-x64/package.json +20 -0
- package/dist/server/node_modules/electron-to-chromium/LICENSE +5 -0
- package/dist/server/node_modules/electron-to-chromium/README.md +186 -0
- package/dist/server/node_modules/electron-to-chromium/chromium-versions.js +85 -0
- package/dist/server/node_modules/electron-to-chromium/chromium-versions.json +1 -0
- package/dist/server/node_modules/electron-to-chromium/full-chromium-versions.js +2706 -0
- package/dist/server/node_modules/electron-to-chromium/full-chromium-versions.json +1 -0
- package/dist/server/node_modules/electron-to-chromium/full-versions.js +1726 -0
- package/dist/server/node_modules/electron-to-chromium/full-versions.json +1 -0
- package/dist/server/node_modules/electron-to-chromium/index.js +36 -0
- package/dist/server/node_modules/electron-to-chromium/package.json +44 -0
- package/dist/server/node_modules/electron-to-chromium/versions.js +237 -0
- package/dist/server/node_modules/electron-to-chromium/versions.json +1 -0
- package/dist/server/node_modules/node-releases/LICENSE +21 -0
- package/dist/server/node_modules/node-releases/README.md +12 -0
- package/dist/server/node_modules/node-releases/data/processed/envs.json +1 -0
- package/dist/server/node_modules/node-releases/data/release-schedule/release-schedule.json +1 -0
- package/dist/server/node_modules/node-releases/package.json +22 -0
- package/dist/server/node_modules/picocolors/LICENSE +15 -0
- package/dist/server/node_modules/picocolors/README.md +21 -0
- package/dist/server/node_modules/picocolors/package.json +25 -0
- package/dist/server/node_modules/picocolors/picocolors.browser.js +4 -0
- package/dist/server/node_modules/picocolors/picocolors.d.ts +5 -0
- package/dist/server/node_modules/picocolors/picocolors.js +75 -0
- package/dist/server/node_modules/picocolors/types.d.ts +51 -0
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/constants-Dvvbc3ac.js +0 -1
- package/dist/client/assets/plugins-CD_83bbp.js +0 -1
- package/dist/client/assets/tasks-CJXh_ge0.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CQVTTHIu.js +0 -1
- package/dist/client/assets/useQuery-BQ0SjuWE.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BSv4Z18C.js +0 -1
- package/dist/server/node_modules/supports-color/browser.js +0 -24
- package/dist/server/node_modules/supports-color/index.js +0 -152
- package/dist/server/node_modules/supports-color/license +0 -9
- package/dist/server/node_modules/supports-color/package.json +0 -58
- package/dist/server/node_modules/supports-color/readme.md +0 -77
package/dist/server/migrate.js
CHANGED
|
@@ -1207,7 +1207,7 @@ data:
|
|
|
1207
1207
|
`;if(J)G+=`id: ${J}
|
|
1208
1208
|
`;return G+=`data: ${JSON.stringify(X)}
|
|
1209
1209
|
|
|
1210
|
-
`,Y.enqueue(Q.encode(G)),!0}catch{return!1}}handleUnsupportedRequest(){return new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32000,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(Y,Q){try{let X=Y.headers.get("accept");if(!X?.includes("application/json")||!X.includes("text/event-stream"))return this.createJsonErrorResponse(406,-32000,"Not Acceptable: Client must accept both application/json and text/event-stream");let J=Y.headers.get("content-type");if(!J||!J.includes("application/json"))return this.createJsonErrorResponse(415,-32000,"Unsupported Media Type: Content-Type must be application/json");let G={headers:Object.fromEntries(Y.headers.entries())},K;if(Q?.parsedBody!==void 0)K=Q.parsedBody;else try{K=await Y.json()}catch{return this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}let W;try{if(Array.isArray(K))W=K.map((M)=>oX.parse(M));else W=[oX.parse(K)]}catch{return this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}let Z=W.some(Rr);if(Z){if(this._initialized&&this.sessionId!==void 0)return this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(W.length>1)return this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");if(this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized)await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!Z){let M=this.validateSession(Y);if(M)return M;let w=this.validateProtocolVersion(Y);if(w)return w}if(!W.some(qW)){for(let M of W)this.onmessage?.(M,{authInfo:Q?.authInfo,requestInfo:G});return new Response(null,{status:202})}let F=crypto.randomUUID(),$=W.find((M)=>Rr(M)),V=$?$.params.protocolVersion:Y.headers.get("mcp-protocol-version")??lU1;if(this._enableJsonResponse)return new Promise((M)=>{this._streamMapping.set(F,{resolveJson:M,cleanup:()=>{this._streamMapping.delete(F)}});for(let w of W)if(qW(w))this._requestToStreamMapping.set(w.id,F);for(let w of W)this.onmessage?.(w,{authInfo:Q?.authInfo,requestInfo:G})});let B=new TextEncoder,U,z=new ReadableStream({start:(M)=>{U=M},cancel:()=>{this._streamMapping.delete(F)}}),L={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};if(this.sessionId!==void 0)L["mcp-session-id"]=this.sessionId;for(let M of W)if(qW(M))this._streamMapping.set(F,{controller:U,encoder:B,cleanup:()=>{this._streamMapping.delete(F);try{U.close()}catch{}}}),this._requestToStreamMapping.set(M.id,F);await this.writePrimingEvent(U,B,F,V);for(let M of W){let w,P;if(qW(M)&&this._eventStore&&V>="2025-11-25")w=()=>{this.closeSSEStream(M.id)},P=()=>{this.closeStandaloneSSEStream()};this.onmessage?.(M,{authInfo:Q?.authInfo,requestInfo:G,closeSSEStream:w,closeStandaloneSSEStream:P})}return new Response(z,{status:200,headers:L})}catch(X){return this.onerror?.(X),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(X)})}}async handleDeleteRequest(Y){let Q=this.validateSession(Y);if(Q)return Q;let X=this.validateProtocolVersion(Y);if(X)return X;return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),await this.close(),new Response(null,{status:200})}validateSession(Y){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.createJsonErrorResponse(400,-32000,"Bad Request: Server not initialized");let Q=Y.headers.get("mcp-session-id");if(!Q)return this.createJsonErrorResponse(400,-32000,"Bad Request: Mcp-Session-Id header is required");if(Q!==this.sessionId)return this.createJsonErrorResponse(404,-32001,"Session not found");return}validateProtocolVersion(Y){let Q=Y.headers.get("mcp-protocol-version");if(Q!==null&&!FV.includes(Q))return this.createJsonErrorResponse(400,-32000,`Bad Request: Unsupported protocol version: ${Q} (supported versions: ${FV.join(", ")})`);return}async close(){this._streamMapping.forEach(({cleanup:Y})=>{Y()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}closeSSEStream(Y){let Q=this._requestToStreamMapping.get(Y);if(!Q)return;let X=this._streamMapping.get(Q);if(X)X.cleanup()}closeStandaloneSSEStream(){let Y=this._streamMapping.get(this._standaloneSseStreamId);if(Y)Y.cleanup()}async send(Y,Q){let X=Q?.relatedRequestId;if(t7(Y)||Gz(Y))X=Y.id;if(X===void 0){if(t7(Y)||Gz(Y))throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let K;if(this._eventStore)K=await this._eventStore.storeEvent(this._standaloneSseStreamId,Y);let W=this._streamMapping.get(this._standaloneSseStreamId);if(W===void 0)return;if(W.controller&&W.encoder)this.writeSSEEvent(W.controller,W.encoder,Y,K);return}let J=this._requestToStreamMapping.get(X);if(!J)throw Error(`No connection established for request ID: ${String(X)}`);let G=this._streamMapping.get(J);if(!this._enableJsonResponse&&G?.controller&&G?.encoder){let K;if(this._eventStore)K=await this._eventStore.storeEvent(J,Y);this.writeSSEEvent(G.controller,G.encoder,Y,K)}if(t7(Y)||Gz(Y)){this._requestResponseMap.set(X,Y);let K=Array.from(this._requestToStreamMapping.entries()).filter(([Z,H])=>H===J).map(([Z])=>Z);if(K.every((Z)=>this._requestResponseMap.has(Z))){if(!G)throw Error(`No connection established for request ID: ${String(X)}`);if(this._enableJsonResponse&&G.resolveJson){let Z={"Content-Type":"application/json"};if(this.sessionId!==void 0)Z["mcp-session-id"]=this.sessionId;let H=K.map((F)=>this._requestResponseMap.get(F));if(H.length===1)G.resolveJson(new Response(JSON.stringify(H[0]),{status:200,headers:Z}));else G.resolveJson(new Response(JSON.stringify(H),{status:200,headers:Z}))}else G.cleanup();for(let Z of K)this._requestResponseMap.delete(Z),this._requestToStreamMapping.delete(Z)}}}}var cw0=S(()=>{_Y()});var iw0="SELF",lm=(Y)=>{return typeof Y==="object"&&Y!==null&&"handler"in Y&&"events"in Y&&typeof Y.handler==="function"&&Array.isArray(Y.events)},aw0=(Y)=>{return typeof Y==="object"&&Y!==null&&"handler"in Y&&"events"in Y&&typeof Y.handler==="function"&&Array.isArray(Y.events)},nw0="::",rw0=(Y)=>{let Q=Y.indexOf(nw0);if(Q===-1)return null;let X=Y.substring(0,Q),J=Y.substring(Q+nw0.length);return[X,J]},GF4=(Y)=>{if(!Y.startsWith("cron/"))return null;let Q=Y.substring(5),X=Q.indexOf("/");if(X===-1)return null;let J=Q.substring(0,X),G=Q.substring(X+1);return[J,G]},ow0=(Y)=>{if(lm(Y))return[];return Object.keys(Y)},WF4=(Y,Q)=>{if(lm(Y))return Y.events;let X=Y[Q];if(!X)return[];if(aw0(X))return X.events;return Object.keys(X)},mm=(Y,Q,X)=>{if(Y===iw0){if(!X)return console.warn("[Event] SELF binding used but no connectionId available"),null;return X}let J=Q[Y];if(!kZ1(J))return console.warn(`[Event] Binding "${Y}" not found in state`),null;return J.value},ZF4=(Y,Q,X)=>{let J=Q;if(lm(Y)){let K=[];for(let W of Y.events){let Z=rw0(W);if(!Z){console.warn(`[Event] Global handler event "${W}" must be prefixed with BINDING:: (e.g., "SELF::${W}" or "DATABASE::${W}")`);continue}let[H,F]=Z,$=mm(H,J,X);if(!$)continue;K.push({eventType:F,publisher:$})}return K}let G=[];for(let K of ow0(Y)){let W=mm(K,J,X);if(!W)continue;let Z=WF4(Y,K);for(let H of Z)G.push({eventType:H,publisher:W})}return G},KF4=(Y)=>{let Q=new Map;for(let X of Y){let J=X.source,G=Q.get(J)||[];G.push(X),Q.set(J,G)}return Q},HF4=(Y)=>{let Q=new Map;for(let X of Y){let J=X.type,G=Q.get(J)||[];G.push(X),Q.set(J,G)}return Q},FF4=(Y)=>{let Q={},X={},J=!1,G=0,K=[];for(let W of Y){if(W.results)Object.assign(X,W.results);if(W.success===!1){if(J=!0,W.error)K.push(W.error)}if(W.processedCount!==void 0)G+=W.processedCount}if(Object.keys(X).length>0)Q.results=X;if(Q.success=!J,K.length>0)Q.error=K.join("; ");if(G>0)Q.processedCount=G;return Q},$F4=async(Y,Q,X,J,G)=>{let K=J;if(lm(Y)){let $=new Set;for(let B of Y.events){let U=rw0(B);if(!U)continue;let[z,L]=U,M=mm(z,K,G);if(!M)continue;$.add(`${M}:${L}`)}let V=Q.filter((B)=>{let U=`${B.source}:${B.type}`;return $.has(U)});if(V.length===0)return{success:!0};try{return await Y.handler({events:V},X)}catch(B){return{success:!1,error:B instanceof Error?B.message:String(B)}}}let W=new Map;for(let $ of ow0(Y)){let V=mm($,K,G);if(V)W.set(V,$)}let Z=KF4(Q),H=[];for(let[$,V]of Z){let B=W.get($);if(!B)continue;let U=Y[B];if(!U)continue;if(aw0(U)){H.push((async()=>{try{return await U.handler({events:V},X)}catch(M){let w={};for(let P of V)w[P.id]={success:!1,error:M instanceof Error?M.message:String(M)};return{results:w}}})());continue}let z=U,L=HF4(V);for(let[M,w]of L){let P=z[M];if(!P)continue;H.push((async()=>{try{let I=await P({events:w},X),C={};for(let E of w)C[E.id]=I;return{results:C}}catch(I){let C={};for(let E of w)C[E.id]={success:!1,error:I instanceof Error?I.message:String(I)};return{results:C}}})())}}let F=await Promise.all(H);if(F.length===0)return{success:!0};return FF4(F)},dm;var gZ1=S(()=>{bm();dm={subscriptions:ZF4,execute:$F4,parseCron:GF4}});function w3(Y){return{...Y,execute:(Q)=>{return Y.execute({...Q,runtimeContext:bC(Q.runtimeContext)})}}}function uZ1(Y){return Y&&"streamable"in Y&&Y.streamable===!0}var bC=(Y)=>{let Q=OC.getStore();if(!Q){if(Y)return Y;throw Error("Missing context, did you forget to call State.bind?")}return Q},VF4=(Y,Q)=>{let X=Q;return typeof X[Y]<"u"?X[Y]:Q?.MESH_REQUEST_CONTEXT?.state?.[Y]},qF4=({events:Y,configuration:{state:Q,scopes:X,onChange:J}={}}={})=>{let G=Q?q.toJSONSchema(Q):{type:"object",properties:{}},K=String(Y?.bus??"EVENT_BUS");return[...J||Y?[w3({id:"ON_MCP_CONFIGURATION",description:"MCP Configuration On Change",inputSchema:q.object({state:Q??q.unknown(),scopes:q.array(q.string()).describe("Array of scopes in format 'KEY::SCOPE' (e.g., 'GMAIL::GetCurrentUser')")}),outputSchema:q.object({}),execute:async(W)=>{let Z=W.context.state;await J?.(W.runtimeContext.env,{state:Z,scopes:W.context.scopes});let H=VF4(K,W.runtimeContext.env);if(Y&&Z&&H){let F=W.runtimeContext.env.MESH_REQUEST_CONTEXT?.connectionId,$=dm.subscriptions(Y?.handlers??{},Z,F);if(await H.EVENT_SYNC_SUBSCRIPTIONS({subscriptions:$}),F){let V=$.filter((B)=>B.eventType.startsWith("cron/")&&B.publisher===F);await Promise.all(V.map(async(B)=>{let U=dm.parseCron(B.eventType);if(U){let[,z]=U;await H.EVENT_PUBLISH({type:B.eventType,cron:z})}}))}}return Promise.resolve({})}})]:[],...Y?.handlers?[w3({id:"ON_EVENTS",description:"Receive and process CloudEvents from the event bus. Returns per-event or batch results.",inputSchema:hm,outputSchema:xm,execute:async(W)=>{let Z=W.runtimeContext.env,H=Z.MESH_REQUEST_CONTEXT?.state,F=Z.MESH_REQUEST_CONTEXT?.connectionId;return dm.execute(Y.handlers,W.context.events,Z,H,F)}})]:[],w3({id:"MCP_CONFIGURATION",description:"MCP Configuration",inputSchema:q.object({}),outputSchema:q.object({stateSchema:q.unknown(),scopes:q.array(q.string()).optional()}),execute:()=>{return Promise.resolve({stateSchema:G,scopes:[...X??[],...Y?[`${K}::EVENT_SYNC_SUBSCRIPTIONS`]:[]]})}})]},sw0=(Y)=>{let Q=async(G)=>{await Y.before?.(G);let K=new Sz({name:"@deco/mcp-api",version:"1.0.0"},{capabilities:{tools:{},prompts:{},resources:{}}}),Z=await(typeof Y.tools==="function"?Y.tools:async(B)=>{if(typeof Y.tools==="function")return await Y.tools(B);return await Promise.all(Y.tools?.flatMap(async(U)=>{let L=await U(B);if(Array.isArray(L))return L;return[L]})??[]).then((U)=>U.flat())})(G);Z.push(...qF4(Y));for(let B of Z)K.registerTool(B.id,{_meta:{streamable:uZ1(B),...B._meta??{}},description:B.description,annotations:B.annotations,inputSchema:B.inputSchema&&"shape"in B.inputSchema?B.inputSchema.shape:q.object({}).shape,outputSchema:uZ1(B)?q.object({bytes:q.record(q.string(),q.number())}).shape:B.outputSchema&&typeof B.outputSchema==="object"&&("shape"in B.outputSchema)?B.outputSchema.shape:void 0},async(U)=>{let z=await B.execute({context:U,runtimeContext:bC()});if(uZ1(B)&&z instanceof Response)return{structuredContent:{streamable:!0,status:z.status,statusText:z.statusText},content:[{type:"text",text:`Streaming response: ${z.status} ${z.statusText}`}]};return{structuredContent:z,content:[{type:"text",text:JSON.stringify(z)}]}});let F=await(typeof Y.prompts==="function"?Y.prompts:async(B)=>{if(typeof Y.prompts==="function")return await Y.prompts(B);return await Promise.all(Y.prompts?.flatMap(async(U)=>{let L=await U(B);if(Array.isArray(L))return L;return[L]})??[]).then((U)=>U.flat())})(G);for(let B of F)K.registerPrompt(B.name,{title:B.title,description:B.description,argsSchema:B.argsSchema?B.argsSchema:q.object({}).shape},async(U)=>{return await B.execute({args:U,runtimeContext:bC()})});let V=await(typeof Y.resources==="function"?Y.resources:async(B)=>{if(typeof Y.resources==="function")return await Y.resources(B);return await Promise.all(Y.resources?.flatMap(async(U)=>{let L=await U(B);if(Array.isArray(L))return L;return[L]})??[]).then((U)=>U.flat())})(G);for(let B of V)K.resource(B.name,B.uri,{description:B.description,mimeType:B.mimeType},async(U)=>{let z=await B.read({uri:U,runtimeContext:bC()}),L={uri:z.uri};if(z.mimeType)L.mimeType=z.mimeType;if(z.text!==void 0)return{contents:[{uri:z.uri,mimeType:z.mimeType,text:z.text}]};else if(z.blob!==void 0)return{contents:[{uri:z.uri,mimeType:z.mimeType,blob:z.blob}]};return{contents:[{uri:z.uri,mimeType:z.mimeType,text:""}]}});return{server:K,tools:Z,prompts:F,resources:V}};return{fetch:async(G,K)=>{let{server:W}=await Q(K),Z=new xZ1;await W.connect(Z);try{let H=await Z.handleRequest(G),F=H.headers.get("content-type");if(!(F?.includes("text/event-stream")||F?.includes("application/json-rpc"))){console.debug("[MCP Transport] Closing transport for non-streaming response");try{await Z.close?.()}catch{}}else console.debug("[MCP Transport] Keeping transport open for streaming response (Content-Type: %s)",F);return H}catch(H){console.debug("[MCP Transport] Closing transport due to error:",H instanceof Error?H.message:H);try{await Z.close?.()}catch{}throw H}},callTool:async({toolCallId:G,toolCallInput:K})=>{let W=OC.getStore();if(!W)throw Error("Missing state, did you forget to call State.bind?");let Z=W?.env,{tools:H}=await Q(Z),$=H.find((V)=>V.id===G)?.execute;if(!$)throw Error(`Tool ${G} not found or does not have an execute function`);return $({context:K,runtimeContext:bC()})}}};var pm=S(()=>{um();Nk();cw0();k1();gZ1();yZ1();gZ1()});var BF4=({env:Y,server:Q,url:X})=>{Y.SELF=new Proxy({},{get:(J,G)=>{if(G==="toJSON")return null;return async(K)=>{return await Q.callTool({toolCallId:G,toolCallInput:K})}}}),Y.IS_LOCAL=(X?.startsWith("http://localhost")||X?.startsWith("http://127.0.0.1"))??!1},tw0=(Y)=>()=>{return{...Y??{}}},UF4=({env:Y,server:Q,tokenOrContext:X,url:J,authToken:G})=>{let K=Y,W=G?G.split(" ")[1]:void 0,Z;if(typeof X==="string"){let H=k8(X),F=H.metadata??{};Z={authorization:W,state:H.state??F.state??{},token:X,meshUrl:H.meshUrl??F.meshUrl,connectionId:H.connectionId??F.connectionId,organizationId:H.organizationId??F.organizationId,organizationName:H.organizationName??F.organizationName,organizationSlug:H.organizationSlug??F.organizationSlug,ensureAuthenticated:tw0(H.user??H.sub)}}else if(typeof X==="object"){Z=X;let H=k8(X.token),F=H.metadata??{},$=H.appName;Z.authorization??=W,Z.callerApp=$,Z.connectionId??=H.connectionId??F.connectionId,Z.ensureAuthenticated=tw0(H.user??H.sub)}else Z={state:{},authorization:W,token:void 0,meshUrl:void 0,connectionId:void 0,ensureAuthenticated:()=>{throw Error("Unauthorized")}};return K.MESH_REQUEST_CONTEXT=Z,Z.state=Ow0(Z),BF4({env:K,server:Q,url:J}),K},zF4,ew0=(Y)=>{let Q=sw0(Y),X=Y.cors??zF4,J=Y.oauth,G=J?Tw0(J):null,K=async(W,Z,H)=>{let F=new URL(W.url);if(G){if(F.pathname==="/.well-known/oauth-protected-resource"||F.pathname==="/mcp/.well-known/oauth-protected-resource")return G.handleProtectedResourceMetadata(W);if(F.pathname==="/.well-known/oauth-authorization-server")return G.handleAuthorizationServerMetadata(W);if(F.pathname==="/authorize")return G.handleAuthorize(W);if(F.pathname==="/oauth/callback")return G.handleOAuthCallback(W);if(F.pathname==="/token"&&W.method==="POST")return G.handleToken(W);if((F.pathname==="/register"||F.pathname==="/mcp/register")&&W.method==="POST")return G.handleClientRegistration(W)}if(F.pathname==="/mcp"){if(W.method==="GET")return new Response("Method not allowed",{status:405});if(G&&!G.hasAuth(W)){let $=W.clone();try{if((await $.json())?.method!=="tools/list")return G.createUnauthorizedResponse(W)}catch{return G.createUnauthorizedResponse(W)}}return Q.fetch(W,Z,H)}if(F.pathname.startsWith("/mcp/call-tool")){let $=F.pathname.split("/").pop();if(!$)return new Response("Not found",{status:404});let V=await W.json(),B=await Q.callTool({toolCallId:$,toolCallInput:V});if(B instanceof Response)return B;return new Response(JSON.stringify(B),{headers:{"Content-Type":"application/json"}})}return Y.fetch?.(W,Z,H)||new Response("Not found",{status:404})};return{fetch:async(W,Z,H)=>{if(new URL(W.url).pathname==="/_healthcheck")return new Response("OK",{status:200});if(X!==!1&&W.method==="OPTIONS")return Nw0(W,X??{});let F=UF4({authToken:W.headers.get("authorization")??null,env:{...process.env,...Z},server:Q,tokenOrContext:W.headers.get("x-mesh-token")??void 0,url:W.url}),$=await OC.run({req:W,env:F,ctx:H},async()=>await K(W,F,H));if(X!==!1)return Mw0($,W,X??{});return $}}};var YA0=S(()=>{OX();bm();ww0();yZ1();pm();pm();bm();_Z1();zF4={origin:(Y)=>{if(Y.includes("localhost")||Y.includes("127.0.0.1"))return Y;return Y},credentials:!0,allowMethods:["GET","POST","PUT","DELETE","OPTIONS"],allowHeaders:["Content-Type","Authorization","mcp-protocol-version"]}});function cm(Y){return Buffer.from(String(Y),"utf8").toString("base64")}function nm(Y){if(!Y)return null;try{let Q=Buffer.from(Y,"base64").toString("utf8"),X=Number.parseInt(Q,10);return Number.isNaN(X)||X<0?null:X}catch{return null}}function GQ(Y){if(!Y?.length)return[];return Array.from(new Set(Y.map((Q)=>Q.trim()).filter((Q)=>Q.length>0).map((Q)=>Q.toLowerCase())))}function yB(Y){if(!Y)return[];return GQ(Y.split(","))}function im(Y,Q){if(!Y)return Q;try{return JSON.parse(Y)}catch{return Q}}function am(Y){return Y?.["mcp.mesh"]??{}}function rm(Y){return Y.length?Y.join(","):null}function DF4(Y,Q){if(!Q?.length)return;let X=Y;for(let J of Q){if(X===null||X===void 0)return;if(typeof X!=="object")return;X=X[J]}return X}function OF4(Y,Q,X){if(!Q)return!1;if(Q==="eq")return Y===X;if(Q==="contains"||Q==="like"){let J=String(Y??"").toLowerCase(),G=String(X??"").toLowerCase();return J.includes(G)}if(Q==="in"){if(!Array.isArray(X))return!1;return X.includes(Y)}if(Q==="gt")return Number(Y)>Number(X);if(Q==="gte")return Number(Y)>=Number(X);if(Q==="lt")return Number(Y)<Number(X);if(Q==="lte")return Number(Y)<=Number(X);return!1}function hC(Y,Q){if(!Q)return!0;if(Array.isArray(Q.conditions)&&Q.conditions.length){if(Q.operator==="and")return Q.conditions.every((X)=>hC(Y,X));if(Q.operator==="or")return Q.conditions.some((X)=>hC(Y,X));if(Q.operator==="not")return!Q.conditions.some((X)=>hC(Y,X))}return OF4(DF4(Y,Q.field),Q.operator,Q.value)}class xC{db;constructor(Y){this.db=Y}async create(Y){let Q=new Date().toISOString(),X=Y._meta??{},J=am(X),G=GQ(J.tags),K=GQ(J.categories),W={id:Y.id,organization_id:Y.organization_id,title:Y.title,description:Y.description??null,server_json:JSON.stringify(Y.server),meta_json:JSON.stringify(X),tags:rm(G),categories:rm(K),is_public:Y.is_public?1:0,is_unlisted:Y.is_unlisted?1:0,created_at:Q,updated_at:Q,created_by:Y.created_by??null};await this.db.insertInto("private_registry_item").values(W).execute();let Z=await this.findById(Y.organization_id,Y.id);if(!Z)throw Error(`Failed to create registry item "${Y.id}"`);return Z}async findById(Y,Q){let X=await this.db.selectFrom("private_registry_item").selectAll().where("organization_id","=",Y).where("id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async findByIdOrName(Y,Q){let X=await this.findById(Y,Q);if(X)return X;let J=await this.db.selectFrom("private_registry_item").selectAll().where("organization_id","=",Y).where("title","=",Q).executeTakeFirst();return J?this.deserialize(J):null}async update(Y,Q,X){let J=await this.findById(Y,Q);if(!J)throw Error(`Registry item not found: ${Q}`);let G=X._meta??J._meta??{},K=am(G),W=GQ(K.tags),Z=GQ(K.categories),H={updated_at:new Date().toISOString()};if(X.title!==void 0)H.title=X.title;if(X.description!==void 0)H.description=X.description;if(X.server!==void 0)H.server_json=JSON.stringify(X.server);if(X._meta!==void 0)H.meta_json=JSON.stringify(X._meta);if(X._meta!==void 0)H.tags=rm(W),H.categories=rm(Z);if(X.is_public!==void 0)H.is_public=X.is_public?1:0;if(X.is_unlisted!==void 0)H.is_unlisted=X.is_unlisted?1:0;await this.db.updateTable("private_registry_item").set(H).where("organization_id","=",Y).where("id","=",Q).execute();let F=await this.findById(Y,Q);if(!F)throw Error(`Registry item not found after update: ${Q}`);return F}async delete(Y,Q){let X=await this.findById(Y,Q);if(!X)return null;return await this.db.deleteFrom("private_registry_item").where("organization_id","=",Y).where("id","=",Q).execute(),X}async list(Y,Q={}){let X=this.db.selectFrom("private_registry_item").selectAll().where("organization_id","=",Y).orderBy("created_at","desc");if(!Q.includeUnlisted)X=X.where("is_unlisted","=",0);let G=(await X.execute()).map((z)=>this.deserialize(z)),K=GQ(Q.tags),W=GQ(Q.categories),Z=G.filter((z)=>{let L=am(z._meta),M=GQ(L.tags),w=GQ(L.categories),P=K.length===0||K.every((E)=>M.includes(E)),I=W.length===0||W.every((E)=>w.includes(E)),C=hC(z,Q.where);return P&&I&&C}),F=nm(Q.cursor)??Q.offset??0,$=Q.limit??24,V=Z.slice(F,F+$),B=F+$<Z.length,U=B?cm(F+$):void 0;return{items:V,totalCount:Z.length,hasMore:B,nextCursor:U}}async listPublic(Y,Q={}){let J=(await this.db.selectFrom("private_registry_item").selectAll().where("organization_id","=",Y).where("is_public","=",1).where("is_unlisted","=",0).orderBy("created_at","desc").execute()).map((U)=>this.deserialize(U)),G=GQ(Q.tags),K=GQ(Q.categories),W=J.filter((U)=>{let z=am(U._meta),L=GQ(z.tags),M=GQ(z.categories),w=G.length===0||G.every((C)=>L.includes(C)),P=K.length===0||K.every((C)=>M.includes(C)),I=hC(U,Q.where);return w&&P&&I}),H=nm(Q.cursor)??Q.offset??0,F=Q.limit??24,$=W.slice(H,H+F),V=H+F<W.length,B=V?cm(H+F):void 0;return{items:$,totalCount:W.length,hasMore:V,nextCursor:B}}async getFilters(Y,Q){let X=this.db.selectFrom("private_registry_item").select(["tags","categories"]).where("organization_id","=",Y);if(Q?.publicOnly)X=X.where("is_public","=",1);if(!Q?.includeUnlisted)X=X.where("is_unlisted","=",0);let J=await X.execute(),G=new Map,K=new Map;for(let Z of J){for(let H of yB(Z.tags))G.set(H,(G.get(H)??0)+1);for(let H of yB(Z.categories))K.set(H,(K.get(H)??0)+1)}let W=(Z)=>Array.from(Z.entries()).map(([H,F])=>({value:H,count:F})).sort((H,F)=>H.value.localeCompare(F.value));return{tags:W(G),categories:W(K)}}async search(Y,Q={},X){let J=this.db.selectFrom("private_registry_item").select(["id","title","description","meta_json","server_json","tags","categories","is_public","is_unlisted"]).where("organization_id","=",Y).orderBy("created_at","desc");if(X?.publicOnly)J=J.where("is_public","=",1);if(!X?.includeUnlisted)J=J.where("is_unlisted","=",0);let G=await J.execute(),K=Q.query?.trim().toLowerCase(),W=GQ(Q.tags),Z=GQ(Q.categories),H=G.filter((M)=>{if(K){let w=im(M.server_json,{}),I=im(M.meta_json,{})?.["mcp.mesh"]?.short_description??"";if(![M.id,M.title,M.description??"",w.name??"",w.description??"",I].join(" ").toLowerCase().includes(K))return!1}if(W.length>0){let w=GQ(yB(M.tags));if(!W.every((P)=>w.includes(P)))return!1}if(Z.length>0){let w=GQ(yB(M.categories));if(!Z.every((P)=>w.includes(P)))return!1}return!0}),$=nm(Q.cursor)??0,V=Q.limit??20,B=H.slice($,$+V),U=$+V<H.length,z=U?cm($+V):void 0;return{items:B.map((M)=>({id:M.id,title:M.title,tags:yB(M.tags),categories:yB(M.categories),is_public:M.is_public===1,is_unlisted:M.is_unlisted===1})),totalCount:H.length,hasMore:U,nextCursor:z}}deserialize(Y){let Q=im(Y.server_json,{}),X=im(Y.meta_json,{});return{id:Y.id,name:typeof Q.name==="string"?Q.name:void 0,title:Y.title,description:Y.description,_meta:X,server:Q,is_public:Y.is_public===1,is_unlisted:Y.is_unlisted===1,created_at:Y.created_at,updated_at:Y.updated_at,...Y.created_by?{created_by:Y.created_by}:{}}}}var mZ1=()=>{};var om,LF4,sm,lG,lZ1,NF4,Z$,pL,uX,fB,dZ1,QA0,pZ1,XA0,cZ1,JA0,nZ1,GA0,cL,MF4,gC,wF4,tm,iZ1,WA0,ZA0,aZ1,KA0,HA0,FA0,$A0,VA0,qA0,BA0,UA0,AF4,rZ1,zA0,DA0,oZ1,OA0;var v9=S(()=>{gX();k1();om=q.object({name:q.string(),title:q.string().optional(),description:q.string().optional(),version:q.string().optional(),websiteUrl:q.string().optional(),icons:q.array(q.object({src:q.string()})).optional(),remotes:q.array(q.object({type:q.string().optional(),url:q.string().optional(),name:q.string().optional(),title:q.string().optional(),description:q.string().optional()})).optional(),packages:q.array(q.object({identifier:q.string(),version:q.string().optional()})).optional(),repository:q.object({url:q.string().optional(),source:q.string().optional(),subfolder:q.string().optional()}).optional()}),LF4=q.object({name:q.string(),description:q.string().nullable().optional()}),sm=q.object({"mcp.mesh":q.object({verified:q.boolean().optional(),tags:q.array(q.string()).optional(),categories:q.array(q.string()).optional(),friendly_name:q.string().nullable().optional(),short_description:q.string().max(160).nullable().optional(),owner:q.string().nullable().optional(),readme:q.string().max(50000).nullable().optional(),readme_url:q.string().url().nullable().optional(),has_remote:q.boolean().optional(),has_oauth:q.boolean().optional(),tools:q.array(LF4).optional()}).optional()}).catchall(q.unknown()),lG=q.object({id:q.string(),name:q.string().optional(),title:q.string(),description:q.string().nullable().optional(),_meta:sm.optional(),server:om,is_public:q.boolean().optional(),created_at:q.string(),updated_at:q.string(),created_by:q.string().optional()}),lZ1=q.object({id:q.string(),title:q.string(),description:q.string().nullable().optional(),_meta:sm.optional(),server:om,is_public:q.boolean().optional()}),NF4=q.object({title:q.string().optional(),description:q.string().nullable().optional(),_meta:sm.optional(),server:om.optional(),is_public:q.boolean().optional()}),Z$=mG.extend({tags:q.array(q.string()).optional().describe("Filter by tags (AND semantics)"),categories:q.array(q.string()).optional().describe("Filter by categories (AND semantics)"),cursor:q.string().optional().describe("Pagination cursor")}).describe("List registry items with optional filtering and pagination."),pL=q.object({items:q.array(lG),totalCount:q.number(),hasMore:q.boolean().optional(),nextCursor:q.string().optional()}),uX=q.object({id:q.string().optional().describe("Registry item ID"),name:q.string().optional().describe("Registry item name (alias for id)")}).refine((Y)=>Y.id||Y.name,{message:"At least one of 'id' or 'name' is required"}).describe("Get a registry item by ID or name."),fB=q.object({item:lG.nullable()}),dZ1=q.object({data:lZ1}),QA0=q.object({item:lG}),pZ1=q.object({items:q.array(lZ1).min(1)}),XA0=q.object({created:q.number(),errors:q.array(q.object({id:q.string(),error:q.string()}))}),cZ1=q.object({id:q.string(),data:NF4}),JA0=q.object({item:lG}),nZ1=q.object({id:q.string()}),GA0=q.object({item:lG}),cL=q.object({tags:q.array(q.object({value:q.string(),count:q.number()})),categories:q.array(q.object({value:q.string(),count:q.number()}))}),MF4=q.enum(["description","short_description","tags","categories","readme"]),gC=q.object({query:q.string().optional().describe("Free-text search across id, title, description, server name"),tags:q.array(q.string()).optional().describe("Filter by tags (AND)"),categories:q.array(q.string()).optional().describe("Filter by categories (AND)"),limit:q.number().int().min(1).max(100).optional().describe("Max results (default 20)"),cursor:q.string().optional().describe("Pagination cursor")}).describe("Lightweight search returning minimal fields (id, title, tags, categories, is_public)."),wF4=q.object({id:q.string(),title:q.string(),tags:q.array(q.string()),categories:q.array(q.string()),is_public:q.boolean()}),tm=q.object({items:q.array(wF4),totalCount:q.number(),hasMore:q.boolean().optional(),nextCursor:q.string().optional()}),iZ1=q.object({type:MF4.describe("Which content to generate"),llmConnectionId:q.string().describe("Connection ID of a language model"),modelId:q.string().describe("Model ID to use"),context:q.object({name:q.string().optional(),provider:q.string().optional(),url:q.string().optional(),owner:q.string().optional(),repositoryUrl:q.string().optional(),description:q.string().optional(),shortDescription:q.string().optional(),tags:q.array(q.string()).optional(),categories:q.array(q.string()).optional(),availableTags:q.array(q.string()).optional(),availableCategories:q.array(q.string()).optional(),tools:q.array(q.object({name:q.string(),description:q.string().nullable().optional()})).optional()})}),WA0=q.object({result:q.string().optional(),items:q.array(q.string()).optional()}),ZA0=q.enum(["pending","approved","rejected"]),aZ1=q.object({id:q.string(),organization_id:q.string(),requested_id:q.string().nullable().optional(),status:ZA0,title:q.string(),description:q.string().nullable().optional(),_meta:sm.optional(),server:om,requester_name:q.string().nullable().optional(),requester_email:q.string().nullable().optional(),reviewer_notes:q.string().nullable().optional(),created_at:q.string(),updated_at:q.string()}),KA0=q.object({status:ZA0.optional(),limit:q.number().int().min(1).max(200).optional(),offset:q.number().int().min(0).optional(),sortBy:q.enum(["created_at","title"]).optional(),sortDirection:q.enum(["asc","desc"]).optional()}),HA0=q.object({items:q.array(aZ1),totalCount:q.number()}),FA0=q.object({id:q.string(),status:q.enum(["approved","rejected"]),reviewerNotes:q.string().nullable().optional()}),$A0=q.object({item:aZ1}),VA0=q.object({pending:q.number()}),qA0=q.object({id:q.string()}),BA0=q.object({item:aZ1.nullable()}),UA0=q.object({data:lZ1,requester:q.object({name:q.string().optional(),email:q.string().email().optional()}).optional()}),AF4=q.object({id:q.string(),name:q.string(),prefix:q.string(),createdAt:q.string()}),rZ1=q.object({name:q.string().min(1).max(64).describe("A descriptive name for this key")}),zA0=q.object({id:q.string(),name:q.string(),prefix:q.string(),key:q.string().describe("The full API key \u2014 shown only once!"),createdAt:q.string()}),DA0=q.object({items:q.array(AF4)}),oZ1=q.object({keyId:q.string()}),OA0=q.object({success:q.boolean(),keyId:q.string()})});function PF4(Y,Q){let X=w3({id:"COLLECTION_REGISTRY_APP_LIST",description:"List public registry items",inputSchema:Z$,outputSchema:pL,execute:async({context:Z})=>{return await Y.listPublic(Q,{limit:Z.limit,offset:Z.offset,cursor:Z.cursor,tags:Z.tags,categories:Z.categories,where:Z.where})}}),J=w3({id:"COLLECTION_REGISTRY_APP_GET",description:"Get a public registry item by ID or name",inputSchema:uX,outputSchema:fB,execute:async({context:Z})=>{let H=Z.id??Z.name;if(!H)return{item:null};let F=await Y.findByIdOrName(Q,H);if(F&&F.is_public)return{item:F};return{item:null}}}),G=w3({id:"COLLECTION_REGISTRY_APP_VERSIONS",description:"Get available versions of a public registry item",inputSchema:uX,outputSchema:q.object({versions:q.array(fB.shape.item)}),execute:async({context:Z})=>{let H=Z.id??Z.name;if(!H)return{versions:[]};let F=await Y.findByIdOrName(Q,H);if(F&&F.is_public)return{versions:[F]};return{versions:[]}}}),K=w3({id:"COLLECTION_REGISTRY_APP_SEARCH",description:"Search public registry items returning minimal data (id, title, tags, categories, is_public). Use this instead of LIST when you need to find items efficiently without loading full details.",inputSchema:gC,outputSchema:tm,execute:async({context:Z})=>{return await Y.search(Q,Z,{publicOnly:!0})}}),W=w3({id:"COLLECTION_REGISTRY_APP_FILTERS",description:"Get available tags and categories for public registry items",inputSchema:q.object({}),outputSchema:cL,execute:async()=>{return await Y.getFilters(Q,{publicOnly:!0})}});return[X,K,J,G,W]}function sZ1(Y,Q){let X=Q.db,J=new xC(X);Y.all("/org/:orgSlug/registry/*",async(G)=>{let K=G.req.param("orgSlug");console.log(`[Public Registry MCP] Request for org slug: ${K}, path: ${G.req.path}`);let W=await X.selectFrom("organization").select(["id","slug","name"]).where("slug","=",K).executeTakeFirst();if(console.log("[Public Registry MCP] Found org:",W),!W)return console.log(`[Public Registry MCP] Organization not found: ${K}`),G.json({error:"Organization not found"},404);let Z=PF4(J,W.id),H=ew0({tools:()=>Z}),F=new URL(G.req.url),$=G.req.path.replace(`/org/${K}/registry`,""),V=new URL($||"/",F.origin);F.searchParams.forEach((z,L)=>{V.searchParams.set(L,z)}),console.log(`[Public Registry MCP] Rewriting ${F.pathname} to ${V.pathname}`);let B=new Request(V.toString(),{method:G.req.method,headers:G.req.raw.headers,body:G.req.method!=="GET"&&G.req.method!=="HEAD"?G.req.raw.body:void 0}),U={organizationId:W.id,db:X,MESH_REQUEST_CONTEXT:{},MESH_APP_DEPLOYMENT_ID:"public-registry",IS_LOCAL:!1};return await H.fetch(B,U,G)})}var LA0=S(()=>{YA0();pm();k1();mZ1();v9()});import{randomUUID as EF4}from"crypto";function NA0(Y,Q){if(!Y)return Q;try{return JSON.parse(Y)}catch{return Q}}class uC{db;constructor(Y){this.db=Y}async createOrUpdate(Y){let Q=new Date().toISOString(),X=await this.findPendingByRequestedId(Y.organization_id,Y.requested_id);if(X){let W={title:Y.title,description:Y.description??null,server_json:JSON.stringify(Y.server),meta_json:Y._meta?JSON.stringify(Y._meta):null,requester_name:Y.requester_name??null,requester_email:Y.requester_email??null,updated_at:Q};await this.db.updateTable("private_registry_publish_request").set(W).where("organization_id","=",Y.organization_id).where("id","=",X.id).execute();let Z=await this.findById(Y.organization_id,X.id);if(!Z)throw Error("Failed to update publish request");return Z}let J=EF4(),G={id:J,organization_id:Y.organization_id,requested_id:Y.requested_id,status:"pending",title:Y.title,description:Y.description??null,server_json:JSON.stringify(Y.server),meta_json:Y._meta?JSON.stringify(Y._meta):null,requester_name:Y.requester_name??null,requester_email:Y.requester_email??null,reviewer_notes:null,created_at:Q,updated_at:Q};await this.db.insertInto("private_registry_publish_request").values(G).execute();let K=await this.findById(Y.organization_id,J);if(!K)throw Error("Failed to create publish request");return K}async findPendingByRequestedId(Y,Q){let X=await this.db.selectFrom("private_registry_publish_request").selectAll().where("organization_id","=",Y).where("requested_id","=",Q).where("status","=","pending").executeTakeFirst();return X?this.deserialize(X):null}async findById(Y,Q){let X=await this.db.selectFrom("private_registry_publish_request").selectAll().where("organization_id","=",Y).where("id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async list(Y,Q={}){let X=this.db.selectFrom("private_registry_publish_request").selectAll().where("organization_id","=",Y),J=this.db.selectFrom("private_registry_publish_request").select((F)=>F.fn.countAll().as("count")).where("organization_id","=",Y);if(Q.status)X=X.where("status","=",Q.status),J=J.where("status","=",Q.status);let G=await J.executeTakeFirst(),K=Number(G?.count??0),W=Q.sortBy??"created_at",Z=Q.sortDirection??"desc";if(W==="title")X=X.orderBy("title",Z);else X=X.orderBy("created_at",Z);return{items:(await X.limit(Q.limit??24).offset(Q.offset??0).execute()).map((F)=>this.deserialize(F)),totalCount:K}}async updateStatus(Y,Q,X,J){let G={status:X,updated_at:new Date().toISOString(),reviewer_notes:J??null};await this.db.updateTable("private_registry_publish_request").set(G).where("organization_id","=",Y).where("id","=",Q).execute();let K=await this.findById(Y,Q);if(!K)throw Error(`Publish request not found: ${Q}`);return K}async countPending(Y){let Q=await this.db.selectFrom("private_registry_publish_request").select((X)=>X.fn.countAll().as("count")).where("organization_id","=",Y).where("status","=","pending").executeTakeFirst();return Number(Q?.count??0)}async delete(Y,Q){let X=await this.findById(Y,Q);if(!X)return null;return await this.db.deleteFrom("private_registry_publish_request").where("organization_id","=",Y).where("id","=",Q).execute(),X}deserialize(Y){return{id:Y.id,organization_id:Y.organization_id,requested_id:Y.requested_id??null,status:Y.status,title:Y.title,description:Y.description,_meta:NA0(Y.meta_json,{}),server:NA0(Y.server_json,{name:""}),requester_name:Y.requester_name,requester_email:Y.requester_email,reviewer_notes:Y.reviewer_notes,created_at:Y.created_at,updated_at:Y.updated_at}}}var tZ1=()=>{};import{randomUUID as TF4}from"crypto";async function MA0(Y){let X=new TextEncoder().encode(Y),J=await crypto.subtle.digest("SHA-256",X);return Array.from(new Uint8Array(J)).map((K)=>K.toString(16).padStart(2,"0")).join("")}function CF4(){let Y=new Uint8Array(32);return crypto.getRandomValues(Y),`prk_${Array.from(Y).map((X)=>X.toString(16).padStart(2,"0")).join("")}`}class mC{db;constructor(Y){this.db=Y}async generate(Y,Q){let X=TF4(),J=CF4(),G=await MA0(J),K=J.slice(0,12),W=new Date().toISOString();return await this.db.insertInto("private_registry_publish_api_key").values({id:X,organization_id:Y,name:Q,key_hash:G,prefix:K,created_at:W}).execute(),{entity:{id:X,organization_id:Y,name:Q,prefix:K,created_at:W},key:J}}async list(Y){return await this.db.selectFrom("private_registry_publish_api_key").select(["id","organization_id","name","prefix","created_at"]).where("organization_id","=",Y).orderBy("created_at","desc").execute()}async revoke(Y,Q){return(await this.db.deleteFrom("private_registry_publish_api_key").where("organization_id","=",Y).where("id","=",Q).execute()).length>0}async validate(Y,Q){let X=await MA0(Q),J=await this.db.selectFrom("private_registry_publish_api_key").select(["id"]).where("organization_id","=",Y).where("key_hash","=",X).executeTakeFirst();return Boolean(J)}async hasKeys(Y){let Q=await this.db.selectFrom("private_registry_publish_api_key").select((X)=>X.fn.countAll().as("count")).where("organization_id","=",Y).executeTakeFirst();return Number(Q?.count??0)>0}}var eZ1=()=>{};import{sql as RF4}from"kysely";import{randomUUID as wA0}from"crypto";async function jF4(Y){let Q=new Date().toISOString(),X=wA0(),J=u9.SELF(Y.organizationId),G="registry.publish_request.created",K={requestId:Y.request.id,requestedId:Y.request.requested_id,title:Y.request.title,status:Y.request.status,createdAt:Y.request.created_at,requester:{name:Y.request.requester_name,email:Y.request.requester_email}};await Y.db.insertInto("events").values({id:X,organization_id:Y.organizationId,type:"registry.publish_request.created",source:J,specversion:"1.0",subject:Y.request.id,time:Q,datacontenttype:"application/json",dataschema:null,data:JSON.stringify(K),cron:null,status:"pending",attempts:0,last_error:null,next_retry_at:null,created_at:Q,updated_at:Q}).execute();let W=await Y.db.selectFrom("event_subscriptions").select(["id"]).where("organization_id","=",Y.organizationId).where("enabled","=",1).where("event_type","=","registry.publish_request.created").where((Z)=>Z.or([Z("publisher","is",null),Z("publisher","=",J)])).execute();if(W.length>0)await Y.db.insertInto("event_deliveries").values(W.map((Z)=>({id:wA0(),event_id:X,subscription_id:Z.id,status:"pending",attempts:0,last_error:null,delivered_at:null,next_retry_at:null,created_at:Q}))).execute();try{await RF4`SELECT pg_notify('mesh_events', ${X})`.execute(Y.db)}catch{}}async function SF4(Y,Q){let J=(await Y.selectFrom("organization").select(["id"]).where("id","=",Q).execute())[0];if(J?.id)return J.id;return(await Y.selectFrom("organization").select(["id"]).where("slug","=",Q).execute())[0]?.id??null}async function _F4(Y,Q){let X=await Y.selectFrom("project_plugin_configs").innerJoin("projects","projects.id","project_plugin_configs.project_id").select(["project_plugin_configs.settings as settings"]).where("projects.organization_id","=",Q).where("project_plugin_configs.plugin_id","=",jZ).execute();for(let J of X){let G=J.settings,K=typeof G==="string"?(()=>{try{return JSON.parse(G)}catch{return{}}})():G??{};if(K.acceptPublishRequests===!0){let W=K.rateLimitWindow==="minute"?"minute":"hour",Z=K.rateLimitMax,H=typeof Z==="number"&&Number.isFinite(Z)&&Z>=1?Math.floor(Z):PA0;return{acceptPublishRequests:!0,requireApiToken:K.requireApiToken===!0,rateLimitEnabled:K.rateLimitEnabled===void 0?AA0:K.rateLimitEnabled===!0,rateLimitWindow:W,rateLimitMax:H}}}return{acceptPublishRequests:!1,requireApiToken:!1,rateLimitEnabled:AA0,rateLimitWindow:IF4,rateLimitMax:PA0}}async function vF4(Y,Q,X){let J=X==="minute"?60000:3600000,G=new Date(Date.now()-J).toISOString(),K=await Y.selectFrom("private_registry_publish_request").select((W)=>W.fn.countAll().as("count")).where("organization_id","=",Q).where("created_at",">=",G).executeTakeFirst();return Number(K?.count??0)}async function kF4(Y,Q,X,J){let G=await Y.selectFrom("private_registry_item").select(["id","title"]).where("organization_id","=",Q).where((K)=>K.or([K("id","=",X),K("title","=",J)])).executeTakeFirst();return G?{id:String(G.id),title:String(G.title)}:null}function YK1(Y,Q){let{db:X,db:J}=Q,G=new uC(J),K=new mC(J);Y.post("/org/:orgRef/registry/publish-request",async(W)=>{let Z=W.req.param("orgRef"),H=await SF4(X,Z);if(!H)return W.json({error:"Organization not found"},404);let F=await _F4(X,H);if(!F.acceptPublishRequests)return W.json({error:"Publish requests are not enabled for this registry."},403);if(F.requireApiToken){let z=W.req.header("Authorization"),L=z?.startsWith("Bearer ")?z.slice(7).trim():null;if(!L)return W.json({error:"API key required. Use Authorization: Bearer <key>"},401);if(!await K.validate(H,L))return W.json({error:"Invalid API key"},401)}if(F.rateLimitEnabled){if(await vF4(J,H,F.rateLimitWindow)>=F.rateLimitMax)return W.json({error:"Too many publish requests. Please try again later.",retryAfterSeconds:F.rateLimitWindow==="minute"?60:3600},429)}let $;try{$=await W.req.json()}catch{return W.json({error:"Invalid JSON body"},400)}let V=UA0.safeParse($);if(!V.success)return W.json({error:"Invalid publish request payload",details:q.treeifyError(V.error)},400);let B=await kF4(J,H,V.data.data.id,V.data.data.title);if(B)return W.json({error:"A registry item with the same id or title already exists. Please use a different name/id.",conflict:B},409);let U=await G.createOrUpdate({organization_id:H,requested_id:V.data.data.id,title:V.data.data.title,description:V.data.data.description??null,_meta:V.data.data._meta,server:V.data.data.server,requester_name:V.data.requester?.name??null,requester_email:V.data.requester?.email??null});try{await jF4({db:X,organizationId:H,request:U})}catch(z){console.warn("[private-registry] failed to emit publish-request event:",z)}return W.json({id:U.id,requested_id:U.requested_id,status:U.status},201)})}var AA0=!0,IF4="hour",PA0=100;var EA0=S(()=>{DY();k1();SB();tZ1();eZ1();v9()});var TA0=S(()=>{LA0();EA0()});function CA0(Y){QK1=Y}function t0(){if(!QK1)throw Error(`Plugin storage not initialized. Make sure the "${jZ}" plugin is enabled.`);return QK1}async function yF4(Y){if(!Y.organization)throw Error("Organization context required");return await Y.access.check(),Y}function O6(Y,Q){return async(X,J)=>{let G=await yF4(J);return Q(X,G)}}function fF4(Y){if(!Y)return{};if(typeof Y==="string")try{return JSON.parse(Y)}catch{return{}}if(typeof Y==="object")return Y;return{}}async function lC(Y,Q){let J=(await Y.db.selectFrom("project_plugin_configs").innerJoin("projects","projects.id","project_plugin_configs.project_id").select(["project_plugin_configs.settings as settings"]).where("projects.organization_id","=",Q).where("project_plugin_configs.plugin_id","=",jZ).execute()).map((K)=>fF4(K.settings)),G={acceptPublishRequests:J.some((K)=>K.acceptPublishRequests===!0),requireApiToken:J.some((K)=>K.requireApiToken===!0),storePrivateOnly:J.some((K)=>K.storePrivateOnly===!0)};if(G.acceptPublishRequests||G.requireApiToken||G.storePrivateOnly)return G;for(let K of J)if(Object.keys(K).length>0)return K;return{}}var QK1=null;var J8=S(()=>{SB()});import{randomUUID as RA0}from"crypto";function IA0(Y,Q){if(!Y)return Q;try{return JSON.parse(Y)}catch{return Q}}class XK1{db;constructor(Y){this.db=Y}async create(Y){let Q=RA0(),X=new Date().toISOString(),J={id:Q,organization_id:Y.organization_id,status:Y.status??"pending",config_snapshot:Y.config_snapshot?JSON.stringify(Y.config_snapshot):null,total_items:Y.total_items??0,tested_items:0,passed_items:0,failed_items:0,skipped_items:0,current_item_id:null,started_at:Y.started_at??null,finished_at:null,created_at:X};await this.db.insertInto("private_registry_monitor_run").values(J).execute();let G=await this.findById(Y.organization_id,Q);if(!G)throw Error(`Failed to create monitor run ${Q}`);return G}async findById(Y,Q){let X=await this.db.selectFrom("private_registry_monitor_run").selectAll().where("organization_id","=",Y).where("id","=",Q).executeTakeFirst();return X?this.deserializeRun(X):null}async list(Y,Q={}){let X=this.db.selectFrom("private_registry_monitor_run").selectAll().where("organization_id","=",Y),J=this.db.selectFrom("private_registry_monitor_run").select((Z)=>Z.fn.countAll().as("count")).where("organization_id","=",Y);if(Q.status)X=X.where("status","=",Q.status),J=J.where("status","=",Q.status);let G=await J.executeTakeFirst(),K=Number(G?.count??0);return{items:(await X.orderBy("created_at","desc").limit(Q.limit??24).offset(Q.offset??0).execute()).map((Z)=>this.deserializeRun(Z)),totalCount:K}}async update(Y,Q,X){let J={};if(X.total_items!==void 0)J.total_items=X.total_items;if(X.status!==void 0)J.status=X.status;if(X.tested_items!==void 0)J.tested_items=X.tested_items;if(X.passed_items!==void 0)J.passed_items=X.passed_items;if(X.failed_items!==void 0)J.failed_items=X.failed_items;if(X.skipped_items!==void 0)J.skipped_items=X.skipped_items;if(X.current_item_id!==void 0)J.current_item_id=X.current_item_id;if(X.started_at!==void 0)J.started_at=X.started_at;if(X.finished_at!==void 0)J.finished_at=X.finished_at;await this.db.updateTable("private_registry_monitor_run").set(J).where("organization_id","=",Y).where("id","=",Q).execute();let G=await this.findById(Y,Q);if(!G)throw Error(`Monitor run not found: ${Q}`);return G}deserializeRun(Y){return{id:Y.id,organization_id:Y.organization_id,status:Y.status,config_snapshot:IA0(Y.config_snapshot,null),total_items:Number(Y.total_items??0),tested_items:Number(Y.tested_items??0),passed_items:Number(Y.passed_items??0),failed_items:Number(Y.failed_items??0),skipped_items:Number(Y.skipped_items??0),current_item_id:Y.current_item_id,started_at:Y.started_at,finished_at:Y.finished_at,created_at:Y.created_at}}}class JK1{db;constructor(Y){this.db=Y}async create(Y){let Q=RA0(),X=new Date().toISOString(),J={id:Q,run_id:Y.run_id,organization_id:Y.organization_id,item_id:Y.item_id,item_title:Y.item_title,status:Y.status,error_message:Y.error_message??null,connection_ok:Y.connection_ok?1:0,tools_listed:Y.tools_listed?1:0,tool_results:Y.tool_results?JSON.stringify(Y.tool_results):null,agent_summary:Y.agent_summary??null,duration_ms:Y.duration_ms??0,action_taken:Y.action_taken??"none",tested_at:X};await this.db.insertInto("private_registry_monitor_result").values(J).execute();let G=await this.findById(Y.organization_id,Q);if(!G)throw Error("Failed to create test result");return G}async findById(Y,Q){let X=await this.db.selectFrom("private_registry_monitor_result").selectAll().where("organization_id","=",Y).where("id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async listByRun(Y,Q,X={}){let J=this.db.selectFrom("private_registry_monitor_result").selectAll().where("organization_id","=",Y).where("run_id","=",Q),G=this.db.selectFrom("private_registry_monitor_result").select((H)=>H.fn.countAll().as("count")).where("organization_id","=",Y).where("run_id","=",Q);if(X.status)J=J.where("status","=",X.status),G=G.where("status","=",X.status);let K=await G.executeTakeFirst(),W=Number(K?.count??0);return{items:(await J.orderBy("tested_at","desc").limit(X.limit??50).offset(X.offset??0).execute()).map((H)=>this.deserialize(H)),totalCount:W}}async update(Y,Q,X){let J={};if(X.status!==void 0)J.status=X.status;if(X.error_message!==void 0)J.error_message=X.error_message;if(X.connection_ok!==void 0)J.connection_ok=X.connection_ok?1:0;if(X.tools_listed!==void 0)J.tools_listed=X.tools_listed?1:0;if(X.tool_results!==void 0)J.tool_results=JSON.stringify(X.tool_results);if(X.agent_summary!==void 0)J.agent_summary=X.agent_summary;if(X.duration_ms!==void 0)J.duration_ms=X.duration_ms;if(X.action_taken!==void 0)J.action_taken=X.action_taken;await this.db.updateTable("private_registry_monitor_result").set(J).where("organization_id","=",Y).where("id","=",Q).execute();let G=await this.findById(Y,Q);if(!G)throw Error(`Monitor result not found: ${Q}`);return G}deserialize(Y){return{id:Y.id,run_id:Y.run_id,organization_id:Y.organization_id,item_id:Y.item_id,item_title:Y.item_title,status:Y.status,error_message:Y.error_message,connection_ok:Y.connection_ok===1,tools_listed:Y.tools_listed===1,tool_results:IA0(Y.tool_results,[]),agent_summary:Y.agent_summary,duration_ms:Number(Y.duration_ms??0),action_taken:Y.action_taken,tested_at:Y.tested_at}}}var jA0=()=>{};import{randomUUID as bF4}from"crypto";class GK1{db;constructor(Y){this.db=Y}async findByItemId(Y,Q){let X=await this.db.selectFrom("private_registry_monitor_connection").selectAll().where("organization_id","=",Y).where("item_id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async list(Y){return(await this.db.selectFrom("private_registry_monitor_connection").selectAll().where("organization_id","=",Y).orderBy("updated_at","desc").execute()).map((X)=>this.deserialize(X))}async findByConnectionId(Y,Q){let X=await this.db.selectFrom("private_registry_monitor_connection").selectAll().where("organization_id","=",Y).where("connection_id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async upsert(Y){let Q=await this.findByItemId(Y.organization_id,Y.item_id),X=new Date().toISOString();if(!Q){let G={id:bF4(),organization_id:Y.organization_id,item_id:Y.item_id,connection_id:Y.connection_id,auth_status:Y.auth_status??"none",created_at:X,updated_at:X};await this.db.insertInto("private_registry_monitor_connection").values(G).execute()}else{let G={connection_id:Y.connection_id,auth_status:Y.auth_status??Q.auth_status,updated_at:X};await this.db.updateTable("private_registry_monitor_connection").set(G).where("organization_id","=",Y.organization_id).where("item_id","=",Y.item_id).execute()}let J=await this.findByItemId(Y.organization_id,Y.item_id);if(!J)throw Error("Failed to save monitor connection");return J}async updateAuthStatus(Y,Q,X){return await this.db.updateTable("private_registry_monitor_connection").set({auth_status:X,updated_at:new Date().toISOString()}).where("organization_id","=",Y).where("item_id","=",Q).execute(),this.findByItemId(Y,Q)}deserialize(Y){return{id:Y.id,organization_id:Y.organization_id,item_id:Y.item_id,connection_id:Y.connection_id,auth_status:Y.auth_status,created_at:Y.created_at,updated_at:Y.updated_at}}}var SA0=()=>{};function _A0(Y){let Q=Y.db,X={items:new xC(Q),publishRequests:new uC(Q),publishApiKeys:new mC(Q),monitorRuns:new XK1(Q),monitorResults:new JK1(Q),monitorConnections:new GK1(Q)};return CA0(X),X}var vA0=S(()=>{J8();mZ1();tZ1();eZ1();jA0();SA0()});var kA0;var yA0=S(()=>{v9();J8();kA0={name:"REGISTRY_ITEM_BULK_CREATE",description:"Create many private registry items at once",inputSchema:pZ1,outputSchema:XA0,handler:O6(pZ1,async(Y,Q)=>{let X=t0(),J=[],G=0;for(let K of Y.items)try{await X.items.create({...K,organization_id:Q.organization.id,created_by:Q.auth.user?.id??null}),G+=1}catch(W){J.push({id:K.id,error:W instanceof Error?W.message:"Unknown error"})}return{created:G,errors:J}})}});function hF4(Y){return Array.from(new Set(Y.map((Q)=>Q.trim().toLowerCase()).filter((Q)=>Q.length>0)))}function xF4(Y){let X=Y.structuredContent?.content?.filter((J)=>J.type==="text"&&typeof J.text==="string").map((J)=>J.text??"").join(`
|
|
1210
|
+
`,Y.enqueue(Q.encode(G)),!0}catch{return!1}}handleUnsupportedRequest(){return new Response(JSON.stringify({jsonrpc:"2.0",error:{code:-32000,message:"Method not allowed."},id:null}),{status:405,headers:{Allow:"GET, POST, DELETE","Content-Type":"application/json"}})}async handlePostRequest(Y,Q){try{let X=Y.headers.get("accept");if(!X?.includes("application/json")||!X.includes("text/event-stream"))return this.createJsonErrorResponse(406,-32000,"Not Acceptable: Client must accept both application/json and text/event-stream");let J=Y.headers.get("content-type");if(!J||!J.includes("application/json"))return this.createJsonErrorResponse(415,-32000,"Unsupported Media Type: Content-Type must be application/json");let G={headers:Object.fromEntries(Y.headers.entries())},K;if(Q?.parsedBody!==void 0)K=Q.parsedBody;else try{K=await Y.json()}catch{return this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON")}let W;try{if(Array.isArray(K))W=K.map((M)=>oX.parse(M));else W=[oX.parse(K)]}catch{return this.createJsonErrorResponse(400,-32700,"Parse error: Invalid JSON-RPC message")}let Z=W.some(Rr);if(Z){if(this._initialized&&this.sessionId!==void 0)return this.createJsonErrorResponse(400,-32600,"Invalid Request: Server already initialized");if(W.length>1)return this.createJsonErrorResponse(400,-32600,"Invalid Request: Only one initialization request is allowed");if(this.sessionId=this.sessionIdGenerator?.(),this._initialized=!0,this.sessionId&&this._onsessioninitialized)await Promise.resolve(this._onsessioninitialized(this.sessionId))}if(!Z){let M=this.validateSession(Y);if(M)return M;let w=this.validateProtocolVersion(Y);if(w)return w}if(!W.some(qW)){for(let M of W)this.onmessage?.(M,{authInfo:Q?.authInfo,requestInfo:G});return new Response(null,{status:202})}let F=crypto.randomUUID(),$=W.find((M)=>Rr(M)),V=$?$.params.protocolVersion:Y.headers.get("mcp-protocol-version")??lU1;if(this._enableJsonResponse)return new Promise((M)=>{this._streamMapping.set(F,{resolveJson:M,cleanup:()=>{this._streamMapping.delete(F)}});for(let w of W)if(qW(w))this._requestToStreamMapping.set(w.id,F);for(let w of W)this.onmessage?.(w,{authInfo:Q?.authInfo,requestInfo:G})});let B=new TextEncoder,U,z=new ReadableStream({start:(M)=>{U=M},cancel:()=>{this._streamMapping.delete(F)}}),L={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"};if(this.sessionId!==void 0)L["mcp-session-id"]=this.sessionId;for(let M of W)if(qW(M))this._streamMapping.set(F,{controller:U,encoder:B,cleanup:()=>{this._streamMapping.delete(F);try{U.close()}catch{}}}),this._requestToStreamMapping.set(M.id,F);await this.writePrimingEvent(U,B,F,V);for(let M of W){let w,P;if(qW(M)&&this._eventStore&&V>="2025-11-25")w=()=>{this.closeSSEStream(M.id)},P=()=>{this.closeStandaloneSSEStream()};this.onmessage?.(M,{authInfo:Q?.authInfo,requestInfo:G,closeSSEStream:w,closeStandaloneSSEStream:P})}return new Response(z,{status:200,headers:L})}catch(X){return this.onerror?.(X),this.createJsonErrorResponse(400,-32700,"Parse error",{data:String(X)})}}async handleDeleteRequest(Y){let Q=this.validateSession(Y);if(Q)return Q;let X=this.validateProtocolVersion(Y);if(X)return X;return await Promise.resolve(this._onsessionclosed?.(this.sessionId)),await this.close(),new Response(null,{status:200})}validateSession(Y){if(this.sessionIdGenerator===void 0)return;if(!this._initialized)return this.createJsonErrorResponse(400,-32000,"Bad Request: Server not initialized");let Q=Y.headers.get("mcp-session-id");if(!Q)return this.createJsonErrorResponse(400,-32000,"Bad Request: Mcp-Session-Id header is required");if(Q!==this.sessionId)return this.createJsonErrorResponse(404,-32001,"Session not found");return}validateProtocolVersion(Y){let Q=Y.headers.get("mcp-protocol-version");if(Q!==null&&!FV.includes(Q))return this.createJsonErrorResponse(400,-32000,`Bad Request: Unsupported protocol version: ${Q} (supported versions: ${FV.join(", ")})`);return}async close(){this._streamMapping.forEach(({cleanup:Y})=>{Y()}),this._streamMapping.clear(),this._requestResponseMap.clear(),this.onclose?.()}closeSSEStream(Y){let Q=this._requestToStreamMapping.get(Y);if(!Q)return;let X=this._streamMapping.get(Q);if(X)X.cleanup()}closeStandaloneSSEStream(){let Y=this._streamMapping.get(this._standaloneSseStreamId);if(Y)Y.cleanup()}async send(Y,Q){let X=Q?.relatedRequestId;if(t7(Y)||Gz(Y))X=Y.id;if(X===void 0){if(t7(Y)||Gz(Y))throw Error("Cannot send a response on a standalone SSE stream unless resuming a previous client request");let K;if(this._eventStore)K=await this._eventStore.storeEvent(this._standaloneSseStreamId,Y);let W=this._streamMapping.get(this._standaloneSseStreamId);if(W===void 0)return;if(W.controller&&W.encoder)this.writeSSEEvent(W.controller,W.encoder,Y,K);return}let J=this._requestToStreamMapping.get(X);if(!J)throw Error(`No connection established for request ID: ${String(X)}`);let G=this._streamMapping.get(J);if(!this._enableJsonResponse&&G?.controller&&G?.encoder){let K;if(this._eventStore)K=await this._eventStore.storeEvent(J,Y);this.writeSSEEvent(G.controller,G.encoder,Y,K)}if(t7(Y)||Gz(Y)){this._requestResponseMap.set(X,Y);let K=Array.from(this._requestToStreamMapping.entries()).filter(([Z,H])=>H===J).map(([Z])=>Z);if(K.every((Z)=>this._requestResponseMap.has(Z))){if(!G)throw Error(`No connection established for request ID: ${String(X)}`);if(this._enableJsonResponse&&G.resolveJson){let Z={"Content-Type":"application/json"};if(this.sessionId!==void 0)Z["mcp-session-id"]=this.sessionId;let H=K.map((F)=>this._requestResponseMap.get(F));if(H.length===1)G.resolveJson(new Response(JSON.stringify(H[0]),{status:200,headers:Z}));else G.resolveJson(new Response(JSON.stringify(H),{status:200,headers:Z}))}else G.cleanup();for(let Z of K)this._requestResponseMap.delete(Z),this._requestToStreamMapping.delete(Z)}}}}var cw0=S(()=>{_Y()});var iw0="SELF",lm=(Y)=>{return typeof Y==="object"&&Y!==null&&"handler"in Y&&"events"in Y&&typeof Y.handler==="function"&&Array.isArray(Y.events)},aw0=(Y)=>{return typeof Y==="object"&&Y!==null&&"handler"in Y&&"events"in Y&&typeof Y.handler==="function"&&Array.isArray(Y.events)},nw0="::",rw0=(Y)=>{let Q=Y.indexOf(nw0);if(Q===-1)return null;let X=Y.substring(0,Q),J=Y.substring(Q+nw0.length);return[X,J]},GF4=(Y)=>{if(!Y.startsWith("cron/"))return null;let Q=Y.substring(5),X=Q.indexOf("/");if(X===-1)return null;let J=Q.substring(0,X),G=Q.substring(X+1);return[J,G]},ow0=(Y)=>{if(lm(Y))return[];return Object.keys(Y)},WF4=(Y,Q)=>{if(lm(Y))return Y.events;let X=Y[Q];if(!X)return[];if(aw0(X))return X.events;return Object.keys(X)},mm=(Y,Q,X)=>{if(Y===iw0){if(!X)return console.warn("[Event] SELF binding used but no connectionId available"),null;return X}let J=Q[Y];if(!kZ1(J))return console.warn(`[Event] Binding "${Y}" not found in state`),null;return J.value},ZF4=(Y,Q,X)=>{let J=Q;if(lm(Y)){let K=[];for(let W of Y.events){let Z=rw0(W);if(!Z){console.warn(`[Event] Global handler event "${W}" must be prefixed with BINDING:: (e.g., "SELF::${W}" or "DATABASE::${W}")`);continue}let[H,F]=Z,$=mm(H,J,X);if(!$)continue;K.push({eventType:F,publisher:$})}return K}let G=[];for(let K of ow0(Y)){let W=mm(K,J,X);if(!W)continue;let Z=WF4(Y,K);for(let H of Z)G.push({eventType:H,publisher:W})}return G},KF4=(Y)=>{let Q=new Map;for(let X of Y){let J=X.source,G=Q.get(J)||[];G.push(X),Q.set(J,G)}return Q},HF4=(Y)=>{let Q=new Map;for(let X of Y){let J=X.type,G=Q.get(J)||[];G.push(X),Q.set(J,G)}return Q},FF4=(Y)=>{let Q={},X={},J=!1,G=0,K=[];for(let W of Y){if(W.results)Object.assign(X,W.results);if(W.success===!1){if(J=!0,W.error)K.push(W.error)}if(W.processedCount!==void 0)G+=W.processedCount}if(Object.keys(X).length>0)Q.results=X;if(Q.success=!J,K.length>0)Q.error=K.join("; ");if(G>0)Q.processedCount=G;return Q},$F4=async(Y,Q,X,J,G)=>{let K=J;if(lm(Y)){let $=new Set;for(let B of Y.events){let U=rw0(B);if(!U)continue;let[z,L]=U,M=mm(z,K,G);if(!M)continue;$.add(`${M}:${L}`)}let V=Q.filter((B)=>{let U=`${B.source}:${B.type}`;return $.has(U)});if(V.length===0)return{success:!0};try{return await Y.handler({events:V},X)}catch(B){return{success:!1,error:B instanceof Error?B.message:String(B)}}}let W=new Map;for(let $ of ow0(Y)){let V=mm($,K,G);if(V)W.set(V,$)}let Z=KF4(Q),H=[];for(let[$,V]of Z){let B=W.get($);if(!B)continue;let U=Y[B];if(!U)continue;if(aw0(U)){H.push((async()=>{try{return await U.handler({events:V},X)}catch(M){let w={};for(let P of V)w[P.id]={success:!1,error:M instanceof Error?M.message:String(M)};return{results:w}}})());continue}let z=U,L=HF4(V);for(let[M,w]of L){let P=z[M];if(!P)continue;H.push((async()=>{try{let I=await P({events:w},X),C={};for(let E of w)C[E.id]=I;return{results:C}}catch(I){let C={};for(let E of w)C[E.id]={success:!1,error:I instanceof Error?I.message:String(I)};return{results:C}}})())}}let F=await Promise.all(H);if(F.length===0)return{success:!0};return FF4(F)},dm;var gZ1=S(()=>{bm();dm={subscriptions:ZF4,execute:$F4,parseCron:GF4}});function w3(Y){return{...Y,execute:(Q)=>{return Y.execute({...Q,runtimeContext:bC(Q.runtimeContext)})}}}function uZ1(Y){return Y&&"streamable"in Y&&Y.streamable===!0}var bC=(Y)=>{let Q=OC.getStore();if(!Q){if(Y)return Y;throw Error("Missing context, did you forget to call State.bind?")}return Q},VF4=(Y,Q)=>{let X=Q;return typeof X[Y]<"u"?X[Y]:Q?.MESH_REQUEST_CONTEXT?.state?.[Y]},qF4=({events:Y,configuration:{state:Q,scopes:X,onChange:J}={}}={})=>{let G=Q?q.toJSONSchema(Q):{type:"object",properties:{}},K=String(Y?.bus??"EVENT_BUS");return[...J||Y?[w3({id:"ON_MCP_CONFIGURATION",description:"MCP Configuration On Change",inputSchema:q.object({state:Q??q.unknown(),scopes:q.array(q.string()).describe("Array of scopes in format 'KEY::SCOPE' (e.g., 'GMAIL::GetCurrentUser')")}),outputSchema:q.object({}),execute:async(W)=>{let Z=W.context.state;await J?.(W.runtimeContext.env,{state:Z,scopes:W.context.scopes});let H=VF4(K,W.runtimeContext.env);if(Y&&Z&&H){let F=W.runtimeContext.env.MESH_REQUEST_CONTEXT?.connectionId,$=dm.subscriptions(Y?.handlers??{},Z,F);if(await H.EVENT_SYNC_SUBSCRIPTIONS({subscriptions:$}),F){let V=$.filter((B)=>B.eventType.startsWith("cron/")&&B.publisher===F);await Promise.all(V.map(async(B)=>{let U=dm.parseCron(B.eventType);if(U){let[,z]=U;await H.EVENT_PUBLISH({type:B.eventType,cron:z})}}))}}return Promise.resolve({})}})]:[],...Y?.handlers?[w3({id:"ON_EVENTS",description:"Receive and process CloudEvents from the event bus. Returns per-event or batch results.",inputSchema:hm,outputSchema:xm,execute:async(W)=>{let Z=W.runtimeContext.env,H=Z.MESH_REQUEST_CONTEXT?.state,F=Z.MESH_REQUEST_CONTEXT?.connectionId;return dm.execute(Y.handlers,W.context.events,Z,H,F)}})]:[],w3({id:"MCP_CONFIGURATION",description:"MCP Configuration",inputSchema:q.object({}),outputSchema:q.object({stateSchema:q.unknown(),scopes:q.array(q.string()).optional()}),execute:()=>{return Promise.resolve({stateSchema:G,scopes:[...X??[],...Y?[`${K}::EVENT_SYNC_SUBSCRIPTIONS`]:[]]})}})]},sw0=(Y)=>{let Q=async(G)=>{await Y.before?.(G);let K=new Sz({name:"@deco/mcp-api",version:"1.0.0"},{capabilities:{tools:{},prompts:{},resources:{}}}),Z=await(typeof Y.tools==="function"?Y.tools:async(B)=>{if(typeof Y.tools==="function")return await Y.tools(B);return await Promise.all(Y.tools?.flatMap(async(U)=>{let L=await U(B);if(Array.isArray(L))return L;return[L]})??[]).then((U)=>U.flat())})(G);Z.push(...qF4(Y));for(let B of Z)K.registerTool(B.id,{_meta:{streamable:uZ1(B),...B._meta??{}},description:B.description,annotations:B.annotations,inputSchema:B.inputSchema&&"shape"in B.inputSchema?B.inputSchema.shape:q.object({}).shape,outputSchema:uZ1(B)?q.object({bytes:q.record(q.string(),q.number())}).shape:B.outputSchema&&typeof B.outputSchema==="object"&&("shape"in B.outputSchema)?B.outputSchema.shape:void 0},async(U)=>{let z=await B.execute({context:U,runtimeContext:bC()});if(uZ1(B)&&z instanceof Response)return{structuredContent:{streamable:!0,status:z.status,statusText:z.statusText},content:[{type:"text",text:`Streaming response: ${z.status} ${z.statusText}`}]};return{structuredContent:z,content:[{type:"text",text:JSON.stringify(z)}]}});let F=await(typeof Y.prompts==="function"?Y.prompts:async(B)=>{if(typeof Y.prompts==="function")return await Y.prompts(B);return await Promise.all(Y.prompts?.flatMap(async(U)=>{let L=await U(B);if(Array.isArray(L))return L;return[L]})??[]).then((U)=>U.flat())})(G);for(let B of F)K.registerPrompt(B.name,{title:B.title,description:B.description,argsSchema:B.argsSchema?B.argsSchema:q.object({}).shape},async(U)=>{return await B.execute({args:U,runtimeContext:bC()})});let V=await(typeof Y.resources==="function"?Y.resources:async(B)=>{if(typeof Y.resources==="function")return await Y.resources(B);return await Promise.all(Y.resources?.flatMap(async(U)=>{let L=await U(B);if(Array.isArray(L))return L;return[L]})??[]).then((U)=>U.flat())})(G);for(let B of V)K.resource(B.name,B.uri,{description:B.description,mimeType:B.mimeType},async(U)=>{let z=await B.read({uri:U,runtimeContext:bC()}),L={uri:z.uri};if(z.mimeType)L.mimeType=z.mimeType;if(z.text!==void 0)return{contents:[{uri:z.uri,mimeType:z.mimeType,text:z.text}]};else if(z.blob!==void 0)return{contents:[{uri:z.uri,mimeType:z.mimeType,blob:z.blob}]};return{contents:[{uri:z.uri,mimeType:z.mimeType,text:""}]}});return{server:K,tools:Z,prompts:F,resources:V}};return{fetch:async(G,K)=>{let{server:W}=await Q(K),Z=new xZ1;await W.connect(Z);try{let H=await Z.handleRequest(G),F=H.headers.get("content-type");if(!(F?.includes("text/event-stream")||F?.includes("application/json-rpc"))){console.debug("[MCP Transport] Closing transport for non-streaming response");try{await Z.close?.()}catch{}}else console.debug("[MCP Transport] Keeping transport open for streaming response (Content-Type: %s)",F);return H}catch(H){console.debug("[MCP Transport] Closing transport due to error:",H instanceof Error?H.message:H);try{await Z.close?.()}catch{}throw H}},callTool:async({toolCallId:G,toolCallInput:K})=>{let W=OC.getStore();if(!W)throw Error("Missing state, did you forget to call State.bind?");let Z=W?.env,{tools:H}=await Q(Z),$=H.find((V)=>V.id===G)?.execute;if(!$)throw Error(`Tool ${G} not found or does not have an execute function`);return $({context:K,runtimeContext:bC()})}}};var pm=S(()=>{um();Nk();cw0();k1();gZ1();yZ1();gZ1()});var BF4=({env:Y,server:Q,url:X})=>{Y.SELF=new Proxy({},{get:(J,G)=>{if(G==="toJSON")return null;return async(K)=>{return await Q.callTool({toolCallId:G,toolCallInput:K})}}}),Y.IS_LOCAL=(X?.startsWith("http://localhost")||X?.startsWith("http://127.0.0.1"))??!1},tw0=(Y)=>()=>{return{...Y??{}}},UF4=({env:Y,server:Q,tokenOrContext:X,url:J,authToken:G})=>{let K=Y,W=G?G.split(" ")[1]:void 0,Z;if(typeof X==="string"){let H=k8(X),F=H.metadata??{};Z={authorization:W,state:H.state??F.state??{},token:X,meshUrl:H.meshUrl??F.meshUrl,connectionId:H.connectionId??F.connectionId,organizationId:H.organizationId??F.organizationId,organizationName:H.organizationName??F.organizationName,organizationSlug:H.organizationSlug??F.organizationSlug,ensureAuthenticated:tw0(H.user??H.sub)}}else if(typeof X==="object"){Z=X;let H=k8(X.token),F=H.metadata??{},$=H.appName;Z.authorization??=W,Z.callerApp=$,Z.connectionId??=H.connectionId??F.connectionId,Z.organizationId??=H.organizationId??F.organizationId,Z.organizationName??=H.organizationName??F.organizationName,Z.organizationSlug??=H.organizationSlug??F.organizationSlug,Z.ensureAuthenticated=tw0(H.user??H.sub)}else Z={state:{},authorization:W,token:void 0,meshUrl:void 0,connectionId:void 0,ensureAuthenticated:()=>{throw Error("Unauthorized")}};return K.MESH_REQUEST_CONTEXT=Z,Z.state=Ow0(Z),BF4({env:K,server:Q,url:J}),K},zF4,ew0=(Y)=>{let Q=sw0(Y),X=Y.cors??zF4,J=Y.oauth,G=J?Tw0(J):null,K=async(W,Z,H)=>{let F=new URL(W.url);if(G){if(F.pathname==="/.well-known/oauth-protected-resource"||F.pathname==="/mcp/.well-known/oauth-protected-resource")return G.handleProtectedResourceMetadata(W);if(F.pathname==="/.well-known/oauth-authorization-server")return G.handleAuthorizationServerMetadata(W);if(F.pathname==="/authorize")return G.handleAuthorize(W);if(F.pathname==="/oauth/callback")return G.handleOAuthCallback(W);if(F.pathname==="/token"&&W.method==="POST")return G.handleToken(W);if((F.pathname==="/register"||F.pathname==="/mcp/register")&&W.method==="POST")return G.handleClientRegistration(W)}if(F.pathname==="/mcp"){if(W.method==="GET")return new Response("Method not allowed",{status:405});if(G&&!G.hasAuth(W)){let $=W.clone();try{if((await $.json())?.method!=="tools/list")return G.createUnauthorizedResponse(W)}catch{return G.createUnauthorizedResponse(W)}}return Q.fetch(W,Z,H)}if(F.pathname.startsWith("/mcp/call-tool")){let $=F.pathname.split("/").pop();if(!$)return new Response("Not found",{status:404});let V=await W.json(),B=await Q.callTool({toolCallId:$,toolCallInput:V});if(B instanceof Response)return B;return new Response(JSON.stringify(B),{headers:{"Content-Type":"application/json"}})}return Y.fetch?.(W,Z,H)||new Response("Not found",{status:404})};return{fetch:async(W,Z,H)=>{if(new URL(W.url).pathname==="/_healthcheck")return new Response("OK",{status:200});if(X!==!1&&W.method==="OPTIONS")return Nw0(W,X??{});let F=UF4({authToken:W.headers.get("authorization")??null,env:{...process.env,...Z},server:Q,tokenOrContext:W.headers.get("x-mesh-token")??void 0,url:W.url}),$=await OC.run({req:W,env:F,ctx:H},async()=>await K(W,F,H));if(X!==!1)return Mw0($,W,X??{});return $}}};var YA0=S(()=>{OX();bm();ww0();yZ1();pm();pm();bm();_Z1();zF4={origin:(Y)=>{if(Y.includes("localhost")||Y.includes("127.0.0.1"))return Y;return Y},credentials:!0,allowMethods:["GET","POST","PUT","DELETE","OPTIONS"],allowHeaders:["Content-Type","Authorization","mcp-protocol-version"]}});function cm(Y){return Buffer.from(String(Y),"utf8").toString("base64")}function nm(Y){if(!Y)return null;try{let Q=Buffer.from(Y,"base64").toString("utf8"),X=Number.parseInt(Q,10);return Number.isNaN(X)||X<0?null:X}catch{return null}}function GQ(Y){if(!Y?.length)return[];return Array.from(new Set(Y.map((Q)=>Q.trim()).filter((Q)=>Q.length>0).map((Q)=>Q.toLowerCase())))}function yB(Y){if(!Y)return[];return GQ(Y.split(","))}function im(Y,Q){if(!Y)return Q;try{return JSON.parse(Y)}catch{return Q}}function am(Y){return Y?.["mcp.mesh"]??{}}function rm(Y){return Y.length?Y.join(","):null}function DF4(Y,Q){if(!Q?.length)return;let X=Y;for(let J of Q){if(X===null||X===void 0)return;if(typeof X!=="object")return;X=X[J]}return X}function OF4(Y,Q,X){if(!Q)return!1;if(Q==="eq")return Y===X;if(Q==="contains"||Q==="like"){let J=String(Y??"").toLowerCase(),G=String(X??"").toLowerCase();return J.includes(G)}if(Q==="in"){if(!Array.isArray(X))return!1;return X.includes(Y)}if(Q==="gt")return Number(Y)>Number(X);if(Q==="gte")return Number(Y)>=Number(X);if(Q==="lt")return Number(Y)<Number(X);if(Q==="lte")return Number(Y)<=Number(X);return!1}function hC(Y,Q){if(!Q)return!0;if(Array.isArray(Q.conditions)&&Q.conditions.length){if(Q.operator==="and")return Q.conditions.every((X)=>hC(Y,X));if(Q.operator==="or")return Q.conditions.some((X)=>hC(Y,X));if(Q.operator==="not")return!Q.conditions.some((X)=>hC(Y,X))}return OF4(DF4(Y,Q.field),Q.operator,Q.value)}class xC{db;constructor(Y){this.db=Y}async create(Y){let Q=new Date().toISOString(),X=Y._meta??{},J=am(X),G=GQ(J.tags),K=GQ(J.categories),W={id:Y.id,organization_id:Y.organization_id,title:Y.title,description:Y.description??null,server_json:JSON.stringify(Y.server),meta_json:JSON.stringify(X),tags:rm(G),categories:rm(K),is_public:Y.is_public?1:0,is_unlisted:Y.is_unlisted?1:0,created_at:Q,updated_at:Q,created_by:Y.created_by??null};await this.db.insertInto("private_registry_item").values(W).execute();let Z=await this.findById(Y.organization_id,Y.id);if(!Z)throw Error(`Failed to create registry item "${Y.id}"`);return Z}async findById(Y,Q){let X=await this.db.selectFrom("private_registry_item").selectAll().where("organization_id","=",Y).where("id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async findByIdOrName(Y,Q){let X=await this.findById(Y,Q);if(X)return X;let J=await this.db.selectFrom("private_registry_item").selectAll().where("organization_id","=",Y).where("title","=",Q).executeTakeFirst();return J?this.deserialize(J):null}async update(Y,Q,X){let J=await this.findById(Y,Q);if(!J)throw Error(`Registry item not found: ${Q}`);let G=X._meta??J._meta??{},K=am(G),W=GQ(K.tags),Z=GQ(K.categories),H={updated_at:new Date().toISOString()};if(X.title!==void 0)H.title=X.title;if(X.description!==void 0)H.description=X.description;if(X.server!==void 0)H.server_json=JSON.stringify(X.server);if(X._meta!==void 0)H.meta_json=JSON.stringify(X._meta);if(X._meta!==void 0)H.tags=rm(W),H.categories=rm(Z);if(X.is_public!==void 0)H.is_public=X.is_public?1:0;if(X.is_unlisted!==void 0)H.is_unlisted=X.is_unlisted?1:0;await this.db.updateTable("private_registry_item").set(H).where("organization_id","=",Y).where("id","=",Q).execute();let F=await this.findById(Y,Q);if(!F)throw Error(`Registry item not found after update: ${Q}`);return F}async delete(Y,Q){let X=await this.findById(Y,Q);if(!X)return null;return await this.db.deleteFrom("private_registry_item").where("organization_id","=",Y).where("id","=",Q).execute(),X}async list(Y,Q={}){let X=this.db.selectFrom("private_registry_item").selectAll().where("organization_id","=",Y).orderBy("created_at","desc");if(!Q.includeUnlisted)X=X.where("is_unlisted","=",0);let G=(await X.execute()).map((z)=>this.deserialize(z)),K=GQ(Q.tags),W=GQ(Q.categories),Z=G.filter((z)=>{let L=am(z._meta),M=GQ(L.tags),w=GQ(L.categories),P=K.length===0||K.every((E)=>M.includes(E)),I=W.length===0||W.every((E)=>w.includes(E)),C=hC(z,Q.where);return P&&I&&C}),F=nm(Q.cursor)??Q.offset??0,$=Q.limit??24,V=Z.slice(F,F+$),B=F+$<Z.length,U=B?cm(F+$):void 0;return{items:V,totalCount:Z.length,hasMore:B,nextCursor:U}}async listPublic(Y,Q={}){let J=(await this.db.selectFrom("private_registry_item").selectAll().where("organization_id","=",Y).where("is_public","=",1).where("is_unlisted","=",0).orderBy("created_at","desc").execute()).map((U)=>this.deserialize(U)),G=GQ(Q.tags),K=GQ(Q.categories),W=J.filter((U)=>{let z=am(U._meta),L=GQ(z.tags),M=GQ(z.categories),w=G.length===0||G.every((C)=>L.includes(C)),P=K.length===0||K.every((C)=>M.includes(C)),I=hC(U,Q.where);return w&&P&&I}),H=nm(Q.cursor)??Q.offset??0,F=Q.limit??24,$=W.slice(H,H+F),V=H+F<W.length,B=V?cm(H+F):void 0;return{items:$,totalCount:W.length,hasMore:V,nextCursor:B}}async getFilters(Y,Q){let X=this.db.selectFrom("private_registry_item").select(["tags","categories"]).where("organization_id","=",Y);if(Q?.publicOnly)X=X.where("is_public","=",1);if(!Q?.includeUnlisted)X=X.where("is_unlisted","=",0);let J=await X.execute(),G=new Map,K=new Map;for(let Z of J){for(let H of yB(Z.tags))G.set(H,(G.get(H)??0)+1);for(let H of yB(Z.categories))K.set(H,(K.get(H)??0)+1)}let W=(Z)=>Array.from(Z.entries()).map(([H,F])=>({value:H,count:F})).sort((H,F)=>H.value.localeCompare(F.value));return{tags:W(G),categories:W(K)}}async search(Y,Q={},X){let J=this.db.selectFrom("private_registry_item").select(["id","title","description","meta_json","server_json","tags","categories","is_public","is_unlisted"]).where("organization_id","=",Y).orderBy("created_at","desc");if(X?.publicOnly)J=J.where("is_public","=",1);if(!X?.includeUnlisted)J=J.where("is_unlisted","=",0);let G=await J.execute(),K=Q.query?.trim().toLowerCase(),W=GQ(Q.tags),Z=GQ(Q.categories),H=G.filter((M)=>{if(K){let w=im(M.server_json,{}),I=im(M.meta_json,{})?.["mcp.mesh"]?.short_description??"";if(![M.id,M.title,M.description??"",w.name??"",w.description??"",I].join(" ").toLowerCase().includes(K))return!1}if(W.length>0){let w=GQ(yB(M.tags));if(!W.every((P)=>w.includes(P)))return!1}if(Z.length>0){let w=GQ(yB(M.categories));if(!Z.every((P)=>w.includes(P)))return!1}return!0}),$=nm(Q.cursor)??0,V=Q.limit??20,B=H.slice($,$+V),U=$+V<H.length,z=U?cm($+V):void 0;return{items:B.map((M)=>({id:M.id,title:M.title,tags:yB(M.tags),categories:yB(M.categories),is_public:M.is_public===1,is_unlisted:M.is_unlisted===1})),totalCount:H.length,hasMore:U,nextCursor:z}}deserialize(Y){let Q=im(Y.server_json,{}),X=im(Y.meta_json,{});return{id:Y.id,name:typeof Q.name==="string"?Q.name:void 0,title:Y.title,description:Y.description,_meta:X,server:Q,is_public:Y.is_public===1,is_unlisted:Y.is_unlisted===1,created_at:Y.created_at,updated_at:Y.updated_at,...Y.created_by?{created_by:Y.created_by}:{}}}}var mZ1=()=>{};var om,LF4,sm,lG,lZ1,NF4,Z$,pL,uX,fB,dZ1,QA0,pZ1,XA0,cZ1,JA0,nZ1,GA0,cL,MF4,gC,wF4,tm,iZ1,WA0,ZA0,aZ1,KA0,HA0,FA0,$A0,VA0,qA0,BA0,UA0,AF4,rZ1,zA0,DA0,oZ1,OA0;var v9=S(()=>{gX();k1();om=q.object({name:q.string(),title:q.string().optional(),description:q.string().optional(),version:q.string().optional(),websiteUrl:q.string().optional(),icons:q.array(q.object({src:q.string()})).optional(),remotes:q.array(q.object({type:q.string().optional(),url:q.string().optional(),name:q.string().optional(),title:q.string().optional(),description:q.string().optional()})).optional(),packages:q.array(q.object({identifier:q.string(),version:q.string().optional()})).optional(),repository:q.object({url:q.string().optional(),source:q.string().optional(),subfolder:q.string().optional()}).optional()}),LF4=q.object({name:q.string(),description:q.string().nullable().optional()}),sm=q.object({"mcp.mesh":q.object({verified:q.boolean().optional(),tags:q.array(q.string()).optional(),categories:q.array(q.string()).optional(),friendly_name:q.string().nullable().optional(),short_description:q.string().max(160).nullable().optional(),owner:q.string().nullable().optional(),readme:q.string().max(50000).nullable().optional(),readme_url:q.string().url().nullable().optional(),has_remote:q.boolean().optional(),has_oauth:q.boolean().optional(),tools:q.array(LF4).optional()}).optional()}).catchall(q.unknown()),lG=q.object({id:q.string(),name:q.string().optional(),title:q.string(),description:q.string().nullable().optional(),_meta:sm.optional(),server:om,is_public:q.boolean().optional(),created_at:q.string(),updated_at:q.string(),created_by:q.string().optional()}),lZ1=q.object({id:q.string(),title:q.string(),description:q.string().nullable().optional(),_meta:sm.optional(),server:om,is_public:q.boolean().optional()}),NF4=q.object({title:q.string().optional(),description:q.string().nullable().optional(),_meta:sm.optional(),server:om.optional(),is_public:q.boolean().optional()}),Z$=mG.extend({tags:q.array(q.string()).optional().describe("Filter by tags (AND semantics)"),categories:q.array(q.string()).optional().describe("Filter by categories (AND semantics)"),cursor:q.string().optional().describe("Pagination cursor")}).describe("List registry items with optional filtering and pagination."),pL=q.object({items:q.array(lG),totalCount:q.number(),hasMore:q.boolean().optional(),nextCursor:q.string().optional()}),uX=q.object({id:q.string().optional().describe("Registry item ID"),name:q.string().optional().describe("Registry item name (alias for id)")}).refine((Y)=>Y.id||Y.name,{message:"At least one of 'id' or 'name' is required"}).describe("Get a registry item by ID or name."),fB=q.object({item:lG.nullable()}),dZ1=q.object({data:lZ1}),QA0=q.object({item:lG}),pZ1=q.object({items:q.array(lZ1).min(1)}),XA0=q.object({created:q.number(),errors:q.array(q.object({id:q.string(),error:q.string()}))}),cZ1=q.object({id:q.string(),data:NF4}),JA0=q.object({item:lG}),nZ1=q.object({id:q.string()}),GA0=q.object({item:lG}),cL=q.object({tags:q.array(q.object({value:q.string(),count:q.number()})),categories:q.array(q.object({value:q.string(),count:q.number()}))}),MF4=q.enum(["description","short_description","tags","categories","readme"]),gC=q.object({query:q.string().optional().describe("Free-text search across id, title, description, server name"),tags:q.array(q.string()).optional().describe("Filter by tags (AND)"),categories:q.array(q.string()).optional().describe("Filter by categories (AND)"),limit:q.number().int().min(1).max(100).optional().describe("Max results (default 20)"),cursor:q.string().optional().describe("Pagination cursor")}).describe("Lightweight search returning minimal fields (id, title, tags, categories, is_public)."),wF4=q.object({id:q.string(),title:q.string(),tags:q.array(q.string()),categories:q.array(q.string()),is_public:q.boolean()}),tm=q.object({items:q.array(wF4),totalCount:q.number(),hasMore:q.boolean().optional(),nextCursor:q.string().optional()}),iZ1=q.object({type:MF4.describe("Which content to generate"),llmConnectionId:q.string().describe("Connection ID of a language model"),modelId:q.string().describe("Model ID to use"),context:q.object({name:q.string().optional(),provider:q.string().optional(),url:q.string().optional(),owner:q.string().optional(),repositoryUrl:q.string().optional(),description:q.string().optional(),shortDescription:q.string().optional(),tags:q.array(q.string()).optional(),categories:q.array(q.string()).optional(),availableTags:q.array(q.string()).optional(),availableCategories:q.array(q.string()).optional(),tools:q.array(q.object({name:q.string(),description:q.string().nullable().optional()})).optional()})}),WA0=q.object({result:q.string().optional(),items:q.array(q.string()).optional()}),ZA0=q.enum(["pending","approved","rejected"]),aZ1=q.object({id:q.string(),organization_id:q.string(),requested_id:q.string().nullable().optional(),status:ZA0,title:q.string(),description:q.string().nullable().optional(),_meta:sm.optional(),server:om,requester_name:q.string().nullable().optional(),requester_email:q.string().nullable().optional(),reviewer_notes:q.string().nullable().optional(),created_at:q.string(),updated_at:q.string()}),KA0=q.object({status:ZA0.optional(),limit:q.number().int().min(1).max(200).optional(),offset:q.number().int().min(0).optional(),sortBy:q.enum(["created_at","title"]).optional(),sortDirection:q.enum(["asc","desc"]).optional()}),HA0=q.object({items:q.array(aZ1),totalCount:q.number()}),FA0=q.object({id:q.string(),status:q.enum(["approved","rejected"]),reviewerNotes:q.string().nullable().optional()}),$A0=q.object({item:aZ1}),VA0=q.object({pending:q.number()}),qA0=q.object({id:q.string()}),BA0=q.object({item:aZ1.nullable()}),UA0=q.object({data:lZ1,requester:q.object({name:q.string().optional(),email:q.string().email().optional()}).optional()}),AF4=q.object({id:q.string(),name:q.string(),prefix:q.string(),createdAt:q.string()}),rZ1=q.object({name:q.string().min(1).max(64).describe("A descriptive name for this key")}),zA0=q.object({id:q.string(),name:q.string(),prefix:q.string(),key:q.string().describe("The full API key \u2014 shown only once!"),createdAt:q.string()}),DA0=q.object({items:q.array(AF4)}),oZ1=q.object({keyId:q.string()}),OA0=q.object({success:q.boolean(),keyId:q.string()})});function PF4(Y,Q){let X=w3({id:"COLLECTION_REGISTRY_APP_LIST",description:"List public registry items",inputSchema:Z$,outputSchema:pL,execute:async({context:Z})=>{return await Y.listPublic(Q,{limit:Z.limit,offset:Z.offset,cursor:Z.cursor,tags:Z.tags,categories:Z.categories,where:Z.where})}}),J=w3({id:"COLLECTION_REGISTRY_APP_GET",description:"Get a public registry item by ID or name",inputSchema:uX,outputSchema:fB,execute:async({context:Z})=>{let H=Z.id??Z.name;if(!H)return{item:null};let F=await Y.findByIdOrName(Q,H);if(F&&F.is_public)return{item:F};return{item:null}}}),G=w3({id:"COLLECTION_REGISTRY_APP_VERSIONS",description:"Get available versions of a public registry item",inputSchema:uX,outputSchema:q.object({versions:q.array(fB.shape.item)}),execute:async({context:Z})=>{let H=Z.id??Z.name;if(!H)return{versions:[]};let F=await Y.findByIdOrName(Q,H);if(F&&F.is_public)return{versions:[F]};return{versions:[]}}}),K=w3({id:"COLLECTION_REGISTRY_APP_SEARCH",description:"Search public registry items returning minimal data (id, title, tags, categories, is_public). Use this instead of LIST when you need to find items efficiently without loading full details.",inputSchema:gC,outputSchema:tm,execute:async({context:Z})=>{return await Y.search(Q,Z,{publicOnly:!0})}}),W=w3({id:"COLLECTION_REGISTRY_APP_FILTERS",description:"Get available tags and categories for public registry items",inputSchema:q.object({}),outputSchema:cL,execute:async()=>{return await Y.getFilters(Q,{publicOnly:!0})}});return[X,K,J,G,W]}function sZ1(Y,Q){let X=Q.db,J=new xC(X);Y.all("/org/:orgSlug/registry/*",async(G)=>{let K=G.req.param("orgSlug");console.log(`[Public Registry MCP] Request for org slug: ${K}, path: ${G.req.path}`);let W=await X.selectFrom("organization").select(["id","slug","name"]).where("slug","=",K).executeTakeFirst();if(console.log("[Public Registry MCP] Found org:",W),!W)return console.log(`[Public Registry MCP] Organization not found: ${K}`),G.json({error:"Organization not found"},404);let Z=PF4(J,W.id),H=ew0({tools:()=>Z}),F=new URL(G.req.url),$=G.req.path.replace(`/org/${K}/registry`,""),V=new URL($||"/",F.origin);F.searchParams.forEach((z,L)=>{V.searchParams.set(L,z)}),console.log(`[Public Registry MCP] Rewriting ${F.pathname} to ${V.pathname}`);let B=new Request(V.toString(),{method:G.req.method,headers:G.req.raw.headers,body:G.req.method!=="GET"&&G.req.method!=="HEAD"?G.req.raw.body:void 0}),U={organizationId:W.id,db:X,MESH_REQUEST_CONTEXT:{},MESH_APP_DEPLOYMENT_ID:"public-registry",IS_LOCAL:!1};return await H.fetch(B,U,G)})}var LA0=S(()=>{YA0();pm();k1();mZ1();v9()});import{randomUUID as EF4}from"crypto";function NA0(Y,Q){if(!Y)return Q;try{return JSON.parse(Y)}catch{return Q}}class uC{db;constructor(Y){this.db=Y}async createOrUpdate(Y){let Q=new Date().toISOString(),X=await this.findPendingByRequestedId(Y.organization_id,Y.requested_id);if(X){let W={title:Y.title,description:Y.description??null,server_json:JSON.stringify(Y.server),meta_json:Y._meta?JSON.stringify(Y._meta):null,requester_name:Y.requester_name??null,requester_email:Y.requester_email??null,updated_at:Q};await this.db.updateTable("private_registry_publish_request").set(W).where("organization_id","=",Y.organization_id).where("id","=",X.id).execute();let Z=await this.findById(Y.organization_id,X.id);if(!Z)throw Error("Failed to update publish request");return Z}let J=EF4(),G={id:J,organization_id:Y.organization_id,requested_id:Y.requested_id,status:"pending",title:Y.title,description:Y.description??null,server_json:JSON.stringify(Y.server),meta_json:Y._meta?JSON.stringify(Y._meta):null,requester_name:Y.requester_name??null,requester_email:Y.requester_email??null,reviewer_notes:null,created_at:Q,updated_at:Q};await this.db.insertInto("private_registry_publish_request").values(G).execute();let K=await this.findById(Y.organization_id,J);if(!K)throw Error("Failed to create publish request");return K}async findPendingByRequestedId(Y,Q){let X=await this.db.selectFrom("private_registry_publish_request").selectAll().where("organization_id","=",Y).where("requested_id","=",Q).where("status","=","pending").executeTakeFirst();return X?this.deserialize(X):null}async findById(Y,Q){let X=await this.db.selectFrom("private_registry_publish_request").selectAll().where("organization_id","=",Y).where("id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async list(Y,Q={}){let X=this.db.selectFrom("private_registry_publish_request").selectAll().where("organization_id","=",Y),J=this.db.selectFrom("private_registry_publish_request").select((F)=>F.fn.countAll().as("count")).where("organization_id","=",Y);if(Q.status)X=X.where("status","=",Q.status),J=J.where("status","=",Q.status);let G=await J.executeTakeFirst(),K=Number(G?.count??0),W=Q.sortBy??"created_at",Z=Q.sortDirection??"desc";if(W==="title")X=X.orderBy("title",Z);else X=X.orderBy("created_at",Z);return{items:(await X.limit(Q.limit??24).offset(Q.offset??0).execute()).map((F)=>this.deserialize(F)),totalCount:K}}async updateStatus(Y,Q,X,J){let G={status:X,updated_at:new Date().toISOString(),reviewer_notes:J??null};await this.db.updateTable("private_registry_publish_request").set(G).where("organization_id","=",Y).where("id","=",Q).execute();let K=await this.findById(Y,Q);if(!K)throw Error(`Publish request not found: ${Q}`);return K}async countPending(Y){let Q=await this.db.selectFrom("private_registry_publish_request").select((X)=>X.fn.countAll().as("count")).where("organization_id","=",Y).where("status","=","pending").executeTakeFirst();return Number(Q?.count??0)}async delete(Y,Q){let X=await this.findById(Y,Q);if(!X)return null;return await this.db.deleteFrom("private_registry_publish_request").where("organization_id","=",Y).where("id","=",Q).execute(),X}deserialize(Y){return{id:Y.id,organization_id:Y.organization_id,requested_id:Y.requested_id??null,status:Y.status,title:Y.title,description:Y.description,_meta:NA0(Y.meta_json,{}),server:NA0(Y.server_json,{name:""}),requester_name:Y.requester_name,requester_email:Y.requester_email,reviewer_notes:Y.reviewer_notes,created_at:Y.created_at,updated_at:Y.updated_at}}}var tZ1=()=>{};import{randomUUID as TF4}from"crypto";async function MA0(Y){let X=new TextEncoder().encode(Y),J=await crypto.subtle.digest("SHA-256",X);return Array.from(new Uint8Array(J)).map((K)=>K.toString(16).padStart(2,"0")).join("")}function CF4(){let Y=new Uint8Array(32);return crypto.getRandomValues(Y),`prk_${Array.from(Y).map((X)=>X.toString(16).padStart(2,"0")).join("")}`}class mC{db;constructor(Y){this.db=Y}async generate(Y,Q){let X=TF4(),J=CF4(),G=await MA0(J),K=J.slice(0,12),W=new Date().toISOString();return await this.db.insertInto("private_registry_publish_api_key").values({id:X,organization_id:Y,name:Q,key_hash:G,prefix:K,created_at:W}).execute(),{entity:{id:X,organization_id:Y,name:Q,prefix:K,created_at:W},key:J}}async list(Y){return await this.db.selectFrom("private_registry_publish_api_key").select(["id","organization_id","name","prefix","created_at"]).where("organization_id","=",Y).orderBy("created_at","desc").execute()}async revoke(Y,Q){return(await this.db.deleteFrom("private_registry_publish_api_key").where("organization_id","=",Y).where("id","=",Q).execute()).length>0}async validate(Y,Q){let X=await MA0(Q),J=await this.db.selectFrom("private_registry_publish_api_key").select(["id"]).where("organization_id","=",Y).where("key_hash","=",X).executeTakeFirst();return Boolean(J)}async hasKeys(Y){let Q=await this.db.selectFrom("private_registry_publish_api_key").select((X)=>X.fn.countAll().as("count")).where("organization_id","=",Y).executeTakeFirst();return Number(Q?.count??0)>0}}var eZ1=()=>{};import{sql as RF4}from"kysely";import{randomUUID as wA0}from"crypto";async function jF4(Y){let Q=new Date().toISOString(),X=wA0(),J=u9.SELF(Y.organizationId),G="registry.publish_request.created",K={requestId:Y.request.id,requestedId:Y.request.requested_id,title:Y.request.title,status:Y.request.status,createdAt:Y.request.created_at,requester:{name:Y.request.requester_name,email:Y.request.requester_email}};await Y.db.insertInto("events").values({id:X,organization_id:Y.organizationId,type:"registry.publish_request.created",source:J,specversion:"1.0",subject:Y.request.id,time:Q,datacontenttype:"application/json",dataschema:null,data:JSON.stringify(K),cron:null,status:"pending",attempts:0,last_error:null,next_retry_at:null,created_at:Q,updated_at:Q}).execute();let W=await Y.db.selectFrom("event_subscriptions").select(["id"]).where("organization_id","=",Y.organizationId).where("enabled","=",1).where("event_type","=","registry.publish_request.created").where((Z)=>Z.or([Z("publisher","is",null),Z("publisher","=",J)])).execute();if(W.length>0)await Y.db.insertInto("event_deliveries").values(W.map((Z)=>({id:wA0(),event_id:X,subscription_id:Z.id,status:"pending",attempts:0,last_error:null,delivered_at:null,next_retry_at:null,created_at:Q}))).execute();try{await RF4`SELECT pg_notify('mesh_events', ${X})`.execute(Y.db)}catch{}}async function SF4(Y,Q){let J=(await Y.selectFrom("organization").select(["id"]).where("id","=",Q).execute())[0];if(J?.id)return J.id;return(await Y.selectFrom("organization").select(["id"]).where("slug","=",Q).execute())[0]?.id??null}async function _F4(Y,Q){let X=await Y.selectFrom("project_plugin_configs").innerJoin("projects","projects.id","project_plugin_configs.project_id").select(["project_plugin_configs.settings as settings"]).where("projects.organization_id","=",Q).where("project_plugin_configs.plugin_id","=",jZ).execute();for(let J of X){let G=J.settings,K=typeof G==="string"?(()=>{try{return JSON.parse(G)}catch{return{}}})():G??{};if(K.acceptPublishRequests===!0){let W=K.rateLimitWindow==="minute"?"minute":"hour",Z=K.rateLimitMax,H=typeof Z==="number"&&Number.isFinite(Z)&&Z>=1?Math.floor(Z):PA0;return{acceptPublishRequests:!0,requireApiToken:K.requireApiToken===!0,rateLimitEnabled:K.rateLimitEnabled===void 0?AA0:K.rateLimitEnabled===!0,rateLimitWindow:W,rateLimitMax:H}}}return{acceptPublishRequests:!1,requireApiToken:!1,rateLimitEnabled:AA0,rateLimitWindow:IF4,rateLimitMax:PA0}}async function vF4(Y,Q,X){let J=X==="minute"?60000:3600000,G=new Date(Date.now()-J).toISOString(),K=await Y.selectFrom("private_registry_publish_request").select((W)=>W.fn.countAll().as("count")).where("organization_id","=",Q).where("created_at",">=",G).executeTakeFirst();return Number(K?.count??0)}async function kF4(Y,Q,X,J){let G=await Y.selectFrom("private_registry_item").select(["id","title"]).where("organization_id","=",Q).where((K)=>K.or([K("id","=",X),K("title","=",J)])).executeTakeFirst();return G?{id:String(G.id),title:String(G.title)}:null}function YK1(Y,Q){let{db:X,db:J}=Q,G=new uC(J),K=new mC(J);Y.post("/org/:orgRef/registry/publish-request",async(W)=>{let Z=W.req.param("orgRef"),H=await SF4(X,Z);if(!H)return W.json({error:"Organization not found"},404);let F=await _F4(X,H);if(!F.acceptPublishRequests)return W.json({error:"Publish requests are not enabled for this registry."},403);if(F.requireApiToken){let z=W.req.header("Authorization"),L=z?.startsWith("Bearer ")?z.slice(7).trim():null;if(!L)return W.json({error:"API key required. Use Authorization: Bearer <key>"},401);if(!await K.validate(H,L))return W.json({error:"Invalid API key"},401)}if(F.rateLimitEnabled){if(await vF4(J,H,F.rateLimitWindow)>=F.rateLimitMax)return W.json({error:"Too many publish requests. Please try again later.",retryAfterSeconds:F.rateLimitWindow==="minute"?60:3600},429)}let $;try{$=await W.req.json()}catch{return W.json({error:"Invalid JSON body"},400)}let V=UA0.safeParse($);if(!V.success)return W.json({error:"Invalid publish request payload",details:q.treeifyError(V.error)},400);let B=await kF4(J,H,V.data.data.id,V.data.data.title);if(B)return W.json({error:"A registry item with the same id or title already exists. Please use a different name/id.",conflict:B},409);let U=await G.createOrUpdate({organization_id:H,requested_id:V.data.data.id,title:V.data.data.title,description:V.data.data.description??null,_meta:V.data.data._meta,server:V.data.data.server,requester_name:V.data.requester?.name??null,requester_email:V.data.requester?.email??null});try{await jF4({db:X,organizationId:H,request:U})}catch(z){console.warn("[private-registry] failed to emit publish-request event:",z)}return W.json({id:U.id,requested_id:U.requested_id,status:U.status},201)})}var AA0=!0,IF4="hour",PA0=100;var EA0=S(()=>{DY();k1();SB();tZ1();eZ1();v9()});var TA0=S(()=>{LA0();EA0()});function CA0(Y){QK1=Y}function t0(){if(!QK1)throw Error(`Plugin storage not initialized. Make sure the "${jZ}" plugin is enabled.`);return QK1}async function yF4(Y){if(!Y.organization)throw Error("Organization context required");return await Y.access.check(),Y}function O6(Y,Q){return async(X,J)=>{let G=await yF4(J);return Q(X,G)}}function fF4(Y){if(!Y)return{};if(typeof Y==="string")try{return JSON.parse(Y)}catch{return{}}if(typeof Y==="object")return Y;return{}}async function lC(Y,Q){let J=(await Y.db.selectFrom("project_plugin_configs").innerJoin("projects","projects.id","project_plugin_configs.project_id").select(["project_plugin_configs.settings as settings"]).where("projects.organization_id","=",Q).where("project_plugin_configs.plugin_id","=",jZ).execute()).map((K)=>fF4(K.settings)),G={acceptPublishRequests:J.some((K)=>K.acceptPublishRequests===!0),requireApiToken:J.some((K)=>K.requireApiToken===!0),storePrivateOnly:J.some((K)=>K.storePrivateOnly===!0)};if(G.acceptPublishRequests||G.requireApiToken||G.storePrivateOnly)return G;for(let K of J)if(Object.keys(K).length>0)return K;return{}}var QK1=null;var J8=S(()=>{SB()});import{randomUUID as RA0}from"crypto";function IA0(Y,Q){if(!Y)return Q;try{return JSON.parse(Y)}catch{return Q}}class XK1{db;constructor(Y){this.db=Y}async create(Y){let Q=RA0(),X=new Date().toISOString(),J={id:Q,organization_id:Y.organization_id,status:Y.status??"pending",config_snapshot:Y.config_snapshot?JSON.stringify(Y.config_snapshot):null,total_items:Y.total_items??0,tested_items:0,passed_items:0,failed_items:0,skipped_items:0,current_item_id:null,started_at:Y.started_at??null,finished_at:null,created_at:X};await this.db.insertInto("private_registry_monitor_run").values(J).execute();let G=await this.findById(Y.organization_id,Q);if(!G)throw Error(`Failed to create monitor run ${Q}`);return G}async findById(Y,Q){let X=await this.db.selectFrom("private_registry_monitor_run").selectAll().where("organization_id","=",Y).where("id","=",Q).executeTakeFirst();return X?this.deserializeRun(X):null}async list(Y,Q={}){let X=this.db.selectFrom("private_registry_monitor_run").selectAll().where("organization_id","=",Y),J=this.db.selectFrom("private_registry_monitor_run").select((Z)=>Z.fn.countAll().as("count")).where("organization_id","=",Y);if(Q.status)X=X.where("status","=",Q.status),J=J.where("status","=",Q.status);let G=await J.executeTakeFirst(),K=Number(G?.count??0);return{items:(await X.orderBy("created_at","desc").limit(Q.limit??24).offset(Q.offset??0).execute()).map((Z)=>this.deserializeRun(Z)),totalCount:K}}async update(Y,Q,X){let J={};if(X.total_items!==void 0)J.total_items=X.total_items;if(X.status!==void 0)J.status=X.status;if(X.tested_items!==void 0)J.tested_items=X.tested_items;if(X.passed_items!==void 0)J.passed_items=X.passed_items;if(X.failed_items!==void 0)J.failed_items=X.failed_items;if(X.skipped_items!==void 0)J.skipped_items=X.skipped_items;if(X.current_item_id!==void 0)J.current_item_id=X.current_item_id;if(X.started_at!==void 0)J.started_at=X.started_at;if(X.finished_at!==void 0)J.finished_at=X.finished_at;await this.db.updateTable("private_registry_monitor_run").set(J).where("organization_id","=",Y).where("id","=",Q).execute();let G=await this.findById(Y,Q);if(!G)throw Error(`Monitor run not found: ${Q}`);return G}deserializeRun(Y){return{id:Y.id,organization_id:Y.organization_id,status:Y.status,config_snapshot:IA0(Y.config_snapshot,null),total_items:Number(Y.total_items??0),tested_items:Number(Y.tested_items??0),passed_items:Number(Y.passed_items??0),failed_items:Number(Y.failed_items??0),skipped_items:Number(Y.skipped_items??0),current_item_id:Y.current_item_id,started_at:Y.started_at,finished_at:Y.finished_at,created_at:Y.created_at}}}class JK1{db;constructor(Y){this.db=Y}async create(Y){let Q=RA0(),X=new Date().toISOString(),J={id:Q,run_id:Y.run_id,organization_id:Y.organization_id,item_id:Y.item_id,item_title:Y.item_title,status:Y.status,error_message:Y.error_message??null,connection_ok:Y.connection_ok?1:0,tools_listed:Y.tools_listed?1:0,tool_results:Y.tool_results?JSON.stringify(Y.tool_results):null,agent_summary:Y.agent_summary??null,duration_ms:Y.duration_ms??0,action_taken:Y.action_taken??"none",tested_at:X};await this.db.insertInto("private_registry_monitor_result").values(J).execute();let G=await this.findById(Y.organization_id,Q);if(!G)throw Error("Failed to create test result");return G}async findById(Y,Q){let X=await this.db.selectFrom("private_registry_monitor_result").selectAll().where("organization_id","=",Y).where("id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async listByRun(Y,Q,X={}){let J=this.db.selectFrom("private_registry_monitor_result").selectAll().where("organization_id","=",Y).where("run_id","=",Q),G=this.db.selectFrom("private_registry_monitor_result").select((H)=>H.fn.countAll().as("count")).where("organization_id","=",Y).where("run_id","=",Q);if(X.status)J=J.where("status","=",X.status),G=G.where("status","=",X.status);let K=await G.executeTakeFirst(),W=Number(K?.count??0);return{items:(await J.orderBy("tested_at","desc").limit(X.limit??50).offset(X.offset??0).execute()).map((H)=>this.deserialize(H)),totalCount:W}}async update(Y,Q,X){let J={};if(X.status!==void 0)J.status=X.status;if(X.error_message!==void 0)J.error_message=X.error_message;if(X.connection_ok!==void 0)J.connection_ok=X.connection_ok?1:0;if(X.tools_listed!==void 0)J.tools_listed=X.tools_listed?1:0;if(X.tool_results!==void 0)J.tool_results=JSON.stringify(X.tool_results);if(X.agent_summary!==void 0)J.agent_summary=X.agent_summary;if(X.duration_ms!==void 0)J.duration_ms=X.duration_ms;if(X.action_taken!==void 0)J.action_taken=X.action_taken;await this.db.updateTable("private_registry_monitor_result").set(J).where("organization_id","=",Y).where("id","=",Q).execute();let G=await this.findById(Y,Q);if(!G)throw Error(`Monitor result not found: ${Q}`);return G}deserialize(Y){return{id:Y.id,run_id:Y.run_id,organization_id:Y.organization_id,item_id:Y.item_id,item_title:Y.item_title,status:Y.status,error_message:Y.error_message,connection_ok:Y.connection_ok===1,tools_listed:Y.tools_listed===1,tool_results:IA0(Y.tool_results,[]),agent_summary:Y.agent_summary,duration_ms:Number(Y.duration_ms??0),action_taken:Y.action_taken,tested_at:Y.tested_at}}}var jA0=()=>{};import{randomUUID as bF4}from"crypto";class GK1{db;constructor(Y){this.db=Y}async findByItemId(Y,Q){let X=await this.db.selectFrom("private_registry_monitor_connection").selectAll().where("organization_id","=",Y).where("item_id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async list(Y){return(await this.db.selectFrom("private_registry_monitor_connection").selectAll().where("organization_id","=",Y).orderBy("updated_at","desc").execute()).map((X)=>this.deserialize(X))}async findByConnectionId(Y,Q){let X=await this.db.selectFrom("private_registry_monitor_connection").selectAll().where("organization_id","=",Y).where("connection_id","=",Q).executeTakeFirst();return X?this.deserialize(X):null}async upsert(Y){let Q=await this.findByItemId(Y.organization_id,Y.item_id),X=new Date().toISOString();if(!Q){let G={id:bF4(),organization_id:Y.organization_id,item_id:Y.item_id,connection_id:Y.connection_id,auth_status:Y.auth_status??"none",created_at:X,updated_at:X};await this.db.insertInto("private_registry_monitor_connection").values(G).execute()}else{let G={connection_id:Y.connection_id,auth_status:Y.auth_status??Q.auth_status,updated_at:X};await this.db.updateTable("private_registry_monitor_connection").set(G).where("organization_id","=",Y.organization_id).where("item_id","=",Y.item_id).execute()}let J=await this.findByItemId(Y.organization_id,Y.item_id);if(!J)throw Error("Failed to save monitor connection");return J}async updateAuthStatus(Y,Q,X){return await this.db.updateTable("private_registry_monitor_connection").set({auth_status:X,updated_at:new Date().toISOString()}).where("organization_id","=",Y).where("item_id","=",Q).execute(),this.findByItemId(Y,Q)}deserialize(Y){return{id:Y.id,organization_id:Y.organization_id,item_id:Y.item_id,connection_id:Y.connection_id,auth_status:Y.auth_status,created_at:Y.created_at,updated_at:Y.updated_at}}}var SA0=()=>{};function _A0(Y){let Q=Y.db,X={items:new xC(Q),publishRequests:new uC(Q),publishApiKeys:new mC(Q),monitorRuns:new XK1(Q),monitorResults:new JK1(Q),monitorConnections:new GK1(Q)};return CA0(X),X}var vA0=S(()=>{J8();mZ1();tZ1();eZ1();jA0();SA0()});var kA0;var yA0=S(()=>{v9();J8();kA0={name:"REGISTRY_ITEM_BULK_CREATE",description:"Create many private registry items at once",inputSchema:pZ1,outputSchema:XA0,handler:O6(pZ1,async(Y,Q)=>{let X=t0(),J=[],G=0;for(let K of Y.items)try{await X.items.create({...K,organization_id:Q.organization.id,created_by:Q.auth.user?.id??null}),G+=1}catch(W){J.push({id:K.id,error:W instanceof Error?W.message:"Unknown error"})}return{created:G,errors:J}})}});function hF4(Y){return Array.from(new Set(Y.map((Q)=>Q.trim().toLowerCase()).filter((Q)=>Q.length>0)))}function xF4(Y){let X=Y.structuredContent?.content?.filter((J)=>J.type==="text"&&typeof J.text==="string").map((J)=>J.text??"").join(`
|
|
1211
1211
|
`).trim();if(X)return X;return Y.content?.filter((J)=>J.type==="text"&&typeof J.text==="string").map((J)=>J.text??"").join(`
|
|
1212
1212
|
`).trim()??""}function gF4(Y){let Q=Y.context,X=JSON.stringify({name:Q.name??"",provider:Q.provider??"",url:Q.url??"",owner:Q.owner??"",repositoryUrl:Q.repositoryUrl??"",description:Q.description??"",shortDescription:Q.shortDescription??"",tags:Q.tags??[],categories:Q.categories??[],availableTags:Q.availableTags??[],availableCategories:Q.availableCategories??[],tools:Q.tools??[]},null,2);if(Y.type==="description")return{system:"You are an assistant that writes concise MCP registry descriptions.",user:`Use the context below to write a clear English description for this MCP server.
|
|
1213
1213
|
Rules:
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@esbuild/linux-x64",
|
|
3
|
+
"version": "0.27.3",
|
|
4
|
+
"description": "The Linux 64-bit binary for esbuild, a JavaScript bundler.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/evanw/esbuild.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"preferUnplugged": true,
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18"
|
|
13
|
+
},
|
|
14
|
+
"os": [
|
|
15
|
+
"linux"
|
|
16
|
+
],
|
|
17
|
+
"cpu": [
|
|
18
|
+
"x64"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Copyright 2018 Kilian Valkhof
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
|
+
|
|
5
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
### Made by [@kilianvalkhof](https://twitter.com/kilianvalkhof)
|
|
2
|
+
|
|
3
|
+
#### Other projects:
|
|
4
|
+
|
|
5
|
+
- 💻 [Polypane](https://polypane.app) - Develop responsive websites and apps twice as fast on multiple screens at once
|
|
6
|
+
- 🖌️ [Superposition](https://superposition.design) - Kickstart your design system by extracting design tokens from your website
|
|
7
|
+
- 🗒️ [FromScratch](https://fromscratch.rocks) - A smart but simple autosaving scratchpad
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Electron-to-Chromium [](https://www.npmjs.com/package/electron-to-chromium) [](https://travis-ci.org/Kilian/electron-to-chromium) [](https://www.npmjs.com/package/electron-to-chromium) [](https://codecov.io/gh/Kilian/electron-to-chromium)[](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_shield)
|
|
12
|
+
|
|
13
|
+
This repository provides a mapping of Electron versions to the Chromium version that it uses.
|
|
14
|
+
|
|
15
|
+
This package is used in [Browserslist](https://github.com/ai/browserslist), so you can use e.g. `electron >= 1.4` in [Autoprefixer](https://github.com/postcss/autoprefixer), [Stylelint](https://github.com/stylelint/stylelint), [babel-preset-env](https://github.com/babel/babel-preset-env) and [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat).
|
|
16
|
+
|
|
17
|
+
**Supported by:**
|
|
18
|
+
|
|
19
|
+
<a href="https://m.do.co/c/bb22ea58e765">
|
|
20
|
+
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
|
|
21
|
+
</a>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
Install using `npm install electron-to-chromium`.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
To include Electron-to-Chromium, require it:
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
var e2c = require('electron-to-chromium');
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Properties
|
|
35
|
+
The Electron-to-Chromium object has 4 properties to use:
|
|
36
|
+
|
|
37
|
+
#### `versions`
|
|
38
|
+
An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value.
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
var versions = e2c.versions;
|
|
42
|
+
console.log(versions['1.4']);
|
|
43
|
+
// returns "53"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### `fullVersions`
|
|
47
|
+
An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value.
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
var versions = e2c.fullVersions;
|
|
51
|
+
console.log(versions['1.4.11']);
|
|
52
|
+
// returns "53.0.2785.143"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### `chromiumVersions`
|
|
56
|
+
An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value.
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
var versions = e2c.chromiumVersions;
|
|
60
|
+
console.log(versions['54']);
|
|
61
|
+
// returns "1.4"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### `fullChromiumVersions`
|
|
65
|
+
An object of key-value pairs with a Chromium version as the key, and an array of the corresponding major Electron versions as the value.
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
var versions = e2c.fullChromiumVersions;
|
|
69
|
+
console.log(versions['54.0.2840.101']);
|
|
70
|
+
// returns ["1.5.1", "1.5.0"]
|
|
71
|
+
```
|
|
72
|
+
### Functions
|
|
73
|
+
|
|
74
|
+
#### `electronToChromium(query)`
|
|
75
|
+
Arguments:
|
|
76
|
+
* Query: string or number, required. A major or full Electron version.
|
|
77
|
+
|
|
78
|
+
A function that returns the corresponding Chromium version for a given Electron function. Returns a string.
|
|
79
|
+
|
|
80
|
+
If you provide it with a major Electron version, it will return a major Chromium version:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
var chromeVersion = e2c.electronToChromium('1.4');
|
|
84
|
+
// chromeVersion is "53"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If you provide it with a full Electron version, it will return the full Chromium version.
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
var chromeVersion = e2c.electronToChromium('1.4.11');
|
|
91
|
+
// chromeVersion is "53.0.2785.143"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If a query does not match a Chromium version, it will return `undefined`.
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
var chromeVersion = e2c.electronToChromium('9000');
|
|
98
|
+
// chromeVersion is undefined
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### `chromiumToElectron(query)`
|
|
102
|
+
Arguments:
|
|
103
|
+
* Query: string or number, required. A major or full Chromium version.
|
|
104
|
+
|
|
105
|
+
Returns a string with the corresponding Electron version for a given Chromium query.
|
|
106
|
+
|
|
107
|
+
If you provide it with a major Chromium version, it will return a major Electron version:
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
var electronVersion = e2c.chromiumToElectron('54');
|
|
111
|
+
// electronVersion is "1.4"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If you provide it with a full Chrome version, it will return an array of full Electron versions.
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
var electronVersions = e2c.chromiumToElectron('56.0.2924.87');
|
|
118
|
+
// electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If a query does not match an Electron version, it will return `undefined`.
|
|
122
|
+
|
|
123
|
+
```js
|
|
124
|
+
var electronVersion = e2c.chromiumToElectron('10');
|
|
125
|
+
// electronVersion is undefined
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### `electronToBrowserList(query)` **DEPRECATED**
|
|
129
|
+
Arguments:
|
|
130
|
+
* Query: string or number, required. A major Electron version.
|
|
131
|
+
|
|
132
|
+
_**Deprecated**: Browserlist already includes electron-to-chromium._
|
|
133
|
+
|
|
134
|
+
A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string.
|
|
135
|
+
|
|
136
|
+
If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities:
|
|
137
|
+
|
|
138
|
+
```js
|
|
139
|
+
var query = e2c.electronToBrowserList('1.4');
|
|
140
|
+
// query is "Chrome >= 53"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
If a query does not match a Chromium version, it will return `undefined`.
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
var query = e2c.electronToBrowserList('9000');
|
|
147
|
+
// query is undefined
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions
|
|
151
|
+
All lists can be imported on their own, if file size is a concern.
|
|
152
|
+
|
|
153
|
+
#### `versions`
|
|
154
|
+
|
|
155
|
+
```js
|
|
156
|
+
var versions = require('electron-to-chromium/versions');
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### `fullVersions`
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
var fullVersions = require('electron-to-chromium/full-versions');
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### `chromiumVersions`
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
var chromiumVersions = require('electron-to-chromium/chromium-versions');
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
#### `fullChromiumVersions`
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions');
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Updating
|
|
178
|
+
This package will be updated with each new Electron release.
|
|
179
|
+
|
|
180
|
+
To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions.
|
|
181
|
+
|
|
182
|
+
To verify correct behaviour, run `npm test`.
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
## License
|
|
186
|
+
[](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_large)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"39": "0.20",
|
|
3
|
+
"40": "0.21",
|
|
4
|
+
"41": "0.21",
|
|
5
|
+
"42": "0.25",
|
|
6
|
+
"43": "0.27",
|
|
7
|
+
"44": "0.30",
|
|
8
|
+
"45": "0.31",
|
|
9
|
+
"47": "0.36",
|
|
10
|
+
"49": "0.37",
|
|
11
|
+
"50": "1.1",
|
|
12
|
+
"51": "1.2",
|
|
13
|
+
"52": "1.3",
|
|
14
|
+
"53": "1.4",
|
|
15
|
+
"54": "1.4",
|
|
16
|
+
"56": "1.6",
|
|
17
|
+
"58": "1.7",
|
|
18
|
+
"59": "1.8",
|
|
19
|
+
"61": "2.0",
|
|
20
|
+
"66": "3.0",
|
|
21
|
+
"69": "4.0",
|
|
22
|
+
"72": "5.0",
|
|
23
|
+
"73": "5.0",
|
|
24
|
+
"76": "6.0",
|
|
25
|
+
"78": "7.0",
|
|
26
|
+
"79": "8.0",
|
|
27
|
+
"80": "8.0",
|
|
28
|
+
"82": "9.0",
|
|
29
|
+
"83": "9.0",
|
|
30
|
+
"84": "10.0",
|
|
31
|
+
"85": "10.0",
|
|
32
|
+
"86": "11.0",
|
|
33
|
+
"87": "11.0",
|
|
34
|
+
"89": "12.0",
|
|
35
|
+
"90": "13.0",
|
|
36
|
+
"91": "13.0",
|
|
37
|
+
"92": "14.0",
|
|
38
|
+
"93": "14.0",
|
|
39
|
+
"94": "15.0",
|
|
40
|
+
"95": "16.0",
|
|
41
|
+
"96": "16.0",
|
|
42
|
+
"98": "17.0",
|
|
43
|
+
"99": "18.0",
|
|
44
|
+
"100": "18.0",
|
|
45
|
+
"102": "19.0",
|
|
46
|
+
"103": "20.0",
|
|
47
|
+
"104": "20.0",
|
|
48
|
+
"105": "21.0",
|
|
49
|
+
"106": "21.0",
|
|
50
|
+
"107": "22.0",
|
|
51
|
+
"108": "22.0",
|
|
52
|
+
"110": "23.0",
|
|
53
|
+
"111": "24.0",
|
|
54
|
+
"112": "24.0",
|
|
55
|
+
"114": "25.0",
|
|
56
|
+
"116": "26.0",
|
|
57
|
+
"118": "27.0",
|
|
58
|
+
"119": "28.0",
|
|
59
|
+
"120": "28.0",
|
|
60
|
+
"121": "29.0",
|
|
61
|
+
"122": "29.0",
|
|
62
|
+
"123": "30.0",
|
|
63
|
+
"124": "30.0",
|
|
64
|
+
"125": "31.0",
|
|
65
|
+
"126": "31.0",
|
|
66
|
+
"127": "32.0",
|
|
67
|
+
"128": "32.0",
|
|
68
|
+
"129": "33.0",
|
|
69
|
+
"130": "33.0",
|
|
70
|
+
"131": "34.0",
|
|
71
|
+
"132": "34.0",
|
|
72
|
+
"133": "35.0",
|
|
73
|
+
"134": "35.0",
|
|
74
|
+
"135": "36.0",
|
|
75
|
+
"136": "36.0",
|
|
76
|
+
"137": "37.0",
|
|
77
|
+
"138": "37.0",
|
|
78
|
+
"139": "38.0",
|
|
79
|
+
"140": "38.0",
|
|
80
|
+
"141": "39.0",
|
|
81
|
+
"142": "39.0",
|
|
82
|
+
"143": "40.0",
|
|
83
|
+
"144": "40.0",
|
|
84
|
+
"146": "41.0"
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"39":"0.20","40":"0.21","41":"0.21","42":"0.25","43":"0.27","44":"0.30","45":"0.31","47":"0.36","49":"0.37","50":"1.1","51":"1.2","52":"1.3","53":"1.4","54":"1.4","56":"1.6","58":"1.7","59":"1.8","61":"2.0","66":"3.0","69":"4.0","72":"5.0","73":"5.0","76":"6.0","78":"7.0","79":"8.0","80":"8.0","82":"9.0","83":"9.0","84":"10.0","85":"10.0","86":"11.0","87":"11.0","89":"12.0","90":"13.0","91":"13.0","92":"14.0","93":"14.0","94":"15.0","95":"16.0","96":"16.0","98":"17.0","99":"18.0","100":"18.0","102":"19.0","103":"20.0","104":"20.0","105":"21.0","106":"21.0","107":"22.0","108":"22.0","110":"23.0","111":"24.0","112":"24.0","114":"25.0","116":"26.0","118":"27.0","119":"28.0","120":"28.0","121":"29.0","122":"29.0","123":"30.0","124":"30.0","125":"31.0","126":"31.0","127":"32.0","128":"32.0","129":"33.0","130":"33.0","131":"34.0","132":"34.0","133":"35.0","134":"35.0","135":"36.0","136":"36.0","137":"37.0","138":"37.0","139":"38.0","140":"38.0","141":"39.0","142":"39.0","143":"40.0","144":"40.0","146":"41.0"}
|