@namzu/cli 35.0.0 → 36.1.0
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/CHANGELOG.md +764 -0
- package/README.md +160 -394
- package/assets/pal-blender-mcp.py +123 -0
- package/assets/pal-godot-mcp-pin.json +135 -0
- package/assets/pal-godot-mcp.cjs +418 -0
- package/dist/bin-main.d.ts +3 -0
- package/dist/bin-main.d.ts.map +1 -0
- package/dist/bin.d.ts +2 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +85 -23
- package/dist/bin.js.map +6 -1
- package/dist/boot-narrative.d.ts +16 -0
- package/dist/boot-narrative.d.ts.map +1 -0
- package/dist/checkpoints/manifest.d.ts +107 -0
- package/dist/checkpoints/manifest.d.ts.map +1 -0
- package/dist/checkpoints/store.d.ts +280 -40
- package/dist/checkpoints/store.d.ts.map +1 -1
- package/dist/checkpoints/undo-plan.d.ts +83 -0
- package/dist/checkpoints/undo-plan.d.ts.map +1 -0
- package/dist/checkpoints/wrap.d.ts +4 -0
- package/dist/checkpoints/wrap.d.ts.map +1 -1
- package/dist/chunks/acp-5CWS2GLJ.js +13448 -0
- package/dist/chunks/acp-5CWS2GLJ.js.map +6 -0
- package/dist/chunks/activity-command-HK7YJTXV.js +262 -0
- package/dist/chunks/activity-command-HK7YJTXV.js.map +6 -0
- package/dist/chunks/add-ULH5DUNX.js +712 -0
- package/dist/chunks/add-ULH5DUNX.js.map +6 -0
- package/dist/chunks/agent-UEK2U3RE.js +87 -0
- package/dist/chunks/agent-UEK2U3RE.js.map +6 -0
- package/dist/chunks/agent-session-V7JRTODS.js +46 -0
- package/dist/chunks/agent-session-V7JRTODS.js.map +6 -0
- package/dist/chunks/archive-C4A3HPLF.js +84 -0
- package/dist/chunks/archive-C4A3HPLF.js.map +6 -0
- package/dist/chunks/bin-main-EEJHRDIC.js +126 -0
- package/dist/chunks/bin-main-EEJHRDIC.js.map +6 -0
- package/dist/chunks/browser-CRX4HM4C.js +31 -0
- package/dist/chunks/browser-CRX4HM4C.js.map +6 -0
- package/dist/chunks/chat-FVBATC4E.js +101 -0
- package/dist/chunks/chat-FVBATC4E.js.map +6 -0
- package/dist/chunks/chunk-2A37JQKY.js +1355 -0
- package/dist/chunks/chunk-2A37JQKY.js.map +6 -0
- package/dist/chunks/chunk-2NJ2XUXJ.js +283 -0
- package/dist/chunks/chunk-2NJ2XUXJ.js.map +6 -0
- package/dist/chunks/chunk-4HAE7PYX.js +74 -0
- package/dist/chunks/chunk-4HAE7PYX.js.map +6 -0
- package/dist/chunks/chunk-5GRV6P5C.js +69 -0
- package/dist/chunks/chunk-5GRV6P5C.js.map +6 -0
- package/dist/chunks/chunk-5PQVJBIO.js +168 -0
- package/dist/chunks/chunk-5PQVJBIO.js.map +6 -0
- package/dist/chunks/chunk-62I7HLAP.js +1142 -0
- package/dist/chunks/chunk-62I7HLAP.js.map +6 -0
- package/dist/chunks/chunk-63CGV3XY.js +161 -0
- package/dist/chunks/chunk-63CGV3XY.js.map +6 -0
- package/dist/chunks/chunk-6LLJQ3KY.js +225 -0
- package/dist/chunks/chunk-6LLJQ3KY.js.map +6 -0
- package/dist/chunks/chunk-6YG7D7U4.js +159 -0
- package/dist/chunks/chunk-6YG7D7U4.js.map +6 -0
- package/dist/chunks/chunk-76FLAFCG.js +51 -0
- package/dist/chunks/chunk-76FLAFCG.js.map +6 -0
- package/dist/chunks/chunk-7WJOQ6EA.js +106 -0
- package/dist/chunks/chunk-7WJOQ6EA.js.map +6 -0
- package/dist/chunks/chunk-A22MBIYU.js +42 -0
- package/dist/chunks/chunk-A22MBIYU.js.map +6 -0
- package/dist/chunks/chunk-A5DWGNGR.js +73 -0
- package/dist/chunks/chunk-A5DWGNGR.js.map +6 -0
- package/dist/chunks/chunk-A5UXODFL.js +76 -0
- package/dist/chunks/chunk-A5UXODFL.js.map +6 -0
- package/dist/chunks/chunk-AHIDYIRB.js +329 -0
- package/dist/chunks/chunk-AHIDYIRB.js.map +6 -0
- package/dist/chunks/chunk-AIY4PCDR.js +164 -0
- package/dist/chunks/chunk-AIY4PCDR.js.map +6 -0
- package/dist/chunks/chunk-AK2U3N2A.js +31 -0
- package/dist/chunks/chunk-AK2U3N2A.js.map +6 -0
- package/dist/chunks/chunk-AN7FO7NS.js +247 -0
- package/dist/chunks/chunk-AN7FO7NS.js.map +6 -0
- package/dist/chunks/chunk-AXIGFKJF.js +34 -0
- package/dist/chunks/chunk-AXIGFKJF.js.map +6 -0
- package/dist/chunks/chunk-C5WBEO3X.js +46 -0
- package/dist/chunks/chunk-C5WBEO3X.js.map +6 -0
- package/dist/chunks/chunk-C5XYHYMX.js +675 -0
- package/dist/chunks/chunk-C5XYHYMX.js.map +6 -0
- package/dist/chunks/chunk-CG65NUSJ.js +115 -0
- package/dist/chunks/chunk-CG65NUSJ.js.map +6 -0
- package/dist/chunks/chunk-CHIEVVQ2.js +32 -0
- package/dist/chunks/chunk-CHIEVVQ2.js.map +6 -0
- package/dist/chunks/chunk-E5VLANCO.js +101 -0
- package/dist/chunks/chunk-E5VLANCO.js.map +6 -0
- package/dist/chunks/chunk-EBOHVFOB.js +648 -0
- package/dist/chunks/chunk-EBOHVFOB.js.map +6 -0
- package/dist/chunks/chunk-EEDZOGV4.js +47 -0
- package/dist/chunks/chunk-EEDZOGV4.js.map +6 -0
- package/dist/chunks/chunk-EIYM6TY7.js +1479 -0
- package/dist/chunks/chunk-EIYM6TY7.js.map +6 -0
- package/dist/chunks/chunk-EWKJGHRO.js +82559 -0
- package/dist/chunks/chunk-EWKJGHRO.js.map +6 -0
- package/dist/chunks/chunk-EY7UNVER.js +311 -0
- package/dist/chunks/chunk-EY7UNVER.js.map +6 -0
- package/dist/chunks/chunk-FTMTO72X.js +95 -0
- package/dist/chunks/chunk-FTMTO72X.js.map +6 -0
- package/dist/chunks/chunk-FXS3AG6B.js +25326 -0
- package/dist/chunks/chunk-FXS3AG6B.js.map +6 -0
- package/dist/chunks/chunk-GIXSS6KW.js +2228 -0
- package/dist/chunks/chunk-GIXSS6KW.js.map +6 -0
- package/dist/chunks/chunk-GMCOZ3CU.js +245 -0
- package/dist/chunks/chunk-GMCOZ3CU.js.map +6 -0
- package/dist/chunks/chunk-GNBMKISG.js +19 -0
- package/dist/chunks/chunk-GNBMKISG.js.map +6 -0
- package/dist/chunks/chunk-GWQEMJFS.js +28 -0
- package/dist/chunks/chunk-GWQEMJFS.js.map +6 -0
- package/dist/chunks/chunk-H6B6AROX.js +151 -0
- package/dist/chunks/chunk-H6B6AROX.js.map +6 -0
- package/dist/chunks/chunk-HBBB2CAC.js +75 -0
- package/dist/chunks/chunk-HBBB2CAC.js.map +6 -0
- package/dist/chunks/chunk-HE7WUOX2.js +26 -0
- package/dist/chunks/chunk-HE7WUOX2.js.map +6 -0
- package/dist/chunks/chunk-HFJHHCTY.js +303 -0
- package/dist/chunks/chunk-HFJHHCTY.js.map +6 -0
- package/dist/chunks/chunk-HPMWYIBY.js +773 -0
- package/dist/chunks/chunk-HPMWYIBY.js.map +6 -0
- package/dist/chunks/chunk-HQM2WSQT.js +106 -0
- package/dist/chunks/chunk-HQM2WSQT.js.map +6 -0
- package/dist/chunks/chunk-ITZK4B66.js +787 -0
- package/dist/chunks/chunk-ITZK4B66.js.map +6 -0
- package/dist/chunks/chunk-J72CRUNX.js +154 -0
- package/dist/chunks/chunk-J72CRUNX.js.map +6 -0
- package/dist/chunks/chunk-JORONMD3.js +18 -0
- package/dist/chunks/chunk-JORONMD3.js.map +6 -0
- package/dist/chunks/chunk-JPPC4LJF.js +271 -0
- package/dist/chunks/chunk-JPPC4LJF.js.map +6 -0
- package/dist/chunks/chunk-JV3LONAU.js +76 -0
- package/dist/chunks/chunk-JV3LONAU.js.map +6 -0
- package/dist/chunks/chunk-K76WV7TN.js +71 -0
- package/dist/chunks/chunk-K76WV7TN.js.map +6 -0
- package/dist/chunks/chunk-KCWUQRZV.js +828 -0
- package/dist/chunks/chunk-KCWUQRZV.js.map +6 -0
- package/dist/chunks/chunk-KONYGNG6.js +7661 -0
- package/dist/chunks/chunk-KONYGNG6.js.map +6 -0
- package/dist/chunks/chunk-KU3W6IHV.js +109 -0
- package/dist/chunks/chunk-KU3W6IHV.js.map +6 -0
- package/dist/chunks/chunk-LQMHASKR.js +171 -0
- package/dist/chunks/chunk-LQMHASKR.js.map +6 -0
- package/dist/chunks/chunk-LXB3S4IC.js +19 -0
- package/dist/chunks/chunk-LXB3S4IC.js.map +6 -0
- package/dist/chunks/chunk-MZP6SH3M.js +3497 -0
- package/dist/chunks/chunk-MZP6SH3M.js.map +6 -0
- package/dist/chunks/chunk-N5IF64K3.js +1858 -0
- package/dist/chunks/chunk-N5IF64K3.js.map +6 -0
- package/dist/chunks/chunk-NADQQMMG.js +46 -0
- package/dist/chunks/chunk-NADQQMMG.js.map +6 -0
- package/dist/chunks/chunk-NQY5P2EB.js +20 -0
- package/dist/chunks/chunk-NQY5P2EB.js.map +6 -0
- package/dist/chunks/chunk-NUGPLXVK.js +228 -0
- package/dist/chunks/chunk-NUGPLXVK.js.map +6 -0
- package/dist/chunks/chunk-O7DBCVNY.js +110 -0
- package/dist/chunks/chunk-O7DBCVNY.js.map +6 -0
- package/dist/chunks/chunk-OEW7CJKK.js +140 -0
- package/dist/chunks/chunk-OEW7CJKK.js.map +6 -0
- package/dist/chunks/chunk-OH6TB27S.js +111 -0
- package/dist/chunks/chunk-OH6TB27S.js.map +6 -0
- package/dist/chunks/chunk-OLPOM3DR.js +127 -0
- package/dist/chunks/chunk-OLPOM3DR.js.map +6 -0
- package/dist/chunks/chunk-PYG7DZ2D.js +380 -0
- package/dist/chunks/chunk-PYG7DZ2D.js.map +6 -0
- package/dist/chunks/chunk-Q24K7536.js +661 -0
- package/dist/chunks/chunk-Q24K7536.js.map +6 -0
- package/dist/chunks/chunk-Q5YM2GCX.js +283 -0
- package/dist/chunks/chunk-Q5YM2GCX.js.map +6 -0
- package/dist/chunks/chunk-R7DCDBRN.js +106 -0
- package/dist/chunks/chunk-R7DCDBRN.js.map +6 -0
- package/dist/chunks/chunk-RC6X3ZY6.js +1439 -0
- package/dist/chunks/chunk-RC6X3ZY6.js.map +6 -0
- package/dist/chunks/chunk-SGS435PR.js +11111 -0
- package/dist/chunks/chunk-SGS435PR.js.map +6 -0
- package/dist/chunks/chunk-SKKWMMFP.js +474 -0
- package/dist/chunks/chunk-SKKWMMFP.js.map +6 -0
- package/dist/chunks/chunk-SRU3MDHZ.js +75 -0
- package/dist/chunks/chunk-SRU3MDHZ.js.map +6 -0
- package/dist/chunks/chunk-TBIX6JRE.js +24 -0
- package/dist/chunks/chunk-TBIX6JRE.js.map +6 -0
- package/dist/chunks/chunk-THNCQJ33.js +11265 -0
- package/dist/chunks/chunk-THNCQJ33.js.map +6 -0
- package/dist/chunks/chunk-THZXXVHM.js +2953 -0
- package/dist/chunks/chunk-THZXXVHM.js.map +6 -0
- package/dist/chunks/chunk-TIGWWAJI.js +765 -0
- package/dist/chunks/chunk-TIGWWAJI.js.map +6 -0
- package/dist/chunks/chunk-UDBEU2FR.js +97 -0
- package/dist/chunks/chunk-UDBEU2FR.js.map +6 -0
- package/dist/chunks/chunk-UOOQPODR.js +257 -0
- package/dist/chunks/chunk-UOOQPODR.js.map +6 -0
- package/dist/chunks/chunk-US5ZFPAU.js +400 -0
- package/dist/chunks/chunk-US5ZFPAU.js.map +6 -0
- package/dist/chunks/chunk-UWWGSDZ5.js +134 -0
- package/dist/chunks/chunk-UWWGSDZ5.js.map +6 -0
- package/dist/chunks/chunk-UXVYJWN5.js +1373 -0
- package/dist/chunks/chunk-UXVYJWN5.js.map +6 -0
- package/dist/chunks/chunk-V7TQR6AR.js +818 -0
- package/dist/chunks/chunk-V7TQR6AR.js.map +6 -0
- package/dist/chunks/chunk-VRL2WNQN.js +7534 -0
- package/dist/chunks/chunk-VRL2WNQN.js.map +6 -0
- package/dist/chunks/chunk-WATMFOHB.js +319 -0
- package/dist/chunks/chunk-WATMFOHB.js.map +6 -0
- package/dist/chunks/chunk-WHODOMXA.js +132 -0
- package/dist/chunks/chunk-WHODOMXA.js.map +6 -0
- package/dist/chunks/chunk-WM2JEUGV.js +207 -0
- package/dist/chunks/chunk-WM2JEUGV.js.map +6 -0
- package/dist/chunks/chunk-XEUQN4JC.js +54 -0
- package/dist/chunks/chunk-XEUQN4JC.js.map +6 -0
- package/dist/chunks/chunk-XHOD3RDN.js +517 -0
- package/dist/chunks/chunk-XHOD3RDN.js.map +6 -0
- package/dist/chunks/chunk-Y7B67G22.js +26 -0
- package/dist/chunks/chunk-Y7B67G22.js.map +6 -0
- package/dist/chunks/chunk-ZKEWE6K4.js +399 -0
- package/dist/chunks/chunk-ZKEWE6K4.js.map +6 -0
- package/dist/chunks/chunk-ZPR4IMRT.js +36 -0
- package/dist/chunks/chunk-ZPR4IMRT.js.map +6 -0
- package/dist/chunks/chunk-ZWA2JRJV.js +45 -0
- package/dist/chunks/chunk-ZWA2JRJV.js.map +6 -0
- package/dist/chunks/cli-runtime-7YAOEJGS.js +129 -0
- package/dist/chunks/cli-runtime-7YAOEJGS.js.map +6 -0
- package/dist/chunks/commands-QPVRB3RK.js +21 -0
- package/dist/chunks/commands-QPVRB3RK.js.map +6 -0
- package/dist/chunks/computer-GXDY4H35.js +493 -0
- package/dist/chunks/computer-GXDY4H35.js.map +6 -0
- package/dist/chunks/crash-report-S3BTEPYR.js +21 -0
- package/dist/chunks/crash-report-S3BTEPYR.js.map +6 -0
- package/dist/chunks/devtools-LBE4PAQN.js +3851 -0
- package/dist/chunks/devtools-LBE4PAQN.js.map +6 -0
- package/dist/chunks/dist-3GJFRS2X.js +520 -0
- package/dist/chunks/dist-3GJFRS2X.js.map +6 -0
- package/dist/chunks/dist-BFC7XUCT.js +555 -0
- package/dist/chunks/dist-BFC7XUCT.js.map +6 -0
- package/dist/chunks/dist-ERN5DRKK.js +1415 -0
- package/dist/chunks/dist-ERN5DRKK.js.map +6 -0
- package/dist/chunks/dist-EY3OJBQH.js +1339 -0
- package/dist/chunks/dist-EY3OJBQH.js.map +6 -0
- package/dist/chunks/dist-G42HPNIE.js +514 -0
- package/dist/chunks/dist-G42HPNIE.js.map +6 -0
- package/dist/chunks/dist-SKRHHPUR.js +1018 -0
- package/dist/chunks/dist-SKRHHPUR.js.map +6 -0
- package/dist/chunks/dist-Z47L7ZAJ.js +40654 -0
- package/dist/chunks/dist-Z47L7ZAJ.js.map +6 -0
- package/dist/chunks/doctor-IE3PLXZK.js +28 -0
- package/dist/chunks/doctor-IE3PLXZK.js.map +6 -0
- package/dist/chunks/drain-ESXUKOE6.js +471 -0
- package/dist/chunks/drain-ESXUKOE6.js.map +6 -0
- package/dist/chunks/endpoint-M2DDENPP.js +15 -0
- package/dist/chunks/endpoint-M2DDENPP.js.map +6 -0
- package/dist/chunks/eval-53UONRWR.js +187 -0
- package/dist/chunks/eval-53UONRWR.js.map +6 -0
- package/dist/chunks/exec-COV235L5.js +1284 -0
- package/dist/chunks/exec-COV235L5.js.map +6 -0
- package/dist/chunks/home-QS7RBP34.js +16 -0
- package/dist/chunks/home-QS7RBP34.js.map +6 -0
- package/dist/chunks/host-queries-LDEBHKBX.js +152 -0
- package/dist/chunks/host-queries-LDEBHKBX.js.map +6 -0
- package/dist/chunks/lib-KXZZJJG2.js +2657 -0
- package/dist/chunks/lib-KXZZJJG2.js.map +6 -0
- package/dist/chunks/lifecycle-6NF6NJNV.js +63 -0
- package/dist/chunks/lifecycle-6NF6NJNV.js.map +6 -0
- package/dist/chunks/list-DQZU7NEF.js +293 -0
- package/dist/chunks/list-DQZU7NEF.js.map +6 -0
- package/dist/chunks/login-IQGNP5XY.js +29 -0
- package/dist/chunks/login-IQGNP5XY.js.map +6 -0
- package/dist/chunks/logs-KSG7SFAB.js +116 -0
- package/dist/chunks/logs-KSG7SFAB.js.map +6 -0
- package/dist/chunks/mcp-WFXKXGNM.js +763 -0
- package/dist/chunks/mcp-WFXKXGNM.js.map +6 -0
- package/dist/chunks/message-command-O7ZH4I4C.js +170 -0
- package/dist/chunks/message-command-O7ZH4I4C.js.map +6 -0
- package/dist/chunks/node-QB2FA2ZB.js +916 -0
- package/dist/chunks/node-QB2FA2ZB.js.map +6 -0
- package/dist/chunks/operator-tools-LTPV3CH5.js +115 -0
- package/dist/chunks/operator-tools-LTPV3CH5.js.map +6 -0
- package/dist/chunks/output-schema-UM3P5AOR.js +11 -0
- package/dist/chunks/output-schema-UM3P5AOR.js.map +6 -0
- package/dist/chunks/pal-GBYJHBP3.js +200 -0
- package/dist/chunks/pal-GBYJHBP3.js.map +6 -0
- package/dist/chunks/paths-DXYFKIJU.js +10 -0
- package/dist/chunks/paths-DXYFKIJU.js.map +6 -0
- package/dist/chunks/pica-WNHDDIFX.js +1736 -0
- package/dist/chunks/pica-WNHDDIFX.js.map +6 -0
- package/dist/chunks/providers-J42J2PDA.js +160 -0
- package/dist/chunks/providers-J42J2PDA.js.map +6 -0
- package/dist/chunks/resident-7D6IM5LP.js +1314 -0
- package/dist/chunks/resident-7D6IM5LP.js.map +6 -0
- package/dist/chunks/resume-command-XZWGUXRK.js +22 -0
- package/dist/chunks/resume-command-XZWGUXRK.js.map +6 -0
- package/dist/chunks/schedule-JLIOF3MS.js +143 -0
- package/dist/chunks/schedule-JLIOF3MS.js.map +6 -0
- package/dist/chunks/serve-S7UWNIR3.js +21 -0
- package/dist/chunks/serve-S7UWNIR3.js.map +6 -0
- package/dist/chunks/service-YBU5VTKQ.js +1633 -0
- package/dist/chunks/service-YBU5VTKQ.js.map +6 -0
- package/dist/chunks/session-step-2HJSIJNN.js +26 -0
- package/dist/chunks/session-step-2HJSIJNN.js.map +6 -0
- package/dist/chunks/skills-HV2MOBEW.js +282 -0
- package/dist/chunks/skills-HV2MOBEW.js.map +6 -0
- package/dist/chunks/state-6HV3D3O4.js +717 -0
- package/dist/chunks/state-6HV3D3O4.js.map +6 -0
- package/dist/chunks/store-6J2MUGON.js +82 -0
- package/dist/chunks/store-6J2MUGON.js.map +6 -0
- package/dist/chunks/store-GDP2EW27.js +34 -0
- package/dist/chunks/store-GDP2EW27.js.map +6 -0
- package/dist/chunks/store-VXNKMMNW.js +42 -0
- package/dist/chunks/store-VXNKMMNW.js.map +6 -0
- package/dist/chunks/tui-DDWX2WYH.js +56903 -0
- package/dist/chunks/tui-DDWX2WYH.js.map +6 -0
- package/dist/chunks/upgrade-MC5JB7DK.js +315 -0
- package/dist/chunks/upgrade-MC5JB7DK.js.map +6 -0
- package/dist/chunks/webapi-6HUHZUAH.js +2715 -0
- package/dist/chunks/webapi-6HUHZUAH.js.map +6 -0
- package/dist/chunks/worktree-6YPRX6SU.js +116 -0
- package/dist/chunks/worktree-6YPRX6SU.js.map +6 -0
- package/dist/cli-runtime.d.ts +19 -0
- package/dist/cli-runtime.d.ts.map +1 -0
- package/dist/cli.d.ts +0 -15
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/acp-harness.d.ts +64 -0
- package/dist/commands/acp-harness.d.ts.map +1 -0
- package/dist/commands/acp-provider-retry.d.ts +27 -0
- package/dist/commands/acp-provider-retry.d.ts.map +1 -0
- package/dist/commands/acp.d.ts +134 -3
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/computer.d.ts +3 -0
- package/dist/commands/computer.d.ts.map +1 -0
- package/dist/commands/desktop-host-changes.d.ts +65 -0
- package/dist/commands/desktop-host-changes.d.ts.map +1 -0
- package/dist/commands/desktop-host-header.d.ts +30 -0
- package/dist/commands/desktop-host-header.d.ts.map +1 -0
- package/dist/commands/desktop-host.d.ts +354 -0
- package/dist/commands/desktop-host.d.ts.map +1 -0
- package/dist/commands/desktop-model-catalogue.d.ts +25 -0
- package/dist/commands/desktop-model-catalogue.d.ts.map +1 -0
- package/dist/commands/effort-levels.d.ts +3 -0
- package/dist/commands/effort-levels.d.ts.map +1 -0
- package/dist/commands/exec-flags.d.ts +4 -0
- package/dist/commands/exec-flags.d.ts.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/lazy.d.ts +20 -0
- package/dist/commands/lazy.d.ts.map +1 -0
- package/dist/commands/manifest.d.ts +33 -0
- package/dist/commands/manifest.d.ts.map +1 -0
- package/dist/commands/pal.d.ts +5 -0
- package/dist/commands/pal.d.ts.map +1 -0
- package/dist/commands/permission-preview.d.ts +38 -0
- package/dist/commands/permission-preview.d.ts.map +1 -0
- package/dist/commands/registry.d.ts +10 -0
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/serve.d.ts +1 -12
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/stdin.d.ts.map +1 -1
- package/dist/commands/upgrade.d.ts +14 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/compile-cache-enable.d.ts +2 -0
- package/dist/compile-cache-enable.d.ts.map +1 -0
- package/dist/compile-cache.d.ts +53 -0
- package/dist/compile-cache.d.ts.map +1 -0
- package/dist/computer/bundle.d.ts +18 -0
- package/dist/computer/bundle.d.ts.map +1 -0
- package/dist/computer/run.d.ts +26 -0
- package/dist/computer/run.d.ts.map +1 -0
- package/dist/computer/sentences.d.ts +30 -0
- package/dist/computer/sentences.d.ts.map +1 -0
- package/dist/config/load.d.ts +10 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/context/capabilities.d.ts +25 -2
- package/dist/context/capabilities.d.ts.map +1 -1
- package/dist/context/runtime-message.d.ts.map +1 -1
- package/dist/crash-report.d.ts +22 -0
- package/dist/crash-report.d.ts.map +1 -0
- package/dist/debug-requested.d.ts +7 -0
- package/dist/debug-requested.d.ts.map +1 -0
- package/dist/doctor/checks/credentials.d.ts.map +1 -1
- package/dist/exit-codes.d.ts +9 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/index.js +105 -17
- package/dist/index.js.map +6 -1
- package/dist/integrations/harness/claude-adapter.d.ts +20 -0
- package/dist/integrations/harness/claude-adapter.d.ts.map +1 -0
- package/dist/integrations/harness/claude-protocol.d.ts +67 -0
- package/dist/integrations/harness/claude-protocol.d.ts.map +1 -0
- package/dist/integrations/harness/codex-adapter.d.ts +80 -0
- package/dist/integrations/harness/codex-adapter.d.ts.map +1 -0
- package/dist/integrations/harness/codex-protocol.d.ts +22 -0
- package/dist/integrations/harness/codex-protocol.d.ts.map +1 -0
- package/dist/integrations/harness/model-cache.d.ts +16 -0
- package/dist/integrations/harness/model-cache.d.ts.map +1 -0
- package/dist/integrations/harness/native-executable.d.ts +8 -0
- package/dist/integrations/harness/native-executable.d.ts.map +1 -0
- package/dist/integrations/harness/process.d.ts +25 -0
- package/dist/integrations/harness/process.d.ts.map +1 -0
- package/dist/integrations/peers/runtime.d.ts +64 -0
- package/dist/integrations/peers/runtime.d.ts.map +1 -0
- package/dist/integrations/plugins/inventory.d.ts +27 -0
- package/dist/integrations/plugins/inventory.d.ts.map +1 -0
- package/dist/integrations/providers/composer-settings.d.ts +33 -0
- package/dist/integrations/providers/composer-settings.d.ts.map +1 -0
- package/dist/integrations/providers/connections.d.ts +37 -0
- package/dist/integrations/providers/connections.d.ts.map +1 -0
- package/dist/integrations/providers/credential-store.d.ts +35 -0
- package/dist/integrations/providers/credential-store.d.ts.map +1 -1
- package/dist/integrations/providers/discover.d.ts +27 -1
- package/dist/integrations/providers/discover.d.ts.map +1 -1
- package/dist/integrations/providers/index.d.ts +2 -2
- package/dist/integrations/providers/index.d.ts.map +1 -1
- package/dist/integrations/providers/picker-operation.d.ts +6 -0
- package/dist/integrations/providers/picker-operation.d.ts.map +1 -0
- package/dist/integrations/providers/setup.d.ts +16 -1
- package/dist/integrations/providers/setup.d.ts.map +1 -1
- package/dist/integrations/resident/runner-worker.js +190 -161
- package/dist/integrations/resident/runner-worker.js.map +6 -1
- package/dist/integrations/sessions/display-title.d.ts +8 -0
- package/dist/integrations/sessions/display-title.d.ts.map +1 -1
- package/dist/integrations/sessions/store.d.ts +23 -9
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/task-context.d.ts +1 -1
- package/dist/integrations/sessions/task-context.d.ts.map +1 -1
- package/dist/integrations/sessions/transcript-export.d.ts.map +1 -1
- package/dist/integrations/subagents/activity.d.ts +9 -6
- package/dist/integrations/subagents/activity.d.ts.map +1 -1
- package/dist/integrations/subagents/operator-journal.d.ts +20 -0
- package/dist/integrations/subagents/operator-journal.d.ts.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +11 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/trust/store.d.ts +14 -0
- package/dist/integrations/trust/store.d.ts.map +1 -1
- package/dist/integrations/web/search.d.ts +1 -1
- package/dist/pals/actions.d.ts +57 -0
- package/dist/pals/actions.d.ts.map +1 -0
- package/dist/pals/activity-command.d.ts +3 -0
- package/dist/pals/activity-command.d.ts.map +1 -0
- package/dist/pals/activity.d.ts +18 -0
- package/dist/pals/activity.d.ts.map +1 -0
- package/dist/pals/agent-session.d.ts +19 -0
- package/dist/pals/agent-session.d.ts.map +1 -0
- package/dist/pals/channel-actions.d.ts +5 -0
- package/dist/pals/channel-actions.d.ts.map +1 -0
- package/dist/pals/channel-local.d.ts +7 -0
- package/dist/pals/channel-local.d.ts.map +1 -0
- package/dist/pals/channel.d.ts +20 -0
- package/dist/pals/channel.d.ts.map +1 -0
- package/dist/pals/chat.d.ts +6 -0
- package/dist/pals/chat.d.ts.map +1 -0
- package/dist/pals/communication.d.ts +47 -0
- package/dist/pals/communication.d.ts.map +1 -0
- package/dist/pals/conversations.d.ts +26 -0
- package/dist/pals/conversations.d.ts.map +1 -0
- package/dist/pals/desktop-communication.d.ts +111 -0
- package/dist/pals/desktop-communication.d.ts.map +1 -0
- package/dist/pals/dispatch.d.ts +13 -0
- package/dist/pals/dispatch.d.ts.map +1 -0
- package/dist/pals/environment.d.ts +103 -0
- package/dist/pals/environment.d.ts.map +1 -0
- package/dist/pals/guest-mcp-transport.d.ts +28 -0
- package/dist/pals/guest-mcp-transport.d.ts.map +1 -0
- package/dist/pals/guest-mcp.d.ts +22 -0
- package/dist/pals/guest-mcp.d.ts.map +1 -0
- package/dist/pals/inbox-start.d.ts +35 -0
- package/dist/pals/inbox-start.d.ts.map +1 -0
- package/dist/pals/message-command.d.ts +3 -0
- package/dist/pals/message-command.d.ts.map +1 -0
- package/dist/pals/operator-tools.d.ts +23 -0
- package/dist/pals/operator-tools.d.ts.map +1 -0
- package/dist/pals/public-transcript.d.ts +4 -0
- package/dist/pals/public-transcript.d.ts.map +1 -0
- package/dist/pals/review.d.ts +16 -0
- package/dist/pals/review.d.ts.map +1 -0
- package/dist/pals/store.d.ts +16 -0
- package/dist/pals/store.d.ts.map +1 -0
- package/dist/pals/tui-session.d.ts +11 -0
- package/dist/pals/tui-session.d.ts.map +1 -0
- package/dist/permissions/mode-names.d.ts +2 -0
- package/dist/permissions/mode-names.d.ts.map +1 -0
- package/dist/resume-invocation.d.ts +1 -1
- package/dist/resume-invocation.d.ts.map +1 -1
- package/dist/resume-shell.d.ts +8 -0
- package/dist/resume-shell.d.ts.map +1 -0
- package/dist/schedule/build.d.ts +12 -3
- package/dist/schedule/build.d.ts.map +1 -1
- package/dist/schedule/commands/add.d.ts +1 -1
- package/dist/schedule/commands/add.d.ts.map +1 -1
- package/dist/schedule/commands/lifecycle.d.ts.map +1 -1
- package/dist/schedule/commands/list.d.ts +3 -1
- package/dist/schedule/commands/list.d.ts.map +1 -1
- package/dist/schedule/daemon/daemon.d.ts +2 -0
- package/dist/schedule/daemon/daemon.d.ts.map +1 -1
- package/dist/schedule/delivery.d.ts +66 -0
- package/dist/schedule/delivery.d.ts.map +1 -0
- package/dist/schedule/fire/fire.d.ts +1 -1
- package/dist/schedule/fire/fire.d.ts.map +1 -1
- package/dist/schedule/fire/run-script.d.ts +2 -2
- package/dist/schedule/fire/run-script.d.ts.map +1 -1
- package/dist/schedule/fire/script-report.d.ts +31 -0
- package/dist/schedule/fire/script-report.d.ts.map +1 -0
- package/dist/schedule/floor.d.ts +1 -1
- package/dist/schedule/floor.d.ts.map +1 -1
- package/dist/schedule/folder.d.ts +6 -0
- package/dist/schedule/folder.d.ts.map +1 -1
- package/dist/schedule/resume-command.d.ts +3 -3
- package/dist/schedule/resume-command.d.ts.map +1 -1
- package/dist/schedule/store/history.d.ts.map +1 -1
- package/dist/schedule/store/jobs.d.ts +6 -6
- package/dist/schedule/store/jobs.d.ts.map +1 -1
- package/dist/schedule/store/script-state.d.ts +31 -0
- package/dist/schedule/store/script-state.d.ts.map +1 -0
- package/dist/schedule/store/state.d.ts +4 -2
- package/dist/schedule/store/state.d.ts.map +1 -1
- package/dist/schedule/types.d.ts +61 -16
- package/dist/schedule/types.d.ts.map +1 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/terminal/host.d.ts +22 -0
- package/dist/terminal/host.d.ts.map +1 -0
- package/dist/terminal/manager.d.ts +124 -0
- package/dist/terminal/manager.d.ts.map +1 -0
- package/dist/terminal/protocol.d.ts +162 -0
- package/dist/terminal/protocol.d.ts.map +1 -0
- package/dist/terminal/pty.d.ts +85 -0
- package/dist/terminal/pty.d.ts.map +1 -0
- package/dist/terminal/ring.d.ts +23 -0
- package/dist/terminal/ring.d.ts.map +1 -0
- package/dist/terminal/screen.d.ts +31 -0
- package/dist/terminal/screen.d.ts.map +1 -0
- package/dist/termination-state.d.ts +19 -0
- package/dist/termination-state.d.ts.map +1 -0
- package/dist/termination.d.ts +2 -9
- package/dist/termination.d.ts.map +1 -1
- package/dist/tui/AgentExplorer.d.ts +4 -1
- package/dist/tui/AgentExplorer.d.ts.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/BackgroundJobsPanel.d.ts.map +1 -1
- package/dist/tui/BrandHeader.d.ts.map +1 -1
- package/dist/tui/ChildComposer.d.ts +22 -0
- package/dist/tui/ChildComposer.d.ts.map +1 -0
- package/dist/tui/ChoicePicker.d.ts.map +1 -1
- package/dist/tui/Composer.d.ts +21 -3
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/ComposerFrame.d.ts.map +1 -1
- package/dist/tui/CopyPicker.d.ts.map +1 -1
- package/dist/tui/EditPromptPicker.d.ts.map +1 -1
- package/dist/tui/EffortSlider.d.ts.map +1 -1
- package/dist/tui/LiveActivity.d.ts +7 -1
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/PendingInputPanel.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/ProviderSetup.d.ts.map +1 -1
- package/dist/tui/ResumePicker.d.ts.map +1 -1
- package/dist/tui/SaveSkillOverlay.d.ts.map +1 -1
- package/dist/tui/ScheduleReviewOverlay.d.ts +1 -1
- package/dist/tui/ScheduleReviewOverlay.d.ts.map +1 -1
- package/dist/tui/StatusBar.d.ts +7 -1
- package/dist/tui/StatusBar.d.ts.map +1 -1
- package/dist/tui/StatusPanel.d.ts.map +1 -1
- package/dist/tui/TextPrompt.d.ts.map +1 -1
- package/dist/tui/ToolOutputViewer.d.ts.map +1 -1
- package/dist/tui/Transcript.d.ts +3 -0
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/TranscriptScrollView.d.ts +23 -0
- package/dist/tui/TranscriptScrollView.d.ts.map +1 -0
- package/dist/tui/TrustPrompt.d.ts +8 -0
- package/dist/tui/TrustPrompt.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +125 -3
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/browser-notices.d.ts.map +1 -1
- package/dist/tui/capability-notice.d.ts +38 -0
- package/dist/tui/capability-notice.d.ts.map +1 -0
- package/dist/tui/console-input.d.ts +31 -0
- package/dist/tui/console-input.d.ts.map +1 -0
- package/dist/tui/conversation-evidence-view.d.ts.map +1 -1
- package/dist/tui/credential-entry.d.ts.map +1 -1
- package/dist/tui/exit-summary.d.ts +9 -1
- package/dist/tui/exit-summary.d.ts.map +1 -1
- package/dist/tui/external-editor.d.ts.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/key-hints.d.ts +51 -0
- package/dist/tui/key-hints.d.ts.map +1 -0
- package/dist/tui/launch-settings.d.ts +34 -0
- package/dist/tui/launch-settings.d.ts.map +1 -0
- package/dist/tui/log-pane.d.ts.map +1 -1
- package/dist/tui/model-choices.d.ts +39 -1
- package/dist/tui/model-choices.d.ts.map +1 -1
- package/dist/tui/model-search.d.ts +4 -1
- package/dist/tui/model-search.d.ts.map +1 -1
- package/dist/tui/output-size-watch.d.ts +32 -0
- package/dist/tui/output-size-watch.d.ts.map +1 -0
- package/dist/tui/permission-review.d.ts.map +1 -1
- package/dist/tui/person-terms.d.ts +58 -0
- package/dist/tui/person-terms.d.ts.map +1 -0
- package/dist/tui/plain-failure.d.ts +27 -0
- package/dist/tui/plain-failure.d.ts.map +1 -0
- package/dist/tui/plain-interruption.d.ts +46 -0
- package/dist/tui/plain-interruption.d.ts.map +1 -0
- package/dist/tui/provider-list.d.ts.map +1 -1
- package/dist/tui/render-mode.d.ts +19 -0
- package/dist/tui/render-mode.d.ts.map +1 -0
- package/dist/tui/schedule/host-commands.d.ts +2 -9
- package/dist/tui/schedule/host-commands.d.ts.map +1 -1
- package/dist/tui/schedule/integration.d.ts +8 -0
- package/dist/tui/schedule/integration.d.ts.map +1 -1
- package/dist/tui/schedule/source-deliveries.d.ts +37 -0
- package/dist/tui/schedule/source-deliveries.d.ts.map +1 -0
- package/dist/tui/schedule/startup.d.ts.map +1 -1
- package/dist/tui/schedule/tool-host.d.ts +3 -1
- package/dist/tui/schedule/tool-host.d.ts.map +1 -1
- package/dist/tui/setup-text.d.ts +14 -0
- package/dist/tui/setup-text.d.ts.map +1 -0
- package/dist/tui/shell-escape.d.ts.map +1 -1
- package/dist/tui/skills/suggest-setting.d.ts.map +1 -1
- package/dist/tui/slashCommands.d.ts +4 -1
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/terminal-choice-text.d.ts +7 -0
- package/dist/tui/terminal-choice-text.d.ts.map +1 -1
- package/dist/tui/tidy-tool-output.d.ts +83 -0
- package/dist/tui/tidy-tool-output.d.ts.map +1 -0
- package/dist/tui/tool-presentation.d.ts +6 -0
- package/dist/tui/tool-presentation.d.ts.map +1 -0
- package/dist/tui/transcript-scroll.d.ts +73 -0
- package/dist/tui/transcript-scroll.d.ts.map +1 -0
- package/dist/tui/triggers/copy.d.ts.map +1 -1
- package/dist/tui/triggers/setting.d.ts.map +1 -1
- package/dist/tui/turn-interruption.d.ts +1 -1
- package/dist/tui/turn-interruption.d.ts.map +1 -1
- package/dist/tui/turn-limits-settings.d.ts +4 -4
- package/dist/tui/turn-limits-settings.d.ts.map +1 -1
- package/dist/tui/types.d.ts +10 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/web-activity.d.ts +3 -2
- package/dist/tui/web-activity.d.ts.map +1 -1
- package/dist/tui/zen-free-refusal.d.ts +17 -0
- package/dist/tui/zen-free-refusal.d.ts.map +1 -0
- package/dist/usage-error.d.ts +15 -0
- package/dist/usage-error.d.ts.map +1 -0
- package/dist/warning-filter.d.ts +30 -0
- package/dist/warning-filter.d.ts.map +1 -0
- package/package.json +21 -10
- package/skills/schedule-task/SKILL.md +74 -20
- package/dist/browser/commands.js +0 -365
- package/dist/browser/commands.js.map +0 -1
- package/dist/browser/control.js +0 -140
- package/dist/browser/control.js.map +0 -1
- package/dist/browser/describe.js +0 -27
- package/dist/browser/describe.js.map +0 -1
- package/dist/checkpoints/store.js +0 -192
- package/dist/checkpoints/store.js.map +0 -1
- package/dist/checkpoints/wrap.js +0 -37
- package/dist/checkpoints/wrap.js.map +0 -1
- package/dist/cli.js +0 -602
- package/dist/cli.js.map +0 -1
- package/dist/commands/acp.js +0 -388
- package/dist/commands/acp.js.map +0 -1
- package/dist/commands/archive.js +0 -65
- package/dist/commands/archive.js.map +0 -1
- package/dist/commands/browser.js +0 -16
- package/dist/commands/browser.js.map +0 -1
- package/dist/commands/doctor.js +0 -267
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/drain.js +0 -498
- package/dist/commands/drain.js.map +0 -1
- package/dist/commands/eval.js +0 -237
- package/dist/commands/eval.js.map +0 -1
- package/dist/commands/exec-flags.js +0 -334
- package/dist/commands/exec-flags.js.map +0 -1
- package/dist/commands/exec-json.js +0 -497
- package/dist/commands/exec-json.js.map +0 -1
- package/dist/commands/exec.js +0 -688
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/host-queries.js +0 -156
- package/dist/commands/host-queries.js.map +0 -1
- package/dist/commands/login.js +0 -315
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/mcp-oauth-login.js +0 -213
- package/dist/commands/mcp-oauth-login.js.map +0 -1
- package/dist/commands/mcp.js +0 -461
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/prior-messages.js +0 -329
- package/dist/commands/prior-messages.js.map +0 -1
- package/dist/commands/provider-wait.js +0 -65
- package/dist/commands/provider-wait.js.map +0 -1
- package/dist/commands/registry.js +0 -40
- package/dist/commands/registry.js.map +0 -1
- package/dist/commands/resident-flags.js +0 -193
- package/dist/commands/resident-flags.js.map +0 -1
- package/dist/commands/resident-learning.js +0 -293
- package/dist/commands/resident-learning.js.map +0 -1
- package/dist/commands/resident.js +0 -419
- package/dist/commands/resident.js.map +0 -1
- package/dist/commands/resume.js +0 -109
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/schedule.js +0 -131
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/serve.js +0 -21
- package/dist/commands/serve.js.map +0 -1
- package/dist/commands/skills.js +0 -178
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/state.js +0 -110
- package/dist/commands/state.js.map +0 -1
- package/dist/commands/stdin.js +0 -69
- package/dist/commands/stdin.js.map +0 -1
- package/dist/commands/types.js +0 -2
- package/dist/commands/types.js.map +0 -1
- package/dist/commands/upgrade-progress.js +0 -54
- package/dist/commands/upgrade-progress.js.map +0 -1
- package/dist/commands/upgrade.js +0 -232
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/worktree.js +0 -86
- package/dist/commands/worktree.js.map +0 -1
- package/dist/config/composer-triggers.js +0 -80
- package/dist/config/composer-triggers.js.map +0 -1
- package/dist/config/debug.js +0 -126
- package/dist/config/debug.js.map +0 -1
- package/dist/config/load.js +0 -1208
- package/dist/config/load.js.map +0 -1
- package/dist/config/schema.js +0 -13
- package/dist/config/schema.js.map +0 -1
- package/dist/config/tool-result-screens.js +0 -104
- package/dist/config/tool-result-screens.js.map +0 -1
- package/dist/config/trusted-project-context.js +0 -28
- package/dist/config/trusted-project-context.js.map +0 -1
- package/dist/config/turn-guards.js +0 -46
- package/dist/config/turn-guards.js.map +0 -1
- package/dist/config/user-config.js +0 -118
- package/dist/config/user-config.js.map +0 -1
- package/dist/context/capabilities.js +0 -164
- package/dist/context/capabilities.js.map +0 -1
- package/dist/context/directories.js +0 -69
- package/dist/context/directories.js.map +0 -1
- package/dist/context/doctrine.js +0 -24
- package/dist/context/doctrine.js.map +0 -1
- package/dist/context/environment.js +0 -255
- package/dist/context/environment.js.map +0 -1
- package/dist/context/project-path.js +0 -16
- package/dist/context/project-path.js.map +0 -1
- package/dist/context/project-tracker.js +0 -217
- package/dist/context/project-tracker.js.map +0 -1
- package/dist/context/project.js +0 -256
- package/dist/context/project.js.map +0 -1
- package/dist/context/runtime-message.js +0 -30
- package/dist/context/runtime-message.js.map +0 -1
- package/dist/context/sandbox.js +0 -114
- package/dist/context/sandbox.js.map +0 -1
- package/dist/context/turn-snapshot.js +0 -122
- package/dist/context/turn-snapshot.js.map +0 -1
- package/dist/doctor/checks/browser.js +0 -63
- package/dist/doctor/checks/browser.js.map +0 -1
- package/dist/doctor/checks/chain.js +0 -211
- package/dist/doctor/checks/chain.js.map +0 -1
- package/dist/doctor/checks/credentials.js +0 -98
- package/dist/doctor/checks/credentials.js.map +0 -1
- package/dist/doctor/checks/index.js +0 -72
- package/dist/doctor/checks/index.js.map +0 -1
- package/dist/doctor/checks/invariants.js +0 -79
- package/dist/doctor/checks/invariants.js.map +0 -1
- package/dist/doctor/checks/logging.js +0 -69
- package/dist/doctor/checks/logging.js.map +0 -1
- package/dist/doctor/checks/providers.js +0 -30
- package/dist/doctor/checks/providers.js.map +0 -1
- package/dist/doctor/checks/runtime.js +0 -40
- package/dist/doctor/checks/runtime.js.map +0 -1
- package/dist/doctor/checks/sandbox.js +0 -76
- package/dist/doctor/checks/sandbox.js.map +0 -1
- package/dist/doctor/checks/scheduler.js +0 -74
- package/dist/doctor/checks/scheduler.js.map +0 -1
- package/dist/doctor/checks/session-export.js +0 -62
- package/dist/doctor/checks/session-export.js.map +0 -1
- package/dist/doctor/checks/telemetry.js +0 -58
- package/dist/doctor/checks/telemetry.js.map +0 -1
- package/dist/doctor/checks/vault.js +0 -67
- package/dist/doctor/checks/vault.js.map +0 -1
- package/dist/doctor/index.js +0 -3
- package/dist/doctor/index.js.map +0 -1
- package/dist/doctor/registry.js +0 -230
- package/dist/doctor/registry.js.map +0 -1
- package/dist/exit-codes.js +0 -62
- package/dist/exit-codes.js.map +0 -1
- package/dist/installation.js +0 -48
- package/dist/installation.js.map +0 -1
- package/dist/integrations/clipboard/image.js +0 -119
- package/dist/integrations/clipboard/image.js.map +0 -1
- package/dist/integrations/clipboard/text.js +0 -43
- package/dist/integrations/clipboard/text.js.map +0 -1
- package/dist/integrations/files/attachment-store.js +0 -86
- package/dist/integrations/files/attachment-store.js.map +0 -1
- package/dist/integrations/mcp/oauth-store.js +0 -549
- package/dist/integrations/mcp/oauth-store.js.map +0 -1
- package/dist/integrations/mcp/servers.js +0 -611
- package/dist/integrations/mcp/servers.js.map +0 -1
- package/dist/integrations/mcp/user-config.js +0 -92
- package/dist/integrations/mcp/user-config.js.map +0 -1
- package/dist/integrations/notifications/desktop/freedesktop.js +0 -33
- package/dist/integrations/notifications/desktop/freedesktop.js.map +0 -1
- package/dist/integrations/notifications/desktop/macos.js +0 -17
- package/dist/integrations/notifications/desktop/macos.js.map +0 -1
- package/dist/integrations/notifications/desktop/sanitize.js +0 -49
- package/dist/integrations/notifications/desktop/sanitize.js.map +0 -1
- package/dist/integrations/notifications/desktop/throttle.js +0 -39
- package/dist/integrations/notifications/desktop/throttle.js.map +0 -1
- package/dist/integrations/notifications/desktop/windows-toast.js +0 -56
- package/dist/integrations/notifications/desktop/windows-toast.js.map +0 -1
- package/dist/integrations/notifications/desktop.js +0 -199
- package/dist/integrations/notifications/desktop.js.map +0 -1
- package/dist/integrations/notifications/terminal.js +0 -46
- package/dist/integrations/notifications/terminal.js.map +0 -1
- package/dist/integrations/npm-invocation.js +0 -23
- package/dist/integrations/npm-invocation.js.map +0 -1
- package/dist/integrations/plugins/runtime.js +0 -189
- package/dist/integrations/plugins/runtime.js.map +0 -1
- package/dist/integrations/plugins/settings.js +0 -106
- package/dist/integrations/plugins/settings.js.map +0 -1
- package/dist/integrations/providers/access.js +0 -23
- package/dist/integrations/providers/access.js.map +0 -1
- package/dist/integrations/providers/chain-capabilities.js +0 -211
- package/dist/integrations/providers/chain-capabilities.js.map +0 -1
- package/dist/integrations/providers/codex-device-login.js +0 -195
- package/dist/integrations/providers/codex-device-login.js.map +0 -1
- package/dist/integrations/providers/codex-oauth.js +0 -95
- package/dist/integrations/providers/codex-oauth.js.map +0 -1
- package/dist/integrations/providers/credential-provider.js +0 -74
- package/dist/integrations/providers/credential-provider.js.map +0 -1
- package/dist/integrations/providers/credential-store.js +0 -657
- package/dist/integrations/providers/credential-store.js.map +0 -1
- package/dist/integrations/providers/current-credential.js +0 -45
- package/dist/integrations/providers/current-credential.js.map +0 -1
- package/dist/integrations/providers/discover.js +0 -313
- package/dist/integrations/providers/discover.js.map +0 -1
- package/dist/integrations/providers/gemini-credentials.js +0 -148
- package/dist/integrations/providers/gemini-credentials.js.map +0 -1
- package/dist/integrations/providers/harness-credentials.js +0 -344
- package/dist/integrations/providers/harness-credentials.js.map +0 -1
- package/dist/integrations/providers/identity.js +0 -64
- package/dist/integrations/providers/identity.js.map +0 -1
- package/dist/integrations/providers/index.js +0 -14
- package/dist/integrations/providers/index.js.map +0 -1
- package/dist/integrations/providers/keychain.js +0 -78
- package/dist/integrations/providers/keychain.js.map +0 -1
- package/dist/integrations/providers/model-reasoning.js +0 -51
- package/dist/integrations/providers/model-reasoning.js.map +0 -1
- package/dist/integrations/providers/oauth.js +0 -302
- package/dist/integrations/providers/oauth.js.map +0 -1
- package/dist/integrations/providers/preferences.js +0 -287
- package/dist/integrations/providers/preferences.js.map +0 -1
- package/dist/integrations/providers/register.js +0 -154
- package/dist/integrations/providers/register.js.map +0 -1
- package/dist/integrations/providers/registry.js +0 -289
- package/dist/integrations/providers/registry.js.map +0 -1
- package/dist/integrations/providers/setup.js +0 -158
- package/dist/integrations/providers/setup.js.map +0 -1
- package/dist/integrations/providers/subscription-login.js +0 -328
- package/dist/integrations/providers/subscription-login.js.map +0 -1
- package/dist/integrations/providers/zen-catalogue.js +0 -196
- package/dist/integrations/providers/zen-catalogue.js.map +0 -1
- package/dist/integrations/resident/foreground.js +0 -95
- package/dist/integrations/resident/foreground.js.map +0 -1
- package/dist/integrations/resident/inspection.js +0 -282
- package/dist/integrations/resident/inspection.js.map +0 -1
- package/dist/integrations/resident/learning-sources.js +0 -79
- package/dist/integrations/resident/learning-sources.js.map +0 -1
- package/dist/integrations/resident/learning-storage.js +0 -55
- package/dist/integrations/resident/learning-storage.js.map +0 -1
- package/dist/integrations/resident/lifecycle-errors.js +0 -15
- package/dist/integrations/resident/lifecycle-errors.js.map +0 -1
- package/dist/integrations/resident/owned-runner.js +0 -91
- package/dist/integrations/resident/owned-runner.js.map +0 -1
- package/dist/integrations/resident/runner-control.js +0 -238
- package/dist/integrations/resident/runner-control.js.map +0 -1
- package/dist/integrations/resident/runner-launch.js +0 -142
- package/dist/integrations/resident/runner-launch.js.map +0 -1
- package/dist/integrations/resident/runner-store.js +0 -284
- package/dist/integrations/resident/runner-store.js.map +0 -1
- package/dist/integrations/resident/session-log-reads.js +0 -125
- package/dist/integrations/resident/session-log-reads.js.map +0 -1
- package/dist/integrations/resident/session-step.js +0 -476
- package/dist/integrations/resident/session-step.js.map +0 -1
- package/dist/integrations/resident/storage.js +0 -183
- package/dist/integrations/resident/storage.js.map +0 -1
- package/dist/integrations/resident/tool-evidence.js +0 -123
- package/dist/integrations/resident/tool-evidence.js.map +0 -1
- package/dist/integrations/resident/verification.js +0 -109
- package/dist/integrations/resident/verification.js.map +0 -1
- package/dist/integrations/sessions/checkpoint-view.js +0 -48
- package/dist/integrations/sessions/checkpoint-view.js.map +0 -1
- package/dist/integrations/sessions/context-inventory.js +0 -44
- package/dist/integrations/sessions/context-inventory.js.map +0 -1
- package/dist/integrations/sessions/conversation-search.js +0 -572
- package/dist/integrations/sessions/conversation-search.js.map +0 -1
- package/dist/integrations/sessions/display-title.js +0 -5
- package/dist/integrations/sessions/display-title.js.map +0 -1
- package/dist/integrations/sessions/evidence-page-validation.js +0 -74
- package/dist/integrations/sessions/evidence-page-validation.js.map +0 -1
- package/dist/integrations/sessions/evidence-recall.js +0 -117
- package/dist/integrations/sessions/evidence-recall.js.map +0 -1
- package/dist/integrations/sessions/store.js +0 -780
- package/dist/integrations/sessions/store.js.map +0 -1
- package/dist/integrations/sessions/task-context.js +0 -96
- package/dist/integrations/sessions/task-context.js.map +0 -1
- package/dist/integrations/sessions/transcript-export.js +0 -342
- package/dist/integrations/sessions/transcript-export.js.map +0 -1
- package/dist/integrations/state/home.js +0 -17
- package/dist/integrations/state/home.js.map +0 -1
- package/dist/integrations/state/identity.js +0 -49
- package/dist/integrations/state/identity.js.map +0 -1
- package/dist/integrations/state/immutable-json.js +0 -38
- package/dist/integrations/state/immutable-json.js.map +0 -1
- package/dist/integrations/state/private-directory.js +0 -43
- package/dist/integrations/state/private-directory.js.map +0 -1
- package/dist/integrations/state/project.js +0 -13
- package/dist/integrations/state/project.js.map +0 -1
- package/dist/integrations/state/report.js +0 -626
- package/dist/integrations/state/report.js.map +0 -1
- package/dist/integrations/state/retention.js +0 -18
- package/dist/integrations/state/retention.js.map +0 -1
- package/dist/integrations/subagents/NamzuCliAgent.js +0 -9
- package/dist/integrations/subagents/NamzuCliAgent.js.map +0 -1
- package/dist/integrations/subagents/activity.js +0 -759
- package/dist/integrations/subagents/activity.js.map +0 -1
- package/dist/integrations/subagents/batches.js +0 -172
- package/dist/integrations/subagents/batches.js.map +0 -1
- package/dist/integrations/subagents/definitions.js +0 -26
- package/dist/integrations/subagents/definitions.js.map +0 -1
- package/dist/integrations/subagents/model-effort.js +0 -12
- package/dist/integrations/subagents/model-effort.js.map +0 -1
- package/dist/integrations/subagents/parent.js +0 -47
- package/dist/integrations/subagents/parent.js.map +0 -1
- package/dist/integrations/subagents/policy.js +0 -3
- package/dist/integrations/subagents/policy.js.map +0 -1
- package/dist/integrations/subagents/replay.js +0 -295
- package/dist/integrations/subagents/replay.js.map +0 -1
- package/dist/integrations/subagents/runtime.js +0 -1317
- package/dist/integrations/subagents/runtime.js.map +0 -1
- package/dist/integrations/subagents/saved-agents.js +0 -102
- package/dist/integrations/subagents/saved-agents.js.map +0 -1
- package/dist/integrations/subagents/slash.js +0 -45
- package/dist/integrations/subagents/slash.js.map +0 -1
- package/dist/integrations/subagents/worktree-driver.js +0 -72
- package/dist/integrations/subagents/worktree-driver.js.map +0 -1
- package/dist/integrations/telemetry/session-export.js +0 -119
- package/dist/integrations/telemetry/session-export.js.map +0 -1
- package/dist/integrations/trust/store.js +0 -73
- package/dist/integrations/trust/store.js.map +0 -1
- package/dist/integrations/updates.js +0 -115
- package/dist/integrations/updates.js.map +0 -1
- package/dist/integrations/web/exa-search.js +0 -154
- package/dist/integrations/web/exa-search.js.map +0 -1
- package/dist/integrations/web/open-url.js +0 -73
- package/dist/integrations/web/open-url.js.map +0 -1
- package/dist/integrations/web/search.js +0 -68
- package/dist/integrations/web/search.js.map +0 -1
- package/dist/integrations/worktrees/managed.js +0 -231
- package/dist/integrations/worktrees/managed.js.map +0 -1
- package/dist/logging.js +0 -115
- package/dist/logging.js.map +0 -1
- package/dist/memory/io.js +0 -177
- package/dist/memory/io.js.map +0 -1
- package/dist/memory/presentation.js +0 -76
- package/dist/memory/presentation.js.map +0 -1
- package/dist/memory/store.js +0 -180
- package/dist/memory/store.js.map +0 -1
- package/dist/memory/typed.js +0 -336
- package/dist/memory/typed.js.map +0 -1
- package/dist/output/formatter.js +0 -16
- package/dist/output/formatter.js.map +0 -1
- package/dist/output/index.js +0 -22
- package/dist/output/index.js.map +0 -1
- package/dist/output/json.js +0 -51
- package/dist/output/json.js.map +0 -1
- package/dist/output/text.js +0 -50
- package/dist/output/text.js.map +0 -1
- package/dist/output/yaml.js +0 -26
- package/dist/output/yaml.js.map +0 -1
- package/dist/output-schema.js +0 -18
- package/dist/output-schema.js.map +0 -1
- package/dist/permissions/browser-sites.js +0 -270
- package/dist/permissions/browser-sites.js.map +0 -1
- package/dist/permissions/canonical-project.js +0 -13
- package/dist/permissions/canonical-project.js.map +0 -1
- package/dist/permissions/checks.js +0 -128
- package/dist/permissions/checks.js.map +0 -1
- package/dist/permissions/headless-trust.js +0 -86
- package/dist/permissions/headless-trust.js.map +0 -1
- package/dist/permissions/live-mode.js +0 -62
- package/dist/permissions/live-mode.js.map +0 -1
- package/dist/permissions/mode.js +0 -65
- package/dist/permissions/mode.js.map +0 -1
- package/dist/permissions/rules.js +0 -358
- package/dist/permissions/rules.js.map +0 -1
- package/dist/release-notes.js +0 -64
- package/dist/release-notes.js.map +0 -1
- package/dist/resume-invocation.js +0 -24
- package/dist/resume-invocation.js.map +0 -1
- package/dist/schedule/build.js +0 -374
- package/dist/schedule/build.js.map +0 -1
- package/dist/schedule/changes.js +0 -78
- package/dist/schedule/changes.js.map +0 -1
- package/dist/schedule/commands/add.js +0 -603
- package/dist/schedule/commands/add.js.map +0 -1
- package/dist/schedule/commands/args.js +0 -80
- package/dist/schedule/commands/args.js.map +0 -1
- package/dist/schedule/commands/confirm-prompt.js +0 -21
- package/dist/schedule/commands/confirm-prompt.js.map +0 -1
- package/dist/schedule/commands/lifecycle.js +0 -586
- package/dist/schedule/commands/lifecycle.js.map +0 -1
- package/dist/schedule/commands/list.js +0 -260
- package/dist/schedule/commands/list.js.map +0 -1
- package/dist/schedule/commands/logs.js +0 -106
- package/dist/schedule/commands/logs.js.map +0 -1
- package/dist/schedule/commands/service.js +0 -458
- package/dist/schedule/commands/service.js.map +0 -1
- package/dist/schedule/daemon/daemon.js +0 -1265
- package/dist/schedule/daemon/daemon.js.map +0 -1
- package/dist/schedule/daemon/endpoint.js +0 -158
- package/dist/schedule/daemon/endpoint.js.map +0 -1
- package/dist/schedule/daemon/exit.js +0 -8
- package/dist/schedule/daemon/exit.js.map +0 -1
- package/dist/schedule/daemon/log.js +0 -53
- package/dist/schedule/daemon/log.js.map +0 -1
- package/dist/schedule/daemon/notify.js +0 -158
- package/dist/schedule/daemon/notify.js.map +0 -1
- package/dist/schedule/daemon/retention.js +0 -46
- package/dist/schedule/daemon/retention.js.map +0 -1
- package/dist/schedule/daemon/sessions.js +0 -52
- package/dist/schedule/daemon/sessions.js.map +0 -1
- package/dist/schedule/env.js +0 -106
- package/dist/schedule/env.js.map +0 -1
- package/dist/schedule/fire/browser-preflight.js +0 -73
- package/dist/schedule/fire/browser-preflight.js.map +0 -1
- package/dist/schedule/fire/calls.js +0 -114
- package/dist/schedule/fire/calls.js.map +0 -1
- package/dist/schedule/fire/fire.js +0 -681
- package/dist/schedule/fire/fire.js.map +0 -1
- package/dist/schedule/fire/result.js +0 -19
- package/dist/schedule/fire/result.js.map +0 -1
- package/dist/schedule/fire/run-script.js +0 -81
- package/dist/schedule/fire/run-script.js.map +0 -1
- package/dist/schedule/fire/unattended-note.js +0 -51
- package/dist/schedule/fire/unattended-note.js.map +0 -1
- package/dist/schedule/fire/wake-gate.js +0 -90
- package/dist/schedule/fire/wake-gate.js.map +0 -1
- package/dist/schedule/floor.js +0 -1561
- package/dist/schedule/floor.js.map +0 -1
- package/dist/schedule/folder.js +0 -84
- package/dist/schedule/folder.js.map +0 -1
- package/dist/schedule/paths.js +0 -53
- package/dist/schedule/paths.js.map +0 -1
- package/dist/schedule/policy.js +0 -414
- package/dist/schedule/policy.js.map +0 -1
- package/dist/schedule/resume-command.js +0 -72
- package/dist/schedule/resume-command.js.map +0 -1
- package/dist/schedule/script-check.js +0 -146
- package/dist/schedule/script-check.js.map +0 -1
- package/dist/schedule/script-shell.js +0 -5
- package/dist/schedule/script-shell.js.map +0 -1
- package/dist/schedule/service/detect.js +0 -29
- package/dist/schedule/service/detect.js.map +0 -1
- package/dist/schedule/service/index.js +0 -361
- package/dist/schedule/service/index.js.map +0 -1
- package/dist/schedule/service/launchd.js +0 -84
- package/dist/schedule/service/launchd.js.map +0 -1
- package/dist/schedule/service/manifest.js +0 -16
- package/dist/schedule/service/manifest.js.map +0 -1
- package/dist/schedule/service/names.js +0 -22
- package/dist/schedule/service/names.js.map +0 -1
- package/dist/schedule/service/quote.js +0 -64
- package/dist/schedule/service/quote.js.map +0 -1
- package/dist/schedule/service/runner.js +0 -31
- package/dist/schedule/service/runner.js.map +0 -1
- package/dist/schedule/service/systemd.js +0 -96
- package/dist/schedule/service/systemd.js.map +0 -1
- package/dist/schedule/service/windows-task.js +0 -199
- package/dist/schedule/service/windows-task.js.map +0 -1
- package/dist/schedule/service/wsl.js +0 -121
- package/dist/schedule/service/wsl.js.map +0 -1
- package/dist/schedule/store/atomic.js +0 -138
- package/dist/schedule/store/atomic.js.map +0 -1
- package/dist/schedule/store/claims.js +0 -57
- package/dist/schedule/store/claims.js.map +0 -1
- package/dist/schedule/store/digest.js +0 -139
- package/dist/schedule/store/digest.js.map +0 -1
- package/dist/schedule/store/history.js +0 -117
- package/dist/schedule/store/history.js.map +0 -1
- package/dist/schedule/store/jobs.js +0 -277
- package/dist/schedule/store/jobs.js.map +0 -1
- package/dist/schedule/store/state.js +0 -38
- package/dist/schedule/store/state.js.map +0 -1
- package/dist/schedule/types.js +0 -33
- package/dist/schedule/types.js.map +0 -1
- package/dist/schedule/visible-source.js +0 -59
- package/dist/schedule/visible-source.js.map +0 -1
- package/dist/skills/audit.js +0 -75
- package/dist/skills/audit.js.map +0 -1
- package/dist/skills/catalog.js +0 -226
- package/dist/skills/catalog.js.map +0 -1
- package/dist/skills/directory.js +0 -51
- package/dist/skills/directory.js.map +0 -1
- package/dist/skills/save.js +0 -344
- package/dist/skills/save.js.map +0 -1
- package/dist/skills/store.js +0 -351
- package/dist/skills/store.js.map +0 -1
- package/dist/termination.js +0 -143
- package/dist/termination.js.map +0 -1
- package/dist/test-support/toolset.js +0 -27
- package/dist/test-support/toolset.js.map +0 -1
- package/dist/tui/AgentExplorer.js +0 -789
- package/dist/tui/AgentExplorer.js.map +0 -1
- package/dist/tui/App.js +0 -8499
- package/dist/tui/App.js.map +0 -1
- package/dist/tui/BackgroundJobsPanel.js +0 -129
- package/dist/tui/BackgroundJobsPanel.js.map +0 -1
- package/dist/tui/BrandHeader.js +0 -14
- package/dist/tui/BrandHeader.js.map +0 -1
- package/dist/tui/Checklist.js +0 -90
- package/dist/tui/Checklist.js.map +0 -1
- package/dist/tui/ChoicePicker.js +0 -64
- package/dist/tui/ChoicePicker.js.map +0 -1
- package/dist/tui/Composer.js +0 -939
- package/dist/tui/Composer.js.map +0 -1
- package/dist/tui/ComposerFrame.js +0 -79
- package/dist/tui/ComposerFrame.js.map +0 -1
- package/dist/tui/CopyPicker.js +0 -19
- package/dist/tui/CopyPicker.js.map +0 -1
- package/dist/tui/EditPromptPicker.js +0 -17
- package/dist/tui/EditPromptPicker.js.map +0 -1
- package/dist/tui/EffortSlider.js +0 -134
- package/dist/tui/EffortSlider.js.map +0 -1
- package/dist/tui/LiveActivity.js +0 -89
- package/dist/tui/LiveActivity.js.map +0 -1
- package/dist/tui/Markdown.js +0 -137
- package/dist/tui/Markdown.js.map +0 -1
- package/dist/tui/PendingInputPanel.js +0 -108
- package/dist/tui/PendingInputPanel.js.map +0 -1
- package/dist/tui/PermissionOverlay.js +0 -278
- package/dist/tui/PermissionOverlay.js.map +0 -1
- package/dist/tui/Picker.js +0 -1310
- package/dist/tui/Picker.js.map +0 -1
- package/dist/tui/ProviderSetup.js +0 -125
- package/dist/tui/ProviderSetup.js.map +0 -1
- package/dist/tui/ResumePicker.js +0 -34
- package/dist/tui/ResumePicker.js.map +0 -1
- package/dist/tui/SaveSkillOverlay.js +0 -118
- package/dist/tui/SaveSkillOverlay.js.map +0 -1
- package/dist/tui/ScheduleReviewOverlay.js +0 -166
- package/dist/tui/ScheduleReviewOverlay.js.map +0 -1
- package/dist/tui/StatusBar.js +0 -182
- package/dist/tui/StatusBar.js.map +0 -1
- package/dist/tui/StatusPanel.js +0 -11
- package/dist/tui/StatusPanel.js.map +0 -1
- package/dist/tui/TaskList.js +0 -43
- package/dist/tui/TaskList.js.map +0 -1
- package/dist/tui/TextPrompt.js +0 -185
- package/dist/tui/TextPrompt.js.map +0 -1
- package/dist/tui/ToolOutputViewer.js +0 -39
- package/dist/tui/ToolOutputViewer.js.map +0 -1
- package/dist/tui/Transcript.js +0 -235
- package/dist/tui/Transcript.js.map +0 -1
- package/dist/tui/TrustPrompt.js +0 -13
- package/dist/tui/TrustPrompt.js.map +0 -1
- package/dist/tui/ViewportBound.js +0 -55
- package/dist/tui/ViewportBound.js.map +0 -1
- package/dist/tui/agent-transcript-rows.js +0 -115
- package/dist/tui/agent-transcript-rows.js.map +0 -1
- package/dist/tui/agent.js +0 -4301
- package/dist/tui/agent.js.map +0 -1
- package/dist/tui/browser-notices.js +0 -107
- package/dist/tui/browser-notices.js.map +0 -1
- package/dist/tui/choice-selection.js +0 -38
- package/dist/tui/choice-selection.js.map +0 -1
- package/dist/tui/compact-transcript.js +0 -46
- package/dist/tui/compact-transcript.js.map +0 -1
- package/dist/tui/consent-timing.js +0 -48
- package/dist/tui/consent-timing.js.map +0 -1
- package/dist/tui/conversation-evidence-view.js +0 -96
- package/dist/tui/conversation-evidence-view.js.map +0 -1
- package/dist/tui/conversation-history.js +0 -33
- package/dist/tui/conversation-history.js.map +0 -1
- package/dist/tui/copy-targets.js +0 -189
- package/dist/tui/copy-targets.js.map +0 -1
- package/dist/tui/credential-entry.js +0 -134
- package/dist/tui/credential-entry.js.map +0 -1
- package/dist/tui/edit-prompts.js +0 -35
- package/dist/tui/edit-prompts.js.map +0 -1
- package/dist/tui/exit-summary.js +0 -30
- package/dist/tui/exit-summary.js.map +0 -1
- package/dist/tui/external-editor.js +0 -169
- package/dist/tui/external-editor.js.map +0 -1
- package/dist/tui/hypermode.js +0 -58
- package/dist/tui/hypermode.js.map +0 -1
- package/dist/tui/index.js +0 -81
- package/dist/tui/index.js.map +0 -1
- package/dist/tui/live-window.js +0 -281
- package/dist/tui/live-window.js.map +0 -1
- package/dist/tui/log-pane.js +0 -100
- package/dist/tui/log-pane.js.map +0 -1
- package/dist/tui/login-prompt.js +0 -105
- package/dist/tui/login-prompt.js.map +0 -1
- package/dist/tui/logo.js +0 -9
- package/dist/tui/logo.js.map +0 -1
- package/dist/tui/markdown-block-cache.js +0 -76
- package/dist/tui/markdown-block-cache.js.map +0 -1
- package/dist/tui/markdown-table.js +0 -175
- package/dist/tui/markdown-table.js.map +0 -1
- package/dist/tui/markdown-wrap.js +0 -189
- package/dist/tui/markdown-wrap.js.map +0 -1
- package/dist/tui/markdownParser.js +0 -237
- package/dist/tui/markdownParser.js.map +0 -1
- package/dist/tui/mentions.js +0 -150
- package/dist/tui/mentions.js.map +0 -1
- package/dist/tui/model-catalogue-view.js +0 -75
- package/dist/tui/model-catalogue-view.js.map +0 -1
- package/dist/tui/model-choices.js +0 -157
- package/dist/tui/model-choices.js.map +0 -1
- package/dist/tui/model-search.js +0 -28
- package/dist/tui/model-search.js.map +0 -1
- package/dist/tui/model-selection-intent.js +0 -96
- package/dist/tui/model-selection-intent.js.map +0 -1
- package/dist/tui/model-switch-tool.js +0 -74
- package/dist/tui/model-switch-tool.js.map +0 -1
- package/dist/tui/model-switch.js +0 -106
- package/dist/tui/model-switch.js.map +0 -1
- package/dist/tui/notices.js +0 -27
- package/dist/tui/notices.js.map +0 -1
- package/dist/tui/open-browser.js +0 -147
- package/dist/tui/open-browser.js.map +0 -1
- package/dist/tui/permission-review.js +0 -858
- package/dist/tui/permission-review.js.map +0 -1
- package/dist/tui/plugin-view.js +0 -59
- package/dist/tui/plugin-view.js.map +0 -1
- package/dist/tui/provider-list.js +0 -327
- package/dist/tui/provider-list.js.map +0 -1
- package/dist/tui/provider-selection.js +0 -16
- package/dist/tui/provider-selection.js.map +0 -1
- package/dist/tui/schedule/host-commands.js +0 -428
- package/dist/tui/schedule/host-commands.js.map +0 -1
- package/dist/tui/schedule/integration.js +0 -150
- package/dist/tui/schedule/integration.js.map +0 -1
- package/dist/tui/schedule/loop-host.js +0 -153
- package/dist/tui/schedule/loop-host.js.map +0 -1
- package/dist/tui/schedule/resume.js +0 -333
- package/dist/tui/schedule/resume.js.map +0 -1
- package/dist/tui/schedule/startup.js +0 -121
- package/dist/tui/schedule/startup.js.map +0 -1
- package/dist/tui/schedule/tool-host.js +0 -619
- package/dist/tui/schedule/tool-host.js.map +0 -1
- package/dist/tui/selection-window.js +0 -37
- package/dist/tui/selection-window.js.map +0 -1
- package/dist/tui/shell-escape.js +0 -110
- package/dist/tui/shell-escape.js.map +0 -1
- package/dist/tui/skills/learning.js +0 -131
- package/dist/tui/skills/learning.js.map +0 -1
- package/dist/tui/skills/suggest-setting.js +0 -55
- package/dist/tui/skills/suggest-setting.js.map +0 -1
- package/dist/tui/skills/suggestion-ledger.js +0 -52
- package/dist/tui/skills/suggestion-ledger.js.map +0 -1
- package/dist/tui/slashCommands.js +0 -1588
- package/dist/tui/slashCommands.js.map +0 -1
- package/dist/tui/status-card.js +0 -30
- package/dist/tui/status-card.js.map +0 -1
- package/dist/tui/status-panel-layout.js +0 -42
- package/dist/tui/status-panel-layout.js.map +0 -1
- package/dist/tui/stream-blocks.js +0 -187
- package/dist/tui/stream-blocks.js.map +0 -1
- package/dist/tui/task-activity.js +0 -157
- package/dist/tui/task-activity.js.map +0 -1
- package/dist/tui/terminal-choice-text.js +0 -118
- package/dist/tui/terminal-choice-text.js.map +0 -1
- package/dist/tui/terminal-display.js +0 -65
- package/dist/tui/terminal-display.js.map +0 -1
- package/dist/tui/terminal-hyperlinks.js +0 -70
- package/dist/tui/terminal-hyperlinks.js.map +0 -1
- package/dist/tui/theme.js +0 -34
- package/dist/tui/theme.js.map +0 -1
- package/dist/tui/triggers/analyze.js +0 -221
- package/dist/tui/triggers/analyze.js.map +0 -1
- package/dist/tui/triggers/context-text.js +0 -44
- package/dist/tui/triggers/context-text.js.map +0 -1
- package/dist/tui/triggers/copy.js +0 -163
- package/dist/tui/triggers/copy.js.map +0 -1
- package/dist/tui/triggers/detect.js +0 -295
- package/dist/tui/triggers/detect.js.map +0 -1
- package/dist/tui/triggers/fold.js +0 -44
- package/dist/tui/triggers/fold.js.map +0 -1
- package/dist/tui/triggers/pattern.js +0 -243
- package/dist/tui/triggers/pattern.js.map +0 -1
- package/dist/tui/triggers/provenance.js +0 -98
- package/dist/tui/triggers/provenance.js.map +0 -1
- package/dist/tui/triggers/registry.js +0 -164
- package/dist/tui/triggers/registry.js.map +0 -1
- package/dist/tui/triggers/setting.js +0 -61
- package/dist/tui/triggers/setting.js.map +0 -1
- package/dist/tui/triggers/verbs.js +0 -140
- package/dist/tui/triggers/verbs.js.map +0 -1
- package/dist/tui/turn-interruption.js +0 -160
- package/dist/tui/turn-interruption.js.map +0 -1
- package/dist/tui/turn-limits-settings.js +0 -88
- package/dist/tui/turn-limits-settings.js.map +0 -1
- package/dist/tui/types.js +0 -7
- package/dist/tui/types.js.map +0 -1
- package/dist/tui/units.js +0 -20
- package/dist/tui/units.js.map +0 -1
- package/dist/tui/use-selection-index.js +0 -13
- package/dist/tui/use-selection-index.js.map +0 -1
- package/dist/tui/web-activity.js +0 -105
- package/dist/tui/web-activity.js.map +0 -1
- package/dist/tui/workspace-diff.js +0 -101
- package/dist/tui/workspace-diff.js.map +0 -1
- package/dist/tui/workspace-review.js +0 -67
- package/dist/tui/workspace-review.js.map +0 -1
- package/dist/user-commands/store.js +0 -235
- package/dist/user-commands/store.js.map +0 -1
- package/dist/version.js +0 -23
- package/dist/version.js.map +0 -1
|
@@ -1,1265 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The scheduler daemon: one per `NAMZU_HOME`, started by a user service.
|
|
3
|
-
*
|
|
4
|
-
* ## One owner
|
|
5
|
-
*
|
|
6
|
-
* Ownership is a fenced lease in `schedule/daemon/` — the session lease's own
|
|
7
|
-
* store, `lease.<fence>.json` published with `link`, the highest fence owning,
|
|
8
|
-
* renewed every 30 s with a 90 s expiry. A second daemon does not exit (a
|
|
9
|
-
* supervisor would restart it in a loop): it waits on standby and takes a new
|
|
10
|
-
* fence when the owner's expires. Before every claim the owner checks its
|
|
11
|
-
* fence is still the highest, and one that was fenced out stops dispatching at
|
|
12
|
-
* once. The occurrence claim (`claims/`, also `link`) is the final guarantee
|
|
13
|
-
* that nothing starts twice, lease or no lease.
|
|
14
|
-
*
|
|
15
|
-
* ## The loop
|
|
16
|
-
*
|
|
17
|
-
* Every tick (at most 30 s, sooner when something is due, a job file changes
|
|
18
|
-
* or a run ends): evaluate each job with the SDK's pure evaluator, append what
|
|
19
|
-
* it decided to history, queue what is due, and dispatch the queue up to the
|
|
20
|
-
* concurrency cap — one run at a time per folder for jobs that can write.
|
|
21
|
-
* An occurrence is claimed when its run STARTS, never when it is queued, so a
|
|
22
|
-
* restart re-derives a waiting run instead of losing it.
|
|
23
|
-
*
|
|
24
|
-
* ## Runs
|
|
25
|
-
*
|
|
26
|
-
* A run is a child process, `schedule __fire`, whose stdout and stderr are a
|
|
27
|
-
* log FILE rather than pipes, so it outlives a daemon restart without dying of
|
|
28
|
-
* EPIPE. It enforces its own wall clock. A run this daemon did not start (it
|
|
29
|
-
* was started before a restart) is adopted: finalised from its result file,
|
|
30
|
-
* or from its session log once its lease lapses. Nothing is ever killed by a
|
|
31
|
-
* pid read from disk.
|
|
32
|
-
*
|
|
33
|
-
* ## Upgrades
|
|
34
|
-
*
|
|
35
|
-
* Every tick compares the installed CLI with the one this daemon started
|
|
36
|
-
* from. On a change it stops dispatching, waits for the runs it started and
|
|
37
|
-
* exits 0; the supervisor starts the new code.
|
|
38
|
-
*/
|
|
39
|
-
import { spawn } from 'node:child_process';
|
|
40
|
-
import { closeSync, existsSync, openSync, rmSync, statSync, watch, writeFileSync, } from 'node:fs';
|
|
41
|
-
import { dirname, join } from 'node:path';
|
|
42
|
-
import { DiskSessionLeaseStore, evaluateJob, generateScheduleRunId, } from '@namzu/sdk';
|
|
43
|
-
import { admitNotification } from '../../integrations/notifications/desktop/throttle.js';
|
|
44
|
-
import { childEnvironment } from '../env.js';
|
|
45
|
-
import { isFinal, readRunResult } from '../fire/result.js';
|
|
46
|
-
import { allowsWrites } from '../policy.js';
|
|
47
|
-
import { resumeCommand } from '../resume-command.js';
|
|
48
|
-
import { PRIVATE_FILE_MODE, ensureDir, writeJsonAtomic } from '../store/atomic.js';
|
|
49
|
-
import { claimOccurrence, isClaimed, pruneClaims } from '../store/claims.js';
|
|
50
|
-
import { appendHistory, compactHistory } from '../store/history.js';
|
|
51
|
-
import { confirmationHolds, jobSecurityDigest, listJobs, readJob, updateJob, } from '../store/jobs.js';
|
|
52
|
-
import { readState, withoutUndefined, writeState } from '../store/state.js';
|
|
53
|
-
import { runResultVersion, } from '../types.js';
|
|
54
|
-
import { startEndpoint } from './endpoint.js';
|
|
55
|
-
import { EXIT_STOP_REQUESTED } from './exit.js';
|
|
56
|
-
import { pruneDaemonLogs } from './log.js';
|
|
57
|
-
import { failureSignature, noticeText, scriptSummaryOf } from './notify.js';
|
|
58
|
-
import { archiveOldRuns } from './retention.js';
|
|
59
|
-
import { abandonParkedTurn, sessionFacts, sessionLeaseLive, turnOutcome } from './sessions.js';
|
|
60
|
-
export { EXIT_STOP_REQUESTED };
|
|
61
|
-
export const LEASE_TTL_MS = 90_000;
|
|
62
|
-
export const LEASE_RENEW_MS = 30_000;
|
|
63
|
-
export const TICK_MS = 30_000;
|
|
64
|
-
/** A run with no result and no session this long after it started is gone. */
|
|
65
|
-
const START_GRACE_MS = 120_000;
|
|
66
|
-
const CLAIM_RETENTION_EXTRA_MS = 24 * 60 * 60 * 1000;
|
|
67
|
-
const HOUSEKEEPING_MS = 24 * 60 * 60 * 1000;
|
|
68
|
-
const GAP_MS = 60_000;
|
|
69
|
-
export class ScheduleDaemon {
|
|
70
|
-
#o;
|
|
71
|
-
#now;
|
|
72
|
-
#mono;
|
|
73
|
-
#leaseStore;
|
|
74
|
-
#lease = null;
|
|
75
|
-
#leaseRenewedAt = 0;
|
|
76
|
-
#endpoint;
|
|
77
|
-
#watcher;
|
|
78
|
-
/** Runs in progress: ours (with a handle) and adopted ones (without). */
|
|
79
|
-
#running = new Map();
|
|
80
|
-
#stopping = false;
|
|
81
|
-
/** The stop came from `schedule stop`'s file, not a signal or the endpoint. */
|
|
82
|
-
#stopRequestedByFile = false;
|
|
83
|
-
#draining = false;
|
|
84
|
-
#standby = false;
|
|
85
|
-
#wake;
|
|
86
|
-
#lastWall = 0;
|
|
87
|
-
#lastMono = 0;
|
|
88
|
-
#startedAt = 0;
|
|
89
|
-
#observedGap;
|
|
90
|
-
#startFingerprint = '';
|
|
91
|
-
#lastHousekeeping = 0;
|
|
92
|
-
#manual = [];
|
|
93
|
-
/** Why a queued run is waiting, for its run record once it starts. */
|
|
94
|
-
#delayReasons = new Map();
|
|
95
|
-
#finalizing = [];
|
|
96
|
-
constructor(options) {
|
|
97
|
-
this.#o = options;
|
|
98
|
-
this.#now = options.now ?? Date.now;
|
|
99
|
-
this.#mono = options.monotonic ?? (() => performance.now());
|
|
100
|
-
this.#leaseStore = new DiskSessionLeaseStore(options.paths.daemon);
|
|
101
|
-
}
|
|
102
|
-
get standby() {
|
|
103
|
-
return this.#standby;
|
|
104
|
-
}
|
|
105
|
-
get lease() {
|
|
106
|
-
return this.#lease;
|
|
107
|
-
}
|
|
108
|
-
/** Ask the loop to stop at its next wake. Running children are left running. */
|
|
109
|
-
stop() {
|
|
110
|
-
this.#stopping = true;
|
|
111
|
-
this.#wake?.();
|
|
112
|
-
}
|
|
113
|
-
/** Stop dispatching, wait for our own runs, then stop (an upgrade restart). */
|
|
114
|
-
drainAndRestart() {
|
|
115
|
-
this.#draining = true;
|
|
116
|
-
this.#persistManual();
|
|
117
|
-
this.#wake?.();
|
|
118
|
-
}
|
|
119
|
-
wake() {
|
|
120
|
-
this.#wake?.();
|
|
121
|
-
}
|
|
122
|
-
/** Try once to own the home (for a caller driving {@link tick} itself). */
|
|
123
|
-
async claimOwnership() {
|
|
124
|
-
this.#startFingerprint ||= this.#o.fingerprint();
|
|
125
|
-
this.#startedAt ||= this.#now();
|
|
126
|
-
const lease = await this.#leaseStore.claim({
|
|
127
|
-
holder: this.#o.epoch,
|
|
128
|
-
ttlMs: this.#o.leaseTtlMs ?? LEASE_TTL_MS,
|
|
129
|
-
now: this.#now(),
|
|
130
|
-
});
|
|
131
|
-
if (lease) {
|
|
132
|
-
this.#lease = lease;
|
|
133
|
-
this.#leaseRenewedAt = this.#now();
|
|
134
|
-
}
|
|
135
|
-
return lease !== null;
|
|
136
|
-
}
|
|
137
|
-
/** Give the home up (a caller driving {@link tick} itself). */
|
|
138
|
-
async releaseOwnership() {
|
|
139
|
-
if (this.#lease)
|
|
140
|
-
await this.#leaseStore.release(this.#lease);
|
|
141
|
-
this.#lease = null;
|
|
142
|
-
}
|
|
143
|
-
/** Run until stopped. Returns the process exit code. */
|
|
144
|
-
async run() {
|
|
145
|
-
ensureDir(this.#o.paths.daemon);
|
|
146
|
-
this.#startedAt = this.#now();
|
|
147
|
-
this.#startFingerprint = this.#o.fingerprint();
|
|
148
|
-
for (;;) {
|
|
149
|
-
const acquired = await this.#acquire();
|
|
150
|
-
if (acquired === 'exit75')
|
|
151
|
-
return 75;
|
|
152
|
-
if (acquired === 'stopped')
|
|
153
|
-
return this.#stopRequestedByFile ? EXIT_STOP_REQUESTED : 0;
|
|
154
|
-
const outcome = await this.#own();
|
|
155
|
-
if (outcome === 'standby')
|
|
156
|
-
continue;
|
|
157
|
-
return this.#stopRequestedByFile ? EXIT_STOP_REQUESTED : 0;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
async #acquire() {
|
|
161
|
-
let announced = false;
|
|
162
|
-
for (;;) {
|
|
163
|
-
if (this.#stopRequested())
|
|
164
|
-
this.#stopping = true;
|
|
165
|
-
if (this.#stopping)
|
|
166
|
-
return 'stopped';
|
|
167
|
-
const lease = await this.#leaseStore.claim({
|
|
168
|
-
holder: this.#o.epoch,
|
|
169
|
-
ttlMs: this.#o.leaseTtlMs ?? LEASE_TTL_MS,
|
|
170
|
-
now: this.#now(),
|
|
171
|
-
});
|
|
172
|
-
if (lease) {
|
|
173
|
-
this.#lease = lease;
|
|
174
|
-
this.#leaseRenewedAt = this.#now();
|
|
175
|
-
this.#standby = false;
|
|
176
|
-
this.#o.log.info('scheduler owns this home', {
|
|
177
|
-
'namzu.schedule.epoch': this.#o.epoch,
|
|
178
|
-
'namzu.schedule.fence': lease.fence,
|
|
179
|
-
});
|
|
180
|
-
return 'owned';
|
|
181
|
-
}
|
|
182
|
-
if (this.#o.onceOrExit) {
|
|
183
|
-
this.#o.log.warn('another scheduler owns this home', {
|
|
184
|
-
'namzu.schedule.epoch': this.#o.epoch,
|
|
185
|
-
});
|
|
186
|
-
return 'exit75';
|
|
187
|
-
}
|
|
188
|
-
this.#standby = true;
|
|
189
|
-
if (!announced) {
|
|
190
|
-
announced = true;
|
|
191
|
-
this.#o.log.info('scheduler on standby', { 'namzu.schedule.epoch': this.#o.epoch });
|
|
192
|
-
}
|
|
193
|
-
await this.#sleep(this.#o.standbyPollMs ?? LEASE_RENEW_MS);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
async #own() {
|
|
197
|
-
this.#endpoint = await startEndpoint(this.#o.paths.endpoint, this.#o.epoch, {
|
|
198
|
-
status: () => this.status(),
|
|
199
|
-
reload: () => this.wake(),
|
|
200
|
-
runNow: (jobId) => this.requestRunNow(jobId),
|
|
201
|
-
stop: () => this.stop(),
|
|
202
|
-
drainAndRestart: () => this.drainAndRestart(),
|
|
203
|
-
});
|
|
204
|
-
if (this.#o.watchJobs !== false) {
|
|
205
|
-
try {
|
|
206
|
-
ensureDir(this.#o.paths.jobs);
|
|
207
|
-
this.#watcher = watch(this.#o.paths.jobs, () => this.wake());
|
|
208
|
-
this.#watcher.on('error', () => { });
|
|
209
|
-
}
|
|
210
|
-
catch { }
|
|
211
|
-
}
|
|
212
|
-
this.#lastWall = this.#now();
|
|
213
|
-
this.#lastMono = this.#mono();
|
|
214
|
-
try {
|
|
215
|
-
for (;;) {
|
|
216
|
-
if (this.#stopRequested())
|
|
217
|
-
this.#stopping = true;
|
|
218
|
-
if (this.#stopping)
|
|
219
|
-
return 'stopped';
|
|
220
|
-
if (!(await this.#holdLease())) {
|
|
221
|
-
this.#o.log.warn('scheduler lost its lease; standing by', {
|
|
222
|
-
'namzu.schedule.epoch': this.#o.epoch,
|
|
223
|
-
});
|
|
224
|
-
return 'standby';
|
|
225
|
-
}
|
|
226
|
-
await this.tick();
|
|
227
|
-
if (this.#draining && this.#ownRuns() === 0) {
|
|
228
|
-
this.#o.log.info('scheduler drained for a restart', {
|
|
229
|
-
'namzu.schedule.epoch': this.#o.epoch,
|
|
230
|
-
});
|
|
231
|
-
this.#stopping = true;
|
|
232
|
-
return 'stopped';
|
|
233
|
-
}
|
|
234
|
-
await this.#sleep(this.#nextSleep());
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
finally {
|
|
238
|
-
this.#watcher?.close();
|
|
239
|
-
await this.#endpoint?.close();
|
|
240
|
-
this.#endpoint = undefined;
|
|
241
|
-
await Promise.allSettled(this.#finalizing);
|
|
242
|
-
if (this.#stopping)
|
|
243
|
-
this.#persistManual();
|
|
244
|
-
if (this.#lease && this.#stopping) {
|
|
245
|
-
await this.#leaseStore.release(this.#lease).catch(() => undefined);
|
|
246
|
-
this.#lease = null;
|
|
247
|
-
}
|
|
248
|
-
this.#heartbeat();
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* `schedule stop` and `uninstall` leave `daemon/stop.json`; `start` and
|
|
253
|
-
* `install` remove it. It reaches a daemon the service manager cannot: one
|
|
254
|
-
* on standby (it has no endpoint), or one under WSL, whose Windows task
|
|
255
|
-
* ending does not end the Linux process. A daemon that finds it exits
|
|
256
|
-
* {@link EXIT_STOP_REQUESTED}.
|
|
257
|
-
*/
|
|
258
|
-
#stopRequested() {
|
|
259
|
-
if (!existsSync(stopRequestPath(this.#o.paths)))
|
|
260
|
-
return false;
|
|
261
|
-
this.#stopRequestedByFile = true;
|
|
262
|
-
this.#o.log.info('scheduler stop requested', { 'namzu.schedule.epoch': this.#o.epoch });
|
|
263
|
-
return true;
|
|
264
|
-
}
|
|
265
|
-
#ownRuns() {
|
|
266
|
-
let n = 0;
|
|
267
|
-
for (const t of this.#running.values())
|
|
268
|
-
if (t.run)
|
|
269
|
-
n++;
|
|
270
|
-
return n;
|
|
271
|
-
}
|
|
272
|
-
/** Renew when due; true while this daemon's fence is still the highest. */
|
|
273
|
-
async #holdLease() {
|
|
274
|
-
const lease = this.#lease;
|
|
275
|
-
if (!lease)
|
|
276
|
-
return false;
|
|
277
|
-
if (this.#now() - this.#leaseRenewedAt >= LEASE_RENEW_MS) {
|
|
278
|
-
const renewed = await this.#leaseStore.claim({ holder: this.#o.epoch, ttlMs: this.#o.leaseTtlMs ?? LEASE_TTL_MS, now: this.#now() }, { renew: lease });
|
|
279
|
-
if (!renewed) {
|
|
280
|
-
this.#lease = null;
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
this.#lease = renewed;
|
|
284
|
-
this.#leaseRenewedAt = this.#now();
|
|
285
|
-
}
|
|
286
|
-
return this.#stillOwner();
|
|
287
|
-
}
|
|
288
|
-
async #stillOwner() {
|
|
289
|
-
const lease = this.#lease;
|
|
290
|
-
return lease !== null && (await this.#leaseStore.fence()) === lease.fence;
|
|
291
|
-
}
|
|
292
|
-
#sleep(ms) {
|
|
293
|
-
return new Promise((resolve) => {
|
|
294
|
-
const timer = setTimeout(() => {
|
|
295
|
-
this.#wake = undefined;
|
|
296
|
-
resolve();
|
|
297
|
-
}, Math.max(10, ms));
|
|
298
|
-
this.#wake = () => {
|
|
299
|
-
clearTimeout(timer);
|
|
300
|
-
this.#wake = undefined;
|
|
301
|
-
resolve();
|
|
302
|
-
};
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
#nextSleep() {
|
|
306
|
-
const tick = this.#o.tickMs ?? TICK_MS;
|
|
307
|
-
let soonest = this.#now() + tick;
|
|
308
|
-
for (const job of listJobs(this.#o.paths).jobs) {
|
|
309
|
-
try {
|
|
310
|
-
const next = readState(this.#o.paths, job.id).nextFireAt;
|
|
311
|
-
if (next)
|
|
312
|
-
soonest = Math.min(soonest, Date.parse(next) + 50);
|
|
313
|
-
}
|
|
314
|
-
catch { }
|
|
315
|
-
}
|
|
316
|
-
return Math.max(50, Math.min(tick, soonest - this.#now()));
|
|
317
|
-
}
|
|
318
|
-
/** What the endpoint's `status` reports. */
|
|
319
|
-
status() {
|
|
320
|
-
return {
|
|
321
|
-
epoch: this.#o.epoch,
|
|
322
|
-
pid: process.pid,
|
|
323
|
-
version: this.#o.version,
|
|
324
|
-
fence: this.#lease?.fence,
|
|
325
|
-
standby: this.#standby,
|
|
326
|
-
draining: this.#draining,
|
|
327
|
-
runs: [...this.#running.values()].map((t) => ({
|
|
328
|
-
jobId: t.jobId,
|
|
329
|
-
runId: t.runId,
|
|
330
|
-
adopted: t.run === undefined,
|
|
331
|
-
})),
|
|
332
|
-
notifications: this.#o.notificationBackend ?? 'unknown',
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
/** Queue a manual run (`schedule run-now`). Refused while the job has a run. */
|
|
336
|
-
requestRunNow(jobId) {
|
|
337
|
-
const job = readJob(this.#o.paths, jobId);
|
|
338
|
-
if (!job)
|
|
339
|
-
return { ok: false, message: `no job ${jobId}` };
|
|
340
|
-
if (job.state !== 'active' || !confirmationHolds(job)) {
|
|
341
|
-
return {
|
|
342
|
-
ok: false,
|
|
343
|
-
message: `${job.name} is ${job.state === 'active' ? 'awaiting confirmation' : job.state}`,
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
const state = readState(this.#o.paths, job.id);
|
|
347
|
-
if (state.activeRun || state.queued || this.#manual.some((m) => m.jobId === job.id)) {
|
|
348
|
-
return { ok: false, message: `${job.name} already has a run` };
|
|
349
|
-
}
|
|
350
|
-
this.#manual.push({ jobId: job.id, runId: generateScheduleRunId() });
|
|
351
|
-
if (this.#draining) {
|
|
352
|
-
// This daemon starts nothing more and its memory goes with it: the run
|
|
353
|
-
// is left queued on disk, for the daemon that takes over.
|
|
354
|
-
this.#persistManual();
|
|
355
|
-
return {
|
|
356
|
-
ok: true,
|
|
357
|
-
message: `${job.name} queued; the scheduler is restarting for an upgrade and starts it once it is back`,
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
this.wake();
|
|
361
|
-
return { ok: true, message: `${job.name} queued` };
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Move every manual run still waiting in memory (deferred by the cap or a
|
|
365
|
-
* busy folder lane) to `state.queued` on disk. A daemon that stops
|
|
366
|
-
* dispatching (a drain) or exits keeps no memory, and the CLI has already
|
|
367
|
-
* told the operator the run is queued; the daemon that takes over starts
|
|
368
|
-
* it from disk under the same run id.
|
|
369
|
-
*/
|
|
370
|
-
#persistManual() {
|
|
371
|
-
for (const manual of this.#manual.splice(0)) {
|
|
372
|
-
try {
|
|
373
|
-
const state = readState(this.#o.paths, manual.jobId);
|
|
374
|
-
if (state.activeRun || state.queued) {
|
|
375
|
-
this.#o.log.warn('manual run dropped; the job already has a run', {
|
|
376
|
-
'namzu.schedule.job_id': manual.jobId,
|
|
377
|
-
'namzu.schedule.run_id': manual.runId,
|
|
378
|
-
});
|
|
379
|
-
continue;
|
|
380
|
-
}
|
|
381
|
-
const at = new Date(this.#now()).toISOString();
|
|
382
|
-
writeState(this.#o.paths, {
|
|
383
|
-
...state,
|
|
384
|
-
queued: {
|
|
385
|
-
key: `${MANUAL_KEY_PREFIX}${manual.runId}`,
|
|
386
|
-
scheduledFor: at,
|
|
387
|
-
trigger: 'manual',
|
|
388
|
-
queuedAt: at,
|
|
389
|
-
},
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
catch (error) {
|
|
393
|
-
this.#o.log.error('manual run could not be queued on disk', {
|
|
394
|
-
'namzu.schedule.job_id': manual.jobId,
|
|
395
|
-
'namzu.schedule.run_id': manual.runId,
|
|
396
|
-
'exception.message': error instanceof Error ? error.message : String(error),
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
#heartbeat() {
|
|
402
|
-
try {
|
|
403
|
-
writeJsonAtomic(this.#o.paths.heartbeat, {
|
|
404
|
-
v: 1,
|
|
405
|
-
kind: 'schedule-heartbeat',
|
|
406
|
-
at: new Date(this.#now()).toISOString(),
|
|
407
|
-
pid: process.pid,
|
|
408
|
-
epoch: this.#o.epoch,
|
|
409
|
-
version: this.#o.version,
|
|
410
|
-
standby: this.#standby,
|
|
411
|
-
draining: this.#draining,
|
|
412
|
-
runsInFlight: this.#running.size,
|
|
413
|
-
notifications: this.#o.notificationBackend ?? 'unknown',
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
catch { }
|
|
417
|
-
}
|
|
418
|
-
#observeClock() {
|
|
419
|
-
const wall = this.#now();
|
|
420
|
-
const mono = this.#mono();
|
|
421
|
-
const wallDelta = wall - this.#lastWall;
|
|
422
|
-
const monoDelta = mono - this.#lastMono;
|
|
423
|
-
if (wallDelta - monoDelta > GAP_MS) {
|
|
424
|
-
this.#observedGap = {
|
|
425
|
-
from: new Date(this.#lastWall),
|
|
426
|
-
to: new Date(wall),
|
|
427
|
-
kind: monoDelta < wallDelta / 2 ? 'asleep' : 'clock-forward',
|
|
428
|
-
};
|
|
429
|
-
this.#o.log.info('scheduler observed a clock gap', {
|
|
430
|
-
'namzu.schedule.gap_ms': wallDelta - monoDelta,
|
|
431
|
-
'namzu.schedule.gap_kind': this.#observedGap.kind,
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
else if (monoDelta - wallDelta > GAP_MS) {
|
|
435
|
-
this.#observedGap = {
|
|
436
|
-
from: new Date(this.#lastWall),
|
|
437
|
-
to: new Date(wall),
|
|
438
|
-
kind: 'clock-backward',
|
|
439
|
-
};
|
|
440
|
-
this.#o.log.info('scheduler observed the clock going back', {
|
|
441
|
-
'namzu.schedule.gap_ms': monoDelta - wallDelta,
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
this.#lastWall = wall;
|
|
445
|
-
this.#lastMono = mono;
|
|
446
|
-
}
|
|
447
|
-
/** One pass: every job evaluated, the queue dispatched. Public for tests. */
|
|
448
|
-
async tick() {
|
|
449
|
-
this.#observeClock();
|
|
450
|
-
if (!this.#draining && this.#o.fingerprint() !== this.#startFingerprint) {
|
|
451
|
-
this.#o.log.info('installed CLI changed; draining for a restart', {
|
|
452
|
-
'namzu.schedule.epoch': this.#o.epoch,
|
|
453
|
-
});
|
|
454
|
-
this.#draining = true;
|
|
455
|
-
this.#persistManual();
|
|
456
|
-
}
|
|
457
|
-
const now = this.#now();
|
|
458
|
-
const { jobs, errors } = listJobs(this.#o.paths);
|
|
459
|
-
for (const error of errors) {
|
|
460
|
-
this.#o.log.warn('scheduled job file unreadable', {
|
|
461
|
-
'namzu.schedule.path': error.path,
|
|
462
|
-
'exception.message': error.message,
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
for (const job of jobs) {
|
|
466
|
-
try {
|
|
467
|
-
await this.#tickJob(job, now);
|
|
468
|
-
}
|
|
469
|
-
catch (error) {
|
|
470
|
-
this.#o.log.error('scheduled job evaluation failed', {
|
|
471
|
-
'namzu.schedule.job_id': job.id,
|
|
472
|
-
'exception.message': error instanceof Error ? error.message : String(error),
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
this.#observedGap = undefined;
|
|
477
|
-
if (!this.#draining)
|
|
478
|
-
await this.#dispatch(now);
|
|
479
|
-
// A dispatch that was under way when the drain began may have handed a
|
|
480
|
-
// deferred manual run back to memory.
|
|
481
|
-
if (this.#draining)
|
|
482
|
-
this.#persistManual();
|
|
483
|
-
if (now - this.#lastHousekeeping > HOUSEKEEPING_MS) {
|
|
484
|
-
this.#lastHousekeeping = now;
|
|
485
|
-
for (const job of jobs) {
|
|
486
|
-
try {
|
|
487
|
-
compactHistory(this.#o.paths, job.id, now);
|
|
488
|
-
pruneClaims(this.#o.paths, job.id, job.catchUp.windowMs + CLAIM_RETENTION_EXTRA_MS, now);
|
|
489
|
-
}
|
|
490
|
-
catch { }
|
|
491
|
-
}
|
|
492
|
-
pruneDaemonLogs(this.#o.paths.daemonLog, new Date(now));
|
|
493
|
-
}
|
|
494
|
-
this.#heartbeat();
|
|
495
|
-
}
|
|
496
|
-
async #notice(kind, job, extra) {
|
|
497
|
-
if (!this.#o.notifications)
|
|
498
|
-
return;
|
|
499
|
-
const flags = job.notify;
|
|
500
|
-
const wanted = kind === 'finished'
|
|
501
|
-
? flags.finished
|
|
502
|
-
: kind === 'awaiting-approval'
|
|
503
|
-
? flags.awaitingApproval
|
|
504
|
-
: kind === 'catch-up'
|
|
505
|
-
? flags.finished
|
|
506
|
-
: flags.failed || kind === 'held' || kind === 'needs-confirmation';
|
|
507
|
-
if (!wanted)
|
|
508
|
-
return;
|
|
509
|
-
// What needs the person is never throttled: each happens at most once
|
|
510
|
-
// per run or per change, and a dropped one is never sent again. A park
|
|
511
|
-
// right after a catch-up notice would otherwise sit unannounced until
|
|
512
|
-
// its approval expired, with every later occurrence skipped.
|
|
513
|
-
const always = kind === 'held' ||
|
|
514
|
-
kind === 'needs-confirmation' ||
|
|
515
|
-
kind === 'auto-paused' ||
|
|
516
|
-
kind === 'awaiting-approval' ||
|
|
517
|
-
kind === 'approval-expired';
|
|
518
|
-
if (!always &&
|
|
519
|
-
!admitNotification(join(this.#o.paths.daemon, 'notify.json'), job.id, this.#now()))
|
|
520
|
-
return;
|
|
521
|
-
const text = noticeText(kind, job, extra);
|
|
522
|
-
await this.#o.notify({ jobId: job.id, ...text });
|
|
523
|
-
this.#o.log.info('scheduled run notification', {
|
|
524
|
-
'namzu.schedule.job_id': job.id,
|
|
525
|
-
'namzu.schedule.notice': kind,
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
async #tickJob(loaded, now) {
|
|
529
|
-
const paths = this.#o.paths;
|
|
530
|
-
let job = loaded;
|
|
531
|
-
let state = readState(paths, job.id);
|
|
532
|
-
// A confirmed job whose file no longer matches its confirmation was
|
|
533
|
-
// edited behind the CLI's back: hold it, say so once.
|
|
534
|
-
if (job.state === 'active' && !confirmationHolds(job)) {
|
|
535
|
-
job = updateJob(paths, job.id, job.revision, (j) => ({ ...j, state: 'pending-confirmation' }));
|
|
536
|
-
appendHistory(paths, job.id, {
|
|
537
|
-
v: 1,
|
|
538
|
-
kind: 'job',
|
|
539
|
-
at: new Date(now).toISOString(),
|
|
540
|
-
action: 'tampered',
|
|
541
|
-
by: 'daemon',
|
|
542
|
-
detail: 'the job file changed outside namzu; it waits for confirmation',
|
|
543
|
-
});
|
|
544
|
-
state = { ...state, lastHoldNotice: jobSecurityDigest(job) };
|
|
545
|
-
writeState(paths, state);
|
|
546
|
-
await this.#notice('held', job, { at: new Date(now) });
|
|
547
|
-
}
|
|
548
|
-
else if (job.state === 'pending-confirmation') {
|
|
549
|
-
const digest = jobSecurityDigest(job);
|
|
550
|
-
if (state.lastHoldNotice !== digest) {
|
|
551
|
-
state = { ...state, lastHoldNotice: digest };
|
|
552
|
-
writeState(paths, state);
|
|
553
|
-
await this.#notice('needs-confirmation', job, { at: new Date(now) });
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
state = await this.#reconcile(job, state, now);
|
|
557
|
-
job = readJob(paths, job.id) ?? job;
|
|
558
|
-
// A draining daemon does not evaluate. Evaluating would move
|
|
559
|
-
// `lastEvaluatedAt` past an occurrence it cannot queue, so the daemon
|
|
560
|
-
// that takes over would never see it: no run, no `missed`, and a
|
|
561
|
-
// one-shot left active with nothing to fire. Left alone, the successor
|
|
562
|
-
// evaluates from where this daemon stopped and runs it (late, as a
|
|
563
|
-
// scheduled or catch-up run under the job's own policy).
|
|
564
|
-
if (this.#draining)
|
|
565
|
-
return;
|
|
566
|
-
const evaluationState = {
|
|
567
|
-
...(state.lastEvaluatedAt ? { lastEvaluatedAt: state.lastEvaluatedAt } : {}),
|
|
568
|
-
...(state.jobRevision !== undefined ? { jobRevision: state.jobRevision } : {}),
|
|
569
|
-
...(state.activeRun
|
|
570
|
-
? { activeRun: { status: state.activeRun.status } }
|
|
571
|
-
: state.queued || this.#manual.some((m) => m.jobId === job.id)
|
|
572
|
-
? { activeRun: { status: 'queued' } }
|
|
573
|
-
: {}),
|
|
574
|
-
...(state.quotaHoldUntil ? { quotaHoldUntil: state.quotaHoldUntil } : {}),
|
|
575
|
-
};
|
|
576
|
-
const decision = evaluateJob({
|
|
577
|
-
job: {
|
|
578
|
-
spec: job.schedule,
|
|
579
|
-
state: job.state,
|
|
580
|
-
catchUp: job.catchUp,
|
|
581
|
-
createdAt: job.createdAt,
|
|
582
|
-
updatedAt: job.updatedAt,
|
|
583
|
-
revision: job.revision,
|
|
584
|
-
},
|
|
585
|
-
state: evaluationState,
|
|
586
|
-
now: new Date(now),
|
|
587
|
-
daemon: {
|
|
588
|
-
startedAt: new Date(this.#startedAt),
|
|
589
|
-
...(this.#observedGap ? { observedGap: this.#observedGap } : {}),
|
|
590
|
-
},
|
|
591
|
-
isClaimed: (key) => isClaimed(paths, job.id, key),
|
|
592
|
-
});
|
|
593
|
-
const at = new Date(now).toISOString();
|
|
594
|
-
for (const skip of decision.skip) {
|
|
595
|
-
appendHistory(paths, job.id, {
|
|
596
|
-
v: 1,
|
|
597
|
-
kind: 'skip',
|
|
598
|
-
at,
|
|
599
|
-
scheduledFor: skip.scheduledFor.toISOString(),
|
|
600
|
-
reason: skip.reason,
|
|
601
|
-
count: skip.count,
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
if (decision.missed) {
|
|
605
|
-
appendHistory(paths, job.id, {
|
|
606
|
-
v: 1,
|
|
607
|
-
kind: 'missed',
|
|
608
|
-
at,
|
|
609
|
-
from: decision.missed.from.toISOString(),
|
|
610
|
-
to: decision.missed.to.toISOString(),
|
|
611
|
-
count: decision.missed.count,
|
|
612
|
-
...(decision.missed.capped ? { capped: true } : {}),
|
|
613
|
-
reason: decision.missed.reason,
|
|
614
|
-
...(decision.fire ? { caughtUpBy: decision.fire.key } : {}),
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
let next = withoutUndefined({
|
|
618
|
-
...state,
|
|
619
|
-
lastEvaluatedAt: decision.nextState.lastEvaluatedAt.toISOString(),
|
|
620
|
-
jobRevision: decision.nextState.jobRevision,
|
|
621
|
-
nextFireAt: decision.nextState.nextFireAt?.toISOString(),
|
|
622
|
-
quotaHoldUntil: state.quotaHoldUntil && Date.parse(state.quotaHoldUntil) > now
|
|
623
|
-
? state.quotaHoldUntil
|
|
624
|
-
: undefined,
|
|
625
|
-
});
|
|
626
|
-
if (decision.fire) {
|
|
627
|
-
next = {
|
|
628
|
-
...next,
|
|
629
|
-
queued: {
|
|
630
|
-
key: decision.fire.key,
|
|
631
|
-
scheduledFor: decision.fire.scheduledFor.toISOString(),
|
|
632
|
-
trigger: decision.fire.trigger,
|
|
633
|
-
queuedAt: at,
|
|
634
|
-
},
|
|
635
|
-
};
|
|
636
|
-
if (decision.fire.trigger === 'catch-up') {
|
|
637
|
-
await this.#notice('catch-up', job, {
|
|
638
|
-
at: new Date(now),
|
|
639
|
-
scheduledFor: decision.fire.scheduledFor,
|
|
640
|
-
...(decision.missed ? { missed: decision.missed.count } : {}),
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
writeState(paths, next);
|
|
645
|
-
if (decision.jobTransition && decision.jobTransition !== job.state) {
|
|
646
|
-
const transition = decision.jobTransition;
|
|
647
|
-
// A one-shot that fired completes once its run is dispatched; one
|
|
648
|
-
// that expired is done now.
|
|
649
|
-
if (transition === 'expired' || !decision.fire) {
|
|
650
|
-
updateJob(paths, job.id, job.revision, (j) => ({ ...j, state: transition }));
|
|
651
|
-
appendHistory(paths, job.id, { v: 1, kind: 'job', at, action: transition, by: 'daemon' });
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* Record how a run this daemon did not start has ended — a foreground
|
|
657
|
-
* `schedule run-now` — exactly as a run it started is recorded. False,
|
|
658
|
-
* and nothing written, when the job's state no longer names that run (a
|
|
659
|
-
* daemon that adopted it recorded it first).
|
|
660
|
-
*/
|
|
661
|
-
async finalizeRun(jobId, runId, result) {
|
|
662
|
-
const job = readJob(this.#o.paths, jobId);
|
|
663
|
-
const run = readState(this.#o.paths, jobId).activeRun;
|
|
664
|
-
if (!job || run?.runId !== runId)
|
|
665
|
-
return false;
|
|
666
|
-
this.#finalize(job, run, result, this.#now());
|
|
667
|
-
await this.settled();
|
|
668
|
-
return true;
|
|
669
|
-
}
|
|
670
|
-
/**
|
|
671
|
-
* Settle the job's run in progress if its process is gone, as a tick
|
|
672
|
-
* would, without evaluating the schedule. For a foreground `run-now`
|
|
673
|
-
* finding a run no scheduler is left to settle.
|
|
674
|
-
*/
|
|
675
|
-
async reconcileJob(jobId) {
|
|
676
|
-
const job = readJob(this.#o.paths, jobId);
|
|
677
|
-
if (!job)
|
|
678
|
-
return undefined;
|
|
679
|
-
const state = await this.#reconcile(job, readState(this.#o.paths, jobId), this.#now());
|
|
680
|
-
await this.settled();
|
|
681
|
-
return state;
|
|
682
|
-
}
|
|
683
|
-
/** Finalise or adopt the job's run in progress, if it has one. */
|
|
684
|
-
async #reconcile(job, state, now) {
|
|
685
|
-
// A run adopted earlier that the job no longer names was recorded by
|
|
686
|
-
// someone else (a foreground `run-now` finishing): stop counting it.
|
|
687
|
-
for (const [runId, tracked] of this.#running) {
|
|
688
|
-
if (tracked.jobId === job.id && !tracked.run && state.activeRun?.runId !== runId)
|
|
689
|
-
this.#running.delete(runId);
|
|
690
|
-
}
|
|
691
|
-
const run = state.activeRun;
|
|
692
|
-
if (!run)
|
|
693
|
-
return state;
|
|
694
|
-
const tracked = this.#running.get(run.runId);
|
|
695
|
-
if (tracked?.run)
|
|
696
|
-
return state;
|
|
697
|
-
const result = readRunResult(this.#o.paths, job.id, run.runId);
|
|
698
|
-
if (run.status === 'running') {
|
|
699
|
-
if (isFinal(result))
|
|
700
|
-
return this.#finalize(job, run, result, now);
|
|
701
|
-
const slug = result?.projectSlug ?? run.projectSlug;
|
|
702
|
-
const sessionId = result?.sessionId ?? run.sessionId;
|
|
703
|
-
const ref = slug && sessionId ? { home: this.#o.paths.home, projectSlug: slug, sessionId } : undefined;
|
|
704
|
-
if (ref && (await sessionLeaseLive(ref, now))) {
|
|
705
|
-
this.#running.set(run.runId, {
|
|
706
|
-
jobId: job.id,
|
|
707
|
-
runId: run.runId,
|
|
708
|
-
folder: job.folder.canonical,
|
|
709
|
-
writes: allowsWrites(job.permissions),
|
|
710
|
-
});
|
|
711
|
-
return state;
|
|
712
|
-
}
|
|
713
|
-
if (!ref && now - Date.parse(run.startedAt) < START_GRACE_MS) {
|
|
714
|
-
this.#running.set(run.runId, {
|
|
715
|
-
jobId: job.id,
|
|
716
|
-
runId: run.runId,
|
|
717
|
-
folder: job.folder.canonical,
|
|
718
|
-
writes: allowsWrites(job.permissions),
|
|
719
|
-
});
|
|
720
|
-
return state;
|
|
721
|
-
}
|
|
722
|
-
this.#running.delete(run.runId);
|
|
723
|
-
// The process is gone. The session log says how far the turn got.
|
|
724
|
-
const facts = ref ? await sessionFacts(ref) : null;
|
|
725
|
-
if (facts?.activeTurn?.paused) {
|
|
726
|
-
return this.#finalize(job, run, {
|
|
727
|
-
...(result ?? this.#emptyResult(job, run)),
|
|
728
|
-
status: 'awaiting-approval',
|
|
729
|
-
exitCode: 0,
|
|
730
|
-
turnId: facts.activeTurn.turnId,
|
|
731
|
-
...(ref ? { sessionId: ref.sessionId, projectSlug: ref.projectSlug } : {}),
|
|
732
|
-
}, now);
|
|
733
|
-
}
|
|
734
|
-
const outcome = facts && !facts.activeTurn ? turnOutcome(facts, run.turnId ?? result?.turnId) : undefined;
|
|
735
|
-
return this.#finalize(job, run, {
|
|
736
|
-
...(result ?? this.#emptyResult(job, run)),
|
|
737
|
-
status: outcome?.status ?? 'interrupted',
|
|
738
|
-
exitCode: outcome?.status === 'completed' ? 0 : 1,
|
|
739
|
-
reason: outcome?.reason ?? 'the run stopped without recording a result (its process ended)',
|
|
740
|
-
}, now);
|
|
741
|
-
}
|
|
742
|
-
// Parked on a decision.
|
|
743
|
-
if (!run.sessionId || !run.projectSlug) {
|
|
744
|
-
return this.#finalize(job, run, { ...this.#emptyResult(job, run), status: 'interrupted', exitCode: 1 }, now);
|
|
745
|
-
}
|
|
746
|
-
const ref = { home: this.#o.paths.home, projectSlug: run.projectSlug, sessionId: run.sessionId };
|
|
747
|
-
const facts = await sessionFacts(ref);
|
|
748
|
-
if (!facts) {
|
|
749
|
-
return this.#finalize(job, run, {
|
|
750
|
-
...this.#emptyResult(job, run),
|
|
751
|
-
status: 'interrupted',
|
|
752
|
-
exitCode: 1,
|
|
753
|
-
reason: 'the parked session is gone',
|
|
754
|
-
}, now);
|
|
755
|
-
}
|
|
756
|
-
const active = facts.activeTurn;
|
|
757
|
-
if (active && active.turnId === run.turnId) {
|
|
758
|
-
if (!active.paused)
|
|
759
|
-
return state; // someone resumed it; wait for it to settle
|
|
760
|
-
const parkedAt = Date.parse(run.parkedAt ?? run.startedAt);
|
|
761
|
-
if (now - parkedAt > job.approvalTtlMs && !(await sessionLeaseLive(ref, now))) {
|
|
762
|
-
try {
|
|
763
|
-
await abandonParkedTurn(ref, active.turnId, 'Scheduled run: approval expired');
|
|
764
|
-
}
|
|
765
|
-
catch (error) {
|
|
766
|
-
this.#o.log.warn('could not abandon an expired park', {
|
|
767
|
-
'namzu.schedule.job_id': job.id,
|
|
768
|
-
'exception.message': error instanceof Error ? error.message : String(error),
|
|
769
|
-
});
|
|
770
|
-
return state;
|
|
771
|
-
}
|
|
772
|
-
const expired = this.#finalize(job, run, {
|
|
773
|
-
...this.#emptyResult(job, run),
|
|
774
|
-
status: 'approval-expired',
|
|
775
|
-
exitCode: 1,
|
|
776
|
-
reason: 'nobody answered the approval in time; the turn was abandoned',
|
|
777
|
-
}, now);
|
|
778
|
-
await this.#notice('approval-expired', job, { at: new Date(now) });
|
|
779
|
-
return expired;
|
|
780
|
-
}
|
|
781
|
-
return state;
|
|
782
|
-
}
|
|
783
|
-
if (active)
|
|
784
|
-
return state;
|
|
785
|
-
const outcome = turnOutcome(facts, run.turnId);
|
|
786
|
-
if (!outcome)
|
|
787
|
-
return state;
|
|
788
|
-
return this.#finalize(job, run, {
|
|
789
|
-
...this.#emptyResult(job, run),
|
|
790
|
-
status: outcome.status,
|
|
791
|
-
exitCode: outcome.status === 'completed' ? 0 : 1,
|
|
792
|
-
...(outcome.reason ? { reason: outcome.reason } : {}),
|
|
793
|
-
}, now);
|
|
794
|
-
}
|
|
795
|
-
#emptyResult(job, run) {
|
|
796
|
-
return {
|
|
797
|
-
v: 1,
|
|
798
|
-
kind: 'schedule-run-result',
|
|
799
|
-
runId: run.runId,
|
|
800
|
-
jobId: job.id,
|
|
801
|
-
status: 'interrupted',
|
|
802
|
-
exitCode: 1,
|
|
803
|
-
startedAt: run.startedAt,
|
|
804
|
-
...(run.sessionId ? { sessionId: run.sessionId } : {}),
|
|
805
|
-
...(run.projectSlug ? { projectSlug: run.projectSlug } : {}),
|
|
806
|
-
...(run.turnId ? { turnId: run.turnId } : {}),
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
/** Record how a run ended, update counters, notify. Returns the new state (already written). */
|
|
810
|
-
#finalize(job, run, result, now) {
|
|
811
|
-
const paths = this.#o.paths;
|
|
812
|
-
const at = new Date(now).toISOString();
|
|
813
|
-
const status = result.status === 'running' ? 'interrupted' : result.status;
|
|
814
|
-
this.#running.delete(run.runId);
|
|
815
|
-
appendRunRecord(paths, job.id, run, result, at);
|
|
816
|
-
const current = readState(paths, job.id);
|
|
817
|
-
const failed = status === 'failed' ||
|
|
818
|
-
status === 'blocked-config' ||
|
|
819
|
-
status === 'timed-out' ||
|
|
820
|
-
status === 'interrupted' ||
|
|
821
|
-
status === 'approval-expired' ||
|
|
822
|
-
status === 'check-failed';
|
|
823
|
-
const counters = {
|
|
824
|
-
runs: current.counters.runs + (status === 'awaiting-approval' ? 0 : 1),
|
|
825
|
-
failures: current.counters.failures + (failed ? 1 : 0),
|
|
826
|
-
failureStreak: failed
|
|
827
|
-
? current.counters.failureStreak + 1
|
|
828
|
-
: status === 'completed'
|
|
829
|
-
? 0
|
|
830
|
-
: current.counters.failureStreak,
|
|
831
|
-
};
|
|
832
|
-
const quotaHold = status === 'failed' &&
|
|
833
|
-
result.retryAfterMs !== undefined &&
|
|
834
|
-
result.retryAfterMs > job.budget.waitForProviderMs
|
|
835
|
-
? new Date(now + result.retryAfterMs).toISOString()
|
|
836
|
-
: current.quotaHoldUntil;
|
|
837
|
-
let next;
|
|
838
|
-
if (status === 'awaiting-approval') {
|
|
839
|
-
next = withoutUndefined({
|
|
840
|
-
...current,
|
|
841
|
-
counters,
|
|
842
|
-
activeRun: withoutUndefined({
|
|
843
|
-
...run,
|
|
844
|
-
status: 'awaiting-approval',
|
|
845
|
-
sessionId: result.sessionId ?? run.sessionId,
|
|
846
|
-
projectSlug: result.projectSlug ?? run.projectSlug,
|
|
847
|
-
turnId: result.turnId ?? run.turnId,
|
|
848
|
-
parkedAt: run.parkedAt ?? at,
|
|
849
|
-
handoff: result.handoff ? { reason: result.handoff.reason } : undefined,
|
|
850
|
-
}),
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
|
-
else {
|
|
854
|
-
next = withoutUndefined({
|
|
855
|
-
...current,
|
|
856
|
-
counters,
|
|
857
|
-
activeRun: undefined,
|
|
858
|
-
quotaHoldUntil: quotaHold,
|
|
859
|
-
lastRun: withoutUndefined({
|
|
860
|
-
runId: run.runId,
|
|
861
|
-
scheduledFor: run.scheduledFor,
|
|
862
|
-
status,
|
|
863
|
-
endedAt: result.endedAt ?? at,
|
|
864
|
-
sessionId: result.sessionId,
|
|
865
|
-
refusedCalls: result.refusedCalls?.count,
|
|
866
|
-
failedCalls: result.failedCalls?.count,
|
|
867
|
-
}),
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
// The same failure is told once; a success clears it.
|
|
871
|
-
let incident = next.lastIncident;
|
|
872
|
-
let tell;
|
|
873
|
-
if (status === 'completed') {
|
|
874
|
-
incident = undefined;
|
|
875
|
-
tell = 'finished';
|
|
876
|
-
}
|
|
877
|
-
else if (status === 'awaiting-approval') {
|
|
878
|
-
tell = 'awaiting-approval';
|
|
879
|
-
}
|
|
880
|
-
else if (failed && status !== 'approval-expired') {
|
|
881
|
-
const signature = failureSignature(status, result.reason);
|
|
882
|
-
if (incident?.signature !== signature) {
|
|
883
|
-
tell =
|
|
884
|
-
status === 'blocked-config'
|
|
885
|
-
? 'blocked-config'
|
|
886
|
-
: status === 'timed-out'
|
|
887
|
-
? 'timed-out'
|
|
888
|
-
: status === 'interrupted'
|
|
889
|
-
? 'interrupted'
|
|
890
|
-
: status === 'check-failed'
|
|
891
|
-
? 'check-failed'
|
|
892
|
-
: 'failed';
|
|
893
|
-
incident = { signature, at };
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
next = withoutUndefined({ ...next, lastIncident: incident });
|
|
897
|
-
writeState(paths, next);
|
|
898
|
-
// A failing job pauses itself rather than failing every tick forever.
|
|
899
|
-
const pauseAfter = job.failurePolicy.pauseAfterFailures;
|
|
900
|
-
let autoPaused = false;
|
|
901
|
-
if (failed && pauseAfter > 0 && counters.failureStreak >= pauseAfter) {
|
|
902
|
-
const latest = readJob(paths, job.id);
|
|
903
|
-
if (latest && latest.state === 'active') {
|
|
904
|
-
updateJob(paths, job.id, latest.revision, (j) => ({
|
|
905
|
-
...j,
|
|
906
|
-
state: 'paused',
|
|
907
|
-
pausedAt: at,
|
|
908
|
-
pausedBy: 'auto-failure-streak',
|
|
909
|
-
}));
|
|
910
|
-
appendHistory(paths, job.id, {
|
|
911
|
-
v: 1,
|
|
912
|
-
kind: 'job',
|
|
913
|
-
at,
|
|
914
|
-
action: 'paused',
|
|
915
|
-
by: 'auto-failure-streak',
|
|
916
|
-
detail: `${counters.failureStreak} failed runs in a row`,
|
|
917
|
-
});
|
|
918
|
-
autoPaused = true;
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
// A one-shot that ran is complete.
|
|
922
|
-
if (job.schedule.kind === 'at' && status !== 'awaiting-approval' && run.trigger !== 'manual') {
|
|
923
|
-
const latest = readJob(paths, job.id);
|
|
924
|
-
if (latest && latest.state === 'active') {
|
|
925
|
-
updateJob(paths, job.id, latest.revision, (j) => ({ ...j, state: 'completed' }));
|
|
926
|
-
appendHistory(paths, job.id, { v: 1, kind: 'job', at, action: 'completed', by: 'daemon' });
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
const notices = [];
|
|
930
|
-
if (tell) {
|
|
931
|
-
const summary = result.summary ?? scriptSummaryOf(result);
|
|
932
|
-
notices.push(this.#notice(tell, job, {
|
|
933
|
-
at: new Date(now),
|
|
934
|
-
...(summary ? { summary } : {}),
|
|
935
|
-
...(result.refusedCalls ? { refused: result.refusedCalls } : {}),
|
|
936
|
-
...(tell === 'check-failed' && result.reason ? { reason: result.reason } : {}),
|
|
937
|
-
...(tell === 'awaiting-approval' && next.activeRun?.sessionId
|
|
938
|
-
? { resumeCommand: resumeCommand(job, next.activeRun.sessionId) }
|
|
939
|
-
: {}),
|
|
940
|
-
...(tell === 'awaiting-approval' && result.handoff
|
|
941
|
-
? { handoff: result.handoff.reason }
|
|
942
|
-
: {}),
|
|
943
|
-
}));
|
|
944
|
-
}
|
|
945
|
-
if (autoPaused)
|
|
946
|
-
notices.push(this.#notice('auto-paused', job, { at: new Date(now), failures: counters.failureStreak }));
|
|
947
|
-
if (status === 'completed') {
|
|
948
|
-
notices.push(archiveOldRuns(paths, job, next).then((archived) => {
|
|
949
|
-
if (archived.length > 0) {
|
|
950
|
-
const latest = readState(paths, job.id);
|
|
951
|
-
writeState(paths, {
|
|
952
|
-
...latest,
|
|
953
|
-
archivedSessions: [...(latest.archivedSessions ?? []), ...archived].slice(-200),
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
}, () => undefined));
|
|
957
|
-
}
|
|
958
|
-
this.#finalizing.push(Promise.allSettled(notices).then(() => undefined));
|
|
959
|
-
this.#o.log.info('scheduled run recorded', {
|
|
960
|
-
'namzu.schedule.job_id': job.id,
|
|
961
|
-
'namzu.schedule.run_id': run.runId,
|
|
962
|
-
'namzu.schedule.status': status,
|
|
963
|
-
});
|
|
964
|
-
return next;
|
|
965
|
-
}
|
|
966
|
-
/** Start queued runs, oldest first, within the cap and the folder lanes. */
|
|
967
|
-
async #dispatch(now) {
|
|
968
|
-
const paths = this.#o.paths;
|
|
969
|
-
const queue = [];
|
|
970
|
-
for (const job of listJobs(paths).jobs) {
|
|
971
|
-
const state = readState(paths, job.id);
|
|
972
|
-
if (state.queued)
|
|
973
|
-
queue.push({ job, state });
|
|
974
|
-
}
|
|
975
|
-
queue.sort((a, b) => (a.state.queued?.queuedAt ?? '').localeCompare(b.state.queued?.queuedAt ?? ''));
|
|
976
|
-
for (const manual of this.#manual.splice(0)) {
|
|
977
|
-
const job = readJob(paths, manual.jobId);
|
|
978
|
-
if (job)
|
|
979
|
-
queue.push({ job, state: readState(paths, job.id), manual: manual.runId });
|
|
980
|
-
}
|
|
981
|
-
for (const entry of queue) {
|
|
982
|
-
const { job } = entry;
|
|
983
|
-
const queued = entry.state.queued;
|
|
984
|
-
if (!(await this.#stillOwner())) {
|
|
985
|
-
this.#o.log.warn('scheduler fenced out; not dispatching', {
|
|
986
|
-
'namzu.schedule.epoch': this.#o.epoch,
|
|
987
|
-
});
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
const latest = readJob(paths, job.id);
|
|
991
|
-
if (!latest || latest.state !== 'active' || !confirmationHolds(latest)) {
|
|
992
|
-
if (queued)
|
|
993
|
-
writeState(paths, withoutUndefined({ ...entry.state, queued: undefined }));
|
|
994
|
-
continue;
|
|
995
|
-
}
|
|
996
|
-
const writes = allowsWrites(latest.permissions);
|
|
997
|
-
const busyLane = writes &&
|
|
998
|
-
[...this.#running.values()].some((t) => t.writes && t.folder === latest.folder.canonical);
|
|
999
|
-
if (this.#running.size >= this.#o.maxConcurrentRuns || busyLane) {
|
|
1000
|
-
this.#delayReasons.set(job.id, busyLane ? 'folder-busy' : 'concurrency-cap');
|
|
1001
|
-
if (entry.manual)
|
|
1002
|
-
this.#manual.push({ jobId: job.id, runId: entry.manual });
|
|
1003
|
-
continue;
|
|
1004
|
-
}
|
|
1005
|
-
const delayReason = this.#delayReasons.get(job.id);
|
|
1006
|
-
this.#delayReasons.delete(job.id);
|
|
1007
|
-
// A manual run queued on disk (during a drain) keeps the run id its key names.
|
|
1008
|
-
const queuedManual = !entry.manual && queued?.trigger === 'manual' && queued.key.startsWith(MANUAL_KEY_PREFIX)
|
|
1009
|
-
? queued.key.slice(MANUAL_KEY_PREFIX.length)
|
|
1010
|
-
: undefined;
|
|
1011
|
-
const runId = entry.manual ?? queuedManual ?? generateScheduleRunId();
|
|
1012
|
-
const key = entry.manual ? `${MANUAL_KEY_PREFIX}${runId}` : queued?.key;
|
|
1013
|
-
const trigger = entry.manual ? 'manual' : (queued?.trigger ?? 'scheduled');
|
|
1014
|
-
if (!claimOccurrence(paths, {
|
|
1015
|
-
jobId: job.id,
|
|
1016
|
-
key,
|
|
1017
|
-
runId,
|
|
1018
|
-
daemonEpoch: this.#o.epoch,
|
|
1019
|
-
at: new Date(now).toISOString(),
|
|
1020
|
-
})) {
|
|
1021
|
-
// Somebody already started this occurrence.
|
|
1022
|
-
if (queued)
|
|
1023
|
-
writeState(paths, withoutUndefined({ ...readState(paths, job.id), queued: undefined }));
|
|
1024
|
-
continue;
|
|
1025
|
-
}
|
|
1026
|
-
const delayedMs = queued && trigger !== 'manual' ? Math.max(0, now - Date.parse(queued.queuedAt)) : 0;
|
|
1027
|
-
const run = withoutUndefined({
|
|
1028
|
-
runId,
|
|
1029
|
-
key,
|
|
1030
|
-
trigger,
|
|
1031
|
-
scheduledFor: trigger === 'manual' ? undefined : queued?.scheduledFor,
|
|
1032
|
-
startedAt: new Date(now).toISOString(),
|
|
1033
|
-
daemonEpoch: this.#o.epoch,
|
|
1034
|
-
status: 'running',
|
|
1035
|
-
delayedMs: delayedMs >= 1_000 ? delayedMs : undefined,
|
|
1036
|
-
delayReason: delayedMs >= 1_000 ? (delayReason ?? 'concurrency-cap') : undefined,
|
|
1037
|
-
});
|
|
1038
|
-
writeState(paths, withoutUndefined({ ...readState(paths, job.id), queued: undefined, activeRun: run }));
|
|
1039
|
-
appendHistory(paths, job.id, {
|
|
1040
|
-
v: 1,
|
|
1041
|
-
kind: 'run',
|
|
1042
|
-
at: run.startedAt,
|
|
1043
|
-
runId,
|
|
1044
|
-
key,
|
|
1045
|
-
trigger,
|
|
1046
|
-
...(run.scheduledFor ? { scheduledFor: run.scheduledFor } : {}),
|
|
1047
|
-
startedAt: run.startedAt,
|
|
1048
|
-
...(run.delayedMs
|
|
1049
|
-
? { delayedMs: run.delayedMs, delayReason: run.delayReason ?? 'concurrency-cap' }
|
|
1050
|
-
: {}),
|
|
1051
|
-
status: 'running',
|
|
1052
|
-
});
|
|
1053
|
-
let spawned;
|
|
1054
|
-
try {
|
|
1055
|
-
spawned = this.#o.spawnFire({
|
|
1056
|
-
job: latest,
|
|
1057
|
-
runId,
|
|
1058
|
-
key,
|
|
1059
|
-
trigger,
|
|
1060
|
-
...(run.scheduledFor ? { scheduledFor: run.scheduledFor } : {}),
|
|
1061
|
-
epoch: this.#o.epoch,
|
|
1062
|
-
});
|
|
1063
|
-
}
|
|
1064
|
-
catch (error) {
|
|
1065
|
-
this.#finalize(latest, run, {
|
|
1066
|
-
...this.#emptyResult(latest, run),
|
|
1067
|
-
status: 'failed',
|
|
1068
|
-
exitCode: 1,
|
|
1069
|
-
reason: `the run could not be started: ${error instanceof Error ? error.message : String(error)}`,
|
|
1070
|
-
}, now);
|
|
1071
|
-
continue;
|
|
1072
|
-
}
|
|
1073
|
-
this.#running.set(runId, {
|
|
1074
|
-
jobId: job.id,
|
|
1075
|
-
runId,
|
|
1076
|
-
folder: latest.folder.canonical,
|
|
1077
|
-
writes,
|
|
1078
|
-
run: spawned,
|
|
1079
|
-
});
|
|
1080
|
-
this.#o.log.info('scheduled run started', {
|
|
1081
|
-
'namzu.schedule.job_id': job.id,
|
|
1082
|
-
'namzu.schedule.run_id': runId,
|
|
1083
|
-
'namzu.schedule.trigger': trigger,
|
|
1084
|
-
});
|
|
1085
|
-
void spawned.exited.then(() => {
|
|
1086
|
-
const tracked = this.#running.get(runId);
|
|
1087
|
-
if (tracked)
|
|
1088
|
-
this.#running.set(runId, { ...tracked, run: undefined });
|
|
1089
|
-
const jobNow = readJob(paths, job.id) ?? latest;
|
|
1090
|
-
const state = readState(paths, job.id);
|
|
1091
|
-
if (state.activeRun?.runId === runId) {
|
|
1092
|
-
const result = readRunResult(paths, job.id, runId);
|
|
1093
|
-
this.#finalize(jobNow, state.activeRun, isFinal(result)
|
|
1094
|
-
? result
|
|
1095
|
-
: {
|
|
1096
|
-
...this.#emptyResult(jobNow, state.activeRun),
|
|
1097
|
-
...(result ?? {}),
|
|
1098
|
-
status: 'interrupted',
|
|
1099
|
-
exitCode: 1,
|
|
1100
|
-
reason: 'the run ended without recording a result',
|
|
1101
|
-
}, this.#now());
|
|
1102
|
-
}
|
|
1103
|
-
else {
|
|
1104
|
-
this.#running.delete(runId);
|
|
1105
|
-
// The job was removed (`remove --force`) while this run went on:
|
|
1106
|
-
// nothing will ever settle it, so its end is written here, where
|
|
1107
|
-
// `prune` finds it.
|
|
1108
|
-
if (!readJob(paths, job.id)) {
|
|
1109
|
-
const result = readRunResult(paths, job.id, runId);
|
|
1110
|
-
appendRunRecord(paths, job.id, run, isFinal(result)
|
|
1111
|
-
? result
|
|
1112
|
-
: {
|
|
1113
|
-
...this.#emptyResult(latest, run),
|
|
1114
|
-
...(result ?? {}),
|
|
1115
|
-
status: 'interrupted',
|
|
1116
|
-
exitCode: 1,
|
|
1117
|
-
reason: 'the run ended without recording a result',
|
|
1118
|
-
}, new Date(this.#now()).toISOString());
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
this.wake();
|
|
1122
|
-
});
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
/** For tests: wait until notifications and archiving started by finalisation are done. */
|
|
1126
|
-
async settled() {
|
|
1127
|
-
await Promise.allSettled(this.#finalizing.splice(0));
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
/** A manual run's occurrence key is this and its run id. */
|
|
1131
|
-
export const MANUAL_KEY_PREFIX = 'manual-';
|
|
1132
|
-
/**
|
|
1133
|
-
* Append the record of how a run ended (or parked) to its job's history. A
|
|
1134
|
-
* run still `running` is recorded `interrupted`: the record is final.
|
|
1135
|
-
*/
|
|
1136
|
-
export function appendRunRecord(paths, jobId, run, result, at) {
|
|
1137
|
-
const status = result.status === 'running' ? 'interrupted' : result.status;
|
|
1138
|
-
appendHistory(paths, jobId, {
|
|
1139
|
-
v: runResultVersion({
|
|
1140
|
-
status,
|
|
1141
|
-
gateResult: result.gateResult,
|
|
1142
|
-
scriptOutput: result.scriptOutput,
|
|
1143
|
-
}),
|
|
1144
|
-
kind: 'run',
|
|
1145
|
-
at,
|
|
1146
|
-
runId: run.runId,
|
|
1147
|
-
key: run.key,
|
|
1148
|
-
trigger: run.trigger,
|
|
1149
|
-
...(run.scheduledFor ? { scheduledFor: run.scheduledFor } : {}),
|
|
1150
|
-
startedAt: run.startedAt,
|
|
1151
|
-
...(status === 'awaiting-approval' ? {} : { endedAt: result.endedAt ?? at }),
|
|
1152
|
-
...(run.delayedMs
|
|
1153
|
-
? { delayedMs: run.delayedMs, delayReason: run.delayReason ?? 'concurrency-cap' }
|
|
1154
|
-
: {}),
|
|
1155
|
-
...(result.sessionId ? { sessionId: result.sessionId } : {}),
|
|
1156
|
-
status,
|
|
1157
|
-
...(result.reason ? { reason: result.reason } : {}),
|
|
1158
|
-
exitCode: result.exitCode,
|
|
1159
|
-
...(result.summary ? { summary: result.summary } : {}),
|
|
1160
|
-
...(result.usage ? { usage: result.usage } : {}),
|
|
1161
|
-
...(result.warnings ? { warnings: result.warnings } : {}),
|
|
1162
|
-
...(result.refusedCalls ? { refusedCalls: result.refusedCalls } : {}),
|
|
1163
|
-
...(result.failedCalls ? { failedCalls: result.failedCalls } : {}),
|
|
1164
|
-
...(result.gateResult ? { gateResult: result.gateResult } : {}),
|
|
1165
|
-
...(result.scriptOutput ? { scriptOutput: result.scriptOutput } : {}),
|
|
1166
|
-
});
|
|
1167
|
-
}
|
|
1168
|
-
/** Where `schedule stop` leaves its request. See `ScheduleDaemon#stopRequested`. */
|
|
1169
|
-
export function stopRequestPath(paths) {
|
|
1170
|
-
return join(paths.daemon, 'stop.json');
|
|
1171
|
-
}
|
|
1172
|
-
/** Ask every daemon of this home, owner or standby, to stop; or clear the request. */
|
|
1173
|
-
export function requestStop(paths, stop) {
|
|
1174
|
-
if (stop)
|
|
1175
|
-
writeJsonAtomic(stopRequestPath(paths), {
|
|
1176
|
-
v: 1,
|
|
1177
|
-
kind: 'schedule-stop',
|
|
1178
|
-
at: new Date().toISOString(),
|
|
1179
|
-
});
|
|
1180
|
-
else
|
|
1181
|
-
rmSync(stopRequestPath(paths), { force: true });
|
|
1182
|
-
}
|
|
1183
|
-
/** Spawn `node <bin> schedule __fire …` with its output going to a log file, not a pipe. */
|
|
1184
|
-
export function spawnFireProcess(options) {
|
|
1185
|
-
return (request) => {
|
|
1186
|
-
const logPath = options.paths.runLog(request.job.id, request.runId);
|
|
1187
|
-
ensureDir(dirname(logPath));
|
|
1188
|
-
writeFileSync(logPath, '', { flag: 'a', mode: PRIVATE_FILE_MODE });
|
|
1189
|
-
const fd = openSync(logPath, 'a', PRIVATE_FILE_MODE);
|
|
1190
|
-
let child;
|
|
1191
|
-
try {
|
|
1192
|
-
child = spawn(options.node, [
|
|
1193
|
-
options.bin,
|
|
1194
|
-
'schedule',
|
|
1195
|
-
'__fire',
|
|
1196
|
-
'--home',
|
|
1197
|
-
options.paths.home,
|
|
1198
|
-
'--job',
|
|
1199
|
-
request.job.id,
|
|
1200
|
-
'--run',
|
|
1201
|
-
request.runId,
|
|
1202
|
-
'--key',
|
|
1203
|
-
request.key,
|
|
1204
|
-
'--revision',
|
|
1205
|
-
String(request.job.revision),
|
|
1206
|
-
'--trigger',
|
|
1207
|
-
request.trigger,
|
|
1208
|
-
...(request.scheduledFor ? ['--scheduled-for', request.scheduledFor] : []),
|
|
1209
|
-
'--epoch',
|
|
1210
|
-
request.epoch,
|
|
1211
|
-
], {
|
|
1212
|
-
cwd: request.job.folder.canonical,
|
|
1213
|
-
env: childEnvironment(options.env, options.paths.home),
|
|
1214
|
-
stdio: ['ignore', fd, fd],
|
|
1215
|
-
detached: process.platform !== 'win32',
|
|
1216
|
-
windowsHide: true,
|
|
1217
|
-
});
|
|
1218
|
-
}
|
|
1219
|
-
finally {
|
|
1220
|
-
closeSync(fd);
|
|
1221
|
-
}
|
|
1222
|
-
const exited = new Promise((resolve) => {
|
|
1223
|
-
child.once('exit', (code) => resolve(code));
|
|
1224
|
-
child.once('error', () => resolve(null));
|
|
1225
|
-
});
|
|
1226
|
-
child.unref();
|
|
1227
|
-
return {
|
|
1228
|
-
exited,
|
|
1229
|
-
terminate: () => {
|
|
1230
|
-
try {
|
|
1231
|
-
child.kill('SIGTERM');
|
|
1232
|
-
}
|
|
1233
|
-
catch { }
|
|
1234
|
-
},
|
|
1235
|
-
};
|
|
1236
|
-
};
|
|
1237
|
-
}
|
|
1238
|
-
/**
|
|
1239
|
-
* The CLI as installed, cheaply: its version file, its entry point and the
|
|
1240
|
-
* scheduler's own modules, by size and time. An npm install rewrites every
|
|
1241
|
-
* file; a rebuild rewrites the modules that changed.
|
|
1242
|
-
*/
|
|
1243
|
-
export function installedFingerprint(bin) {
|
|
1244
|
-
const dist = dirname(bin);
|
|
1245
|
-
const watched = [
|
|
1246
|
-
join(dist, '..', 'package.json'),
|
|
1247
|
-
bin,
|
|
1248
|
-
join(dist, 'schedule', 'daemon', 'daemon.js'),
|
|
1249
|
-
join(dist, 'schedule', 'fire', 'fire.js'),
|
|
1250
|
-
];
|
|
1251
|
-
return () => {
|
|
1252
|
-
const parts = [];
|
|
1253
|
-
for (const path of watched) {
|
|
1254
|
-
try {
|
|
1255
|
-
const st = statSync(path);
|
|
1256
|
-
parts.push(`${st.size}:${st.mtimeMs}`);
|
|
1257
|
-
}
|
|
1258
|
-
catch {
|
|
1259
|
-
parts.push('missing');
|
|
1260
|
-
}
|
|
1261
|
-
}
|
|
1262
|
-
return parts.join('|');
|
|
1263
|
-
};
|
|
1264
|
-
}
|
|
1265
|
-
//# sourceMappingURL=daemon.js.map
|