decocms 4.315.8 → 4.315.9
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-CkzV0rLF.js → AlertCircle-CL_4tn1p.js} +1 -1
- package/dist/client/assets/{AreaChart-pHg9Fx4q.js → AreaChart-j27KmB4g.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Dm5_VLV8.js → ArrowLeft-CTlE91Se.js} +1 -1
- package/dist/client/assets/{ArrowUp-CkqJs-MZ.js → ArrowUp-Cg_S3Ibc.js} +1 -1
- package/dist/client/assets/{Check-C2opEhYm.js → Check-BxJwXI1K.js} +1 -1
- package/dist/client/assets/{CheckCircle-BuxJYUrk.js → CheckCircle-BOEKgm4s.js} +1 -1
- package/dist/client/assets/{ChevronDown-Bueer4qU.js → ChevronDown-DJdrVENB.js} +1 -1
- package/dist/client/assets/{ChevronRight-DofQuep9.js → ChevronRight-DVQxNeux.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CDh4aSpQ.js → ChevronSelectorVertical-CeYKq1nS.js} +1 -1
- package/dist/client/assets/{ChevronUp-BKRDLJov.js → ChevronUp-D_e-_bgt.js} +1 -1
- package/dist/client/assets/{Copy01-ynzmMJf5.js → Copy01-r3rR8oFl.js} +1 -1
- package/dist/client/assets/{CreditCard01-iLPjz2EG.js → CreditCard01-B5lrI4QA.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dl2a4pwB.js → DotsVertical-CCLHyaor.js} +1 -1
- package/dist/client/assets/{Download01-D5_gKwhP.js → Download01-BMBwpCqW.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-77FeXJso.js → ErrorBarContext-CarF3tVq.js} +1 -1
- package/dist/client/assets/{Eye-DtRvnPj3.js → Eye-BDx5CVQ1.js} +1 -1
- package/dist/client/assets/{FilterLines-C90xQoMG.js → FilterLines-Be8XDwJK.js} +1 -1
- package/dist/client/assets/{GitBranch01-xz-_Yjyh.js → GitBranch01-BCGBIJSq.js} +1 -1
- package/dist/client/assets/{Globe01-CG410Az0.js → Globe01-Cn5Tf0_x.js} +1 -1
- package/dist/client/assets/{Globe04-BqFwV5BD.js → Globe04-DvBPwF-i.js} +1 -1
- package/dist/client/assets/{HardDrive-BXDcottD.js → HardDrive-C9LeptOg.js} +1 -1
- package/dist/client/assets/{Image01-DWQsBmMv.js → Image01-kU7eM7XD.js} +1 -1
- package/dist/client/assets/{Key01-N_ZWYtTX.js → Key01-Cm6_PJva.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D5ZZVcoA.js → LinkExternal01-BWZ7F1Al.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-DF_DQFCQ.js → LockUnlocked01-BR3rF-gO.js} +1 -1
- package/dist/client/assets/{LogOut01-Bp_us-Ox.js → LogOut01-B_RyGfAi.js} +1 -1
- package/dist/client/assets/{Monitor01-CmZ7P9ai.js → Monitor01-DqkHRD9c.js} +1 -1
- package/dist/client/assets/{Package-Dm3trmid.js → Package-BE8vO8A1.js} +1 -1
- package/dist/client/assets/{Palette-DT9uu6qO.js → Palette-B7cKDulV.js} +1 -1
- package/dist/client/assets/{Play-C96cznrL.js → Play-DtOxCqq9.js} +1 -1
- package/dist/client/assets/{Plus-DIm7CtF1.js → Plus-pF1gkrQu.js} +1 -1
- package/dist/client/assets/{SearchLg-GP23COxS.js → SearchLg-D4Puwtic.js} +1 -1
- package/dist/client/assets/{SearchMd-CO8ah3bm.js → SearchMd-NcT2_7Kt.js} +1 -1
- package/dist/client/assets/{Sector-DlhiHncA.js → Sector-BDJHHdvk.js} +1 -1
- package/dist/client/assets/{Settings02-DKIynolO.js → Settings02-BxXbVA5q.js} +1 -1
- package/dist/client/assets/{Share07-9sygjVhJ.js → Share07-C4XeWbrs.js} +1 -1
- package/dist/client/assets/{Shield01-BVjFRMqE.js → Shield01-OSTRjHtV.js} +1 -1
- package/dist/client/assets/{Stars01-Dy9Hsrtu.js → Stars01-DoaX-aGy.js} +1 -1
- package/dist/client/assets/{Stars02-BWafZXKL.js → Stars02-2Q9rKKnE.js} +1 -1
- package/dist/client/assets/{Sun-BU9tFsLF.js → Sun--FKpotKb.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-s2Jb9X7B.js → SwitchHorizontal01-Be37_ayv.js} +1 -1
- package/dist/client/assets/{Tool01-ClWaWn3c.js → Tool01-BogBG-0d.js} +1 -1
- package/dist/client/assets/{Tool02-DOXsydL5.js → Tool02-BRNvwlps.js} +1 -1
- package/dist/client/assets/{Trash01-CsCWSj3Z.js → Trash01-BqFal5cZ.js} +1 -1
- package/dist/client/assets/{TrendUp01-sisgIENp.js → TrendUp01-HylxHo_S.js} +1 -1
- package/dist/client/assets/{Upload01-x2XapLpM.js → Upload01-C3vnnmtB.js} +1 -1
- package/dist/client/assets/{User01-BLBnLkZ-.js → User01-BExsxEwq.js} +1 -1
- package/dist/client/assets/{UserSquare-CZB9NBEt.js → UserSquare-DbNMZZiK.js} +1 -1
- package/dist/client/assets/{Users01-DOJyIilu.js → Users01-kbK47QLH.js} +1 -1
- package/dist/client/assets/{Users03-Dr-turCI.js → Users03-0K5fdw0U.js} +1 -1
- package/dist/client/assets/{XCircle-ByLTULyg.js → XCircle-Y-35SKWf.js} +1 -1
- package/dist/client/assets/{XClose-C7Ypg3YR.js → XClose-CEk3thCy.js} +1 -1
- package/dist/client/assets/{YAxis-DNCqDEtu.js → YAxis-BirTvn3v.js} +1 -1
- package/dist/client/assets/{Zap-BFYXXgOH.js → Zap-ByV4KGZt.js} +1 -1
- package/dist/client/assets/{ZapSquare-B34n3eW3.js → ZapSquare-0ixpYIod.js} +1 -1
- package/dist/client/assets/{ZoomOut-De6Y8zsq.js → ZoomOut-DutIC766.js} +1 -1
- package/dist/client/assets/{access-gate-Dhqfvmrb.js → access-gate-CsL0UrqU.js} +1 -1
- package/dist/client/assets/{agent-icon-Dm8ROwob.js → agent-icon-DzkKc2-F.js} +1 -1
- package/dist/client/assets/{agents-list-CfklaJyI.js → agents-list-CRLJcP-F.js} +1 -1
- package/dist/client/assets/{ai-providers-lfEDJXBd.js → ai-providers-DC2V-odi.js} +1 -1
- package/dist/client/assets/{alert-CiTezlQb.js → alert-CIkkcDzY.js} +1 -1
- package/dist/client/assets/{alert-dialog-O_BHWaSR.js → alert-dialog-CkyuBFYU.js} +1 -1
- package/dist/client/assets/{analytics-tab-CPAQvUZw.js → analytics-tab-CNymj_o_.js} +1 -1
- package/dist/client/assets/{api-keys-WsnfK4vH.js → api-keys-CCgZd7P-.js} +1 -1
- package/dist/client/assets/{app-editor-E9viIdOu.js → app-editor-BFto2s4b.js} +1 -1
- package/dist/client/assets/{auth-97Xd2KQD.js → auth-B-lUc7JB.js} +1 -1
- package/dist/client/assets/{auth-catchall-BqZ4MSal.js → auth-catchall-04uLPCJa.js} +1 -1
- package/dist/client/assets/{auth-entry-Bv9nikOw.js → auth-entry-Vh_1p-8h.js} +1 -1
- package/dist/client/assets/{auth-split-layout-B_-U8HnZ.js → auth-split-layout-DzXV6Cyv.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CVuk8U7C.js → authenticate-and-persist-oauth-B6kuSGji.js} +1 -1
- package/dist/client/assets/{automation-list-row-B2WvcnD2.js → automation-list-row-CxXGHm2i.js} +1 -1
- package/dist/client/assets/{automation-runs-C-dUH7vL.js → automation-runs-RL4Kwf-0.js} +1 -1
- package/dist/client/assets/{automations-4bTczlBY.js → automations-DHigjlCG.js} +1 -1
- package/dist/client/assets/{avatar-T4HFdCsq.js → avatar-DlzgwwKu.js} +1 -1
- package/dist/client/assets/{badge-EiflaT_K.js → badge-BZBoWlI8.js} +1 -1
- package/dist/client/assets/{block-document-C1_9rW7y.js → block-document-C156keNk.js} +1 -1
- package/dist/client/assets/{breadcrumb-B0yqAhd6.js → breadcrumb-DzYTRi3x.js} +1 -1
- package/dist/client/assets/{buckets-CWUhQmS8.js → buckets-tkXWjufa.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-GjhYIh9Z.js → bulk-category-panel-CUzT4c0q.js} +1 -1
- package/dist/client/assets/{capability-load-error-D6yRI_bf.js → capability-load-error-DH0iwI9H.js} +1 -1
- package/dist/client/assets/{cards-Dgq9R2-4.js → cards-Dt3LM-42.js} +1 -1
- package/dist/client/assets/{category-editor-B5_P9UOK.js → category-editor-Odt9RZZD.js} +1 -1
- package/dist/client/assets/{cdn-tab-D2l8TTDd.js → cdn-tab-BJ9WT8PJ.js} +1 -1
- package/dist/client/assets/{chart-DJU2IjAo.js → chart-CBLWGjtp.js} +1 -1
- package/dist/client/assets/{chat-context-BY7xRXxg.js → chat-context-CJuvF_Xp.js} +1 -1
- package/dist/client/assets/{checkbox-B1YhjCUq.js → checkbox-BQPaB63z.js} +1 -1
- package/dist/client/assets/{choose-editor-y-iGUJNW.js → choose-editor-qy9C3IvH.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BM_DJoRX.js → cli-auth-success-D60ln-6M.js} +1 -1
- package/dist/client/assets/{collection-detail-C-h_IIbk.js → collection-detail-B1_5OcZk.js} +1 -1
- package/dist/client/assets/{collection-display-button-BoA_zNUN.js → collection-display-button-BLkdrF3x.js} +1 -1
- package/dist/client/assets/{collection-search-C3ITf4PL.js → collection-search-PEdTTjuO.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B9_lOrCX.js → collection-table-wrapper-BcFu8Zw5.js} +1 -1
- package/dist/client/assets/{collection-tabs-IptzBr8k.js → collection-tabs-kdKuJC7q.js} +1 -1
- package/dist/client/assets/{command-DQkOmuVt.js → command-B3frpUPd.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-B-9nQ9Kq.js → commerce-onboarding-De6IwIlB.js} +1 -1
- package/dist/client/assets/{config-DlJwhwZM.js → config-JQlEuDVB.js} +1 -1
- package/dist/client/assets/{connect-YDqCMEQg.js → connect-d22oVehh.js} +1 -1
- package/dist/client/assets/{connection-DXVX-Cvw.js → connection-DOtDb_My.js} +1 -1
- package/dist/client/assets/{connection-card-DZL8U2Oz.js → connection-card-DWbC2xiO.js} +1 -1
- package/dist/client/assets/{connection-detail-CrtV7_9C.js → connection-detail-C6hII8rU.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BehosOAh.js → connection-form-helpers-B88QRdFU.js} +1 -1
- package/dist/client/assets/{connections-a2JYR8lz.js → connections-DBK5-bEB.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DZgVeU98.js → decopilot-sse-pool-BDpW5Ile.js} +1 -1
- package/dist/client/assets/{dialog-Dje85m6l.js → dialog-B93cuv2j.js} +1 -1
- package/dist/client/assets/{domain-settings-D9L2FS30.js → domain-settings-BvpMSxSy.js} +1 -1
- package/dist/client/assets/{drawer-ByuY_14m.js → drawer-Dw_C-OFR.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DOvmqsiG.js → dropdown-menu-DFKdfWqR.js} +1 -1
- package/dist/client/assets/{e2e-tab-DhIvz2rJ.js → e2e-tab-DOoB_3LX.js} +1 -1
- package/dist/client/assets/{editor-Ci6UfGD4.js → editor-BUwVGK9H.js} +1 -1
- package/dist/client/assets/{empty-state-CWJrqb0p.js → empty-state-D2Lwpepj.js} +1 -1
- package/dist/client/assets/{empty-state-CBVYWgXH.js → empty-state-D4oRtGhK.js} +1 -1
- package/dist/client/assets/{extract-connection-data-qRGJBXXK.js → extract-connection-data-CRaRW80o.js} +1 -1
- package/dist/client/assets/{file-explorer-BOB0I3Xd.js → file-explorer-CqyuA_Or.js} +1 -1
- package/dist/client/assets/{file-type-icon-BL0Pha35.js → file-type-icon-zbvv6X-a.js} +1 -1
- package/dist/client/assets/{folder-icon-C0l5GzKL.js → folder-icon-CqgUuCJQ.js} +1 -1
- package/dist/client/assets/{form-BS9U3FXJ.js → form-cO8Ae-uo.js} +1 -1
- package/dist/client/assets/{general-DDxUxj4q.js → general-Cr0QzBen.js} +1 -1
- package/dist/client/assets/{github-repo-picker-la7DJEBj.js → github-repo-picker-BHWlExt5.js} +1 -1
- package/dist/client/assets/{hooks-FKOZdGJr.js → hooks-D6IFa_T3.js} +1 -1
- package/dist/client/assets/{hosting-tab-CenPiZoe.js → hosting-tab-BcPYFmK7.js} +1 -1
- package/dist/client/assets/{index-DRc6R8Fy.js → index-B-cZa7wO.js} +6 -6
- package/dist/client/assets/{index-BgHa4dOV.js → index-CVGE73KR.js} +1 -1
- package/dist/client/assets/{index-9AjWL1kY.js → index-CWCDqN5a.js} +1 -1
- package/dist/client/assets/{index-CuCJpWsz.js → index-CqaHxo9D.js} +1 -1
- package/dist/client/assets/{index-BZVho9-x.js → index-DKGYnX1-.js} +3 -3
- package/dist/client/assets/{index-5E9-9Po7.js → index-DNOFwZPj.js} +1 -1
- package/dist/client/assets/{index-BZiJU7qP.js → index-DnhjwHLJ.js} +1 -1
- package/dist/client/assets/{index-Chg16cvM.js → index-Dt2JEPgQ.js} +1 -1
- package/dist/client/assets/{index-cloLMcwk.js → index-DyUkIZwj.js} +1 -1
- package/dist/client/assets/{index-redirect-d54OB8uV.js → index-redirect-D1GFo6EN.js} +1 -1
- package/dist/client/assets/{infra-billing-DJW8PM-D.js → infra-billing-DIx1pNqi.js} +1 -1
- package/dist/client/assets/{input-DIJTuAiI.js → input-BcHHFntG.js} +1 -1
- package/dist/client/assets/{integration-icon-BuLRi6Ml.js → integration-icon-BHFBVJRp.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-qV1dhIC9.js → invite-member-dialog-DWH_RQe0.js} +1 -1
- package/dist/client/assets/{label-1eNt2dYG.js → label-DQA1pWHP.js} +1 -1
- package/dist/client/assets/{layout-AEVGrfbS.js → layout-CxknLOAB.js} +1 -1
- package/dist/client/assets/{login-CtpytVO1.js → login-D-YHxf_y.js} +1 -1
- package/dist/client/assets/{markdown-IvxHRyNi.js → markdown-DVCh_fSS.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BmtUTIZx.js → mcp-oauth-DghlcFJ0.js} +1 -1
- package/dist/client/assets/{members-DOCAYA4Z.js → members-Knrv1J6U.js} +1 -1
- package/dist/client/assets/{monaco-editor-DOxRkV0B.js → monaco-editor-HEsNuj5p.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-bKbPxkng.js → monitoring-stats-row-C2Bu3hAG.js} +1 -1
- package/dist/client/assets/{multi-select-BNyOYyQR.js → multi-select-BxUB4Pu8.js} +1 -1
- package/dist/client/assets/{oauth-callback-CSAwKqpa.js → oauth-callback-Cx_sZ7PB.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DP94Efqw.js → oauth-callback-ai-provider-H8mg4wXh.js} +1 -1
- package/dist/client/assets/{onboarding-D8d_QiIv.js → onboarding-4VcDWfx4.js} +1 -1
- package/dist/client/assets/{org-layout-BBYWQwag.js → org-layout-BuaZBt1u.js} +1 -1
- package/dist/client/assets/{organization-choice-B3v0o9jH.js → organization-choice-BuVF1S7l.js} +1 -1
- package/dist/client/assets/{orgs-DkD0u01M.js → orgs-BSyNQ5nv.js} +1 -1
- package/dist/client/assets/{page-seo-form-DIdWp_Gn.js → page-seo-form-CTIEBFhp.js} +1 -1
- package/dist/client/assets/{popover-B3OuMlKR.js → popover-BtaYotxf.js} +1 -1
- package/dist/client/assets/{post-calendar-DbqKByy3.js → post-calendar-BaFw8-Xi.js} +1 -1
- package/dist/client/assets/{post-editor-B4Dof7zD.js → post-editor-Bka6zxWi.js} +1 -1
- package/dist/client/assets/{primitives-D1x3zqY1.js → primitives-P2itvxW4.js} +1 -1
- package/dist/client/assets/{profile-BWhfQNoL.js → profile-DiGYOC37.js} +1 -1
- package/dist/client/assets/{project-app-view-xWbOkTi8.js → project-app-view-CYKEJGI9.js} +1 -1
- package/dist/client/assets/{prompts-Bs55oclw.js → prompts-BlmeJuLY.js} +1 -1
- package/dist/client/assets/record-editor-CMrfxwqc.js +1 -0
- package/dist/client/assets/{redirect-editor-h8Z1AAyl.js → redirect-editor-Dc13twyN.js} +1 -1
- package/dist/client/assets/registry-D1RK8ldf.js +2 -0
- package/dist/client/assets/{registry-layout-1EeeGV1e.js → registry-layout-BMpqGNDQ.js} +1 -1
- package/dist/client/assets/{reports-EUnUAqRe.js → reports-BNPcUZs8.js} +1 -1
- package/dist/client/assets/{require-capability-BFWk0jAl.js → require-capability-BVMnPdze.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BzolNhCo.js → required-auth-layout-DhiF2W1M.js} +1 -1
- package/dist/client/assets/{reset-password-BDzxBCgz.js → reset-password-_YUPdefm.js} +1 -1
- package/dist/client/assets/{review-settings-Dz3jJmfx.js → review-settings-BF10cbM5.js} +1 -1
- package/dist/client/assets/{roles-BpCgO6Te.js → roles-D1SBNCKM.js} +1 -1
- package/dist/client/assets/{scroll-area-CmfbQ0k6.js → scroll-area-Dv0RFNSf.js} +1 -1
- package/dist/client/assets/{search-input-B5IlyOHK.js → search-input-2jKUH-nd.js} +1 -1
- package/dist/client/assets/{secrets-B2tDxCCi.js → secrets-CLDVUmWB.js} +1 -1
- package/dist/client/assets/{sections-editor-BPDik0CJ.js → sections-editor-Bn4t7sOX.js} +1 -1
- package/dist/client/assets/{select-W5fEmgO1.js → select-Cc_Ttu05.js} +1 -1
- package/dist/client/assets/{select-model-BI5n0fdt.js → select-model-Yl5j2Tw9.js} +1 -1
- package/dist/client/assets/{self-tool-result-CUY8lXfh.js → self-tool-result-0cDglymW.js} +1 -1
- package/dist/client/assets/{seo-editor-DRA8CB5C.js → seo-editor-Dt5xTzhA.js} +1 -1
- package/dist/client/assets/{settings-layout-B-iZrQ19.js → settings-layout-xcp3z6Vj.js} +1 -1
- package/dist/client/assets/{shell-controls-BVuk02iv.js → shell-controls-CDF0CW1H.js} +1 -1
- package/dist/client/assets/{shell-layout-Bbu9US5Y.js → shell-layout-CeOtF7mb.js} +1 -1
- package/dist/client/assets/{skill-preview-Dx0wyioV.js → skill-preview-DNtnqRrN.js} +1 -1
- package/dist/client/assets/{skills-DTuZvYqf.js → skills-tzJVIYUM.js} +1 -1
- package/dist/client/assets/{spinner-2YrjsZ0k.js → spinner-3u4DI7qB.js} +1 -1
- package/dist/client/assets/{sso-BupLBJpT.js → sso-DTF7UPbu.js} +1 -1
- package/dist/client/assets/{store-BJW7M-v7.js → store-BKRqonLR.js} +1 -1
- package/dist/client/assets/store-registry-BwoIjmOK.js +2 -0
- package/dist/client/assets/{super-agent-icon-BzeHQLgI.js → super-agent-icon-C0KzQMI4.js} +1 -1
- package/dist/client/assets/{switch-C8ESSGPB.js → switch-CTvA9699.js} +1 -1
- package/dist/client/assets/{synced-repos-CqP_clO0.js → synced-repos-BrQQmACI.js} +1 -1
- package/dist/client/assets/{table-BHPFDuYO.js → table-CYbAOv1M.js} +1 -1
- package/dist/client/assets/{tabs-B0ILtoA9.js → tabs-CyPxPGyI.js} +1 -1
- package/dist/client/assets/{task-board-CDv-XJ2U.js → task-board-DfBQPg6r.js} +1 -1
- package/dist/client/assets/{tasks-B6g6Mxmz.js → tasks-o5W4MjSx.js} +1 -1
- package/dist/client/assets/{textarea-Buvn72cT.js → textarea-Dcz8E2N7.js} +1 -1
- package/dist/client/assets/{thread-route-DZYjgtCg.js → thread-route-SM9xfyxG.js} +1 -1
- package/dist/client/assets/{toggle-group-B-U60nZB.js → toggle-group-DCg-dK6K.js} +1 -1
- package/dist/client/assets/{toolbar-D_EEp8Mj.js → toolbar-DCWHnKyU.js} +1 -1
- package/dist/client/assets/{track-BCBM0lu5.js → track-D0InpUUu.js} +1 -1
- package/dist/client/assets/{types-CN4C807w.js → types-DuxK-8WA.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DG6vV5Hx.js → use-ai-providers-CocBUykr.js} +1 -1
- package/dist/client/assets/{use-api-keys-ByUSQjvJ.js → use-api-keys-CW4BDX4s.js} +1 -1
- package/dist/client/assets/{use-automations-CvP7MmXu.js → use-automations-BxFoGyOn.js} +1 -1
- package/dist/client/assets/{use-autosave-BPDElkW3.js → use-autosave--V_4nvzh.js} +1 -1
- package/dist/client/assets/{use-connection-G0MWfeF4.js → use-connection-Bz4cOi6L.js} +1 -1
- package/dist/client/assets/{use-copy-DF3dMdXF.js → use-copy-2LvRpRib.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B2Bs3JQL.js → use-create-virtual-mcp-DyR_TXkL.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DX7KGPEc.js → use-debounced-autosave-BXFXFPOt.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C6w6Kc_A.js → use-debounced-value-BxBz9Gt4.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DFEnjoJS.js → use-decopilot-events-9Stqn4Fp.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BarTqrm2.js → use-delete-connection-BZNVBVMW.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Hm0yvR3w.js → use-deployment-admin-C16tQ43l.js} +1 -1
- package/dist/client/assets/{use-destination-route-CKl6x7eL.js → use-destination-route-BAYYRSMz.js} +1 -1
- package/dist/client/assets/{use-file-configs-d52rl_fd.js → use-file-configs-CnCQVEM_.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CKkim1QW.js → use-infinite-scroll-xj-r2W2T.js} +1 -1
- package/dist/client/assets/{use-join-requests-8_-xybh7.js → use-join-requests-BnMn0g9C.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BeiIWrik.js → use-mcp-auth-status-2vgcaYP0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CMS2aS7J.js → use-mcp-client-RzjN97CT.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CtmU8Aal.js → use-mcp-tools-T7W49rqX.js} +1 -1
- package/dist/client/assets/{use-members-4PIyDy5T.js → use-members-N5DrJl_7.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C_6QH1UK.js → use-navigate-to-agent-KwNMNRZf.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-umGZ2fB_.js → use-org-auth-client-CSvcfVvV.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CmtgcHJE.js → use-org-repo-syncs-CwKu1zCq.js} +1 -1
- package/dist/client/assets/{use-org-sso--Yt5VHFo.js → use-org-sso-D2B_iEyT.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cul3X2-M.js → use-organization-roles-FD3PZmxl.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Co9OZfKz.js → use-organization-settings-BREcdDdo.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DcbNZKOV.js → use-panel-navigate-CSbrNiDT.js} +1 -1
- package/dist/client/assets/{use-registry-connections-2CgUfim7.js → use-registry-connections-D4-si3WM.js} +1 -1
- package/dist/client/assets/{use-secrets-DNcXH1YU.js → use-secrets-DtHucBuQ.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-D_FqALiA.js → use-section-preview-base-CiPIemFK.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BDhzi_jI.js → use-status-sounds-BVPc15m4.js} +1 -1
- package/dist/client/assets/{use-tags-DJgPmiFD.js → use-tags-D7V75gi7.js} +1 -1
- package/dist/client/assets/{use-view-mode-ADBenRd-.js → use-view-mode-CbNAWFtt.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C5o8otqw.js → use-virtual-mcp-BV7srTR4.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D_SaKo-D.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-By2e3GlB.js +1 -0
- package/dist/client/assets/{users-DfFNBEB8.js → users-DlxT9F32.js} +1 -1
- package/dist/client/assets/{variant-calendar-lF4fXJOc.js → variant-calendar-CD8bAuFU.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BM8sgJBI.js → view-mode-toggle-BPN4kr8A.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +3 -3
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/record-editor-IWeDRVn-.js +0 -1
- package/dist/client/assets/registry-DHg5sty2.js +0 -2
- package/dist/client/assets/store-registry-BUWLVl0z.js +0 -2
- package/dist/client/assets/useInfiniteQuery-B9Uzzuq-.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-2wSoxN5g.js +0 -1
package/dist/client/index.html
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<meta name="twitter:description" content="Hire specialized agents, give them access to your tools, and let them deliver real projects — with planning, verification, and observability built in." />
|
|
51
51
|
<meta name="twitter:image" content="/og-image.png" />
|
|
52
52
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
53
|
-
<script type="module" crossorigin src="/assets/index-
|
|
53
|
+
<script type="module" crossorigin src="/assets/index-DKGYnX1-.js"></script>
|
|
54
54
|
<link rel="stylesheet" crossorigin href="/assets/index-DZ3ZDC5F.css">
|
|
55
55
|
</head>
|
|
56
56
|
<body>
|
package/dist/server/cli.js
CHANGED
|
@@ -1508,7 +1508,7 @@ Usage: deco services <up|down|status>`),process.exit(1)}}var yn1=L(()=>{Fb()});f
|
|
|
1508
1508
|
`.execute($);if(Number(W.rows[0]?.cnt)===0){console.warn(`Failed to migrate ${J}/${K}, keeping in old table`);continue}}await fy`
|
|
1509
1509
|
DELETE FROM kysely_migration WHERE name = ${X}
|
|
1510
1510
|
`.execute($)}}async function gs1($){await w04($),await E04($);let Z=new bs1({db:$,provider:{getMigrations:()=>Promise.resolve(In0)}}),{error:X,results:Q}=await Z.migrateToLatest(),Y=0;if(Q?.forEach((G)=>{if(G.status==="Success")Y++;else if(G.status==="Error")console.error(`Failed to execute migration "${G.migrationName}"`)}),X)throw console.error("Failed to migrate"),console.error(X),X;return Y}async function j04($){let{keepOpen:Z=!1,database:X,skipBetterAuth:Q=!1}=$??{},Y="skipped";if(!Q&&!X)Y=await Om0();let G=X??U8(),J=async()=>{if(!Z&&!X)await FO(G).catch((K)=>{console.warn("Warning: Error closing database:",K)})};try{let K=await gs1(G.db);return await J(),{betterAuth:Y,kysely:K}}catch(K){throw await J(),K}}async function z04(){let $=U8(),Z=new bs1({db:$.db,provider:{getMigrations:()=>Promise.resolve(In0)}}),{error:X,results:Q}=await Z.migrateDown();if(Q?.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}"`)}),X)throw console.error("Failed to rollback migration"),console.error(X),X}var us1=L(()=>{fs1();Lm0();FX()});async function g70($){let Z={...process.env},X=S80($,Z);console.log(hE1(X.settings.encryptionKey));let Q=X.settings.betterAuthSecret||(X.settings.localMode?Oo1(X.settings.dataDir):""),{ensureServices:Y}=await Promise.resolve().then(() => (lZ0(),cZ0)),{outputs:G,services:J}=await Y({home:X.settings.dataDir,externalDatabaseUrl:X.externalDatabaseUrl,externalNatsUrl:X.externalNatsUrl});if(!X.skipMigrations){let{migrateBetterAuth:W}=await Promise.resolve().then(() => (Lm0(),Do1));await W(G.databaseUrl);let{createDatabase:H}=await Promise.resolve().then(() => (FX(),_t1)),{migrateToLatest:F}=await Promise.resolve().then(() => (us1(),hs1)),N=H(G.databaseUrl);await F({keepOpen:!0,database:N,skipBetterAuth:!0})}let K={...X.settings,betterAuthSecret:Q,databaseUrl:G.databaseUrl,natsUrls:G.natsUrls,...G.s3?{s3Endpoint:G.s3.endpoint,s3Bucket:G.s3.bucket,s3AccessKeyId:G.s3.accessKeyId,s3SecretAccessKey:G.s3.secretAccessKey,s3ForcePathStyle:G.s3.forcePathStyle}:{}};return gn1(K),{settings:K,services:J.map((W)=>({name:W.name==="PostgreSQL"?"Postgres":W.name,port:W.port})),managedServiceNames:J.filter((W)=>W.owner==="managed").map((W)=>W.name)}}var qn0=L(()=>{Fb();Lo1();P$()});var ds1={};e(ds1,{updateService:()=>Yj,subscribeCliState:()=>kn0,setTuiConsoleIntercepted:()=>h70,setServerUrl:()=>xp,setMigrationsDone:()=>vp,setDevMode:()=>A04,resetCliStateForTests:()=>P04,isTuiConsoleIntercepted:()=>u70,getCliState:()=>Vn0,addLogEntry:()=>wO});function cs1(){return[{name:"Postgres",status:"pending",port:0},{name:"NATS",status:"pending",port:0}]}function ls1(){return{services:cs1(),migrationsStatus:"pending",serverUrl:null,logs:[]}}function P04(){nQ=ls1()}function _p(){for(let $ of Mn0)$()}function Vn0(){return nQ}function kn0($){return Mn0.add($),()=>Mn0.delete($)}function Yj($){nQ={...nQ,services:nQ.services.map((Z)=>Z.name===$.name?$:Z)},_p()}function vp(){nQ={...nQ,migrationsStatus:"done"},_p()}function xp($){nQ={...nQ,serverUrl:$},_p()}function wO($){let Z=[...nQ.logs,$];nQ={...nQ,logs:Z.length>500?Z.slice(-500):Z},_p()}function A04(){nQ={...nQ,services:[...cs1(),{name:"API",status:"pending",port:0},{name:"Vite",status:"pending",port:0}]},_p()}function h70($){ms1=$}function u70(){return ms1}var nQ,Mn0,ms1=!1;var Gj=L(()=>{nQ=ls1();Mn0=new Set});import{createServer as is1}from"net";function T04($){return new Promise((Z)=>{let X=is1();X.once("error",()=>Z(!1)),X.listen($,"0.0.0.0",()=>{X.close(()=>Z(!0))})})}async function fp($){if(await T04($))return $;let Z=await new Promise((X,Q)=>{let Y=is1();Y.once("error",Q),Y.listen(0,"0.0.0.0",()=>{let G=Y.address(),J=typeof G==="object"&&G?G.port:0;Y.close(()=>X(J))})});return console.warn(`Port ${$} is in use, using port ${Z} instead.`),Z}var Sn0=()=>{};var _n0={};e(_n0,{startDevServer:()=>I04,pipeToLogStore:()=>Cn0});import{join as R04}from"path";function Cn0($){let Z=$.getReader(),X=new TextDecoder,Q="";function Y(){let G=Q.split(`
|
|
1511
|
-
`);Q=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;wO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:G,value:J}=await Z.read();if(G)break;Q+=X.decode(J,{stream:!0}),Y()}}catch{}if(Q.trim()){let G=Bun.stripANSI(Q).replace(/^\[\d+\]\s*/,"").trim();if(G)wO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function I04($){let{baseUrl:Z,noTui:X}=$,Q=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=Q?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=Q?await fp(Number(Y)+1):await fp(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await g70({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)Yj({name:D.name,status:"ready",port:D.port});vp();let F=R04(import.meta.dir,"..","..","..","..",".."),N=X===!0,U=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:G,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",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)Cn0(U.stdout),Cn0(U.stderr);xp(G),Yj({name:"Vite",status:"ready",port:Number(Y)}),Yj({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(U.kill(D),await U.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (lZ0(),cZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var vn0=L(()=>{qn0();Gj();Sn0()});var c70;var xn0=L(()=>{c70={name:"decocms",version:"4.315.8",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":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@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":"^2.9.1","@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":"^3.0.10","@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:"^6.0.208","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 M04,Text as ps1}from"ink";import{jsx as V04,jsxs as ns1}from"react/jsx-runtime";function ts1({version:$}){return ns1(M04,{flexDirection:"column",marginTop:1,children:[N70.map((Z,X)=>V04(ps1,{color:U70[X],children:Z},X)),ns1(ps1,{dimColor:!0,children:[" v",$]})]})}var os1=L(()=>{zp()});import{Box as Jj,Text as EO}from"ink";import{Spinner as k04}from"@inkjs/ui";import{jsx as HG,jsxs as by}from"react/jsx-runtime";function rs1({status:$}){if($==="pending")return HG(k04,{label:""});return HG(EO,{color:"green",children:"\u2713"})}function S04($){return`${$.name}: ${$.port||"...."}`}function as1({services:$,migrationsStatus:Z,home:X,serverUrl:Q}){return by(Jj,{flexDirection:"column",paddingBottom:1,children:[HG(ts1,{version:c70.version}),HG(Jj,{marginBottom:1,children:HG(EO,{dimColor:!0,children:"\u2500".repeat(80)})}),HG(Jj,{children:by(EO,{dimColor:!0,children:["Home: ",X]})}),by(Jj,{gap:2,children:[$.map((Y)=>by(Jj,{gap:1,children:[HG(EO,{children:S04(Y)}),HG(rs1,{status:Y.status})]},Y.name)),by(Jj,{gap:1,children:[HG(EO,{children:"Migrations"}),HG(rs1,{status:Z})]})]}),HG(Jj,{children:Q?by(EO,{children:["Open in browser: ",HG(EO,{color:"cyan",children:Q})]}):HG(EO,{dimColor:!0,children:"Starting..."})})]})}var ss1=L(()=>{xn0();os1()});import{Box as C04,Text as bp}from"ink";import{jsx as fn0,jsxs as bn0}from"react/jsx-runtime";function _04($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function es1({logs:$}){return fn0(C04,{flexDirection:"column",children:$.map((Z,X)=>{if(Z.rawLine)return fn0(bp,{dimColor:!0,children:Z.rawLine},X);let Q=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return bn0(bp,{children:[bn0(bp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),fn0(bp,{color:_04(Z.status),children:Z.status}),bn0(bp,{dimColor:!0,children:[" ",Q.padStart(8)]})]},X)})})}var $e1=()=>{};var yn0={};e(yn0,{App:()=>f04});import{Box as v04}from"ink";import{useSyncExternalStore as x04}from"react";import{jsx as Ze1,jsxs as b04}from"react/jsx-runtime";function f04({home:$}){let Z=x04(kn0,Vn0);return b04(v04,{flexDirection:"column",children:[Ze1(as1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Ze1(es1,{logs:Z.logs})]})}var gn0=L(()=>{ss1();$e1();Gj()});var a3="thread-gate",PN="decopilot-hosted-harness",AN="decopilot-hosted-harness-sandboxed",AJ="automations",jO="background-tools",Kj="task-board-github-reads",zO="jira-push";var Xe1="10";function Qe1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Xe1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var Ye1=()=>{};import y04 from"pg";async function Je1($,Z){let{databaseUrl:X,lockTimeoutMs:Q=g04}=$,Y=$.log??((W)=>console.log(W)),G=new y04.Client({connectionString:X});await G.connect();let J=Date.now(),K=!1;try{while(!K){if(K=(await G.query("SELECT pg_try_advisory_lock($1) AS locked",[Ge1.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-J>=Q)throw Error(`Timed out after ${Q}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await H$(h04)}let W=Date.now()-J;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await G.query("SELECT pg_advisory_unlock($1)",[Ge1.toString()])}catch{}await G.end().catch(()=>{})}}var Ge1=8314027461559302n,g04=600000,h04=500;var Ke1=L(()=>{J4()});function u04(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function hn0($,Z){for(let X=0;X<$.length;X++){let Q=$[X];if(Q===void 0)continue;if(Q===Z)return $[X+1];if(Q.startsWith(`${Z}=`))return Q.slice(Z.length+1)}return}function We1(){let $=u04();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:hn0($,"--cpu-prof-dir")??process.cwd(),name:hn0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(hn0($,"--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 He1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let X=$j();if(!X)return;let Q={};try{let{heapStats:Y}=await import("bun:jsc"),G=Y(),J=Object.entries(G.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);Q={objectCount:G.objectCount,heapSize:G.heapSize,top:Object.fromEntries(J)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:X.rss,heapUsed:X.heapUsed,heapTotal:X.heapTotal,external:X.external,arrayBuffers:X.arrayBuffers,...Q}))};return Z().catch(()=>{}),l70=setInterval(()=>void Z().catch(()=>{}),$),l70.unref?.(),process.on("SIGUSR2",()=>{try{let X=Bun.generateHeapSnapshot("v8"),Q=typeof X==="string"?X:JSON.stringify(X),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,Q),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(X){console.error("[heap-watch] snapshot failed:",X)}}),()=>{if(l70)clearInterval(l70)}}var l70;var Fe1=()=>{};import*as c04 from"bun:jsc";function Ne1(){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{l04()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let X,Q=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-Q;Q=G+Z;let K=[];try{K=m04()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let F of K){let N=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!N)continue;let U=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${N.name??"?"} @ ${U}:${N.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,N)=>N[1]-F[1]).slice(0,8).map(([F,N])=>({frame:F,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}X=setTimeout(Y,Z),X.unref?.()};return X=setTimeout(Y,Z),X.unref?.(),()=>{if(X)clearTimeout(X)}}var l04,m04;var Ue1=L(()=>{({startSamplingProfiler:l04,samplingProfilerStackTraces:m04}=c04)});function Be1(){We1();let $=[He1(),Rt1(),Ne1()];return()=>{for(let Z of $)Z()}}var Oe1=L(()=>{Gm0();Fe1();Ue1()});var Wj=x((Le1)=>{Object.defineProperty(Le1,"__esModule",{value:!0});Le1.RepublishHeaders=Le1.DirectMsgHeaders=Le1.JsHeaders=Le1.AdvisoryKind=void 0;Le1.isOrderedPushConsumerOptions=d04;Le1.isPullConsumer=i04;Le1.isPushConsumer=p04;Le1.isBoundPushConsumerOptions=n04;function d04($){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 i04($){return $.isPullConsumer()}function p04($){return $.isPushConsumer()}function n04($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Le1.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"};Le1.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"};Le1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Le1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var FG=x((we1)=>{Object.defineProperty(we1,"__esModule",{value:!0});we1.TD=we1.TE=we1.Empty=void 0;we1.encode=X14;we1.decode=Q14;we1.Empty=new Uint8Array(0);we1.TE=new TextEncoder;we1.TD=new TextDecoder;function Z14(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}function X14(...$){let Z=[];for(let X=0;X<$.length;X++)Z.push(we1.TE.encode($[X]));if(Z.length===0)return we1.Empty;if(Z.length===1)return Z[0];return Z14(...Z)}function Q14($){if(!$||$.length===0)return"";return we1.TD.decode($)}});var NG=x((ze1)=>{Object.defineProperty(ze1,"__esModule",{value:!0});ze1.errors=ze1.PermissionViolationError=ze1.NoRespondersError=ze1.TimeoutError=ze1.RequestError=ze1.ProtocolError=ze1.ConnectionError=ze1.DrainingConnectionError=ze1.ClosedConnectionError=ze1.AuthorizationError=ze1.UserAuthenticationExpiredError=ze1.InvalidOperationError=ze1.InvalidArgumentError=ze1.InvalidSubjectError=void 0;class cn0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}ze1.InvalidSubjectError=cn0;class m70 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,X){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((Q)=>`'${Q}'`),$=$.join(",");else $=`'${$}'`;return new m70(`${$} ${Z}`,X)}}ze1.InvalidArgumentError=m70;class ln0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}ze1.InvalidOperationError=ln0;class d70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new d70($);return null}}ze1.UserAuthenticationExpiredError=d70;class i70 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],X=$.toLowerCase();for(let Q=0;Q<Z.length;Q++)if(X.indexOf(Z[Q])!==-1)return new i70($);return null}}ze1.AuthorizationError=i70;class mn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}ze1.ClosedConnectionError=mn0;class dn0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}ze1.DrainingConnectionError=dn0;class in0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}ze1.ConnectionError=in0;class pn0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}ze1.ProtocolError=pn0;class nn0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof p70}}ze1.RequestError=nn0;class tn0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}ze1.TimeoutError=tn0;class p70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}ze1.NoRespondersError=p70;class n70 extends Error{operation;subject;queue;constructor($,Z,X,Q,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=X,this.queue=Q}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let X="publish",Q="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(X=G[1].toLowerCase(),Q=G[2],X==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new n70($,X,Q,Y)}}ze1.PermissionViolationError=n70;ze1.errors={AuthorizationError:i70,ClosedConnectionError:mn0,ConnectionError:in0,DrainingConnectionError:dn0,InvalidArgumentError:m70,InvalidOperationError:ln0,InvalidSubjectError:cn0,NoRespondersError:p70,PermissionViolationError:n70,ProtocolError:pn0,RequestError:nn0,TimeoutError:tn0,UserAuthenticationExpiredError:d70}});var s3=x((Ie1)=>{Object.defineProperty(Ie1,"__esModule",{value:!0});Ie1.SimpleMutex=Ie1.Perf=void 0;Ie1.extend=z14;Ie1.render=P14;Ie1.timeout=A14;Ie1.delay=T14;Ie1.deadline=R14;Ie1.deferred=rn0;Ie1.debugDeferred=I14;Ie1.shuffle=q14;Ie1.collect=M14;Ie1.jitter=Re1;Ie1.backoff=V14;Ie1.nanos=k14;Ie1.millis=S14;Ie1.randomToken=v14;var j14=FG(),on0=NG();function z14($,...Z){for(let X=0;X<Z.length;X++){let Q=Z[X];Object.keys(Q).forEach(function(Y){$[Y]=Q[Y]})}return $}function P14($){return j14.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function A14($,Z=!0){let X=Z?new on0.TimeoutError:null,Q,Y,G=new Promise((J,K)=>{Q={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(X===null)K(new on0.TimeoutError);else K(X)},$)});return Object.assign(G,Q)}function T14($=0){let Z,X=new Promise((Q)=>{let Y=setTimeout(()=>{Q()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),Q()}}});return Object.assign(X,Z)}async function R14($,Z=1000){let X=rn0(),Q=setTimeout(()=>{X.reject(new on0.TimeoutError)},Z);try{return await Promise.race([$,X])}finally{clearTimeout(Q)}}function rn0(){let $={},Z=new Promise((X,Q)=>{$={resolve:X,reject:Q}});return Object.assign(Z,$)}function I14(){let $={},Z=new Promise((X,Q)=>{$={resolve:(Y)=>{console.trace("resolve",Y),X(Y)},reject:(Y)=>{console.trace("reject"),Q(Y)}}});return Object.assign(Z,$)}function q14($){for(let Z=$.length-1;Z>0;Z--){let X=Math.floor(Math.random()*(Z+1));[$[Z],$[X]]=[$[X],$[Z]]}return $}async function M14($){let Z=[];for await(let X of $)Z.push(X);return Z}class Ae1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,X){let Q=this.timers.get(Z);if(Q===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(X);if(Y===void 0)throw Error(`${X} is not defined`);this.measures.set($,Y-Q)}getEntries(){let $=[];return this.measures.forEach((Z,X)=>{$.push({name:X,duration:Z})}),$}}Ie1.Perf=Ae1;class Te1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=rn0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}Ie1.SimpleMutex=Te1;function Re1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function V14($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(X){return Re1(X>Z?$[Z]:$[X])}}}function k14($){return $*1e6}function S14($){return Math.floor($/1e6)}var C14="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",TN=new Uint8Array(62);for(let $=0;$<62;$++)TN[$]=C14.charCodeAt($);var _14=218340105584896;function v14(){let $=Math.floor(Math.random()*_14),Z=$%62,X=TN[Z];$=($-Z)/62,Z=$%62;let Q=TN[Z];$=($-Z)/62,Z=$%62;let Y=TN[Z];$=($-Z)/62,Z=$%62;let G=TN[Z];$=($-Z)/62,Z=$%62;let J=TN[Z];$=($-Z)/62,Z=$%62;let K=TN[Z];$=($-Z)/62,Z=$%62;let W=TN[Z];$=($-Z)/62;let H=TN[$];return String.fromCharCode(X,Q,Y,G,J,K,W,H)}});var ve1=x((Ce1)=>{Object.defineProperty(Ce1,"__esModule",{value:!0});Ce1.nuid=Ce1.NuidImpl=void 0;var o14="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",PO=62,o70=12,ke1=10,Me1=33,r14=333,Ve1=o70+ke1,sn0=new Uint8Array(PO);for(let $=0;$<PO;$++)sn0[$]=o14.charCodeAt($);var t70=4294967296,Se1=BigInt(PO)**BigInt(ke1),yp=Number(Se1/(1n<<32n)),an0=Number(Se1%(1n<<32n));function a14($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function s14($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else a14($)}class en0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(Ve1),this.cbuf=new Uint8Array(o70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(yp+1)),this.seqLo=Math.floor(Math.random()*t70);while($++<8&&this.seqHi===yp&&this.seqLo>=an0);if(this.seqHi===yp&&this.seqLo>=an0)this.seqLo=0;this.inc=Math.random()*(r14-Me1)+Me1|0}setPre(){s14(this.cbuf);for(let $=0;$<o70;$++)this.buf[$]=sn0[this.cbuf[$]%PO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let X=Ve1-1;X>=o70;X--){let Q=Math.floor($/PO),G=($-Q*PO)*t70+Z,J=Math.floor(G/PO),K=G-J*PO;this.buf[X]=sn0[K],$=Q,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=t70)this.seqLo-=t70,this.seqHi+=1;if(this.seqHi>yp||this.seqHi===yp&&this.seqLo>=an0)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()}}Ce1.NuidImpl=en0;Ce1.nuid=new en0});var ye1=x((fe1)=>{Object.defineProperty(fe1,"__esModule",{value:!0});fe1.nuid=fe1.Nuid=void 0;var xe1=ve1();fe1.Nuid=xe1.NuidImpl;fe1.nuid=xe1.nuid});var a70=x((r70)=>{Object.defineProperty(r70,"__esModule",{value:!0});r70.nuid=r70.Nuid=void 0;var ge1=ye1();Object.defineProperty(r70,"Nuid",{enumerable:!0,get:function(){return ge1.Nuid}});Object.defineProperty(r70,"nuid",{enumerable:!0,get:function(){return ge1.nuid}})});var AO=x((he1)=>{Object.defineProperty(he1,"__esModule",{value:!0});he1.DEFAULT_HOST=he1.DEFAULT_PORT=he1.Match=void 0;he1.syncIterator=Y$4;he1.createInbox=G$4;var X$4=a70(),Q$4=NG();he1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function Y$4($){let Z=$[Symbol.asyncIterator]();return{async next(){let X=await Z.next();if(X.done)return Promise.resolve(null);return Promise.resolve(X.value)}}}function G$4($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw Q$4.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${X$4.nuid.next()}`}he1.DEFAULT_PORT=4222;he1.DEFAULT_HOST="127.0.0.1"});var gp=x((me1)=>{Object.defineProperty(me1,"__esModule",{value:!0});me1.DataBuffer=void 0;var ce1=FG();class le1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}static fromAscii($){if(!$)$="";return ce1.TE.encode($)}static toAscii($){return ce1.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 X=0;X<this.buffers.length;X++)$.set(this.buffers[X],Z),Z+=this.buffers[X].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 X=this.byteLength;if($===void 0||$>X)$=X;let Q=Z.subarray(0,$);if(X>$)this.buffers.push(Z.subarray($));return this.byteLength=X-$,Q}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let X=0;X<Z.length;X++)if(Z[X]&&Z[X].length)this.buffers.push(Z[X]),this.byteLength+=Z[X].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}}me1.DataBuffer=le1});var Hj=x((pe1)=>{Object.defineProperty(pe1,"__esModule",{value:!0});pe1.LF=pe1.CR=pe1.CRLF=pe1.CR_LF_LEN=pe1.CR_LF=void 0;pe1.setTransportFactory=B$4;pe1.defaultPort=O$4;pe1.getUrlParseFn=L$4;pe1.newTransport=D$4;pe1.getResolveFn=w$4;pe1.protoLen=ie1;pe1.extractProtocolMessage=E$4;var F$4=FG(),N$4=AO(),U$4=gp(),UG;function B$4($){UG=$}function O$4(){return UG!==void 0&&UG.defaultPort!==void 0?UG.defaultPort:N$4.DEFAULT_PORT}function L$4(){return UG!==void 0&&UG.urlParseFn?UG.urlParseFn:void 0}function D$4(){if(!UG||typeof UG.factory!=="function")throw Error("transport fn is not set");return UG.factory()}function w$4(){return UG!==void 0&&UG.dnsResolveFn?UG.dnsResolveFn:void 0}pe1.CR_LF=`\r
|
|
1511
|
+
`);Q=G.pop()??"";for(let J of G){let K=Bun.stripANSI(J).replace(/^\[\d+\]\s*/,"").trim();if(!K)continue;wO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:K})}}(async()=>{try{for(;;){let{done:G,value:J}=await Z.read();if(G)break;Q+=X.decode(J,{stream:!0}),Y()}}catch{}if(Q.trim()){let G=Bun.stripANSI(Q).replace(/^\[\d+\]\s*/,"").trim();if(G)wO({method:"",path:"",status:0,duration:0,timestamp:new Date,rawLine:G})}})()}async function I04($){let{baseUrl:Z,noTui:X}=$,Q=process.env.HOST==="0.0.0.0"&&Boolean(process.env.PORT),Y=Q?process.env.PORT:$.vitePort,G=Z||`http://localhost:${Y}`,J=Q?await fp(Number(Y)+1):await fp(Number($.port)),{settings:K,services:W,managedServiceNames:H}=await g70({port:String(J),home:$.home,baseUrl:$.baseUrl,localMode:$.localMode,skipMigrations:$.skipMigrations,noTui:$.noTui,vitePort:$.vitePort});for(let D of W)Yj({name:D.name,status:"ready",port:D.port});vp();let F=R04(import.meta.dir,"..","..","..","..",".."),N=X===!0,U=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:G,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",N?"inherit":"pipe",N?"inherit":"pipe"]});if(!N)Cn0(U.stdout),Cn0(U.stderr);xp(G),Yj({name:"Vite",status:"ready",port:Number(Y)}),Yj({name:"API",status:"ready",port:Number(K.port)});let O=async(D)=>{if(U.kill(D),await U.exited,H.length>0){let{stopServices:w}=await Promise.resolve().then(() => (lZ0(),cZ0));await w(K.dataDir)}};return process.on("SIGINT",()=>O("SIGINT")),process.on("SIGTERM",()=>O("SIGTERM")),{port:Number(Y),process:U}}var vn0=L(()=>{qn0();Gj();Sn0()});var c70;var xn0=L(()=>{c70={name:"decocms",version:"4.315.9",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":"^3.0.85","@ai-sdk/google":"^3.0.83","@ai-sdk/openai":"^3.0.73","@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":"^2.9.1","@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":"^3.0.10","@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:"^6.0.208","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 M04,Text as ps1}from"ink";import{jsx as V04,jsxs as ns1}from"react/jsx-runtime";function ts1({version:$}){return ns1(M04,{flexDirection:"column",marginTop:1,children:[N70.map((Z,X)=>V04(ps1,{color:U70[X],children:Z},X)),ns1(ps1,{dimColor:!0,children:[" v",$]})]})}var os1=L(()=>{zp()});import{Box as Jj,Text as EO}from"ink";import{Spinner as k04}from"@inkjs/ui";import{jsx as HG,jsxs as by}from"react/jsx-runtime";function rs1({status:$}){if($==="pending")return HG(k04,{label:""});return HG(EO,{color:"green",children:"\u2713"})}function S04($){return`${$.name}: ${$.port||"...."}`}function as1({services:$,migrationsStatus:Z,home:X,serverUrl:Q}){return by(Jj,{flexDirection:"column",paddingBottom:1,children:[HG(ts1,{version:c70.version}),HG(Jj,{marginBottom:1,children:HG(EO,{dimColor:!0,children:"\u2500".repeat(80)})}),HG(Jj,{children:by(EO,{dimColor:!0,children:["Home: ",X]})}),by(Jj,{gap:2,children:[$.map((Y)=>by(Jj,{gap:1,children:[HG(EO,{children:S04(Y)}),HG(rs1,{status:Y.status})]},Y.name)),by(Jj,{gap:1,children:[HG(EO,{children:"Migrations"}),HG(rs1,{status:Z})]})]}),HG(Jj,{children:Q?by(EO,{children:["Open in browser: ",HG(EO,{color:"cyan",children:Q})]}):HG(EO,{dimColor:!0,children:"Starting..."})})]})}var ss1=L(()=>{xn0();os1()});import{Box as C04,Text as bp}from"ink";import{jsx as fn0,jsxs as bn0}from"react/jsx-runtime";function _04($){if($>=500)return"red";if($>=400)return"yellow";if($>=300)return"cyan";return"green"}function es1({logs:$}){return fn0(C04,{flexDirection:"column",children:$.map((Z,X)=>{if(Z.rawLine)return fn0(bp,{dimColor:!0,children:Z.rawLine},X);let Q=Z.duration<1000?`${Z.duration}ms`:`${(Z.duration/1000).toFixed(1)}s`;return bn0(bp,{children:[bn0(bp,{dimColor:!0,children:[Z.method.padEnd(6)," ",Z.path.padEnd(30)," "]}),fn0(bp,{color:_04(Z.status),children:Z.status}),bn0(bp,{dimColor:!0,children:[" ",Q.padStart(8)]})]},X)})})}var $e1=()=>{};var yn0={};e(yn0,{App:()=>f04});import{Box as v04}from"ink";import{useSyncExternalStore as x04}from"react";import{jsx as Ze1,jsxs as b04}from"react/jsx-runtime";function f04({home:$}){let Z=x04(kn0,Vn0);return b04(v04,{flexDirection:"column",children:[Ze1(as1,{services:Z.services,migrationsStatus:Z.migrationsStatus,home:$,serverUrl:Z.serverUrl}),Ze1(es1,{logs:Z.logs})]})}var gn0=L(()=>{ss1();$e1();Gj()});var a3="thread-gate",PN="decopilot-hosted-harness",AN="decopilot-hosted-harness-sandboxed",AJ="automations",jO="background-tools",Kj="task-board-github-reads",zO="jira-push";var Xe1="10";function Qe1($){return{name:"decocms",systemDatabaseUrl:$.systemDatabaseUrl,systemDatabaseSchemaName:"dbos",systemDatabasePoolSize:$.poolSize,runAdminServer:!1,executorID:$.executorID,applicationVersion:Xe1,...$.listenQueues!==void 0?{listenQueues:$.listenQueues}:{}}}var Ye1=()=>{};import y04 from"pg";async function Je1($,Z){let{databaseUrl:X,lockTimeoutMs:Q=g04}=$,Y=$.log??((W)=>console.log(W)),G=new y04.Client({connectionString:X});await G.connect();let J=Date.now(),K=!1;try{while(!K){if(K=(await G.query("SELECT pg_try_advisory_lock($1) AS locked",[Ge1.toString()])).rows[0]?.locked===!0,K)break;if(Date.now()-J>=Q)throw Error(`Timed out after ${Q}ms waiting for the DBOS migration lock. Another process is still migrating the dbos schema; this pod will restart and retry.`);await H$(h04)}let W=Date.now()-J;if(W>1000)Y(`[dbos] waited ${W}ms for the migration lock; another process migrated first`);return await Z()}finally{if(K)try{await G.query("SELECT pg_advisory_unlock($1)",[Ge1.toString()])}catch{}await G.end().catch(()=>{})}}var Ge1=8314027461559302n,g04=600000,h04=500;var Ke1=L(()=>{J4()});function u04(){let $=(process.env.BUN_OPTIONS??"").split(/\s+/).filter(Boolean);return[...process.argv.slice(1),...$]}function hn0($,Z){for(let X=0;X<$.length;X++){let Q=$[X];if(Q===void 0)continue;if(Q===Z)return $[X+1];if(Q.startsWith(`${Z}=`))return Q.slice(Z.length+1)}return}function We1(){let $=u04();if($.includes("--cpu-prof")){console.log(JSON.stringify({msg:"cpu-profiling-active",dir:hn0($,"--cpu-prof-dir")??process.cwd(),name:hn0($,"--cpu-prof-name"),markdown:$.includes("--cpu-prof-md"),intervalUs:Number(hn0($,"--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 He1(){if(process.env.HEAP_WATCH!=="1")return()=>{};let $=Number(process.env.HEAP_WATCH_INTERVAL_MS??60000),Z=async()=>{let X=$j();if(!X)return;let Q={};try{let{heapStats:Y}=await import("bun:jsc"),G=Y(),J=Object.entries(G.objectTypeCounts).sort((K,W)=>W[1]-K[1]).slice(0,20);Q={objectCount:G.objectCount,heapSize:G.heapSize,top:Object.fromEntries(J)}}catch{}console.log(JSON.stringify({msg:"heap-watch",ts:new Date().toISOString(),uptimeS:Math.round(process.uptime()),rss:X.rss,heapUsed:X.heapUsed,heapTotal:X.heapTotal,external:X.external,arrayBuffers:X.arrayBuffers,...Q}))};return Z().catch(()=>{}),l70=setInterval(()=>void Z().catch(()=>{}),$),l70.unref?.(),process.on("SIGUSR2",()=>{try{let X=Bun.generateHeapSnapshot("v8"),Q=typeof X==="string"?X:JSON.stringify(X),Y=`/tmp/heap-${process.pid}-${Date.now()}.heapsnapshot`;Bun.write(Y,Q),console.log(JSON.stringify({msg:"heap-snapshot-written",path:Y}))}catch(X){console.error("[heap-watch] snapshot failed:",X)}}),()=>{if(l70)clearInterval(l70)}}var l70;var Fe1=()=>{};import*as c04 from"bun:jsc";function Ne1(){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{l04()}catch(G){return console.error("[stall-watchdog] failed to start sampling profiler:",G),()=>{}}let X,Q=performance.now()+Z,Y=()=>{let G=performance.now(),J=G-Q;Q=G+Z;let K=[];try{K=m04()?.traces??[]}catch{}if(J>$&&K.length>0){let W=new Map;for(let F of K){let N=F.frames.find((O)=>O.sourceURL&&!/Unknown Executable/.test(O.category??""))??F.frames[0];if(!N)continue;let U=(N.sourceURL??"?").replace(/^.*\/node_modules\//,"node_modules/"),B=`${N.name??"?"} @ ${U}:${N.line??"?"}`;W.set(B,(W.get(B)??0)+1)}let H=[...W.entries()].sort((F,N)=>N[1]-F[1]).slice(0,8).map(([F,N])=>({frame:F,count:N}));console.warn(JSON.stringify({msg:"stall-stack",ts:new Date().toISOString(),lagMs:Math.round(J),samplesInWindow:K.length,top:H}))}X=setTimeout(Y,Z),X.unref?.()};return X=setTimeout(Y,Z),X.unref?.(),()=>{if(X)clearTimeout(X)}}var l04,m04;var Ue1=L(()=>{({startSamplingProfiler:l04,samplingProfilerStackTraces:m04}=c04)});function Be1(){We1();let $=[He1(),Rt1(),Ne1()];return()=>{for(let Z of $)Z()}}var Oe1=L(()=>{Gm0();Fe1();Ue1()});var Wj=x((Le1)=>{Object.defineProperty(Le1,"__esModule",{value:!0});Le1.RepublishHeaders=Le1.DirectMsgHeaders=Le1.JsHeaders=Le1.AdvisoryKind=void 0;Le1.isOrderedPushConsumerOptions=d04;Le1.isPullConsumer=i04;Le1.isPushConsumer=p04;Le1.isBoundPushConsumerOptions=n04;function d04($){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 i04($){return $.isPullConsumer()}function p04($){return $.isPushConsumer()}function n04($){if($&&typeof $==="object")return"deliver_subject"in $||"deliver_group"in $||"idle_heartbeat"in $;return!1}Le1.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"};Le1.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"};Le1.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"};Le1.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"}});var FG=x((we1)=>{Object.defineProperty(we1,"__esModule",{value:!0});we1.TD=we1.TE=we1.Empty=void 0;we1.encode=X14;we1.decode=Q14;we1.Empty=new Uint8Array(0);we1.TE=new TextEncoder;we1.TD=new TextDecoder;function Z14(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}function X14(...$){let Z=[];for(let X=0;X<$.length;X++)Z.push(we1.TE.encode($[X]));if(Z.length===0)return we1.Empty;if(Z.length===1)return Z[0];return Z14(...Z)}function Q14($){if(!$||$.length===0)return"";return we1.TD.decode($)}});var NG=x((ze1)=>{Object.defineProperty(ze1,"__esModule",{value:!0});ze1.errors=ze1.PermissionViolationError=ze1.NoRespondersError=ze1.TimeoutError=ze1.RequestError=ze1.ProtocolError=ze1.ConnectionError=ze1.DrainingConnectionError=ze1.ClosedConnectionError=ze1.AuthorizationError=ze1.UserAuthenticationExpiredError=ze1.InvalidOperationError=ze1.InvalidArgumentError=ze1.InvalidSubjectError=void 0;class cn0 extends Error{constructor($,Z){super(`illegal subject: '${$}'`,Z);this.name="InvalidSubjectError"}}ze1.InvalidSubjectError=cn0;class m70 extends Error{constructor($,Z){super($,Z);this.name="InvalidArgumentError"}static format($,Z,X){if(Array.isArray(Z)&&Z.length>1)Z=Z[0];if(Array.isArray($))$=$.map((Q)=>`'${Q}'`),$=$.join(",");else $=`'${$}'`;return new m70(`${$} ${Z}`,X)}}ze1.InvalidArgumentError=m70;class ln0 extends Error{constructor($,Z){super($,Z);this.name="InvalidOperationError"}}ze1.InvalidOperationError=ln0;class d70 extends Error{constructor($,Z){super($,Z);this.name="UserAuthenticationExpiredError"}static parse($){if($.toLowerCase().indexOf("user authentication expired")!==-1)return new d70($);return null}}ze1.UserAuthenticationExpiredError=d70;class i70 extends Error{constructor($,Z){super($,Z);this.name="AuthorizationError"}static parse($){let Z=["authorization violation","account authentication expired","authentication timeout"],X=$.toLowerCase();for(let Q=0;Q<Z.length;Q++)if(X.indexOf(Z[Q])!==-1)return new i70($);return null}}ze1.AuthorizationError=i70;class mn0 extends Error{constructor(){super("closed connection");this.name="ClosedConnectionError"}}ze1.ClosedConnectionError=mn0;class dn0 extends Error{constructor(){super("connection draining");this.name="DrainingConnectionError"}}ze1.DrainingConnectionError=dn0;class in0 extends Error{constructor($,Z){super($,Z);this.name="ConnectionError"}}ze1.ConnectionError=in0;class pn0 extends Error{constructor($,Z){super($,Z);this.name="ProtocolError"}}ze1.ProtocolError=pn0;class nn0 extends Error{constructor($="",Z){super($,Z);this.name="RequestError"}isNoResponders(){return this.cause instanceof p70}}ze1.RequestError=nn0;class tn0 extends Error{constructor($){super("timeout",$);this.name="TimeoutError"}}ze1.TimeoutError=tn0;class p70 extends Error{subject;constructor($,Z){super(`no responders: '${$}'`,Z);this.subject=$,this.name="NoResponders"}}ze1.NoRespondersError=p70;class n70 extends Error{operation;subject;queue;constructor($,Z,X,Q,Y){super($,Y);this.name="PermissionViolationError",this.operation=Z,this.subject=X,this.queue=Q}static parse($){if(($?$.toLowerCase():"").indexOf("permissions violation")===-1)return null;let X="publish",Q="",Y=void 0,G=$.match(/(Publish|Subscription) to "(\S+)"/);if(G){if(X=G[1].toLowerCase(),Q=G[2],X==="subscription"){let J=$.match(/using queue "(\S+)"/);if(J)Y=J[1]}}return new n70($,X,Q,Y)}}ze1.PermissionViolationError=n70;ze1.errors={AuthorizationError:i70,ClosedConnectionError:mn0,ConnectionError:in0,DrainingConnectionError:dn0,InvalidArgumentError:m70,InvalidOperationError:ln0,InvalidSubjectError:cn0,NoRespondersError:p70,PermissionViolationError:n70,ProtocolError:pn0,RequestError:nn0,TimeoutError:tn0,UserAuthenticationExpiredError:d70}});var s3=x((Ie1)=>{Object.defineProperty(Ie1,"__esModule",{value:!0});Ie1.SimpleMutex=Ie1.Perf=void 0;Ie1.extend=z14;Ie1.render=P14;Ie1.timeout=A14;Ie1.delay=T14;Ie1.deadline=R14;Ie1.deferred=rn0;Ie1.debugDeferred=I14;Ie1.shuffle=q14;Ie1.collect=M14;Ie1.jitter=Re1;Ie1.backoff=V14;Ie1.nanos=k14;Ie1.millis=S14;Ie1.randomToken=v14;var j14=FG(),on0=NG();function z14($,...Z){for(let X=0;X<Z.length;X++){let Q=Z[X];Object.keys(Q).forEach(function(Y){$[Y]=Q[Y]})}return $}function P14($){return j14.TD.decode($).replace(/\n/g,"\u240A").replace(/\r/g,"\u240D")}function A14($,Z=!0){let X=Z?new on0.TimeoutError:null,Q,Y,G=new Promise((J,K)=>{Q={cancel:()=>{if(Y)clearTimeout(Y)}},Y=setTimeout(()=>{if(X===null)K(new on0.TimeoutError);else K(X)},$)});return Object.assign(G,Q)}function T14($=0){let Z,X=new Promise((Q)=>{let Y=setTimeout(()=>{Q()},$);Z={cancel:()=>{if(Y)clearTimeout(Y),Q()}}});return Object.assign(X,Z)}async function R14($,Z=1000){let X=rn0(),Q=setTimeout(()=>{X.reject(new on0.TimeoutError)},Z);try{return await Promise.race([$,X])}finally{clearTimeout(Q)}}function rn0(){let $={},Z=new Promise((X,Q)=>{$={resolve:X,reject:Q}});return Object.assign(Z,$)}function I14(){let $={},Z=new Promise((X,Q)=>{$={resolve:(Y)=>{console.trace("resolve",Y),X(Y)},reject:(Y)=>{console.trace("reject"),Q(Y)}}});return Object.assign(Z,$)}function q14($){for(let Z=$.length-1;Z>0;Z--){let X=Math.floor(Math.random()*(Z+1));[$[Z],$[X]]=[$[X],$[Z]]}return $}async function M14($){let Z=[];for await(let X of $)Z.push(X);return Z}class Ae1{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark($){this.timers.set($,performance.now())}measure($,Z,X){let Q=this.timers.get(Z);if(Q===void 0)throw Error(`${Z} is not defined`);let Y=this.timers.get(X);if(Y===void 0)throw Error(`${X} is not defined`);this.measures.set($,Y-Q)}getEntries(){let $=[];return this.measures.forEach((Z,X)=>{$.push({name:X,duration:Z})}),$}}Ie1.Perf=Ae1;class Te1{max;current;waiting;constructor($=1){this.max=$,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let $=rn0();return this.waiting.push($),$}unlock(){this.current--,this.waiting.pop()?.resolve()}}Ie1.SimpleMutex=Te1;function Re1($){if($===0)return 0;return Math.floor($/2+Math.random()*$)}function V14($=[0,250,250,500,500,3000,5000]){if(!Array.isArray($))$=[0,250,250,500,500,3000,5000];let Z=$.length-1;return{backoff(X){return Re1(X>Z?$[Z]:$[X])}}}function k14($){return $*1e6}function S14($){return Math.floor($/1e6)}var C14="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",TN=new Uint8Array(62);for(let $=0;$<62;$++)TN[$]=C14.charCodeAt($);var _14=218340105584896;function v14(){let $=Math.floor(Math.random()*_14),Z=$%62,X=TN[Z];$=($-Z)/62,Z=$%62;let Q=TN[Z];$=($-Z)/62,Z=$%62;let Y=TN[Z];$=($-Z)/62,Z=$%62;let G=TN[Z];$=($-Z)/62,Z=$%62;let J=TN[Z];$=($-Z)/62,Z=$%62;let K=TN[Z];$=($-Z)/62,Z=$%62;let W=TN[Z];$=($-Z)/62;let H=TN[$];return String.fromCharCode(X,Q,Y,G,J,K,W,H)}});var ve1=x((Ce1)=>{Object.defineProperty(Ce1,"__esModule",{value:!0});Ce1.nuid=Ce1.NuidImpl=void 0;var o14="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",PO=62,o70=12,ke1=10,Me1=33,r14=333,Ve1=o70+ke1,sn0=new Uint8Array(PO);for(let $=0;$<PO;$++)sn0[$]=o14.charCodeAt($);var t70=4294967296,Se1=BigInt(PO)**BigInt(ke1),yp=Number(Se1/(1n<<32n)),an0=Number(Se1%(1n<<32n));function a14($){for(let Z=0;Z<$.length;Z++)$[Z]=Math.floor(Math.random()*256)}function s14($){if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues($);else a14($)}class en0{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(Ve1),this.cbuf=new Uint8Array(o70),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let $=0;do this.seqHi=Math.floor(Math.random()*(yp+1)),this.seqLo=Math.floor(Math.random()*t70);while($++<8&&this.seqHi===yp&&this.seqLo>=an0);if(this.seqHi===yp&&this.seqLo>=an0)this.seqLo=0;this.inc=Math.random()*(r14-Me1)+Me1|0}setPre(){s14(this.cbuf);for(let $=0;$<o70;$++)this.buf[$]=sn0[this.cbuf[$]%PO]}fillSeq(){let $=this.seqHi,Z=this.seqLo;for(let X=Ve1-1;X>=o70;X--){let Q=Math.floor($/PO),G=($-Q*PO)*t70+Z,J=Math.floor(G/PO),K=G-J*PO;this.buf[X]=sn0[K],$=Q,Z=J}}next(){if(!this.inited)this.init();if(this.seqLo+=this.inc,this.seqLo>=t70)this.seqLo-=t70,this.seqHi+=1;if(this.seqHi>yp||this.seqHi===yp&&this.seqLo>=an0)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()}}Ce1.NuidImpl=en0;Ce1.nuid=new en0});var ye1=x((fe1)=>{Object.defineProperty(fe1,"__esModule",{value:!0});fe1.nuid=fe1.Nuid=void 0;var xe1=ve1();fe1.Nuid=xe1.NuidImpl;fe1.nuid=xe1.nuid});var a70=x((r70)=>{Object.defineProperty(r70,"__esModule",{value:!0});r70.nuid=r70.Nuid=void 0;var ge1=ye1();Object.defineProperty(r70,"Nuid",{enumerable:!0,get:function(){return ge1.Nuid}});Object.defineProperty(r70,"nuid",{enumerable:!0,get:function(){return ge1.nuid}})});var AO=x((he1)=>{Object.defineProperty(he1,"__esModule",{value:!0});he1.DEFAULT_HOST=he1.DEFAULT_PORT=he1.Match=void 0;he1.syncIterator=Y$4;he1.createInbox=G$4;var X$4=a70(),Q$4=NG();he1.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"};function Y$4($){let Z=$[Symbol.asyncIterator]();return{async next(){let X=await Z.next();if(X.done)return Promise.resolve(null);return Promise.resolve(X.value)}}}function G$4($=""){if($=$||"_INBOX",typeof $!=="string")throw TypeError("prefix must be a string");return $.split(".").forEach((Z)=>{if(Z==="*"||Z===">")throw Q$4.InvalidArgumentError.format("prefix",`cannot have wildcards ('${$}')`)}),`${$}.${X$4.nuid.next()}`}he1.DEFAULT_PORT=4222;he1.DEFAULT_HOST="127.0.0.1"});var gp=x((me1)=>{Object.defineProperty(me1,"__esModule",{value:!0});me1.DataBuffer=void 0;var ce1=FG();class le1{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...$){let Z=0;for(let Y=0;Y<$.length;Y++)Z+=$[Y].length;let X=new Uint8Array(Z),Q=0;for(let Y=0;Y<$.length;Y++)X.set($[Y],Q),Q+=$[Y].length;return X}static fromAscii($){if(!$)$="";return ce1.TE.encode($)}static toAscii($){return ce1.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 X=0;X<this.buffers.length;X++)$.set(this.buffers[X],Z),Z+=this.buffers[X].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 X=this.byteLength;if($===void 0||$>X)$=X;let Q=Z.subarray(0,$);if(X>$)this.buffers.push(Z.subarray($));return this.byteLength=X-$,Q}}return new Uint8Array(0)}fill($,...Z){if($)this.buffers.push($),this.byteLength+=$.length;for(let X=0;X<Z.length;X++)if(Z[X]&&Z[X].length)this.buffers.push(Z[X]),this.byteLength+=Z[X].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}}me1.DataBuffer=le1});var Hj=x((pe1)=>{Object.defineProperty(pe1,"__esModule",{value:!0});pe1.LF=pe1.CR=pe1.CRLF=pe1.CR_LF_LEN=pe1.CR_LF=void 0;pe1.setTransportFactory=B$4;pe1.defaultPort=O$4;pe1.getUrlParseFn=L$4;pe1.newTransport=D$4;pe1.getResolveFn=w$4;pe1.protoLen=ie1;pe1.extractProtocolMessage=E$4;var F$4=FG(),N$4=AO(),U$4=gp(),UG;function B$4($){UG=$}function O$4(){return UG!==void 0&&UG.defaultPort!==void 0?UG.defaultPort:N$4.DEFAULT_PORT}function L$4(){return UG!==void 0&&UG.urlParseFn?UG.urlParseFn:void 0}function D$4(){if(!UG||typeof UG.factory!=="function")throw Error("transport fn is not set");return UG.factory()}function w$4(){return UG!==void 0&&UG.dnsResolveFn?UG.dnsResolveFn:void 0}pe1.CR_LF=`\r
|
|
1512
1512
|
`;pe1.CR_LF_LEN=pe1.CR_LF.length;pe1.CRLF=U$4.DataBuffer.fromAscii(pe1.CR_LF);pe1.CR=new Uint8Array(pe1.CRLF)[0];pe1.LF=new Uint8Array(pe1.CRLF)[1];function ie1($){for(let Z=0;Z<$.length;Z++){let X=Z+1;if($.byteLength>X&&$[Z]===pe1.CR&&$[X]===pe1.LF)return X+1}return 0}function E$4($){let Z=ie1($);if(Z>0){let Q=new Uint8Array($).slice(0,Z);return F$4.TD.decode(Q)}return""}});var Yt0=x(($0$)=>{Object.defineProperty($0$,"__esModule",{value:!0});$0$.ipV4=ae1;$0$.isIP=k$4;$0$.parseIP=se1;var hp=4,Fj=16,s70=48,re1=57,te1=65,M$4=70,oe1=97,V$4=102,Qt0=16777215;function ae1($,Z,X,Q){let Y=new Uint8Array(Fj);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((J,K)=>{Y[K]=J}),Y[12]=$,Y[13]=Z,Y[14]=X,Y[15]=Q,Y}function k$4($){return se1($)!==void 0}function se1($){for(let Z=0;Z<$.length;Z++)switch($[Z]){case".":return ee1($);case":":return S$4($)}return}function ee1($){let Z=new Uint8Array(hp);for(let X=0;X<hp;X++){if($.length===0)return;if(X>0){if($[0]!==".")return;$=$.substring(1)}let{n:Q,c:Y,ok:G}=C$4($);if(!G||Q>255)return;$=$.substring(Y),Z[X]=Q}return ae1(Z[0],Z[1],Z[2],Z[3])}function S$4($){let Z=new Uint8Array(Fj),X=-1;if($.length>=2&&$[0]===":"&&$[1]===":"){if(X=0,$=$.substring(2),$.length===0)return Z}let Q=0;while(Q<Fj){let{n:Y,c:G,ok:J}=_$4($);if(!J||Y>65535)return;if(G<$.length&&$[G]==="."){if(X<0&&Q!=Fj-hp)return;if(Q+hp>Fj)return;let K=ee1($);if(K===void 0)return;Z[Q]=K[12],Z[Q+1]=K[13],Z[Q+2]=K[14],Z[Q+3]=K[15],$="",Q+=hp;break}if(Z[Q]=Y>>8,Z[Q+1]=Y,Q+=2,$=$.substring(G),$.length===0)break;if($[0]!==":"||$.length==1)return;if($=$.substring(1),$[0]===":"){if(X>=0)return;if(X=Q,$=$.substring(1),$.length===0)break}}if($.length!==0)return;if(Q<Fj){if(X<0)return;let Y=Fj-Q;for(let G=Q-1;G>=X;G--)Z[G+Y]=Z[G];for(let G=X+Y-1;G>=X;G--)Z[G]=0}else if(X>=0)return;return Z}function C$4($){let Z=0,X=0;for(Z=0;Z<$.length&&s70<=$.charCodeAt(Z)&&$.charCodeAt(Z)<=re1;Z++)if(X=X*10+($.charCodeAt(Z)-s70),X>=Qt0)return{n:Qt0,c:Z,ok:!1};if(Z===0)return{n:0,c:0,ok:!1};return{n:X,c:Z,ok:!0}}function _$4($){let Z=0,X=0;for(X=0;X<$.length;X++){if(s70<=$.charCodeAt(X)&&$.charCodeAt(X)<=re1)Z*=16,Z+=$.charCodeAt(X)-s70;else if(oe1<=$.charCodeAt(X)&&$.charCodeAt(X)<=V$4)Z*=16,Z+=$.charCodeAt(X)-oe1+10;else if(te1<=$.charCodeAt(X)&&$.charCodeAt(X)<=M$4)Z*=16,Z+=$.charCodeAt(X)-te1+10;else break;if(Z>=Qt0)return{n:0,c:X,ok:!1}}if(X===0)return{n:0,c:X,ok:!1};return{n:Z,c:X,ok:!0}}});var Ft0=x((X0$)=>{Object.defineProperty(X0$,"__esModule",{value:!0});X0$.Servers=X0$.ServerImpl=void 0;X0$.isIPV4OrHostname=Z0$;X0$.hostPort=Ht0;var Gt0=Hj(),Jt0=s3(),Kt0=Yt0(),b$4=AO(),y$4=NG();function Z0$($){if($.indexOf("[")!==-1||$.indexOf("::")!==-1)return!1;if($.indexOf(".")!==-1)return!0;if($.split(":").length<=2)return!0;return!1}function Wt0($){return!Z0$($)}function g$4($){let X=$.toUpperCase().indexOf("::FFFF:");if(X!==-1&&$.indexOf(".")!==-1){let Q=$.substring(X+7);return Q=Q.replace("[",""),Q.replace("]","")}return $}function Ht0($){if($=$.trim(),$.match(/^(.*:\/\/)(.*)/m))$=$.replace(/^(.*:\/\/)(.*)/gm,"$2");if($=g$4($),Wt0($)&&$.indexOf("[")===-1)$=`[${$}]`;let Z=Wt0($)?$.match(/(]:)(\d+)/):$.match(/(:)(\d+)/),X=Z&&Z.length===3&&Z[1]&&Z[2]?parseInt(Z[2]):b$4.DEFAULT_PORT,Y=new URL(`${X===80?"https":"http"}://${$}`);Y.port=`${X}`;let G=Y.hostname;if(G.charAt(0)==="[")G=G.substring(1,G.length-1);return{listen:Y.host,hostname:G,port:X}}class yy{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor($,Z=!1){this.src=$,this.tlsName="";let X=Ht0($);this.listen=X.listen,this.hostname=X.hostname,this.port=X.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,Kt0.isIP)(this.hostname))return[this];else{let X=await $.fn(this.hostname);if($.debug)console.log(`resolve ${this.hostname} = ${X.join(",")}`);for(let Q of X){let Y=this.port===80?"https":"http",G=new URL(`${Y}://${Wt0(Q)?"["+Q+"]":Q}`);G.port=`${this.port}`;let J=new yy(G.host,!1);J.tlsName=this.hostname,Z.push(J)}}if($.randomize)(0,Jt0.shuffle)(Z);return this.resolves=Z,Z}}X0$.ServerImpl=yy;class e70{firstSelect;servers;currentServer;tlsName;randomize;constructor($={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=$.randomize||!1}setServers($){if(!Array.isArray($)||$.length===0)throw y$4.InvalidArgumentError.format("servers","cannot be empty");let Z=(0,Gt0.getUrlParseFn)(),X=new Map;for(let Y of this.servers)X.set(Y.listen,Y);let Q=[];for(let Y of $){Y=Z?Z(Y):Y;let{listen:G}=Ht0(Y),J=X.get(G);if(J)J.gossiped=!1,Q.push(J);else Q.push(new yy(Y))}if(this.randomize)(0,Jt0.shuffle)(Q);if(this.servers=Q,this.currentServer===void 0||!Q.includes(this.currentServer))this.currentServer=Q[0],this.firstSelect=!0}clear(){this.servers.length=0}updateTLSName(){let $=this.getCurrentServer();if(!(0,Kt0.isIP)($.hostname))this.tlsName=$.hostname,this.servers.forEach((Z)=>{if(Z.gossiped)Z.tlsName=this.tlsName})}getCurrentServer(){return this.currentServer}addServer($,Z=!1){let X=(0,Gt0.getUrlParseFn)();$=X?X($):$;let Q=new yy($,Z);if((0,Kt0.isIP)(Q.hostname))Q.tlsName=this.tlsName;this.servers.push(Q)}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 e70.freezeAll(this.servers)}snapshotForHandler(){let $=this.currentServer;if(!$)return this.snapshot();let Z=this.servers.indexOf($);if(Z<=0)return this.snapshot();return e70.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 X=[],Q=[],Y=(0,Gt0.getUrlParseFn)(),G=new Map;if($.connect_urls&&$.connect_urls.length>0)$.connect_urls.forEach((K)=>{K=Y?Y(K,Z):K;let W=new yy(K,!0);G.set(K,W)});let J=[];if(this.servers.forEach((K,W)=>{let H=K.listen;if(K.gossiped&&this.currentServer.listen!==H&&G.get(H)===void 0)J.push(W);G.delete(H)}),J.reverse(),J.forEach((K)=>{let W=this.servers.splice(K,1);Q=Q.concat(W[0].listen)}),G.forEach((K,W)=>{this.servers.push(K),X.push(W)}),this.randomize&&X.length>0){let K=this.currentServer,W=this.servers.filter((H)=>H!==K);(0,Jt0.shuffle)(W),this.servers=K?[K,...W]:W}return{added:X,deleted:Q}}}X0$.Servers=e70});var $X0=x((J0$)=>{Object.defineProperty(J0$,"__esModule",{value:!0});J0$.QueuedIteratorImpl=void 0;var Nt0=s3(),Y0$=NG();class G0${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,Nt0.deferred)(),this.yields=[],this.iterClosed=(0,Nt0.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(X){}}return}if(typeof $==="function")this.pendingFiltered++;this.yields.push($),this.signal.resolve()}async*iterate(){if(this.noIterator)throw new Y0$.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Y0$.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 Q=$[Z];try{Q()}catch(Y){throw Y}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let X=this.profile?Date.now():0;yield $[Z],this.time=this.profile?Date.now()-X:0}if(this.done)break;else if(this.yields.length===0)$.length=0,this.yields=$,this.signal=(0,Nt0.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}}J0$.QueuedIteratorImpl=G0$});var Ut0=x((F0$)=>{Object.defineProperty(F0$,"__esModule",{value:!0});F0$.MuxSubscription=void 0;var l$4=AO(),W0$=NG();class H0${baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init($){return this.baseInbox=`${(0,l$4.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((X)=>{X.resolver(Z,{})}),!0;if(Z.operation==="publish"){let X=this.all().find((Q)=>{return Q.requestSubject===Z.subject});if(X)return X.resolver(Z,{}),!0}return!1}dispatcher(){return($,Z)=>{let X=this.getToken(Z);if(X){let Q=this.get(X);if(Q){if($===null)$=Z?.data?.length===0&&Z.headers?.code===503?new W0$.NoRespondersError(Q.requestSubject):null;Q.resolver($,Z)}}}}close(){let $=new W0$.RequestError("connection closed");this.reqs.forEach((Z)=>{Z.resolver($,{})})}}F0$.MuxSubscription=H0$});var Bt0=x((B0$)=>{Object.defineProperty(B0$,"__esModule",{value:!0});B0$.Heartbeat=void 0;var m$4=s3();class U0${ph;interval;maxOut;timer;pendings;constructor($,Z,X){this.ph=$,this.interval=Z,this.maxOut=X,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,m$4.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})}}B0$.Heartbeat=U0$});var Dt0=x((E0$)=>{Object.defineProperty(E0$,"__esModule",{value:!0});E0$.DenoBuffer=E0$.MAX_SIZE=E0$.AssertionError=void 0;E0$.assert=D0$;E0$.concat=w0$;E0$.append=i$4;E0$.readAll=p$4;E0$.writeAll=n$4;var d$4=FG();class Ot0 extends Error{constructor($){super($);this.name="AssertionError"}}E0$.AssertionError=Ot0;function D0$($,Z="Assertion failed."){if(!$)throw new Ot0(Z)}var L0$=32768;E0$.MAX_SIZE=4294967294;function ZX0($,Z,X=0){let Q=Z.byteLength-X;if($.byteLength>Q)$=$.subarray(0,Q);return Z.set($,X),$.byteLength}function w0$($,Z){if($===void 0&&Z===void 0)return new Uint8Array(0);if($===void 0)return Z;if(Z===void 0)return $;let X=new Uint8Array($.length+Z.length);return X.set($,0),X.set(Z,$.length),X}function i$4($,Z){return w0$($,Uint8Array.of(Z))}class Lt0{_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($){D0$($<=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=ZX0(this._buf.subarray(this._off),$);return this._off+=Z,Z}writeByte($){return this.write(Uint8Array.of($))}writeString($){return this.write(d$4.TE.encode($))}write($){let Z=this._grow($.byteLength);return ZX0($,this._buf,Z)}_grow($){let Z=this.length;if(Z===0&&this._off!==0)this.reset();let X=this._tryGrowByReslice($);if(X>=0)return X;let Q=this.capacity;if($<=Math.floor(Q/2)-Z)ZX0(this._buf.subarray(this._off),this._buf);else if(Q+$>E0$.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let Y=new Uint8Array(Math.min(2*Q+$,E0$.MAX_SIZE));ZX0(this._buf.subarray(this._off),Y),this._buf=Y}return this._off=0,this._reslice(Math.min(Z+$,E0$.MAX_SIZE)),Z}grow($){if($<0)throw Error("Buffer._grow: negative count");let Z=this._grow($);this._reslice(Z)}readFrom($){let Z=0,X=new Uint8Array(L0$);while(!0){let Q=this.capacity-this.length<L0$,Y=Q?X:new Uint8Array(this._buf.buffer,this.length),G=$.read(Y);if(G===null)return Z;if(Q)this.write(Y.subarray(0,G));else this._reslice(this.length+G);Z+=G}}}E0$.DenoBuffer=Lt0;function p$4($){let Z=new Lt0;return Z.readFrom($),Z.bytes()}function n$4($,Z){let X=0;while(X<Z.length)X+=$.write(Z.subarray(X))}});var jt0=x((T0$)=>{Object.defineProperty(T0$,"__esModule",{value:!0});T0$.cc=T0$.State=T0$.Parser=T0$.Kind=void 0;T0$.describe=$84;var wt0=Dt0(),Et0=FG();T0$.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5};function $84($){let Z,X="";switch($.kind){case T0$.Kind.MSG:Z="MSG";break;case T0$.Kind.OK:Z="OK";break;case T0$.Kind.ERR:Z="ERR",X=Et0.TD.decode($.data);break;case T0$.Kind.PING:Z="PING";break;case T0$.Kind.PONG:Z="PONG";break;case T0$.Kind.INFO:Z="INFO",X=Et0.TD.decode($.data)}return`${Z}: ${X}`}function z0$(){let $={};return $.sid=-1,$.hdr=-1,$.size=-1,$}var P0$=48,Z84=57,gy=67108864;class A0${dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor($){this.dispatcher=$,this.state=T0$.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse($){let Z;for(Z=0;Z<$.length;Z++){let X=$[Z];switch(this.state){case T0$.State.OP_START:switch(X){case T0$.cc.M:case T0$.cc.m:this.state=T0$.State.OP_M,this.hdr=-1,this.ma=z0$();break;case T0$.cc.H:case T0$.cc.h:this.state=T0$.State.OP_H,this.hdr=0,this.ma=z0$();break;case T0$.cc.P:case T0$.cc.p:this.state=T0$.State.OP_P;break;case T0$.cc.PLUS:this.state=T0$.State.OP_PLUS;break;case T0$.cc.MINUS:this.state=T0$.State.OP_MINUS;break;case T0$.cc.I:case T0$.cc.i:this.state=T0$.State.OP_I;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_H:switch(X){case T0$.cc.M:case T0$.cc.m:this.state=T0$.State.OP_M;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_M:switch(X){case T0$.cc.S:case T0$.cc.s:this.state=T0$.State.OP_MS;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_MS:switch(X){case T0$.cc.G:case T0$.cc.g:this.state=T0$.State.OP_MSG;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_MSG:switch(X){case T0$.cc.SPACE:case T0$.cc.TAB:this.state=T0$.State.OP_MSG_SPC;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_MSG_SPC:switch(X){case T0$.cc.SPACE:case T0$.cc.TAB:continue;default:this.state=T0$.State.MSG_ARG,this.as=Z}break;case T0$.State.MSG_ARG:switch(X){case T0$.cc.CR:this.drop=1;break;case T0$.cc.NL:{let Q=this.argBuf?this.argBuf.bytes():$.subarray(this.as,Z-this.drop);this.processMsgArgs(Q),this.drop=0,this.as=Z+1,this.state=T0$.State.MSG_PAYLOAD,Z=this.as+this.ma.size-1;break}default:if(this.argBuf)this.argBuf.writeByte(X)}break;case T0$.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let Q=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:T0$.Kind.MSG,msg:this.ma,data:Q}),this.argBuf=void 0,this.msgBuf=void 0,this.state=T0$.State.MSG_END}else{let Q=this.ma.size-this.msgBuf.length,Y=$.length-Z;if(Y<Q)Q=Y;if(Q>0)this.msgBuf.write($.subarray(Z,Z+Q)),Z=Z+Q-1;else this.msgBuf.writeByte(X)}else if(Z-this.as>=this.ma.size)this.dispatcher.push({kind:T0$.Kind.MSG,msg:this.ma,data:$.subarray(this.as,Z)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=T0$.State.MSG_END;break;case T0$.State.MSG_END:switch(X){case T0$.cc.NL:this.drop=0,this.as=Z+1,this.state=T0$.State.OP_START;break;default:continue}break;case T0$.State.OP_PLUS:switch(X){case T0$.cc.O:case T0$.cc.o:this.state=T0$.State.OP_PLUS_O;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_PLUS_O:switch(X){case T0$.cc.K:case T0$.cc.k:this.state=T0$.State.OP_PLUS_OK;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_PLUS_OK:switch(X){case T0$.cc.NL:this.dispatcher.push({kind:T0$.Kind.OK}),this.drop=0,this.state=T0$.State.OP_START;break}break;case T0$.State.OP_MINUS:switch(X){case T0$.cc.E:case T0$.cc.e:this.state=T0$.State.OP_MINUS_E;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_MINUS_E:switch(X){case T0$.cc.R:case T0$.cc.r:this.state=T0$.State.OP_MINUS_ER;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_MINUS_ER:switch(X){case T0$.cc.R:case T0$.cc.r:this.state=T0$.State.OP_MINUS_ERR;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_MINUS_ERR:switch(X){case T0$.cc.SPACE:case T0$.cc.TAB:this.state=T0$.State.OP_MINUS_ERR_SPC;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_MINUS_ERR_SPC:switch(X){case T0$.cc.SPACE:case T0$.cc.TAB:continue;default:this.state=T0$.State.MINUS_ERR_ARG,this.as=Z}break;case T0$.State.MINUS_ERR_ARG:switch(X){case T0$.cc.CR:this.drop=1;break;case T0$.cc.NL:{let Q;if(this.argBuf)Q=this.argBuf.bytes(),this.argBuf=void 0;else Q=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:T0$.Kind.ERR,data:Q}),this.drop=0,this.as=Z+1,this.state=T0$.State.OP_START;break}default:if(this.argBuf)this.argBuf.write(Uint8Array.of(X))}break;case T0$.State.OP_P:switch(X){case T0$.cc.I:case T0$.cc.i:this.state=T0$.State.OP_PI;break;case T0$.cc.O:case T0$.cc.o:this.state=T0$.State.OP_PO;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_PO:switch(X){case T0$.cc.N:case T0$.cc.n:this.state=T0$.State.OP_PON;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_PON:switch(X){case T0$.cc.G:case T0$.cc.g:this.state=T0$.State.OP_PONG;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_PONG:switch(X){case T0$.cc.NL:this.dispatcher.push({kind:T0$.Kind.PONG}),this.drop=0,this.state=T0$.State.OP_START;break}break;case T0$.State.OP_PI:switch(X){case T0$.cc.N:case T0$.cc.n:this.state=T0$.State.OP_PIN;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_PIN:switch(X){case T0$.cc.G:case T0$.cc.g:this.state=T0$.State.OP_PING;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_PING:switch(X){case T0$.cc.NL:this.dispatcher.push({kind:T0$.Kind.PING}),this.drop=0,this.state=T0$.State.OP_START;break}break;case T0$.State.OP_I:switch(X){case T0$.cc.N:case T0$.cc.n:this.state=T0$.State.OP_IN;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_IN:switch(X){case T0$.cc.F:case T0$.cc.f:this.state=T0$.State.OP_INF;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_INF:switch(X){case T0$.cc.O:case T0$.cc.o:this.state=T0$.State.OP_INFO;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_INFO:switch(X){case T0$.cc.SPACE:case T0$.cc.TAB:this.state=T0$.State.OP_INFO_SPC;break;default:throw this.fail($.subarray(Z))}break;case T0$.State.OP_INFO_SPC:switch(X){case T0$.cc.SPACE:case T0$.cc.TAB:continue;default:this.state=T0$.State.INFO_ARG,this.as=Z}break;case T0$.State.INFO_ARG:switch(X){case T0$.cc.CR:this.drop=1;break;case T0$.cc.NL:{let Q;if(this.argBuf)Q=this.argBuf.bytes(),this.argBuf=void 0;else Q=$.subarray(this.as,Z-this.drop);this.dispatcher.push({kind:T0$.Kind.INFO,data:Q}),this.drop=0,this.as=Z+1,this.state=T0$.State.OP_START;break}default:if(this.argBuf)this.argBuf.writeByte(X)}break;default:throw this.fail($.subarray(Z))}}if((this.state===T0$.State.MSG_ARG||this.state===T0$.State.MINUS_ERR_ARG||this.state===T0$.State.INFO_ARG)&&!this.argBuf)this.argBuf=new wt0.DenoBuffer($.subarray(this.as,Z-this.drop));if(this.state===T0$.State.MSG_PAYLOAD&&!this.msgBuf){if(!this.argBuf)this.cloneMsgArg();this.msgBuf=new wt0.DenoBuffer($.subarray(this.as))}}cloneMsgArg(){let $=this.ma.subject.length,Z=this.ma.reply?this.ma.reply.length:0,X=new Uint8Array($+Z);if(X.set(this.ma.subject),this.ma.reply)X.set(this.ma.reply,$);if(this.argBuf=new wt0.DenoBuffer(X),this.ma.subject=X.subarray(0,$),this.ma.reply)this.ma.reply=X.subarray($)}processMsgArgs($){if(this.hdr>=0)return this.processHeaderMsgArgs($);let Z=[],X=-1;for(let Q=0;Q<$.length;Q++)switch($[Q]){case T0$.cc.SPACE:case T0$.cc.TAB:case T0$.cc.CR:case T0$.cc.NL:if(X>=0)Z.push($.subarray(X,Q)),X=-1;break;default:if(X<0)X=Q}if(X>=0)Z.push($.subarray(X));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],gy);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],gy);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}: ${Et0.TD.decode($)}`)}processHeaderMsgArgs($){let Z=[],X=-1;for(let Q=0;Q<$.length;Q++)switch($[Q]){case T0$.cc.SPACE:case T0$.cc.TAB:case T0$.cc.CR:case T0$.cc.NL:if(X>=0)Z.push($.subarray(X,Q)),X=-1;break;default:if(X<0)X=Q}if(X>=0)Z.push($.subarray(X));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],gy),this.ma.size=this.protoParseInt(Z[3],gy);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],gy),this.ma.size=this.protoParseInt(Z[4],gy);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 X=0;for(let Q=0;Q<$.length;Q++){if($[Q]<P0$||$[Q]>Z84)return-1;X=X*10+($[Q]-P0$)}return Z!==void 0&&X>Z?-1:X}}T0$.Parser=A0$;T0$.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};T0$.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 YX0=x((I0$)=>{Object.defineProperty(I0$,"__esModule",{value:!0});I0$.MsgHdrsImpl=void 0;I0$.canonicalMIMEHeaderKey=Pt0;I0$.headers=Y84;var R0$=FG(),e3=AO(),QX0=NG();function Pt0($){let F=!0,N=Array($.length);for(let U=0;U<$.length;U++){let B=$.charCodeAt(U);if(B===58||B<33||B>126)throw QX0.InvalidArgumentError.format("header",`'${$[U]}' 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;N[U]=B,F=B==45}return String.fromCharCode(...N)}function Y84($=0,Z=""){if($===0&&Z!=="")throw QX0.InvalidArgumentError.format("code","is required");else if($>0&&Z==="")throw QX0.InvalidArgumentError.format("description","is required");return new hy($,Z)}var zt0="NATS/1.0";class hy{_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,X]of this.headers){let Q=$.values(Z);if(X.length!==Q.length)return!1;let Y=[...X].sort(),G=[...Q].sort();for(let J=0;J<Y.length;J++)if(Y[J]!==G[J])return!1}return!0}return!1}static decode($){let Z=new hy,Q=R0$.TD.decode($).split(`\r
|
|
1513
1513
|
`),Y=Q[0];if(Y!==zt0){let G=Y.replace(zt0,"").trim();if(G.length>0){if(Z._code=parseInt(G,10),isNaN(Z._code))Z._code=0;let J=Z._code.toString();G=G.replace(J,""),Z._description=G.trim()}}if(Q.length>=1)Q.slice(1).map((G)=>{if(G){let J=G.indexOf(":");if(J>-1){let K=G.slice(0,J),W=G.slice(J+1).trim();Z.append(K,W)}}});return Z}toString(){if(this.headers.size===0&&this._code===0)return"";let $=zt0;if(this._code>0&&this._description!=="")$+=` ${this._code} ${this._description}`;for(let[Z,X]of this.headers)for(let Q=0;Q<X.length;Q++)$=`${$}\r
|
|
1514
1514
|
${Z}: ${X[Q]}`;return`${$}\r
|
|
@@ -2818,13 +2818,13 @@ ${Y}`:Y}case"media":return"";case"mediaSingle":case"mediaGroup":return Lc(rH(X),
|
|
|
2818
2818
|
|
|
2819
2819
|
${O}`});if(!D)continue;try{await $.storage.jiraIntegrations.createCommentLink({commentId:D.id,organizationId:K,jiraCommentId:B.id})}catch(w){if(w.code==="23505"){await $.storage.taskBoard.deleteComment(D.id,K,aH);continue}throw w}}}class Qx${ctx;organizationId;ids=new Map;constructor($,Z){this.ctx=$;this.organizationId=Z}async seed($){if($.length===0)return;let Z=await this.ctx.storage.sprints.upsertManyFromJira(this.organizationId,$.map($x$));for(let[X,Q]of Z)this.ids.set(X,Q)}async localIdFor($){if(!$)return null;let Z=this.ids.get($.id);if(Z)return Z;let X=await this.ctx.storage.sprints.upsertFromJira(this.organizationId,$x$($));return this.ids.set($.id,X),X}}function $x$($){return{jiraSprintId:$.id,name:$.name,state:$.state,startsAt:$.startsAt,endsAt:$.endsAt}}function oo4($,Z){if($.size===0)return[];return Z.filter((X)=>!$.has(X.jiraIssueId))}async function ro4($,Z,X,Q){let Y=Z.organizationId,G=await X.searchIssueIds(`(${Q}) AND issuetype IN standardIssueTypes()`);if(G.size===0)return console.warn(`[jira] scope for org ${Y} came back empty \u2014 skipping reconciliation rather than archiving the whole board`),0;let J=oo4(G,await $.storage.jiraIntegrations.listLinkedIssuesOnBoard(Y));if(J.length===0)return 0;for(let K of J){let W=await $.storage.taskBoard.getById(K.itemId,Y);if(!W||W.status==="archived")continue;let H=await $.storage.taskBoard.update(K.itemId,Y,{status:"archived"},aH);await $.storage.taskBoard.recordActivity({taskBoardItemId:K.itemId,action:"status_changed",actorId:null,data:{from:W.status,to:"archived"}}),u$(Y,H),console.log(`[jira] ${K.jiraIssueKey} is no longer in board ${Z.boardId}'s scope \u2014 archived its card`)}return J.length}async function ao4($,Z){let{organizationId:X,boardId:Q}=Z;if(!Q)throw Error("No Jira board selected");let Y=await $.storage.organizationSettings.get(Z.organizationId),G=Q7(Y?.flags,"org_board_columns"),J=await V5($,Z.organizationId),K=G?await uo4($,Z,Q):Yv$(Z.statusMapping),W=new Set((await J.columns()).map((S)=>S.key));if(K.size===0)throw Error(G?"This Jira board has no columns to mirror":"No status mapping configured");let H=Z.lastSyncedAt===null||Z.rescanPending,F=new kY(Z.siteUrl,Z.email,Z.apiToken),{accountId:N}=await F.myself(),U=new e71(F),B=new Date,O=await F.getBoardScopeJql(Q),D=mo4(Z,O,B),w=new Qx$($,X);await w.seed(await F.listBoardSprints(Q));let E={created:0,updated:0,unchanged:0,skipped:0,archived:0,unmappedStatuses:[]},j=new Set,z,A,P=0,I=0;while(P<ZX1&&I<Zx$){I++;let S=await F.searchIssues({jql:D,nextPageToken:A});if(A=S.nextPageToken??void 0,S.issues.length===0){if(!A)break;continue}let i=await $.storage.jiraIntegrations.getLinksByIssueIds(X,S.issues.map((v)=>v.id));await U.resolve(S.issues.flatMap((v)=>[...Ds(v.fields.description),...(v.fields.comment?.comments??[]).flatMap((b)=>Ds(b.body))]));for(let v of S.issues){if(P>=ZX1)break;P++;let b=new Date(v.fields.updated);if(Number.isNaN(b.getTime()))throw Error(`Unparseable updated on ${v.key}`);let l=K.get(v.fields.status.name);if(!l||!av$(v)){if(!l&&av$(v))j.add(v.fields.status.name);E.skipped++,z=b;continue}let y=i.get(v.id);if(y&&do4(y.jiraUpdatedAt,b,H)){E.unchanged++,z=b;continue}let p=v.fields.status.name,Q0=TT0(v.sprints),L0={title:v.fields.summary,description:await po4(v,U),externalUrl:no4(Z.siteUrl,v.key),priority:to4(v),boardColumnOrg:J.columnOwner()};if(y){let t=y.jiraStatus!==p,o=co4({lastSeenJiraSprintId:y.jiraSprintId,jiraSprintId:Q0?.id??null}),B0=await $.storage.taskBoard.getById(y.itemId,X),s=lo4({jiraStatusChanged:t,currentStatus:B0?.status??null,boardColumns:W}),w0=await $.storage.taskBoard.update(y.itemId,X,{...L0,...s?{status:l}:{},...o?{sprintId:await w.localIdFor(Q0)}:{}},aH);if(await $.storage.jiraIntegrations.touchLink(y.itemId,{jiraStatus:p,jiraSprintId:Q0?.id??null}),B0&&s&&B0.status!==l)await $.storage.taskBoard.recordActivity({taskBoardItemId:y.itemId,action:"status_changed",actorId:null,data:{from:B0.status,to:l}});if(t&&!H)w0=await sv$($,Z,w0);await ev$($,Z,F,v,y.itemId,N,U),await $.storage.jiraIntegrations.touchLink(y.itemId,{jiraUpdatedAt:b}),u$(X,w0),E.updated++}else{let t=await $.storage.taskBoard.create({organizationId:X,...L0,status:l,sprintId:await w.localIdFor(Q0),by:aH});try{await $.storage.jiraIntegrations.createLink({itemId:t.id,organizationId:X,jiraIssueId:v.id,jiraIssueKey:v.key,jiraUpdatedAt:new Date(0),jiraStatus:p,jiraSprintId:Q0?.id??null})}catch(o){if(o.code==="23505"){await $.storage.taskBoard.delete(t.id,X,aH),E.unchanged++,z=b;continue}throw o}if(!H)t=await sv$($,Z,t);await ev$($,Z,F,v,t.id,N,U),await $.storage.jiraIntegrations.touchLink(t.id,{jiraUpdatedAt:b}),u$(X,t),E.created++}z=b}if(!A)break}E.unmappedStatuses=[...j].sort();let M=io4(P,I);if(!M)E.archived=await ro4($,Z,F,O);let q=H&&M;if(z===void 0&&P===0)return{counts:E,watermark:B,rescanPending:q};return{counts:E,watermark:z,rescanPending:q}}var aH="jira",ZX1=500,go4=5,Zx$=25,Xx$=1e4,ho4;var kT0=L(()=>{f9();m5();$X1();k5();MT0();d71();ho4={highest:"urgent",high:"high",medium:"medium",low:"low",lowest:"low"}});var Gx$={};e(Gx$,{setJiraSyncRuntime:()=>JX1,registerJiraSyncWorkflow:()=>WX1,maybeEnqueueJiraStatusPush:()=>wr4,maybeEnqueueJiraSprintPush:()=>Er4,enqueueJiraCommentPush:()=>KX1});import{DBOS as VZ,SchedulerMode as so4}from"@dbos-inc/dbos-sdk";function JX1($){Es=$}function pv(){if(!Es)throw Error("[jira] sync runtime not initialized \u2014 setJiraSyncRuntime() must run before the workflow fires");return Es}function J3(){let{db:$,encryptionKey:Z}=pv();return new mv($,new LG(Z))}function Yx$(){return new SQ(pv().db)}function $r4(){return new Os(pv().db)}async function Zr4($){try{let{db:Z}=pv(),X=await J3().getById($);if(!X)return{id:$,error:"integration no longer exists"};if(!X.enabled)return{id:$};let Q=await rK(Z,X.organizationId);if(!Q)return{id:$,error:"organization no longer exists"};let Y=await Dc(Q,X);return"error"in Y?{id:$,error:Y.error}:{id:$}}catch(Z){return{id:$,error:Z instanceof Error?Z.message:String(Z)}}}async function Xr4($,Z){let X=await VZ.runStep(()=>J3().listEnabledIds(),{name:"loadJiraIntegrations"});for(let Q of X){let Y=await VZ.runStep(()=>Zr4(Q),{name:`syncJira:${Q}`});if(Y.error)console.warn(`[jira] sync ${Y.id} failed: ${Y.error}`)}}async function Yr4($){let Z=J3();if(!(await Z.getByOrg($.organizationId))?.enabled)return null;let Q=await Z.getLinkByItemId($.taskBoardItemId,$.organizationId);if(!Q)return null;if(await Z.hasCommentLink($.commentId))return null;return{jiraIssueId:Q.jiraIssueId}}async function Gr4($){return(await pv().db.selectFrom("organization").select("slug").where("id","=",$).executeTakeFirst())?.slug??null}async function Jr4($,Z,X){let Q=await J3().getByOrg($);if(!Q?.enabled)return null;let G=(await rK(pv().db,$))?.orgFs;if(!G)return null;let J=new kY(Q.siteUrl,Q.email,Q.apiToken);return ov$(X,{read:(K)=>G.read(K.volume,K.path).catch((W)=>{if(W instanceof TJ)return null;throw W}),listAttachments:()=>J.listAttachments(Z),upload:(K)=>J.addAttachment(Z,K),mediaIdFor:(K)=>J.resolveMediaId(K)})}async function Kr4($,Z,X){let Q=J3(),Y=await Q.getByOrg($.organizationId);if(!Y?.enabled)return null;let G=await Q.getLinkByItemId($.taskBoardItemId,$.organizationId);if(!G)return null;if(await Q.hasCommentLink($.commentId))return null;return(await new kY(Y.siteUrl,Y.email,Y.apiToken).addComment(G.jiraIssueId,Z,{header:`${$.authorLabel} \xB7 via Studio:`,media:new Map(X)})).id}async function Wr4($,Z){try{await J3().createCommentLink({commentId:$.commentId,organizationId:$.organizationId,jiraCommentId:Z})}catch(X){if(X.code!=="23505")throw X}}async function Hr4($){let Z=$.body.slice(0,Qr4),X=await VZ.runStep(()=>Yr4($),{name:"resolveCommentTarget",retriesAllowed:!0,maxAttempts:3});if(!X)return;let Q=[],Y=Ev$(Z);if(Y.length>0){let J=await VZ.runStep(()=>Gr4($.organizationId),{name:"readOrgSlug",retriesAllowed:!0,maxAttempts:3});for(let K of tv$(Y,J??""))try{let W=await VZ.runStep(()=>Jr4($.organizationId,X.jiraIssueId,K),{name:`attachCommentImage:${K.name}`,retriesAllowed:!0,maxAttempts:3});if(W)Q.push([K.target,W])}catch(W){if(!Zv$(W))throw W;console.warn(`[jira] could not attach ${K.ref.path}:`,W)}}let G=await VZ.runStep(()=>Kr4($,Z,Q),{name:"postCommentToJira",retriesAllowed:!1});if(!G)return;await VZ.runStep(()=>Wr4($,G),{name:"recordCommentLink",retriesAllowed:!0,maxAttempts:4})}async function Fr4($){let Z=J3(),X=await Z.getByOrg($.organizationId);if(!X?.enabled)return null;let Q=await Z.getLinkByItemId($.itemId,$.organizationId);if(!Q)return null;let Y=await Yx$().getById($.itemId,$.organizationId);if(!Y)return null;let G=await Ur4($.organizationId,Y.status,X.statusMapping);if(v71(G,Q.jiraStatus))return null;let K=await new kY(X.siteUrl,X.email,X.apiToken).listTransitions(Q.jiraIssueId),W=Jv$({targets:G,currentJiraStatus:Q.jiraStatus,availableTransitions:K.map((F)=>F.to.name)});if(W.kind!=="transition"){if(W.kind==="unreachable")console.warn(`[jira] ${Q.jiraIssueKey} is ${Y.status} on the board, but its workflow offers no transition to ${W.targets.join(" / ")} \u2014 `+"the card will not move on the Jira board");return null}let H=K.find((F)=>F.to.name===W.targetName);if(!H)return null;return{jiraIssueId:Q.jiraIssueId,transitionId:H.id,targetName:W.targetName}}async function Nr4($,Z){let X=J3(),Q=await X.getByOrg($.organizationId);if(!Q?.enabled)return;let Y=await X.getLinkByItemId($.itemId,$.organizationId);if(!Y||Y.jiraStatus===Z.targetName)return;let G=new kY(Q.siteUrl,Q.email,Q.apiToken);if(await G.getStatusName(Z.jiraIssueId)===Z.targetName){await X.touchLink($.itemId,{jiraStatus:Z.targetName});return}await G.transitionIssue(Z.jiraIssueId,Z.transitionId),await X.touchLink($.itemId,{jiraStatus:Z.targetName})}async function Ur4($,Z,X){let Q=await new _v(pv().db).listByOrg($);return Gv$({column:Q.find((Y)=>Y.key===Z),mapping:X,lane:Z})}async function Br4($){let Z=J3();if(!(await Z.getByOrg($.organizationId))?.enabled)return null;let Q=await Z.getLinkByItemId($.itemId,$.organizationId);if(!Q)return null;let Y=await Yx$().getById($.itemId,$.organizationId);if(!Y)return null;let G=Y.sprintId?await $r4().jiraIdFor($.organizationId,Y.sprintId):null;if(Y.sprintId&&G===null)return console.warn(`[jira] ${Q.jiraIssueKey} is in a sprint that did not come from Jira \u2014 not pushing`),null;if(Q.jiraSprintId===G)return null;return{jiraIssueId:Q.jiraIssueId,jiraIssueKey:Q.jiraIssueKey,targetSprintId:G}}async function Or4($,Z){let X=J3(),Q=await X.getByOrg($.organizationId);if(!Q?.enabled)return;let Y=await X.getLinkByItemId($.itemId,$.organizationId);if(!Y||Y.jiraSprintId===Z.targetSprintId)return;let G=new kY(Q.siteUrl,Q.email,Q.apiToken);if(await G.getIssueSprintId(Z.jiraIssueId)!==Z.targetSprintId)if(Z.targetSprintId===null)await G.moveIssueToBacklog(Z.jiraIssueId);else await G.addIssueToSprint(Z.targetSprintId,Z.jiraIssueId);await X.touchLink($.itemId,{jiraSprintId:Z.targetSprintId})}async function Lr4($){let Z=await VZ.runStep(()=>Br4($),{name:"resolveSprintMove",retriesAllowed:!0,maxAttempts:3});if(!Z)return;await VZ.runStep(()=>Or4($,Z),{name:"executeSprintMove",retriesAllowed:!0,maxAttempts:3})}async function Dr4($){let Z=await VZ.runStep(()=>Fr4($),{name:"resolveStatusTransition",retriesAllowed:!0,maxAttempts:3});if(!Z)return;await VZ.runStep(()=>Nr4($,Z),{name:"executeStatusTransition",retriesAllowed:!0,maxAttempts:3})}function wr4($,Z){if(Z.updatedBy===aH)return;if(!YX1||!Es)return;let X=YX1;(async()=>{if(!await J3().getLinkByItemId(Z.id,$))return;await VZ.startWorkflow(X,{queueName:zO,workflowID:`jira-status:${Z.id}:${Z.status}:${Date.parse(Z.updatedAt)}`,enqueueOptions:{queuePartitionKey:$}})({organizationId:$,itemId:Z.id})})().catch((Q)=>{console.warn(`[jira] status push enqueue failed for ${Z.id}:`,Q instanceof Error?Q.message:Q)})}function Er4($,Z){if(Z.updatedBy===aH)return;if(!GX1||!Es)return;let X=GX1;(async()=>{if(!await J3().getLinkByItemId(Z.id,$))return;await VZ.startWorkflow(X,{queueName:zO,workflowID:`jira-sprint:${Z.id}:${Z.sprintId??"backlog"}:${Date.parse(Z.updatedAt)}`,enqueueOptions:{queuePartitionKey:$}})({organizationId:$,itemId:Z.id})})().catch((Q)=>{console.warn(`[jira] sprint push enqueue failed for ${Z.id}:`,Q instanceof Error?Q.message:Q)})}async function KX1($,Z){try{if(!QX1)return;if(!await $.storage.jiraIntegrations.getLinkByItemId(Z.taskBoardItemId,Z.organizationId))return;await VZ.startWorkflow(QX1,{queueName:zO,workflowID:`jira-cmt-push:${Z.commentId}`,enqueueOptions:{queuePartitionKey:Z.organizationId}})(Z)}catch(X){console.warn(`[jira] comment push enqueue failed for ${Z.commentId}:`,X instanceof Error?X.message:X)}}function WX1(){if(XX1)return;XX1=VZ.registerWorkflow(Xr4,{name:"jiraSyncWorkflow"}),VZ.registerScheduled(XX1,{name:"jiraSyncWorkflow",crontab:eo4,mode:so4.ExactlyOncePerIntervalWhenActive}),QX1=VZ.registerWorkflow(Hr4,{name:"jiraCommentPushWorkflow"}),YX1=VZ.registerWorkflow(Dr4,{name:"jiraStatusPushWorkflow"}),GX1=VZ.registerWorkflow(Lr4,{name:"jiraSprintPushWorkflow"})}var eo4="2-59/10 * * * *",Es=null,Qr4=30000,XX1=null,QX1=null,YX1=null,GX1=null;var ST0=L(()=>{Xv$();SO();Bc();wT0();tH();x71();Pj();MT0();rv$();l71();kT0()});function CT0($,Z,X,Q){PG({event:$,organizationId:Z,properties:{task_id:X.id,reports_task:BY(X),...Q}})}function u$($,Z){d5.emit($,{id:crypto.randomUUID(),type:fD$,source:"task-board",subject:Z.id,data:Z,time:new Date().toISOString()}),Promise.resolve().then(() => (ST0(),Gx$)).then((X)=>{X.maybeEnqueueJiraStatusPush($,Z),X.maybeEnqueueJiraSprintPush($,Z)}).catch((X)=>{console.warn("[jira] push hooks unavailable:",X)})}function Jx$($,Z){d5.emit($,{id:crypto.randomUUID(),type:bD$,source:"task-board",subject:Z,data:{id:Z},time:new Date().toISOString()})}function jr4($,Z){return $?[$]:Z}async function nv($,Z,X){let Q=$.metadata?.runMetadata?.taskBoardItemId,Y=!Q&&X?await $.storage.taskBoard.linkedTaskIds(X,Z):[];return jr4(Q,Y)}async function Kx$($,Z,X){let Q=$.organization?.id;if(!Q)return;try{for(let Y of await nv($,Q,X)){let G=await $.storage.taskBoard.getById(Y,Q),J=lv(Z),K=lv(G?.status??"");if(!G||J!==null&&K!==null&&J<=K)continue;let W=await $.storage.taskBoard.update(Y,Q,{status:Z},$.auth?.user?.id??G.updatedBy);if(await $.storage.taskBoard.recordActivity({taskBoardItemId:Y,action:"status_changed",actorId:null,data:{from:G.status,to:Z}}).catch((H)=>console.error("[task-board] activity log write failed",H)),u$(Q,W),Z==="in_progress")CT0("task_run_started",Q,W,{from:G.status})}}catch(Y){console.error("[task-board] run transition failed",Y)}}async function _T0($,Z){let X=$.organization?.id;if(!X)return;try{for(let Q of await nv($,X,Z)){let Y=await $.storage.taskBoard.openReviewCycleIfInProgress(Q,X,await A9($,X));if(!Y)continue;u$(X,Y),CT0("task_run_completed",X,Y,{from:"in_progress",via:"pr_open"})}}catch(Q){console.error("[task-board] review-cycle open failed",Q)}}async function vT0($,Z,X,Q){let Y=$.organization?.id;if(!Y)return;try{let G=OT0(Z);if(!G)return;let J=await nv($,Y,Q);for(let K of J)await $.storage.taskBoard.linkPr({taskBoardItemId:K,organizationId:Y,url:G.url,prNumber:G.number,repoOwner:G.owner,repoName:G.repo,connectionId:X??null})}catch(G){console.error("[task-board] PR capture failed",G)}}async function wc($,Z,X,Q,Y){try{let G=await $.advanceLinkedTasksToReviewOnThreadFinish(Z,X,Y);for(let J of G)u$(X,J),CT0("task_run_completed",X,J,{from:"in_progress",via:"thread_finish"});for(let J of G)await $.clearRunRetry(J.id,X).catch(()=>{})}catch(G){console.error("[task-board] thread-finish transition failed",G)}await HX1($,Z,X,Y),await FX1($,Q,Z,X)}function Wx$($){return(lv($.status)??-1)>=DT0.in_review||Boolean($.reviewCycleStartedAt)}async function HX1($,Z,X,Q){try{let Y=await $.failedRunInfo(Z,X);if(!Y)return;let G=t_$(Y);for(let J of await $.linkedTaskIds(Z,X)){let K=await $.getById(J,X);if(!K)continue;if(Wx$(K))await $.relabelDeliveredFailure(Z,X,Ar4).catch(()=>{});if(K.status!=="in_progress")continue;if(K.reviewCycleStartedAt)continue;if(K.threads.some((F)=>F.hasMessages&&F.status==="in_progress"))continue;let W=K.retryAttempts;if(W<G){let F=j7(Pr4,zr4,W,2,0.5);if(!await $.scheduleRunRetry(J,X,W+1,new Date(Date.now()+F),Q.progress))continue;await $.recordActivity({taskBoardItemId:J,action:"status_changed",actorId:null,data:{from:"in_progress",to:"in_progress",retry:W+1,of:G,reason:Y.errorText??Y.kind}}).catch(()=>{});continue}let H=await $.returnToTodoAfterFailure(J,X,K.updatedBy,Q);if(!H)continue;await $.recordActivity({taskBoardItemId:J,action:"status_changed",actorId:null,data:{from:"in_progress",to:"todo",reason:Y.errorText??Y.kind,retriesSpent:W}}).catch(()=>{}),u$(X,H),CT0("task_run_failed",X,K,{reason:Y.kind??"error",retries_spent:W})}}catch(Y){console.error("[task-board] failed-run reaction failed",Y)}}async function FX1($,Z,X,Q){try{for(let Y of await $.linkedTaskIds(X,Q)){let G=await $.getById(Y,Q);if(!G)continue;if(Wx$(G))continue;if(G.threads.some((K)=>K.hasMessages&&(K.status===null||!Us.has(K.status))))continue;if((await $.listPrs(Y,Q)).length>0)continue;await cD$(Z,Q,Y)}}catch(Y){console.error("[task-board] quota refund pass failed",Y)}}async function NX1($,Z){let X=await A9($,Z.organizationId);if(Z.status!==X.progress||!VY(Z,X.review))return;if(!vv(Z.organizationId,"in_review",X.review,"parking a reviewed card for a person"))return;try{let Q=await $.storage.taskBoard.update(Z.id,Z.organizationId,{status:X.review},Z.updatedBy);await $.storage.taskBoard.recordActivity({taskBoardItemId:Z.id,action:"status_changed",actorId:null,data:{from:Z.status,to:"in_review"}}).catch(()=>{}),u$(Z.organizationId,Q)}catch(Q){console.error(`[task-board] parking ${Z.id} for review failed`,Q)}}async function sH($,Z,X){let Q=Z.organizationId;if(Z.assigneeId!==W8)return!1;try{await NX1($,Z).catch((G)=>console.warn(`[task-board] parking ${Z.id} before hand-off failed`,G));let Y=await $.storage.taskBoard.unassignSuperAgent(Z.id,Q,Z.updatedBy);if(!Y)return!1;return await k6($,{taskBoardItemId:Z.id,action:"assignee_changed",actorId:null,data:{from:Z.assigneeId,to:null,reason:X}}),console.warn(`[task-board] ${Z.id} handed to a human: ${X}`),u$(Q,Y),!0}catch(Y){return console.error(`[task-board] handing ${Z.id} to a human failed`,Y),!1}}async function Hx$($,Z,X){if(!(X instanceof AQ))return!1;if(X.reason!=="runs_exhausted")return!1;return await sH($,Z,"per-task run limit reached \u2014 the Super Agent can no longer re-dispatch "+"itself on this task. Re-run it manually to continue."),!0}async function Fx$($,Z){let X=$.organization?.id;if(!X)return;try{let Q=await $.storage.taskBoard.reopenLinkedTasksOnThreadRun(Z,X);for(let Y of Q)u$(X,Y)}catch(Q){console.error("[task-board] thread-run reopen failed",Q)}}function Nx$($){return $.includes("create_pull_request")||$.includes("createPullRequest")}function Ux$($){if(Tr4.test($))return!0;return Rr4.test($)&&Ir4.test($)}var zr4=30000,Pr4=120000,Ar4="Run ended after it had already delivered \u2014 the task moved on without it",Tr4,Rr4,Ir4;var k5=L(()=>{pJ();x4();tH();m5();Uc();o_$();J4();Fs();q6();CX();oH();Tr4=/\bgh\s+pr\s+create\b/,Rr4=/api\.github\.com\/repos\/[^\s"']+\/pulls\b/,Ir4=/(?:-X|--request)\s+POST/});function qr4($){if($.status==="completed")return"advance";if($.status==="failed"&&$.messageStorageVersion===2&&($.harnessId==="decopilot"||$.harnessId==="claude-code"))return"nudge";return"none"}function Mr4($){return["This task is still In Progress on the board and your last run ended without finishing it.","","Look at what you already did (`git log`, `git status`, and the messages above), then either:","- finish the remaining work (and open the PR, if it needed code changes),","- or, if it's actually done, say so in one line \u2014 the board moves the card for you,",$==="decopilot"?"- or, if you're blocked on something only a human knows, call the `user_ask` tool.":"- or, if you're blocked on something only a human knows, say what you need and stop.","","Don't start over and don't redo work you already committed or pushed. You are on the same branch as before \u2014 push to it and update your existing pull request rather than opening a second one."].join(`
|
|
2820
2820
|
`)}async function Vr4($,Z,X){await Hc($,Z,X,{messageId:`stall-nudge-${Z.id}-${X.id}`,prompt:Mr4(X.harness_id),workflowID:`stall-nudge:${Z.id}:${X.id}`})}async function kr4($,Z){let X=await $.storage.threads.get(Z);if(!X)return{action:"none",thread:null};return{action:qr4({status:X.status,messageStorageVersion:X.message_storage_version,harnessId:X.harness_id}),thread:X}}function Sr4($,Z=Date.now()){if($.status!=="in_progress")return!1;if($.run_started_at)return!1;return Ws($,Z)}async function Cr4($,Z){let X=[];for(let Q of Z.threads){if(Q.status!=="in_progress")continue;let Y=await $.storage.threads.get(Q.threadId);if(!Y||!Sr4(Y))continue;if(await $.storage.threads.markRunFailed(Q.threadId,UX1,"abandoned"))X.push(Q.threadId),console.warn(`[task-board] failed never-started thread ${Q.threadId} on ${Z.id}`)}return X}async function Bx$($,Z){let X=$.organization?.id;if(!X)return;for(let Q of Z){if(Q.status==="in_progress")try{if((await Cr4($,Q)).length>0)continue}catch(J){console.error(`[task-board] reaping threads for ${Q.id} failed`,J)}let Y;try{Y=Q.repo!=null&&(await $.storage.taskBoard.listPrs(Q.id,X)).length>0}catch(J){console.error(`[task-board] listPrs for ${Q.id} failed`,J);continue}if(!S71(Q,Y))continue;let G=Q.threads.find((J)=>J.hasMessages);if(!G)continue;try{let{action:J,thread:K}=await kr4($,G.threadId);if(J==="none"||!K)continue;if(J==="advance")await wc($.storage.taskBoard,G.threadId,X,$.storage.organizationBilling,await A9($,X));else await Vr4($,Q,K)}catch(J){console.error(`[task-board] stall recovery failed for ${Q.id}`,J)}}}var UX1="Run never started \u2014 no pod picked it up before the idle window elapsed";var BX1=L(()=>{m5();WT0();tH();k5()});import{z as K3}from"zod";var _r4,tv;var OX1=L(()=>{m5();k0();HY();nK();BX1();_r4=K3.object({key:K3.string(),title:K3.string(),position:K3.number(),role:K3.string().nullable()}),tv=c({name:"TASK_BOARD_ITEM_LIST",description:"List all task board items for the organization, plus the `owner/name` repos this organization has imported (the valid values for a task's `repo` field).",annotations:{title:"List Task Board Items",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:K3.object({}),outputSchema:K3.object({items:K3.array(Xc),repos:K3.array(K3.string()),sprints:K3.array(OS$),columns:K3.array(_r4)}),handler:async($,Z)=>{a(Z),await Z.access.check();let X=Z.organization?.id;if(!X)throw Error("Organization ID required (no active organization in context)");let[Q,{items:Y},G,J]=await Promise.all([Z.storage.taskBoard.list(X),Z.storage.connections.list(X,{slug:"mcp-github"}),Z.storage.sprints.listByOrg(X),V5(Z,X).then((W)=>W.columns())]),K=gL$(Y);return Bx$(Z,Q),{items:Q,repos:K,sprints:G,columns:J}}})});import{z as SY}from"zod";function fr4($){return xr4.some((Z)=>$[Z]!==void 0)}function br4($,Z){let X=[];for(let{field:G,action:J}of vr4){if(Z[G]===$[G])continue;X.push({action:J,data:{from:$[G],to:Z[G]}})}if(Z.description!==$.description)X.push({action:"description_changed"});let Q=new Set($.tags.map((G)=>G.id));if(Z.tags.length!==$.tags.length||Z.tags.some((G)=>!Q.has(G.id)))X.push({action:"tags_changed",data:{from:$.tags,to:Z.tags}});return X}function yr4($,Z){if($!==W8)return!1;if(!Z)return!1;return Z.assigneeId!==W8?!0:Z.status==="todo"}function hr4($,Z,X,Q){let Y=$!==void 0&&gr4.has($),G=Z!==void 0&&VY(Z,Q);return X&&Y&&G}function LX1($,Z){return $!==void 0&&_71($)&&!Z}var vr4,xr4,gr4,ov;var xT0=L(()=>{m5();k0();f9();nK();oH();CZ1();SU();CX();bD();k5();$X1();Uc();pJ();vr4=[{field:"status",action:"status_changed"},{field:"assigneeId",action:"assignee_changed"},{field:"priority",action:"priority_changed"},{field:"type",action:"type_changed"},{field:"dueDate",action:"due_date_changed"},{field:"title",action:"title_changed"},{field:"sprintId",action:"sprint_changed"}],xr4=["title","description","status","priority","type","assigneeId","repo","dueDate","sortOrder","sprintId","tagIds"];gr4=new Set(["approved","merged","post_deploy_validation","done","archived"]);ov=c({name:"TASK_BOARD_ITEM_UPDATE",description:"Update a task board item's fields (title, description, status, priority, assignee), and/or link a chat thread to it.",annotations:{title:"Update Task Board Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:SY.object({id:SY.string(),title:SY.string().min(1).max(_A0).optional(),description:SY.string().max(CA0).nullable().optional(),status:PU.optional(),priority:xv.optional(),type:na.optional(),assigneeId:SY.string().nullable().optional(),repo:SY.string().max(vA0).nullable().optional(),dueDate:SY.string().datetime().nullable().optional(),sortOrder:SY.number().optional(),sprintId:SY.string().nullable().optional(),tagIds:SY.array(SY.string()).max(1000).optional(),linkThreadId:SY.string().optional(),prUrl:SY.string().nullable().optional().describe("GitHub pull request URL to link to this task, e.g. https://github.com/owner/repo/pull/123. Pass it after opening a PR for an existing card; linking one is what starts its review.")}),outputSchema:SY.object({item:Xc}),handler:async($,Z)=>{a(Z),await Z.access.check();let X=Z.organization?.id;if(!X)throw Error("Organization ID required (no active organization in context)");let Q=$.prUrl?dD($.prUrl):null;if($.prUrl&&!Q)throw Error(`Not a GitHub pull request URL: ${$.prUrl} (expected https://github.com/<owner>/<repo>/pull/<number>)`);if($.sprintId){if(!(await Z.storage.sprints.listByOrg(X)).some((U)=>U.id===$.sprintId))throw Error("sprintId is not a sprint on this board")}if($.assigneeId)await xA0(Z,X,$.assigneeId);if($.linkThreadId){if(!await Z.storage.taskBoard.getById($.id,X))throw Error(`Task board item not found: ${$.id}`);if(!await Z.storage.threads.get($.linkThreadId))throw Error(`Thread not found: ${$.linkThreadId}`);await Z.storage.taskBoard.linkThread($.id,$.linkThreadId,X)}let Y=fr4($),G=Y?await Z.storage.taskBoard.getById($.id,X):null;if(Y&&!G)throw Error(`Task board item not found: ${$.id}`);let J=await V5(Z,X);if($.status!==void 0)await kA0(J,$.status);if($.status!==void 0&&_71($.status)){let N=await Z.storage.organizationSettings.get(X);if(LX1($.status,Q7(N?.flags,"delivery_lanes_enabled")))throw Error("Delivery lanes are not enabled for this organization \u2014 enable "+"them in Settings before moving a task to Approved, Merged, or Post-deploy Validation.")}let K=jU.getStore()!==void 0;if(hr4($.status,G??void 0,K,(await J.lanes()).review))throw Error("This task is under review \u2014 a run can't move it to Done or Archived. "+"Leave it for the reviewer; only a person, or TASK_BOARD_REVIEW_DECISION on a reviewer's own run, closes out a task under review.");let W=$.assigneeId!==void 0&&$.assigneeId!==(G?.assigneeId??null),H=yr4($.assigneeId,G);if(G&&BY(G)){if($.title!==void 0||$.description!==void 0||$.priority!==void 0)throw Error("This task was generated from your report and can't be edited \u2014 create your own task instead.");if(H)await wu(Z,G,KD())}if($.tagIds!==void 0){let N=await Z.storage.tags.listOrgTags(X),U=new Set(N.map((B)=>B.id));for(let B of $.tagIds)if(!U.has(B))throw Error(`Tag not found: ${B}`);await Z.storage.taskBoard.setItemTags($.id,$.tagIds,a0(Z))}let F;if(Y)F=await Z.storage.taskBoard.update($.id,X,{title:$.title,description:$.description,status:H?"todo":$.status,...$.status!==void 0||H?{boardColumnOrg:J.columnOwner()}:{},priority:$.priority,type:$.type,assigneeId:$.assigneeId,assignedBy:W?$.assigneeId?a0(Z):null:void 0,repo:$.repo,dueDate:$.dueDate,sortOrder:$.sortOrder,sprintId:$.sprintId},a0(Z));else{let N=await Z.storage.taskBoard.getById($.id,X);if(!N)throw Error(`Task board item not found: ${$.id}`);F=N}if(Q)await Z.storage.taskBoard.linkPr({taskBoardItemId:F.id,organizationId:X,url:Q.url,prNumber:Q.number,repoOwner:Q.owner,repoName:Q.repo,connectionId:null});if(G){let N=a0(Z),U=br4(G,F);if(U.length>0)await r_$(Z,U.map((B)=>({taskBoardItemId:F.id,actorId:N,...B,alsoSubscribe:B.action==="assignee_changed"&&F.assigneeId!==W8?[F.assigneeId]:void 0})))}if(G&&F.description!==G.description)await Z.storage.notifications.notifyMentions({taskBoardItemId:F.id,organizationId:X,actorId:a0(Z),body:F.description??"",previousBody:G.description});if(Y||$.linkThreadId||Q)u$(X,F);if(H)return await tD(Z,F,{userInitiated:!0}),{item:F};if($.status!==void 0&&G!==null&&G.status!==F.status)F=await VT0(Z,F,{assignedBy:a0(Z),actor:a0(Z)});return{item:F}}})});import{z as fT0}from"zod";var rv;var DX1=L(()=>{k0();k5();rv=c({name:"TASK_BOARD_ITEM_DELETE",description:"Delete a task board item. A reports-pushed task also dismisses its finding, so the next diagnostic import won't re-create the card.",annotations:{title:"Delete Task Board Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:fT0.object({id:fT0.string()}),outputSchema:fT0.object({success:fT0.boolean()}),handler:async($,Z)=>{a(Z),await Z.access.check();let X=Z.organization?.id;if(!X)throw Error("Organization ID required (no active organization in context)");if(!await Z.storage.taskBoard.delete($.id,X,a0(Z)??"system"))throw Error(`Task board item not found: ${$.id}`);return Jx$(X,$.id),{success:!0}}})});function av($){if($.length===0)return!1;let Z=new Map;for(let X of $){let Q=`${X.repoOwner}/${X.repoName}`.toLowerCase(),Y=Z.get(Q);if(Y)Y.push(X);else Z.set(Q,[X])}return[...Z.values()].every(ur4)}function ur4($){return $.some((Z)=>Z.merged===!0)&&$.every((Z)=>Z.merged===!0||Z.state==="closed")}async function cr4($,Z,X,Q){let Y=await $.storage.taskBoard.getById(X,Z);if(!Y||Y.status!=="done")return!1;let G=await $.storage.taskBoard.listPrs(X,Z),J=await Promise.all(G.map(async(F)=>({...F,...await Q($,Z,F)})));if(!av(J))return!1;let K=await V5($,Z),W=await K.archiveColumn();if(!W)return!1;let H=await $.storage.taskBoard.update(X,Z,Z3(K,W),Y.updatedBy);return await k6($,{taskBoardItemId:X,action:"status_changed",actorId:null,data:{from:"done",to:W,reason:"merged_pr_auto_archive"}}),u$(Z,H),!0}async function Ox$($,Z,X,Q=yT0){let Y=0;for(let G of X)try{if(await cr4($,Z,G,Q))Y+=1}catch(J){console.error(`[task-board-archive] ${G} failed`,J)}return{archived:Y}}function bT0($){let Z=new Map;for(let{id:X,organizationId:Q}of $){let Y=Z.get(Q);if(Y)Y.push(X);else Z.set(Q,[X])}return[...Z].map(([X,Q])=>({organizationId:X,itemIds:Q}))}var Ec=L(()=>{m5();CX();gG();k5()});function gT0($){return $.replace(/\/api\/[^/\s)]+\/fs\/([^/\s)]+)\/read\?path=([^)\s]+)/g,(Z,X,Q)=>{let Y,G;try{Y=decodeURIComponent(X),G=decodeURIComponent(Q)}catch{return Z}let J=(K)=>K.startsWith("/")||K.split("/").includes("..");if(J(Y)||J(G))return Z;return uH(Y,G)})}function hT0($,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 wX1=L(()=>{$P()});function lr4($){let Z=new Map($.map((G)=>[G.id,G])),X=new Map;for(let G of $c($)){let J=Lx$(G.owner,G.repo);X.set(J,[...X.get(J)??[],G])}if(X.size!==1)return null;let Q=[...X.values()][0],Y=Q.find((G)=>{let J=Z.get(G.connectionId);return J?vz(J):!1})??Q[0];return{connectionId:Y.connectionId,owner:Y.owner,name:Y.repo,installationId:Y.installationId,url:`https://github.com/${Y.owner}/${Y.repo}`}}async function uT0($,Z){if(!mZ0())return console.warn(`[task-board] claude-code skipped for org ${Z}: `+"hosted sandbox unavailable \u2014 running Decopilot"),null;try{let{items:X}=await $.storage.connections.list(Z,{slug:"mcp-github"}),Q=lr4(X);if(Q)return{repo:Q};let Y=new Map;for(let J of $c(X)){let K=Lx$(J.owner,J.repo);if(!Y.has(K))Y.set(K,{connectionId:J.connectionId,repo:`${J.owner}/${J.repo}`})}let G=Y;if(G.size===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}: ${G.size} importable repos \u2014 the run picks one with TASK_ADD_REPO`),{choices:[...G.values()]}}catch(X){return console.warn("[task-board] repo lookup for claude-code failed",X),null}}function Dx$($,Z,X){let Q=["You've been assigned this task. Complete it and finish with a pull request 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 Y=gT0($.description);Q.push("","Description:",Y);let G=hT0($.description,Y);if(G)Q.push("",G)}if(Q.push("",Z?`The repository ${Z.owner}/${Z.name} is already cloned at your working directory, on its own branch. \`git\` and \`gh\` are authenticated. ${gr}`:["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 connectionId 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 and `git` and `gh` are authenticated. Do not read files, run `git`, or run `gh` before it returns; there is nothing there yet.","","Repositories in this organization:",...(X?.repoChoices??[]).map((Y)=>`- ${Y.repo} (connectionId: ${Y.connectionId})`),X?.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 pull request per repository you changed.":"Call `mcp__studio__TASK_ADD_REPO` with no arguments to list them."].join(`
|
|
2821
|
-
`),""),X?.resolveConflict&&X.pr)Q.push(`Pull request #${X.pr.number} (${X.pr.url}) is approved but has a MERGE CONFLICT with its base branch.`,`Check that branch out (\`gh pr checkout ${X.pr.number}\`), merge or rebase the base branch into it, resolve the conflicts, and push to update the SAME pull request \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(X?.feedback)Q.push(X.pr?`A reviewer requested changes on pull request #${X.pr.number} (${X.pr.url}):`:"A reviewer requested changes on your previous work:",X.feedback,X.pr?`Check that branch out (\`gh pr checkout ${X.pr.number}\`) before editing, address the feedback, then push to update the SAME pull request \u2014 do NOT open a new one.`:"Address this feedback.","");else if(X?.pr)Q.push(`This task already has an open pull request #${X.pr.number} (${X.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.","");return Q.push("How to finish:","- Make the change, commit it, push the branch, and open a pull request"+(X?.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 dead code, and it 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.","- Nothing is installed and NO dev server is running \u2014 this sandbox is a checkout. Usually you don't need one: read the code path end to end, run the repo's tests, and `curl` the LIVE site for how it behaves today. Only start a dev server if you must see YOUR change rendered \u2014 it is a cold start, so expect several minutes: launch it ONCE in the background and poll until it answers rather than guessing a sleep.",
|
|
2821
|
+
`),""),X?.resolveConflict&&X.pr)Q.push(`Pull request #${X.pr.number} (${X.pr.url}) is approved but has a MERGE CONFLICT with its base branch.`,`Check that branch out (\`gh pr checkout ${X.pr.number}\`), merge or rebase the base branch into it, resolve the conflicts, and push to update the SAME pull request \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(X?.feedback)Q.push(X.pr?`A reviewer requested changes on pull request #${X.pr.number} (${X.pr.url}):`:"A reviewer requested changes on your previous work:",X.feedback,X.pr?`Check that branch out (\`gh pr checkout ${X.pr.number}\`) before editing, address the feedback, then push to update the SAME pull request \u2014 do NOT open a new one.`:"Address this feedback.","");else if(X?.pr)Q.push(`This task already has an open pull request #${X.pr.number} (${X.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.","");return Q.push("How to finish:","- Make the change, commit it, push the branch, and open a pull request"+(X?.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 dead code, and it 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.","- Nothing is installed and NO dev server is running \u2014 this sandbox is a checkout. Usually you don't need one: read the code path end to end, run the repo's tests, and `curl` the LIVE site for how it behaves today. Only start a dev server if you must see YOUR change rendered \u2014 it is a cold start, so expect several minutes: launch it ONCE in the background and poll until it answers rather than guessing a sleep.",'- For a VISUAL change that means LOOKING at it: `qa-screenshot <url> <path>.png [--mobile] [--full] [--selector=<css>]` renders the page in headless Chromium \u2014 it reaches a dev server you started on localhost as well as any public URL, and unlike `curl` it runs the page\'s JS, so lazily-rendered sections are actually there. Then `Read` the file: a screenshot you never opened is not verification. It is already installed; do NOT look for playwright in the repo\'s `node_modules`. To INTERACT with a page \u2014 click, hit-test with `document.elementFromPoint`, fill a form \u2014 write a throwaway node script that requires the global playwright-core: `const { chromium } = require("/usr/local/lib/node_modules/playwright-core"); chromium.launch({ executablePath: "/usr/bin/chromium", args: ["--no-sandbox"] })`. Screenshots alone are not the limit of what you can check.',"- As soon as `gh pr create` prints the URL, call `mcp__studio__TASK_BOARD_ITEM_PR_LINK` with that url. Do this even if you also mention the PR in a comment \u2014 the reviewers are dispatched from the linked PR, not from your message.",'- 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})`),Q.join(`
|
|
2822
2822
|
`)}var Lx$=($,Z)=>`${$}/${Z}`.toLowerCase();var EX1=L(()=>{qA0();HY();q6();P$();wX1()});import{createHmac as mr4,randomBytes as dr4,timingSafeEqual as ir4}from"crypto";function pr4(){if(cT0)return cT0;let $;try{let Z=v0();$=Z.studioJwtSecret??Z.betterAuthSecret}catch{$=void 0}return cT0=$?Buffer.from($):dr4(32),cT0}function jX1($,Z,X){return`rtok_${mr4("sha256",pr4()).update(`${$}:${Z}:${X.toISOString()}`).digest("base64url")}`}function wx$($,Z,X,Q){let Y=Buffer.from($),G=Buffer.from(jX1(Z,X,Q));return Y.length===G.length&&ir4(Y,G)}var cT0=null;var zX1=L(()=>{P$()});import{createHash as nr4}from"crypto";function js($,Z){if($.status===null||Ex$.has($.status))return!1;return!Ws({updated_at:$.lastActiveAt,last_progress_at:null},Z)}function tr4($,Z){return $.threads.some((X)=>!VH.some((Q)=>GD(X.title,Q))&&js(X,Z))}function ar4($,Z){return Z-$>=rr4}async function lT0($,Z,X){let Q=await $.storage.organizationSettings.get(Z.organizationId),Y=ZU(Q?.flags);if(Y.length===0)return;if(tr4(Z,Date.now()))return;let G=Q7(Q?.flags,"cheap_reviewer_model")?"reviewer":"default",J=await $.storage.taskBoard.listActivity(Z.id,Z.organizationId),K=Z.reviewCycleStartedAt,W=XU(J,K),H=new Date(W),F=JD(J,{cycleStartedAt:K});await Promise.all(Y.map(async(N)=>{let U=F.has(N);if(!U){let O=Ya4(J,W),D=Qa4(Z,N,W,O);if(D){await Wa4($,Z,N,D).catch((w)=>console.error(`[task-board] ${N} verdict nudge failed`,w));return}if(Ja4(O,Date.now()))return}if(Za4(Z,N,W,Date.now(),U)){await sH($,Z,`${kH[N]} failed ${PX1} times on `+"this review \u2014 it will not be retried");return}if(X?.previewMatchesHead===!1){if(ar4(W,Date.now()))await sH($,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(Xa4(Z,N,W,Date.now(),U))return;let B=sr4(Z,N,W,Date.now(),U);await Na4($,Z,N,H,B,G).catch((O)=>console.error(`[task-board] ${N} reviewer enqueue failed`,O))}))}function sr4($,Z,X,Q=Date.now(),Y=!0){return $.threads.filter((G)=>GD(G.title,Z)&&AX1(G,Q,Y)&&new Date(G.createdAt).getTime()>=X).length}function er4($,Z){if(!$||!Z||!("choices"in Z))return null;return Z.choices.find((X)=>X.repo===$)?.connectionId??null}function $a4($,Z,X){let Q=$.threads.filter((Y)=>GD(Y.title,Z)&&Y.status==="completed"&&new Date(Y.createdAt).getTime()<X).map((Y)=>new Date(Y.lastActiveAt).getTime()).filter((Y)=>Number.isFinite(Y));return Q.length===0?0:Math.max(...Q)}function AX1($,Z,X=!0){if($.status==="failed")return!0;if($.status!==null&&Ex$.has($.status))return!X;return $.status!==null&&!js($,Z)}function jx$($,Z,X,Q=Date.now()){return $.threads.filter((Y)=>{if(!GD(Y.title,Z))return!1;return js(Y,Q)||new Date(Y.createdAt).getTime()>=X})}function Za4($,Z,X,Q=Date.now(),Y=!0){let G=jx$($,Z,X,Q);return G.length>0&&G.every((J)=>AX1(J,Q,Y))&&G.length>=PX1}function Xa4($,Z,X,Q=Date.now(),Y=!0){let G=jx$($,Z,X,Q);if(G.length===0)return!1;if(G.some((K)=>js(K,Q)))return!0;let J=G.filter((K)=>AX1(K,Q,Y));if(J.length>=PX1)return!0;return J.length!==G.length}function Qa4($,Z,X,Q,Y=Date.now()){return $.threads.find((G)=>GD(G.title,Z)&&G.status==="completed"&&!js(G,Y)&&new Date(G.createdAt).getTime()>=X&&!Q.has(G.threadId))??null}function Ya4($,Z){let X=new Map;for(let Q of $){if(Q.action!=="review_verdict_requested")continue;let Y=new Date(Q.occurredAt).getTime();if(Y<Z)continue;let G=Q.data?.threadId;if(typeof G==="string")X.set(G,Y)}return X}function Ja4($,Z){for(let X of $.values())if(Z-X<Ga4)return!0;return!1}function Ka4($){return[`Your ${kH[$]} 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(`
|
|
2823
2823
|
`)}async function Wa4($,Z,X,Q){let Y=await $.storage.threads.get(Q.threadId);if(!Y||Y.message_storage_version!==2)return;await $.storage.taskBoard.recordActivity({taskBoardItemId:Z.id,action:"review_verdict_requested",actorId:null,data:{reviewer:X,threadId:Q.threadId}}),console.warn(`[task-board] ${X} reviewer on ${Z.id} completed with no verdict \u2014 `+"asking for one"),await Hc($,Z,Y,{messageId:`review-verdict-${Q.threadId}`,prompt:Ka4(X),workflowID:`review-verdict:${Q.threadId}`,runClass:"reviewer"})}function Ha4($,Z,X,Q){return`review:${$}:${Z}:${X.toISOString()}:${Q}`}function Fa4($){return`thrd_${nr4("sha256").update($).digest("hex").slice(0,32)}`}async function Na4($,Z,X,Q,Y,G){let J=Z.organizationId,K=jX1(Z.id,X,Q),W=await uT0($,J),H=W&&"repo"in W?W.repo:null,F=W!==null,N=$a4(Z,X,Q.getTime()),U=er4(Z.repo,W),B=F?"mcp__studio__TASK_BOARD_ITEM_PRS_GET":"TASK_BOARD_ITEM_PRS_GET",O=F?"mcp__studio__TASK_BOARD_REVIEW_DECISION":"TASK_BOARD_REVIEW_DECISION",D=F?"mcp__studio__TASK_BOARD_COMMENT_CREATE":"TASK_BOARD_COMMENT_CREATE",w=F?"mcp__studio__TASK_BOARD_COMMENT_LIST":"TASK_BOARD_COMMENT_LIST",E=[or4[X],"","You are running AUTONOMOUSLY \u2014 no human is watching this run. Making the "+'approve / request-changes call IS your job; you are the decision-maker, not an assistant asking a human to decide. NEVER use `user_ask` to ask whether to approve, or to confirm an obvious call ("Approve the PR?"). Reserve `user_ask` for a genuine, unresolvable blocker only a human can clear (e.g. a missing credential, or a requirement so ambiguous you '+"truly cannot judge the outcome) \u2014 that should be rare. When in doubt "+"between asking and deciding, DECIDE.","","Do NOT merge the pull request \u2014 the board does that itself once your "+"approval is in. Pushing fixes to the PR's own branch is expected of you; opening a second pull request, force-pushing, or touching any other ref is not."].join(`
|
|
2824
2824
|
`),j=Z.description&&F?gT0(Z.description):Z.description,z=Z.description&&j?hT0(Z.description,j):null,A=[...F?[]:[E,""],`Task title: ${Z.title}`,j?`
|
|
2825
2825
|
Task description:
|
|
2826
2826
|
${j}
|
|
2827
|
-
`:"",...z?[z,""]:[],"How to work:",`- Call \`${B}\` with the task id below to find the pull request under review.`,H?`- The repository ${H.owner}/${H.name} is already cloned at your working directory and \`git\` and \`gh\` are authenticated \u2014 check the PR's branch out there to inspect / exercise the change. ${gr}`:F?`- Your working directory is EMPTY. Call \`mcp__studio__TASK_ADD_REPO\` ${U?`with connectionId \`${U}\` (${Z.repo}) FIRST \u2014 do NOT call it with no arguments, that only lists the org's repositories and costs you a turn.`:"with the connectionId of the PR's repository FIRST;"} it clones the repository and waits for the checkout, and \`git\` and \`gh\` are authenticated once it returns. ${gr}`:"- Load the PR's repository to inspect / exercise the change.",`- ${_D$}`,...N>0?[`- This is a RE-REVIEW. You already reviewed an earlier version of this pull request and asked for changes, and there are more commits since (a human re-delegated the card, or your own fixes from that round are in the history). Read your own previous notes with \`${w}\`, then review WHAT MOVED SINCE \u2014 \`gh pr diff <number>\` still shows the whole PR, so narrow it with \`git log --since='${new Date(N).toISOString()}' --oneline\` and diff only those commits. Confirm your earlier notes were addressed and check the new commits for their own problems. Do NOT re-read the parts of the PR you already cleared.`]:[],"- Fix the issues you find on the PR's branch, run the repository's own checks, and push to that same PR. You are the last automated run on this task \u2014 nothing picks up findings you only describe.",`- THEN exercise the change on the PR's deploy \`previewUrl\` (from \`${B}\`) \u2014 re-read it after your push so you get the preview of YOUR commit, and wait for it if it is still building. Deep-link to the page/route the task affects (not root). If you cannot render or exercise it, do NOT approve \u2014 \`request_changes\` with what's blocking.`,"- For a VISUAL change, capture before/after by running `qa-screenshot <url> org/output/qa/<name>.png [--mobile] [--full] [--selector=<css>] [--console]` (headless Chromium, baked into the sandbox; also works against a dev server you started on localhost \u2014 none is running by default, this pod is a checkout). Choose the framing: default is the top viewport, `--full` is the whole page, and `--selector='<css>'` frames just the component you changed (best for a focused before/after). Add `--mobile` too for a responsive change, and `--console` to catch the runtime errors a screenshot alone reports as a pass. WRITE them under `org/output/` \u2014 that's what surfaces them on the task. Then `Read` the files to actually LOOK at them: a screenshot you never opened is not verification.",`- Record what you validated with \`${D}\` (scenarios + pass/fail, the exact URL + viewport, and anything you couldn't verify) BEFORE your decision. EMBED the before/after shots inline as markdown images referencing their org/output path, and put each before/after PAIR in a two-column table so they render side by side, e.g.:
|
|
2827
|
+
`:"",...z?[z,""]:[],"How to work:",`- Call \`${B}\` with the task id below to find the pull request under review.`,H?`- The repository ${H.owner}/${H.name} is already cloned at your working directory and \`git\` and \`gh\` are authenticated \u2014 check the PR's branch out there to inspect / exercise the change. ${gr}`:F?`- Your working directory is EMPTY. Call \`mcp__studio__TASK_ADD_REPO\` ${U?`with connectionId \`${U}\` (${Z.repo}) FIRST \u2014 do NOT call it with no arguments, that only lists the org's repositories and costs you a turn.`:"with the connectionId of the PR's repository FIRST;"} it clones the repository and waits for the checkout, and \`git\` and \`gh\` are authenticated once it returns. ${gr}`:"- Load the PR's repository to inspect / exercise the change.",`- ${_D$}`,...N>0?[`- This is a RE-REVIEW. You already reviewed an earlier version of this pull request and asked for changes, and there are more commits since (a human re-delegated the card, or your own fixes from that round are in the history). Read your own previous notes with \`${w}\`, then review WHAT MOVED SINCE \u2014 \`gh pr diff <number>\` still shows the whole PR, so narrow it with \`git log --since='${new Date(N).toISOString()}' --oneline\` and diff only those commits. Confirm your earlier notes were addressed and check the new commits for their own problems. Do NOT re-read the parts of the PR you already cleared.`]:[],"- Fix the issues you find on the PR's branch, run the repository's own checks, and push to that same PR. You are the last automated run on this task \u2014 nothing picks up findings you only describe.",`- THEN exercise the change on the PR's deploy \`previewUrl\` (from \`${B}\`) \u2014 re-read it after your push so you get the preview of YOUR commit, and wait for it if it is still building. Deep-link to the page/route the task affects (not root). If you cannot render or exercise it, do NOT approve \u2014 \`request_changes\` with what's blocking.`,"- For a VISUAL change, capture before/after by running `qa-screenshot <url> org/output/qa/<name>.png [--mobile] [--full] [--selector=<css>] [--console]` (headless Chromium, baked into the sandbox; also works against a dev server you started on localhost \u2014 none is running by default, this pod is a checkout). Choose the framing: default is the top viewport, `--full` is the whole page, and `--selector='<css>'` frames just the component you changed (best for a focused before/after). Add `--mobile` too for a responsive change, and `--console` to catch the runtime errors a screenshot alone reports as a pass. WRITE them under `org/output/` \u2014 that's what surfaces them on the task. Then `Read` the files to actually LOOK at them: a screenshot you never opened is not verification. To INTERACT with a page \u2014 click, hit-test with `document.elementFromPoint`, fill a form \u2014 `qa-screenshot` is not enough, but the browser it drives is yours: write a throwaway node script that requires the global playwright-core: `const { chromium } = require(\"/usr/local/lib/node_modules/playwright-core\"); chromium.launch({ executablePath: \"/usr/bin/chromium\", args: [\"--no-sandbox\"] })`. Do NOT report a check as impossible because Playwright is missing \u2014 it is installed.",`- Record what you validated with \`${D}\` (scenarios + pass/fail, the exact URL + viewport, and anything you couldn't verify) BEFORE your decision. EMBED the before/after shots inline as markdown images referencing their org/output path, and put each before/after PAIR in a two-column table so they render side by side, e.g.:
|
|
2828
2828
|
|
|
2829
2829
|
| Before | After |
|
|
2830
2830
|
| --- | --- |
|