@overdeck/desktop 0.45.16 → 0.45.18
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-electron/main.js +149 -158
- package/dist-electron/main.js.map +1 -1
- package/dist-electron/preload.js +17 -2
- package/dist-electron/preload.js.map +1 -1
- package/package.json +5 -4
- package/server/acceptance-criteria-aQFKQf-J.js +62 -0
- package/server/{advancing-selfheal-DJYAvGv-.js → advancing-selfheal-DgwQgm4D.js} +6 -6
- package/server/{agent-gc-D0wDIeV1.js → agent-gc-kpzxqT7P.js} +3 -3
- package/server/agent-state-C_6TG-Ad.js +3 -0
- package/server/{agent-state-service-CZrayD_G.js → agent-state-service-BUfovFfB.js} +1 -1
- package/server/{agent-state-service-DFslS5go.js → agent-state-service-nUD3qfob.js} +5 -5
- package/server/agents-BA15AQqo.js +3 -0
- package/server/{briefing-freshness-DESTCWo-.js → agents-BHBxr8c9.js} +5 -131
- package/server/{archive-planning-CbghE9-o.js → archive-planning-CzCW9Ifl.js} +5 -10
- package/server/{archive-planning-CoyIbgGK.js → archive-planning-D-QsBufn.js} +1 -1
- package/server/{artifact-index-jobs-CcSrUoSE.js → artifact-index-jobs-qqa51B2Z.js} +2 -2
- package/server/{backlog-auto-trigger-BfgDsII0.js → backlog-auto-trigger-B7Bi0bvY.js} +2 -2
- package/server/{behavior-BTpYbAv4.js → behavior-CWqNMqE5.js} +2 -2
- package/server/briefing-freshness-DuxIE1yr.js +131 -0
- package/server/{checkpoint-manager-BwFdegJF.js → checkpoint-manager-DF6hb9Jw.js} +3 -3
- package/server/{checkpoint-manager-DWSXooZV.js → checkpoint-manager-DixkLus7.js} +1 -1
- package/server/checkpoint-worker.js +1 -1
- package/server/{checkpoints-fjadfOKF.js → checkpoints-B1Z42tJE.js} +1 -1
- package/server/{checkpoints-BtUonbs3.js → checkpoints-BiviJqei.js} +2 -2
- package/server/{claude-hooks-provision-DiK62u0k.js → claude-hooks-provision-BeMGi4ty.js} +1 -1
- package/server/{claude-hooks-provision-DAtxutOs.js → claude-hooks-provision-Du_PkMsp.js} +2 -2
- package/server/{claude-permissions-CThLgf8d.js → claude-permissions-BB6agcOZ.js} +2 -2
- package/server/{claude-settings-overlay-BF9MPIwx.js → claude-settings-overlay-CAq2oFSK.js} +2 -2
- package/server/{claude-settings-overlay-Dx_Uqcmv.js → claude-settings-overlay-DUWWLd6M.js} +1 -1
- package/server/cli-BFgrSWKV.js +3 -0
- package/server/{cli-ByKIIMfT.js → cli-C33xPZNm.js} +9 -9
- package/server/{cliproxy-C_GuT5DU.js → cliproxy-BQX1TL6N.js} +1 -1
- package/server/{cliproxy-B4c1BUvs.js → cliproxy-CGBA1GzA.js} +2 -2
- package/server/{close-issue-BOuLKr6e.js → close-issue-DNv8npc1.js} +5 -5
- package/server/{closed-issue-reaper-CksfuiFD.js → closed-issue-reaper-DrqgBJlr.js} +1 -1
- package/server/{closed-issue-reaper-DCAYzNXW.js → closed-issue-reaper-LoMnnjtJ.js} +9 -9
- package/server/codex-DxLivxri.js +3 -0
- package/server/{codex-parser-mFYZh8vR.js → codex-parser-DboQnEXN.js} +2 -2
- package/server/{codex-BbqIRZjd.js → codex-sgWVCGUd.js} +43 -18
- package/server/{config-Dj6N8EP9.js → config-6MCHOZ2N.js} +1 -1
- package/server/{config-DVLdmnMJ.js → config-DfaUXr6r.js} +2 -2
- package/server/{config-yaml-cNOZcEww.js → config-yaml-CqaAyn8y.js} +74 -74
- package/server/{conflict-gate-BMKm_5DV.js → conflict-gate-BF_zhcmb.js} +3 -3
- package/server/{conflict-gate-CuXUv-bP.js → conflict-gate-BubJprtD.js} +1 -1
- package/server/{context-layers-c0JqYHcS.js → context-layers-BFrxfl0l.js} +17 -3
- package/server/{context-layers-CeAwSYNt.js → context-layers-DWL_8HhY.js} +2 -2
- package/server/{control-settings-D4EFsRBd.js → control-settings-BguNQ1F_.js} +4 -4
- package/server/{conversation-compaction-kHVfVRg3.js → conversation-compaction-CRKAf2qP.js} +1 -1
- package/server/{conversation-compaction-BCggyih4.js → conversation-compaction-DxSXl0pT.js} +8 -8
- package/server/{conversation-service-BTzObqGi.js → conversation-service-DzuY9qoH.js} +1 -1
- package/server/{conversation-service-B8LFQQm1.js → conversation-service-mFVFdDQK.js} +6 -6
- package/server/{conversations-B-lcHv-5.js → conversations-BX5aD-6F.js} +4 -4
- package/server/{conversations-BM7zlXjr.js → conversations-BajHQ60c.js} +1 -1
- package/server/{cost-D9kPIY_5.js → cost-BoqD1Pxz.js} +2 -2
- package/server/{cost-BcpRQ-7o.js → cost-DuZ5vlv-.js} +3 -3
- package/server/{cost-sync-DF6odxK9.js → cost-sync-BYnmnMkY.js} +3 -3
- package/server/{dag-DKI3sOmX.js → dag-C6kYyF17.js} +7 -243
- package/server/{dangerous-git-ops-Bn18PEcN.js → dangerous-git-ops-q5OPtXMd.js} +1 -1
- package/server/dashboard-db-worker.js +6 -6
- package/server/{deacon-DONuopff.js → deacon-CwCiNuEZ.js} +3 -3
- package/server/{deacon-DdARMjZq.js → deacon-Dru5onpk.js} +233 -162
- package/server/{deacon-nudge-log-B-naf89q.js → deacon-nudge-log-ilDfxrhK.js} +1 -1
- package/server/{deacon-swarm-BNGkmYR_.js → deacon-swarm-BPmBmSoU.js} +298 -72
- package/server/deacon-swarm-CKyGJng1.js +2 -0
- package/server/deacon.js +14 -7
- package/server/{devcontainer-renderer-C-34Sxyz.js → devcontainer-renderer-BqGNCzvN.js} +3 -3
- package/server/{dist-BMXvKiZP.js → dist-BwlEiLCU.js} +1 -1
- package/server/dist-Bx4KkgYL.js +3 -0
- package/server/{dist-src-BgGUblXg.js → dist-src-BE0Denfs.js} +1 -1
- package/server/{docker-apZ9pBYw.js → docker-CNjXS72x.js} +2 -2
- package/server/{ensure-devcontainer-Bqi1EF1P.js → ensure-devcontainer-5e9xOve4.js} +4 -4
- package/server/{ensure-devcontainer-Dq3KoOIl.js → ensure-devcontainer-C6gyUQdE.js} +1 -1
- package/server/{esm-shims-BEjvINX3.js → esm-shims-Cso7IGBC.js} +1 -1
- package/server/{event-store-CqDgfbAs.js → event-store-D9UhQyMS.js} +1 -1
- package/server/{event-store-D89fMfXS.js → event-store-KZnWUKWh.js} +3 -3
- package/server/{events-S_C0pvl6.js → events-2eFUPdqz.js} +3 -3
- package/server/{events-rIGncmP1.js → events-BYbvqZky.js} +1 -1
- package/server/{factory-DV18m0rc.js → factory-BtaRsHFC.js} +20 -17
- package/server/{feature-registry-population-CqZSnqQi.js → feature-registry-population-Ca2UaV0U.js} +4 -4
- package/server/{feature-registry-storage-BeXmNBwK.js → feature-registry-storage-DaP-bQxO.js} +2 -2
- package/server/{features-u5XeMaOK.js → features-DqvaoQoa.js} +2 -2
- package/server/{feedback-target-CwyWf0Dg.js → feedback-target-BXWdOiYI.js} +9 -7
- package/server/{feedback-target-DDG1PWl3.js → feedback-target-BblmMe9P.js} +1 -1
- package/server/{feedback-writer-BsJiw5aT.js → feedback-writer-CULeOOY4.js} +1 -1
- package/server/{feedback-writer-D20HSXre.js → feedback-writer-Dn8o9ZyE.js} +4 -4
- package/server/{flywheel-RCnHAgc4.js → flywheel-BUWdcfhq.js} +1 -1
- package/server/{flywheel-Dczmgchd.js → flywheel-CqkO3cDj.js} +15 -28
- package/server/{flywheel-9Y1X7IM-.js → flywheel-D9r1mw2U.js} +13 -13
- package/server/{flywheel-merge-order-DEtEd3aK.js → flywheel-merge-order-LDzQDwSg.js} +1 -1
- package/server/{flywheel-merge-order-CtCYsFJP.js → flywheel-merge-order-VtjUweEb.js} +6 -6
- package/server/forge-DJy3Zx4s.js +2 -0
- package/server/{forge-DFDThFil.js → forge-wEollMCi.js} +22 -12
- package/server/{from-NSJypkI8.js → from-B2tOYhYV.js} +1 -1
- package/server/{fts-db-C5A_TTOM.js → fts-db-Bgzn2RO7.js} +2 -2
- package/server/{fts-operations-DvCSimfU.js → fts-operations-Bj8yutnR.js} +2 -2
- package/server/{git-utils-Dr0L7mFk.js → git-utils-GxlL0tmt.js} +2 -2
- package/server/{git-utils-C0neHvQx.js → git-utils-q8jNoBts.js} +1 -1
- package/server/{github-app-Bwt9lK4A.js → github-app-BrYwK_Gb.js} +1 -1
- package/server/{github-app-u9-SX7Gc.js → github-app-tUbb8Ldr.js} +8 -3
- package/server/{github-client-Btyy3uan.js → github-client-BwBU41jK.js} +3 -3
- package/server/{github-client-Do3k-N1W.js → github-client-D6CNsftm.js} +1 -1
- package/server/{github-pr-lookup-DOF1U2WW.js → github-pr-lookup-BS5PqkJb.js} +2 -2
- package/server/{harness-resolve-C6g2R0Cd.js → harness-resolve-Dx8hUsvC.js} +3 -3
- package/server/{health-events-B4u-2a9m.js → health-events-2DLp-5Xp.js} +2 -2
- package/server/{health-events-Bos3sk5g.js → health-events-B0mj6Iae.js} +1 -1
- package/server/{hooks-uEr8WTx_.js → hooks-BDcQJDUe.js} +1 -1
- package/server/{hooks-BCoOjL_R.js → hooks-BS_JrvYP.js} +3 -3
- package/server/hume-B4seN95Y.js +3 -0
- package/server/{hume-BqxYKbUf.js → hume-BRhNKyXQ.js} +2 -2
- package/server/{idle-stack-reaper-DbZ8ukMd.js → idle-stack-reaper-BCITXNW5.js} +2 -2
- package/server/{idle-stack-reaper-H0W6XtHh.js → idle-stack-reaper-C1ymihno.js} +1 -1
- package/server/{infra-Ba9mS6e6.js → infra-_Kx1m9pm.js} +9 -4
- package/server/{injection-C1DKXeIZ.js → injection-Bvhyg_MV.js} +1 -1
- package/server/{injection-yrMBxzVq.js → injection-CCaYkofq.js} +7 -7
- package/server/{inspect-agent-B-mnb4uh.js → inspect-agent-BqyZ4pCo.js} +35 -67
- package/server/inspect-agent-DCJQm9Wu.js +2 -0
- package/server/{internal-token-BtqSbKTx.js → internal-token-Cl-1IxaE.js} +2 -2
- package/server/{internal-token-BPYEaXFh.js → internal-token-D-t28de5.js} +1 -1
- package/server/{io-VEGSAqsd.js → io-DkC4sFSy.js} +36 -43
- package/server/{issue-closed-BxcePXL-.js → issue-closed-Cpl4VDUM.js} +41 -6
- package/server/{issue-lifecycle--8MRxrG1.js → issue-lifecycle-CFR8TJ22.js} +22 -37
- package/server/{issue-lifecycle-CdMUauyb.js → issue-lifecycle-YNTy3OT3.js} +1 -1
- package/server/{issue-service-singleton-MZsDhAob.js → issue-service-singleton-D81mCts_.js} +1 -1
- package/server/{issue-service-singleton-CkTUI-eu.js → issue-service-singleton-ldvUUXi3.js} +29 -29
- package/server/{issues-CBAsuoAO.js → issues-DIEHt9sq.js} +2 -2
- package/server/{jsonl-parser-BUW5_sSK.js → jsonl-parser-Cd5jIqh7.js} +3 -3
- package/server/{label-cleanup-htK6fBRU.js → label-cleanup-Btny6Gyo.js} +3 -3
- package/server/{state-home-CEvD_v5F.js → launcher-generator-BXLM9f4b.js} +7 -127
- package/server/{layers-jjL16At6.js → layers-gCJlK62m.js} +2 -2
- package/server/lifecycle-D7aQUnTO.js +12 -0
- package/server/{lifecycle-io-DXv8Utct.js → lifecycle-io-DQBF-GHO.js} +1 -1
- package/server/{lifecycle-io-IehcRt2v.js → lifecycle-io-FfPUtz-y.js} +4 -4
- package/server/{linear-client-D9cSQfvD.js → linear-client-CDH2D6Qy.js} +3 -3
- package/server/{linear-client-By7hjwuN.js → linear-client-WrYrUIAH.js} +1 -1
- package/server/memory-fts-worker.js +1 -1
- package/server/{merge-BN8FGJ2q.js → merge-BsDgUxFz.js} +3 -3
- package/server/{merge-BLcEZNXz.js → merge-Dervs4BF.js} +1 -1
- package/server/{merge-agent-B3u2szOL.js → merge-agent-D6DNhe9j.js} +64 -51
- package/server/{merge-agent-ejC7Wos8.js → merge-agent-DMQTJMP0.js} +1 -1
- package/server/{merge-batch-DyqlgYGp.js → merge-batch-Bv6Z5K2H.js} +1 -1
- package/server/{merge-blockers-cq-aS2KG.js → merge-blockers-WWWi6Ur2.js} +2 -2
- package/server/merge-ops-h9OCnIVz.js +2 -0
- package/server/{merge-rebase-Dl7yIxtV.js → merge-rebase-Czth9ggm.js} +2 -2
- package/server/{merge-set-CZ9Nbay0.js → merge-set-DNc4zBqd.js} +3 -3
- package/server/{merge-set-Dy0D0r3i.js → merge-set-vuE3MEVt.js} +1 -1
- package/server/{merge-sync-D7jWLgCC.js → merge-sync-B2KSk54U.js} +2 -2
- package/server/{merge-sync-CG9kDCdT.js → merge-sync-B9nHdUGx.js} +1 -1
- package/server/{merge-train-CH33XJOH.js → merge-train-DJgr81tF.js} +3 -3
- package/server/{merge-train-deps-JoVdGnOg.js → merge-train-deps-B2OWS0k9.js} +4 -4
- package/server/{merge-verification-D4wTChdX.js → merge-verification-BBIXUEqa.js} +4 -4
- package/server/{multipart-parser-Csn8U-K9.js → multipart-parser-9DhuAkPd.js} +2 -2
- package/server/node_modules/.package-lock.json +11 -11
- package/server/node_modules/@effect/platform-node/node_modules/@effect/platform-node-shared/package.json +3 -3
- package/server/node_modules/toml/README.md +54 -0
- package/server/node_modules/toml/index.d.ts +42 -1
- package/server/node_modules/toml/index.js +3 -3
- package/server/node_modules/toml/lib/compiler.js +35 -3
- package/server/node_modules/toml/lib/parser.js +224 -143
- package/server/node_modules/toml/package.json +3 -1
- package/server/node_modules/ws/lib/receiver.js +15 -32
- package/server/node_modules/ws/lib/websocket-server.js +4 -4
- package/server/node_modules/ws/lib/websocket.js +4 -4
- package/server/node_modules/ws/package.json +5 -1
- package/server/{orphan-proposed-reconciler-DI_IS1p_.js → orphan-proposed-reconciler-B8H41C4a.js} +14 -24
- package/server/{orphan-proposed-reconciler-BIcNu4tl.js → orphan-proposed-reconciler-DbTmT7qy.js} +1 -1
- package/server/package-lock.json +12 -12
- package/server/package.json +1 -1
- package/server/{pan-dir-CQIfKG8c.js → pan-dir-BTw4MdSe.js} +4 -4
- package/server/{paths-Blj6A9AJ.js → paths-Btkc8mzp.js} +2 -2
- package/server/{pipeline-notifier-BH4PAi-w.js → pipeline-notifier-3frIvSi3.js} +1 -1
- package/server/{pipeline-notifier-D_WYtEwl.js → pipeline-notifier-DTd19f18.js} +2 -2
- package/server/{project-pipelines-jMTitpeO.js → project-pipelines-B95fcAek.js} +2 -2
- package/server/projects-Dc9aoVoG.js +3 -0
- package/server/{prompts-B3njaImU.js → prompts-CIVmjHxn.js} +2 -2
- package/server/{providers-DnPxkHoG.js → providers-BLLk5IIb.js} +1 -1
- package/server/{providers-BbEyFhPX.js → providers-C-yWibCk.js} +7 -7
- package/server/public/assets/{chunk-BO2N2NFS-3qh9TUJi.js → chunk-BO2N2NFS-DzKZyoKY.js} +4 -4
- package/server/public/assets/{diagram-OG6HWLK6-D8UVTPj7.js → diagram-OG6HWLK6-Cx8mWUb8.js} +1 -1
- package/server/public/assets/{dist-BvLLn1YC.js → dist-BqccLhaw.js} +3 -3
- package/server/public/assets/{dist-CyubL7Wj.js → dist-rC3nAs_O.js} +1 -1
- package/server/public/assets/{ganttDiagram-6RSMTGT7-BI4E1LbQ.js → ganttDiagram-6RSMTGT7-DLYPLf5T.js} +1 -1
- package/server/public/assets/{highlighted-body-OFNGDK62-D_bapWkF.js → highlighted-body-OFNGDK62-D4DqixbV.js} +1 -1
- package/server/public/assets/index-CPcysUHk.js +796 -0
- package/server/public/assets/index-H5M0yhM4.css +1 -0
- package/server/public/assets/{linear-CEdobObr.js → linear-yqcXkDfj.js} +1 -1
- package/server/public/assets/mermaid-GHXKKRXX-CWdZ_heB.js +1 -0
- package/server/public/assets/{pieDiagram-4H26LBE5-DT79L01f.js → pieDiagram-4H26LBE5-DhraIOaV.js} +1 -1
- package/server/public/assets/{prod-CR_K2DFV.js → prod-DKUunUdN.js} +4 -4
- package/server/public/assets/{quadrantDiagram-W4KKPZXB-BEkKXXrL.js → quadrantDiagram-W4KKPZXB-DPiRcToa.js} +1 -1
- package/server/public/assets/{sankeyDiagram-5OEKKPKP-BxSCqn-j.js → sankeyDiagram-5OEKKPKP-3An5HNkZ.js} +1 -1
- package/server/public/assets/{xychartDiagram-2RQKCTM6-DicwJGG_.js → xychartDiagram-2RQKCTM6-lbEOjfqQ.js} +1 -1
- package/server/public/index.html +2 -2
- package/server/{pull-requests-43LPDfM8.js → pull-requests-D7AL5woD.js} +1 -1
- package/server/{pull-requests-DyUkQl4W.js → pull-requests-NDDNtqNq.js} +3 -3
- package/server/{agents-B9GwfCyp.js → queries-C0LCGG21.js} +710 -325
- package/server/{rally-BtWjybOa.js → rally-4oKvnxLG.js} +3 -3
- package/server/rally-DF5a3ioP.js +3 -0
- package/server/{rally-api-B-osULNL.js → rally-api-41tT6ikZ.js} +2 -2
- package/server/{rally-api-B-YA_oXx.js → rally-api-BsaQ8Vnz.js} +1 -1
- package/server/{rally-client-sErNQBO0.js → rally-client-Bo4hNcCZ.js} +5 -5
- package/server/{rally-client-CzFymP7P.js → rally-client-b5PT1x5L.js} +1 -1
- package/server/{reap-terminal-sessions-DnDQ7pf9.js → reap-terminal-sessions-BR39qflC.js} +1 -1
- package/server/{reap-terminal-sessions-2s-fvilz.js → reap-terminal-sessions-CFkuquQj.js} +1 -1
- package/server/{rebuild-stack-nGD_nPZo.js → rebuild-stack-C7JPUom6.js} +1 -1
- package/server/{rebuild-stack-CoU-HqZj.js → rebuild-stack-Ddv6W017.js} +5 -5
- package/server/{reconstruct-cache-Wj8GrYB0.js → reconstruct-cache-Gqhm---K.js} +6 -6
- package/server/record-DLOqfbkI.js +3 -0
- package/server/record-update-BltEmPge.js +168 -0
- package/server/record-update-CDp7aTaT.js +3 -0
- package/server/recovery-trip-Cn7KJVkS.js +44 -0
- package/server/{release-engine-CBLQXDlH.js → release-engine-BYzmIBf9.js} +5 -5
- package/server/{release-set-BNiqi7hy.js → release-set-7pnxFOWR.js} +3 -3
- package/server/{remote-DW_TWQnr.js → remote-Cvu4CSDk.js} +3 -3
- package/server/{remote-agents-C4cyxHQS.js → remote-agents-C2C6z9tj.js} +6 -33
- package/server/{remote-agents-Cv-U-_V8.js → remote-agents-DYY5fFpd.js} +1 -1
- package/server/{remote-completion-PhXGGFQy.js → remote-completion-2Kb4IDg_.js} +13 -13
- package/server/{remote-DcO9An_f.js → remote-rN0ecjHE.js} +3 -3
- package/server/resume-BFLl-yLn.js +3 -0
- package/server/{review-agent-Dn-yn7Zj.js → review-agent-BZvk0N5G.js} +31 -23
- package/server/{review-agent-u5q3ip7H.js → review-agent-CpSHLzed.js} +1 -1
- package/server/{review-artifacts-D4T04aYI.js → review-artifacts-PCo53YMn.js} +5 -19
- package/server/{review-context-Rc0VDLG_.js → review-context-M7QtJlJq.js} +8 -8
- package/server/{review-monitor-BC--miCO.js → review-monitor-BLC5mTTg.js} +2 -2
- package/server/{review-status-CG0iDuWa.js → review-status-77N3PoZr.js} +1 -1
- package/server/{review-status-Dc1l4dVz.js → review-status-DANr0t-v.js} +32 -58
- package/server/{review-status-enrichment-C1a1OG_1.js → review-status-enrichment-DwOg4UfL.js} +3 -3
- package/server/{review-status-sync-CfSixhhX.js → review-status-sync-Bd08OOFA.js} +1 -1
- package/server/{review-status-sync-CAr-hfnJ.js → review-status-sync-BjTUJ5fx.js} +2 -2
- package/server/{review-verdict-feedback-D2Q960wX.js → review-verdict-feedback-BsFLjN_6.js} +1 -1
- package/server/{review-verdict-feedback-CVDbIDBe.js → review-verdict-feedback-CBf-J_wS.js} +8 -8
- package/server/{rollup-DctoIu-A.js → rollup-Bu0f2EyN.js} +8 -8
- package/server/{rollup-CakjztPl.js → rollup-DTCCdEy4.js} +1 -1
- package/server/{scanner-BTM1jc_u.js → scanner-BlZ2vB7j.js} +7 -7
- package/server/{sequence-io-pnoIDGv4.js → sequence-io-ylyDtz2J.js} +4 -4
- package/server/{sequencer-agent-9Soi-WL-.js → sequencer-agent-DsWQ-87H.js} +6 -17
- package/server/server.js +4695 -4093
- package/server/{service-DfTVoqJg.js → service-CLVBC_1Y.js} +116 -90
- package/server/{session-fork-C4jAFHj8.js → session-fork-DlEIAhRy.js} +2 -2
- package/server/{session-history-DanhhiCw.js → session-history-bnOFKMwf.js} +4 -4
- package/server/settings-CP3GGon2.js +2 -0
- package/server/{settings-Cuc12oP_.js → settings-Cqa-8nyj.js} +2 -2
- package/server/{settings-DfT3f86D.js → settings-gJrdLZy2.js} +3 -3
- package/server/{shadow-engineering-bKuKTCn-.js → shadow-engineering-fq1YEKV3.js} +3 -3
- package/server/{shadow-state-CVHpRWlb.js → shadow-state-BqeFAygK.js} +1 -1
- package/server/{shadow-state-DJz6_pb_.js → shadow-state-RptE9Cau.js} +2 -2
- package/server/shadow-utils-BMWr5tRT.js +39 -0
- package/server/{ship-log-CwqPFfqx.js → ship-log-BRQQi2lU.js} +1 -1
- package/server/{smart-compaction-CiWfGfRZ.js → smart-compaction-CmoXpjeU.js} +7 -7
- package/server/{smart-compaction-B4KlpZGN.js → smart-compaction-DldUel4B.js} +1 -1
- package/server/{spawn-planning-session-CU-DwyDl.js → spawn-planning-session-CoS6LTc6.js} +16 -16
- package/server/{spawn-planning-session-D5N3RuLG.js → spawn-planning-session-DT2tSMxo.js} +1 -1
- package/server/{specialist-completion-CJcv-NXH.js → specialist-completion-pJtESo7m.js} +1 -1
- package/server/{specialist-context-B2HlbNxS.js → specialist-context-CspI4Eog.js} +5 -5
- package/server/{specialist-handoff-logger-CQyF1ygu.js → specialist-handoff-logger-Duz9RGvk.js} +2 -2
- package/server/{specialist-logs-CdcUpfjj.js → specialist-logs-DtSkPJZK.js} +3 -3
- package/server/{specialists-D7AcFi1u.js → specialists-CywEMwxk.js} +1 -1
- package/server/{specialists-k22_Btaq.js → specialists-D9-dMUtI.js} +1 -1
- package/server/{specialists-CFgw_0Q6.js → specialists-Dax7tqXC.js} +161 -448
- package/server/{specialists-CwzFdapR.js → specialists-GF42OOqd.js} +18 -18
- package/server/specs-VwcFtEDi.js +3 -0
- package/server/{src-B4TTzNSr.js → src-By3D85Ry.js} +6 -1
- package/server/{src-BvpMg4EB.js → src-CqyFg52C.js} +5 -5
- package/server/{src-D4YUZrwR.js → src-DhxM-eCb.js} +6 -6
- package/server/{stack-health-DVN7zRnL.js → stack-health-BsEVrJZ6.js} +1 -1
- package/server/{stack-health-CSgcYcr8.js → stack-health-C-SnpRHh.js} +2 -2
- package/server/stale-task-claims-vTxmRzLi.js +69 -0
- package/server/state-home-Bur1y4oH.js +213 -0
- package/server/{state-mapping-C13UaCL7.js → state-mapping-Ci0pkac4.js} +1 -1
- package/server/state-migrate-D3VveYfO.js +362 -0
- package/server/{stuck-remediation-CxsyxwFO.js → stuck-remediation-B699-p8v.js} +36 -41
- package/server/{stuck-remediation-nTIvhGOR.js → stuck-remediation-CaFYYTQW.js} +1 -1
- package/server/{summary-fork-CnRMPCYd.js → summary-fork-BxnF8Xh0.js} +2 -2
- package/server/{summary-fork-gKSoFAnK.js → summary-fork-COqYpVa3.js} +8 -8
- package/server/supervisor/{paths-3R6b989k.js → paths-Bk6hJRH9.js} +4 -3
- package/server/supervisor/pty-supervisor.js +2 -2
- package/server/supervisor/{pty-token-CScQ32Rj.js → pty-token-BZS5GYdG.js} +2 -2
- package/server/supervisor-eWAAmXKu.js +2 -0
- package/server/{supervisor-CZMs8s0M.js → supervisor-liMgIPDF.js} +2 -2
- package/server/{swarm-readiness-h6-pwY8w.js → swarm-readiness-sXB1vhzo.js} +3 -3
- package/server/{system-prerequisites-DZZTi2G6.js → system-prerequisites-Bz6KdkFJ.js} +1 -13
- package/server/{teardown-workspace-B4D-oCVg.js → teardown-workspace-DvzqnmUF.js} +14 -71
- package/server/{test-agent-queue-CnuYku4B.js → test-agent-queue-hAU1Ah08.js} +5 -5
- package/server/{tldr-daemon-CuA8hz21.js → tldr-daemon-Bam7Xhoo.js} +2 -2
- package/server/{tldr-daemon-CgZQ3jmZ.js → tldr-daemon-DhGwd88s.js} +1 -1
- package/server/tmux-C-rgxRDA.js +3 -0
- package/server/{tmux-C3g9VFcg.js → tmux-U55cNGFG.js} +92 -4
- package/server/{token-g_sJ19g3.js → token-Dsa-i36o.js} +2 -2
- package/server/{token-util-DiwnnbJo.js → token-util-BWNpH96m.js} +1 -1
- package/server/token-util-DRt0j2nQ.js +3 -0
- package/server/{tracker-config-dQxC15vH.js → tracker-config-OkdbaUCm.js} +2 -2
- package/server/{tracker-utils--z8FLSWn.js → tracker-utils-CghXMF3q.js} +2 -2
- package/server/{tracker-utils-DkKyRT0H.js → tracker-utils-DdzUiPNU.js} +1 -1
- package/server/{tunnel-BpWZs0Jy.js → tunnel-D1YxesBL.js} +3 -3
- package/server/{tunnel-CN2px87h.js → tunnel-DjlzgTl3.js} +1 -1
- package/server/typed-errors-CH4roFIj.js +3 -0
- package/server/{typed-errors-sLpGfegz.js → typed-errors-n_Tnb4Fh.js} +3 -4
- package/server/{types-BLS_Zbmd.js → types-DOjWNv3Z.js} +1 -1
- package/server/{types-tlXf80x3.js → types-DXBMm4mX.js} +1 -1
- package/server/{uat-train-utGVmqdm.js → uat-train-CaaWs9Rp.js} +1 -1
- package/server/{uat-train-BRo6DM7p.js → uat-train-CqN34zFx.js} +24 -25
- package/server/{validation-CsPVsoA0.js → validation-4-z2Cw4z.js} +70 -23
- package/server/validation-DpTNakM6.js +3 -0
- package/server/verification-artifact-DK1xb1zG.js +56 -0
- package/server/verification-artifact-JD_edpZ9.js +2 -0
- package/server/{verification-runner-CMT5WRMS.js → verification-runner-BjHN80pJ.js} +338 -58
- package/server/verification-runner-ShYu5Ph3.js +2 -0
- package/server/{vtt-parser-C_XPlifj.js → vtt-parser-QnRfcjiU.js} +1 -1
- package/server/{work-agent-prompt-ZTAb2Hyf.js → work-agent-prompt-BiJ43Der.js} +12 -88
- package/server/workflows-B4C3lY9E.js +2 -0
- package/server/{workflows-CXRwhw_o.js → workflows-DkTotz_m.js} +17 -24
- package/server/{workspace-CNfuj1-5.js → workspace-CuN0ev4Z.js} +3 -3
- package/server/{workspace-9UEsKuiP.js → workspace-DQ4vVivd.js} +1 -1
- package/server/{workspace-config-ChWOECy0.js → workspace-config-C77NKnsV.js} +1 -1
- package/server/{workspace-manager-BO-6k3sP.js → workspace-manager-B1mYn0lN.js} +1 -1
- package/server/{workspace-manager-D8AByFIT.js → workspace-manager-Beeo2aKF.js} +23 -48
- package/server/{workspace-metadata-CvC268MN.js → workspace-metadata-BZC5BmoP.js} +2 -2
- package/server/{workspace-metadata-DZiJtnuF.js → workspace-metadata-Cy7_ZACL.js} +1 -1
- package/server/{workspaces-D-uIoqbg.js → workspaces-CGuzW1Ia.js} +182 -152
- package/sync-sources/hooks/codex-notify-hook +64 -8
- package/sync-sources/hooks/record-cost-event.js +1109 -36
- package/sync-sources/hooks/record-cost-event.js.map +1 -1
- package/sync-sources/hooks/statusline.sh +2 -2
- package/sync-sources/hooks/work-agent-stop-hook +1 -2
- package/server/acceptance-criteria-BZ_nQS1f.js +0 -33
- package/server/agent-state-lGvgPP4m.js +0 -3
- package/server/agents-CEcaxSkR.js +0 -3
- package/server/auto-commit-IW-eik_b.js +0 -3
- package/server/bd-process-lock-XAXAet9O.js +0 -390
- package/server/beads-B1u04n3o.js +0 -2
- package/server/beads-BeSMEjGT.js +0 -649
- package/server/beads-query-Dl4FhT8J.js +0 -95
- package/server/beads-restore-BUItPOjI.js +0 -23
- package/server/cli-D9cUTbBr.js +0 -3
- package/server/codex-BYPz6ZdF.js +0 -3
- package/server/compact-beads-CyJtoXJi.js +0 -94
- package/server/compact-beads-N00E4EVa.js +0 -3
- package/server/deacon-swarm-CvdFekIO.js +0 -2
- package/server/dist-BNwrgsUO.js +0 -3
- package/server/export-BJHSVwKP.js +0 -87
- package/server/forge-8y6aEPTB.js +0 -2
- package/server/hume-CerGi2RH.js +0 -3
- package/server/inspect-agent-CWkeAB7J.js +0 -2
- package/server/lifecycle-Ck2UR27D.js +0 -14
- package/server/merge-ops-CFkQtXEj.js +0 -2
- package/server/projects-CrBE6IhN.js +0 -3
- package/server/public/assets/index-BAZxZ-8I.js +0 -796
- package/server/public/assets/index-FBG3JBfq.css +0 -1
- package/server/public/assets/mermaid-GHXKKRXX-BYP8MI37.js +0 -1
- package/server/rally-oggyp4cs.js +0 -3
- package/server/record-lEYK__LD.js +0 -3
- package/server/recovery-trip-BT7nb9OV.js +0 -98
- package/server/resolver-C7dLn8OK.js +0 -158
- package/server/resume-BYZBIab-.js +0 -3
- package/server/settings-Cy7SCFO9.js +0 -2
- package/server/specs-RzcDgozr.js +0 -3
- package/server/supervisor-CfX192ma.js +0 -2
- package/server/tmux-By8E_Yv_.js +0 -3
- package/server/token-util-C9u4An3K.js +0 -3
- package/server/tracker-config-BzfVj41Z.js +0 -3
- package/server/typed-errors-CrN1AByg.js +0 -3
- package/server/validation-Dq_wwcw3.js +0 -3
- package/server/verification-runner-D0Uh-9jc.js +0 -2
- package/server/workflows-BLwxUMP7.js +0 -2
- package/server/writer-BUweuRPx.js +0 -3
- package/server/writer-CrP2xuBn.js +0 -251
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { n as __esmMin, o as __toESM } from "./rolldown-runtime-DNCzzKnI.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $r as sessionFilePath, C as init_tier_table, Cr as AGENTS_DIR, En as getIssuePrefix, F as getBuiltInDefaultHarness, Fn as init_projects, H as setupCredentialFileAuthSync, It as resolveProjectForIssue, Jr as getOverdeckHome, L as getProviderEnvSync, Mr as OVERDECK_HOME, Nt as readIssueRecordForWorkspaceSync, On as getProjectSwarmHotspots, P as clearCredentialFileAuthSync, Pt as readIssueRecordSync, Qr as resolveOhmypiExtensionPath, R as getProviderForModelSync, Rt as writeAgentHarnessModelSync, Sn as findProjectByPathSync, Sr as init_errors, T as resolveTieredExecutionEnabledForIssue, U as ensureOpenAICompatibleProxyRunning, Vr as encodeClaudeProjectDir, W as init_openai_compatible_proxy, X as init_roles, Yr as init_paths, Z as resolveModel, Zr as packageRoot, at as resolveModelIdSync, b as DEFAULT_TIERED_EXECUTION_CONFIG, cr as require_dist, ct as init_percent, dr as ConfigError, et as getModelCapabilitySync, f as loadConfigSync, fr as FsError, hn as shouldCommitLegacyWorkspaceArtifacts, kn as getProjectSync, kt as init_record, l as isClaudeCodeChannelsMcpEnabled, nt as hasModelCapabilitySync, or as resolveBareNumericIdSync, ot as fmix32, pn as init_state_read_home, qn as resolveProjectFromIssueSync, rr as init_issue_id, rt as init_model_capabilities, st as fnv1a32, t as init_config_yaml, u as isTldrEnabledSync, ur as ClaudeCredentialParseError, w as resolveTieredExecutionEnabled, x as TIERED_EXECUTION_DIFFICULTIES, z as init_providers } from "./config-yaml-CqaAyn8y.js";
|
|
3
3
|
import { t as require_toml } from "./toml-CeLDATih.js";
|
|
4
4
|
import { a as init_activity_logger, n as emitActivityEntrySync, r as emitActivityTtsSync } from "./activity-logger-pcbf-e30.js";
|
|
5
|
-
import { d as getOverdeckDatabaseSync, f as init_infra } from "./infra-
|
|
6
|
-
import { A as
|
|
7
|
-
import { a as init_event_store, i as initEventStore } from "./event-store-
|
|
8
|
-
import { a as getHarnessBehavior, i as OHMYPI_BEHAVIOR } from "./src-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { L as normalizeHarness, R as reactivateConversationForSpawn, S as getConversationByName, k as init_conversations, y as createConversation } from "./conversations-
|
|
20
|
-
import { n as recordFeatureRegistryLifecycle, t as init_feature_registry_population } from "./feature-registry-population-
|
|
21
|
-
import { a as readCavemanVariant, n as init_workspace } from "./workspace-
|
|
22
|
-
import { a as
|
|
23
|
-
import { a as init_claude_permissions, r as getClaudePermissionFlagsStringSync } from "./claude-permissions-
|
|
24
|
-
import { h as workspaceContextFile, o as init_layers } from "./layers-
|
|
25
|
-
import { a as extractThreadIdFromRollout, c as initCodexHome, l as init_codex, o as findLatestRollout } from "./codex-
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { a as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import { n as provisionClaudeHooks, t as init_claude_hooks_provision } from "./claude-hooks-provision-
|
|
36
|
-
import { a as init_lifecycle_io, t as appendContinueSessionEntryForIssue } from "./lifecycle-io-
|
|
37
|
-
import { r as init_swarm_readiness, t as analyzeSwarmReadiness } from "./swarm-readiness-
|
|
38
|
-
import {
|
|
5
|
+
import { d as getOverdeckDatabaseSync, f as init_infra } from "./infra-_Kx1m9pm.js";
|
|
6
|
+
import { A as listSessions, B as setOption, D as listPaneValues, E as killSessionSync, F as sendKeys, G as BLANKED_PROVIDER_ENV, J as init_child_env, L as sendRawKeystroke, P as sendEscapeKeyAsync, R as sessionExists, S as init_tmux, T as killSession, a as capturePaneSync, f as exactPaneTarget, i as capturePane, j as listSessionsSync, o as createSession, s as createSessionSync, w as isPaneDead, z as sessionExistsSync } from "./tmux-U55cNGFG.js";
|
|
7
|
+
import { a as init_event_store, i as initEventStore } from "./event-store-KZnWUKWh.js";
|
|
8
|
+
import { a as getHarnessBehavior, i as OHMYPI_BEHAVIOR } from "./src-By3D85Ry.js";
|
|
9
|
+
import { C as init_review_status_source, D as init_agent_state_sync, E as getOverdeckAgentStateSync, O as listOverdeckAgentStatesSync, c as init_review_status, k as saveOverdeckAgentStateSync, m as resetPipelineVerdictsForWorkStartSync, w as readReviewStatusMap } from "./review-status-DANr0t-v.js";
|
|
10
|
+
import { i as countAgentsByStatus, o as init_agents$1 } from "./agents-BHBxr8c9.js";
|
|
11
|
+
import { n as ensureSessionContextBriefingFile, r as init_briefing_freshness } from "./briefing-freshness-DuxIE1yr.js";
|
|
12
|
+
import { o as getPricingSync, s as init_cost } from "./cost-BoqD1Pxz.js";
|
|
13
|
+
import { _ as init_tier_metrics, g as estimateFeedDeliveryTokens, v as recordTierFeedDelivery } from "./cost-sync-BYnmnMkY.js";
|
|
14
|
+
import { a as persistCurrentSessionId, d as isAgentStateServiceInProcess, i as logLauncherSessionPinned, l as getRuntimeSnapshot, n as createFreshSessionIdentity, o as init_persistent_logger, r as init_session_history, s as logAgentLifecycleSync, u as init_agent_runtime_mirror } from "./session-history-bnOFKMwf.js";
|
|
15
|
+
import { t as init_behavior } from "./behavior-CWqNMqE5.js";
|
|
16
|
+
import { i as ensureInternalTokenSync, s as init_internal_token, t as INTERNAL_TOKEN_HEADER } from "./internal-token-Cl-1IxaE.js";
|
|
17
|
+
import { m as readWorkspacePlanSync, o as init_io } from "./io-DkC4sFSy.js";
|
|
18
|
+
import { c as bridgeGeminiAuthToCliproxy, d as getCliproxyAuthDir, g as getCliproxyLogPath, l as decodeJwtPayload$1, p as getCliproxyClientEnv, s as bridgeCodexAuthToCliproxySync, v as init_cliproxy } from "./cliproxy-CGBA1GzA.js";
|
|
19
|
+
import { L as normalizeHarness, R as reactivateConversationForSpawn, S as getConversationByName, k as init_conversations, y as createConversation } from "./conversations-BX5aD-6F.js";
|
|
20
|
+
import { n as recordFeatureRegistryLifecycle, t as init_feature_registry_population } from "./feature-registry-population-Ca2UaV0U.js";
|
|
21
|
+
import { a as readCavemanVariant, n as init_workspace } from "./workspace-CuN0ev4Z.js";
|
|
22
|
+
import { a as requireModelOverrideSync, i as normalizeModelOverrideSync, n as init_launcher_generator, o as shellQuoteModelIdSync, r as init_model_validation, t as generateLauncherScriptSync } from "./launcher-generator-BXLM9f4b.js";
|
|
23
|
+
import { a as init_claude_permissions, r as getClaudePermissionFlagsStringSync } from "./claude-permissions-BB6agcOZ.js";
|
|
24
|
+
import { h as workspaceContextFile, o as init_layers } from "./layers-gCJlK62m.js";
|
|
25
|
+
import { a as extractThreadIdFromRollout, c as initCodexHome, l as init_codex, o as findLatestRollout } from "./codex-sgWVCGUd.js";
|
|
26
|
+
import { f as init_config$1, m as loadConfigSync$1 } from "./config-DfaUXr6r.js";
|
|
27
|
+
import { a as getFlywheelActiveRunIdSync, s as init_control_settings } from "./control-settings-BguNQ1F_.js";
|
|
28
|
+
import { n as createTrackerFromConfig, r as init_factory, t as createTracker } from "./factory-BtaRsHFC.js";
|
|
29
|
+
import { a as init_stack_health, i as getWorkspaceStackHealth } from "./stack-health-C-SnpRHh.js";
|
|
30
|
+
import { i as createActiveSlice, l as init_dag, o as getDispatchableItems, s as groupItemsByWave } from "./dag-C6kYyF17.js";
|
|
31
|
+
import { c as generateFixedPointPromptSync, f as initHookSync, n as checkHookSync, p as init_hooks } from "./hooks-BS_JrvYP.js";
|
|
32
|
+
import { n as resolveHarness, t as init_harness_resolve } from "./harness-resolve-Dx8hUsvC.js";
|
|
33
|
+
import { r as isRoleTerminal, t as init_reap_terminal_sessions } from "./reap-terminal-sessions-CFkuquQj.js";
|
|
34
|
+
import { c as isStateMigrated, o as init_state_home } from "./state-home-Bur1y4oH.js";
|
|
35
|
+
import { n as provisionClaudeHooks, t as init_claude_hooks_provision } from "./claude-hooks-provision-Du_PkMsp.js";
|
|
36
|
+
import { a as init_lifecycle_io, t as appendContinueSessionEntryForIssue } from "./lifecycle-io-FfPUtz-y.js";
|
|
37
|
+
import { r as init_swarm_readiness, t as analyzeSwarmReadiness } from "./swarm-readiness-sXB1vhzo.js";
|
|
38
|
+
import { dirname, join, relative } from "node:path";
|
|
39
39
|
import { Data, Duration, Effect, FileSystem } from "effect";
|
|
40
40
|
import { appendFileSync, existsSync, mkdirSync, readFileSync, statSync, statfsSync, unlinkSync, writeFileSync } from "fs";
|
|
41
41
|
import { basename as basename$1, dirname as dirname$1, join as join$1, resolve as resolve$1 } from "path";
|
|
@@ -45,7 +45,7 @@ import { chmodSync as chmodSync$1, closeSync as closeSync$1, constants, cpSync,
|
|
|
45
45
|
import { chmod, mkdir, readFile, stat as stat$1, writeFile } from "node:fs/promises";
|
|
46
46
|
import { randomUUID } from "crypto";
|
|
47
47
|
import { ChildProcess } from "effect/unstable/process";
|
|
48
|
-
import { mkdir as mkdir$1, readFile as readFile$1, readdir as readdir$1, rename as rename$1, rm as rm$1, stat as stat$2, writeFile as writeFile$1 } from "fs/promises";
|
|
48
|
+
import { mkdir as mkdir$1, open as open$1, readFile as readFile$1, readdir as readdir$1, rename as rename$1, rm as rm$1, stat as stat$2, writeFile as writeFile$1 } from "fs/promises";
|
|
49
49
|
import { platform as platform$2 } from "process";
|
|
50
50
|
import { exec, execFile } from "node:child_process";
|
|
51
51
|
import { promisify } from "node:util";
|
|
@@ -357,6 +357,402 @@ var init_ohmypi_parser = __esmMin((() => {
|
|
|
357
357
|
]);
|
|
358
358
|
}));
|
|
359
359
|
//#endregion
|
|
360
|
+
//#region ../../lib/codex-auth.ts
|
|
361
|
+
/** Absolute path to the codex CLI's own global credential file. */
|
|
362
|
+
function getNativeCodexAuthPath() {
|
|
363
|
+
return join$1(homedir(), ".codex", "auth.json");
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Pure classifier for the native store's raw JSON (PAN-2285). Decodes the
|
|
367
|
+
* access_token JWT `exp` to decide valid/expired; reports missing when the file
|
|
368
|
+
* is absent (raw === null) and unknown when it is malformed. API-key mode
|
|
369
|
+
* (OPENAI_API_KEY set, no OAuth tokens) is a valid auth state. Exported for
|
|
370
|
+
* testing with fabricated JWTs.
|
|
371
|
+
*/
|
|
372
|
+
function classifyNativeCodexAuth(raw, now = Date.now()) {
|
|
373
|
+
if (raw === null) return { status: "missing" };
|
|
374
|
+
let parsed;
|
|
375
|
+
try {
|
|
376
|
+
parsed = JSON.parse(raw);
|
|
377
|
+
} catch {
|
|
378
|
+
return { status: "unknown" };
|
|
379
|
+
}
|
|
380
|
+
const lastRefresh = typeof parsed.last_refresh === "string" ? parsed.last_refresh : void 0;
|
|
381
|
+
const accessToken = typeof parsed.tokens?.access_token === "string" ? parsed.tokens.access_token : null;
|
|
382
|
+
if (!accessToken) {
|
|
383
|
+
if (typeof parsed.OPENAI_API_KEY === "string" && parsed.OPENAI_API_KEY) return {
|
|
384
|
+
status: "valid",
|
|
385
|
+
lastRefresh
|
|
386
|
+
};
|
|
387
|
+
return {
|
|
388
|
+
status: "unknown",
|
|
389
|
+
lastRefresh
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
const idToken = typeof parsed.tokens?.id_token === "string" ? parsed.tokens.id_token : null;
|
|
393
|
+
const idClaims = idToken ? decodeJwtPayload$1(idToken) : null;
|
|
394
|
+
const email = idClaims && typeof idClaims.email === "string" ? idClaims.email : void 0;
|
|
395
|
+
const accessClaims = decodeJwtPayload$1(accessToken);
|
|
396
|
+
const expSec = accessClaims && typeof accessClaims.exp === "number" ? accessClaims.exp : null;
|
|
397
|
+
if (expSec === null) return {
|
|
398
|
+
status: "unknown",
|
|
399
|
+
email,
|
|
400
|
+
lastRefresh
|
|
401
|
+
};
|
|
402
|
+
const expiresAt = (/* @__PURE__ */ new Date(expSec * 1e3)).toISOString();
|
|
403
|
+
if (expSec * 1e3 <= now) return {
|
|
404
|
+
status: "expired",
|
|
405
|
+
email,
|
|
406
|
+
expiresAt,
|
|
407
|
+
lastRefresh
|
|
408
|
+
};
|
|
409
|
+
return {
|
|
410
|
+
status: "valid",
|
|
411
|
+
email,
|
|
412
|
+
expiresAt,
|
|
413
|
+
lastRefresh
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
/** Async native-store probe used by the dashboard status endpoint. */
|
|
417
|
+
async function probeNativeCodexAuth(now = Date.now()) {
|
|
418
|
+
const path = getNativeCodexAuthPath();
|
|
419
|
+
let raw;
|
|
420
|
+
let mtimeMs = 0;
|
|
421
|
+
try {
|
|
422
|
+
raw = await readFile$1(path, "utf8");
|
|
423
|
+
mtimeMs = (await stat$2(path)).mtimeMs;
|
|
424
|
+
} catch {
|
|
425
|
+
raw = null;
|
|
426
|
+
}
|
|
427
|
+
return {
|
|
428
|
+
...classifyNativeCodexAuth(raw, now),
|
|
429
|
+
mtimeMs
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
/** Sync native-store probe used by the spawn gate. */
|
|
433
|
+
function probeNativeCodexAuthSync(now = Date.now()) {
|
|
434
|
+
let raw;
|
|
435
|
+
try {
|
|
436
|
+
raw = readFileSync(getNativeCodexAuthPath(), "utf8");
|
|
437
|
+
} catch {
|
|
438
|
+
raw = null;
|
|
439
|
+
}
|
|
440
|
+
return classifyNativeCodexAuth(raw, now);
|
|
441
|
+
}
|
|
442
|
+
function nativeCodexAuthMtimeSync() {
|
|
443
|
+
try {
|
|
444
|
+
return statSync(getNativeCodexAuthPath()).mtimeMs;
|
|
445
|
+
} catch {
|
|
446
|
+
return 0;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Pure classifier over a codex agent's pane tail (PAN-2285). True when the pane
|
|
451
|
+
* shows the revoked/invalidated refresh-token error. Exported so it is testable
|
|
452
|
+
* without tmux.
|
|
453
|
+
*/
|
|
454
|
+
function paneShowsCodexAuthBurn(paneText) {
|
|
455
|
+
return CODEX_AUTH_BURN_MARKERS.some((marker) => paneText.includes(marker));
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Mark an agent state as codex-auth-burned (PAN-2285). Pure mutation — the
|
|
459
|
+
* caller persists via the agent-state write door (saveAgentStateSync), which
|
|
460
|
+
* mirrors into the shared agents table so the flag crosses the deacon/server
|
|
461
|
+
* process boundary. Returns true only when the state was newly flagged
|
|
462
|
+
* (idempotent: an already-flagged state is left untouched), so callers can emit
|
|
463
|
+
* a single operator notice instead of one per patrol tick. The flag time is
|
|
464
|
+
* embedded in the reason (`codex-auth-burned[<ISO>]`) because the agents table
|
|
465
|
+
* has no dedicated column for it and `troubledAt` may predate the burn when the
|
|
466
|
+
* agent was already troubled for another reason.
|
|
467
|
+
*/
|
|
468
|
+
function applyCodexAuthBurnFlag(state, nowMs = Date.now()) {
|
|
469
|
+
if (state.troubled && state.lastFailureReason?.startsWith("codex-auth-burned")) return false;
|
|
470
|
+
const nowIso = new Date(nowMs).toISOString();
|
|
471
|
+
state.troubled = true;
|
|
472
|
+
if (!state.troubledAt) state.troubledAt = nowIso;
|
|
473
|
+
state.lastFailureReason = `${CODEX_AUTH_BURNED_REASON_PREFIX}[${nowIso}]: Codex refresh token was revoked — re-authenticate (dashboard Codex-auth banner has a Re-authenticate button, or run \`codex login\`)`;
|
|
474
|
+
state.lastFailureAt = nowIso;
|
|
475
|
+
return true;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* When (epoch ms) a state was flagged codex-auth-burned, or null if it is not
|
|
479
|
+
* currently flagged. Requires the troubled gate to still be set — `pan
|
|
480
|
+
* untroubled` / resume clears troubled and the failure fields, which retires the
|
|
481
|
+
* flag. Parses the ISO stamp embedded in the reason; falls back to `troubledAt`
|
|
482
|
+
* for flags written by builds that predate the embedded stamp.
|
|
483
|
+
*/
|
|
484
|
+
function codexAuthBurnFlaggedAtMs(state) {
|
|
485
|
+
if (!state.troubled) return null;
|
|
486
|
+
const reason = state.lastFailureReason;
|
|
487
|
+
if (!reason?.startsWith("codex-auth-burned")) return null;
|
|
488
|
+
const embedded = reason.match(/^codex-auth-burned\[([^\]]+)\]/)?.[1];
|
|
489
|
+
const fromReason = embedded ? Date.parse(embedded) : NaN;
|
|
490
|
+
if (Number.isFinite(fromReason)) return fromReason;
|
|
491
|
+
const fromTroubledAt = state.troubledAt ? Date.parse(state.troubledAt) : NaN;
|
|
492
|
+
return Number.isFinite(fromTroubledAt) ? fromTroubledAt : 0;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Pure filter: which of these agent states are burned AND still current? Flags
|
|
496
|
+
* recorded strictly before the native store's last write are stale: a global
|
|
497
|
+
* `codex login` rewrites ~/.codex/auth.json (bumping its mtime) and heals every
|
|
498
|
+
* agent through the shared symlink, so those burns no longer apply (the flag
|
|
499
|
+
* itself is retired when the agent is untroubled/resumed).
|
|
500
|
+
*/
|
|
501
|
+
function filterCodexAuthBurnedAgentIds(states, nativeMtimeMs) {
|
|
502
|
+
const active = [];
|
|
503
|
+
for (const state of states) {
|
|
504
|
+
const flaggedAt = codexAuthBurnFlaggedAtMs(state);
|
|
505
|
+
if (flaggedAt !== null && flaggedAt >= nativeMtimeMs) active.push(state.id);
|
|
506
|
+
}
|
|
507
|
+
return active;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Agents currently flagged codex-auth-burned. Callers supply states read through
|
|
511
|
+
* the agent resolver so this pure auth module does not create a spawn-time cycle.
|
|
512
|
+
*/
|
|
513
|
+
function listCodexAuthBurnedAgentsSync(nativeMtimeMs, states) {
|
|
514
|
+
return filterCodexAuthBurnedAgentIds(states, nativeMtimeMs);
|
|
515
|
+
}
|
|
516
|
+
/** Sync convenience for the spawn gate: are any agents still burned right now? */
|
|
517
|
+
function hasActiveBurnedCodexAgentsSync(states) {
|
|
518
|
+
return listCodexAuthBurnedAgentsSync(nativeCodexAuthMtimeSync(), states).length > 0;
|
|
519
|
+
}
|
|
520
|
+
function nativeToStatus(native) {
|
|
521
|
+
switch (native.status) {
|
|
522
|
+
case "valid": return {
|
|
523
|
+
status: "valid",
|
|
524
|
+
email: native.email ?? "",
|
|
525
|
+
expiresAt: native.expiresAt ?? "",
|
|
526
|
+
source: "native"
|
|
527
|
+
};
|
|
528
|
+
case "expired": return {
|
|
529
|
+
status: "expired",
|
|
530
|
+
email: native.email ?? "",
|
|
531
|
+
expiresAt: native.expiresAt ?? "",
|
|
532
|
+
source: "native"
|
|
533
|
+
};
|
|
534
|
+
case "missing": return {
|
|
535
|
+
status: "missing",
|
|
536
|
+
source: "native"
|
|
537
|
+
};
|
|
538
|
+
case "unknown": return {
|
|
539
|
+
status: "unknown",
|
|
540
|
+
source: "native"
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
function withSource(status, source) {
|
|
545
|
+
return {
|
|
546
|
+
...status,
|
|
547
|
+
source
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Merge the native and cliproxy statuses into the single worst state the banner
|
|
552
|
+
* should react to (burned > expired > valid > missing > unknown). Both stores
|
|
553
|
+
* are healed by the same `codex login`, so surfacing the more severe one is
|
|
554
|
+
* correct and its remedy is identical. Exported for testing.
|
|
555
|
+
*/
|
|
556
|
+
function combineCodexAuthStatuses(native, cliproxy) {
|
|
557
|
+
const nativeSev = CODEX_AUTH_SEVERITY[native.status];
|
|
558
|
+
return CODEX_AUTH_SEVERITY[cliproxy.status] > nativeSev ? withSource(cliproxy, "cliproxy") : native;
|
|
559
|
+
}
|
|
560
|
+
async function checkCodexAuthStatusPromise(options = {}) {
|
|
561
|
+
const native = await probeNativeCodexAuth(Date.now());
|
|
562
|
+
const cliproxy = await checkCliproxyCodexAuthStatusPromise(options);
|
|
563
|
+
const activeBurned = listCodexAuthBurnedAgentsSync(native.mtimeMs, options.agentStates ?? []);
|
|
564
|
+
if (activeBurned.length > 0) return {
|
|
565
|
+
status: "burned",
|
|
566
|
+
email: native.email ?? "",
|
|
567
|
+
expiresAt: native.expiresAt ?? "",
|
|
568
|
+
source: "native",
|
|
569
|
+
affectedAgents: activeBurned
|
|
570
|
+
};
|
|
571
|
+
return combineCodexAuthStatuses(nativeToStatus(native), cliproxy);
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Spawn gate (PAN-2285): refuse to launch a NEW codex-harness agent while the
|
|
575
|
+
* native codex auth is unusable — missing/expired file or any agent currently
|
|
576
|
+
* burned (revoked refresh token shared across the family). Resumes are exempt:
|
|
577
|
+
* the symlink migration in initCodexHome heals a stale home on relaunch. Throws
|
|
578
|
+
* a clear, remedy-naming error, mirroring the harness-policy ToS gate.
|
|
579
|
+
*/
|
|
580
|
+
function assertCodexNativeAuthForSpawn(harness, agentStates) {
|
|
581
|
+
if (harness !== "codex") return;
|
|
582
|
+
const native = probeNativeCodexAuthSync();
|
|
583
|
+
const reason = native.status === "missing" ? "not signed in (~/.codex/auth.json is missing)" : native.status === "expired" ? "expired (~/.codex/auth.json access token has lapsed)" : hasActiveBurnedCodexAgentsSync(agentStates) ? "revoked (a running codex agent hit a revoked refresh token — the shared token family is dead)" : null;
|
|
584
|
+
if (reason === null) return;
|
|
585
|
+
throw new Error(`Cannot spawn a Codex agent: native Codex authentication is ${reason}. Run \`codex login\` on the host (or click Re-authenticate in the dashboard Codex-auth banner), then retry.`);
|
|
586
|
+
}
|
|
587
|
+
async function checkCliproxyCodexAuthStatusPromise(options = {}) {
|
|
588
|
+
const credPath = join$1(getCliproxyAuthDir(), "codex-primary.json");
|
|
589
|
+
let raw;
|
|
590
|
+
let credMtimeMs = null;
|
|
591
|
+
try {
|
|
592
|
+
raw = await readFile$1(credPath, "utf8");
|
|
593
|
+
credMtimeMs = (await stat$2(credPath)).mtimeMs;
|
|
594
|
+
} catch {
|
|
595
|
+
return { status: "missing" };
|
|
596
|
+
}
|
|
597
|
+
let creds;
|
|
598
|
+
try {
|
|
599
|
+
creds = JSON.parse(raw);
|
|
600
|
+
} catch {
|
|
601
|
+
return {
|
|
602
|
+
status: "unknown",
|
|
603
|
+
message: "Malformed credential file"
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
const accessToken = typeof creds.access_token === "string" ? creds.access_token : null;
|
|
607
|
+
if (!accessToken) return {
|
|
608
|
+
status: "unknown",
|
|
609
|
+
message: "Missing access_token in credential file"
|
|
610
|
+
};
|
|
611
|
+
const claims = decodeJwtPayload$1(accessToken);
|
|
612
|
+
if (!claims) return {
|
|
613
|
+
status: "unknown",
|
|
614
|
+
message: "Unable to decode access_token"
|
|
615
|
+
};
|
|
616
|
+
const expSec = typeof claims.exp === "number" ? claims.exp : null;
|
|
617
|
+
if (expSec === null) return {
|
|
618
|
+
status: "unknown",
|
|
619
|
+
message: "Missing exp claim in access_token"
|
|
620
|
+
};
|
|
621
|
+
const email = typeof creds.email === "string" ? creds.email : "";
|
|
622
|
+
const expiresAt = (/* @__PURE__ */ new Date(expSec * 1e3)).toISOString();
|
|
623
|
+
if (expSec * 1e3 <= Date.now()) return {
|
|
624
|
+
status: "expired",
|
|
625
|
+
email,
|
|
626
|
+
expiresAt
|
|
627
|
+
};
|
|
628
|
+
return await applyBurnedTokenOverride({
|
|
629
|
+
status: "valid",
|
|
630
|
+
email,
|
|
631
|
+
expiresAt
|
|
632
|
+
}, email, expiresAt, { ignoreBurnBefore: options.ignoreBurnBefore ?? credMtimeMs ?? void 0 });
|
|
633
|
+
}
|
|
634
|
+
/** Read the trailing window of the cliproxy log for burn/failure analysis. */
|
|
635
|
+
async function readLogTail(path) {
|
|
636
|
+
const TAIL_BYTES = 128 * 1024;
|
|
637
|
+
const file = await open$1(path, "r");
|
|
638
|
+
try {
|
|
639
|
+
const stat = await file.stat();
|
|
640
|
+
const length = Math.min(stat.size, TAIL_BYTES);
|
|
641
|
+
const buffer = Buffer.alloc(length);
|
|
642
|
+
await file.read(buffer, 0, length, stat.size - length);
|
|
643
|
+
return buffer.toString("utf8");
|
|
644
|
+
} finally {
|
|
645
|
+
await file.close();
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
async function applyBurnedTokenOverride(baseStatus, email, expiresAt, options) {
|
|
649
|
+
let logRaw;
|
|
650
|
+
try {
|
|
651
|
+
logRaw = await readLogTail(getCliproxyLogPath());
|
|
652
|
+
} catch {
|
|
653
|
+
return baseStatus;
|
|
654
|
+
}
|
|
655
|
+
return evaluateBurnedFromLog(logRaw, baseStatus, email, expiresAt, options);
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Pure decision: given the cliproxy log tail, decide whether a JWT-valid token
|
|
659
|
+
* is actually burned. Exported for regression testing (PAN-1584).
|
|
660
|
+
*
|
|
661
|
+
* "Auth failure" evidence = either a refresh-token burn line
|
|
662
|
+
* (`refresh token has already been used`) OR a `503` on `/v1/messages` /
|
|
663
|
+
* `/v1/chat/completions` (the live symptom the agent hits once cliproxy disables
|
|
664
|
+
* the provider — and which keeps appearing after the burn line stops, since a
|
|
665
|
+
* disabled provider no longer attempts refreshes). "Success" = a `200` on those
|
|
666
|
+
* same paths (proves the auth path works right now).
|
|
667
|
+
*
|
|
668
|
+
* Decision:
|
|
669
|
+
* - No failure evidence → trust base status.
|
|
670
|
+
* - Success AFTER the last failure → trust base status (recovered).
|
|
671
|
+
* - Failure AFTER the credential's last write (ignoreBurnBefore) → BURNED,
|
|
672
|
+
* regardless of age. The credential write time is when you last logged in;
|
|
673
|
+
* a failure after it means the current token is dead. This is authoritative
|
|
674
|
+
* and is the fix for the bug where a >1h-stale burn line was dismissed as
|
|
675
|
+
* "valid" during a quiet period even though the token was dead (PAN-1584).
|
|
676
|
+
* - Failure BEFORE that cutoff → trust base status (re-authed since).
|
|
677
|
+
* - No cutoff available → fall back to the staleness backstop:
|
|
678
|
+
* burned only if the last failure is within BURN_STALENESS_MS.
|
|
679
|
+
*
|
|
680
|
+
* We intentionally don't probe cliproxy with HTTP — `GET /v1/models` always
|
|
681
|
+
* 401s (it needs real OAuth, not the local key) and would generate spurious log
|
|
682
|
+
* lines on every dashboard load.
|
|
683
|
+
*/
|
|
684
|
+
function evaluateBurnedFromLog(logRaw, baseStatus, email, expiresAt, options = {}) {
|
|
685
|
+
const now = options.now ?? Date.now();
|
|
686
|
+
const lines = logRaw.split("\n").slice(-500);
|
|
687
|
+
const isBurnLine = (l) => l.includes("refresh token has already been used") || l.includes("refresh_token_reused");
|
|
688
|
+
const isAuthFailure503 = (l) => /\b503 \|/.test(l) && /POST\s+"\/v1\/(messages|chat\/completions)/.test(l);
|
|
689
|
+
const isSuccess = (l) => /\b200 \|/.test(l) && /POST\s+"\/v1\/(messages|chat\/completions)/.test(l);
|
|
690
|
+
const timestampAt = (idx) => {
|
|
691
|
+
for (let j = idx; j >= Math.max(0, idx - 10); j--) {
|
|
692
|
+
const m = lines[j]?.match(/^\[(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})\]/);
|
|
693
|
+
if (m) {
|
|
694
|
+
const t = Date.parse(`${m[1]}T${m[2]}Z`);
|
|
695
|
+
if (Number.isFinite(t)) return t;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
return null;
|
|
699
|
+
};
|
|
700
|
+
let lastFailureIdx = -1;
|
|
701
|
+
let lastFailureTimestamp = null;
|
|
702
|
+
let lastSuccessIdx = -1;
|
|
703
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
704
|
+
const line = lines[i] ?? "";
|
|
705
|
+
if (lastFailureIdx < 0 && (isBurnLine(line) || isAuthFailure503(line))) {
|
|
706
|
+
lastFailureIdx = i;
|
|
707
|
+
lastFailureTimestamp = timestampAt(i);
|
|
708
|
+
}
|
|
709
|
+
if (lastSuccessIdx < 0 && isSuccess(line)) lastSuccessIdx = i;
|
|
710
|
+
if (lastFailureIdx >= 0 && lastSuccessIdx >= 0) break;
|
|
711
|
+
}
|
|
712
|
+
if (lastFailureIdx < 0) return baseStatus;
|
|
713
|
+
if (lastSuccessIdx > lastFailureIdx) return baseStatus;
|
|
714
|
+
if (options.ignoreBurnBefore !== void 0) {
|
|
715
|
+
if (lastFailureTimestamp !== null && lastFailureTimestamp + 1e3 <= options.ignoreBurnBefore) return baseStatus;
|
|
716
|
+
return {
|
|
717
|
+
status: "burned",
|
|
718
|
+
email,
|
|
719
|
+
expiresAt
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
if (lastFailureTimestamp !== null && now - lastFailureTimestamp > BURN_STALENESS_MS) return baseStatus;
|
|
723
|
+
return {
|
|
724
|
+
status: "burned",
|
|
725
|
+
email,
|
|
726
|
+
expiresAt
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
var CodexAuthCheckError, CODEX_AUTH_BURN_MARKERS, CODEX_AUTH_BURNED_REASON_PREFIX, CODEX_AUTH_SEVERITY, BURN_STALENESS_MS, checkCodexAuthStatus;
|
|
730
|
+
var init_codex_auth = __esmMin((() => {
|
|
731
|
+
init_cliproxy();
|
|
732
|
+
CodexAuthCheckError = class extends Data.TaggedError("CodexAuthCheckError") {};
|
|
733
|
+
CODEX_AUTH_BURN_MARKERS = [
|
|
734
|
+
"could not be refreshed because your refresh token was revoked",
|
|
735
|
+
"token_invalidated",
|
|
736
|
+
"token_revoked"
|
|
737
|
+
];
|
|
738
|
+
CODEX_AUTH_BURNED_REASON_PREFIX = "codex-auth-burned";
|
|
739
|
+
CODEX_AUTH_SEVERITY = {
|
|
740
|
+
burned: 4,
|
|
741
|
+
expired: 3,
|
|
742
|
+
valid: 2,
|
|
743
|
+
missing: 1,
|
|
744
|
+
unknown: 0
|
|
745
|
+
};
|
|
746
|
+
BURN_STALENESS_MS = 3600 * 1e3;
|
|
747
|
+
checkCodexAuthStatus = (options = {}) => Effect.tryPromise({
|
|
748
|
+
try: () => checkCodexAuthStatusPromise(options),
|
|
749
|
+
catch: (cause) => new CodexAuthCheckError({
|
|
750
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
751
|
+
cause
|
|
752
|
+
})
|
|
753
|
+
});
|
|
754
|
+
}));
|
|
755
|
+
//#endregion
|
|
360
756
|
//#region ../../lib/overdeck/agent-rollback-state.ts
|
|
361
757
|
function getRollbackAgentStatePath(agentId) {
|
|
362
758
|
return join(getOverdeckHome(), "agents", agentId, AGENT_STATE_ROLLBACK_FILE);
|
|
@@ -1261,10 +1657,16 @@ function getAgentResumeGateBlockReason(state) {
|
|
|
1261
1657
|
/** Intent-aware policy over a classified gate. This function never mutates agent state. */
|
|
1262
1658
|
function decideResumeGate(block, intent, context = {}) {
|
|
1263
1659
|
if (!block) return { decision: "proceed" };
|
|
1264
|
-
if (intent === "message-delivery")
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1660
|
+
if (intent === "message-delivery") {
|
|
1661
|
+
if (block.gate === "stopped-by-user" && context.hasCompletedHandoff === true && context.owesRework === true) return {
|
|
1662
|
+
decision: "proceed",
|
|
1663
|
+
clearStoppedByUser: true
|
|
1664
|
+
};
|
|
1665
|
+
return {
|
|
1666
|
+
decision: "queue-message",
|
|
1667
|
+
reason: block.reason
|
|
1668
|
+
};
|
|
1669
|
+
}
|
|
1268
1670
|
if (intent === "operator-start") {
|
|
1269
1671
|
if (block.gate === "paused") return {
|
|
1270
1672
|
decision: "block",
|
|
@@ -2277,7 +2679,7 @@ async function createOhmypiFifoPromise(agentId, home) {
|
|
|
2277
2679
|
mode: 448
|
|
2278
2680
|
});
|
|
2279
2681
|
if (existsSync$1(paths.fifoPath)) unlinkSync$1(paths.fifoPath);
|
|
2280
|
-
await execAsync$
|
|
2682
|
+
await execAsync$6(`mkfifo -m 600 ${shellQuote$1(paths.fifoPath)}`);
|
|
2281
2683
|
return paths.fifoPath;
|
|
2282
2684
|
}
|
|
2283
2685
|
/**
|
|
@@ -2315,14 +2717,14 @@ function writeOhmypiCommandSync(agentId, command, home) {
|
|
|
2315
2717
|
closeSync$1(fd);
|
|
2316
2718
|
}
|
|
2317
2719
|
}
|
|
2318
|
-
function shellQuote$
|
|
2720
|
+
function shellQuote$1(s) {
|
|
2319
2721
|
if (/^[A-Za-z0-9._/-]+$/.test(s)) return s;
|
|
2320
2722
|
return `'${s.replace(/'/g, `'\\''`)}'`;
|
|
2321
2723
|
}
|
|
2322
|
-
var execAsync$
|
|
2724
|
+
var execAsync$6, OhmypiNotReady, OhmypiFifoError, createOhmypiFifo;
|
|
2323
2725
|
var init_ohmypi_fifo = __esmMin((() => {
|
|
2324
2726
|
init_paths();
|
|
2325
|
-
execAsync$
|
|
2727
|
+
execAsync$6 = promisify(exec);
|
|
2326
2728
|
OhmypiNotReady = class extends Error {
|
|
2327
2729
|
code = "OHMYPI_NOT_READY";
|
|
2328
2730
|
constructor(message) {
|
|
@@ -2382,12 +2784,12 @@ async function claudeSystemPromptFiles(workspace, harness) {
|
|
|
2382
2784
|
files.push(await ensureSessionContextBriefingFile());
|
|
2383
2785
|
const behavior = getHarnessBehavior(harness);
|
|
2384
2786
|
if (behavior.contextLayerKind === "pi") {
|
|
2385
|
-
const { piGlobalContextFile } = await import("./context-layers-
|
|
2787
|
+
const { piGlobalContextFile } = await import("./context-layers-DWL_8HhY.js");
|
|
2386
2788
|
const globalFile = piGlobalContextFile();
|
|
2387
2789
|
if (existsSync(globalFile)) files.unshift(globalFile);
|
|
2388
2790
|
}
|
|
2389
2791
|
if (behavior.contextLayerKind === "codex") {
|
|
2390
|
-
const { codexGlobalContextFile } = await import("./context-layers-
|
|
2792
|
+
const { codexGlobalContextFile } = await import("./context-layers-DWL_8HhY.js");
|
|
2391
2793
|
const globalFile = codexGlobalContextFile();
|
|
2392
2794
|
if (existsSync(globalFile)) files.unshift(globalFile);
|
|
2393
2795
|
}
|
|
@@ -2414,14 +2816,14 @@ async function hasAgentRuntimeInSubtree(rootPid, harness = "claude-code") {
|
|
|
2414
2816
|
if (seen.has(pid) || !/^\d+$/.test(pid)) continue;
|
|
2415
2817
|
seen.add(pid);
|
|
2416
2818
|
try {
|
|
2417
|
-
const { stdout: comm } = await execAsync$
|
|
2819
|
+
const { stdout: comm } = await execAsync$4(`ps -p ${pid} -o comm=`);
|
|
2418
2820
|
const name = comm.trim();
|
|
2419
2821
|
if (expectedProcessNames.has(name)) return true;
|
|
2420
2822
|
} catch {
|
|
2421
2823
|
continue;
|
|
2422
2824
|
}
|
|
2423
2825
|
try {
|
|
2424
|
-
const { stdout: kids } = await execAsync$
|
|
2826
|
+
const { stdout: kids } = await execAsync$4(`pgrep -P ${pid}`);
|
|
2425
2827
|
for (const kid of kids.trim().split("\n").filter(Boolean)) queue.push(kid);
|
|
2426
2828
|
} catch {}
|
|
2427
2829
|
}
|
|
@@ -2540,7 +2942,7 @@ async function injectPiPromptTimeMemory(agentId, prompt) {
|
|
|
2540
2942
|
agentRole: agentState.role ?? "work",
|
|
2541
2943
|
agentHarness: agentState.harness ?? "claude-code"
|
|
2542
2944
|
};
|
|
2543
|
-
const { injectPromptTimeMemory } = await import("./injection-
|
|
2945
|
+
const { injectPromptTimeMemory } = await import("./injection-Bvhyg_MV.js");
|
|
2544
2946
|
const result = await injectPromptTimeMemory({
|
|
2545
2947
|
prompt,
|
|
2546
2948
|
identity,
|
|
@@ -2574,7 +2976,7 @@ async function injectPiConversationMemory(opts, prompt) {
|
|
|
2574
2976
|
agentRole: "work",
|
|
2575
2977
|
agentHarness: "ohmypi"
|
|
2576
2978
|
};
|
|
2577
|
-
const { injectPromptTimeMemory } = await import("./injection-
|
|
2979
|
+
const { injectPromptTimeMemory } = await import("./injection-Bvhyg_MV.js");
|
|
2578
2980
|
const result = await injectPromptTimeMemory({
|
|
2579
2981
|
prompt,
|
|
2580
2982
|
identity,
|
|
@@ -2750,7 +3152,7 @@ async function getRoleRuntimeBaseCommand(model, agentName, role, harness = "clau
|
|
|
2750
3152
|
if (provider.name === "openai" && await getProviderAuthMode(validatedModel) === "subscription") return `claude${printFlag}${roleInject}${permissionFlags} --model ${shellQuoteModelIdSync(CLI_PROXY_MODEL_ALIASES[validatedModel] ?? validatedModel)}${effortFlag}${nameFlag}`;
|
|
2751
3153
|
return `claude${printFlag}${roleInject}${permissionFlags} --model ${quotedModel}${effortFlag}${nameFlag}`;
|
|
2752
3154
|
}
|
|
2753
|
-
var import_dist, execAsync$
|
|
3155
|
+
var import_dist, execAsync$4, missingRoleDefinitionWarnings, OHMYPI_AGENT_READY_TIMEOUT_SECONDS;
|
|
2754
3156
|
var init_runtime_command = __esmMin((() => {
|
|
2755
3157
|
import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
2756
3158
|
init_claude_permissions();
|
|
@@ -2770,7 +3172,7 @@ var init_runtime_command = __esmMin((() => {
|
|
|
2770
3172
|
init_agent_state();
|
|
2771
3173
|
init_identity();
|
|
2772
3174
|
init_provider_env();
|
|
2773
|
-
execAsync$
|
|
3175
|
+
execAsync$4 = promisify$1(exec$1);
|
|
2774
3176
|
missingRoleDefinitionWarnings = /* @__PURE__ */ new Set();
|
|
2775
3177
|
OHMYPI_AGENT_READY_TIMEOUT_SECONDS = 120;
|
|
2776
3178
|
}));
|
|
@@ -2829,6 +3231,14 @@ var init_resolve_tier = __esmMin((() => {
|
|
|
2829
3231
|
}));
|
|
2830
3232
|
//#endregion
|
|
2831
3233
|
//#region ../../lib/agents/staffing.ts
|
|
3234
|
+
/** Per-issue work-model override from the issue record, or undefined. */
|
|
3235
|
+
function resolveIssueWorkModel(issueId) {
|
|
3236
|
+
const resolved = resolveProjectFromIssueSync(issueId);
|
|
3237
|
+
if (!resolved) return void 0;
|
|
3238
|
+
const project = getProjectSync(resolved.projectKey);
|
|
3239
|
+
if (!project) return void 0;
|
|
3240
|
+
return readIssueRecordSync(project, issueId)?.workModel || void 0;
|
|
3241
|
+
}
|
|
2832
3242
|
/** Provider-default harness for a model (PAN-1984: harness is derived from the
|
|
2833
3243
|
* model's provider — per-provider setting else built-in default). */
|
|
2834
3244
|
function providerDefaultHarnessSync(model, config) {
|
|
@@ -2853,6 +3263,16 @@ function resolveImplicitStaffing(config, spawnKey) {
|
|
|
2853
3263
|
*/
|
|
2854
3264
|
function resolveStaffing(item, options = {}) {
|
|
2855
3265
|
const config = options.config ?? loadConfigSync().config;
|
|
3266
|
+
const issueModel = options.issueId ? resolveIssueWorkModel(options.issueId) : void 0;
|
|
3267
|
+
if (issueModel) {
|
|
3268
|
+
const model = requireModelOverrideSync(issueModel);
|
|
3269
|
+
return {
|
|
3270
|
+
tierName: "issue-override",
|
|
3271
|
+
model,
|
|
3272
|
+
harness: providerDefaultHarnessSync(model, config),
|
|
3273
|
+
implicit: false
|
|
3274
|
+
};
|
|
3275
|
+
}
|
|
2856
3276
|
const tiered = config.tieredExecution;
|
|
2857
3277
|
if (tiered && resolveTieredExecutionEnabled(tiered, options.planMetadata)) try {
|
|
2858
3278
|
const tier = resolveTier(item, tiered);
|
|
@@ -2892,7 +3312,9 @@ var init_staffing = __esmMin((() => {
|
|
|
2892
3312
|
init_config_yaml();
|
|
2893
3313
|
init_roles();
|
|
2894
3314
|
init_model_validation();
|
|
3315
|
+
init_record();
|
|
2895
3316
|
init_providers();
|
|
3317
|
+
init_projects();
|
|
2896
3318
|
init_percent();
|
|
2897
3319
|
init_resolve_tier();
|
|
2898
3320
|
init_tier_table();
|
|
@@ -2964,7 +3386,8 @@ function resolveSlotTierSpawnParams(baseWorkspace, slotItemId, explicitModel, sp
|
|
|
2964
3386
|
const staffing = resolveStaffing(item, {
|
|
2965
3387
|
planMetadata,
|
|
2966
3388
|
spawnKey,
|
|
2967
|
-
config
|
|
3389
|
+
config,
|
|
3390
|
+
issueId: issueId ?? void 0
|
|
2968
3391
|
});
|
|
2969
3392
|
return {
|
|
2970
3393
|
model: staffing.model,
|
|
@@ -2996,6 +3419,7 @@ function resolveSingleWorkTierSpawnParams(workspace, explicitModel, spawnKey) {
|
|
|
2996
3419
|
const staffing = resolveStaffing(item, {
|
|
2997
3420
|
planMetadata,
|
|
2998
3421
|
spawnKey,
|
|
3422
|
+
issueId: issueId ?? void 0,
|
|
2999
3423
|
config: {
|
|
3000
3424
|
...config,
|
|
3001
3425
|
tieredExecution: {
|
|
@@ -3078,7 +3502,7 @@ async function transitionIssueToInReview(issueId, workspacePath) {
|
|
|
3078
3502
|
async function buildAgentLaunchConfig(opts) {
|
|
3079
3503
|
const model = requireModelOverrideSync(opts.model);
|
|
3080
3504
|
try {
|
|
3081
|
-
const { injectOverdeckInfraDeny } = await import("./claude-settings-overlay-
|
|
3505
|
+
const { injectOverdeckInfraDeny } = await import("./claude-settings-overlay-DUWWLd6M.js");
|
|
3082
3506
|
await Effect.runPromise(injectOverdeckInfraDeny(opts.workspace));
|
|
3083
3507
|
} catch (err) {
|
|
3084
3508
|
console.warn(`[agents] injectOverdeckInfraDeny failed for ${opts.agentId} (non-fatal): ${err instanceof Error ? err.message : err}`);
|
|
@@ -3159,7 +3583,7 @@ async function retrieveSpawnTimeMemoryContext(input) {
|
|
|
3159
3583
|
agentRole: input.role,
|
|
3160
3584
|
agentHarness: input.harness
|
|
3161
3585
|
};
|
|
3162
|
-
const { injectPromptTimeMemory } = await import("./injection-
|
|
3586
|
+
const { injectPromptTimeMemory } = await import("./injection-Bvhyg_MV.js");
|
|
3163
3587
|
return (await injectPromptTimeMemory({
|
|
3164
3588
|
prompt: input.prompt,
|
|
3165
3589
|
identity,
|
|
@@ -3250,7 +3674,7 @@ async function assertWorkspaceStackHealthyForSpawn(issueId, role, allowHost = fa
|
|
|
3250
3674
|
record.attempts += 1;
|
|
3251
3675
|
spawnStackRebuildState.set(normalizedIssue, record);
|
|
3252
3676
|
console.log(`[agents] Workspace stack for ${normalizedIssue} unhealthy (${details}) — rebuilding before spawn (attempt ${record.attempts}/${SPAWN_STACK_REBUILD_MAX_ATTEMPTS})`);
|
|
3253
|
-
const { rebuildWorkspaceStack } = await import("./rebuild-stack-
|
|
3677
|
+
const { rebuildWorkspaceStack } = await import("./rebuild-stack-C7JPUom6.js");
|
|
3254
3678
|
const result = await Effect.runPromise(rebuildWorkspaceStack(issueId, { onProgress: (m) => console.log(`[agents] ${normalizedIssue} stack rebuild: ${m}`) })).catch((err) => ({
|
|
3255
3679
|
success: false,
|
|
3256
3680
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -4149,12 +4573,6 @@ var init_config = __esmMin((() => {
|
|
|
4149
4573
|
120
|
|
4150
4574
|
]
|
|
4151
4575
|
},
|
|
4152
|
-
cost_limits: {
|
|
4153
|
-
per_agent_usd: 10,
|
|
4154
|
-
per_issue_usd: 25,
|
|
4155
|
-
daily_total_usd: 100,
|
|
4156
|
-
alert_threshold: .8
|
|
4157
|
-
},
|
|
4158
4576
|
retention: {
|
|
4159
4577
|
agent_state_days: 7,
|
|
4160
4578
|
reviewer_state_days: 1,
|
|
@@ -4476,151 +4894,6 @@ var init_concurrency = __esmMin((() => {
|
|
|
4476
4894
|
swarmReservedThisPatrol = 0;
|
|
4477
4895
|
}));
|
|
4478
4896
|
//#endregion
|
|
4479
|
-
//#region ../../lib/agents/queries.ts
|
|
4480
|
-
function listRunningAgentsSync() {
|
|
4481
|
-
const tmuxSessions = listSessionsSync();
|
|
4482
|
-
const tmuxNames = new Set(tmuxSessions.map((s) => s.name));
|
|
4483
|
-
return listOverdeckAgentStatesSync().map((state) => {
|
|
4484
|
-
const normalizedId = normalizeAgentId(state.id);
|
|
4485
|
-
return {
|
|
4486
|
-
...state,
|
|
4487
|
-
id: normalizedId,
|
|
4488
|
-
tmuxActive: tmuxNames.has(normalizedId)
|
|
4489
|
-
};
|
|
4490
|
-
});
|
|
4491
|
-
}
|
|
4492
|
-
/**
|
|
4493
|
-
* PAN-1908: list all agents in the SQLite registry with optional filtering.
|
|
4494
|
-
* This is the replacement for enumerating ~/.overdeck/agents/ directories.
|
|
4495
|
-
*/
|
|
4496
|
-
function listAgentStates(options) {
|
|
4497
|
-
return listOverdeckAgentStatesSync().filter((state) => {
|
|
4498
|
-
if (options?.status && state.status !== options.status) return false;
|
|
4499
|
-
if (options?.role && state.role !== options.role) return false;
|
|
4500
|
-
return true;
|
|
4501
|
-
});
|
|
4502
|
-
}
|
|
4503
|
-
/**
|
|
4504
|
-
* PAN-1048 P2: async startup migration.
|
|
4505
|
-
*
|
|
4506
|
-
* The previous synchronous version used readdirSync, readFileSync,
|
|
4507
|
-
* killSession (sync tmux subprocess), and rmSync — all on the Node
|
|
4508
|
-
* event loop. Called from warnOnBareNumericIssueIds() during dashboard
|
|
4509
|
-
* read-model bootstrap, this blocked all HTTP/WebSocket/PTY traffic on
|
|
4510
|
-
* server startup while it scanned every agent dir, killed stale tmux
|
|
4511
|
-
* sessions, and recursively deleted directories.
|
|
4512
|
-
*
|
|
4513
|
-
* This async variant does the same work using fs/promises and the
|
|
4514
|
-
* already-async killSessionAsync() so the bootstrap path no longer
|
|
4515
|
-
* stalls the event loop.
|
|
4516
|
-
*/
|
|
4517
|
-
async function dropLegacyAgentStatesMissingRoleAsync() {
|
|
4518
|
-
if (!existsSync(AGENTS_DIR)) return 0;
|
|
4519
|
-
const fsp = await import("fs/promises");
|
|
4520
|
-
let entries;
|
|
4521
|
-
try {
|
|
4522
|
-
entries = await fsp.readdir(AGENTS_DIR);
|
|
4523
|
-
} catch {
|
|
4524
|
-
return 0;
|
|
4525
|
-
}
|
|
4526
|
-
let dropped = 0;
|
|
4527
|
-
await Promise.all(entries.map(async (entry) => {
|
|
4528
|
-
const dirPath = join$1(AGENTS_DIR, entry);
|
|
4529
|
-
let stat;
|
|
4530
|
-
try {
|
|
4531
|
-
stat = await fsp.stat(dirPath);
|
|
4532
|
-
} catch {
|
|
4533
|
-
return;
|
|
4534
|
-
}
|
|
4535
|
-
if (!stat.isDirectory()) return;
|
|
4536
|
-
const agentId = normalizeAgentId(entry);
|
|
4537
|
-
const stateFile = getRollbackAgentStatePath(agentId);
|
|
4538
|
-
let raw;
|
|
4539
|
-
try {
|
|
4540
|
-
const contents = await fsp.readFile(stateFile, "utf8");
|
|
4541
|
-
raw = JSON.parse(contents);
|
|
4542
|
-
} catch {
|
|
4543
|
-
return;
|
|
4544
|
-
}
|
|
4545
|
-
if (isRole(raw.role)) return;
|
|
4546
|
-
try {
|
|
4547
|
-
await Effect.runPromise(killSession(agentId));
|
|
4548
|
-
} catch {}
|
|
4549
|
-
try {
|
|
4550
|
-
await fsp.rm(dirPath, {
|
|
4551
|
-
recursive: true,
|
|
4552
|
-
force: true
|
|
4553
|
-
});
|
|
4554
|
-
dropped++;
|
|
4555
|
-
} catch (err) {
|
|
4556
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
4557
|
-
console.warn(`[agents] Failed to drop legacy agent state ${agentId}: ${msg}`);
|
|
4558
|
-
}
|
|
4559
|
-
}));
|
|
4560
|
-
return dropped;
|
|
4561
|
-
}
|
|
4562
|
-
/**
|
|
4563
|
-
* Scan ~/.overdeck/agents/ for state files with bare numeric issueIds
|
|
4564
|
-
* (e.g. "484" instead of "PAN-484") and log warnings to stderr.
|
|
4565
|
-
*
|
|
4566
|
-
* These workspaces were created before the pan- prefix convention and may
|
|
4567
|
-
* cause cross-tracker pollution if their in_review transition is triggered.
|
|
4568
|
-
* Called once at server startup to surface legacy state files.
|
|
4569
|
-
*/
|
|
4570
|
-
/**
|
|
4571
|
-
* PAN-1048 P2: bootstrap-path migration is async.
|
|
4572
|
-
*
|
|
4573
|
-
* Sweeps legacy state files missing a `role` field and warns on bare
|
|
4574
|
-
* numeric issueIds. Both passes used to be synchronous (readdirSync,
|
|
4575
|
-
* readFileSync, killSession, rmSync), which blocked the dashboard
|
|
4576
|
-
* server's event loop on startup. The async version scans the same
|
|
4577
|
-
* directory once per concern and uses fs/promises throughout.
|
|
4578
|
-
*/
|
|
4579
|
-
async function warnOnBareNumericIssueIds() {
|
|
4580
|
-
const droppedLegacyAgents = await dropLegacyAgentStatesMissingRoleAsync();
|
|
4581
|
-
if (droppedLegacyAgents > 0) console.warn(`[agents] Dropped ${droppedLegacyAgents} legacy agent state file(s) missing role`);
|
|
4582
|
-
if (!existsSync(AGENTS_DIR)) return;
|
|
4583
|
-
const fsp = await import("fs/promises");
|
|
4584
|
-
let entries;
|
|
4585
|
-
try {
|
|
4586
|
-
entries = await fsp.readdir(AGENTS_DIR);
|
|
4587
|
-
} catch {
|
|
4588
|
-
return;
|
|
4589
|
-
}
|
|
4590
|
-
const legacy = [];
|
|
4591
|
-
await Promise.all(entries.map(async (entry) => {
|
|
4592
|
-
const dirPath = join$1(AGENTS_DIR, entry);
|
|
4593
|
-
try {
|
|
4594
|
-
if (!(await fsp.stat(dirPath)).isDirectory()) return;
|
|
4595
|
-
} catch {
|
|
4596
|
-
return;
|
|
4597
|
-
}
|
|
4598
|
-
const state = await Effect.runPromise(getAgentState(entry));
|
|
4599
|
-
if (state?.issueId && /^\d+$/.test(state.issueId)) legacy.push(`${entry} (issueId: "${state.issueId}")`);
|
|
4600
|
-
}));
|
|
4601
|
-
if (legacy.length > 0) console.warn(`[agents] WARNING: ${legacy.length} agent state file(s) have bare numeric issueIds (created before the pan- prefix convention). These agents will not be able to transition tracker state. Consider removing or updating them:\n` + legacy.map((l) => ` ~/.overdeck/agents/${l}`).join("\n"));
|
|
4602
|
-
}
|
|
4603
|
-
var listRunningAgents;
|
|
4604
|
-
var init_queries = __esmMin((() => {
|
|
4605
|
-
init_agents();
|
|
4606
|
-
init_tmux();
|
|
4607
|
-
init_paths();
|
|
4608
|
-
init_agent_rollback_state();
|
|
4609
|
-
init_agent_state_sync();
|
|
4610
|
-
listRunningAgents = () => Effect.gen(function* () {
|
|
4611
|
-
const tmuxSessions = yield* listSessions();
|
|
4612
|
-
const tmuxNames = new Set(tmuxSessions.map((s) => s.name));
|
|
4613
|
-
return listOverdeckAgentStatesSync().map((state) => {
|
|
4614
|
-
const normalizedId = normalizeAgentId(state.id);
|
|
4615
|
-
return {
|
|
4616
|
-
...state,
|
|
4617
|
-
id: normalizedId,
|
|
4618
|
-
tmuxActive: tmuxNames.has(normalizedId)
|
|
4619
|
-
};
|
|
4620
|
-
});
|
|
4621
|
-
});
|
|
4622
|
-
}));
|
|
4623
|
-
//#endregion
|
|
4624
4897
|
//#region ../../lib/agents/termination.ts
|
|
4625
4898
|
/**
|
|
4626
4899
|
* True when the PID is a tmux process (client or server). Used to keep the
|
|
@@ -4686,7 +4959,7 @@ async function killLauncherProcessAsync(agentId) {
|
|
|
4686
4959
|
const launcherPath = join$1(AGENTS_DIR, agentId, "launcher.sh");
|
|
4687
4960
|
let pidsOut;
|
|
4688
4961
|
try {
|
|
4689
|
-
const { stdout } = await execAsync$
|
|
4962
|
+
const { stdout } = await execAsync$3(`pgrep -f ${JSON.stringify(launcherPath)}`);
|
|
4690
4963
|
pidsOut = stdout.trim();
|
|
4691
4964
|
} catch {
|
|
4692
4965
|
return;
|
|
@@ -4730,14 +5003,14 @@ function stopAgentSync(agentId) {
|
|
|
4730
5003
|
lastActivity: (/* @__PURE__ */ new Date()).toISOString()
|
|
4731
5004
|
});
|
|
4732
5005
|
}
|
|
4733
|
-
var execAsync$
|
|
5006
|
+
var execAsync$3, stopAgent;
|
|
4734
5007
|
var init_termination = __esmMin((() => {
|
|
4735
5008
|
init_agents();
|
|
4736
5009
|
init_agent_runtime();
|
|
4737
5010
|
init_paths();
|
|
4738
5011
|
init_tmux();
|
|
4739
5012
|
init_errors();
|
|
4740
|
-
execAsync$
|
|
5013
|
+
execAsync$3 = promisify$1(exec$1);
|
|
4741
5014
|
stopAgent = (agentId) => {
|
|
4742
5015
|
const normalizedId = normalizeAgentId(agentId);
|
|
4743
5016
|
return Effect.gen(function* () {
|
|
@@ -4788,46 +5061,6 @@ var init_termination = __esmMin((() => {
|
|
|
4788
5061
|
};
|
|
4789
5062
|
}));
|
|
4790
5063
|
//#endregion
|
|
4791
|
-
//#region ../../lib/beads/bd-shim.ts
|
|
4792
|
-
function shellQuote$1(value) {
|
|
4793
|
-
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
4794
|
-
}
|
|
4795
|
-
function installBdAgentShim(agentDir, realBdPath) {
|
|
4796
|
-
const binDir = join(agentDir, "bin");
|
|
4797
|
-
mkdirSync$1(binDir, { recursive: true });
|
|
4798
|
-
const path = join(binDir, "bd");
|
|
4799
|
-
writeFileSync$1(path, `#!/usr/bin/env bash
|
|
4800
|
-
set -euo pipefail
|
|
4801
|
-
verb="\${1:-}"
|
|
4802
|
-
subverb="\${2:-}"
|
|
4803
|
-
case "$verb:$subverb" in
|
|
4804
|
-
create:*|update:*|close:*|delete:*|import:*|init:*|migrate:*|batch:*|dep:add|dep:remove|dolt:push|dolt:commit|dolt:reset|config:set|config:unset|comments:add|comments:delete|admin:compact)
|
|
4805
|
-
echo "Raw mutating bd commands are blocked in agent sessions. Use pan beads claim|update|close|create|dep|delete so the canonical writer pulls, validates, exports, and pushes durably." >&2
|
|
4806
|
-
exit 64
|
|
4807
|
-
;;
|
|
4808
|
-
esac
|
|
4809
|
-
exec ${shellQuote$1(realBdPath)} "$@"
|
|
4810
|
-
`, { mode: 493 });
|
|
4811
|
-
chmodSync$1(path, 493);
|
|
4812
|
-
return {
|
|
4813
|
-
binDir,
|
|
4814
|
-
pathPrefix: `${binDir}${delimiter}${process.env.PATH ?? ""}`
|
|
4815
|
-
};
|
|
4816
|
-
}
|
|
4817
|
-
async function resolveBdAgentShimPath(agentDir) {
|
|
4818
|
-
try {
|
|
4819
|
-
const { stdout } = await execAsync$3("command -v bd", { encoding: "utf8" });
|
|
4820
|
-
const realBd = stdout.trim();
|
|
4821
|
-
return realBd ? installBdAgentShim(agentDir, realBd).pathPrefix : void 0;
|
|
4822
|
-
} catch {
|
|
4823
|
-
return;
|
|
4824
|
-
}
|
|
4825
|
-
}
|
|
4826
|
-
var execAsync$3;
|
|
4827
|
-
var init_bd_shim = __esmMin((() => {
|
|
4828
|
-
execAsync$3 = promisify(exec);
|
|
4829
|
-
}));
|
|
4830
|
-
//#endregion
|
|
4831
5064
|
//#region ../../lib/agents/hook-readiness.ts
|
|
4832
5065
|
/**
|
|
4833
5066
|
* Ensure Claude's global lifecycle hooks are registered before the process can
|
|
@@ -4897,18 +5130,18 @@ async function spawnRun(issueId, role, options = {}) {
|
|
|
4897
5130
|
let reapWarmIdle = false;
|
|
4898
5131
|
const advancing = role === "review" || role === "test" || role === "ship";
|
|
4899
5132
|
try {
|
|
4900
|
-
const { isPaneDead } = await import("./tmux-
|
|
5133
|
+
const { isPaneDead } = await import("./tmux-C-rgxRDA.js");
|
|
4901
5134
|
if (await Effect.runPromise(isPaneDead(agentId))) reapWarmIdle = true;
|
|
4902
5135
|
else if (advancing) {
|
|
4903
|
-
const { getReviewStatusSync } = await import("./review-status-
|
|
4904
|
-
const { isRoleTerminal } = await import("./reap-terminal-sessions-
|
|
5136
|
+
const { getReviewStatusSync } = await import("./review-status-77N3PoZr.js");
|
|
5137
|
+
const { isRoleTerminal } = await import("./reap-terminal-sessions-BR39qflC.js");
|
|
4905
5138
|
const status = getReviewStatusSync(issueId);
|
|
4906
5139
|
reapWarmIdle = !!status && isRoleTerminal(role, status);
|
|
4907
5140
|
}
|
|
4908
5141
|
} catch {}
|
|
4909
5142
|
if (!reapWarmIdle) throw new Error(`Role run ${agentId} already running. Use 'pan tell' to message it.`);
|
|
4910
5143
|
console.log(`[spawn] ${agentId} is warm-idle from the previous cycle — reaping it for the new ${role} dispatch (PAN-2579)`);
|
|
4911
|
-
const { killSession } = await import("./tmux-
|
|
5144
|
+
const { killSession } = await import("./tmux-C-rgxRDA.js");
|
|
4912
5145
|
await Effect.runPromise(killSession(agentId)).catch(() => {});
|
|
4913
5146
|
}
|
|
4914
5147
|
await assertWorkspaceStackHealthyForSpawn(issueId, role, options.allowHost, workspace);
|
|
@@ -4918,9 +5151,10 @@ async function spawnRun(issueId, role, options = {}) {
|
|
|
4918
5151
|
role,
|
|
4919
5152
|
model: selectedModel
|
|
4920
5153
|
});
|
|
5154
|
+
assertCodexNativeAuthForSpawn(resolvedHarness, listAgentStates());
|
|
4921
5155
|
await ensureLifecycleHooksBeforeLaunch(agentId, resolvedHarness);
|
|
4922
5156
|
if (getProviderForModelSync(selectedModel).name === "openai" && await getProviderAuthMode(selectedModel) === "subscription") {
|
|
4923
|
-
const { isCliproxyRunning } = await import("./cliproxy-
|
|
5157
|
+
const { isCliproxyRunning } = await import("./cliproxy-BQX1TL6N.js");
|
|
4924
5158
|
if (!await Effect.runPromise(isCliproxyRunning())) throw new Error("CLIProxyAPI sidecar is not running. GPT subscription role runs route through a local cliproxy process managed by `pan up`. Run `pan up` (or restart the dashboard) before spawning a GPT role run.");
|
|
4925
5159
|
}
|
|
4926
5160
|
const state = {
|
|
@@ -5028,7 +5262,7 @@ async function spawnRun(issueId, role, options = {}) {
|
|
|
5028
5262
|
const claudeCmd = `bash ${launcherScript}`;
|
|
5029
5263
|
console.log(`[claude-invoke] purpose=role-run | role=${role} | model=${state.model} | source=agents.ts:spawnRun | session=${agentId} | command="${claudeCmd}"`);
|
|
5030
5264
|
try {
|
|
5031
|
-
const { preTrustDirectory } = await import("./workspace-manager-
|
|
5265
|
+
const { preTrustDirectory } = await import("./workspace-manager-B1mYn0lN.js");
|
|
5032
5266
|
preTrustDirectory(workspace);
|
|
5033
5267
|
} catch {}
|
|
5034
5268
|
clearReadySignal(agentId);
|
|
@@ -5098,15 +5332,7 @@ async function spawnAgent(options) {
|
|
|
5098
5332
|
if (await Effect.runPromise(sessionExists(agentId))) throw new Error(`Agent ${agentId} already running. Use 'pan tell' to message it.`);
|
|
5099
5333
|
await assertWorkspaceStackHealthyForSpawn(options.issueId, role, options.allowHost, options.workspace);
|
|
5100
5334
|
initHookSync(agentId);
|
|
5101
|
-
if (role !== "strike" && role !== "knowledge" && options.slotItemId === void 0)
|
|
5102
|
-
await Effect.runPromise(assertIssueHasBeads(options.workspace, options.issueId, { acquisitionTimeoutMs: 500 }));
|
|
5103
|
-
} catch (error) {
|
|
5104
|
-
if (error instanceof BeadsMissingError && error.transientFailure !== void 0) {
|
|
5105
|
-
const attempts = error.transientFailure instanceof BdTransientFailure ? ` after ${error.transientFailure.attempts} attempts` : "";
|
|
5106
|
-
throw new Error(`Beads database was temporarily locked while checking ${options.issueId}${attempts}; re-run shortly.`);
|
|
5107
|
-
}
|
|
5108
|
-
throw error;
|
|
5109
|
-
}
|
|
5335
|
+
if (role !== "strike" && role !== "knowledge" && options.slotItemId === void 0 && !readWorkspacePlanSync(options.workspace)) throw new Error(`The required vBRIEF checklist for ${options.issueId} is missing or unreadable. Run planning before spawning a work agent.`);
|
|
5110
5336
|
const modelSpawnKey = `${role}:${options.issueId}`;
|
|
5111
5337
|
const singleTierParams = role === "work" && options.slotItemId === void 0 && options.slotIndex === void 0 ? resolveSingleWorkTierSpawnParams(options.workspace, options.model, modelSpawnKey) : {};
|
|
5112
5338
|
const selectedModel = determineModel({
|
|
@@ -5116,7 +5342,7 @@ async function spawnAgent(options) {
|
|
|
5116
5342
|
});
|
|
5117
5343
|
console.log(`[DEBUG] Selected model: ${selectedModel}`);
|
|
5118
5344
|
if (getProviderForModelSync(selectedModel).name === "openai" && await getProviderAuthMode(selectedModel) === "subscription") {
|
|
5119
|
-
const { isCliproxyRunning } = await import("./cliproxy-
|
|
5345
|
+
const { isCliproxyRunning } = await import("./cliproxy-BQX1TL6N.js");
|
|
5120
5346
|
if (!await Effect.runPromise(isCliproxyRunning())) throw new Error("CLIProxyAPI sidecar is not running. GPT subscription agents route through a local cliproxy process managed by `pan up`. Run `pan up` (or restart the dashboard) before spawning a GPT agent.");
|
|
5121
5347
|
}
|
|
5122
5348
|
const resolvedHarness = await resolveHarness({
|
|
@@ -5124,6 +5350,7 @@ async function spawnAgent(options) {
|
|
|
5124
5350
|
role,
|
|
5125
5351
|
model: selectedModel
|
|
5126
5352
|
});
|
|
5353
|
+
assertCodexNativeAuthForSpawn(resolvedHarness, listAgentStates());
|
|
5127
5354
|
await ensureLifecycleHooksBeforeLaunch(agentId, resolvedHarness);
|
|
5128
5355
|
const state = {
|
|
5129
5356
|
id: agentId,
|
|
@@ -5144,7 +5371,7 @@ async function spawnAgent(options) {
|
|
|
5144
5371
|
if (role === "work") {
|
|
5145
5372
|
try {
|
|
5146
5373
|
if (resetPipelineVerdictsForWorkStartSync(options.issueId)) {
|
|
5147
|
-
const { resetPostMergeState } = await import("./merge-agent-
|
|
5374
|
+
const { resetPostMergeState } = await import("./merge-agent-DMQTJMP0.js");
|
|
5148
5375
|
resetPostMergeState(options.issueId);
|
|
5149
5376
|
}
|
|
5150
5377
|
} catch (err) {
|
|
@@ -5155,7 +5382,7 @@ async function spawnAgent(options) {
|
|
|
5155
5382
|
});
|
|
5156
5383
|
}
|
|
5157
5384
|
if (role === "work") try {
|
|
5158
|
-
const { writeStoryFeatureContext } = await import("./work-agent-prompt-
|
|
5385
|
+
const { writeStoryFeatureContext } = await import("./work-agent-prompt-BiJ43Der.js");
|
|
5159
5386
|
await writeStoryFeatureContext(options.workspace, options.issueId);
|
|
5160
5387
|
} catch (ctxErr) {
|
|
5161
5388
|
console.warn(`[agents] Could not write story feature context for ${options.issueId}: ${ctxErr.message}`);
|
|
@@ -5204,7 +5431,7 @@ async function spawnAgent(options) {
|
|
|
5204
5431
|
try {
|
|
5205
5432
|
const venvPath = join$1(options.workspace, ".venv");
|
|
5206
5433
|
if (isTldrEnabledSync() && existsSync(venvPath)) {
|
|
5207
|
-
const { getTldrDaemonServiceSync } = await import("./tldr-daemon-
|
|
5434
|
+
const { getTldrDaemonServiceSync } = await import("./tldr-daemon-DhGwd88s.js");
|
|
5208
5435
|
const tldrService = getTldrDaemonServiceSync(options.workspace, venvPath);
|
|
5209
5436
|
if (!(await tldrService.getStatus()).running) {
|
|
5210
5437
|
await tldrService.start(true);
|
|
@@ -5244,13 +5471,13 @@ async function spawnAgent(options) {
|
|
|
5244
5471
|
const claudeCmd = `bash ${launcherScript}`;
|
|
5245
5472
|
console.log(`[claude-invoke] purpose=work-agent | model=${state.model} | source=agents.ts:spawnAgent | session=${agentId} | command="${claudeCmd}"`);
|
|
5246
5473
|
try {
|
|
5247
|
-
const { preTrustDirectory } = await import("./workspace-manager-
|
|
5474
|
+
const { preTrustDirectory } = await import("./workspace-manager-B1mYn0lN.js");
|
|
5248
5475
|
preTrustDirectory(options.workspace);
|
|
5249
5476
|
} catch {}
|
|
5250
5477
|
try {
|
|
5251
|
-
const { isGitHubAppConfigured, generateInstallationToken, configureWorkspaceForBot } = await import("./github-app-
|
|
5478
|
+
const { isGitHubAppConfigured, generateInstallationToken, configureWorkspaceForBot } = await import("./github-app-BrYwK_Gb.js");
|
|
5252
5479
|
if (isGitHubAppConfigured()) {
|
|
5253
|
-
const { findProjectByPathSync } = await import("./projects-
|
|
5480
|
+
const { findProjectByPathSync } = await import("./projects-Dc9aoVoG.js");
|
|
5254
5481
|
const ghRepo = findProjectByPathSync(resolve$1(options.workspace, "..", ".."))?.github_repo;
|
|
5255
5482
|
if (ghRepo) {
|
|
5256
5483
|
const [owner, repo] = ghRepo.split("/");
|
|
@@ -5263,7 +5490,6 @@ async function spawnAgent(options) {
|
|
|
5263
5490
|
console.warn(`[${agentId}] GitHub App config failed (falling back to SSH): ${err.message}`);
|
|
5264
5491
|
}
|
|
5265
5492
|
clearReadySignal(agentId);
|
|
5266
|
-
const bdShimPath = role === "work" ? await resolveBdAgentShimPath(getAgentDir(agentId)) : void 0;
|
|
5267
5493
|
await Effect.runPromise(createSession(agentId, options.workspace, claudeCmd, { env: {
|
|
5268
5494
|
...BLANKED_PROVIDER_ENV,
|
|
5269
5495
|
TERM: "xterm-256color",
|
|
@@ -5272,7 +5498,6 @@ async function spawnAgent(options) {
|
|
|
5272
5498
|
OVERDECK_SESSION_TYPE: role,
|
|
5273
5499
|
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION: "false",
|
|
5274
5500
|
GIT_SEQUENCE_EDITOR: "false",
|
|
5275
|
-
...bdShimPath ? { PATH: bdShimPath } : {},
|
|
5276
5501
|
...flywheelEnv,
|
|
5277
5502
|
...providerEnv
|
|
5278
5503
|
} }));
|
|
@@ -5321,7 +5546,7 @@ async function spawnAgent(options) {
|
|
|
5321
5546
|
const codexHomeForAgent = join$1(homedir(), ".overdeck", "agents", agentId, "codex-home");
|
|
5322
5547
|
(async () => {
|
|
5323
5548
|
try {
|
|
5324
|
-
const { waitForCodexRollout, extractThreadIdFromRollout, writeThreadId } = await import("./codex-
|
|
5549
|
+
const { waitForCodexRollout, extractThreadIdFromRollout, writeThreadId } = await import("./codex-DxLivxri.js");
|
|
5325
5550
|
const rollout = await waitForCodexRollout(codexHomeForAgent, 12e4);
|
|
5326
5551
|
if (rollout) {
|
|
5327
5552
|
const threadId = extractThreadIdFromRollout(rollout);
|
|
@@ -5415,8 +5640,6 @@ function writeTaskCache(agentId, issueId) {
|
|
|
5415
5640
|
var execAsync$2;
|
|
5416
5641
|
var init_spawn = __esmMin((() => {
|
|
5417
5642
|
init_activity_logger();
|
|
5418
|
-
init_beads_query();
|
|
5419
|
-
init_bd_process_lock();
|
|
5420
5643
|
init_child_env();
|
|
5421
5644
|
init_config_yaml();
|
|
5422
5645
|
init_conversations();
|
|
@@ -5426,6 +5649,7 @@ var init_spawn = __esmMin((() => {
|
|
|
5426
5649
|
init_providers();
|
|
5427
5650
|
init_review_status();
|
|
5428
5651
|
init_harness_resolve();
|
|
5652
|
+
init_codex_auth();
|
|
5429
5653
|
init_bridge_token();
|
|
5430
5654
|
init_tmux();
|
|
5431
5655
|
init_dag();
|
|
@@ -5444,7 +5668,6 @@ var init_spawn = __esmMin((() => {
|
|
|
5444
5668
|
init_state_read_home();
|
|
5445
5669
|
init_supervisor_channels();
|
|
5446
5670
|
init_termination();
|
|
5447
|
-
init_bd_shim();
|
|
5448
5671
|
init_session_history();
|
|
5449
5672
|
init_hook_readiness();
|
|
5450
5673
|
execAsync$2 = promisify$1(exec$1);
|
|
@@ -6061,9 +6284,24 @@ async function appendTellInterventionForUserSource(normalizedId, caller) {
|
|
|
6061
6284
|
source: caller
|
|
6062
6285
|
});
|
|
6063
6286
|
}
|
|
6064
|
-
async function messageAgent(agentId, message, caller = "internal") {
|
|
6287
|
+
async function messageAgent(agentId, message, caller = "internal", opts = {}) {
|
|
6065
6288
|
const normalizedId = normalizeAgentId(agentId);
|
|
6066
6289
|
const agentState = getAgentStateSync(normalizedId);
|
|
6290
|
+
const decideMessageGate = () => {
|
|
6291
|
+
const block = agentState ? getAgentResumeGateBlockReason(agentState) : void 0;
|
|
6292
|
+
const agentDir = getAgentDir(normalizedId);
|
|
6293
|
+
const decision = decideResumeGate(block, "message-delivery", {
|
|
6294
|
+
hasCompletedHandoff: existsSync(join$1(agentDir, "completed")) || existsSync(join$1(agentDir, "completed.processed")),
|
|
6295
|
+
owesRework: opts.owesRework === true
|
|
6296
|
+
});
|
|
6297
|
+
if (decision.decision === "proceed" && decision.clearStoppedByUser && agentState) {
|
|
6298
|
+
console.log(`[agents] ${normalizedId} was operator-stopped but owes rework after a completed handoff — clearing stop gate to deliver feedback (PAN-2668)`);
|
|
6299
|
+
logAgentLifecycleSync(normalizedId, "stoppedByUser cleared: completed handoff owes rework; delivering pipeline feedback (PAN-2668)");
|
|
6300
|
+
delete agentState.stoppedByUser;
|
|
6301
|
+
saveAgentStateSync(agentState);
|
|
6302
|
+
}
|
|
6303
|
+
return decision;
|
|
6304
|
+
};
|
|
6067
6305
|
if (agentState?.paused === true) {
|
|
6068
6306
|
const gateBlockReason = getAgentResumeGateBlockReason(agentState)?.reason ?? "agent is paused";
|
|
6069
6307
|
queueAgentMail(normalizedId, message);
|
|
@@ -6072,15 +6310,16 @@ async function messageAgent(agentId, message, caller = "internal") {
|
|
|
6072
6310
|
return;
|
|
6073
6311
|
}
|
|
6074
6312
|
if (getAgentRuntimeStateSync(normalizedId)?.state === "suspended") {
|
|
6075
|
-
const
|
|
6076
|
-
if (
|
|
6313
|
+
const suspendedGate = decideMessageGate();
|
|
6314
|
+
if (suspendedGate.decision !== "proceed") {
|
|
6315
|
+
const gateBlockReason = suspendedGate.reason ?? "agent is gated";
|
|
6077
6316
|
queueAgentMail(normalizedId, message);
|
|
6078
6317
|
logAgentLifecycleSync(normalizedId, `messageAgent queued mail without resume: ${gateBlockReason}`);
|
|
6079
6318
|
console.log(`[agents] Queued message for ${normalizedId}; ${gateBlockReason}`);
|
|
6080
6319
|
return;
|
|
6081
6320
|
}
|
|
6082
6321
|
console.log(`[agents] Auto-resuming suspended agent ${normalizedId} to deliver message`);
|
|
6083
|
-
const { resumeAgent } = await import("./agents-
|
|
6322
|
+
const { resumeAgent } = await import("./agents-BA15AQqo.js");
|
|
6084
6323
|
const result = await resumeAgent(normalizedId, message);
|
|
6085
6324
|
if (!result.success) throw new Error(`Failed to auto-resume agent: ${result.error}`);
|
|
6086
6325
|
if (result.messageDelivered === false) throw new Error(`Agent resumed but ready signal did not fire — message not delivered. Feedback is in the mail queue.`);
|
|
@@ -6088,15 +6327,16 @@ async function messageAgent(agentId, message, caller = "internal") {
|
|
|
6088
6327
|
return;
|
|
6089
6328
|
}
|
|
6090
6329
|
if (agentState && agentState.status === "stopped") {
|
|
6091
|
-
const
|
|
6092
|
-
if (
|
|
6330
|
+
const stoppedGate = decideMessageGate();
|
|
6331
|
+
if (stoppedGate.decision !== "proceed") {
|
|
6332
|
+
const gateBlockReason = stoppedGate.reason ?? "agent is gated";
|
|
6093
6333
|
queueAgentMail(normalizedId, message);
|
|
6094
6334
|
logAgentLifecycleSync(normalizedId, `messageAgent queued mail without resume: ${gateBlockReason}`);
|
|
6095
6335
|
console.log(`[agents] Queued message for ${normalizedId}; ${gateBlockReason}`);
|
|
6096
6336
|
return;
|
|
6097
6337
|
}
|
|
6098
6338
|
console.log(`[agents] Auto-resuming stopped agent ${normalizedId} to deliver feedback (session exists: ${await Effect.runPromise(sessionExists(normalizedId))})`);
|
|
6099
|
-
const { resumeAgent } = await import("./agents-
|
|
6339
|
+
const { resumeAgent } = await import("./agents-BA15AQqo.js");
|
|
6100
6340
|
const resumeResult = await resumeAgent(normalizedId, message);
|
|
6101
6341
|
queueAgentMail(normalizedId, message);
|
|
6102
6342
|
if (resumeResult.success && resumeResult.messageDelivered !== false) {
|
|
@@ -6132,7 +6372,7 @@ async function messageAgent(agentId, message, caller = "internal") {
|
|
|
6132
6372
|
const resumeRole = agentState.role ?? "work";
|
|
6133
6373
|
const resumeModel = agentState.model || "claude-sonnet-4-6";
|
|
6134
6374
|
const fallbackHarness = agentState.harness ?? "claude-code";
|
|
6135
|
-
const { assertWorkspaceStackHealthyForSpawn } = await import("./agents-
|
|
6375
|
+
const { assertWorkspaceStackHealthyForSpawn } = await import("./agents-BA15AQqo.js");
|
|
6136
6376
|
await assertWorkspaceStackHealthyForSpawn(agentState.issueId || normalizedId.replace(/^agent-/, "").toUpperCase(), resumeRole, agentState.hostOverride === true, agentState.workspace);
|
|
6137
6377
|
const fallbackPiFields = fallbackHarness === "ohmypi" ? await getOhmypiLauncherFields(normalizedId, resumeModel) : {};
|
|
6138
6378
|
const fallbackCodexFields = fallbackHarness === "codex" ? getCodexLauncherFields(normalizedId, resumeModel, agentState.workspace) : {};
|
|
@@ -6195,7 +6435,7 @@ async function messageAgent(agentId, message, caller = "internal") {
|
|
|
6195
6435
|
} else console.warn(`[agents] Fallback-restarted ${normalizedId} but ready signal not detected — feedback in mail queue`);
|
|
6196
6436
|
return;
|
|
6197
6437
|
}
|
|
6198
|
-
const { loadRemoteAgentState, sendToRemoteAgent } = await import("./remote-agents-
|
|
6438
|
+
const { loadRemoteAgentState, sendToRemoteAgent } = await import("./remote-agents-DYY5fFpd.js");
|
|
6199
6439
|
const remoteState = loadRemoteAgentState(normalizedId);
|
|
6200
6440
|
if (remoteState && remoteState.vmName) {
|
|
6201
6441
|
console.log(`[agents] Sending message to remote agent ${normalizedId} on ${remoteState.vmName}`);
|
|
@@ -6209,7 +6449,7 @@ async function messageAgent(agentId, message, caller = "internal") {
|
|
|
6209
6449
|
const expectedHarness = agentState?.harness ?? "claude-code";
|
|
6210
6450
|
if (panePids.length > 0 && !await hasAgentRuntimeInSubtree(panePids[0], expectedHarness)) {
|
|
6211
6451
|
console.warn(`[agents] ${normalizedId} tmux session is a zombie (no ${expectedHarness} runtime) — attempting resume`);
|
|
6212
|
-
const { resumeAgent } = await import("./agents-
|
|
6452
|
+
const { resumeAgent } = await import("./agents-BA15AQqo.js");
|
|
6213
6453
|
const resumeResult = await resumeAgent(normalizedId, message);
|
|
6214
6454
|
if (resumeResult.success) {
|
|
6215
6455
|
if (resumeResult.messageDelivered !== false) await appendTellInterventionForUserSource(normalizedId, caller);
|
|
@@ -6277,7 +6517,7 @@ function buildCompactRecoverySeedMessage(issueId, summary) {
|
|
|
6277
6517
|
const lines = [`Your previous session for ${issueId} hit the model's context-window limit, so you are starting a fresh session. This freed tokens; it did not reset your filesystem work.`, "Do NOT start over and do NOT expect the prior conversation to be available."];
|
|
6278
6518
|
if (summary) lines.push("", "Summary of the archived session:", "", summary, "");
|
|
6279
6519
|
else lines.push("");
|
|
6280
|
-
lines.push("Reconstruct your exact work-in-progress from durable artifacts:", "1. Read .pan/continue.json for resumePoint, decisions, hazards, feedback, and sessionHistory.", "2. Run `
|
|
6520
|
+
lines.push("Reconstruct your exact work-in-progress from durable artifacts:", "1. Read .pan/continue.json for resumePoint, decisions, hazards, feedback, and sessionHistory.", "2. Run `pan task next` for the next open item and `pan task show <issue> <item>` for its current state.", "3. Inspect `git status` and `git diff` for uncommitted work already on disk.", "Then continue from that reconstructed state and complete the next required bead — do not wait for further instructions.");
|
|
6281
6521
|
return lines.join("\n");
|
|
6282
6522
|
}
|
|
6283
6523
|
var CONTEXT_OVERFLOW_PATTERNS;
|
|
@@ -6321,7 +6561,7 @@ async function buildCompactRecoverySeed(agentId) {
|
|
|
6321
6561
|
if (agentState?.workspace && sessionId) {
|
|
6322
6562
|
const sessionFile = sessionFilePath(agentState.workspace, sessionId);
|
|
6323
6563
|
try {
|
|
6324
|
-
const [{ getConversationCompactionSettings }, { generateSmartSummary }] = await Promise.all([import("./conversation-compaction-
|
|
6564
|
+
const [{ getConversationCompactionSettings }, { generateSmartSummary }] = await Promise.all([import("./conversation-compaction-CRKAf2qP.js"), import("./smart-compaction-DldUel4B.js")]);
|
|
6325
6565
|
const settings = getConversationCompactionSettings();
|
|
6326
6566
|
summary = (await Effect.runPromise(generateSmartSummary({
|
|
6327
6567
|
jsonlPath: sessionFile,
|
|
@@ -6332,7 +6572,7 @@ async function buildCompactRecoverySeed(agentId) {
|
|
|
6332
6572
|
} catch (err) {
|
|
6333
6573
|
logAgentLifecycleSync(normalizedId, `compact-recovery smart summary failed (${err instanceof Error ? err.message : String(err)}); trying heuristic fallback`);
|
|
6334
6574
|
try {
|
|
6335
|
-
const { generateFallbackSummary } = await import("./summary-fork-
|
|
6575
|
+
const { generateFallbackSummary } = await import("./summary-fork-BxnF8Xh0.js");
|
|
6336
6576
|
summary = await Effect.runPromise(generateFallbackSummary(sessionFile));
|
|
6337
6577
|
} catch (fallbackErr) {
|
|
6338
6578
|
logAgentLifecycleSync(normalizedId, `compact-recovery fallback summary failed (${fallbackErr instanceof Error ? fallbackErr.message : String(fallbackErr)}); seeding with reseed instructions only`);
|
|
@@ -6949,7 +7189,7 @@ function generateRecoveryPrompt(state) {
|
|
|
6949
7189
|
`- Started: ${state.startedAt}`,
|
|
6950
7190
|
"",
|
|
6951
7191
|
"## Recovery Steps",
|
|
6952
|
-
"1. Check
|
|
7192
|
+
"1. Check the vBRIEF task state: `pan task show " + state.issueId + " <item-id>`",
|
|
6953
7193
|
"2. Review recent git commits: `git log --oneline -10`",
|
|
6954
7194
|
"3. Check hook for pending work: `pan admin fpp check`",
|
|
6955
7195
|
"4. Resume from last known state",
|
|
@@ -7151,10 +7391,10 @@ function computeTierRunSchedule(doc, config) {
|
|
|
7151
7391
|
if (!item) continue;
|
|
7152
7392
|
const tier = resolveTier(item, config);
|
|
7153
7393
|
const currentRun = runs[runs.length - 1];
|
|
7154
|
-
if (currentRun && currentRun.tierName === tier.tierName) currentRun.
|
|
7394
|
+
if (currentRun && currentRun.tierName === tier.tierName) currentRun.itemIds.push(item.id);
|
|
7155
7395
|
else runs.push({
|
|
7156
7396
|
tierName: tier.tierName,
|
|
7157
|
-
|
|
7397
|
+
itemIds: [item.id]
|
|
7158
7398
|
});
|
|
7159
7399
|
}
|
|
7160
7400
|
return runs;
|
|
@@ -7188,20 +7428,20 @@ function applyEffectiveDifficulty(item, overrides) {
|
|
|
7188
7428
|
* retry event persistence, tier promotion writes, dispatch, and notifications.
|
|
7189
7429
|
*/
|
|
7190
7430
|
function decideEscalation(trigger, bead, config, overrides) {
|
|
7191
|
-
const
|
|
7431
|
+
const itemId = trigger.itemId || bead.id;
|
|
7192
7432
|
const override = overrides[bead.id];
|
|
7193
7433
|
const currentDifficulty = override?.effectiveDifficulty ?? bead.metadata?.difficulty;
|
|
7194
7434
|
if (!currentDifficulty) return {
|
|
7195
7435
|
action: "block",
|
|
7196
|
-
reason: `
|
|
7436
|
+
reason: `task ${itemId} has no effective difficulty`
|
|
7197
7437
|
};
|
|
7198
7438
|
if ((override?.promotions ?? 0) >= config.max_promotions) return {
|
|
7199
7439
|
action: "block",
|
|
7200
|
-
reason: `max promotions reached for ${
|
|
7440
|
+
reason: `max promotions reached for ${itemId} at ${currentDifficulty}`
|
|
7201
7441
|
};
|
|
7202
7442
|
if (currentDifficulty === "expert") return {
|
|
7203
7443
|
action: "block",
|
|
7204
|
-
reason: `expert
|
|
7444
|
+
reason: `expert task ${itemId} cannot promote beyond expert`
|
|
7205
7445
|
};
|
|
7206
7446
|
const attemptsAtCurrentTier = trigger.attemptsAtCurrentTier ?? 0;
|
|
7207
7447
|
if (attemptsAtCurrentTier < config.retries_at_tier) return {
|
|
@@ -7211,7 +7451,7 @@ function decideEscalation(trigger, bead, config, overrides) {
|
|
|
7211
7451
|
const to = TIERED_EXECUTION_DIFFICULTIES[TIERED_EXECUTION_DIFFICULTIES.indexOf(currentDifficulty) + 1];
|
|
7212
7452
|
if (!to) return {
|
|
7213
7453
|
action: "block",
|
|
7214
|
-
reason: `
|
|
7454
|
+
reason: `task ${itemId} cannot promote beyond ${currentDifficulty}`
|
|
7215
7455
|
};
|
|
7216
7456
|
return {
|
|
7217
7457
|
action: "promote",
|
|
@@ -7283,20 +7523,20 @@ function resolveFeedApiUrl(env = process.env) {
|
|
|
7283
7523
|
}
|
|
7284
7524
|
/**
|
|
7285
7525
|
* Compose the ingestion-only feed message for one commit. Deterministic over
|
|
7286
|
-
* (sha,
|
|
7526
|
+
* (sha, itemTitle, diff) so replay reconstructs byte-identical messages.
|
|
7287
7527
|
*/
|
|
7288
|
-
function composeCommitFeedMessage(sha,
|
|
7528
|
+
function composeCommitFeedMessage(sha, itemTitle, diff, callout) {
|
|
7289
7529
|
const lines = [
|
|
7290
7530
|
`# Commit feed (ingestion-only): ${sha}`,
|
|
7291
7531
|
"",
|
|
7292
|
-
`Bead: ${
|
|
7532
|
+
`Bead: ${itemTitle}`,
|
|
7293
7533
|
""
|
|
7294
7534
|
];
|
|
7295
7535
|
if (callout) {
|
|
7296
7536
|
const body = JSON.stringify({
|
|
7297
7537
|
issueId: callout.issueId,
|
|
7298
7538
|
sha,
|
|
7299
|
-
|
|
7539
|
+
itemId: callout.itemId,
|
|
7300
7540
|
tierName: callout.tierName,
|
|
7301
7541
|
agentId: callout.agentId,
|
|
7302
7542
|
claim: "<one sentence: what is wrong and where>"
|
|
@@ -7313,22 +7553,22 @@ function composeCommitFeedMessage(sha, beadTitle, diff, callout) {
|
|
|
7313
7553
|
*/
|
|
7314
7554
|
async function broadcastCommit(options) {
|
|
7315
7555
|
const feedConfig = options.feedConfig ?? DEFAULT_FEED_CONFIG;
|
|
7316
|
-
if (shouldSkipFeedSubject(options.commitSubject ?? options.
|
|
7556
|
+
if (shouldSkipFeedSubject(options.commitSubject ?? options.itemTitle, feedConfig)) return [];
|
|
7317
7557
|
const renderDiff = options.renderDiff ?? (options.gitShow ? (workspace, sha) => options.gitShow(workspace, sha) : renderCommitFeedDiff);
|
|
7318
7558
|
const deliver = options.deliver ?? deliverAgentMessage;
|
|
7319
7559
|
const recordDelivery = options.recordDelivery ?? recordTierFeedDelivery;
|
|
7320
7560
|
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
7321
7561
|
const diff = await renderDiff(options.workspace, options.sha, feedConfig);
|
|
7322
|
-
const baseMessage = composeCommitFeedMessage(options.sha, options.
|
|
7562
|
+
const baseMessage = composeCommitFeedMessage(options.sha, options.itemTitle, diff);
|
|
7323
7563
|
const baseTokenCount = estimateFeedDeliveryTokens(baseMessage);
|
|
7324
|
-
const includeCallout = feedConfig.callouts !== "off" && options.issueId !== void 0 && options.
|
|
7564
|
+
const includeCallout = feedConfig.callouts !== "off" && options.issueId !== void 0 && options.itemId !== void 0;
|
|
7325
7565
|
const apiUrl = options.apiUrl ?? resolveFeedApiUrl();
|
|
7326
7566
|
const deliveries = [];
|
|
7327
7567
|
for (const tier of options.tiers) {
|
|
7328
|
-
const message = includeCallout ? composeCommitFeedMessage(options.sha, options.
|
|
7568
|
+
const message = includeCallout ? composeCommitFeedMessage(options.sha, options.itemTitle, diff, {
|
|
7329
7569
|
apiUrl,
|
|
7330
7570
|
issueId: options.issueId,
|
|
7331
|
-
|
|
7571
|
+
itemId: options.itemId,
|
|
7332
7572
|
tierName: tier.tierName,
|
|
7333
7573
|
agentId: tier.agentId
|
|
7334
7574
|
}) : baseMessage;
|
|
@@ -7347,7 +7587,7 @@ async function broadcastCommit(options) {
|
|
|
7347
7587
|
ts: now().toISOString(),
|
|
7348
7588
|
issueId: options.issueId,
|
|
7349
7589
|
sha: options.sha,
|
|
7350
|
-
|
|
7590
|
+
itemTitle: options.itemTitle,
|
|
7351
7591
|
tierName: tier.tierName,
|
|
7352
7592
|
agentId: tier.agentId,
|
|
7353
7593
|
tokenCount,
|
|
@@ -7426,10 +7666,10 @@ function shouldSupervise(bead, policy, options = {}) {
|
|
|
7426
7666
|
* is stable across the live commit feed, replay re-delivery (tier-replay),
|
|
7427
7667
|
* and tests.
|
|
7428
7668
|
*/
|
|
7429
|
-
function sampleFraction(
|
|
7669
|
+
function sampleFraction(itemId) {
|
|
7430
7670
|
let hash = 2166136261;
|
|
7431
|
-
for (let i = 0; i <
|
|
7432
|
-
hash ^=
|
|
7671
|
+
for (let i = 0; i < itemId.length; i++) {
|
|
7672
|
+
hash ^= itemId.charCodeAt(i);
|
|
7433
7673
|
hash = Math.imul(hash, 16777619);
|
|
7434
7674
|
}
|
|
7435
7675
|
return (hash >>> 0) / 4294967296;
|
|
@@ -7546,7 +7786,7 @@ You are the standing supervisor for ${event.issueId}. Review this commit against
|
|
|
7546
7786
|
## Bead under review
|
|
7547
7787
|
|
|
7548
7788
|
- Issue: ${event.issueId}
|
|
7549
|
-
- Bead: ${event.
|
|
7789
|
+
- Bead: ${event.itemId} — ${event.itemTitle}
|
|
7550
7790
|
- Commit: ${event.sha}
|
|
7551
7791
|
|
|
7552
7792
|
## Acceptance criteria
|
|
@@ -7561,14 +7801,14 @@ ${event.diff}
|
|
|
7561
7801
|
|
|
7562
7802
|
## Verdict (REQUIRED — post exactly one)
|
|
7563
7803
|
|
|
7564
|
-
Land your verdict on the existing inspect-status surface. Your notes MUST begin with "
|
|
7804
|
+
Land your verdict on the existing inspect-status surface. Your notes MUST begin with "Item ${event.itemId}" — the server extracts the bead id from that prefix.
|
|
7565
7805
|
|
|
7566
7806
|
If the diff satisfies the acceptance criteria, post an ack (this persists inspectStatus and saves the bead checkpoint):
|
|
7567
7807
|
|
|
7568
7808
|
\`\`\`bash
|
|
7569
7809
|
curl -X POST ${event.apiUrl}/api/specialists/done \\
|
|
7570
7810
|
-H "Content-Type: application/json" \\
|
|
7571
|
-
-d '{"specialist":"inspect","issueId":"${event.issueId}","status":"passed","notes":"
|
|
7811
|
+
-d '{"specialist":"inspect","issueId":"${event.issueId}","status":"passed","notes":"Item ${event.itemId} ack: <one-line summary>"}'
|
|
7572
7812
|
\`\`\`
|
|
7573
7813
|
|
|
7574
7814
|
If any acceptance criterion is not met, post a blocking finding with specific, actionable violations ([file:line] + what is wrong):
|
|
@@ -7576,7 +7816,7 @@ If any acceptance criterion is not met, post a blocking finding with specific, a
|
|
|
7576
7816
|
\`\`\`bash
|
|
7577
7817
|
curl -X POST ${event.apiUrl}/api/specialists/done \\
|
|
7578
7818
|
-H "Content-Type: application/json" \\
|
|
7579
|
-
-d '{"specialist":"inspect","issueId":"${event.issueId}","status":"failed","notes":"
|
|
7819
|
+
-d '{"specialist":"inspect","issueId":"${event.issueId}","status":"failed","notes":"Item ${event.itemId} BLOCKED: <specific violations and required fixes>"}'
|
|
7580
7820
|
\`\`\`
|
|
7581
7821
|
|
|
7582
7822
|
Rules:
|
|
@@ -7605,8 +7845,8 @@ async function deliverCommitForReview(options) {
|
|
|
7605
7845
|
const frText = options.prdMarkdown && traces.length > 0 ? extractTracedFrText(options.prdMarkdown, traces) : void 0;
|
|
7606
7846
|
const message = buildSupervisorReviewMessage({
|
|
7607
7847
|
issueId: options.issueId,
|
|
7608
|
-
|
|
7609
|
-
|
|
7848
|
+
itemId: options.itemId ?? options.item.id,
|
|
7849
|
+
itemTitle: options.item.title,
|
|
7610
7850
|
sha: options.sha,
|
|
7611
7851
|
diff,
|
|
7612
7852
|
acceptanceCriteria: extractAcceptanceCriteria(options.item),
|
|
@@ -7743,11 +7983,11 @@ async function replayTierFeed(agentId, target, commits, deps) {
|
|
|
7743
7983
|
const includeCallout = (target.feedConfig ?? DEFAULT_TIERED_EXECUTION_CONFIG.feed).callouts !== "off";
|
|
7744
7984
|
const apiUrl = target.apiUrl ?? resolveFeedApiUrl();
|
|
7745
7985
|
for (const commit of commits) {
|
|
7746
|
-
const
|
|
7747
|
-
const message = composeCommitFeedMessage(commit.sha, commit.subject, commit.diff, includeCallout &&
|
|
7986
|
+
const itemId = commit.itemId;
|
|
7987
|
+
const message = composeCommitFeedMessage(commit.sha, commit.subject, commit.diff, includeCallout && itemId ? {
|
|
7748
7988
|
apiUrl,
|
|
7749
7989
|
issueId: target.issueId,
|
|
7750
|
-
|
|
7990
|
+
itemId,
|
|
7751
7991
|
tierName: target.tierName,
|
|
7752
7992
|
agentId
|
|
7753
7993
|
} : void 0);
|
|
@@ -7767,8 +8007,8 @@ async function replaySupervisorFeed(agentId, target, commits, deps) {
|
|
|
7767
8007
|
const frText = target.prdMarkdown && traces.length > 0 ? extractTracedFrText(target.prdMarkdown, traces) : void 0;
|
|
7768
8008
|
const message = buildSupervisorReviewMessage({
|
|
7769
8009
|
issueId: target.issueId,
|
|
7770
|
-
|
|
7771
|
-
|
|
8010
|
+
itemId: item.id,
|
|
8011
|
+
itemTitle: item.title,
|
|
7772
8012
|
sha: commit.sha,
|
|
7773
8013
|
diff: commit.diff,
|
|
7774
8014
|
acceptanceCriteria: extractAcceptanceCriteria(item),
|
|
@@ -7874,6 +8114,151 @@ var init_agents = __esmMin((() => {
|
|
|
7874
8114
|
init_tier_replay();
|
|
7875
8115
|
}));
|
|
7876
8116
|
//#endregion
|
|
7877
|
-
|
|
8117
|
+
//#region ../../lib/agents/queries.ts
|
|
8118
|
+
function listRunningAgentsSync() {
|
|
8119
|
+
const tmuxSessions = listSessionsSync();
|
|
8120
|
+
const tmuxNames = new Set(tmuxSessions.map((s) => s.name));
|
|
8121
|
+
return listOverdeckAgentStatesSync().map((state) => {
|
|
8122
|
+
const normalizedId = normalizeAgentId(state.id);
|
|
8123
|
+
return {
|
|
8124
|
+
...state,
|
|
8125
|
+
id: normalizedId,
|
|
8126
|
+
tmuxActive: tmuxNames.has(normalizedId)
|
|
8127
|
+
};
|
|
8128
|
+
});
|
|
8129
|
+
}
|
|
8130
|
+
/**
|
|
8131
|
+
* PAN-1908: list all agents in the SQLite registry with optional filtering.
|
|
8132
|
+
* This is the replacement for enumerating ~/.overdeck/agents/ directories.
|
|
8133
|
+
*/
|
|
8134
|
+
function listAgentStates(options) {
|
|
8135
|
+
return listOverdeckAgentStatesSync().filter((state) => {
|
|
8136
|
+
if (options?.status && state.status !== options.status) return false;
|
|
8137
|
+
if (options?.role && state.role !== options.role) return false;
|
|
8138
|
+
return true;
|
|
8139
|
+
});
|
|
8140
|
+
}
|
|
8141
|
+
/**
|
|
8142
|
+
* PAN-1048 P2: async startup migration.
|
|
8143
|
+
*
|
|
8144
|
+
* The previous synchronous version used readdirSync, readFileSync,
|
|
8145
|
+
* killSession (sync tmux subprocess), and rmSync — all on the Node
|
|
8146
|
+
* event loop. Called from warnOnBareNumericIssueIds() during dashboard
|
|
8147
|
+
* read-model bootstrap, this blocked all HTTP/WebSocket/PTY traffic on
|
|
8148
|
+
* server startup while it scanned every agent dir, killed stale tmux
|
|
8149
|
+
* sessions, and recursively deleted directories.
|
|
8150
|
+
*
|
|
8151
|
+
* This async variant does the same work using fs/promises and the
|
|
8152
|
+
* already-async killSessionAsync() so the bootstrap path no longer
|
|
8153
|
+
* stalls the event loop.
|
|
8154
|
+
*/
|
|
8155
|
+
async function dropLegacyAgentStatesMissingRoleAsync() {
|
|
8156
|
+
if (!existsSync(AGENTS_DIR)) return 0;
|
|
8157
|
+
const fsp = await import("fs/promises");
|
|
8158
|
+
let entries;
|
|
8159
|
+
try {
|
|
8160
|
+
entries = await fsp.readdir(AGENTS_DIR);
|
|
8161
|
+
} catch {
|
|
8162
|
+
return 0;
|
|
8163
|
+
}
|
|
8164
|
+
let dropped = 0;
|
|
8165
|
+
await Promise.all(entries.map(async (entry) => {
|
|
8166
|
+
const dirPath = join$1(AGENTS_DIR, entry);
|
|
8167
|
+
let stat;
|
|
8168
|
+
try {
|
|
8169
|
+
stat = await fsp.stat(dirPath);
|
|
8170
|
+
} catch {
|
|
8171
|
+
return;
|
|
8172
|
+
}
|
|
8173
|
+
if (!stat.isDirectory()) return;
|
|
8174
|
+
const agentId = normalizeAgentId(entry);
|
|
8175
|
+
const stateFile = getRollbackAgentStatePath(agentId);
|
|
8176
|
+
let raw;
|
|
8177
|
+
try {
|
|
8178
|
+
const contents = await fsp.readFile(stateFile, "utf8");
|
|
8179
|
+
raw = JSON.parse(contents);
|
|
8180
|
+
} catch {
|
|
8181
|
+
return;
|
|
8182
|
+
}
|
|
8183
|
+
if (isRole(raw.role)) return;
|
|
8184
|
+
try {
|
|
8185
|
+
await Effect.runPromise(killSession(agentId));
|
|
8186
|
+
} catch {}
|
|
8187
|
+
try {
|
|
8188
|
+
await fsp.rm(dirPath, {
|
|
8189
|
+
recursive: true,
|
|
8190
|
+
force: true
|
|
8191
|
+
});
|
|
8192
|
+
dropped++;
|
|
8193
|
+
} catch (err) {
|
|
8194
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
8195
|
+
console.warn(`[agents] Failed to drop legacy agent state ${agentId}: ${msg}`);
|
|
8196
|
+
}
|
|
8197
|
+
}));
|
|
8198
|
+
return dropped;
|
|
8199
|
+
}
|
|
8200
|
+
/**
|
|
8201
|
+
* Scan ~/.overdeck/agents/ for state files with bare numeric issueIds
|
|
8202
|
+
* (e.g. "484" instead of "PAN-484") and log warnings to stderr.
|
|
8203
|
+
*
|
|
8204
|
+
* These workspaces were created before the pan- prefix convention and may
|
|
8205
|
+
* cause cross-tracker pollution if their in_review transition is triggered.
|
|
8206
|
+
* Called once at server startup to surface legacy state files.
|
|
8207
|
+
*/
|
|
8208
|
+
/**
|
|
8209
|
+
* PAN-1048 P2: bootstrap-path migration is async.
|
|
8210
|
+
*
|
|
8211
|
+
* Sweeps legacy state files missing a `role` field and warns on bare
|
|
8212
|
+
* numeric issueIds. Both passes used to be synchronous (readdirSync,
|
|
8213
|
+
* readFileSync, killSession, rmSync), which blocked the dashboard
|
|
8214
|
+
* server's event loop on startup. The async version scans the same
|
|
8215
|
+
* directory once per concern and uses fs/promises throughout.
|
|
8216
|
+
*/
|
|
8217
|
+
async function warnOnBareNumericIssueIds() {
|
|
8218
|
+
const droppedLegacyAgents = await dropLegacyAgentStatesMissingRoleAsync();
|
|
8219
|
+
if (droppedLegacyAgents > 0) console.warn(`[agents] Dropped ${droppedLegacyAgents} legacy agent state file(s) missing role`);
|
|
8220
|
+
if (!existsSync(AGENTS_DIR)) return;
|
|
8221
|
+
const fsp = await import("fs/promises");
|
|
8222
|
+
let entries;
|
|
8223
|
+
try {
|
|
8224
|
+
entries = await fsp.readdir(AGENTS_DIR);
|
|
8225
|
+
} catch {
|
|
8226
|
+
return;
|
|
8227
|
+
}
|
|
8228
|
+
const legacy = [];
|
|
8229
|
+
await Promise.all(entries.map(async (entry) => {
|
|
8230
|
+
const dirPath = join$1(AGENTS_DIR, entry);
|
|
8231
|
+
try {
|
|
8232
|
+
if (!(await fsp.stat(dirPath)).isDirectory()) return;
|
|
8233
|
+
} catch {
|
|
8234
|
+
return;
|
|
8235
|
+
}
|
|
8236
|
+
const state = await Effect.runPromise(getAgentState(entry));
|
|
8237
|
+
if (state?.issueId && /^\d+$/.test(state.issueId)) legacy.push(`${entry} (issueId: "${state.issueId}")`);
|
|
8238
|
+
}));
|
|
8239
|
+
if (legacy.length > 0) console.warn(`[agents] WARNING: ${legacy.length} agent state file(s) have bare numeric issueIds (created before the pan- prefix convention). These agents will not be able to transition tracker state. Consider removing or updating them:\n` + legacy.map((l) => ` ~/.overdeck/agents/${l}`).join("\n"));
|
|
8240
|
+
}
|
|
8241
|
+
var listRunningAgents;
|
|
8242
|
+
var init_queries = __esmMin((() => {
|
|
8243
|
+
init_agents();
|
|
8244
|
+
init_tmux();
|
|
8245
|
+
init_paths();
|
|
8246
|
+
init_agent_rollback_state();
|
|
8247
|
+
init_agent_state_sync();
|
|
8248
|
+
listRunningAgents = () => Effect.gen(function* () {
|
|
8249
|
+
const tmuxSessions = yield* listSessions();
|
|
8250
|
+
const tmuxNames = new Set(tmuxSessions.map((s) => s.name));
|
|
8251
|
+
return listOverdeckAgentStatesSync().map((state) => {
|
|
8252
|
+
const normalizedId = normalizeAgentId(state.id);
|
|
8253
|
+
return {
|
|
8254
|
+
...state,
|
|
8255
|
+
id: normalizedId,
|
|
8256
|
+
tmuxActive: tmuxNames.has(normalizedId)
|
|
8257
|
+
};
|
|
8258
|
+
});
|
|
8259
|
+
});
|
|
8260
|
+
}));
|
|
8261
|
+
//#endregion
|
|
8262
|
+
export { stopAgentSync as $, wipeAgentStateDirs as $n, roleAgentDefinitionPath as $t, buildCompactRecoverySeed as A, decideResumeGate as An, init_bridge_token as At, appendActivity as B, markAgentRunning as Bn, resolveImplicitStaffing as Bt, init_slot_reconcile as C, SESSION_EXITED_BEFORE_KICKOFF as Cn, init_ohmypi_parser as Cr, deliverAgentPermissionDecision as Ct, detectCrashedAgents as D, clearAgentTroubled as Dn, captureTranscriptUserRecordSnapshot as Dt, autoRecoverAgents as E, clearAgentPausedSync as En, setAgentDeliveryMethod as Et, isContextOverflowTail as F, getAgentStateSync as Fn, init_spawn_prep as Ft, saveSessionId as G, recordAgentFailureSync as Gn, describeOhmypiSpawnFailure as Gt, getLatestSessionId as H, markAgentStoppedState as Hn, init_resolve_tier as Ht, init_messaging as I, init_agent_state as In, retrieveSpawnTimeMemoryContext as It, init_spawn as J, saveAgentState as Jn, getOhmypiLauncherFields as Jt, createOhmypiRuntimeSync as K, recordStartupSessionExit as Kn, getAgentRuntimeBaseCommand as Kt, messageAgent as L, isAgentPaused as Ln, transitionIssueToInProgress as Lt, resumeAgent as M, getAgentResumeGateBlockReason as Mn, assertWorkspaceStackHealthyForSpawn as Mt, init_context_overflow as N, getAgentState as Nn, buildAgentLaunchConfig as Nt, recoverAgent as O, clearAgentTroubledSync as On, init_transcript_landing as Ot, isContextOverflowError as P, getAgentStateFilePath as Pn, defaultRunWorkspace as Pt, stopAgent as Q, setAgentYieldedSync as Qn, injectPiConversationMemory as Qt, init_operator_interventions as R, isAgentTroubled as Rn, transitionIssueToInReview as Rt, init_tier_escalation as S, GOVERNOR_SLOT_PAUSE_REASON_PREFIX as Sn, paneShowsCodexAuthBurn as Sr, deliverAgentMessage as St, reconcileSlotState as T, clearAgentPaused as Tn, deliverResumeMessageWithTranscriptConfirmation as Tt, getLatestSessionIdSync as U, markAgentTroubled as Un, resolveTier as Ut, getActivity as V, markAgentRunningState as Vn, resolveStaffing as Vt, getSessionId as W, recordAgentFailure as Wn, OHMYPI_AGENT_READY_TIMEOUT_SECONDS as Wt, spawnRun as X, setAgentPaused as Xn, getRoleRuntimeBaseCommand as Xt, spawnAgent as Y, saveAgentStateSync as Yn, getProviderAuthMode as Yt, init_termination as Z, setAgentPausedSync as Zn, init_runtime_command as Zt, spawnTierSupervisor as _, buildDefaultResumeContinueMessage as _n, getAgentRuntimeSnapshot as _r, init_config as _t, listRunningAgentsSync as a, getClaudeAuthStatus as an, init_pty_supervisor_locate as ar, init_concurrency as at, init_tier_feed as b, dismissDevChannelsDialog as bn, checkCodexAuthStatus as br, saveCloisterConfigSync as bt, compactAtTierRunBoundary as c, buildSpawnEnvForModel as cn, isQualifiedAgentId as cr, resetPatrolDispatchBudget as ct, replayStandingAgent as d, getProviderExportsForModel as dn, waitForAgentIdle as dr, workResumeSlotsAvailable as dt, waitForPromptReady as en, writeAgentStateJsonSync as er, countRunningAgents as et, shouldReplayCompactAtTierRunBoundary as f, getProviderTmuxFlags as fn, waitForReadySignal as fr, getCachedMemoryVerdict as ft, shouldSupervise as g, init_openai_auth as gn, saveAgentRuntimeState as gr, getHealthThresholdsMs as gt, loadPrdDraft as h, getOpenAIAuthStatus as hn, init_runtime_state as hr, DEFAULT_CLOISTER_CONFIG as ht, listRunningAgents as i, ohmypiFifoPaths as in, writePtyToken as ir, getConcurrencyLimits as it, init_resume as j, getAgentDir as jn, writeBridgeTokenSync as jt, restartAgent as k, clearYieldForResumeSync as kn, probeTranscriptSince as kt, contextWindowForModel as l, determineModel as ln, normalizeAgentId as lr, tryReserveAdvancingSlot as lt, init_tier_supervisor as m, validateProviderHealth as mn, getAgentRuntimeStateSync as mr, setCachedMemoryVerdict as mt, init_queries as n, piFifoPaths as nn, readAgentHarnessModelRecordSync as nr, describeRunningAgents as nt, warnOnBareNumericIssueIds as o, init_claude_auth as on, resolvePtySupervisorScriptPath as or, releaseAdvancingSlot as ot, deliverCommitForReview as p, init_provider_health as pn, getAgentRuntimeState as pr, init_memory_verdict_cache as pt, init_ohmypi as q, resetAgentFailureCount as qn, getCodexLauncherFields as qt, listAgentStates as r, init_ohmypi_fifo as rn, init_pty_token as rr, emergencyBrake as rt, init_agents as s, buildCavemanExports as sn, clearReadySignal as sr, releaseSwarmSlot as st, dropLegacyAgentStatesMissingRoleAsync as t, init_pi_fifo as tn, init_agent_record_sync as tr, countRunningSwarmSlotsForIssue as tt, replayCrashedStandingAgent as u, getProviderEnvForModel as un, resolveAgentTargetSync as ur, tryReserveSwarmSlot as ut, supervisorAgentId as v, decideChannelsForWorkAgent as vn, init_agent_runtime as vr, loadCloisterConfig as vt, listSlotAssignments as w, __testInternals as wn, parseOhmypiSessionCostResultSync as wr, deliverInitialPromptWithRetry as wt, decideEscalation as x, writeChannelsBridgeMcpConfig as xn, init_codex_auth as xr, shouldAutoStart as xt, broadcastCommit as y, decideSupervisorForWorkAgent as yn, applyCodexAuthBurnFlag as yr, loadCloisterConfigSync as yt, operatorInterventionEvent as z, isRole as zn, init_staffing as zt };
|
|
7878
8263
|
|
|
7879
|
-
//# sourceMappingURL=
|
|
8264
|
+
//# sourceMappingURL=queries-C0LCGG21.js.map
|