decocms 4.393.1 → 4.393.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CAZCGIym.js → AlertCircle-Bw5IjQll.js} +1 -1
- package/dist/client/assets/{AreaChart-csHp4l4h.js → AreaChart-CoImiSZ8.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CqVRyVC4.js → ArrowLeft-o7Y-fEOP.js} +1 -1
- package/dist/client/assets/{ArrowRight-CN5fIGvW.js → ArrowRight-B9KOH6Mp.js} +1 -1
- package/dist/client/assets/{ArrowUp-B0NBLEx_.js → ArrowUp-siSqnojJ.js} +1 -1
- package/dist/client/assets/{CartesianChart-BeQ1BVpH.js → CartesianChart-B_oczkwR.js} +1 -1
- package/dist/client/assets/{Check-osjC9XAT.js → Check-UJc6KAi4.js} +1 -1
- package/dist/client/assets/{CheckCircle-BQVXo8SX.js → CheckCircle-BMHJHOxj.js} +1 -1
- package/dist/client/assets/{ChevronUp-CWFKBmTR.js → ChevronUp-BfOf-CcT.js} +1 -1
- package/dist/client/assets/{Copy01-C3qedNFV.js → Copy01-jqAaecgQ.js} +1 -1
- package/dist/client/assets/{CreditCard01-X_bLShoe.js → CreditCard01-CTgYXlxC.js} +1 -1
- package/dist/client/assets/{DotsVertical-WjgV6Sz3.js → DotsVertical-DtamlI3j.js} +1 -1
- package/dist/client/assets/{Download01-BxpFiQae.js → Download01-BncQoTgS.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DAk7EcDA.js → ErrorBarContext-BO0Qz3lQ.js} +1 -1
- package/dist/client/assets/{Eye-ClOyTajV.js → Eye-B7WWrfVK.js} +1 -1
- package/dist/client/assets/{Globe04-kFsTYMZt.js → Globe04-CvitSAdn.js} +1 -1
- package/dist/client/assets/{Image01-CZ5ChEda.js → Image01-BcdinLnP.js} +1 -1
- package/dist/client/assets/{Key01-B8Wj8PkA.js → Key01-DfBLIcDO.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BQilm9GH.js → LayoutLeft-fyXbrdze.js} +1 -1
- package/dist/client/assets/{Line-BNKFz7ks.js → Line-Bve7YiyC.js} +1 -1
- package/dist/client/assets/{Link01-DUz2pQNV.js → Link01-CUNNOfMo.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CvuOMgs8.js → LinkExternal01-CjlXJ8JK.js} +1 -1
- package/dist/client/assets/{Monitor01-CCsQ-B6D.js → Monitor01-Bgx96mK1.js} +1 -1
- package/dist/client/assets/{Package-Cm2wb2c_.js → Package-CCyqVpLL.js} +1 -1
- package/dist/client/assets/{Palette-BSBAE3IQ.js → Palette-uwPl9fbG.js} +1 -1
- package/dist/client/assets/{Plus-WfTftgTi.js → Plus-DVO5ynNJ.js} +1 -1
- package/dist/client/assets/{SearchLg-CMx4kSga.js → SearchLg-BuXTAvmm.js} +1 -1
- package/dist/client/assets/{SearchMd-Deh4spzU.js → SearchMd-4YJlY5kp.js} +1 -1
- package/dist/client/assets/{Sector-DIzARH0M.js → Sector-C0TyewPL.js} +1 -1
- package/dist/client/assets/{Share07-B-CaWtRk.js → Share07-slK9gs7d.js} +1 -1
- package/dist/client/assets/{Stars01-CIfg88Aw.js → Stars01-BHCqXxdF.js} +1 -1
- package/dist/client/assets/{Sun-BeEVq7FM.js → Sun-CD9h4ghg.js} +1 -1
- package/dist/client/assets/{Tool01-DXV90eZp.js → Tool01-BGKWFxqT.js} +1 -1
- package/dist/client/assets/{Trash01-CKvnXwav.js → Trash01-elTVICGJ.js} +1 -1
- package/dist/client/assets/{Upload01-ChdQ8FAD.js → Upload01-C_pNo17d.js} +1 -1
- package/dist/client/assets/{User01-CPMi0clz.js → User01-A5ycKGmZ.js} +1 -1
- package/dist/client/assets/{UserSquare-C9kzzswT.js → UserSquare-CjWcARYJ.js} +1 -1
- package/dist/client/assets/{Users01-q9yK0HY-.js → Users01-CYLXmuWv.js} +1 -1
- package/dist/client/assets/{X-XbUtFT5N.js → X-DfL64JB-.js} +1 -1
- package/dist/client/assets/{XCircle-BrmD7rCp.js → XCircle-Cn_6vXwx.js} +1 -1
- package/dist/client/assets/{XClose-D7CZc-Y8.js → XClose-B001-Pfs.js} +1 -1
- package/dist/client/assets/{Zap-OydN7TCA.js → Zap-vgIAjKVr.js} +1 -1
- package/dist/client/assets/{ZoomOut-DHONvuYn.js → ZoomOut-DckCENcg.js} +1 -1
- package/dist/client/assets/{access-gate-DzUD_Rz8.js → access-gate-0Jk-hZos.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-rVwaJ1no.js → add-connection-dialog-CXhnysPD.js} +1 -1
- package/dist/client/assets/{agent-analytics-CdhgHttW.js → agent-analytics-BhYprSIO.js} +1 -1
- package/dist/client/assets/agent-app-DVQdsoCP.js +1 -0
- package/dist/client/assets/{agent-assets-a6vAQUAU.js → agent-assets-CS42OR4f.js} +1 -1
- package/dist/client/assets/{agent-automation-CvrmRmKp.js → agent-automation-D1d7OJUi.js} +1 -1
- package/dist/client/assets/{agent-automations-BzM17hCZ.js → agent-automations-CbaldEol.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-CxAeBbTS.js → agent-connect-sources-zJfGAKvI.js} +1 -1
- package/dist/client/assets/agent-deck-DwkEMcun.js +1 -0
- package/dist/client/assets/{agent-e2e-BP835YP5.js → agent-e2e-BqhXL_2D.js} +1 -1
- package/dist/client/assets/{agent-experiments-DgNmITWp.js → agent-experiments-D0OMBW0K.js} +1 -1
- package/dist/client/assets/agent-file-kb3kZGOR.js +1 -0
- package/dist/client/assets/{agent-git-Dt-lR7q1.js → agent-git-oYCjVN4D.js} +1 -1
- package/dist/client/assets/{agent-hosting-q-td_9QW.js → agent-hosting-DYUWky5K.js} +1 -1
- package/dist/client/assets/{agent-icon-DpnWPizr.js → agent-icon-zd22KZWY.js} +1 -1
- package/dist/client/assets/agent-library-file-B26RhOf0.js +1 -0
- package/dist/client/assets/{agent-monitor-CP4F0vIz.js → agent-monitor-ByQaXaRH.js} +1 -1
- package/dist/client/assets/{agent-overview-DxHPryIY.js → agent-overview-DIOaHJov.js} +1 -1
- package/dist/client/assets/agent-settings-BQ_MplXY.js +1 -0
- package/dist/client/assets/{agent-site-editor-Dal_nhq0.js → agent-site-editor-ZmxLibT8.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DY_zO3AJ.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-C1bZZXyB.js → agent-site-editor-content-DRt9vlIp.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CbgEmJVs.js → agent-site-editor-preview-7Z9SMUI4.js} +3 -3
- package/dist/client/assets/agent-view-BpAqFgTh.js +1 -0
- package/dist/client/assets/{agent-view-guard-BuO6alvH.js → agent-view-guard-B9HgiZ1B.js} +1 -1
- package/dist/client/assets/{agents-list-xeT8iHfY.js → agents-list-DG9VPQx9.js} +1 -1
- package/dist/client/assets/{ai-providers-F48YOClz.js → ai-providers-0H-9yOOS.js} +1 -1
- package/dist/client/assets/{alert-Cv4YsoTB.js → alert-Buf9oiWa.js} +1 -1
- package/dist/client/assets/{alert-dialog-BGNyf8_T.js → alert-dialog-DG5_wKgz.js} +1 -1
- package/dist/client/assets/api-keys-DbPrfCxe.js +1 -0
- package/dist/client/assets/{api-keys-BIOBkExB.js → api-keys-DcivUdvJ.js} +1 -1
- package/dist/client/assets/app-editor-DuO1pc7m.js +1 -0
- package/dist/client/assets/{asset-utils-B19bt1ML.js → asset-utils-C3onDFgi.js} +1 -1
- package/dist/client/assets/{auth-BdTqkjKW.js → auth-53fyYgiO.js} +1 -1
- package/dist/client/assets/{auth-catchall-DFuU0nWY.js → auth-catchall-DMZWFewT.js} +1 -1
- package/dist/client/assets/{auth-entry-DPaQtFVO.js → auth-entry-CFGe0IMr.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CtHsmnha.js → auth-split-layout-wTIwUQun.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DfHeo6XU.js → authenticate-and-persist-oauth-l6FFkSS7.js} +1 -1
- package/dist/client/assets/{automation-list-row-B5bdsRlJ.js → automation-list-row-DhjFlSDJ.js} +1 -1
- package/dist/client/assets/{automation-runs-B5LbdxJK.js → automation-runs-mbixKpuo.js} +1 -1
- package/dist/client/assets/{automations-BSR-wDw5.js → automations-CTADvQov.js} +1 -1
- package/dist/client/assets/{autosend-C5CH8Kv_.js → autosend-DAAxKqft.js} +1 -1
- package/dist/client/assets/{avatar-BuBijS2t.js → avatar-DfT409hq.js} +1 -1
- package/dist/client/assets/{badge-BNQNKg0b.js → badge-CbxyjOGk.js} +1 -1
- package/dist/client/assets/{block-document-DORiAwbc.js → block-document-DbC1itU8.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DwATmEux.js → blocks-preview-workspace-context-B1GaYQuE.js} +1 -1
- package/dist/client/assets/{breadcrumb-QjE9J74b.js → breadcrumb-DHQJNhJR.js} +1 -1
- package/dist/client/assets/{buckets-B_85RYP6.js → buckets-4eM8JDqA.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BCV2VvlA.js → build-improve-prompt-doc-B9GRKFtg.js} +1 -1
- package/dist/client/assets/{calendar-CfVU54EG.js → calendar-BARhOOLs.js} +1 -1
- package/dist/client/assets/{capability-load-error-CbJ9ZzCB.js → capability-load-error-ULojqFhh.js} +1 -1
- package/dist/client/assets/{category-editor-piRWLx2t.js → category-editor-Ci_lv1Kn.js} +1 -1
- package/dist/client/assets/{chart-Cro1YyeH.js → chart-B51bLH2f.js} +1 -1
- package/dist/client/assets/{chat-context-C11mERBr.js → chat-context-Biuolo5l.js} +1 -1
- package/dist/client/assets/{chat-draft-Cdyy_ZaJ.js → chat-draft-DVuLPy-j.js} +1 -1
- package/dist/client/assets/{checkbox-tEVfKex5.js → checkbox-wlUWF7hx.js} +1 -1
- package/dist/client/assets/{choose-editor-BzW1X_Gx.js → choose-editor-CfaxqMkO.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-CBbywr-E.js → claim-phase-copy-CCRVAHif.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Da2JmnRU.js → cli-auth-success-CP3p1uvq.js} +1 -1
- package/dist/client/assets/{client-icons-Ccs-iuPw.js → client-icons-BR1lKQvc.js} +1 -1
- package/dist/client/assets/{collapsible-DePYhMBn.js → collapsible-CNrrD80N.js} +1 -1
- package/dist/client/assets/{collection-detail-BhtO5G9E.js → collection-detail-DlQAEEKO.js} +1 -1
- package/dist/client/assets/{collection-display-button-DIAK9YZL.js → collection-display-button-CYn3y4wE.js} +1 -1
- package/dist/client/assets/{collection-search-tlAk0D2T.js → collection-search-eq8Jx08C.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CrfE5X7q.js → collection-table-wrapper-UUqdFF6D.js} +1 -1
- package/dist/client/assets/{collection-tabs-48AXMZkw.js → collection-tabs-DOg1wSrf.js} +1 -1
- package/dist/client/assets/{combobox-g3qBIFHm.js → combobox-DjacBfQl.js} +1 -1
- package/dist/client/assets/{command-C-r5sx5V.js → command-fcrvAs5N.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DMw9QL7t.js → companion-mcps-section-BUgcQwu4.js} +1 -1
- package/dist/client/assets/{connect-COIxgZeh.js → connect-CXE8VD1-.js} +1 -1
- package/dist/client/assets/{connect-layout-DLMD9wkO.js → connect-layout-we_wWtwn.js} +1 -1
- package/dist/client/assets/{connection-CNU7MCMV.js → connection-N1n0cOU1.js} +1 -1
- package/dist/client/assets/{connection-card-D376cueq.js → connection-card-CimJ0_Nn.js} +1 -1
- package/dist/client/assets/{connection-detail-CToAiBOE.js → connection-detail-DvIWvhqF.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CaCe-22s.js → connection-form-helpers-B3f1xsmc.js} +1 -1
- package/dist/client/assets/{connections-CJeS1gEN.js → connections-3TDgqTMn.js} +1 -1
- package/dist/client/assets/{context-Bm8sNWBn.js → context-CebZ2Cct.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CWwz-e0D.js → create-organization-dialog-BdCFwYq9.js} +1 -1
- package/dist/client/assets/{decofile-api-CMt-Sefg.js → decofile-api-CPs_PsP6.js} +1 -1
- package/dist/client/assets/{decopilot-Dbmw_-Dy.js → decopilot-4O7tybPz.js} +1 -1
- package/dist/client/assets/{dialog-Dt_E9wmY.js → dialog-Fq0nM2c3.js} +1 -1
- package/dist/client/assets/{discover-CYGnXa5J.js → discover-BU5y4Bvv.js} +1 -1
- package/dist/client/assets/{domain-settings-UxT7otZT.js → domain-settings-BDx0Eb04.js} +1 -1
- package/dist/client/assets/{download-app-dialog-BSZH45AW.js → download-app-dialog-B3AxYOeQ.js} +1 -1
- package/dist/client/assets/{drawer-Bo2lykGg.js → drawer-BUmwqcdF.js} +1 -1
- package/dist/client/assets/{editor-DY0gniQ0.js → editor-DWYOPm_Z.js} +1 -1
- package/dist/client/assets/{empty-state-B2SpKzDm.js → empty-state-gX-Wv4YC.js} +1 -1
- package/dist/client/assets/{empty-state-CDUe3tn0.js → empty-state-yvdmqB8T.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CnfKRYNf.js → extract-connection-data-BOVjMhIV.js} +1 -1
- package/dist/client/assets/{feature-gate-CvSWEnli.js → feature-gate-CRsogGiy.js} +1 -1
- package/dist/client/assets/{feature-paywall-CGvloST1.js → feature-paywall-CEyVPyUB.js} +1 -1
- package/dist/client/assets/{file-explorer-DYEIQQxw.js → file-explorer-Bspsi2W2.js} +1 -1
- package/dist/client/assets/{file-preview-CeR2xF4M.js → file-preview-AD_9B9zi.js} +1 -1
- package/dist/client/assets/{file-share-button-UbrO25iu.js → file-share-button-DkWghzVW.js} +1 -1
- package/dist/client/assets/{file-type-icon-BAcJ-gRp.js → file-type-icon-Ba6U7kMI.js} +1 -1
- package/dist/client/assets/{folder-icon-_yCMhmLN.js → folder-icon-DaSOqQDi.js} +1 -1
- package/dist/client/assets/{form-Bz-Keo7k.js → form-DwboDCoC.js} +1 -1
- package/dist/client/assets/{gateway-client-D5k7zcJK.js → gateway-client-U-aebFOp.js} +1 -1
- package/dist/client/assets/{general-BbSSEjJq.js → general-Bu1PxERY.js} +1 -1
- package/dist/client/assets/{github-icon-B8T9fbHW.js → github-icon-Bczff7w9.js} +1 -1
- package/dist/client/assets/{home-B6A_KWPD.js → home-CCdzOU8E.js} +1 -1
- package/dist/client/assets/{hooks-BKcgVPwe.js → hooks-AXSBDhcZ.js} +1 -1
- package/dist/client/assets/{icon-button-BcW9XgoS.js → icon-button-DN7NI2o6.js} +1 -1
- package/dist/client/assets/{index-BR8i50YQ.js → index-8CYOhgaG.js} +1 -1
- package/dist/client/assets/{index-lzir6TXP.js → index-B0qklDzl.js} +1 -1
- package/dist/client/assets/{index-DouGIYci.js → index-BDb83FE4.js} +1 -1
- package/dist/client/assets/{index-bfAPcQJQ.js → index-BMy4NaZ7.js} +1 -1
- package/dist/client/assets/{index-Bmbp3xBS.js → index-BQxAqOiP.js} +1 -1
- package/dist/client/assets/{index-DdFj8Xwq.js → index-Bry0pxcS.js} +1 -1
- package/dist/client/assets/{index-DQParzZ4.js → index-C-DpAA_l.js} +1 -1
- package/dist/client/assets/{index-D-16c9sJ.js → index-C9q3x3zt.js} +1 -1
- package/dist/client/assets/{index-DcM0fnrE.js → index-CBBWa_aS.js} +1 -1
- package/dist/client/assets/{index-LPyqg8-3.js → index-CCj1WqkC.js} +1 -1
- package/dist/client/assets/{index-CzbeZwh3.js → index-CDlZjUqm.js} +1 -1
- package/dist/client/assets/{index-9uj_-gJ4.js → index-ClatepTO.js} +1 -1
- package/dist/client/assets/{index-CcdwM6i1.js → index-D8J5Sxky.js} +1 -1
- package/dist/client/assets/{index-Bv7m6pZJ.js → index-jpNIlPuy.js} +2 -2
- package/dist/client/assets/{index-redirect-DWm8xJA-.js → index-redirect-C6u8gj-W.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D1sRgsQJ.js → infiniteQueryObserver-Bh_fjXey.js} +1 -1
- package/dist/client/assets/{infra-billing-CUSjhFVd.js → infra-billing-CSgHD_R2.js} +1 -1
- package/dist/client/assets/{input-CyVfmTFZ.js → input-AEl9FaSr.js} +1 -1
- package/dist/client/assets/{input-D07U23f5.js → input-B1-dAf6o.js} +1 -1
- package/dist/client/assets/{input-CHrUn7HF.js → input-CxmpW7Ek.js} +1 -1
- package/dist/client/assets/{integration-icon-BALP9e7t.js → integration-icon-D86q1Lsj.js} +1 -1
- package/dist/client/assets/{label-C7LXwY4c.js → label-oK9z5afE.js} +1 -1
- package/dist/client/assets/{last-preview-page-Br-qo0JQ.js → last-preview-page-BZ6mQEgl.js} +1 -1
- package/dist/client/assets/{layout-mQgMx3D0.js → layout-rWWMXjrM.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-GsVPRazb.js → legacy-agents-deep-D75KaBzt.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CFsTS2Yt.js → legacy-main-redirect-BYmbBZTf.js} +1 -1
- package/dist/client/assets/{library-DZfo1ill.js → library-LbSkWNn5.js} +1 -1
- package/dist/client/assets/{login-Bx_G-ZfM.js → login-C5K6zPK9.js} +1 -1
- package/dist/client/assets/{markdown-UrG1OUwx.js → markdown-DewRRxkR.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-D6yOnt3X.js → mcp-app-renderer-B8WWFBjV.js} +1 -1
- package/dist/client/assets/{mcp-oauth-7y-TBSgg.js → mcp-oauth-DF-3wjVL.js} +1 -1
- package/dist/client/assets/{members-KYY24wBr.js → members-gpZjw-0e.js} +1 -1
- package/dist/client/assets/{message-templates-C4q0pMiN.js → message-templates-CGvvfznj.js} +1 -1
- package/dist/client/assets/{mini-report-page-B36HzYKH.js → mini-report-page-B18w4HJM.js} +1 -1
- package/dist/client/assets/{mock-board-B8mPRdKv.js → mock-board-PHDWZ5Rj.js} +3 -3
- package/dist/client/assets/{monaco-editor-CLoQO8ua.js → monaco-editor-1VDRMi5Z.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Dz2Z5Leg.js → monitoring-stats-row-BTHr4fZ5.js} +1 -1
- package/dist/client/assets/{multi-select-BQEJMcpt.js → multi-select-_hBjuZhJ.js} +1 -1
- package/dist/client/assets/{mustache-BBPquBDn.js → mustache-qkuFcNLb.js} +1 -1
- package/dist/client/assets/{oauth-callback-EFwcXKm-.js → oauth-callback-B1Uai9y4.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BqaIKxHZ.js → oauth-callback-ai-provider-glRwYBh0.js} +1 -1
- package/dist/client/assets/{onboarding-BuTjRMnK.js → onboarding-DDANr9IQ.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Bp5keE3H.js → optimistic-project-sidebar-views-DMA4YBZs.js} +1 -1
- package/dist/client/assets/{org-file-open-context-DHpNV-Za.js → org-file-open-context-CcPURBkR.js} +1 -1
- package/dist/client/assets/{organization-choice-C88iEhc9.js → organization-choice-q4iDzxaT.js} +1 -1
- package/dist/client/assets/{orgs-VjsNpb3l.js → orgs-B2MwX22p.js} +1 -1
- package/dist/client/assets/{page-seo-form-DxijkNF3.js → page-seo-form-DPxJXv8-.js} +1 -1
- package/dist/client/assets/{pair-DkCaPZGG.js → pair-C60j_huQ.js} +1 -1
- package/dist/client/assets/{plan-ladder-B7BHKanR.js → plan-ladder-DiEGIMNA.js} +1 -1
- package/dist/client/assets/{popover-BVDv_qcw.js → popover-Ddu4iAPr.js} +1 -1
- package/dist/client/assets/{post-calendar-DlgaB_mv.js → post-calendar-DmX3brDp.js} +1 -1
- package/dist/client/assets/{post-editor-Dg0XPKjI.js → post-editor-DDpQa9aK.js} +1 -1
- package/dist/client/assets/{preview-content-BGVXSIuy.js → preview-content-nP7rYoVp.js} +1 -1
- package/dist/client/assets/{preview-dialog-mvYZITqK.js → preview-dialog-DVTbqSrZ.js} +1 -1
- package/dist/client/assets/{profile-DnuPEuMr.js → profile-DH86JppE.js} +1 -1
- package/dist/client/assets/{project-app-view-Bm7ebFhY.js → project-app-view-D1ahOteG.js} +1 -1
- package/dist/client/assets/{project-feed-C8MYxRQr.js → project-feed-DcdY9b8p.js} +1 -1
- package/dist/client/assets/{project-icon-DfGWWram.js → project-icon-CE-voYeF.js} +1 -1
- package/dist/client/assets/project-reports-BORRGsRz.js +1 -0
- package/dist/client/assets/project-tasks-CRStWfOr.js +1 -0
- package/dist/client/assets/{prompts-CcbY66hh.js → prompts-B0m81b-P.js} +1 -1
- package/dist/client/assets/record-editor-DB5V4dOD.js +1 -0
- package/dist/client/assets/{redirect-editor-DAZz80-W.js → redirect-editor-BxGeAe1m.js} +1 -1
- package/dist/client/assets/{reports-s0iM3bai.js → reports-BGuoAK-j.js} +1 -1
- package/dist/client/assets/reports-bnYiC_GO.js +1 -0
- package/dist/client/assets/{reports-onboarding-B7TG-bDs.js → reports-onboarding-BSr5xqLY.js} +1 -1
- package/dist/client/assets/{reports-tab-CM14iFQ4.js → reports-tab-Dv1b1trN.js} +2 -2
- package/dist/client/assets/{repositories-D76jdZGS.js → repositories-DhDdUI7t.js} +1 -1
- package/dist/client/assets/{repository-import-picker-D63E_FEB.js → repository-import-picker-DQ2X5vYR.js} +1 -1
- package/dist/client/assets/{repository-picker-Ilzy9Kv8.js → repository-picker-DuUqRm8X.js} +1 -1
- package/dist/client/assets/{require-capability-C0MD5CDU.js → require-capability-DbxXicMT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D8RoPgqo.js → required-auth-layout-nM5VBqDv.js} +1 -1
- package/dist/client/assets/{reset-password-CRhea7-u.js → reset-password-B9WOYVDd.js} +1 -1
- package/dist/client/assets/{resizable-CEPHaLdf.js → resizable-BAWWm2nK.js} +1 -1
- package/dist/client/assets/{review-settings-CfN-lmLA.js → review-settings-BGS7uQ6I.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-CivqII9W.js → rich-text-link-control-Bdhpb3Zg.js} +1 -1
- package/dist/client/assets/{roles-D7xhHY5g.js → roles-V5JoTuaT.js} +1 -1
- package/dist/client/assets/{route-BsEMFU2I.js → route-BqHCYCsv.js} +1 -1
- package/dist/client/assets/{route-CFJ0YCVD.js → route-DjwL1Fx5.js} +1 -1
- package/dist/client/assets/{route-DykpJaTp.js → route-ZOU_9LwH.js} +1 -1
- package/dist/client/assets/{route-page-header-D0xiRjXr.js → route-page-header-BpBVey10.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-CcLMQzGK.js → runnable-block-editor-BhysVT_d.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DdzUVnCQ.js → sandbox-lifecycle-context-MYXX62o9.js} +1 -1
- package/dist/client/assets/{schema-BtjpCkBi.js → schema-CbxRw8u0.js} +1 -1
- package/dist/client/assets/{scroll-area-BJWIwL31.js → scroll-area-cGn3a7WI.js} +1 -1
- package/dist/client/assets/{search-input-pdt0PjHf.js → search-input-BDrnENeI.js} +1 -1
- package/dist/client/assets/{search-toggle-C34D8JZy.js → search-toggle-D3OE1eNA.js} +1 -1
- package/dist/client/assets/{secret-picker-Ckm17aBF.js → secret-picker-7NmqTvJr.js} +1 -1
- package/dist/client/assets/{secrets-BPQSzLEe.js → secrets-C8RnJX_t.js} +1 -1
- package/dist/client/assets/{sections-editor-CTc0eCxh.js → sections-editor-B7HawNxT.js} +1 -1
- package/dist/client/assets/{select-DCf8mW_F.js → select-DxhjEfyz.js} +1 -1
- package/dist/client/assets/{select-model-DPpoAruH.js → select-model-BANyElMS.js} +1 -1
- package/dist/client/assets/{seo-editor-DqNiw3Gu.js → seo-editor-DfUSXMZj.js} +1 -1
- package/dist/client/assets/{separator-DkJFgiVz.js → separator-ByET-GLC.js} +1 -1
- package/dist/client/assets/{settings-tab-X9MsSJaG.js → settings-tab-XTpgZ69I.js} +1 -1
- package/dist/client/assets/{sheet-CRpiY1-P.js → sheet-n9kcgSxF.js} +1 -1
- package/dist/client/assets/{shell-layout-BhxJycDB.js → shell-layout-3Y13kkhL.js} +1 -1
- package/dist/client/assets/{sidebar-jYcM8g67.js → sidebar-CJTXGZDA.js} +1 -1
- package/dist/client/assets/{skill-preview-BX-_amDj.js → skill-preview-By3pB2y3.js} +1 -1
- package/dist/client/assets/{skills-skZ-d2he.js → skills-D4_sFwwl.js} +1 -1
- package/dist/client/assets/{sso-B8ybivYm.js → sso-BYhFmBwz.js} +1 -1
- package/dist/client/assets/{suggestion-D9IPPiJm.js → suggestion-C4rd6y9a.js} +1 -1
- package/dist/client/assets/{switch-DF6wdqfh.js → switch-DKrCkEm_.js} +1 -1
- package/dist/client/assets/{synced-repos-CCUZGqTp.js → synced-repos-2MrHm3BW.js} +1 -1
- package/dist/client/assets/{table-BxgDzT2Q.js → table-CVXiShGi.js} +1 -1
- package/dist/client/assets/{tabs-DA1AIZDN.js → tabs-DZsSgDfP.js} +1 -1
- package/dist/client/assets/{task-board-DWNkcIT9.js → task-board-Ny1PbjMW.js} +1 -1
- package/dist/client/assets/{task-route-CzUc59tY.js → task-route-9MeQLYQ9.js} +1 -1
- package/dist/client/assets/{task-status-DRe5owa5.js → task-status-DbQ_mzm6.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-B0aiNvOj.js → taskboard-analytics-DywDB_Qc.js} +1 -1
- package/dist/client/assets/{tasks-KzSZR8oQ.js → tasks-DEcROjS5.js} +1 -1
- package/dist/client/assets/tasks-Dok3BfRQ.js +1 -0
- package/dist/client/assets/{textarea-BswM-JJn.js → textarea-DGsUkzqN.js} +1 -1
- package/dist/client/assets/{thread-button-DpvYBb08.js → thread-button-PKgxAUks.js} +1 -1
- package/dist/client/assets/{thread-intent-D2yH8NQG.js → thread-intent-CDjInTZL.js} +1 -1
- package/dist/client/assets/{thread-route-Qq_kbYd9.js → thread-route-CC_31SLX.js} +1 -1
- package/dist/client/assets/{thread-route-DkDGVcOv.js → thread-route-D30inKGP.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Dl3leyvL.js → thread-sheet-body-hFIE9VHn.js} +1 -1
- package/dist/client/assets/{toggle-group-DX3mdFud.js → toggle-group-DPI9Gz2N.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DO_Pu4gv.js → toolbar-icon-button-BkDKNKtL.js} +1 -1
- package/dist/client/assets/{tooltip-MZWOYG63.js → tooltip-CSEjy-r8.js} +1 -1
- package/dist/client/assets/{track-BOO7JHvQ.js → track-K6tQy-wy.js} +1 -1
- package/dist/client/assets/{types-CdIb-oSa.js → types-k3vJw7wx.js} +1 -1
- package/dist/client/assets/{usage-stats-D9_UDdxp.js → usage-stats-HcbmSz7a.js} +1 -1
- package/dist/client/assets/{use-ai-providers-LNkRnBQk.js → use-ai-providers-CcGxl3Gi.js} +1 -1
- package/dist/client/assets/{use-automations-wHZIlCBG.js → use-automations-CDFazwkf.js} +1 -1
- package/dist/client/assets/{use-autosave-BYzOUZ9X.js → use-autosave-DsxiIWxA.js} +1 -1
- package/dist/client/assets/{use-connect-companion-CpQsI1Ur.js → use-connect-companion-D6711Opr.js} +1 -1
- package/dist/client/assets/{use-connection-B-USUnQN.js → use-connection-CMx-XZiq.js} +1 -1
- package/dist/client/assets/{use-copy-Nse-byOh.js → use-copy-BpzZQl2g.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-w0UfekMk.js → use-create-virtual-mcp--ht4Rkm7.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DSMUf9DP.js → use-date-fns-locale-BjV4TzBE.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BIyRiVKw.js → use-debounced-autosave-CEylLohK.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BBnUBOSq.js → use-debounced-value-C6okEGbV.js} +1 -1
- package/dist/client/assets/{use-deco-credits-gF2uD0li.js → use-deco-credits-CpqHEICB.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CtrWnhxy.js → use-decopilot-events-Dppj3YU9.js} +1 -1
- package/dist/client/assets/{use-delete-connection-C8-NvdUG.js → use-delete-connection-DUW9f2u1.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CJ8ciOjT.js → use-deployment-admin-DshXpxI2.js} +1 -1
- package/dist/client/assets/{use-entitlements-BHhFQNz5.js → use-entitlements-Ba17FhRN.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BC-z9fhi.js → use-fast-preview-draft-url-kMKxC_Pw.js} +1 -1
- package/dist/client/assets/{use-file-configs-BAx_Bctw.js → use-file-configs-BmEDH0VE.js} +1 -1
- package/dist/client/assets/{use-in-settings-CX8maZJ7.js → use-in-settings-YUhZQzYy.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BNK1GE9k.js → use-infinite-scroll-CSRrFY6h.js} +1 -1
- package/dist/client/assets/{use-join-requests-GN9Xi7io.js → use-join-requests-BoS4qMQi.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Bs2TK-ce.js → use-main-panel-tabs-By5S27Gp.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DQ2enOLs.js → use-mcp-auth-status-CWdlR5O6.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CiFGnu7b.js → use-mcp-client-C8DXVUZj.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-lZTjG1mH.js → use-mcp-prompts-JOWAmkEq.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BOO1IMIj.js → use-mcp-tools-D-S9SAOh.js} +1 -1
- package/dist/client/assets/{use-members-Z0iLDtCA.js → use-members-CAwVsdC4.js} +1 -1
- package/dist/client/assets/{use-mobile-FeK7AF2-.js → use-mobile-BYW51CpD.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CPtcDApl.js → use-navigate-to-agent-ebIYYmYW.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-C1TkXtsG.js → use-open-billing-url-i3U-Ki4a.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BcsB9kzf.js → use-org-auth-client-D-B1M9Fj.js} +1 -1
- package/dist/client/assets/{use-org-fs-DZVXkCx9.js → use-org-fs-D3EWDZUC.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-oHWqq1Hv.js → use-org-repo-syncs-DmuKbSlB.js} +1 -1
- package/dist/client/assets/{use-org-sso-BrL8hF5L.js → use-org-sso-CzqSMhda.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DWETaDWP.js → use-organization-roles-_GFhEaSJ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CDeGu_eP.js → use-organization-settings-BG_WfOIn.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-D_YT_rEt.js → use-panel-navigate-DI4UQ_n7.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-aCoQogoA.js → use-project-native-view-presence-CcjNty9d.js} +1 -1
- package/dist/client/assets/{use-project-scope-Bg0KmzUM.js → use-project-scope-CdVgPS_9.js} +1 -1
- package/dist/client/assets/{use-releases-CF_duBCQ.js → use-releases-D_nd9qj6.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DlQkRAqW.js → use-reports-diagnostic-C-GusDUW.js} +1 -1
- package/dist/client/assets/{use-route-default-main-D-CU2nKW.js → use-route-default-main-CVXNK-Ds.js} +1 -1
- package/dist/client/assets/{use-secrets-BbiQEKkz.js → use-secrets-CKbHXdHu.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DMJs1jQ3.js → use-section-preview-base-BHfKu4Be.js} +1 -1
- package/dist/client/assets/{use-session-runtime-Y6K8YOdz.js → use-session-runtime-a9Y20Jh0.js} +1 -1
- package/dist/client/assets/{use-tags-BSU7h4nA.js → use-tags-BQDPMaYa.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BKJ8I9Cs.js → use-task-board-analytics-dyWG2Jj9.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CvYiPjE8.js → use-task-metadata-De4dYawr.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-JEXsALbU.js → use-thread-outputs-CHuFDG4c.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-FRNqyFl7.js → use-virtual-mcp-BnIp2YQj.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-HKtw1Zwv.js +1 -0
- package/dist/client/assets/{useQueries-9Xvfq4o_.js → useQueries-DX5YqUyF.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CIYuI7yd.js +1 -0
- package/dist/client/assets/{users-CB4moz77.js → users-C1JPEsq0.js} +1 -1
- package/dist/client/assets/{utils-h4IU03oF.js → utils-Dnu7Z_7W.js} +1 -1
- package/dist/client/assets/{variant-calendar-G4X0EVoH.js → variant-calendar-52QBX61v.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CfLSliOF.js → variant-matcher-override-G4ZIBzQZ.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BB8DfoWq.js → view-mode-toggle-BHHm82Wa.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DOLKk3ac.js → virtual-mcp-VENiZcwc.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/agent-app-BEn3DHbU.js +0 -1
- package/dist/client/assets/agent-deck-Cdi72ZuY.js +0 -1
- package/dist/client/assets/agent-file-DWqJLMKY.js +0 -1
- package/dist/client/assets/agent-library-file-Bc9zk09x.js +0 -1
- package/dist/client/assets/agent-settings-Dkp6jsMM.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CJi1470H.js +0 -2
- package/dist/client/assets/agent-view-BHtjcZQK.js +0 -1
- package/dist/client/assets/api-keys-D-h5jmiI.js +0 -1
- package/dist/client/assets/app-editor-B4pRY03V.js +0 -1
- package/dist/client/assets/project-reports-Xaq5q-8V.js +0 -1
- package/dist/client/assets/project-tasks-Bk6SIhsH.js +0 -1
- package/dist/client/assets/record-editor-CHeB7WJ0.js +0 -1
- package/dist/client/assets/reports-D4_laEx2.js +0 -1
- package/dist/client/assets/tasks-NSYirPqf.js +0 -1
- package/dist/client/assets/useInfiniteQuery-D7pUQ9-H.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CCPBpqAT.js +0 -1
package/dist/server/cli.js
CHANGED
|
@@ -2105,7 +2105,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var t8$=L(()=>{ph()});f
|
|
|
2105
2105
|
`.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${G}/${K}, keeping in old table`);continue}}await El`
|
|
2106
2106
|
DELETE FROM kysely_migration WHERE name = ${Q}
|
|
2107
2107
|
`.execute($)}}async function R7$($){await lK4($),await cK4($);let Z=new T7$({db:$,provider:{getMigrations:()=>Promise.resolve(O11)}}),{error:Q,results:X}=await Z.migrateToLatest(),Y=0;if(X?.forEach((J)=>{if(J.status==="Success")Y++;else if(J.status==="Error")console.error(`Failed to execute migration "${J.migrationName}"`)}),Q)throw console.error("Failed to migrate"),console.error(Q),Q;return Y}async function mK4($){let{keepOpen:Z=!1,database:Q,skipBetterAuth:X=!1}=$??{},Y="skipped";if(!X&&!Q)Y=await Ma0();let J=Q??W8(),G=async()=>{if(!Z&&!Q)await pD(J).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await R7$(J.db);return await G(),{betterAuth:Y,kysely:K}}catch(K){throw await G(),K}}async function dK4(){let $=W8(),Z=new T7$({db:$.db,provider:{getMigrations:()=>Promise.resolve(O11)}}),{error:Q,results:X}=await Z.migrateDown();if(X?.forEach((Y)=>{if(Y.status==="Success")console.log(`\u2705 Migration "${Y.migrationName}" rolled back successfully`);else if(Y.status==="Error")console.error(`\u274C Failed to rollback migration "${Y.migrationName}"`)}),Q)throw console.error("Failed to rollback migration"),console.error(Q),Q}var M7$=L(()=>{P7$();Ia0();LX()});async function N30($){let Z={...process.env},Q=Z70($,Z);console.log(aI1(Q.settings.encryptionKey));let X=Q.settings.betterAuthSecret||(Q.settings.localMode?M6$(Q.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (BG0(),NG0)),{outputs:J,services:G}=await Y({home:Q.settings.dataDir,externalDatabaseUrl:Q.externalDatabaseUrl,externalNatsUrl:Q.externalNatsUrl});if(!Q.skipMigrations){let{migrateBetterAuth:W}=await Promise.resolve().then(() => (Ia0(),V6$));await W(J.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (LX(),d4$)),{migrateToLatest:F}=await Promise.resolve().then(() => (M7$(),q7$)),U=H(J.databaseUrl);await F({keepOpen:!0,database:U,skipBetterAuth:!0})}let K={...Q.settings,betterAuthSecret:X,databaseUrl:J.databaseUrl,natsUrls:J.natsUrls,...J.s3?{s3Endpoint:J.s3.endpoint,s3Bucket:J.s3.bucket,s3AccessKeyId:J.s3.accessKeyId,s3SecretAccessKey:J.s3.secretAccessKey,s3ForcePathStyle:J.s3.forcePathStyle}:{}};return o8$(K),{settings:K,services:G.map((W)=>({name:W.name==="PostgreSQL"?"Postgres":W.name,port:W.port})),managedServiceNames:G.filter((W)=>W.owner==="managed").map((W)=>W.name)}}var D11=L(()=>{ph();I6$();H$()});var S7$={};K0(S7$,{updateService:()=>KT,subscribeCliState:()=>E11,setTuiConsoleIntercepted:()=>B30,setServerUrl:()=>sa,setMigrationsDone:()=>ra,setDevMode:()=>pK4,resetCliStateForTests:()=>iK4,isTuiConsoleIntercepted:()=>L30,getCliState:()=>j11,addLogEntry:()=>sD});function I7$(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function V7$(){return{services:I7$(),migrationsStatus:"pending",serverUrl:null,logs:[]}}function iK4(){NJ=V7$()}function aa(){for(let $ of w11)$()}function j11(){return NJ}function E11($){return w11.add($),()=>w11.delete($)}function KT($){NJ={...NJ,services:NJ.services.map((Z)=>Z.name===$.name?$:Z)},aa()}function ra(){NJ={...NJ,migrationsStatus:"done"},aa()}function sa($){NJ={...NJ,serverUrl:$},aa()}function sD($){let Z=[...NJ.logs,$];NJ={...NJ,logs:Z.length>500?Z.slice(-500):Z},aa()}function pK4(){NJ={...NJ,services:[...I7$(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},aa()}function B30($){k7$=$}function L30(){return k7$}var NJ,w11,k7$=!1;var WT=L(()=>{NJ=V7$();w11=new Set});import{createServer as C7$}from"net";function nK4($){return new Promise((Z)=>{let Q=C7$();Q.once("error",()=>Z(!1)),Q.listen($,"0.0.0.0",()=>{Q.close(()=>Z(!0))})})}async function ea($){if(await nK4($))return $;let Z=await new Promise((Q,X)=>{let Y=C7$();Y.once("error",X),Y.listen(0,"0.0.0.0",()=>{let J=Y.address(),G=typeof J==="object"&&J?J.port:0;Y.close(()=>Q(G))})});return console.warn(`Port ${$} is in use, using port ${Z} instead.`),Z}var z11=()=>{};var T11={};K0(T11,{startDevServer:()=>oK4,pipeToLogStore:()=>P11});import{join as tK4}from"path";function P11($){let Z=$.getReader(),Q=new TextDecoder,X="";function Y(){let J=X.split(`
|
|
2108
|
-
`);X=J.pop()??"";for(let G of J){let K=Bun.stripANSI(G).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;sD({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:J,value:G}=await Z.read();if(J)break;X+=Q.decode(G,{stream:!0}),Y()}}catch{}if(X.trim()){let J=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(J)sD({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function oK4($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,J=Z||`http://localhost:${Y}`,G=X?await ea(Number(Y)+1):await ea(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await N30({port:String(G),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)KT({name:D.name,status:"ready",port:D.port});ra();let F=tK4(import.meta.dir,"..","..","..","..",".."),U=Q===!0,N=Bun.spawn(["bun","run","dev:servers"],{cwd:F,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:J,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}},stdio:["inherit",U?"inherit":"pipe",U?"inherit":"pipe"]});if(!U)P11(N.stdout),P11(N.stderr);sa(J),KT({name:"Vite",status:"ready",port:Number(Y)}),KT({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(N.kill(D),await N.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (BG0(),NG0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:N}}var A11=L(()=>{D11();WT();z11()});var O30;var R11=L(()=>{O30={name:"decocms",version:"4.393.1",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^4.0.58","@ai-sdk/google":"^4.0.76","@ai-sdk/openai":"^4.0.71","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^3.1.0","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^4.0.17","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^7.0.107","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as rK4,Text as _7$}from"ink";import{jsx as sK4,jsxs as v7$}from"react/jsx-runtime";function x7$({version:$}){return v7$(rK4,{flexDirection:"column",marginTop:1,children:[bG0.map((Z,Q)=>sK4(_7$,{color:yG0[Q],children:Z},Q)),v7$(_7$,{dimColor:!0,children:[" v",$]})]})}var f7$=L(()=>{fa()});import{Box as HT,Text as eD}from"ink";import{Spinner as eK4}from"@inkjs/ui";import{jsx as CG,jsxs as zl}from"react/jsx-runtime";function b7$({status:$}){if($==="pending")return CG(eK4,{label:""});return CG(eD,{color:"green",children:"\u2713"})}function $W4($){return`${$.name}: ${$.port||"...."}`}function y7$({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return zl(HT,{flexDirection:"column",paddingBottom:1,children:[CG(x7$,{version:O30.version}),CG(HT,{marginBottom:1,children:CG(eD,{dimColor:!0,children:"\u2500".repeat(80)})}),CG(HT,{children:zl(eD,{dimColor:!0,children:["Home: ",Q]})}),zl(HT,{gap:2,children:[$.map((Y)=>zl(HT,{gap:1,children:[CG(eD,{children:$W4(Y)}),CG(b7$,{status:Y.status})]},Y.name)),zl(HT,{gap:1,children:[CG(eD,{children:"Migrations"}),CG(b7$,{status:Z})]})]}),CG(HT,{children:X?zl(eD,{children:["Open in browser: ",CG(eD,{color:"cyan",children:X})]}):CG(eD,{dimColor:!0,children:"Starting..."})})]})}var g7$=L(()=>{R11();f7$()});import{Box as ZW4,Text as $r}from"ink";import{jsx as q11,jsxs as M11}from"react/jsx-runtime";function QW4($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function h7$({logs:$}){return q11(ZW4,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return q11($r,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return M11($r,{children:[M11($r,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),q11($r,{color:QW4(Z.status),children:Z.status}),M11($r,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var u7$=()=>{};var I11={};K0(I11,{App:()=>JW4});import{Box as XW4}from"ink";import{useSyncExternalStore as YW4}from"react";import{jsx as l7$,jsxs as GW4}from"react/jsx-runtime";function JW4({home:$}){let Z=YW4(E11,j11);return GW4(XW4,{flexDirection:"column",children:[l7$(y7$,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),l7$(h7$,{logs:Z.logs})]})}var V11=L(()=>{g7$();u7$();WT()});var WK="thread-gate",fB="decopilot-hosted-harness",bB="decopilot-hosted-harness-sandboxed",HK="automations",$w="background-tools",FT="task-board-github-reads";var c7$="13";function m7$($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:c7$,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var d7$=()=>{};import KW4 from"pg";async function p7$($,Z){let{databaseUrl:Q,lockTimeoutMs:X=WW4}=$,Y=$.log??((W)=>console.log(W)),J=new KW4.Client({connectionString:Q});await J.connect();let G=Date.now(),K=!1;try{while(!K){if(K=(await J.query("SELECT pg_try_advisory_lock($1) AS locked",[i7$.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-G>=X)throw Error(`Timed out after ${X}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await k$(HW4)}let W=Date.now()-G;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await J.query("SELECT pg_advisory_unlock($1)",[i7$.toString()])}catch{}await J.end().catch(()=>{})}}var i7$=8314027461559302n,WW4=600000,HW4=500;var n7$=L(()=>{O8()});function FW4(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function k11($,Z){for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X===Z)return $[Q+1];if(X.startsWith(`${Z}=`))return X.slice(Z.length+1)}return}function t7$(){let $=FW4();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:k11($,"--cpu-prof-dir")??process.cwd(),name:k11($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(k11($,"--cpu-prof-interval")??1000),note:"profile is written on process exit"}));return}if(process.env.CPU_PROFILE)console.warn(JSON.stringify({msg:"cpu-profiling-requested-but-inactive",hint:'CPU profiling is a Bun launch flag. Set BUN_OPTIONS="--cpu-prof --cpu-prof-md --cpu-prof-dir=/tmp" before starting the process.'}))}function o7$(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=XT();if(!Q)return;let X={};try{let{heapStats:Y}=await import("bun:jsc"),J=Y(),G=Object.entries(J.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);X={objectCount:J.objectCount,heapSize:J.heapSize,top:Object.fromEntries(G)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:Q.rss,heapUsed:Q.heapUsed,heapTotal:Q.heapTotal,external:Q.external,arrayBuffers:Q.arrayBuffers,...X}))};return Z().catch(()=>{}),D30=setInterval(()=>void Z().catch(()=>{}),$),D30.unref?.(),process.on("SIGUSR2",()=>{try{let Q=Bun.generateHeapSnapshot("v8"),X=typeof Q==="string"?Q:JSON.stringify(Q),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,X),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(Q){console.error("[heap-watch] snapshot failed:",Q)}}),()=>{if(D30)clearInterval(D30)}}var D30;var a7$=()=>{};import*as UW4 from"bun:jsc";function r7$(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let $=Number(process.env.STALL_WATCHDOG_MS??100),Z=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{NW4()}catch(J){return console.error("[stall-watchdog] failed to start sampling profiler:",J),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let J=performance.now(),G=J-X;X=J+Z;let K=[];try{K=BW4()?.traces??[]}catch{}if(G>$&&K.length>0){let W=new Map;for(let F of K){let U=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!U)continue;let N=(U.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${U.name??"?"} @ ${N}:${U.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,U)=>U[1]-F[1]).slice(0,8).map(([F,U])=>({frame:F,count:U}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(G),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var NW4,BW4;var s7$=L(()=>{({startSamplingProfiler:NW4,samplingProfilerStackTraces:BW4}=UW4)});function e7$(){t7$();let $=[o7$(),b4$(),r7$()];return()=>{for(let Z of $)Z()}}var $Q$=L(()=>{ja0();a7$();s7$()});var UT=b((ZQ$)=>{Object.defineProperty(ZQ$,"__esModule",{value:!0});ZQ$.RepublishHeaders=ZQ$.DirectMsgHeaders=ZQ$.JsHeaders=ZQ$.AdvisoryKind=void 0;ZQ$.isOrderedPushConsumerOptions=LW4;ZQ$.isPullConsumer=OW4;ZQ$.isPushConsumer=DW4;ZQ$.isBoundPushConsumerOptions=wW4;function LW4($){if($&&typeof $==="object")return"name_prefix"in $||"deliver_subject_prefix"in $||"filter_subjects"in $||"filter_subject"in $||"deliver_policy"in $||"opt_start_seq"in $||"opt_start_time"in $||"replay_policy"in $||"inactive_threshold"in $||"headers_only"in $||"deliver_prefix"in $;return!1}function OW4($){return $.isPullConsumer()}function DW4($){return $.isPushConsumer()}function wW4($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}ZQ$.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"};ZQ$.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"};ZQ$.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};ZQ$.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var _G=b((XQ$)=>{Object.defineProperty(XQ$,"__esModule",{value:!0});XQ$.TD=XQ$.TE=XQ$.Empty=void 0;XQ$.encode=MW4;XQ$.decode=IW4;XQ$.Empty=new Uint8Array(0);XQ$.TE=new TextEncoder;XQ$.TD=new TextDecoder;function qW4(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}function MW4(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(XQ$.TE.encode($[Q]));if(Z.length===0)return XQ$.Empty;if(Z.length===1)return Z[0];return qW4(...Z)}function IW4($){if(!$||$.length===0)return"";return XQ$.TD.decode($)}});var vG=b((GQ$)=>{Object.defineProperty(GQ$,"__esModule",{value:!0});GQ$.errors=GQ$.PermissionViolationError=GQ$.NoRespondersError=GQ$.TimeoutError=GQ$.RequestError=GQ$.ProtocolError=GQ$.ConnectionError=GQ$.DrainingConnectionError=GQ$.ClosedConnectionError=GQ$.AuthorizationError=GQ$.UserAuthenticationExpiredError=GQ$.InvalidOperationError=GQ$.InvalidArgumentError=GQ$.InvalidSubjectError=void 0;class C11 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}GQ$.InvalidSubjectError=C11;class w30 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,Q){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((X)=>`'${X}'`),$=$.join(",");else $=`'${$}'`;return new w30(`${$} ${Z}`,Q)}}GQ$.InvalidArgumentError=w30;class _11 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}GQ$.InvalidOperationError=_11;class j30 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new j30($);return null}}GQ$.UserAuthenticationExpiredError=j30;class E30 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],Q=$.toLowerCase();for(let X=0;X<Z.length;X++)if(Q.indexOf(Z[X])!==-1)return new E30($);return null}}GQ$.AuthorizationError=E30;class v11 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}GQ$.ClosedConnectionError=v11;class x11 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}GQ$.DrainingConnectionError=x11;class f11 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}GQ$.ConnectionError=f11;class b11 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}GQ$.ProtocolError=b11;class y11 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof z30}}GQ$.RequestError=y11;class g11 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}GQ$.TimeoutError=g11;class z30 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}GQ$.NoRespondersError=z30;class P30 extends Error{operation;subject;queue;constructor($,Z,Q,X,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=Q,this.queue=X}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Q="publish",X="",Y=void 0,J=$.match(/(Publish|Subscription) to "(\S+)"/);if(J){if(Q=J[1].toLowerCase(),X=J[2],Q==="subscription"){let G=$.match(/using queue "(\S+)"/);if(G)Y=G[1]}}return new P30($,Q,X,Y)}}GQ$.PermissionViolationError=P30;GQ$.errors={AuthorizationError:E30,ClosedConnectionError:v11,ConnectionError:f11,DrainingConnectionError:x11,InvalidArgumentError:w30,InvalidOperationError:_11,InvalidSubjectError:C11,NoRespondersError:z30,PermissionViolationError:P30,ProtocolError:b11,RequestError:y11,TimeoutError:g11,UserAuthenticationExpiredError:j30}});var iW=b((UQ$)=>{Object.defineProperty(UQ$,"__esModule",{value:!0});UQ$.SimpleMutex=UQ$.Perf=void 0;UQ$.extend=dW4;UQ$.render=iW4;UQ$.timeout=pW4;UQ$.delay=nW4;UQ$.deadline=tW4;UQ$.deferred=u11;UQ$.debugDeferred=oW4;UQ$.shuffle=aW4;UQ$.collect=rW4;UQ$.jitter=FQ$;UQ$.backoff=sW4;UQ$.nanos=eW4;UQ$.millis=$H4;UQ$.randomToken=XH4;var mW4=_G(),h11=vG();function dW4($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function iW4($){return mW4.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function pW4($,Z=!0){let Q=Z?new h11.TimeoutError:null,X,Y,J=new Promise((G,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new h11.TimeoutError);else K(Q)},$)});return Object.assign(J,X)}function nW4($=0){let Z,Q=new Promise((X)=>{let Y=setTimeout(()=>{X()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),X()}}});return Object.assign(Q,Z)}async function tW4($,Z=1000){let Q=u11(),X=setTimeout(()=>{Q.reject(new h11.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function u11(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function oW4(){let $={},Z=new Promise((Q,X)=>{$={resolve:(Y)=>{console.trace("resolve",Y),Q(Y)},reject:(Y)=>{console.trace("reject"),X(Y)}}});return Object.assign(Z,$)}function aW4($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function rW4($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class WQ${timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,Q){let X=this.timers.get(Z);if(X===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(Q);if(Y===void 0)throw Error(`${Q} is not defined`);this.measures.set($,Y-X)}getEntries(){let $=[];return this.measures.forEach((Z,Q)=>{$.push({name:Q,duration:Z})}),$}}UQ$.Perf=WQ$;class HQ${max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=u11();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}UQ$.SimpleMutex=HQ$;function FQ$($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function sW4($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(Q){return FQ$(Q>Z?$[Z]:$[Q])}}}function eW4($){return $*1e6}function $H4($){return Math.floor($/1e6)}var ZH4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",yB=new Uint8Array(62);for(let $=0;$<62;$++)yB[$]=ZH4.charCodeAt($);var QH4=218340105584896;function XH4(){let $=Math.floor(Math.random()*QH4),Z=$%62,Q=yB[Z];$=($-Z)/62,Z=$%62;let X=yB[Z];$=($-Z)/62,Z=$%62;let Y=yB[Z];$=($-Z)/62,Z=$%62;let J=yB[Z];$=($-Z)/62,Z=$%62;let G=yB[Z];$=($-Z)/62,Z=$%62;let K=yB[Z];$=($-Z)/62,Z=$%62;let W=yB[Z];$=($-Z)/62;let H=yB[$];return String.fromCharCode(Q,X,Y,J,G,K,W,H)}});var EQ$=b((wQ$)=>{Object.defineProperty(wQ$,"__esModule",{value:!0});wQ$.nuid=wQ$.NuidImpl=void 0;var EH4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Zw=62,A30=12,OQ$=10,BQ$=33,zH4=333,LQ$=A30+OQ$,c11=new Uint8Array(Zw);for(let $=0;$<Zw;$++)c11[$]=EH4.charCodeAt($);var T30=4294967296,DQ$=BigInt(Zw)**BigInt(OQ$),Zr=Number(DQ$/(1n<<32n)),l11=Number(DQ$%(1n<<32n));function PH4($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function TH4($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else PH4($)}class m11{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(LQ$),this.cbuf=new Uint8Array(A30),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Zr+1)),this.seqLo=Math.floor(Math.random()*T30);while($++<8&&this.seqHi===Zr&&this.seqLo>=l11);if(this.seqHi===Zr&&this.seqLo>=l11)this.seqLo=0;this.inc=Math.random()*(zH4-BQ$)+BQ$|0}setPre(){TH4(this.cbuf);for(let $=0;$<A30;$++)this.buf[$]=c11[this.cbuf[$]%Zw]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=LQ$-1;Q>=A30;Q--){let X=Math.floor($/Zw),J=($-X*Zw)*T30+Z,G=Math.floor(J/Zw),K=J-G*Zw;this.buf[Q]=c11[K],$=X,Z=G}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=T30)this.seqLo-=T30,this.seqHi+=1;if(this.seqHi>Zr||this.seqHi===Zr&&this.seqLo>=l11)this.setPre(),this.initSeqAndInc();this.fillSeq();let $=this.buf;return String.fromCharCode($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8],$[9],$[10],$[11],$[12],$[13],$[14],$[15],$[16],$[17],$[18],$[19],$[20],$[21])}reset(){this.init()}}wQ$.NuidImpl=m11;wQ$.nuid=new m11});var AQ$=b((PQ$)=>{Object.defineProperty(PQ$,"__esModule",{value:!0});PQ$.nuid=PQ$.Nuid=void 0;var zQ$=EQ$();PQ$.Nuid=zQ$.NuidImpl;PQ$.nuid=zQ$.nuid});var q30=b((R30)=>{Object.defineProperty(R30,"__esModule",{value:!0});R30.nuid=R30.Nuid=void 0;var RQ$=AQ$();Object.defineProperty(R30,"Nuid",{enumerable:!0,get:function(){return RQ$.Nuid}});Object.defineProperty(R30,"nuid",{enumerable:!0,get:function(){return RQ$.nuid}})});var Qw=b((qQ$)=>{Object.defineProperty(qQ$,"__esModule",{value:!0});qQ$.DEFAULT_HOST=qQ$.DEFAULT_PORT=qQ$.Match=void 0;qQ$.syncIterator=VH4;qQ$.createInbox=kH4;var MH4=q30(),IH4=vG();qQ$.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function VH4($){let Z=$[Symbol.asyncIterator]();return{async next(){let Q=await Z.next();if(Q.done)return Promise.resolve(null);return Promise.resolve(Q.value)}}}function kH4($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw IH4.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${MH4.nuid.next()}`}qQ$.DEFAULT_PORT=4222;qQ$.DEFAULT_HOST="127.0.0.1"});var Qr=b((kQ$)=>{Object.defineProperty(kQ$,"__esModule",{value:!0});kQ$.DataBuffer=void 0;var IQ$=_G();class VQ${buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}static fromAscii($){if(!$)$="";return IQ$.TE.encode($)}static toAscii($){return IQ$.TD.decode($)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let $=new Uint8Array(this.byteLength),Z=0;for(let Q=0;Q<this.buffers.length;Q++)$.set(this.buffers[Q],Z),Z+=this.buffers[Q].length;this.buffers.length=0,this.buffers.push($)}}shift(){if(this.buffers.length){let $=this.buffers.shift();if($)return this.byteLength-=$.length,$}return new Uint8Array(0)}drain($){if(this.buffers.length){this.pack();let Z=this.buffers.pop();if(Z){let Q=this.byteLength;if($===void 0||$>Q)$=Q;let X=Z.subarray(0,$);if(Q>$)this.buffers.push(Z.subarray($));return this.byteLength=Q-$,X}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let Q=0;Q<Z.length;Q++)if(Z[Q]&&Z[Q].length)this.buffers.push(Z[Q]),this.byteLength+=Z[Q].length}peek(){if(this.buffers.length)return this.pack(),this.buffers[0];return new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}kQ$.DataBuffer=VQ$});var NT=b((_Q$)=>{Object.defineProperty(_Q$,"__esModule",{value:!0});_Q$.LF=_Q$.CR=_Q$.CRLF=_Q$.CR_LF_LEN=_Q$.CR_LF=void 0;_Q$.setTransportFactory=yH4;_Q$.defaultPort=gH4;_Q$.getUrlParseFn=hH4;_Q$.newTransport=uH4;_Q$.getResolveFn=lH4;_Q$.protoLen=CQ$;_Q$.extractProtocolMessage=cH4;var xH4=_G(),fH4=Qw(),bH4=Qr(),xG;function yH4($){xG=$}function gH4(){return xG!==void 0&&xG.defaultPort!==void 0?xG.defaultPort:fH4.DEFAULT_PORT}function hH4(){return xG!==void 0&&xG.urlParseFn?xG.urlParseFn:void 0}function uH4(){if(!xG||typeof xG.factory!=="function")throw Error("transport fn is not set");return xG.factory()}function lH4(){return xG!==void 0&&xG.dnsResolveFn?xG.dnsResolveFn:void 0}_Q$.CR_LF=`\r
|
|
2108
|
+
`);X=J.pop()??"";for(let G of J){let K=Bun.stripANSI(G).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;sD({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:J,value:G}=await Z.read();if(J)break;X+=Q.decode(G,{stream:!0}),Y()}}catch{}if(X.trim()){let J=Bun.stripANSI(X).replace(/^\[\d+\]\s*/,"").trim();if(J)sD({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:J})}})()}async function oK4($){let{baseUrl:Z,noTui:Q}=$,X=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=X?process.env.PORT:$.vitePort,J=Z||`http://localhost:${Y}`,G=X?await ea(Number(Y)+1):await ea(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await N30({port:String(G),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)KT({name:D.name,status:"ready",port:D.port});ra();let F=tK4(import.meta.dir,"..","..","..","..",".."),U=Q===!0,N=Bun.spawn(["bun","run","dev:servers"],{cwd:F,env:{...process.env,PORT:String(K.port),VITE_PORT:String(Y),DATABASE_URL:K.databaseUrl,NATS_URL:K.natsUrls.join(","),NODE_ENV:K.nodeEnv,BASE_URL:J,DECOCMS_LOCAL_MODE:String(K.localMode),DECOCMS_HOME:K.dataDir,DATA_DIR:K.dataDir,DECO_CLI:"1",...K.betterAuthSecret?{BETTER_AUTH_SECRET:K.betterAuthSecret}:{},...K.s3Endpoint?{S3_ENDPOINT:K.s3Endpoint,S3_BUCKET:K.s3Bucket??"",S3_ACCESS_KEY_ID:K.s3AccessKeyId??"",S3_SECRET_ACCESS_KEY:K.s3SecretAccessKey??"",S3_FORCE_PATH_STYLE:String(K.s3ForcePathStyle)}:{},...K.natsCredsPath?{NATS_CREDS:K.natsCredsPath}:{}},stdio:["inherit",U?"inherit":"pipe",U?"inherit":"pipe"]});if(!U)P11(N.stdout),P11(N.stderr);sa(J),KT({name:"Vite",status:"ready",port:Number(Y)}),KT({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(N.kill(D),await N.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (BG0(),NG0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:N}}var A11=L(()=>{D11();WT();z11()});var O30;var R11=L(()=>{O30={name:"decocms",version:"4.393.2",description:"Deco CMS \u2014 Self-hostable MCP Gateway for managing AI connections and tools",author:"Deco team",repository:{type:"git",url:"git+https://github.com/decocms/studio.git",directory:"apps/api"},bugs:{url:"https://github.com/decocms/studio/issues"},type:"module",bin:{deco:"./dist/server/cli.js"},files:["dist/**/*"],scripts:{dev:"bun run migrate && bun run dev:server","dev:server":"bun run --cwd=../../packages/sandbox build && NODE_ENV=development bun --env-file=.env --hot run src/index.ts",build:"bun run build:server","build:server":"bun run scripts/bundle-server-script.ts --dist ./dist/server","generate:tool-contracts":"bun run scripts/generate-tool-contracts.ts","db:migrate":"bun run ./dist/server/migrate.js","db:migrate:dbos":"bun run ./dist/server/migrate-dbos.js",check:"tsc --noEmit",start:"bun run ./dist/server/server.js",migrate:"bun run src/database/migrate.ts","migrate:dbos":"bun run src/database/migrate-dbos.ts",test:"bun test src","better-auth:migrate":"bunx --bun @better-auth/cli migrate -y --config src/auth/index.ts",prepublishOnly:"bun run --cwd=../.. build:studio"},optionalDependencies:{"@duckdb/node-api":"^1.5.0-r.1"},dependencies:{"@ai-sdk/anthropic":"^4.0.58","@ai-sdk/google":"^4.0.76","@ai-sdk/openai":"^4.0.71","@anthropic-ai/sdk":"^0.105.0","@aws-sdk/client-s3":"^3.1013.0","@aws-sdk/client-sts":"^3.1013.0","@aws-sdk/lib-storage":"^3.1013.0","@aws-sdk/s3-request-presigner":"^3.1013.0","@clickhouse/client":"^1.8.1","@dbos-inc/dbos-sdk":"^4.21.6","@inkjs/ui":"^2.0.0","@nats-io/jetstream":"3.4.0","@nats-io/kv":"3.4.0","@nats-io/nats-core":"3.4.0","@nats-io/transport-node":"3.4.0","@openrouter/ai-sdk-provider":"^3.1.0","@opentelemetry/core":"^2.6.0","embedded-postgres":"^18.3.0-beta.16",ink:"^6.8.0",kysely:"^0.28.12","posthog-node":"^5.0.0",react:"^19.2.6","react-dom":"^19.2.6"},devDependencies:{"@ai-sdk/provider":"^4.0.17","@better-auth/sso":"1.4.1","@decocms/better-auth":"1.5.17","@decocms/bindings":"workspace:*","@decocms/mcp-utils":"workspace:*","@decocms/runtime":"workspace:*","@decocms/sandbox":"workspace:*","@decocms/shared":"workspace:*","@jitl/quickjs-wasmfile-release-sync":"0.31.0","@modelcontextprotocol/sdk":"1.29.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.211.0","@opentelemetry/exporter-logs-otlp-proto":"^0.211.0","@opentelemetry/exporter-prometheus":"^0.208.0","@opentelemetry/exporter-trace-otlp-proto":"^0.207.0","@opentelemetry/instrumentation-runtime-node":"^0.24.0","@opentelemetry/resources":"^2.6.0","@opentelemetry/sdk-logs":"^0.211.0","@opentelemetry/sdk-metrics":"^2.2.0","@opentelemetry/sdk-node":"^0.207.0","@opentelemetry/sdk-trace-base":"^2.5.0","@types/bun":"^1.3.1","@types/google.maps":"^3.65.2","@types/pg":"^8.15.6","@types/react-syntax-highlighter":"^15.5.13","@vercel/nft":"^1.1.1",ai:"^7.0.107","better-auth":"1.4.22",croner:"^9.1.0",degit:"^2.8.4",hono:"^4.10.7",jose:"^6.0.11",nanoid:"^5.1.6",pg:"^8.16.3",typescript:"^7.0.2",typescript5:"npm:typescript@^5.9.3",zod:"4.3.6"},homepage:"https://github.com/decocms/studio",keywords:["mcp","model-context-protocol","ai","gateway","self-hosted","tools"],license:"MIT",publishConfig:{access:"public"}}});import{Box as rK4,Text as _7$}from"ink";import{jsx as sK4,jsxs as v7$}from"react/jsx-runtime";function x7$({version:$}){return v7$(rK4,{flexDirection:"column",marginTop:1,children:[bG0.map((Z,Q)=>sK4(_7$,{color:yG0[Q],children:Z},Q)),v7$(_7$,{dimColor:!0,children:[" v",$]})]})}var f7$=L(()=>{fa()});import{Box as HT,Text as eD}from"ink";import{Spinner as eK4}from"@inkjs/ui";import{jsx as CG,jsxs as zl}from"react/jsx-runtime";function b7$({status:$}){if($==="pending")return CG(eK4,{label:""});return CG(eD,{color:"green",children:"\u2713"})}function $W4($){return`${$.name}: ${$.port||"...."}`}function y7$({services:$,migrationsStatus:Z,home:Q,serverUrl:X}){return zl(HT,{flexDirection:"column",paddingBottom:1,children:[CG(x7$,{version:O30.version}),CG(HT,{marginBottom:1,children:CG(eD,{dimColor:!0,children:"\u2500".repeat(80)})}),CG(HT,{children:zl(eD,{dimColor:!0,children:["Home: ",Q]})}),zl(HT,{gap:2,children:[$.map((Y)=>zl(HT,{gap:1,children:[CG(eD,{children:$W4(Y)}),CG(b7$,{status:Y.status})]},Y.name)),zl(HT,{gap:1,children:[CG(eD,{children:"Migrations"}),CG(b7$,{status:Z})]})]}),CG(HT,{children:X?zl(eD,{children:["Open in browser: ",CG(eD,{color:"cyan",children:X})]}):CG(eD,{dimColor:!0,children:"Starting..."})})]})}var g7$=L(()=>{R11();f7$()});import{Box as ZW4,Text as $r}from"ink";import{jsx as q11,jsxs as M11}from"react/jsx-runtime";function QW4($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function h7$({logs:$}){return q11(ZW4,{flexDirection:"column",children:$.map((Z,Q)=>{if(Z.rawLine)return q11($r,{dimColor:!0,children:Z.rawLine},Q);let X=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return M11($r,{children:[M11($r,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),q11($r,{color:QW4(Z.status),children:Z.status}),M11($r,{dimColor:!0,children:[" ",X.padStart(8)]})]},Q)})})}var u7$=()=>{};var I11={};K0(I11,{App:()=>JW4});import{Box as XW4}from"ink";import{useSyncExternalStore as YW4}from"react";import{jsx as l7$,jsxs as GW4}from"react/jsx-runtime";function JW4({home:$}){let Z=YW4(E11,j11);return GW4(XW4,{flexDirection:"column",children:[l7$(y7$,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),l7$(h7$,{logs:Z.logs})]})}var V11=L(()=>{g7$();u7$();WT()});var WK="thread-gate",fB="decopilot-hosted-harness",bB="decopilot-hosted-harness-sandboxed",HK="automations",$w="background-tools",FT="task-board-github-reads";var c7$="13";function m7$($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:c7$,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var d7$=()=>{};import KW4 from"pg";async function p7$($,Z){let{databaseUrl:Q,lockTimeoutMs:X=WW4}=$,Y=$.log??((W)=>console.log(W)),J=new KW4.Client({connectionString:Q});await J.connect();let G=Date.now(),K=!1;try{while(!K){if(K=(await J.query("SELECT pg_try_advisory_lock($1) AS locked",[i7$.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-G>=X)throw Error(`Timed out after ${X}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await k$(HW4)}let W=Date.now()-G;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await J.query("SELECT pg_advisory_unlock($1)",[i7$.toString()])}catch{}await J.end().catch(()=>{})}}var i7$=8314027461559302n,WW4=600000,HW4=500;var n7$=L(()=>{O8()});function FW4(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function k11($,Z){for(let Q=0;Q<$.length;Q++){let X=$[Q];if(X===void 0)continue;if(X===Z)return $[Q+1];if(X.startsWith(`${Z}=`))return X.slice(Z.length+1)}return}function t7$(){let $=FW4();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:k11($,"--cpu-prof-dir")??process.cwd(),name:k11($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(k11($,"--cpu-prof-interval")??1000),note:"profile is written on process exit"}));return}if(process.env.CPU_PROFILE)console.warn(JSON.stringify({msg:"cpu-profiling-requested-but-inactive",hint:'CPU profiling is a Bun launch flag. Set BUN_OPTIONS="--cpu-prof --cpu-prof-md --cpu-prof-dir=/tmp" before starting the process.'}))}function o7$(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let Q=XT();if(!Q)return;let X={};try{let{heapStats:Y}=await import("bun:jsc"),J=Y(),G=Object.entries(J.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);X={objectCount:J.objectCount,heapSize:J.heapSize,top:Object.fromEntries(G)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:Q.rss,heapUsed:Q.heapUsed,heapTotal:Q.heapTotal,external:Q.external,arrayBuffers:Q.arrayBuffers,...X}))};return Z().catch(()=>{}),D30=setInterval(()=>void Z().catch(()=>{}),$),D30.unref?.(),process.on("SIGUSR2",()=>{try{let Q=Bun.generateHeapSnapshot("v8"),X=typeof Q==="string"?Q:JSON.stringify(Q),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,X),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(Q){console.error("[heap-watch] snapshot failed:",Q)}}),()=>{if(D30)clearInterval(D30)}}var D30;var a7$=()=>{};import*as UW4 from"bun:jsc";function r7$(){if(process.env.STALL_WATCHDOG!=="1")return()=>{};let $=Number(process.env.STALL_WATCHDOG_MS??100),Z=Number(process.env.STALL_WATCHDOG_TICK_MS??50);try{NW4()}catch(J){return console.error("[stall-watchdog] failed to start sampling profiler:",J),()=>{}}let Q,X=performance.now()+Z,Y=()=>{let J=performance.now(),G=J-X;X=J+Z;let K=[];try{K=BW4()?.traces??[]}catch{}if(G>$&&K.length>0){let W=new Map;for(let F of K){let U=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!U)continue;let N=(U.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${U.name??"?"} @ ${N}:${U.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,U)=>U[1]-F[1]).slice(0,8).map(([F,U])=>({frame:F,count:U}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(G),samplesInWindow:K.length,top:H}))}Q=setTimeout(Y,Z),Q.unref?.()};return Q=setTimeout(Y,Z),Q.unref?.(),()=>{if(Q)clearTimeout(Q)}}var NW4,BW4;var s7$=L(()=>{({startSamplingProfiler:NW4,samplingProfilerStackTraces:BW4}=UW4)});function e7$(){t7$();let $=[o7$(),b4$(),r7$()];return()=>{for(let Z of $)Z()}}var $Q$=L(()=>{ja0();a7$();s7$()});var UT=b((ZQ$)=>{Object.defineProperty(ZQ$,"__esModule",{value:!0});ZQ$.RepublishHeaders=ZQ$.DirectMsgHeaders=ZQ$.JsHeaders=ZQ$.AdvisoryKind=void 0;ZQ$.isOrderedPushConsumerOptions=LW4;ZQ$.isPullConsumer=OW4;ZQ$.isPushConsumer=DW4;ZQ$.isBoundPushConsumerOptions=wW4;function LW4($){if($&&typeof $==="object")return"name_prefix"in $||"deliver_subject_prefix"in $||"filter_subjects"in $||"filter_subject"in $||"deliver_policy"in $||"opt_start_seq"in $||"opt_start_time"in $||"replay_policy"in $||"inactive_threshold"in $||"headers_only"in $||"deliver_prefix"in $;return!1}function OW4($){return $.isPullConsumer()}function DW4($){return $.isPushConsumer()}function wW4($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}ZQ$.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"};ZQ$.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"};ZQ$.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};ZQ$.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var _G=b((XQ$)=>{Object.defineProperty(XQ$,"__esModule",{value:!0});XQ$.TD=XQ$.TE=XQ$.Empty=void 0;XQ$.encode=MW4;XQ$.decode=IW4;XQ$.Empty=new Uint8Array(0);XQ$.TE=new TextEncoder;XQ$.TD=new TextDecoder;function qW4(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}function MW4(...$){let Z=[];for(let Q=0;Q<$.length;Q++)Z.push(XQ$.TE.encode($[Q]));if(Z.length===0)return XQ$.Empty;if(Z.length===1)return Z[0];return qW4(...Z)}function IW4($){if(!$||$.length===0)return"";return XQ$.TD.decode($)}});var vG=b((GQ$)=>{Object.defineProperty(GQ$,"__esModule",{value:!0});GQ$.errors=GQ$.PermissionViolationError=GQ$.NoRespondersError=GQ$.TimeoutError=GQ$.RequestError=GQ$.ProtocolError=GQ$.ConnectionError=GQ$.DrainingConnectionError=GQ$.ClosedConnectionError=GQ$.AuthorizationError=GQ$.UserAuthenticationExpiredError=GQ$.InvalidOperationError=GQ$.InvalidArgumentError=GQ$.InvalidSubjectError=void 0;class C11 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}GQ$.InvalidSubjectError=C11;class w30 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,Q){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((X)=>`'${X}'`),$=$.join(",");else $=`'${$}'`;return new w30(`${$} ${Z}`,Q)}}GQ$.InvalidArgumentError=w30;class _11 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}GQ$.InvalidOperationError=_11;class j30 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new j30($);return null}}GQ$.UserAuthenticationExpiredError=j30;class E30 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],Q=$.toLowerCase();for(let X=0;X<Z.length;X++)if(Q.indexOf(Z[X])!==-1)return new E30($);return null}}GQ$.AuthorizationError=E30;class v11 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}GQ$.ClosedConnectionError=v11;class x11 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}GQ$.DrainingConnectionError=x11;class f11 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}GQ$.ConnectionError=f11;class b11 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}GQ$.ProtocolError=b11;class y11 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof z30}}GQ$.RequestError=y11;class g11 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}GQ$.TimeoutError=g11;class z30 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}GQ$.NoRespondersError=z30;class P30 extends Error{operation;subject;queue;constructor($,Z,Q,X,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=Q,this.queue=X}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let Q="publish",X="",Y=void 0,J=$.match(/(Publish|Subscription) to "(\S+)"/);if(J){if(Q=J[1].toLowerCase(),X=J[2],Q==="subscription"){let G=$.match(/using queue "(\S+)"/);if(G)Y=G[1]}}return new P30($,Q,X,Y)}}GQ$.PermissionViolationError=P30;GQ$.errors={AuthorizationError:E30,ClosedConnectionError:v11,ConnectionError:f11,DrainingConnectionError:x11,InvalidArgumentError:w30,InvalidOperationError:_11,InvalidSubjectError:C11,NoRespondersError:z30,PermissionViolationError:P30,ProtocolError:b11,RequestError:y11,TimeoutError:g11,UserAuthenticationExpiredError:j30}});var iW=b((UQ$)=>{Object.defineProperty(UQ$,"__esModule",{value:!0});UQ$.SimpleMutex=UQ$.Perf=void 0;UQ$.extend=dW4;UQ$.render=iW4;UQ$.timeout=pW4;UQ$.delay=nW4;UQ$.deadline=tW4;UQ$.deferred=u11;UQ$.debugDeferred=oW4;UQ$.shuffle=aW4;UQ$.collect=rW4;UQ$.jitter=FQ$;UQ$.backoff=sW4;UQ$.nanos=eW4;UQ$.millis=$H4;UQ$.randomToken=XH4;var mW4=_G(),h11=vG();function dW4($,...Z){for(let Q=0;Q<Z.length;Q++){let X=Z[Q];Object.keys(X).forEach(function(Y){$[Y]=X[Y]})}return $}function iW4($){return mW4.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function pW4($,Z=!0){let Q=Z?new h11.TimeoutError:null,X,Y,J=new Promise((G,K)=>{X={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(Q===null)K(new h11.TimeoutError);else K(Q)},$)});return Object.assign(J,X)}function nW4($=0){let Z,Q=new Promise((X)=>{let Y=setTimeout(()=>{X()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),X()}}});return Object.assign(Q,Z)}async function tW4($,Z=1000){let Q=u11(),X=setTimeout(()=>{Q.reject(new h11.TimeoutError)},Z);try{return await Promise.race([$,Q])}finally{clearTimeout(X)}}function u11(){let $={},Z=new Promise((Q,X)=>{$={resolve:Q,reject:X}});return Object.assign(Z,$)}function oW4(){let $={},Z=new Promise((Q,X)=>{$={resolve:(Y)=>{console.trace("resolve",Y),Q(Y)},reject:(Y)=>{console.trace("reject"),X(Y)}}});return Object.assign(Z,$)}function aW4($){for(let Z=$.length-1;Z>0;Z--){let Q=Math.floor(Math.random()*(Z+1));[$[Z],$[Q]]=[$[Q],$[Z]]}return $}async function rW4($){let Z=[];for await(let Q of $)Z.push(Q);return Z}class WQ${timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,Q){let X=this.timers.get(Z);if(X===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(Q);if(Y===void 0)throw Error(`${Q} is not defined`);this.measures.set($,Y-X)}getEntries(){let $=[];return this.measures.forEach((Z,Q)=>{$.push({name:Q,duration:Z})}),$}}UQ$.Perf=WQ$;class HQ${max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=u11();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}UQ$.SimpleMutex=HQ$;function FQ$($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function sW4($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(Q){return FQ$(Q>Z?$[Z]:$[Q])}}}function eW4($){return $*1e6}function $H4($){return Math.floor($/1e6)}var ZH4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",yB=new Uint8Array(62);for(let $=0;$<62;$++)yB[$]=ZH4.charCodeAt($);var QH4=218340105584896;function XH4(){let $=Math.floor(Math.random()*QH4),Z=$%62,Q=yB[Z];$=($-Z)/62,Z=$%62;let X=yB[Z];$=($-Z)/62,Z=$%62;let Y=yB[Z];$=($-Z)/62,Z=$%62;let J=yB[Z];$=($-Z)/62,Z=$%62;let G=yB[Z];$=($-Z)/62,Z=$%62;let K=yB[Z];$=($-Z)/62,Z=$%62;let W=yB[Z];$=($-Z)/62;let H=yB[$];return String.fromCharCode(Q,X,Y,J,G,K,W,H)}});var EQ$=b((wQ$)=>{Object.defineProperty(wQ$,"__esModule",{value:!0});wQ$.nuid=wQ$.NuidImpl=void 0;var EH4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Zw=62,A30=12,OQ$=10,BQ$=33,zH4=333,LQ$=A30+OQ$,c11=new Uint8Array(Zw);for(let $=0;$<Zw;$++)c11[$]=EH4.charCodeAt($);var T30=4294967296,DQ$=BigInt(Zw)**BigInt(OQ$),Zr=Number(DQ$/(1n<<32n)),l11=Number(DQ$%(1n<<32n));function PH4($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function TH4($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else PH4($)}class m11{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(LQ$),this.cbuf=new Uint8Array(A30),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(Zr+1)),this.seqLo=Math.floor(Math.random()*T30);while($++<8&&this.seqHi===Zr&&this.seqLo>=l11);if(this.seqHi===Zr&&this.seqLo>=l11)this.seqLo=0;this.inc=Math.random()*(zH4-BQ$)+BQ$|0}setPre(){TH4(this.cbuf);for(let $=0;$<A30;$++)this.buf[$]=c11[this.cbuf[$]%Zw]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let Q=LQ$-1;Q>=A30;Q--){let X=Math.floor($/Zw),J=($-X*Zw)*T30+Z,G=Math.floor(J/Zw),K=J-G*Zw;this.buf[Q]=c11[K],$=X,Z=G}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=T30)this.seqLo-=T30,this.seqHi+=1;if(this.seqHi>Zr||this.seqHi===Zr&&this.seqLo>=l11)this.setPre(),this.initSeqAndInc();this.fillSeq();let $=this.buf;return String.fromCharCode($[0],$[1],$[2],$[3],$[4],$[5],$[6],$[7],$[8],$[9],$[10],$[11],$[12],$[13],$[14],$[15],$[16],$[17],$[18],$[19],$[20],$[21])}reset(){this.init()}}wQ$.NuidImpl=m11;wQ$.nuid=new m11});var AQ$=b((PQ$)=>{Object.defineProperty(PQ$,"__esModule",{value:!0});PQ$.nuid=PQ$.Nuid=void 0;var zQ$=EQ$();PQ$.Nuid=zQ$.NuidImpl;PQ$.nuid=zQ$.nuid});var q30=b((R30)=>{Object.defineProperty(R30,"__esModule",{value:!0});R30.nuid=R30.Nuid=void 0;var RQ$=AQ$();Object.defineProperty(R30,"Nuid",{enumerable:!0,get:function(){return RQ$.Nuid}});Object.defineProperty(R30,"nuid",{enumerable:!0,get:function(){return RQ$.nuid}})});var Qw=b((qQ$)=>{Object.defineProperty(qQ$,"__esModule",{value:!0});qQ$.DEFAULT_HOST=qQ$.DEFAULT_PORT=qQ$.Match=void 0;qQ$.syncIterator=VH4;qQ$.createInbox=kH4;var MH4=q30(),IH4=vG();qQ$.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function VH4($){let Z=$[Symbol.asyncIterator]();return{async next(){let Q=await Z.next();if(Q.done)return Promise.resolve(null);return Promise.resolve(Q.value)}}}function kH4($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw IH4.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${MH4.nuid.next()}`}qQ$.DEFAULT_PORT=4222;qQ$.DEFAULT_HOST="127.0.0.1"});var Qr=b((kQ$)=>{Object.defineProperty(kQ$,"__esModule",{value:!0});kQ$.DataBuffer=void 0;var IQ$=_G();class VQ${buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let Q=new Uint8Array(Z),X=0;for(let Y=0;Y<$.length;Y++)Q.set($[Y],X),X+=$[Y].length;return Q}static fromAscii($){if(!$)$="";return IQ$.TE.encode($)}static toAscii($){return IQ$.TD.decode($)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let $=new Uint8Array(this.byteLength),Z=0;for(let Q=0;Q<this.buffers.length;Q++)$.set(this.buffers[Q],Z),Z+=this.buffers[Q].length;this.buffers.length=0,this.buffers.push($)}}shift(){if(this.buffers.length){let $=this.buffers.shift();if($)return this.byteLength-=$.length,$}return new Uint8Array(0)}drain($){if(this.buffers.length){this.pack();let Z=this.buffers.pop();if(Z){let Q=this.byteLength;if($===void 0||$>Q)$=Q;let X=Z.subarray(0,$);if(Q>$)this.buffers.push(Z.subarray($));return this.byteLength=Q-$,X}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let Q=0;Q<Z.length;Q++)if(Z[Q]&&Z[Q].length)this.buffers.push(Z[Q]),this.byteLength+=Z[Q].length}peek(){if(this.buffers.length)return this.pack(),this.buffers[0];return new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}}kQ$.DataBuffer=VQ$});var NT=b((_Q$)=>{Object.defineProperty(_Q$,"__esModule",{value:!0});_Q$.LF=_Q$.CR=_Q$.CRLF=_Q$.CR_LF_LEN=_Q$.CR_LF=void 0;_Q$.setTransportFactory=yH4;_Q$.defaultPort=gH4;_Q$.getUrlParseFn=hH4;_Q$.newTransport=uH4;_Q$.getResolveFn=lH4;_Q$.protoLen=CQ$;_Q$.extractProtocolMessage=cH4;var xH4=_G(),fH4=Qw(),bH4=Qr(),xG;function yH4($){xG=$}function gH4(){return xG!==void 0&&xG.defaultPort!==void 0?xG.defaultPort:fH4.DEFAULT_PORT}function hH4(){return xG!==void 0&&xG.urlParseFn?xG.urlParseFn:void 0}function uH4(){if(!xG||typeof xG.factory!=="function")throw Error("transport fn is not set");return xG.factory()}function lH4(){return xG!==void 0&&xG.dnsResolveFn?xG.dnsResolveFn:void 0}_Q$.CR_LF=`\r
|
|
2109
2109
|
`;_Q$.CR_LF_LEN=_Q$.CR_LF.length;_Q$.CRLF=bH4.DataBuffer.fromAscii(_Q$.CR_LF);_Q$.CR=new Uint8Array(_Q$.CRLF)[0];_Q$.LF=new Uint8Array(_Q$.CRLF)[1];function CQ$($){for(let Z=0;Z<$.length;Z++){let Q=Z+1;if($.byteLength>Q&&$[Z]===_Q$.CR&&$[Q]===_Q$.LF)return Q+1}return 0}function cH4($){let Z=CQ$($);if(Z>0){let X=new Uint8Array($).slice(0,Z);return xH4.TD.decode(X)}return""}});var t11=b((uQ$)=>{Object.defineProperty(uQ$,"__esModule",{value:!0});uQ$.ipV4=yQ$;uQ$.isIP=eH4;uQ$.parseIP=gQ$;var Xr=4,BT=16,M30=48,bQ$=57,xQ$=65,rH4=70,fQ$=97,sH4=102,n11=16777215;function yQ$($,Z,Q,X){let Y=new Uint8Array(BT);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((G,K)=>{Y[K]=G}),Y[12]=$,Y[13]=Z,Y[14]=Q,Y[15]=X,Y}function eH4($){return gQ$($)!==void 0}function gQ$($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return hQ$($);case":":return $F4($)}return}function hQ$($){let Z=new Uint8Array(Xr);for(let Q=0;Q<Xr;Q++){if($.length===0)return;if(Q>0){if($[0]!==".")return;$=$.substring(1)}let{n:X,c:Y,ok:J}=ZF4($);if(!J||X>255)return;$=$.substring(Y),Z[Q]=X}return yQ$(Z[0],Z[1],Z[2],Z[3])}function $F4($){let Z=new Uint8Array(BT),Q=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(Q=0,$=$.substring(2),$.length===0)return Z}let X=0;while(X<BT){let{n:Y,c:J,ok:G}=QF4($);if(!G||Y>65535)return;if(J<$.length&&$[J]==="."){if(Q<0&&X!=BT-Xr)return;if(X+Xr>BT)return;let K=hQ$($);if(K===void 0)return;Z[X]=K[12],Z[X+1]=K[13],Z[X+2]=K[14],Z[X+3]=K[15],$="",X+=Xr;break}if(Z[X]=Y>>8,Z[X+1]=Y,X+=2,$=$.substring(J),$.length===0)break;if($[0]!==":"||$.length==1)return;if($=$.substring(1),$[0]===":"){if(Q>=0)return;if(Q=X,$=$.substring(1),$.length===0)break}}if($.length!==0)return;if(X<BT){if(Q<0)return;let Y=BT-X;for(let J=X-1;J>=Q;J--)Z[J+Y]=Z[J];for(let J=Q+Y-1;J>=Q;J--)Z[J]=0}else if(Q>=0)return;return Z}function ZF4($){let Z=0,Q=0;for(Z=0;Z<$.length&&M30<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=bQ$;Z++)if(Q=Q*10+($.charCodeAt(Z)-M30),Q>=n11)return{n:n11,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:Q,c:Z,ok:!0}}function QF4($){let Z=0,Q=0;for(Q=0;Q<$.length;Q++){if(M30<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=bQ$)Z*=16,Z+=$.charCodeAt(Q)-M30;else if(fQ$<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=sH4)Z*=16,Z+=$.charCodeAt(Q)-fQ$+10;else if(xQ$<=$.charCodeAt(Q)&&$.charCodeAt(Q)<=rH4)Z*=16,Z+=$.charCodeAt(Q)-xQ$+10;else break;if(Z>=n11)return{n:0,c:Q,ok:!1}}if(Q===0)return{n:0,c:Q,ok:!1};return{n:Z,c:Q,ok:!0}}});var $$1=b((cQ$)=>{Object.defineProperty(cQ$,"__esModule",{value:!0});cQ$.Servers=cQ$.ServerImpl=void 0;cQ$.isIPV4OrHostname=lQ$;cQ$.hostPort=e11;var o11=NT(),a11=iW(),r11=t11(),GF4=Qw(),KF4=vG();function lQ$($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function s11($){return!lQ$($)}function WF4($){let Q=$.toUpperCase().indexOf("::FFFF:");if(Q!==-1&&$.indexOf(".")!==-1){let X=$.substring(Q+7);return X=X.replace("[",""),X.replace("]","")}return $}function e11($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=WF4($),s11($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=s11($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),Q=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):GF4.DEFAULT_PORT,Y=new URL(`${Q===80?"https":"http"}://${$}`);Y.port=`${Q}`;let J=Y.hostname;if(J.charAt(0)==="[")J=J.substring(1,J.length-1);return{listen:Y.host,hostname:J,port:Q}}class Pl{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let Q=e11($);this.listen=Q.listen,this.hostname=Q.hostname,this.port=Q.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=Z}toString(){return this.listen}async resolve($){if(!$.fn||$.resolve===!1)return[this];let Z=[];if((0,r11.isIP)(this.hostname))return[this];else{let Q=await $.fn(this.hostname);if($.debug)console.log(`resolve ${this.hostname} = ${Q.join(",")}`);for(let X of Q){let Y=this.port===80?"https":"http",J=new URL(`${Y}://${s11(X)?"["+X+"]":X}`);J.port=`${this.port}`;let G=new Pl(J.host,!1);G.tlsName=this.hostname,Z.push(G)}}if($.randomize)(0,a11.shuffle)(Z);return this.resolves=Z,Z}}cQ$.ServerImpl=Pl;class I30{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw KF4.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,o11.getUrlParseFn)(),Q=new Map;for(let Y of this.servers)Q.set(Y.listen,Y);let X=[];for(let Y of $){Y=Z?Z(Y):Y;let{listen:J}=e11(Y),G=Q.get(J);if(G)G.gossiped=!1,X.push(G);else X.push(new Pl(Y))}if(this.randomize)(0,a11.shuffle)(X);if(this.servers=X,this.currentServer===void 0||!X.includes(this.currentServer))this.currentServer=X[0],this.firstSelect=!0}clear(){this.servers.length=0}updateTLSName(){let $=this.getCurrentServer();if(!(0,r11.isIP)($.hostname))this.tlsName=$.hostname,this.servers.forEach((Z)=>{if(Z.gossiped)Z.tlsName=this.tlsName})}getCurrentServer(){return this.currentServer}addServer($,Z=!1){let Q=(0,o11.getUrlParseFn)();$=Q?Q($):$;let X=new Pl($,Z);if((0,r11.isIP)(X.hostname))X.tlsName=this.tlsName;this.servers.push(X)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;let $=this.servers.shift();if($)this.servers.push($),this.currentServer=$;return $}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer($){if($){let Z=this.servers.indexOf($);this.servers.splice(Z,1)}}snapshot(){return I30.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return I30.freezeAll([$,...this.servers.slice(0,Z),...this.servers.slice(Z+1)])}static freezeAll($){return $.map((Z)=>Object.freeze({hostname:Z.hostname,port:Z.port,listen:Z.listen,src:Z.src,tlsName:Z.tlsName,reconnects:Z.reconnects,lastConnect:Z.lastConnect,gossiped:Z.gossiped,didConnect:Z.didConnect}))}find($){return this.servers.find((Z)=>Z.listen===$.listen)}setCurrent($){this.currentServer=$}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update($,Z){let Q=[],X=[],Y=(0,o11.getUrlParseFn)(),J=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new Pl(K,!0);J.set(K,W)});let G=[];if(this.servers.forEach((K,W)=>{let H=K.listen;if(K.gossiped&&this.currentServer.listen!==H&&J.get(H)===void 0)G.push(W);J.delete(H)}),G.reverse(),G.forEach((K)=>{let W=this.servers.splice(K,1);X=X.concat(W[0].listen)}),J.forEach((K,W)=>{this.servers.push(K),Q.push(W)}),this.randomize&&Q.length>0){let K=this.currentServer,W=this.servers.filter((H)=>H!==K);(0,a11.shuffle)(W),this.servers=K?[K,...W]:W}return{added:Q,deleted:X}}}cQ$.Servers=I30});var V30=b((pQ$)=>{Object.defineProperty(pQ$,"__esModule",{value:!0});pQ$.QueuedIteratorImpl=void 0;var Z$1=iW(),dQ$=vG();class iQ${inflight;processed;received;noIterator;iterClosed;done;signal;yields;filtered;pendingFiltered;ctx;_data;err;time;profile;yielding;didBreak;constructor(){this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=(0,Z$1.deferred)(),this.yields=[],this.iterClosed=(0,Z$1.deferred)(),this.time=0,this.yielding=!1,this.didBreak=!1,this.profile=!1}[Symbol.asyncIterator](){return this.iterate()}push($){if(this.done)return;if(this.didBreak){if(typeof $==="function"){let Z=$;try{Z()}catch(Q){}}return}if(typeof $==="function")this.pendingFiltered++;this.yields.push($),this.signal.resolve()}async*iterate(){if(this.noIterator)throw new dQ$.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new dQ$.InvalidOperationError("iterator is already yielding");this.yielding=!0;try{while(!0){if(this.yields.length===0)await this.signal;if(this.err)throw this.err;let $=this.yields;this.inflight=$.length,this.yields=[];for(let Z=0;Z<$.length;Z++){if(typeof $[Z]==="function"){this.pendingFiltered--;let X=$[Z];try{X()}catch(Y){throw Y}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let Q=this.profile?Date.now():0;yield $[Z],this.time=this.profile?Date.now()-Q:0}if(this.done)break;else if(this.yields.length===0)$.length=0,this.yields=$,this.signal=(0,Z$1.deferred)()}}finally{this.didBreak=!0,this.stop()}}stop($){if(this.done)return;this.err=$,this.done=!0,this.signal.resolve(),this.iterClosed.resolve($)}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}pQ$.QueuedIteratorImpl=iQ$});var Q$1=b((aQ$)=>{Object.defineProperty(aQ$,"__esModule",{value:!0});aQ$.MuxSubscription=void 0;var NF4=Qw(),tQ$=vG();class oQ${baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,NF4.createInbox)($)}.`,this.baseInbox}add($){if(!isNaN($.received))$.received=0;this.reqs.set($.token,$)}get($){return this.reqs.get($)}cancel($){this.reqs.delete($.token)}getToken($){let Z=$.subject||"";if(Z.indexOf(this.baseInbox)===0)return Z.substring(this.baseInbox.length);return null}all(){return Array.from(this.reqs.values())}handleError($,Z){if($)return this.all().forEach((Q)=>{Q.resolver(Z,{})}),!0;if(Z.operation==="publish"){let Q=this.all().find((X)=>{return X.requestSubject===Z.subject});if(Q)return Q.resolver(Z,{}),!0}return!1}dispatcher(){return($,Z)=>{let Q=this.getToken(Z);if(Q){let X=this.get(Q);if(X){if($===null)$=Z?.data?.length===0&&Z.headers?.code===503?new tQ$.NoRespondersError(X.requestSubject):null;X.resolver($,Z)}}}}close(){let $=new tQ$.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}aQ$.MuxSubscription=oQ$});var X$1=b((eQ$)=>{Object.defineProperty(eQ$,"__esModule",{value:!0});eQ$.Heartbeat=void 0;var BF4=iW();class sQ${ph;interval;maxOut;timer;pendings;constructor($,Z,Q){this.ph=$,this.interval=Z,this.maxOut=Q,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel($){if(this.timer)clearTimeout(this.timer),this.timer=void 0;if(this._reset(),$)this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:"ping",pendingPings:this.pendings.length+1}),this.pendings.length===this.maxOut){this.cancel(!0);return}let $=(0,BF4.deferred)();this.ph.flush($).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push($),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(($)=>{return $.resolve(),!1})}}eQ$.Heartbeat=sQ$});var G$1=b((YX$)=>{Object.defineProperty(YX$,"__esModule",{value:!0});YX$.DenoBuffer=YX$.MAX_SIZE=YX$.AssertionError=void 0;YX$.assert=QX$;YX$.concat=XX$;YX$.append=OF4;YX$.readAll=DF4;YX$.writeAll=wF4;var LF4=_G();class Y$1 extends Error{constructor($){super($);this.name="AssertionError"}}YX$.AssertionError=Y$1;function QX$($,Z="Assertion failed."){if(!$)throw new Y$1(Z)}var ZX$=32768;YX$.MAX_SIZE=4294967294;function k30($,Z,Q=0){let X=Z.byteLength-Q;if($.byteLength>X)$=$.subarray(0,X);return Z.set($,Q),$.byteLength}function XX$($,Z){if($===void 0&&Z===void 0)return new Uint8Array(0);if($===void 0)return Z;if(Z===void 0)return $;let Q=new Uint8Array($.length+Z.length);return Q.set($,0),Q.set(Z,$.length),Q}function OF4($,Z){return XX$($,Uint8Array.of(Z))}class J$1{_buf;_off;constructor($){if(this._off=0,$==null){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array($)}bytes($={copy:!0}){if($.copy===!1)return this._buf.subarray(this._off);return this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate($){if($===0){this.reset();return}if($<0||$>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+$)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice($){let Z=this._buf.byteLength;if($<=this.capacity-Z)return this._reslice(Z+$),Z;return-1}_reslice($){QX$($<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,$)}readByte(){let $=new Uint8Array(1);if(this.read($))return $[0];return null}read($){if(this.empty()){if(this.reset(),$.byteLength===0)return 0;return null}let Z=k30(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(LF4.TE.encode($))}write($){let Z=this._grow($.byteLength);return k30($,this._buf,Z)}_grow($){let Z=this.length;if(Z===0&&this._off!==0)this.reset();let Q=this._tryGrowByReslice($);if(Q>=0)return Q;let X=this.capacity;if($<=Math.floor(X/2)-Z)k30(this._buf.subarray(this._off),this._buf);else if(X+$>YX$.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*X+$,YX$.MAX_SIZE));k30(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,YX$.MAX_SIZE)),Z}grow($){if($<0)throw Error("Buffer._grow: negative count");let Z=this._grow($);this._reslice(Z)}readFrom($){let Z=0,Q=new Uint8Array(ZX$);while(!0){let X=this.capacity-this.length<ZX$,Y=X?Q:new Uint8Array(this._buf.buffer,this.length),J=$.read(Y);if(J===null)return Z;if(X)this.write(Y.subarray(0,J));else this._reslice(this.length+J);Z+=J}}}YX$.DenoBuffer=J$1;function DF4($){let Z=new J$1;return Z.readFrom($),Z.bytes()}function wF4($,Z){let Q=0;while(Q<Z.length)Q+=$.write(Z.subarray(Q))}});var H$1=b((HX$)=>{Object.defineProperty(HX$,"__esModule",{value:!0});HX$.cc=HX$.State=HX$.Parser=HX$.Kind=void 0;HX$.describe=RF4;var K$1=G$1(),W$1=_G();HX$.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function RF4($){let Z,Q="";switch($.kind){case HX$.Kind.MSG:Z="MSG";break;case HX$.Kind.OK:Z="OK";break;case HX$.Kind.ERR:Z="ERR",Q=W$1.TD.decode($.data);break;case HX$.Kind.PING:Z="PING";break;case HX$.Kind.PONG:Z="PONG";break;case HX$.Kind.INFO:Z="INFO",Q=W$1.TD.decode($.data)}return`${Z}: ${Q}`}function GX$(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var KX$=48,qF4=57,Tl=67108864;class WX${dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=HX$.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse($){let Z;for(Z=0;Z<$.length;Z++){let Q=$[Z];switch(this.state){case HX$.State.OP_START:switch(Q){case HX$.cc.M:case HX$.cc.m:this.state=HX$.State.OP_M,this.hdr=-1,this.ma=GX$();break;case HX$.cc.H:case HX$.cc.h:this.state=HX$.State.OP_H,this.hdr=0,this.ma=GX$();break;case HX$.cc.P:case HX$.cc.p:this.state=HX$.State.OP_P;break;case HX$.cc.PLUS:this.state=HX$.State.OP_PLUS;break;case HX$.cc.MINUS:this.state=HX$.State.OP_MINUS;break;case HX$.cc.I:case HX$.cc.i:this.state=HX$.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_H:switch(Q){case HX$.cc.M:case HX$.cc.m:this.state=HX$.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_M:switch(Q){case HX$.cc.S:case HX$.cc.s:this.state=HX$.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_MS:switch(Q){case HX$.cc.G:case HX$.cc.g:this.state=HX$.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_MSG:switch(Q){case HX$.cc.SPACE:case HX$.cc.TAB:this.state=HX$.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_MSG_SPC:switch(Q){case HX$.cc.SPACE:case HX$.cc.TAB:continue;default:this.state=HX$.State.MSG_ARG,this.as=Z}break;case HX$.State.MSG_ARG:switch(Q){case HX$.cc.CR:this.drop=1;break;case HX$.cc.NL:{let X=this.argBuf?this.argBuf.bytes():$.subarray(this.as,Z-this.drop);this.processMsgArgs(X),this.drop=0,this.as=Z+1,this.state=HX$.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;case HX$.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let X=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:HX$.Kind.MSG,msg:this.ma,data:X}),this.argBuf=void 0,this.msgBuf=void 0,this.state=HX$.State.MSG_END}else{let X=this.ma.size-this.msgBuf.length,Y=$.length-Z;if(Y<X)X=Y;if(X>0)this.msgBuf.write($.subarray(Z,Z+X)),Z=Z+X-1;else this.msgBuf.writeByte(Q)}else if(Z-this.as>=this.ma.size)this.dispatcher.push({kind:HX$.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=HX$.State.MSG_END;break;case HX$.State.MSG_END:switch(Q){case HX$.cc.NL:this.drop=0,this.as=Z+1,this.state=HX$.State.OP_START;break;default:continue}break;case HX$.State.OP_PLUS:switch(Q){case HX$.cc.O:case HX$.cc.o:this.state=HX$.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_PLUS_O:switch(Q){case HX$.cc.K:case HX$.cc.k:this.state=HX$.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_PLUS_OK:switch(Q){case HX$.cc.NL:this.dispatcher.push({kind:HX$.Kind.OK}),this.drop=0,this.state=HX$.State.OP_START;break}break;case HX$.State.OP_MINUS:switch(Q){case HX$.cc.E:case HX$.cc.e:this.state=HX$.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_MINUS_E:switch(Q){case HX$.cc.R:case HX$.cc.r:this.state=HX$.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_MINUS_ER:switch(Q){case HX$.cc.R:case HX$.cc.r:this.state=HX$.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_MINUS_ERR:switch(Q){case HX$.cc.SPACE:case HX$.cc.TAB:this.state=HX$.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_MINUS_ERR_SPC:switch(Q){case HX$.cc.SPACE:case HX$.cc.TAB:continue;default:this.state=HX$.State.MINUS_ERR_ARG,this.as=Z}break;case HX$.State.MINUS_ERR_ARG:switch(Q){case HX$.cc.CR:this.drop=1;break;case HX$.cc.NL:{let X;if(this.argBuf)X=this.argBuf.bytes(),this.argBuf=void 0;else X=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:HX$.Kind.ERR,data:X}),this.drop=0,this.as=Z+1,this.state=HX$.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(Q))}break;case HX$.State.OP_P:switch(Q){case HX$.cc.I:case HX$.cc.i:this.state=HX$.State.OP_PI;break;case HX$.cc.O:case HX$.cc.o:this.state=HX$.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_PO:switch(Q){case HX$.cc.N:case HX$.cc.n:this.state=HX$.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_PON:switch(Q){case HX$.cc.G:case HX$.cc.g:this.state=HX$.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_PONG:switch(Q){case HX$.cc.NL:this.dispatcher.push({kind:HX$.Kind.PONG}),this.drop=0,this.state=HX$.State.OP_START;break}break;case HX$.State.OP_PI:switch(Q){case HX$.cc.N:case HX$.cc.n:this.state=HX$.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_PIN:switch(Q){case HX$.cc.G:case HX$.cc.g:this.state=HX$.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_PING:switch(Q){case HX$.cc.NL:this.dispatcher.push({kind:HX$.Kind.PING}),this.drop=0,this.state=HX$.State.OP_START;break}break;case HX$.State.OP_I:switch(Q){case HX$.cc.N:case HX$.cc.n:this.state=HX$.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_IN:switch(Q){case HX$.cc.F:case HX$.cc.f:this.state=HX$.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_INF:switch(Q){case HX$.cc.O:case HX$.cc.o:this.state=HX$.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_INFO:switch(Q){case HX$.cc.SPACE:case HX$.cc.TAB:this.state=HX$.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case HX$.State.OP_INFO_SPC:switch(Q){case HX$.cc.SPACE:case HX$.cc.TAB:continue;default:this.state=HX$.State.INFO_ARG,this.as=Z}break;case HX$.State.INFO_ARG:switch(Q){case HX$.cc.CR:this.drop=1;break;case HX$.cc.NL:{let X;if(this.argBuf)X=this.argBuf.bytes(),this.argBuf=void 0;else X=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:HX$.Kind.INFO,data:X}),this.drop=0,this.as=Z+1,this.state=HX$.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(Q)}break;default:throw this.fail($.subarray(Z))}}if((this.state===HX$.State.MSG_ARG||this.state===HX$.State.MINUS_ERR_ARG||this.state===HX$.State.INFO_ARG)&&!this.argBuf)this.argBuf=new K$1.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===HX$.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new K$1.DenoBuffer($.subarray(this.as))}}cloneMsgArg(){let $=this.ma.subject.length,Z=this.ma.reply?this.ma.reply.length:0,Q=new Uint8Array($+Z);if(Q.set(this.ma.subject),this.ma.reply)Q.set(this.ma.reply,$);if(this.argBuf=new K$1.DenoBuffer(Q),this.ma.subject=Q.subarray(0,$),this.ma.reply)this.ma.reply=Q.subarray($)}processMsgArgs($){if(this.hdr>=0)return this.processHeaderMsgArgs($);let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case HX$.cc.SPACE:case HX$.cc.TAB:case HX$.cc.CR:case HX$.cc.NL:if(Q>=0)Z.push($.subarray(Q,X)),Q=-1;break;default:if(Q<0)Q=X}if(Q>=0)Z.push($.subarray(Q));switch(Z.length){case 3:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(Z[2],Tl);break;case 4:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=Z[2],this.ma.size=this.protoParseInt(Z[3],Tl);break;default:throw this.fail($,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail($,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail($,"processMsgArgs Bad or Missing Size Error")}fail($,Z=""){if(!Z)Z=`parse error [${this.state}]`;else Z=`${Z} [${this.state}]`;return Error(`${Z}: ${W$1.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],Q=-1;for(let X=0;X<$.length;X++)switch($[X]){case HX$.cc.SPACE:case HX$.cc.TAB:case HX$.cc.CR:case HX$.cc.NL:if(Q>=0)Z.push($.subarray(Q,X)),Q=-1;break;default:if(Q<0)Q=X}if(Q>=0)Z.push($.subarray(Q));switch(Z.length){case 4:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(Z[2],Tl),this.ma.size=this.protoParseInt(Z[3],Tl);break;case 5:this.ma.subject=Z[0],this.ma.sid=this.protoParseInt(Z[1]),this.ma.reply=Z[2],this.ma.hdr=this.protoParseInt(Z[3],Tl),this.ma.size=this.protoParseInt(Z[4],Tl);break;default:throw this.fail($,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail($,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail($,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail($,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt($,Z){if($.length===0||$.length>15)return-1;let Q=0;for(let X=0;X<$.length;X++){if($[X]<KX$||$[X]>qF4)return-1;Q=Q*10+($[X]-KX$)}return Z!==void 0&&Q>Z?-1:Q}}HX$.Parser=WX$;HX$.State={OP_START:0,OP_PLUS:1,OP_PLUS_O:2,OP_PLUS_OK:3,OP_MINUS:4,OP_MINUS_E:5,OP_MINUS_ER:6,OP_MINUS_ERR:7,OP_MINUS_ERR_SPC:8,MINUS_ERR_ARG:9,OP_M:10,OP_MS:11,OP_MSG:12,OP_MSG_SPC:13,MSG_ARG:14,MSG_PAYLOAD:15,MSG_END:16,OP_H:17,OP_P:18,OP_PI:19,OP_PIN:20,OP_PING:21,OP_PO:22,OP_PON:23,OP_PONG:24,OP_I:25,OP_IN:26,OP_INF:27,OP_INFO:28,OP_INFO_SPC:29,INFO_ARG:30};HX$.cc={CR:13,E:69,e:101,F:70,f:102,G:71,g:103,H:72,h:104,I:73,i:105,K:75,k:107,M:77,m:109,MINUS:45,N:78,n:110,NL:10,O:79,o:111,P:80,p:112,PLUS:43,R:82,r:114,S:83,s:115,SPACE:32,TAB:9}});var _30=b((UX$)=>{Object.defineProperty(UX$,"__esModule",{value:!0});UX$.MsgHdrsImpl=void 0;UX$.canonicalMIMEHeaderKey=U$1;UX$.headers=VF4;var FX$=_G(),pW=Qw(),C30=vG();function U$1($){let F=!0,U=Array($.length);for(let N=0;N<$.length;N++){let B=$.charCodeAt(N);if(B===58||B<33||B>126)throw C30.InvalidArgumentError.format("header",`'${$[N]}' is not a valid character in a header name`);if(F&&97<=B&&B<=122)B-=32;else if(!F&&65<=B&&B<=90)B+=32;U[N]=B,F=B==45}return String.fromCharCode(...U)}function VF4($=0,Z=""){if($===0&&Z!=="")throw C30.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw C30.InvalidArgumentError.format("description","is required");return new Al($,Z)}var F$1="NATS/1.0";class Al{_code;headers;_description;constructor($=0,Z=""){this._code=$,this._description=Z,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals($){if($&&this.headers.size===$.headers.size&&this._code===$._code){for(let[Z,Q]of this.headers){let X=$.values(Z);if(Q.length!==X.length)return!1;let Y=[...Q].sort(),J=[...X].sort();for(let G=0;G<Y.length;G++)if(Y[G]!==J[G])return!1}return!0}return!1}static decode($){let Z=new Al,X=FX$.TD.decode($).split(`\r
|
|
2110
2110
|
`),Y=X[0];if(Y!==F$1){let J=Y.replace(F$1,"").trim();if(J.length>0){if(Z._code=parseInt(J,10),isNaN(Z._code))Z._code=0;let G=Z._code.toString();J=J.replace(G,""),Z._description=J.trim()}}if(X.length>=1)X.slice(1).map((J)=>{if(J){let G=J.indexOf(":");if(G>-1){let K=J.slice(0,G),W=J.slice(G+1).trim();Z.append(K,W)}}});return Z}toString(){if(this.headers.size===0&&this._code===0)return"";let $=F$1;if(this._code>0&&this._description!=="")$+=` ${this._code} ${this._description}`;for(let[Z,Q]of this.headers)for(let X=0;X<Q.length;X++)$=`${$}\r
|
|
2111
2111
|
${Z}: ${Q[X]}`;return`${$}\r
|
|
@@ -3623,7 +3623,7 @@ ${Y}`:Y}case"media":return"";case"mediaSingle":case"mediaGroup":return ai(wN(Q),
|
|
|
3623
3623
|
case
|
|
3624
3624
|
when count(distinct up.metadata->'models'->'thinking'->>'provider') = 1
|
|
3625
3625
|
then max(up.metadata->'models'->'thinking'->>'provider')
|
|
3626
|
-
end`.as("provider")]).whereRef("up.thread_id","=","link.thread_id").where("up.kind","=","finish").as("cost"),(G)=>G.onTrue()).select((G)=>["cost.usd as costUsd","cost.provider as costProvider","link.task_board_item_id as taskId","link.thread_id as threadId","link.created_at as createdAt","t.status as status","t.failure_kind as failureKind","t.title as title","t.virtual_mcp_id as virtualMcpId","t.metadata as metadata","t.updated_at as updatedAt","t.last_progress_at as lastProgressAt","lastmsg.payload as lastMessagePayload",G.or([G.exists(G.selectFrom("thread_message_parts as mp").select("mp.id").whereRef("mp.thread_id","=","link.thread_id")),G.exists(G.selectFrom("thread_messages as tm").select("tm.id").whereRef("tm.thread_id","=","link.thread_id"))]).as("hasMessages")]).where("link.organization_id","=",Q).where("link.task_board_item_id","in",X).orderBy("link.created_at","desc").execute(),J=new Map;for(let G of Y){let K={threadId:G.threadId,virtualMcpId:G.virtualMcpId??null,status:G.status??null,failureKind:G.failureKind??null,title:G.title??null,lastMessage:we$(G.lastMessagePayload),hasPreview:MP6(G.metadata),hasMessages:!!G.hasMessages,lastActiveAt:VP6(G.updatedAt,G.lastProgressAt),costUsd:IP6(G.costUsd),costProvider:G.costProvider??null,createdAt:G.createdAt instanceof Date?G.createdAt.toISOString():G.createdAt},W=J.get(G.taskId);if(W)W.push(K);else J.set(G.taskId,[K])}for(let G of Z)G.threads=J.get(G.id)??[]}async attachTags($,Z){let Q=Z.map((J)=>J.id),X=await $.selectFrom("task_board_item_tags as link").innerJoin("organization_tags as tag","tag.id","link.id").select(["link.task_board_item_id as taskId","link.created_by as createdBy","link.created_at as createdAt","tag.id as id","tag.name as name","tag.color as color"]).where("link.task_board_item_id","in",Q).orderBy("tag.name","asc").execute(),Y=new Map;for(let J of X){let G={id:J.id,name:J.name,color:J.color??null,createdBy:J.createdBy,createdAt:J.createdAt instanceof Date?J.createdAt.toISOString():J.createdAt},K=Y.get(J.taskId);if(K)K.push(G);else Y.set(J.taskId,[G])}for(let J of Z)J.tags=Y.get(J.id)??[]}async attachReviewVerdicts($,Z){let Q=Z.map((J)=>J.id),X=await $.selectFrom("task_board_activity").select(["task_board_item_id as taskId","action","data","occurred_at"]).where("task_board_item_id","in",Q).where("action","in",["status_changed","review_approved","review_changes_requested"]).orderBy("occurred_at","asc").execute(),Y=new Map;for(let J of X){let G={action:J.action,data:J.data??null,occurredAt:J.occurred_at instanceof Date?J.occurred_at.toISOString():J.occurred_at},K=Y.get(J.taskId);if(K)K.push(G);else Y.set(J.taskId,[G])}for(let J of Z){let G=Y.get(J.id)??[],K=J.reviewCycleStartedAt,W=BE(G,{cycleStartedAt:K}),H=BE(G,{cycleStartedAt:K,verifiedOnly:!0});J.reviewVerdicts=tK.flatMap((F)=>{let U=W.get(F);if(!U)return[];return[{reviewer:F,verdict:U,verified:H.get(F)==="approved"}]})}}async recordActivity($){await this.db.insertInto("task_board_activity").values({id:Z4("act"),task_board_item_id:$.taskBoardItemId,action:$.action,actor_id:$.actorId,data:$.data?JSON.stringify($.data):null,occurred_at:new Date().toISOString()}).execute(),await this.fanOut([$])}async fanOut($){for(let Z of $){let Q=AP6(Z.action);if(!Q)continue;await Zp({db:this.db,taskBoardItemId:Z.taskBoardItemId,type:Q,actorId:Z.actorId,alsoSubscribe:Z.alsoSubscribe})}}async resolveReviewClaimByToken($,Z){let Q=await this.db.selectFrom("task_board_review_claims").select(["reviewer","cycle_at"]).where("task_board_item_id","=",$).where("token","=",Z).executeTakeFirst();return Q?{reviewer:Q.reviewer,cycleAt:Q.cycle_at}:null}async recordActivities($){if($.length===0)return;let Z=new Date().toISOString(),Q=[];for(let X of $)if(!(RP6.has(X.action)&&await this.touchRecentActivity(X,Z)))Q.push(X);if(Q.length===0)return;await this.db.insertInto("task_board_activity").values(Q.map((X)=>({id:Z4("act"),task_board_item_id:X.taskBoardItemId,action:X.action,actor_id:X.actorId,data:X.data?JSON.stringify(X.data):null,occurred_at:Z}))).execute(),await this.fanOut(Q)}async touchRecentActivity($,Z){let Q=new Date(Date.parse(Z)-qP6).toISOString();return((await this.db.updateTable("task_board_activity").set({occurred_at:new Date(Z)}).where("id","=",this.db.selectFrom("task_board_activity").select("id").where("task_board_item_id","=",$.taskBoardItemId).where("action","=",$.action).where((Y)=>$.actorId===null?Y("actor_id","is",null):Y("actor_id","=",$.actorId)).where("occurred_at",">=",new Date(Q)).orderBy("occurred_at","desc").limit(1)).executeTakeFirst()).numUpdatedRows??0n)>0n}async listActivity($,Z){return(await this.db.selectFrom("task_board_activity as a").innerJoin("task_board_items as item","item.id","a.task_board_item_id").selectAll("a").where("item.organization_id","=",Z).where("a.task_board_item_id","=",$).orderBy("a.occurred_at","asc").execute()).map((X)=>({id:X.id,taskBoardItemId:X.task_board_item_id,action:X.action,actorId:X.actor_id,data:typeof X.data==="string"?JSON.parse(X.data):X.data??{},occurredAt:X.occurred_at instanceof Date?X.occurred_at.toISOString():X.occurred_at}))}async hasHumanRejectedDone($,Z){let Q=$F`a.data->>'from'`,X=$F`a.data->>'reason'`,Y="a.actor_id";return await this.db.selectFrom("task_board_activity as a").innerJoin("task_board_items as item","item.id","a.task_board_item_id").select("a.id").where("item.organization_id","=",Z).where("a.task_board_item_id","=",$).where("a.action","=","status_changed").where("a.actor_id","is not",null).where(Q,"in",["done","merged"]).where(X,"is",null).limit(1).executeTakeFirst()!==void 0}async listComments($,Z){return(await this.db.selectFrom("task_board_comments as c").innerJoin("task_board_items as item","item.id","c.task_board_item_id").selectAll("c").where("item.organization_id","=",Z).where("c.task_board_item_id","=",$).orderBy("c.created_at","asc").execute()).map((X)=>LS0(X))}async createComment($){if(!await this.db.selectFrom("task_board_items").select("id").where("id","=",$.taskBoardItemId).where("organization_id","=",$.organizationId).executeTakeFirst())return null;let Q=null;if($.parentId){let Y=await this.db.selectFrom("task_board_comments").select(["id","parent_id"]).where("id","=",$.parentId).where("task_board_item_id","=",$.taskBoardItemId).executeTakeFirst();if(!Y)return null;Q=Y.parent_id??Y.id}let X=await this.db.insertInto("task_board_comments").values({id:Z4("cmt"),task_board_item_id:$.taskBoardItemId,parent_id:Q,author_id:$.authorId,thread_id:$.threadId??null,body:$.body}).returningAll().executeTakeFirstOrThrow();return LS0(X)}async updateComment($){let Z=await this.commentInOrg($.id,$.organizationId);if(!Z)return null;if($.body!==void 0&&Z.authorId!==$.callerId)return null;if($.resolved!==void 0&&Z.parentId!==null)return null;let Q=await this.db.updateTable("task_board_comments").set({...$.body===void 0?{}:{body:$.body},...$.resolved===void 0?{}:{resolved:$.resolved},updated_at:new Date().toISOString()}).where("id","=",$.id).returningAll().executeTakeFirst();return Q?LS0(Q):null}async deleteComment($,Z,Q){let X=await this.commentInOrg($,Z);if(!X)return!1;if(X.authorId!==Q&&X.authorId!==I8)return!1;return await this.db.deleteFrom("task_board_comments").where("id","=",$).execute(),!0}async getComment($,Z){let Q=await this.db.selectFrom("task_board_comments as c").innerJoin("task_board_items as item","item.id","c.task_board_item_id").selectAll("c").where("c.id","=",$).where("item.organization_id","=",Z).executeTakeFirst();return Q?LS0(Q):null}async commentInOrg($,Z){let Q=await this.db.selectFrom("task_board_comments as c").innerJoin("task_board_items as item","item.id","c.task_board_item_id").select(["c.id","c.author_id","c.parent_id"]).where("c.id","=",$).where("item.organization_id","=",Z).executeTakeFirst();return Q?{authorId:Q.author_id,parentId:Q.parent_id}:null}itemFromDbRow($){return{id:$.id,organizationId:$.organization_id,title:$.title,description:$.description,status:$.status,priority:$.priority,type:$.type??r31,assigneeId:$.assignee_id,assignedBy:$.assigned_by,repo:$.repo,repositoryId:$.repository_id??null,dueDate:$.due_date instanceof Date?$.due_date.toISOString():$.due_date,externalUrl:$.external_url??null,previewRoutes:$.preview_routes??[],source:$.source??null,sortOrder:$.sort_order,keySeq:$.key_seq,retryAttempts:$.retry_attempts??0,reviewCycleStartedAt:$.review_cycle_started_at instanceof Date?$.review_cycle_started_at.toISOString():$.review_cycle_started_at??null,threads:[],tags:[],reviewVerdicts:[],createdBy:$.created_by,createdAt:$.created_at instanceof Date?$.created_at.toISOString():$.created_at,updatedBy:$.updated_by,updatedAt:$.updated_at instanceof Date?$.updated_at.toISOString():$.updated_at}}}var TP6,RP6,qP6=600000,je$,h40,kP6;var OO=L(()=>{A6();oK();jX();x4();x4();ok0();FS0();BS0();mr();TP6=new Set(HS0);RP6=new Set(["description_changed","title_changed"]);je$=new Set(["in_progress","in_review"]),h40=new Set(["completed","failed","expired"]);kP6=[...jL0,"done"]});function Jz($){if($==null)return null;if(typeof $==="string")return WG1($);let Z;try{Z=JSON.stringify($)}catch{return null}return Z?WG1(Z):null}function u40($){return{repo:xH($.url)??SL($.repoOwner,$.repoName),repositoryId:$.repositoryId,connectionId:$.connectionId}}var cy=L(()=>{A6()});function l40($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function SP6($){let Z=ei($.orgSlug,$.keySeq),Q=Z??$.title,X=Z?`${$.baseUrl}/${encodeURIComponent($.orgSlug)}/t/${encodeURIComponent(Z)}`:null,Y=$.prs.map((J)=>`<p style="margin:0 0 8px 0;"><a href="${l40(J.url)}" style="color:#141413;">Review ${l40(J.repo)} #${J.number}</a></p>`).join("");return{subject:`${Q} is ready for your review`,html:pG({preheader:`${Q} has a pull request waiting for you.`,heading:"Ready for your review",subheading:X?`<a href="${X}" style="color:#141413;">${l40(Q)}</a> \u2014 ${l40($.title)}`:l40($.title),body:Y})}}function CP6(){let $=jH().auth,Z=$.emailProviders??[],Q=$.inviteEmailProviderId?iG(Z,$.inviteEmailProviderId):Z[0];return Q?dG(Q):null}async function Ee$($,Z){try{let Q=await $.storage.organizationSettings.get(Z.organizationId);if(!cQ(Q?.flags,"home_task_intake_enabled"))return;if(!Z.createdBy)return;let X=await $.storage.taskBoard.listPrs(Z.id,Z.organizationId);if(X.length===0)return;let Y=await $.db.selectFrom("user").innerJoin("member","member.userId","user.id").select("user.email as email").where("user.id","=",Z.createdBy).where("member.organizationId","=",Z.organizationId).executeTakeFirst();if(!Y?.email)return;let J=await $.db.selectFrom("organization").select("slug").where("id","=",Z.organizationId).executeTakeFirst();if(!J?.slug)return;let G=CP6();if(!G)return;let{subject:K,html:W}=SP6({title:Z.title,orgSlug:J.slug,keySeq:Z.keySeq,prs:X.map((H)=>({url:H.url,repo:`${H.repoOwner}/${H.repoName}`,number:H.number})),baseUrl:V9()});await G({to:Y.email,subject:K,html:W})}catch(Q){console.error(`[task-board] PR-ready email for ${Z.id} failed`,Q)}}var ze$=L(()=>{US0();xZ();MA();Q00();B9()});function c40($){return!!$&&T0().taskBoardAdminOrgIds.includes($)}async function aN1($,Z){let Q=T0().taskBoardAdminOrgIds;if(!Z||Q.length===0)return!1;return!!await $.selectFrom("member").select(["id"]).where("userId","=",Z).where("organizationId","in",Q).executeTakeFirst()}async function m40($){if(!$.db)return!1;return aN1($.db,$.auth?.user?.id)}function my($){console.log("task_board_admin_action",$)}var OS0=L(()=>{H$()});async function GW($,Z){let Q=await $.selectFrom("organization").select(["id","slug","name"]).where("id","=",Z).executeTakeFirst();if(!Q)return null;let X=await pQ.create();return X.organization={id:Q.id,slug:Q.slug,name:Q.name},Gz(X,{id:Q.id,slug:Q.slug}),X}var dy=L(()=>{aU()});import{z as _P6}from"zod";async function fP6($,Z,Q){if(!c40($.organization?.id)||!await m40($))throw Error("Not allowed to act on another organization (the `org` parameter needs an admin org)");let X=await $.storage.taskBoardAnalytics.resolveOrgRef(Z);if(!X)throw Error(`Organization not found: ${Z}`);let Y=await GW($.db,X.id);if(!Y)throw Error(`Organization not found: ${Z}`);return my({action:"tool_org_override",actorUserId:$.auth?.user?.id,actorOrgId:$.organization?.id,targetOrgId:X.id,tool:Q}),Y.auth=$.auth,Y.boundAuth=$.boundAuth,Y.access=$.access,Y}function Qp($){let Z=$;return{...$,description:`${$.description}${xP6}`,inputSchema:Z.inputSchema.extend(vP6),execute:async(Q,X)=>{let{org:Y,...J}=Q??{};if(!Y)return Z.execute(Q,X);return Z.execute(J,await fP6(X,Y,$.name))}}}var vP6,xP6;var DS0=L(()=>{OS0();dy();vP6={org:_P6.string().optional().describe("Org slug or id to read instead of the current one. Requires membership of an admin org; omit for the current org.")},xP6=" Pass `org` to read ANOTHER organization's board instead of the current "+"one \u2014 call TASK_BOARD_ADMIN_ORG_LIST first for the organizations you may "+"name (an empty list means none, and `org` will be refused)."});import{z as wS0}from"zod";async function r6($,Z){try{await $.storage.taskBoard.recordActivity(Z)}catch(Q){console.error("[task-board] activity log write failed",Q)}}async function Pe$($,Z){if(Z.length===0)return;try{await $.storage.taskBoard.recordActivities(Z)}catch(Q){console.error("[task-board] activity log write failed",Q)}}var bP6,rN1;var tX=L(()=>{x0();rJ();DS0();bP6=p({name:"TASK_BOARD_ACTIVITY_LIST",description:"List a task board item's change history (timeline, oldest first).",annotations:{title:"List Task Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:wS0.object({taskBoardItemId:wS0.string()}),outputSchema:wS0.object({activity:wS0.array(Wd$)}),handler:async($,Z)=>{$0(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");return{activity:await Z.storage.taskBoard.listActivity($.taskBoardItemId,Q)}}}),rN1=Qp(bP6)});function iy($){if($.length===0)return!1;let Z=new Map;for(let Q of $){let X=`${Q.repoOwner}/${Q.repoName}`.toLowerCase(),Y=Z.get(X);if(Y)Y.push(Q);else Z.set(X,[Q])}return[...Z.values()].every(yP6)}function yP6($){return $.some((Z)=>Z.merged===!0)&&$.every((Z)=>Z.merged===!0||Z.state==="closed")}async function gP6($,Z,Q,X){let Y=await $.storage.taskBoard.getById(Q,Z);if(!Y||Y.status!=="done")return!1;let J=await $.storage.taskBoard.listPrs(Q,Z),G=await Promise.all(J.map(async(H)=>({...H,...await X($,Z,H)})));if(!iy(G))return!1;let K=l$.archive,W=await $.storage.taskBoard.update(Q,Z,{status:K},Y.updatedBy);return await r6($,{taskBoardItemId:Q,action:"status_changed",actorId:null,data:{from:"done",to:K,reason:"merged_pr_auto_archive"}}),T8(Z,W),!0}async function Te$($,Z,Q,X=ES0){let Y=0;for(let J of Q)try{if(await gP6($,Z,J,X))Y+=1}catch(G){console.error(`[task-board-archive] ${J} failed`,G)}return{archived:Y}}function jS0($){let Z=new Map;for(let{id:Q,organizationId:X}of $){let Y=Z.get(X);if(Y)Y.push(Q);else Z.set(X,[Q])}return[...Z].map(([Q,X])=>({organizationId:Q,itemIds:X}))}var Xp=L(()=>{x4();tX();V7();y9()});function py($){let Z=uP6[$];if(Z===void 0)throw Error(`Unknown board column "${$}"`);return Z}function sN1($){return Ae$.includes($)}function Re$($,Z){return py(Z)>py($)}function PS0($,Z){return py($)<=py(Z)}function Me$($){return $==="done"||Ae$.includes($)}function ZG($){if(py($.status)>zS0.in_review)return!1;return $.status===l$.review||Boolean($.reviewCycleStartedAt)}var hP6,zS0,uP6,Ae$,qe$;var ZF=L(()=>{x4();hP6=Object.fromEntries(cH.map(($,Z)=>[$,Z])),zS0=hP6,uP6=zS0;Ae$=jL0;qe$=new Set(["in_review","approved"])});function TS0($){return $===""?"Your Studio tools are registered under their bare names: a tool named `JIRA_COMMENT_ADD` is called exactly that.":"Your Studio tools are namespaced `mcp__studio__`: where an instruction names a tool `JIRA_COMMENT_ADD`, the tool you actually call is `mcp__studio__JIRA_COMMENT_ADD`. Don't search for the unprefixed name."}function AS0($){return $.replace(/\/api\/[^/\s)]+\/fs\/([^/\s)]+)\/read\?path=([^)\s]+)/g,(Z,Q,X)=>{let Y,J;try{Y=decodeURIComponent(Q),J=decodeURIComponent(X)}catch{return Z}let G=(K)=>K.startsWith("/")||K.split("/").includes("..");if(G(Y)||G(J))return Z;return YN(Y,J)})}function RS0($,Z){return Z===$?null:"The image and file links in that description are real paths in this sandbox, not URLs \u2014 `Read` them. A screenshot the task points at is usually the clearest statement of what it wants."}var eN1=L(()=>{l2()});function lP6($,Z){let Q=Z?.repositoryId,X=Z?.repo;if(Q){let Y=$.filter((J)=>J.repository?.id===Q);if(Y.length>0)return Y}if(X)return $.filter((Y)=>`${Y.owner}/${Y.name}`.toLowerCase()===X.toLowerCase());return Q?[]:$}function cP6($,Z){if($=lP6($,Z),$.length!==1)return null;let Q=$[0];return{id:Q.id,owner:Q.owner,name:Q.name,url:Q.webUrl,provider:Q.provider,...Q.connectionId?{connectionId:Q.connectionId}:{},...Q.repository?{repositoryId:Q.repository.id}:{},...Q.installationId!==void 0?{installationId:Q.installationId}:{}}}async function MS0($,Z,Q){if(!cD())return console.warn(`[task-board] claude-code skipped for org ${Z}: `+"hosted sandbox unavailable \u2014 running Decopilot"),null;try{let X=await CE($,Z),Y=cP6(X,Q);if(Y)return{repo:Y};if(X.length===0)return console.warn(`[task-board] claude-code skipped for org ${Z}: `+"no importable repos \u2014 running Decopilot"),null;return console.warn(`[task-board] claude-code for org ${Z}: ${X.length} importable repos \u2014 the run picks one with TASK_ADD_REPO`),{choices:X.map((J)=>({id:J.id,repo:`${J.owner}/${J.name}`}))}}catch(X){return console.warn("[task-board] repo lookup for claude-code failed",X),null}}function qS0($){let Z=$?.others??[];if(Z.length===0)return[];return[`This issue spans ${Z.length+1} repositories, and it has an open pull request in each of the others too:`,...Z.map((Q)=>`- ${Q.repo}: pull request #${Q.number} (${Q.url}) on branch \`${Q.head}\`. After cloning that repository, run \`git fetch origin ${Q.head} && git checkout ${Q.head}\` BEFORE editing, and push to update that SAME pull request \u2014 do NOT open a new one there.`),"A change that only lands on one side is worse than none: if you cannot update them all, update none and say why."]}function Ie$($,Z,Q){let X=AC$(Z?.provider??"github"),Y=Q?.source?.kind==="jira",J=[Q?.instruction?.trim()||(Y?"":`You've been assigned this task. Complete it and finish with a ${X.changeRequest} if it makes sense (like a coding task) or is explicitly requested.`),"","You are running AUTONOMOUSLY \u2014 no human is watching, so drive this to "+"completion yourself. Make reasonable decisions and move on; do not stop to ask for confirmation.","",`Title: ${$.title}`];if($.description){let G=AS0($.description);J.push("","Description:",G);let K=RS0($.description,G);if(K)J.push("",K)}if(J.push("",Z?`The repository ${Z.owner}/${Z.name} is already cloned at your working directory, on its own branch. It is hosted on ${X.name}, so ${X.cli?`\`git\` and \`${X.cli}\` are`:"`git` is"} authenticated there${X.cli?"":" (Bitbucket has no CLI; `$BITBUCKET_TOKEN` is the bearer for its REST API)"}. ${u$0}`:["Your working directory is EMPTY: this organization has several repositories, so nothing has been cloned yet. FIRST call `mcp__studio__TASK_ADD_REPO` with the id of the repository this task is about. It clones that repository into your working directory and waits for the checkout, so once it returns the repository is there on its own branch, with `git` and that repository's own CLI authenticated. Do not read files or run `git` before it returns; there is nothing there yet.","","Repositories in this organization:",...(Q?.repoChoices??[]).map((G)=>`- ${G.repo} (id: ${G.id})`),Q?.repoChoices?.length?"Start with the one the task is about. If it turns out to need a change in "+"another of them too, call `mcp__studio__TASK_ADD_REPO` again \u2014 repositories "+"accumulate, so a second call adds a checkout beside the first rather than replacing it. Each lands in its own directory and keeps its own git remote, so open one change request per repository you changed.":"Call `mcp__studio__TASK_ADD_REPO` with no arguments to list them."].join(`
|
|
3626
|
+
end`.as("provider")]).whereRef("up.thread_id","=","link.thread_id").where("up.kind","=","finish").as("cost"),(G)=>G.onTrue()).select((G)=>["cost.usd as costUsd","cost.provider as costProvider","link.task_board_item_id as taskId","link.thread_id as threadId","link.created_at as createdAt","t.status as status","t.failure_kind as failureKind","t.title as title","t.virtual_mcp_id as virtualMcpId","t.metadata as metadata","t.updated_at as updatedAt","t.last_progress_at as lastProgressAt","lastmsg.payload as lastMessagePayload",G.or([G.exists(G.selectFrom("thread_message_parts as mp").select("mp.id").whereRef("mp.thread_id","=","link.thread_id")),G.exists(G.selectFrom("thread_messages as tm").select("tm.id").whereRef("tm.thread_id","=","link.thread_id"))]).as("hasMessages")]).where("link.organization_id","=",Q).where("link.task_board_item_id","in",X).orderBy("link.created_at","desc").execute(),J=new Map;for(let G of Y){let K={threadId:G.threadId,virtualMcpId:G.virtualMcpId??null,status:G.status??null,failureKind:G.failureKind??null,title:G.title??null,lastMessage:we$(G.lastMessagePayload),hasPreview:MP6(G.metadata),hasMessages:!!G.hasMessages,lastActiveAt:VP6(G.updatedAt,G.lastProgressAt),costUsd:IP6(G.costUsd),costProvider:G.costProvider??null,createdAt:G.createdAt instanceof Date?G.createdAt.toISOString():G.createdAt},W=J.get(G.taskId);if(W)W.push(K);else J.set(G.taskId,[K])}for(let G of Z)G.threads=J.get(G.id)??[]}async attachTags($,Z){let Q=Z.map((J)=>J.id),X=await $.selectFrom("task_board_item_tags as link").innerJoin("organization_tags as tag","tag.id","link.id").select(["link.task_board_item_id as taskId","link.created_by as createdBy","link.created_at as createdAt","tag.id as id","tag.name as name","tag.color as color"]).where("link.task_board_item_id","in",Q).orderBy("tag.name","asc").execute(),Y=new Map;for(let J of X){let G={id:J.id,name:J.name,color:J.color??null,createdBy:J.createdBy,createdAt:J.createdAt instanceof Date?J.createdAt.toISOString():J.createdAt},K=Y.get(J.taskId);if(K)K.push(G);else Y.set(J.taskId,[G])}for(let J of Z)J.tags=Y.get(J.id)??[]}async attachReviewVerdicts($,Z){let Q=Z.map((J)=>J.id),X=await $.selectFrom("task_board_activity").select(["task_board_item_id as taskId","action","data","occurred_at"]).where("task_board_item_id","in",Q).where("action","in",["status_changed","review_approved","review_changes_requested"]).orderBy("occurred_at","asc").execute(),Y=new Map;for(let J of X){let G={action:J.action,data:J.data??null,occurredAt:J.occurred_at instanceof Date?J.occurred_at.toISOString():J.occurred_at},K=Y.get(J.taskId);if(K)K.push(G);else Y.set(J.taskId,[G])}for(let J of Z){let G=Y.get(J.id)??[],K=J.reviewCycleStartedAt,W=BE(G,{cycleStartedAt:K}),H=BE(G,{cycleStartedAt:K,verifiedOnly:!0});J.reviewVerdicts=tK.flatMap((F)=>{let U=W.get(F);if(!U)return[];return[{reviewer:F,verdict:U,verified:H.get(F)==="approved"}]})}}async recordActivity($){await this.db.insertInto("task_board_activity").values({id:Z4("act"),task_board_item_id:$.taskBoardItemId,action:$.action,actor_id:$.actorId,data:$.data?JSON.stringify($.data):null,occurred_at:new Date().toISOString()}).execute(),await this.fanOut([$])}async fanOut($){for(let Z of $){let Q=AP6(Z.action);if(!Q)continue;await Zp({db:this.db,taskBoardItemId:Z.taskBoardItemId,type:Q,actorId:Z.actorId,alsoSubscribe:Z.alsoSubscribe})}}async resolveReviewClaimByToken($,Z){let Q=await this.db.selectFrom("task_board_review_claims").select(["reviewer","cycle_at"]).where("task_board_item_id","=",$).where("token","=",Z).executeTakeFirst();return Q?{reviewer:Q.reviewer,cycleAt:Q.cycle_at}:null}async recordActivities($){if($.length===0)return;let Z=new Date().toISOString(),Q=[];for(let X of $)if(!(RP6.has(X.action)&&await this.touchRecentActivity(X,Z)))Q.push(X);if(Q.length===0)return;await this.db.insertInto("task_board_activity").values(Q.map((X)=>({id:Z4("act"),task_board_item_id:X.taskBoardItemId,action:X.action,actor_id:X.actorId,data:X.data?JSON.stringify(X.data):null,occurred_at:Z}))).execute(),await this.fanOut(Q)}async touchRecentActivity($,Z){let Q=new Date(Date.parse(Z)-qP6).toISOString();return((await this.db.updateTable("task_board_activity").set({occurred_at:new Date(Z)}).where("id","=",this.db.selectFrom("task_board_activity").select("id").where("task_board_item_id","=",$.taskBoardItemId).where("action","=",$.action).where((Y)=>$.actorId===null?Y("actor_id","is",null):Y("actor_id","=",$.actorId)).where("occurred_at",">=",new Date(Q)).orderBy("occurred_at","desc").limit(1)).executeTakeFirst()).numUpdatedRows??0n)>0n}async listActivity($,Z){return(await this.db.selectFrom("task_board_activity as a").innerJoin("task_board_items as item","item.id","a.task_board_item_id").selectAll("a").where("item.organization_id","=",Z).where("a.task_board_item_id","=",$).orderBy("a.occurred_at","asc").execute()).map((X)=>({id:X.id,taskBoardItemId:X.task_board_item_id,action:X.action,actorId:X.actor_id,data:typeof X.data==="string"?JSON.parse(X.data):X.data??{},occurredAt:X.occurred_at instanceof Date?X.occurred_at.toISOString():X.occurred_at}))}async hasHumanRejectedDone($,Z){let Q=$F`a.data->>'from'`,X=$F`a.data->>'reason'`,Y="a.actor_id";return await this.db.selectFrom("task_board_activity as a").innerJoin("task_board_items as item","item.id","a.task_board_item_id").select("a.id").where("item.organization_id","=",Z).where("a.task_board_item_id","=",$).where("a.action","=","status_changed").where("a.actor_id","is not",null).where(Q,"in",["done","merged"]).where(X,"is",null).limit(1).executeTakeFirst()!==void 0}async listComments($,Z){return(await this.db.selectFrom("task_board_comments as c").innerJoin("task_board_items as item","item.id","c.task_board_item_id").selectAll("c").where("item.organization_id","=",Z).where("c.task_board_item_id","=",$).orderBy("c.created_at","asc").execute()).map((X)=>LS0(X))}async createComment($){if(!await this.db.selectFrom("task_board_items").select("id").where("id","=",$.taskBoardItemId).where("organization_id","=",$.organizationId).executeTakeFirst())return null;let Q=null;if($.parentId){let Y=await this.db.selectFrom("task_board_comments").select(["id","parent_id"]).where("id","=",$.parentId).where("task_board_item_id","=",$.taskBoardItemId).executeTakeFirst();if(!Y)return null;Q=Y.parent_id??Y.id}let X=await this.db.insertInto("task_board_comments").values({id:Z4("cmt"),task_board_item_id:$.taskBoardItemId,parent_id:Q,author_id:$.authorId,thread_id:$.threadId??null,body:$.body}).returningAll().executeTakeFirstOrThrow();return LS0(X)}async updateComment($){let Z=await this.commentInOrg($.id,$.organizationId);if(!Z)return null;if($.body!==void 0&&Z.authorId!==$.callerId)return null;if($.resolved!==void 0&&Z.parentId!==null)return null;let Q=await this.db.updateTable("task_board_comments").set({...$.body===void 0?{}:{body:$.body},...$.resolved===void 0?{}:{resolved:$.resolved},updated_at:new Date().toISOString()}).where("id","=",$.id).returningAll().executeTakeFirst();return Q?LS0(Q):null}async deleteComment($,Z,Q){let X=await this.commentInOrg($,Z);if(!X)return!1;if(X.authorId!==Q&&X.authorId!==I8)return!1;return await this.db.deleteFrom("task_board_comments").where("id","=",$).execute(),!0}async getComment($,Z){let Q=await this.db.selectFrom("task_board_comments as c").innerJoin("task_board_items as item","item.id","c.task_board_item_id").selectAll("c").where("c.id","=",$).where("item.organization_id","=",Z).executeTakeFirst();return Q?LS0(Q):null}async commentInOrg($,Z){let Q=await this.db.selectFrom("task_board_comments as c").innerJoin("task_board_items as item","item.id","c.task_board_item_id").select(["c.id","c.author_id","c.parent_id"]).where("c.id","=",$).where("item.organization_id","=",Z).executeTakeFirst();return Q?{authorId:Q.author_id,parentId:Q.parent_id}:null}itemFromDbRow($){return{id:$.id,organizationId:$.organization_id,title:$.title,description:$.description,status:$.status,priority:$.priority,type:$.type??r31,assigneeId:$.assignee_id,assignedBy:$.assigned_by,repo:$.repo,repositoryId:$.repository_id??null,dueDate:$.due_date instanceof Date?$.due_date.toISOString():$.due_date,externalUrl:$.external_url??null,previewRoutes:$.preview_routes??[],source:$.source??null,sortOrder:$.sort_order,keySeq:$.key_seq,retryAttempts:$.retry_attempts??0,reviewCycleStartedAt:$.review_cycle_started_at instanceof Date?$.review_cycle_started_at.toISOString():$.review_cycle_started_at??null,threads:[],tags:[],reviewVerdicts:[],createdBy:$.created_by,createdAt:$.created_at instanceof Date?$.created_at.toISOString():$.created_at,updatedBy:$.updated_by,updatedAt:$.updated_at instanceof Date?$.updated_at.toISOString():$.updated_at}}}var TP6,RP6,qP6=600000,je$,h40,kP6;var OO=L(()=>{A6();oK();jX();x4();x4();ok0();FS0();BS0();mr();TP6=new Set(HS0);RP6=new Set(["description_changed","title_changed"]);je$=new Set(["in_progress","in_review"]),h40=new Set(["completed","failed","expired"]);kP6=[...jL0,"done"]});function Jz($){if($==null)return null;if(typeof $==="string")return WG1($);let Z;try{Z=JSON.stringify($)}catch{return null}return Z?WG1(Z):null}function u40($){return{repo:xH($.url)??SL($.repoOwner,$.repoName),repositoryId:$.repositoryId,connectionId:$.connectionId}}var cy=L(()=>{A6()});function l40($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function SP6($){let Z=ei($.orgSlug,$.keySeq),Q=Z??$.title,X=Z?`${$.baseUrl}/${encodeURIComponent($.orgSlug)}/t/${encodeURIComponent(Z)}`:null,Y=$.prs.map((J)=>`<p style="margin:0 0 8px 0;"><a href="${l40(J.url)}" style="color:#141413;">Review ${l40(J.repo)} #${J.number}</a></p>`).join("");return{subject:`${Q} is ready for your review`,html:pG({preheader:`${Q} has a pull request waiting for you.`,heading:"Ready for your review",subheading:X?`<a href="${X}" style="color:#141413;">${l40(Q)}</a> \u2014 ${l40($.title)}`:l40($.title),body:Y})}}function CP6(){let $=jH().auth,Z=$.emailProviders??[],Q=$.inviteEmailProviderId?iG(Z,$.inviteEmailProviderId):Z[0];return Q?dG(Q):null}async function Ee$($,Z){try{let Q=await $.storage.organizationSettings.get(Z.organizationId);if(!cQ(Q?.flags,"home_task_intake_enabled"))return;if(!Z.createdBy)return;let X=await $.storage.taskBoard.listPrs(Z.id,Z.organizationId);if(X.length===0)return;let Y=await $.db.selectFrom("user").innerJoin("member","member.userId","user.id").select("user.email as email").where("user.id","=",Z.createdBy).where("member.organizationId","=",Z.organizationId).executeTakeFirst();if(!Y?.email)return;let J=await $.db.selectFrom("organization").select("slug").where("id","=",Z.organizationId).executeTakeFirst();if(!J?.slug)return;let G=CP6();if(!G)return;let{subject:K,html:W}=SP6({title:Z.title,orgSlug:J.slug,keySeq:Z.keySeq,prs:X.map((H)=>({url:H.url,repo:`${H.repoOwner}/${H.repoName}`,number:H.number})),baseUrl:V9()});await G({to:Y.email,subject:K,html:W})}catch(Q){console.error(`[task-board] PR-ready email for ${Z.id} failed`,Q)}}var ze$=L(()=>{US0();xZ();MA();Q00();B9()});function c40($){return!!$&&T0().taskBoardAdminOrgIds.includes($)}async function aN1($,Z){let Q=T0().taskBoardAdminOrgIds;if(!Z||Q.length===0)return!1;return!!await $.selectFrom("member").select(["id"]).where("userId","=",Z).where("organizationId","in",Q).executeTakeFirst()}async function m40($){if(!$.db)return!1;return aN1($.db,$.auth?.user?.id)}function my($){console.log("task_board_admin_action",$)}var OS0=L(()=>{H$()});async function GW($,Z){let Q=await $.selectFrom("organization").select(["id","slug","name"]).where("id","=",Z).executeTakeFirst();if(!Q)return null;let X=await pQ.create();return X.organization={id:Q.id,slug:Q.slug,name:Q.name},Gz(X,{id:Q.id,slug:Q.slug}),X}var dy=L(()=>{aU()});import{z as _P6}from"zod";async function fP6($,Z,Q){if(!c40($.organization?.id)||!await m40($))throw Error("Not allowed to act on another organization (the `org` parameter needs an admin org)");let X=await $.storage.taskBoardAnalytics.resolveOrgRef(Z);if(!X)throw Error(`Organization not found: ${Z}`);let Y=await GW($.db,X.id);if(!Y)throw Error(`Organization not found: ${Z}`);return my({action:"tool_org_override",actorUserId:$.auth?.user?.id,actorOrgId:$.organization?.id,targetOrgId:X.id,tool:Q}),Y.auth=$.auth,Y.boundAuth=$.boundAuth,Y.access=$.access,Y}function Qp($){let Z=$;return{...$,description:`${$.description}${xP6}`,inputSchema:Z.inputSchema.extend(vP6),execute:async(Q,X)=>{let{org:Y,...J}=Q??{};if(!Y)return Z.execute(Q,X);return Z.execute(J,await fP6(X,Y,$.name))}}}var vP6,xP6;var DS0=L(()=>{OS0();dy();vP6={org:_P6.string().optional().describe("Org slug or id to read instead of the current one. Requires membership of an admin org; omit for the current org.")},xP6=" Pass `org` to read ANOTHER organization's board instead of the current "+"one \u2014 call TASK_BOARD_ADMIN_ORG_LIST first for the organizations you may "+"name (an empty list means none, and `org` will be refused)."});import{z as wS0}from"zod";async function r6($,Z){try{await $.storage.taskBoard.recordActivity(Z)}catch(Q){console.error("[task-board] activity log write failed",Q)}}async function Pe$($,Z){if(Z.length===0)return;try{await $.storage.taskBoard.recordActivities(Z)}catch(Q){console.error("[task-board] activity log write failed",Q)}}var bP6,rN1;var tX=L(()=>{x0();rJ();DS0();bP6=p({name:"TASK_BOARD_ACTIVITY_LIST",description:"List a task board item's change history (timeline, oldest first).",annotations:{title:"List Task Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:wS0.object({taskBoardItemId:wS0.string()}),outputSchema:wS0.object({activity:wS0.array(Wd$)}),handler:async($,Z)=>{$0(Z),await Z.access.check();let Q=Z.organization?.id;if(!Q)throw Error("Organization ID required (no active organization in context)");return{activity:await Z.storage.taskBoard.listActivity($.taskBoardItemId,Q)}}}),rN1=Qp(bP6)});function iy($){if($.length===0)return!1;let Z=new Map;for(let Q of $){let X=`${Q.repoOwner}/${Q.repoName}`.toLowerCase(),Y=Z.get(X);if(Y)Y.push(Q);else Z.set(X,[Q])}return[...Z.values()].every(yP6)}function yP6($){return $.some((Z)=>Z.merged===!0)&&$.every((Z)=>Z.merged===!0||Z.state==="closed")}async function gP6($,Z,Q,X){let Y=await $.storage.taskBoard.getById(Q,Z);if(!Y||Y.status!=="done")return!1;let J=await $.storage.taskBoard.listPrs(Q,Z),G=await Promise.all(J.map(async(H)=>({...H,...await X($,Z,H)})));if(!iy(G))return!1;let K=l$.archive,W=await $.storage.taskBoard.update(Q,Z,{status:K},Y.updatedBy);return await r6($,{taskBoardItemId:Q,action:"status_changed",actorId:null,data:{from:"done",to:K,reason:"merged_pr_auto_archive"}}),T8(Z,W),!0}async function Te$($,Z,Q,X=ES0){let Y=0;for(let J of Q)try{if(await gP6($,Z,J,X))Y+=1}catch(G){console.error(`[task-board-archive] ${J} failed`,G)}return{archived:Y}}function jS0($){let Z=new Map;for(let{id:Q,organizationId:X}of $){let Y=Z.get(X);if(Y)Y.push(Q);else Z.set(X,[Q])}return[...Z].map(([Q,X])=>({organizationId:Q,itemIds:X}))}var Xp=L(()=>{x4();tX();V7();y9()});function py($){let Z=uP6[$];if(Z===void 0)throw Error(`Unknown board column "${$}"`);return Z}function sN1($){return Ae$.includes($)}function Re$($,Z){return py(Z)>py($)}function PS0($,Z){return py($)<=py(Z)}function Me$($){return $==="done"||Ae$.includes($)}function ZG($){if(py($.status)>zS0.in_review)return!1;return $.status===l$.review||Boolean($.reviewCycleStartedAt)}var hP6,zS0,uP6,Ae$,qe$;var ZF=L(()=>{x4();hP6=Object.fromEntries(cH.map(($,Z)=>[$,Z])),zS0=hP6,uP6=zS0;Ae$=jL0;qe$=new Set(["in_review","approved"])});function TS0($){return $===""?"Your Studio tools are registered under their bare names: a tool named `JIRA_COMMENT_ADD` is called exactly that.":"Your Studio tools are namespaced `mcp__studio__`: where an instruction names a tool `JIRA_COMMENT_ADD`, the tool you actually call is `mcp__studio__JIRA_COMMENT_ADD`. Don't search for the unprefixed name."}function AS0($){return $.replace(/\/api\/[^/\s)]+\/fs\/([^/\s)]+)\/read\?path=([^)\s]+)/g,(Z,Q,X)=>{let Y,J;try{Y=decodeURIComponent(Q),J=decodeURIComponent(X)}catch{return Z}let G=(K)=>K.startsWith("/")||K.split("/").includes("..");if(G(Y)||G(J))return Z;return YN(Y,J)})}function RS0($,Z){return Z===$?null:"The image and file links in that description are real paths in this sandbox, not URLs \u2014 `Read` them. A screenshot the task points at is usually the clearest statement of what it wants."}var eN1=L(()=>{l2()});function lP6($,Z){let Q=Z?.repositoryId,X=Z?.repo;if(Q){let Y=$.filter((J)=>J.repository?.id===Q);if(Y.length>0)return Y}if(X)return $.filter((Y)=>`${Y.owner}/${Y.name}`.toLowerCase()===X.toLowerCase());return Q?[]:$}function cP6($,Z){if($=lP6($,Z),$.length!==1)return null;let Q=$[0];return{id:Q.id,owner:Q.owner,name:Q.name,url:Q.webUrl,provider:Q.provider,...Q.connectionId?{connectionId:Q.connectionId}:{},...Q.repository?{repositoryId:Q.repository.id}:{},...Q.installationId!==void 0?{installationId:Q.installationId}:{}}}async function MS0($,Z,Q){if(!cD())return console.warn(`[task-board] claude-code skipped for org ${Z}: `+"hosted sandbox unavailable \u2014 running Decopilot"),null;try{let X=await CE($,Z),Y=cP6(X,Q);if(Y)return{repo:Y};if(X.length===0)return console.warn(`[task-board] claude-code skipped for org ${Z}: `+"no importable repos \u2014 running Decopilot"),null;return console.warn(`[task-board] claude-code for org ${Z}: ${X.length} importable repos \u2014 the run picks one with TASK_ADD_REPO`),{choices:X.map((J)=>({id:J.id,repo:`${J.owner}/${J.name}`}))}}catch(X){return console.warn("[task-board] repo lookup for claude-code failed",X),null}}function qS0($){let Z=$?.others??[];if(Z.length===0)return[];return[`This issue spans ${Z.length+1} repositories, and it has an open pull request in each of the others too:`,...Z.map((Q)=>`- ${Q.repo}: pull request #${Q.number} (${Q.url}) on branch \`${Q.head}\`. After cloning that repository, run \`git fetch origin +refs/heads/${Q.head}:refs/remotes/origin/${Q.head} && git checkout -B ${Q.head} origin/${Q.head}\` BEFORE editing (the clone is single-branch, so a bare \`git fetch origin ${Q.head}\` creates no branch to check out), and push to update that SAME pull request \u2014 do NOT open a new one there.`),"A change that only lands on one side is worse than none: if you cannot update them all, update none and say why."]}function Ie$($,Z,Q){let X=AC$(Z?.provider??"github"),Y=Q?.source?.kind==="jira",J=[Q?.instruction?.trim()||(Y?"":`You've been assigned this task. Complete it and finish with a ${X.changeRequest} if it makes sense (like a coding task) or is explicitly requested.`),"","You are running AUTONOMOUSLY \u2014 no human is watching, so drive this to "+"completion yourself. Make reasonable decisions and move on; do not stop to ask for confirmation.","",`Title: ${$.title}`];if($.description){let G=AS0($.description);J.push("","Description:",G);let K=RS0($.description,G);if(K)J.push("",K)}if(J.push("",Z?`The repository ${Z.owner}/${Z.name} is already cloned at your working directory, on its own branch. It is hosted on ${X.name}, so ${X.cli?`\`git\` and \`${X.cli}\` are`:"`git` is"} authenticated there${X.cli?"":" (Bitbucket has no CLI; `$BITBUCKET_TOKEN` is the bearer for its REST API)"}. ${u$0}`:["Your working directory is EMPTY: this organization has several repositories, so nothing has been cloned yet. FIRST call `mcp__studio__TASK_ADD_REPO` with the id of the repository this task is about. It clones that repository into your working directory and waits for the checkout, so once it returns the repository is there on its own branch, with `git` and that repository's own CLI authenticated. Do not read files or run `git` before it returns; there is nothing there yet.","","Repositories in this organization:",...(Q?.repoChoices??[]).map((G)=>`- ${G.repo} (id: ${G.id})`),Q?.repoChoices?.length?"Start with the one the task is about. If it turns out to need a change in "+"another of them too, call `mcp__studio__TASK_ADD_REPO` again \u2014 repositories "+"accumulate, so a second call adds a checkout beside the first rather than replacing it. Each lands in its own directory and keeps its own git remote, so open one change request per repository you changed.":"Call `mcp__studio__TASK_ADD_REPO` with no arguments to list them."].join(`
|
|
3627
3627
|
`),"",mP6,""),Q?.resolveConflict&&Q.pr)J.push(`Pull request #${Q.pr.number} (${Q.pr.url}) is approved but has a MERGE CONFLICT with its base branch.`,`Check that branch out (\`${UG1(Z?.provider??"github",Q.pr.number)}\`), merge or rebase the base branch into it, resolve the conflicts, and push to update the SAME ${X.changeRequest} \u2014 do NOT open a new one. Resolve by preserving BOTH sides' intent; never blindly discard either side, and change only what the conflict requires.`,"");else if(Q?.feedback)J.push(Q.pr?`A reviewer requested changes on pull request #${Q.pr.number} (${Q.pr.url}):`:"A reviewer requested changes on your previous work:",Q.feedback,Q.pr?`Check that branch out (\`${UG1(Z?.provider??"github",Q.pr.number)}\`) before editing, address the feedback, then push to update the SAME ${X.changeRequest} \u2014 do NOT open a new one.`:"Address this feedback.",...qS0(Q.pr),"");else if(Q?.pr)J.push(`This task already has an open pull request #${Q.pr.number} (${Q.pr.url}), and you are already on its branch.`,"Continue that work: commit and push to update the SAME pull request \u2014 do NOT open a new one. If it already does everything the task asks, say so and stop rather than changing it.",...qS0(Q.pr),"");if(Y)return J.push(TS0("mcp__studio__"),""),J.join(`
|
|
3628
3628
|
`).trimStart();return J.push("How to finish:","- Make the change, commit it, push the branch, and open a pull request"+(Q?.pr?" \u2014 or push to the existing one, per the instruction above.":"."),"- Change only what the task needs. Don't refactor around it.","- The change must be REACHABLE from the surface the task names: edit the component that route actually renders, not one that merely looks like the right place. A change nothing imports is the most common reason a task comes back rejected.","- Before handing over, VERIFY the task's outcome LOCALLY, in the sandbox: exercise the affected code path and confirm the behaviour actually happens. A green test suite is not the bar. Do NOT wait for, or verify against, the PR's deploy preview \u2014 a reviewer checks that after you hand over.",'- A browser is installed globally, NOT in the repo\'s `node_modules` \u2014 don\'t go looking for playwright there. `qa-screenshot <url> <path>.png [--mobile] [--full] [--selector=<css>]` renders any URL (localhost included) in headless Chromium, runs the page\'s JS, and writes a file you must then `Read` \u2014 a screenshot you never opened is not verification. To INTERACT (click, fill, `document.elementFromPoint`), write a throwaway node script: `const { chromium } = require("/usr/local/lib/node_modules/playwright-core"); chromium.launch({ executablePath: "/usr/bin/chromium", args: ["--no-sandbox"] })`.',`- Open the ${X.changeRequest} from the branch you were given \u2014 the board finds it by that branch. Don't move the work to a differently-named one.`),J.push(`- If your change adds or edits pages a person can open, report their paths with \`mcp__studio__TASK_BOARD_ITEM_UPDATE\` (id "${$.id}", \`previewRoutes: ["/some-page"]\`) \u2014 paths only, no host. The card joins them onto the deploy preview so a reviewer opens the page directly. Skip it when the change has no visible route.`,'- If the task turns out to need no code change, do NOT open a PR: explain why in a comment on the task (`mcp__studio__TASK_BOARD_COMMENT_CREATE`) and move it to "done". There is nothing for a reviewer to review, so leaving it for one would strand it.',`- Anything a reviewer should know (a decision you made, something you found and deliberately left alone, a question) goes on the task as a comment: \`mcp__studio__TASK_BOARD_COMMENT_CREATE\` with taskBoardItemId "${$.id}". Read what's already there first with \`mcp__studio__TASK_BOARD_COMMENT_LIST\` \u2014 a comment may be addressed to you.`,"",`(task id: ${$.id})`),J.join(`
|
|
3629
3629
|
`)}var mP6;var $B1=L(()=>{U80();A6();x4();H$();eN1();mP6='Each checkout is authenticated for ITS OWN host: use `gh` inside a GitHub repository and `glab` inside a GitLab one (`glab mr create` is the counterpart of `gh pr create`). Bitbucket has no CLI: inside a Bitbucket repository open pull requests through the Studio tools or the REST API with `curl -H "Authorization: Bearer $BITBUCKET_TOKEN"` against api.bitbucket.org. A run can hold several at once, so pick the one that matches the repository '+"you are standing in \u2014 check its remote with `git remote get-url origin` if "+"you are unsure."});import{createHmac as dP6,timingSafeEqual as iP6}from"crypto";function ZB1($,Z,Q){return`rtok_${dP6("sha256",rk0()).update(`${$}:${Z}:${Q.toISOString()}`).digest("base64url")}`}function Ve$($,Z,Q,X){let Y=Buffer.from($),J=Buffer.from(ZB1(Z,Q,X));return Y.length===J.length&&iP6(Y,J)}var QB1=L(()=>{DN1()});import{createHash as pP6}from"crypto";function d40($,Z){if($.status===null||ke$.has($.status))return!1;return!C40({updated_at:$.lastActiveAt,last_progress_at:null},Z)}function XB1($,Z){return $.threads.some((Q)=>!tK.some((X)=>NE(Q.title,X))&&d40(Q,Z))}function oP6($,Z){return Z-$>=tP6}function aP6($,Z,Q,X){if($||Z!==!1)return!1;return oP6(Q,X)}async function Yp($,Z,Q){let X=await $.storage.organizationSettings.get(Z.organizationId),Y=Q?.kinds??lL(X?.flags);if(Y.length===0)return[];if(XB1(Z,Date.now()))return[];let J=cQ(X?.flags,"cheap_reviewer_model")?"reviewer":"default",G=await $.storage.taskBoard.listActivity(Z.id,Z.organizationId),K=Z.reviewCycleStartedAt,W=cL(G,K),H=new Date(W),F=BE(G,{cycleStartedAt:K}),U=[];return await Promise.all(Y.map(async(N)=>{let B=F.has(N);if(!B){let w=XT6(G,W),j=QT6(Z,N,W,w);if(j){await KT6($,Z,N,j).catch((E)=>console.error(`[task-board] ${N} verdict nudge failed`,E));return}if(JT6(w,Date.now()))return}if($T6(Z,N,W,Date.now(),B)){await EN($,Z,`${sU[N]} failed ${YB1} times on `+"this review \u2014 it will not be retried");return}if(Q?.previewMatchesHead===!1){if(aP6(B,Q.previewMatchesHead,W,Date.now()))await EN($,Z,"the pull request's deploy preview is not showing its latest commit (its checks never went green), so the Reviewer cannot verify this change against what the PR actually does");return}if(ZT6(Z,N,W,Date.now(),B))return;let O=rP6(Z,N,W,Date.now(),B);if(await FT6($,Z,N,H,O,J).catch((w)=>{return console.error(`[task-board] ${N} reviewer enqueue failed`,w),!1}))U.push(N)})),U}function rP6($,Z,Q,X=Date.now(),Y=!0){return $.threads.filter((J)=>NE(J.title,Z)&&JB1(J,X,Y)&&new Date(J.createdAt).getTime()>=Q).length}function sP6($,Z){if(!$||!Z||!("choices"in Z))return null;return Z.choices.find((Q)=>Q.repo===$)?.id??null}function eP6($,Z,Q){let X=$.threads.filter((Y)=>NE(Y.title,Z)&&Y.status==="completed"&&new Date(Y.createdAt).getTime()<Q).map((Y)=>new Date(Y.lastActiveAt).getTime()).filter((Y)=>Number.isFinite(Y));return X.length===0?0:Math.max(...X)}function JB1($,Z,Q=!0){if($.status==="failed")return!0;if($.status!==null&&ke$.has($.status))return!Q;return $.status!==null&&!d40($,Z)}function Se$($,Z,Q,X=Date.now()){return $.threads.filter((Y)=>{if(!NE(Y.title,Z))return!1;return d40(Y,X)||new Date(Y.createdAt).getTime()>=Q})}function $T6($,Z,Q,X=Date.now(),Y=!0){let J=Se$($,Z,Q,X);return J.length>0&&J.every((G)=>JB1(G,X,Y))&&J.length>=YB1}function ZT6($,Z,Q,X=Date.now(),Y=!0){let J=Se$($,Z,Q,X);if(J.length===0)return!1;if(J.some((K)=>d40(K,X)))return!0;let G=J.filter((K)=>JB1(K,X,Y));if(G.length>=YB1)return!0;return G.length!==J.length}function QT6($,Z,Q,X,Y=Date.now()){return $.threads.find((J)=>NE(J.title,Z)&&J.status==="completed"&&!d40(J,Y)&&new Date(J.createdAt).getTime()>=Q&&!X.has(J.threadId))??null}function XT6($,Z){let Q=new Map;for(let X of $){if(X.action!=="review_verdict_requested")continue;let Y=new Date(X.occurredAt).getTime();if(Y<Z)continue;let J=X.data?.threadId;if(typeof J==="string")Q.set(J,Y)}return Q}function JT6($,Z){for(let Q of $.values())if(Z-Q<YT6)return!0;return!1}function GT6($){return[`Your ${sU[$]} run ended without recording a decision, so the task is stuck: nothing ships and nobody is told why. A review that reaches no verdict is not a review.`,"","Do exactly ONE thing in this run and then stop:","- Call `TASK_BOARD_REVIEW_DECISION` now, with the verdict your review already reached and notes that say what you checked.","- Approve ONLY if you actually exercised the change and it holds. If you could not finish \u2014 a check never came back, a preview never rendered, you ran out of room \u2014 `request_changes` and say exactly what is unresolved. That hands the card to a person, which is the correct outcome for an unfinished review.","- Do NOT re-run the review, do NOT change any code, and do NOT wait on any background task: whatever you know right now is the verdict."].join(`
|