@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
|
@@ -0,0 +1,1284 @@
|
|
|
1
|
+
import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
2
|
+
const require = __namzuCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
expandHeadlessCommand,
|
|
5
|
+
hostCommandNames
|
|
6
|
+
} from "./chunk-N5IF64K3.js";
|
|
7
|
+
import {
|
|
8
|
+
withTerminationHandling
|
|
9
|
+
} from "./chunk-7WJOQ6EA.js";
|
|
10
|
+
import "./chunk-TBIX6JRE.js";
|
|
11
|
+
import {
|
|
12
|
+
loadOutputSchema
|
|
13
|
+
} from "./chunk-AXIGFKJF.js";
|
|
14
|
+
import "./chunk-JV3LONAU.js";
|
|
15
|
+
import {
|
|
16
|
+
decideHeadlessTrust
|
|
17
|
+
} from "./chunk-C5WBEO3X.js";
|
|
18
|
+
import "./chunk-PYG7DZ2D.js";
|
|
19
|
+
import "./chunk-JPPC4LJF.js";
|
|
20
|
+
import "./chunk-KU3W6IHV.js";
|
|
21
|
+
import "./chunk-HE7WUOX2.js";
|
|
22
|
+
import {
|
|
23
|
+
resolveTrustedProjectContext
|
|
24
|
+
} from "./chunk-CHIEVVQ2.js";
|
|
25
|
+
import "./chunk-US5ZFPAU.js";
|
|
26
|
+
import "./chunk-6LLJQ3KY.js";
|
|
27
|
+
import {
|
|
28
|
+
EXIT_FAIL,
|
|
29
|
+
EXIT_OK,
|
|
30
|
+
EXIT_UNTRUSTED,
|
|
31
|
+
EXIT_USAGE
|
|
32
|
+
} from "./chunk-Y7B67G22.js";
|
|
33
|
+
import {
|
|
34
|
+
applyProviderFlags,
|
|
35
|
+
buildGate,
|
|
36
|
+
loadSkillsContext,
|
|
37
|
+
parseExecFlags,
|
|
38
|
+
resolveWorkingDirectory,
|
|
39
|
+
unknownOptionMessage
|
|
40
|
+
} from "./chunk-HFJHHCTY.js";
|
|
41
|
+
import {
|
|
42
|
+
duration,
|
|
43
|
+
pauseWait
|
|
44
|
+
} from "./chunk-XEUQN4JC.js";
|
|
45
|
+
import {
|
|
46
|
+
compilePermissions,
|
|
47
|
+
warnLegacyMcpPermissionNames
|
|
48
|
+
} from "./chunk-Q5YM2GCX.js";
|
|
49
|
+
import {
|
|
50
|
+
describeTurnInterruption,
|
|
51
|
+
retryAfterMs
|
|
52
|
+
} from "./chunk-WM2JEUGV.js";
|
|
53
|
+
import {
|
|
54
|
+
cliLogger,
|
|
55
|
+
contextLogging,
|
|
56
|
+
createStderrSink,
|
|
57
|
+
installCliLogging
|
|
58
|
+
} from "./chunk-HBBB2CAC.js";
|
|
59
|
+
import "./chunk-EEDZOGV4.js";
|
|
60
|
+
import {
|
|
61
|
+
resolvePermissionMode
|
|
62
|
+
} from "./chunk-5GRV6P5C.js";
|
|
63
|
+
import {
|
|
64
|
+
attachSessionExport
|
|
65
|
+
} from "./chunk-FTMTO72X.js";
|
|
66
|
+
import "./chunk-LXB3S4IC.js";
|
|
67
|
+
import "./chunk-OH6TB27S.js";
|
|
68
|
+
import {
|
|
69
|
+
closeSessions,
|
|
70
|
+
listRecent,
|
|
71
|
+
loadConversation,
|
|
72
|
+
loadResumableConversation,
|
|
73
|
+
openSessions,
|
|
74
|
+
resolveConversation,
|
|
75
|
+
startConversation
|
|
76
|
+
} from "./chunk-TIGWWAJI.js";
|
|
77
|
+
import "./chunk-H6B6AROX.js";
|
|
78
|
+
import "./chunk-A5UXODFL.js";
|
|
79
|
+
import "./chunk-OLPOM3DR.js";
|
|
80
|
+
import "./chunk-CG65NUSJ.js";
|
|
81
|
+
import "./chunk-JORONMD3.js";
|
|
82
|
+
import "./chunk-Q24K7536.js";
|
|
83
|
+
import "./chunk-NQY5P2EB.js";
|
|
84
|
+
import {
|
|
85
|
+
BOOT_EVENT_NAMES,
|
|
86
|
+
EVENT_NAME_ATTRIBUTE,
|
|
87
|
+
TurnCancelled,
|
|
88
|
+
asSessionId,
|
|
89
|
+
generateSessionId,
|
|
90
|
+
isCompactionMessage,
|
|
91
|
+
isModelContentOmission,
|
|
92
|
+
isProjectInstructionMessageSource,
|
|
93
|
+
isRuntimeContextMessageSource,
|
|
94
|
+
isWorkingMemoryMessage,
|
|
95
|
+
jsonLinesSink
|
|
96
|
+
} from "./chunk-EWKJGHRO.js";
|
|
97
|
+
import {
|
|
98
|
+
__name
|
|
99
|
+
} from "./chunk-76FLAFCG.js";
|
|
100
|
+
|
|
101
|
+
// src/commands/exec.ts
|
|
102
|
+
import { relative, resolve } from "node:path";
|
|
103
|
+
|
|
104
|
+
// src/commands/prior-messages.ts
|
|
105
|
+
var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
|
|
106
|
+
var isFiniteNumber = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value), "isFiniteNumber");
|
|
107
|
+
function optional(value, key, path, accepts, expected) {
|
|
108
|
+
const candidate = value[key];
|
|
109
|
+
return candidate === void 0 || accepts(candidate) ? null : `${path}.${key} must be ${expected}`;
|
|
110
|
+
}
|
|
111
|
+
__name(optional, "optional");
|
|
112
|
+
function stringField(value, key, path) {
|
|
113
|
+
return typeof value[key] === "string" ? null : `${path}.${key} must be a string`;
|
|
114
|
+
}
|
|
115
|
+
__name(stringField, "stringField");
|
|
116
|
+
function validateCommon(value, path) {
|
|
117
|
+
return (
|
|
118
|
+
// A string, not a checked `MessageId`: this file validates spelling
|
|
119
|
+
// the same way it already does for `toolCalls[].id`, never provenance
|
|
120
|
+
// — `query()`'s own reconciliation is what tells an id this log
|
|
121
|
+
// actually recorded from one a host invented, refusing the latter as
|
|
122
|
+
// `stale_cached_history` (`'foreign'`) rather than trusting it here.
|
|
123
|
+
// Keeping it (not stripping it) is what lets a host that reads its
|
|
124
|
+
// prior turn back from `namzu history --session <key>` (which DOES
|
|
125
|
+
// carry the real durable id) feed that same history into a stateless
|
|
126
|
+
// `exec --json` call and have it reconcile by id.
|
|
127
|
+
optional(value, "id", path, (candidate) => typeof candidate === "string", "a string") ?? optional(value, "timestamp", path, isFiniteNumber, "a finite number") ?? optional(
|
|
128
|
+
value,
|
|
129
|
+
"cacheHint",
|
|
130
|
+
path,
|
|
131
|
+
(candidate) => candidate === "cache" || candidate === "ephemeral" || candidate === "none",
|
|
132
|
+
'"cache", "ephemeral", or "none"'
|
|
133
|
+
) ?? optional(value, "retain", path, (candidate) => typeof candidate === "boolean", "a boolean")
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
__name(validateCommon, "validateCommon");
|
|
137
|
+
function validateAttachment(value, path) {
|
|
138
|
+
if (!isObject(value)) return `${path} must be an attachment object`;
|
|
139
|
+
const type = value.type;
|
|
140
|
+
if (type === "stored") {
|
|
141
|
+
return `${path} is a stored attachment reference, but stateless exec --json has no attachment store; send inline data instead`;
|
|
142
|
+
}
|
|
143
|
+
if (type === "document") {
|
|
144
|
+
return stringField(value, "data", path) ?? stringField(value, "mediaType", path) ?? optional(value, "name", path, (candidate) => typeof candidate === "string", "a string") ?? optional(value, "citations", path, (candidate) => typeof candidate === "boolean", "a boolean");
|
|
145
|
+
}
|
|
146
|
+
if (type !== void 0 && type !== "image") {
|
|
147
|
+
return `${path}.type must be "image", "document", "stored", or absent`;
|
|
148
|
+
}
|
|
149
|
+
return stringField(value, "data", path) ?? stringField(value, "mediaType", path) ?? optional(
|
|
150
|
+
value,
|
|
151
|
+
"modelOmission",
|
|
152
|
+
path,
|
|
153
|
+
isModelContentOmission,
|
|
154
|
+
"a provider-rejected model-delivery marker"
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
__name(validateAttachment, "validateAttachment");
|
|
158
|
+
function validateAttachments(value, path) {
|
|
159
|
+
if (!Array.isArray(value)) return `${path} must be an array`;
|
|
160
|
+
for (let index = 0; index < value.length; index++) {
|
|
161
|
+
const error = validateAttachment(value[index], `${path}[${index}]`);
|
|
162
|
+
if (error) return error;
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
__name(validateAttachments, "validateAttachments");
|
|
167
|
+
function validateUserSource(value, path) {
|
|
168
|
+
if (!isObject(value)) return `${path} must be a source object`;
|
|
169
|
+
if (value.type === "project-instructions") {
|
|
170
|
+
return isProjectInstructionMessageSource(value) ? null : `${path} must contain unique canonical project-relative AGENTS.md paths`;
|
|
171
|
+
}
|
|
172
|
+
if (value.type === "runtime-context") {
|
|
173
|
+
return isRuntimeContextMessageSource(value) ? null : `${path} must contain an admitted runtime context kind`;
|
|
174
|
+
}
|
|
175
|
+
if (value.type !== "goal-round") {
|
|
176
|
+
return `${path}.type must be "goal-round", "project-instructions", or "runtime-context"`;
|
|
177
|
+
}
|
|
178
|
+
return stringField(value, "goalId", path) ?? stringField(value, "objective", path) ?? (isFiniteNumber(value.goalRevision) ? null : `${path}.goalRevision must be a finite number`) ?? (isFiniteNumber(value.round) ? null : `${path}.round must be a finite number`) ?? (isFiniteNumber(value.maxGoalRounds) ? null : `${path}.maxGoalRounds must be a finite number`);
|
|
179
|
+
}
|
|
180
|
+
__name(validateUserSource, "validateUserSource");
|
|
181
|
+
function validateAssistantSource(value, path) {
|
|
182
|
+
if (!isObject(value)) return `${path} must be a source object`;
|
|
183
|
+
if (value.type !== "model") return `${path}.type must be "model"`;
|
|
184
|
+
return stringField(value, "providerId", path) ?? stringField(value, "model", path) ?? (Number.isSafeInteger(value.chainIndex) && value.chainIndex >= 0 ? null : `${path}.chainIndex must be a non-negative safe integer`);
|
|
185
|
+
}
|
|
186
|
+
__name(validateAssistantSource, "validateAssistantSource");
|
|
187
|
+
var isCount = /* @__PURE__ */ __name((candidate) => Number.isSafeInteger(candidate) && candidate >= 0, "isCount");
|
|
188
|
+
function validateInputError(value, path) {
|
|
189
|
+
if (!isObject(value)) return `${path} must be an object`;
|
|
190
|
+
return (value.reason === "truncated" || value.reason === "malformed" ? null : `${path}.reason must be "truncated" or "malformed"`) ?? optional(
|
|
191
|
+
value,
|
|
192
|
+
"finishReason",
|
|
193
|
+
path,
|
|
194
|
+
(candidate) => candidate === "stop" || candidate === "tool_calls" || candidate === "length" || candidate === "content_filter",
|
|
195
|
+
'"stop", "tool_calls", "length", or "content_filter"'
|
|
196
|
+
) ?? stringField(value, "parseError", path) ?? optional(value, "offset", path, isCount, "a non-negative safe integer") ?? (isCount(value.length) ? null : `${path}.length must be a non-negative safe integer`) ?? (isCount(value.precedingLength) ? null : `${path}.precedingLength must be a non-negative safe integer`) ?? optional(
|
|
197
|
+
value,
|
|
198
|
+
"finishDetail",
|
|
199
|
+
path,
|
|
200
|
+
(candidate) => candidate === "context_window",
|
|
201
|
+
'"context_window"'
|
|
202
|
+
) ?? optional(value, "outputTokens", path, isCount, "a non-negative safe integer") ?? optional(value, "reasoningTokens", path, isCount, "a non-negative safe integer");
|
|
203
|
+
}
|
|
204
|
+
__name(validateInputError, "validateInputError");
|
|
205
|
+
function validateToolCall(value, path) {
|
|
206
|
+
if (!isObject(value)) return `${path} must be a tool-call object`;
|
|
207
|
+
const fn = value.function;
|
|
208
|
+
if (!isObject(fn)) return `${path}.function must be an object`;
|
|
209
|
+
const metadata = value.metadata;
|
|
210
|
+
return stringField(value, "id", path) ?? (value.type === "function" ? null : `${path}.type must be "function"`) ?? stringField(fn, "name", `${path}.function`) ?? stringField(fn, "arguments", `${path}.function`) ?? (metadata === void 0 ? null : !isObject(metadata) ? `${path}.metadata must be an object` : optional(
|
|
211
|
+
metadata,
|
|
212
|
+
"inputTruncated",
|
|
213
|
+
`${path}.metadata`,
|
|
214
|
+
(candidate) => typeof candidate === "boolean",
|
|
215
|
+
"a boolean"
|
|
216
|
+
) ?? optional(
|
|
217
|
+
metadata,
|
|
218
|
+
"partialArguments",
|
|
219
|
+
`${path}.metadata`,
|
|
220
|
+
(candidate) => typeof candidate === "string",
|
|
221
|
+
"a string"
|
|
222
|
+
) ?? (metadata.inputError === void 0 ? null : validateInputError(metadata.inputError, `${path}.metadata.inputError`)));
|
|
223
|
+
}
|
|
224
|
+
__name(validateToolCall, "validateToolCall");
|
|
225
|
+
function validateReasoning(value, path) {
|
|
226
|
+
if (!isObject(value)) return `${path} must be a reasoning object`;
|
|
227
|
+
return (value.type === "thinking" || value.type === "redacted_thinking" ? null : `${path}.type must be "thinking" or "redacted_thinking"`) ?? optional(value, "text", path, (candidate) => typeof candidate === "string", "a string") ?? optional(value, "signature", path, (candidate) => typeof candidate === "string", "a string") ?? optional(value, "encrypted", path, (candidate) => typeof candidate === "string", "a string");
|
|
228
|
+
}
|
|
229
|
+
__name(validateReasoning, "validateReasoning");
|
|
230
|
+
function validateCitation(value, path) {
|
|
231
|
+
if (!isObject(value)) return `${path} must be a citation object`;
|
|
232
|
+
const location = value.location;
|
|
233
|
+
if (!isObject(location)) return `${path}.location must be an object`;
|
|
234
|
+
return stringField(value, "citedText", path) ?? (isFiniteNumber(value.documentIndex) ? null : `${path}.documentIndex must be a finite number`) ?? optional(
|
|
235
|
+
value,
|
|
236
|
+
"documentTitle",
|
|
237
|
+
path,
|
|
238
|
+
(candidate) => typeof candidate === "string",
|
|
239
|
+
"a string"
|
|
240
|
+
) ?? (location.kind === "page" || location.kind === "char" || location.kind === "block" ? null : `${path}.location.kind must be "page", "char", or "block"`) ?? (isFiniteNumber(location.start) ? null : `${path}.location.start must be a finite number`) ?? (isFiniteNumber(location.end) ? null : `${path}.location.end must be a finite number`);
|
|
241
|
+
}
|
|
242
|
+
__name(validateCitation, "validateCitation");
|
|
243
|
+
function validateToolResultBlock(value, path) {
|
|
244
|
+
if (!isObject(value)) return `${path} must be a tool-result block object`;
|
|
245
|
+
if (value.type === "text") return stringField(value, "text", path);
|
|
246
|
+
if (value.type === "image") {
|
|
247
|
+
return stringField(value, "data", path) ?? stringField(value, "mediaType", path) ?? optional(
|
|
248
|
+
value,
|
|
249
|
+
"modelOmission",
|
|
250
|
+
path,
|
|
251
|
+
isModelContentOmission,
|
|
252
|
+
"a provider-rejected model-delivery marker"
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
if (value.type === "document") return validateAttachment(value, path);
|
|
256
|
+
return `${path}.type must be "text", "image", or "document"`;
|
|
257
|
+
}
|
|
258
|
+
__name(validateToolResultBlock, "validateToolResultBlock");
|
|
259
|
+
function validateMessage(value, index) {
|
|
260
|
+
const path = `messages[${index}]`;
|
|
261
|
+
if (!isObject(value)) return `${path} must be an object`;
|
|
262
|
+
const common = validateCommon(value, path);
|
|
263
|
+
if (common) return common;
|
|
264
|
+
if (value.role === "system") {
|
|
265
|
+
if (typeof value.content !== "string") return `${path}.content must be a string`;
|
|
266
|
+
return isCompactionMessage(value.content) || isWorkingMemoryMessage(value.content) ? null : `${path} is an arbitrary system prompt; stateless history accepts only compacted or working-memory conversation state`;
|
|
267
|
+
}
|
|
268
|
+
if (value.role === "user") {
|
|
269
|
+
if (typeof value.content !== "string") return `${path}.content must be a string`;
|
|
270
|
+
return (value.attachments === void 0 ? null : validateAttachments(value.attachments, `${path}.attachments`)) ?? (value.source === void 0 ? null : validateUserSource(value.source, `${path}.source`));
|
|
271
|
+
}
|
|
272
|
+
if (value.role === "assistant") {
|
|
273
|
+
if (typeof value.content !== "string" && value.content !== null) {
|
|
274
|
+
return `${path}.content must be a string or null`;
|
|
275
|
+
}
|
|
276
|
+
if (value.toolCalls !== void 0) {
|
|
277
|
+
if (!Array.isArray(value.toolCalls)) return `${path}.toolCalls must be an array`;
|
|
278
|
+
for (let callIndex = 0; callIndex < value.toolCalls.length; callIndex++) {
|
|
279
|
+
const error = validateToolCall(
|
|
280
|
+
value.toolCalls[callIndex],
|
|
281
|
+
`${path}.toolCalls[${callIndex}]`
|
|
282
|
+
);
|
|
283
|
+
if (error) return error;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (value.reasoning !== void 0) {
|
|
287
|
+
if (!Array.isArray(value.reasoning)) return `${path}.reasoning must be an array`;
|
|
288
|
+
for (let reasoningIndex = 0; reasoningIndex < value.reasoning.length; reasoningIndex++) {
|
|
289
|
+
const error = validateReasoning(
|
|
290
|
+
value.reasoning[reasoningIndex],
|
|
291
|
+
`${path}.reasoning[${reasoningIndex}]`
|
|
292
|
+
);
|
|
293
|
+
if (error) return error;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (value.citations !== void 0) {
|
|
297
|
+
if (!Array.isArray(value.citations)) return `${path}.citations must be an array`;
|
|
298
|
+
for (let citationIndex = 0; citationIndex < value.citations.length; citationIndex++) {
|
|
299
|
+
const error = validateCitation(
|
|
300
|
+
value.citations[citationIndex],
|
|
301
|
+
`${path}.citations[${citationIndex}]`
|
|
302
|
+
);
|
|
303
|
+
if (error) return error;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return value.source === void 0 ? null : validateAssistantSource(value.source, `${path}.source`);
|
|
307
|
+
}
|
|
308
|
+
if (value.role === "tool") {
|
|
309
|
+
if (typeof value.content !== "string") {
|
|
310
|
+
if (!Array.isArray(value.content)) {
|
|
311
|
+
return `${path}.content must be a string or tool-result block array`;
|
|
312
|
+
}
|
|
313
|
+
for (let blockIndex = 0; blockIndex < value.content.length; blockIndex++) {
|
|
314
|
+
const error = validateToolResultBlock(
|
|
315
|
+
value.content[blockIndex],
|
|
316
|
+
`${path}.content[${blockIndex}]`
|
|
317
|
+
);
|
|
318
|
+
if (error) return error;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return stringField(value, "toolCallId", path) ?? optional(value, "isError", path, (candidate) => typeof candidate === "boolean", "a boolean");
|
|
322
|
+
}
|
|
323
|
+
return `${path}.role must be "system", "user", "assistant", or "tool"`;
|
|
324
|
+
}
|
|
325
|
+
__name(validateMessage, "validateMessage");
|
|
326
|
+
function validateSequence(messages) {
|
|
327
|
+
const seenCallIds = /* @__PURE__ */ new Set();
|
|
328
|
+
let pending = null;
|
|
329
|
+
let sawConversation = false;
|
|
330
|
+
for (let index = 0; index < messages.length; index++) {
|
|
331
|
+
const message = messages[index];
|
|
332
|
+
if (!message) continue;
|
|
333
|
+
if (pending) {
|
|
334
|
+
if (message.role !== "tool") {
|
|
335
|
+
return `messages[${index}] cannot appear before every tool call from messages[${pending.openedAt}] has a result`;
|
|
336
|
+
}
|
|
337
|
+
if (!pending.ids.has(message.toolCallId)) {
|
|
338
|
+
return `messages[${index}].toolCallId does not match an unanswered call from messages[${pending.openedAt}]`;
|
|
339
|
+
}
|
|
340
|
+
pending.ids.delete(message.toolCallId);
|
|
341
|
+
if (pending.ids.size === 0) pending = null;
|
|
342
|
+
continue;
|
|
343
|
+
}
|
|
344
|
+
if (message.role === "system") {
|
|
345
|
+
if (sawConversation) return `messages[${index}] is a system message after conversation began`;
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if (!sawConversation) {
|
|
349
|
+
sawConversation = true;
|
|
350
|
+
if (message.role !== "user") {
|
|
351
|
+
return `messages[${index}] must be a user message at the start of conversation history`;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (message.role === "tool") return `messages[${index}] is a tool result with no pending call`;
|
|
355
|
+
if (message.role !== "assistant" || !message.toolCalls || message.toolCalls.length === 0) {
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const ids = /* @__PURE__ */ new Set();
|
|
359
|
+
for (let callIndex = 0; callIndex < message.toolCalls.length; callIndex++) {
|
|
360
|
+
const id = message.toolCalls[callIndex]?.id;
|
|
361
|
+
if (!id) continue;
|
|
362
|
+
if (seenCallIds.has(id) || ids.has(id)) {
|
|
363
|
+
return `messages[${index}].toolCalls[${callIndex}].id duplicates tool call id "${id}"`;
|
|
364
|
+
}
|
|
365
|
+
ids.add(id);
|
|
366
|
+
seenCallIds.add(id);
|
|
367
|
+
}
|
|
368
|
+
pending = { openedAt: index, ids };
|
|
369
|
+
}
|
|
370
|
+
if (pending) {
|
|
371
|
+
return `messages[${pending.openedAt}] has tool calls without immediate results for: ${[...pending.ids].join(", ")}`;
|
|
372
|
+
}
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
__name(validateSequence, "validateSequence");
|
|
376
|
+
function parsePriorMessages(raw) {
|
|
377
|
+
const trimmed = raw.trim();
|
|
378
|
+
if (!trimmed) return { ok: true, messages: [] };
|
|
379
|
+
let parsed;
|
|
380
|
+
try {
|
|
381
|
+
parsed = JSON.parse(trimmed);
|
|
382
|
+
} catch {
|
|
383
|
+
return { ok: false, error: "stdin history is not valid JSON" };
|
|
384
|
+
}
|
|
385
|
+
if (!Array.isArray(parsed)) {
|
|
386
|
+
return { ok: false, error: "stdin history must be a JSON Message[] array" };
|
|
387
|
+
}
|
|
388
|
+
for (let index = 0; index < parsed.length; index++) {
|
|
389
|
+
const error = validateMessage(parsed[index], index);
|
|
390
|
+
if (error) return { ok: false, error };
|
|
391
|
+
}
|
|
392
|
+
const messages = parsed;
|
|
393
|
+
const sequenceError = validateSequence(messages);
|
|
394
|
+
return sequenceError ? { ok: false, error: sequenceError } : { ok: true, messages };
|
|
395
|
+
}
|
|
396
|
+
__name(parsePriorMessages, "parsePriorMessages");
|
|
397
|
+
|
|
398
|
+
// src/commands/stdin.ts
|
|
399
|
+
var FIRST_BYTE_DEADLINE_MS = 250;
|
|
400
|
+
async function readStdin(opts = {}) {
|
|
401
|
+
const input = process.stdin;
|
|
402
|
+
if (input.isTTY) return "";
|
|
403
|
+
const chunks = [];
|
|
404
|
+
const collect = /* @__PURE__ */ __name(async () => {
|
|
405
|
+
for await (const chunk of input) chunks.push(chunk);
|
|
406
|
+
}, "collect");
|
|
407
|
+
if (!opts.deadline) {
|
|
408
|
+
await collect();
|
|
409
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
410
|
+
}
|
|
411
|
+
let timer;
|
|
412
|
+
let settleFirstByte;
|
|
413
|
+
const firstByte = new Promise((resolve2) => {
|
|
414
|
+
settleFirstByte = resolve2;
|
|
415
|
+
timer = setTimeout(() => setImmediate(resolve2), FIRST_BYTE_DEADLINE_MS);
|
|
416
|
+
input.once("readable", settleFirstByte);
|
|
417
|
+
input.once("end", settleFirstByte);
|
|
418
|
+
});
|
|
419
|
+
try {
|
|
420
|
+
await firstByte;
|
|
421
|
+
} finally {
|
|
422
|
+
if (timer) clearTimeout(timer);
|
|
423
|
+
if (settleFirstByte) {
|
|
424
|
+
input.removeListener("readable", settleFirstByte);
|
|
425
|
+
input.removeListener("end", settleFirstByte);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (input.readableEnded || input.readableLength > 0) await collect();
|
|
429
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
430
|
+
}
|
|
431
|
+
__name(readStdin, "readStdin");
|
|
432
|
+
|
|
433
|
+
// src/commands/exec-json.ts
|
|
434
|
+
var EXIT_TURN_IN_PROGRESS = 75;
|
|
435
|
+
function defaultPrefs(detected) {
|
|
436
|
+
const first = detected[0];
|
|
437
|
+
return first ? {
|
|
438
|
+
version: 3,
|
|
439
|
+
providers: [{ id: first.entry.id }],
|
|
440
|
+
subagents: { active: [] }
|
|
441
|
+
} : null;
|
|
442
|
+
}
|
|
443
|
+
__name(defaultPrefs, "defaultPrefs");
|
|
444
|
+
async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOutput) {
|
|
445
|
+
let ctx = bootstrapCtx;
|
|
446
|
+
const write = /* @__PURE__ */ __name((o) => {
|
|
447
|
+
process.stdout.write(`${JSON.stringify(o)}
|
|
448
|
+
`);
|
|
449
|
+
}, "write");
|
|
450
|
+
const fail = /* @__PURE__ */ __name((message) => {
|
|
451
|
+
write({ kind: "error", message });
|
|
452
|
+
write({ kind: "done" });
|
|
453
|
+
return EXIT_OK;
|
|
454
|
+
}, "fail");
|
|
455
|
+
const refuse = /* @__PURE__ */ __name((message) => {
|
|
456
|
+
write({ kind: "error", message });
|
|
457
|
+
write({ kind: "done" });
|
|
458
|
+
return EXIT_FAIL;
|
|
459
|
+
}, "refuse");
|
|
460
|
+
const limitsFromFlags = {
|
|
461
|
+
...flags.maxIterations !== null ? { maxIterations: flags.maxIterations } : {},
|
|
462
|
+
...flags.tokenBudget !== null ? { tokenBudget: flags.tokenBudget } : {}
|
|
463
|
+
};
|
|
464
|
+
if (flags.unknown.length > 0) return fail(unknownOptionMessage(flags.unknown));
|
|
465
|
+
if (structuredOutput && "error" in structuredOutput) return fail(structuredOutput.error);
|
|
466
|
+
if (flags.continueLast || flags.resume !== null) {
|
|
467
|
+
return fail(
|
|
468
|
+
"exec --json does not take --continue or --resume; they belong to the default mode. Bind history with --session <id>, which keys a persisted conversation in this folder."
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
if (flags.waitForProviderMs !== null) {
|
|
472
|
+
return fail(
|
|
473
|
+
"exec --json does not take --wait-for-provider; it belongs to the default mode. A host reads the paused event and resumes when it chooses."
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
const sessionKey = flags.session;
|
|
477
|
+
const prompt = flags.rest.join(" ").trim();
|
|
478
|
+
if (!prompt) return fail("no prompt \u2014 pass it as an argument");
|
|
479
|
+
const resolved = resolveWorkingDirectory(flags.cwd);
|
|
480
|
+
if ("error" in resolved) return fail(resolved.error);
|
|
481
|
+
const requestedCwd = resolved.cwd;
|
|
482
|
+
const trust = decideHeadlessTrust({
|
|
483
|
+
cwd: requestedCwd,
|
|
484
|
+
trustFlag: flags.trust
|
|
485
|
+
});
|
|
486
|
+
if (!trust.allowed) {
|
|
487
|
+
write({ kind: "error", message: trust.message ?? "folder not trusted" });
|
|
488
|
+
write({ kind: "done" });
|
|
489
|
+
return EXIT_UNTRUSTED;
|
|
490
|
+
}
|
|
491
|
+
const cwd = trust.cwd;
|
|
492
|
+
ctx = resolveTrustedProjectContext(bootstrapCtx, cwd);
|
|
493
|
+
const expansion = expandHeadlessCommand(prompt, {
|
|
494
|
+
cwd,
|
|
495
|
+
builtins: hostCommandNames()
|
|
496
|
+
});
|
|
497
|
+
if (expansion.kind === "refused") {
|
|
498
|
+
return expansion.fixable ? fail(expansion.reason) : refuse(expansion.reason);
|
|
499
|
+
}
|
|
500
|
+
const finalPrompt = expansion.kind === "expanded" ? expansion.prompt : prompt;
|
|
501
|
+
let cli;
|
|
502
|
+
let conversationId = null;
|
|
503
|
+
let prior = [];
|
|
504
|
+
if (!sessionKey) {
|
|
505
|
+
const parsed = parsePriorMessages(await readStdin({ deadline: true }));
|
|
506
|
+
if (!parsed.ok) return fail(`invalid stdin history: ${parsed.error}`);
|
|
507
|
+
prior = [...parsed.messages];
|
|
508
|
+
}
|
|
509
|
+
try {
|
|
510
|
+
cli = await openSessions(cwd);
|
|
511
|
+
if (sessionKey) {
|
|
512
|
+
conversationId = await resolveConversation(cli, sessionKey);
|
|
513
|
+
prior = await loadConversation(cli, conversationId);
|
|
514
|
+
}
|
|
515
|
+
} catch (err) {
|
|
516
|
+
if (sessionKey) {
|
|
517
|
+
return refuse(
|
|
518
|
+
`could not open conversation "${sessionKey}": ${err instanceof Error ? err.message : String(err)}. Nothing ran, because continuing the wrong history is worse than not continuing. Drop --session to run this turn stateless.`
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
return refuse(
|
|
522
|
+
`could not open workspace state: ${err instanceof Error ? err.message : String(err)}. Nothing ran, because generated state could not be bound to this working directory.`
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
const logging = contextLogging(ctx);
|
|
526
|
+
installCliLogging(jsonLinesSink(process.stderr), logging.level);
|
|
527
|
+
const { probeAgentSession, createAgentSession } = await import("./agent-UEK2U3RE.js");
|
|
528
|
+
const probe = await probeAgentSession();
|
|
529
|
+
let prefs = probe.preferences ?? defaultPrefs(probe.detected);
|
|
530
|
+
if (!prefs) {
|
|
531
|
+
return refuse(
|
|
532
|
+
"no LLM provider available \u2014 set a credential (e.g. ANTHROPIC_API_KEY) or run `namzu` to pick one"
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
prefs = applyProviderFlags(prefs, flags);
|
|
536
|
+
const modeResult = resolvePermissionMode({
|
|
537
|
+
flag: flags.permissionMode,
|
|
538
|
+
skipPermissions: flags.skipPermissions,
|
|
539
|
+
interactive: false
|
|
540
|
+
});
|
|
541
|
+
if ("error" in modeResult) return fail(modeResult.error);
|
|
542
|
+
warnLegacyMcpPermissionNames(ctx.config.permissions);
|
|
543
|
+
const permissions = compilePermissions(ctx.config.permissions, ctx.config.permissionChecks);
|
|
544
|
+
for (const d of permissions.diagnostics) {
|
|
545
|
+
const where = d.pattern ? `permissions.${d.tool}."${d.pattern}"` : `permissions.${d.tool}`;
|
|
546
|
+
write({ kind: "error", message: `${where}: ${d.message}` });
|
|
547
|
+
}
|
|
548
|
+
const gate = buildGate(flags, cwd);
|
|
549
|
+
const session = await createAgentSession(prefs, probe.detected, {
|
|
550
|
+
cwd,
|
|
551
|
+
...structuredOutput ? { structuredOutput } : {},
|
|
552
|
+
scope: {
|
|
553
|
+
sessionId: conversationId ?? generateSessionId(),
|
|
554
|
+
topicId: cli.topicId,
|
|
555
|
+
projectId: cli.projectId,
|
|
556
|
+
tenantId: cli.tenantId
|
|
557
|
+
},
|
|
558
|
+
stateRoot: cli.root,
|
|
559
|
+
// A keyed conversation appends to its log; a stateless one runs in an
|
|
560
|
+
// in-memory log, so nothing is written for it.
|
|
561
|
+
...conversationId ? { conversationSessions: cli } : { ephemeral: true },
|
|
562
|
+
rules: permissions.rules,
|
|
563
|
+
// The operator's --gate commands, as a standing condition on the
|
|
564
|
+
// answer. Spread rather than passed as undefined so a turn without
|
|
565
|
+
// gates is byte-identical to the one that shipped before them.
|
|
566
|
+
...gate ?? {},
|
|
567
|
+
permissionMode: modeResult.mode,
|
|
568
|
+
...ctx.config.mcpServers ? { mcpServers: ctx.config.mcpServers } : {},
|
|
569
|
+
...ctx.config.plugins ? { plugins: ctx.config.plugins } : {},
|
|
570
|
+
...ctx.config.skills ? { skills: ctx.config.skills } : {},
|
|
571
|
+
...ctx.config.web ? { web: ctx.config.web } : {},
|
|
572
|
+
...ctx.config.hooks ? { hooks: ctx.config.hooks } : {},
|
|
573
|
+
...ctx.config.compaction ? { compaction: ctx.config.compaction } : {},
|
|
574
|
+
...ctx.config.memory ? { memory: ctx.config.memory } : {},
|
|
575
|
+
...Object.keys({ ...ctx.config.limits, ...limitsFromFlags }).length > 0 ? { limits: { ...ctx.config.limits, ...limitsFromFlags } } : {},
|
|
576
|
+
...ctx.config.sandbox ? { sandbox: ctx.config.sandbox } : {},
|
|
577
|
+
// `!== undefined`, not truthiness: an empty list is the operator
|
|
578
|
+
// turning the default screen OFF, and a falsy check would drop it.
|
|
579
|
+
...ctx.config.toolResultScreens !== void 0 ? { toolResultScreens: ctx.config.toolResultScreens } : {}
|
|
580
|
+
});
|
|
581
|
+
if (!session.hasProvider) {
|
|
582
|
+
await session.close();
|
|
583
|
+
const message = session.errorHint ?? "agent is not ready";
|
|
584
|
+
return session.errorKind === "invocation" ? fail(message) : refuse(message);
|
|
585
|
+
}
|
|
586
|
+
if (session.mcpFailed.length > 0) {
|
|
587
|
+
const said = session.mcpFailed.map((f) => `tool server "${f.name}" is not available: ${f.reason}`).join("; ");
|
|
588
|
+
await session.close();
|
|
589
|
+
return refuse(said);
|
|
590
|
+
}
|
|
591
|
+
for (const notice of session.configNotices) {
|
|
592
|
+
write({ kind: "notice", message: notice });
|
|
593
|
+
}
|
|
594
|
+
const reportedMcpDiscoveries = /* @__PURE__ */ new Set();
|
|
595
|
+
const reportMcpDiscoveries = /* @__PURE__ */ __name(() => {
|
|
596
|
+
for (const server of session.mcpStatus?.().connected ?? session.mcpConnected) {
|
|
597
|
+
const notices = [
|
|
598
|
+
...server.drift?.added.map((name) => `tool added: ${name}`) ?? [],
|
|
599
|
+
...server.drift?.removed.map((name) => `tool removed: ${name}`) ?? [],
|
|
600
|
+
...server.drift?.changed.map((name) => `tool changed; earlier definition held: ${name}`) ?? [],
|
|
601
|
+
...server.refused?.map(
|
|
602
|
+
(item) => `${item.kind} name refused by policy: ${item.name} (${item.reason})`
|
|
603
|
+
) ?? []
|
|
604
|
+
];
|
|
605
|
+
for (const detail of notices) {
|
|
606
|
+
const message = `tool server "${server.name}": ${detail}`;
|
|
607
|
+
if (reportedMcpDiscoveries.has(message)) continue;
|
|
608
|
+
reportedMcpDiscoveries.add(message);
|
|
609
|
+
write({ kind: "notice", message });
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}, "reportMcpDiscoveries");
|
|
613
|
+
reportMcpDiscoveries();
|
|
614
|
+
const extraSystem = await loadSkillsContext(cwd, flags.skills, ctx.config.skills);
|
|
615
|
+
const userMessage = {
|
|
616
|
+
role: "user",
|
|
617
|
+
content: finalPrompt,
|
|
618
|
+
timestamp: Date.now()
|
|
619
|
+
};
|
|
620
|
+
const messages = [...prior, userMessage];
|
|
621
|
+
let terminalEvent;
|
|
622
|
+
let budget;
|
|
623
|
+
let busy;
|
|
624
|
+
const turnAbort = new AbortController();
|
|
625
|
+
let stopped = false;
|
|
626
|
+
let settled;
|
|
627
|
+
let ended = false;
|
|
628
|
+
const inConversation = conversationId ? ` in conversation ${conversationId}` : "";
|
|
629
|
+
termination.onTerminate(async (signal) => {
|
|
630
|
+
stopped = true;
|
|
631
|
+
if (!ended) {
|
|
632
|
+
ended = true;
|
|
633
|
+
try {
|
|
634
|
+
write({
|
|
635
|
+
kind: "error",
|
|
636
|
+
code: "terminated",
|
|
637
|
+
message: settled ? `stopped by ${signal} ${settled.state}` : `stopped by ${signal}; the turn was left interrupted${inConversation}. Close it with /abandon in the TUI, or continue it with /resume or \`namzu drain\`.`
|
|
638
|
+
});
|
|
639
|
+
write(
|
|
640
|
+
settled?.last ?? {
|
|
641
|
+
kind: "done",
|
|
642
|
+
...conversationId ? { sessionId: conversationId } : {}
|
|
643
|
+
}
|
|
644
|
+
);
|
|
645
|
+
} catch {
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
turnAbort.abort(new TurnCancelled("user"));
|
|
649
|
+
await session.close();
|
|
650
|
+
closeSessions(cli);
|
|
651
|
+
});
|
|
652
|
+
let paused;
|
|
653
|
+
try {
|
|
654
|
+
for await (const event of session.send(messages, {
|
|
655
|
+
signal: turnAbort.signal,
|
|
656
|
+
...extraSystem ? { extraSystem } : {},
|
|
657
|
+
...flags.effort !== null ? { effort: flags.effort } : {}
|
|
658
|
+
})) {
|
|
659
|
+
if (stopped) continue;
|
|
660
|
+
if ("budget" in event && event.budget) budget = event.budget;
|
|
661
|
+
if (event.kind === "paused") paused = event;
|
|
662
|
+
if (event.kind === "error" && event.turnInProgress) {
|
|
663
|
+
busy = event.turnInProgress;
|
|
664
|
+
write({ ...event, code: "turn_in_progress" });
|
|
665
|
+
} else if (event.kind === "done") terminalEvent = event;
|
|
666
|
+
else write(event);
|
|
667
|
+
}
|
|
668
|
+
} catch (err) {
|
|
669
|
+
if (stopped) return EXIT_OK;
|
|
670
|
+
reportMcpDiscoveries();
|
|
671
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
672
|
+
settled = {
|
|
673
|
+
last: { kind: "done" },
|
|
674
|
+
state: `after the turn failed (${message})${inConversation}.`
|
|
675
|
+
};
|
|
676
|
+
await session.close();
|
|
677
|
+
closeSessions(cli);
|
|
678
|
+
if (stopped) return EXIT_OK;
|
|
679
|
+
ended = true;
|
|
680
|
+
return fail(message);
|
|
681
|
+
}
|
|
682
|
+
if (stopped) return EXIT_OK;
|
|
683
|
+
reportMcpDiscoveries();
|
|
684
|
+
settled = busy ? {
|
|
685
|
+
// Nothing was begun, so nothing was recorded: the conversation's
|
|
686
|
+
// active turn is still the one it was. Not now, rather than not ever.
|
|
687
|
+
last: { kind: "done", sessionId: busy.sessionId },
|
|
688
|
+
state: `; no turn was started in conversation ${busy.sessionId}.`
|
|
689
|
+
} : {
|
|
690
|
+
// The kernel appended this turn to the conversation's log as it ran,
|
|
691
|
+
// so a later `history --session <key>` and the next turn's context
|
|
692
|
+
// see it.
|
|
693
|
+
last: {
|
|
694
|
+
...terminalEvent ?? {
|
|
695
|
+
kind: "done",
|
|
696
|
+
...conversationId ? { sessionId: conversationId } : {}
|
|
697
|
+
},
|
|
698
|
+
...budget ? { budget } : {}
|
|
699
|
+
},
|
|
700
|
+
state: paused ? `while the turn was paused: it keeps checkpoint ${paused.checkpointId}${inConversation}. Continue it with /resume or \`namzu drain\`, or close it with /abandon in the TUI.` : `after the turn ended; it is recorded${inConversation}, and nothing is left to close.`
|
|
701
|
+
};
|
|
702
|
+
await session.close();
|
|
703
|
+
closeSessions(cli);
|
|
704
|
+
if (stopped) return EXIT_OK;
|
|
705
|
+
ended = true;
|
|
706
|
+
write(settled.last);
|
|
707
|
+
return busy ? EXIT_TURN_IN_PROGRESS : 0;
|
|
708
|
+
}
|
|
709
|
+
__name(execJson, "execJson");
|
|
710
|
+
|
|
711
|
+
// src/commands/resume.ts
|
|
712
|
+
async function resolveResume(sessions, request, cwd) {
|
|
713
|
+
if (!request.continueLast && !request.sessionId) return { kind: "fresh" };
|
|
714
|
+
if (request.continueLast && request.sessionId) {
|
|
715
|
+
return {
|
|
716
|
+
kind: "error",
|
|
717
|
+
message: "--continue and --resume ask for different conversations: --continue takes the most recent, --resume takes the one you named. Pass one."
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
if (!sessions) {
|
|
721
|
+
return {
|
|
722
|
+
kind: "error",
|
|
723
|
+
message: `no conversation store in ${cwd} \u2014 it could not be opened, so there is nothing to resume`
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
if (request.continueLast) {
|
|
727
|
+
let recent;
|
|
728
|
+
try {
|
|
729
|
+
recent = await listRecent(sessions, 50);
|
|
730
|
+
} catch (err) {
|
|
731
|
+
return {
|
|
732
|
+
kind: "error",
|
|
733
|
+
message: `conversations in ${cwd} cannot be resumed: ${err instanceof Error ? err.message : String(err)}`
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
const latest = recent[0];
|
|
737
|
+
if (!latest) {
|
|
738
|
+
return {
|
|
739
|
+
kind: "error",
|
|
740
|
+
message: `no previous conversation in ${cwd} \u2014 run without --continue to start one, or pass --cwd if you meant a different directory`
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
return await load(sessions, latest.id, cwd);
|
|
744
|
+
}
|
|
745
|
+
const wanted = request.sessionId;
|
|
746
|
+
return await load(sessions, wanted, cwd);
|
|
747
|
+
}
|
|
748
|
+
__name(resolveResume, "resolveResume");
|
|
749
|
+
async function load(sessions, sessionId, cwd) {
|
|
750
|
+
let messages;
|
|
751
|
+
try {
|
|
752
|
+
messages = await loadResumableConversation(sessions, sessionId);
|
|
753
|
+
} catch (err) {
|
|
754
|
+
return {
|
|
755
|
+
kind: "error",
|
|
756
|
+
message: `conversation "${sessionId}" could not be resumed in ${cwd}: ${err instanceof Error ? err.message : String(err)}`
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
if (messages.length === 0) {
|
|
760
|
+
return {
|
|
761
|
+
kind: "error",
|
|
762
|
+
message: `conversation "${sessionId}" has no messages to resume \u2014 its transcript is empty`
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
return { kind: "resumed", sessionId, messages };
|
|
766
|
+
}
|
|
767
|
+
__name(load, "load");
|
|
768
|
+
|
|
769
|
+
// src/commands/exec.ts
|
|
770
|
+
function composePrompt(fromArgs, piped) {
|
|
771
|
+
const question = fromArgs.trim();
|
|
772
|
+
const material = piped.trim();
|
|
773
|
+
if (!question) return material;
|
|
774
|
+
if (!material) return question;
|
|
775
|
+
return `${question}
|
|
776
|
+
|
|
777
|
+
<stdin>
|
|
778
|
+
${material}
|
|
779
|
+
</stdin>`;
|
|
780
|
+
}
|
|
781
|
+
__name(composePrompt, "composePrompt");
|
|
782
|
+
function defaultPrefs2(detected) {
|
|
783
|
+
const first = detected[0];
|
|
784
|
+
return first ? {
|
|
785
|
+
version: 3,
|
|
786
|
+
providers: [{ id: first.entry.id }],
|
|
787
|
+
subagents: { active: [] }
|
|
788
|
+
} : null;
|
|
789
|
+
}
|
|
790
|
+
__name(defaultPrefs2, "defaultPrefs");
|
|
791
|
+
function stoppedBy(signal, sessionId, phase, paused) {
|
|
792
|
+
switch (phase) {
|
|
793
|
+
case "running":
|
|
794
|
+
return `stopped by ${signal}: the turn in conversation ${sessionId} was left interrupted \u2014 close it with /abandon in the TUI, or continue it with /resume or \`namzu drain\``;
|
|
795
|
+
case "paused":
|
|
796
|
+
return `stopped by ${signal} while the turn was paused: it keeps checkpoint ${paused?.checkpointId ?? "(unknown)"} in conversation ${sessionId} \u2014 continue it with /resume or \`namzu drain\`, or close it with /abandon in the TUI`;
|
|
797
|
+
case "ended":
|
|
798
|
+
return `stopped by ${signal} after the turn ended; it is recorded in conversation ${sessionId}, and nothing is left to close`;
|
|
799
|
+
case "not-started":
|
|
800
|
+
return `stopped by ${signal}; no turn was started in conversation ${sessionId}`;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
__name(stoppedBy, "stoppedBy");
|
|
804
|
+
function loadExecOutputSchema(path) {
|
|
805
|
+
if (path === null) return void 0;
|
|
806
|
+
const absolute = resolve(process.cwd(), path);
|
|
807
|
+
try {
|
|
808
|
+
return loadOutputSchema(absolute);
|
|
809
|
+
} catch (error) {
|
|
810
|
+
return {
|
|
811
|
+
error: `--output-schema ${absolute}: ${error instanceof Error ? error.message : String(error)}`
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
__name(loadExecOutputSchema, "loadExecOutputSchema");
|
|
816
|
+
async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOutput) {
|
|
817
|
+
let ctx = bootstrapCtx;
|
|
818
|
+
const limitsFromFlags = {
|
|
819
|
+
...flags.maxIterations !== null ? { maxIterations: flags.maxIterations } : {},
|
|
820
|
+
...flags.tokenBudget !== null ? { tokenBudget: flags.tokenBudget } : {}
|
|
821
|
+
};
|
|
822
|
+
if (flags.unknown.length > 0) {
|
|
823
|
+
ctx.formatter.error({ message: unknownOptionMessage(flags.unknown) });
|
|
824
|
+
return EXIT_USAGE;
|
|
825
|
+
}
|
|
826
|
+
if (structuredOutput && "error" in structuredOutput) {
|
|
827
|
+
ctx.formatter.error({ message: structuredOutput.error });
|
|
828
|
+
return EXIT_USAGE;
|
|
829
|
+
}
|
|
830
|
+
if (flags.session !== null) {
|
|
831
|
+
ctx.formatter.error({
|
|
832
|
+
message: "--session binds a host conversation for `exec --json`; this mode resumes with --continue or --resume <id>"
|
|
833
|
+
});
|
|
834
|
+
return EXIT_USAGE;
|
|
835
|
+
}
|
|
836
|
+
const fromArgs = flags.rest.join(" ").trim() === "-" ? "" : flags.rest.join(" ").trim();
|
|
837
|
+
const pipedRead = readStdin({ deadline: Boolean(fromArgs) });
|
|
838
|
+
pipedRead.catch(() => {
|
|
839
|
+
});
|
|
840
|
+
const pipedAfterStartup = fromArgs !== "" && !fromArgs.startsWith("/");
|
|
841
|
+
const piped = pipedAfterStartup ? "" : await pipedRead;
|
|
842
|
+
const prompt = composePrompt(fromArgs, piped);
|
|
843
|
+
if (!prompt) {
|
|
844
|
+
ctx.formatter.error({
|
|
845
|
+
message: "no prompt \u2014 pass it as an argument or pipe it via stdin"
|
|
846
|
+
});
|
|
847
|
+
return 2;
|
|
848
|
+
}
|
|
849
|
+
const resolved = resolveWorkingDirectory(flags.cwd);
|
|
850
|
+
if ("error" in resolved) {
|
|
851
|
+
ctx.formatter.error({ message: resolved.error });
|
|
852
|
+
return EXIT_USAGE;
|
|
853
|
+
}
|
|
854
|
+
const trust = decideHeadlessTrust({
|
|
855
|
+
cwd: resolved.cwd,
|
|
856
|
+
trustFlag: flags.trust
|
|
857
|
+
});
|
|
858
|
+
if (!trust.allowed) {
|
|
859
|
+
ctx.formatter.error({ message: trust.message ?? "folder not trusted" });
|
|
860
|
+
return EXIT_UNTRUSTED;
|
|
861
|
+
}
|
|
862
|
+
const cwd = trust.cwd;
|
|
863
|
+
ctx = resolveTrustedProjectContext(bootstrapCtx, cwd);
|
|
864
|
+
const expansion = expandHeadlessCommand(prompt, {
|
|
865
|
+
cwd,
|
|
866
|
+
builtins: hostCommandNames()
|
|
867
|
+
});
|
|
868
|
+
if (expansion.kind === "refused") {
|
|
869
|
+
ctx.formatter.error({ message: expansion.reason });
|
|
870
|
+
return EXIT_USAGE;
|
|
871
|
+
}
|
|
872
|
+
const promptUntilPiped = expansion.kind === "expanded" ? expansion.prompt : prompt;
|
|
873
|
+
const logging = contextLogging(ctx);
|
|
874
|
+
installCliLogging(createStderrSink(logging.format), logging.level);
|
|
875
|
+
const { probeAgentSession, createAgentSession } = await import("./agent-UEK2U3RE.js");
|
|
876
|
+
const probe = await probeAgentSession();
|
|
877
|
+
let prefs = probe.preferences ?? defaultPrefs2(probe.detected);
|
|
878
|
+
if (!prefs) {
|
|
879
|
+
ctx.formatter.error({
|
|
880
|
+
message: "no LLM provider available \u2014 set a credential (e.g. ANTHROPIC_API_KEY) or run `namzu` to pick one"
|
|
881
|
+
});
|
|
882
|
+
return 1;
|
|
883
|
+
}
|
|
884
|
+
prefs = applyProviderFlags(prefs, flags);
|
|
885
|
+
const modeResult = resolvePermissionMode({
|
|
886
|
+
flag: flags.permissionMode,
|
|
887
|
+
skipPermissions: flags.skipPermissions,
|
|
888
|
+
// A headless turn has nobody to ask, so `prompt` here would silently
|
|
889
|
+
// become `auto`. Resolving it as `auto` says so instead.
|
|
890
|
+
interactive: false
|
|
891
|
+
});
|
|
892
|
+
if ("error" in modeResult) {
|
|
893
|
+
ctx.formatter.error({ message: modeResult.error });
|
|
894
|
+
return EXIT_USAGE;
|
|
895
|
+
}
|
|
896
|
+
warnLegacyMcpPermissionNames(ctx.config.permissions);
|
|
897
|
+
const permissions = compilePermissions(ctx.config.permissions, ctx.config.permissionChecks);
|
|
898
|
+
for (const d of permissions.diagnostics) {
|
|
899
|
+
const where = d.pattern ? `permissions.${d.tool}."${d.pattern}"` : `permissions.${d.tool}`;
|
|
900
|
+
ctx.formatter.error({ message: `${where}: ${d.message}` });
|
|
901
|
+
}
|
|
902
|
+
const gate = buildGate(flags, cwd);
|
|
903
|
+
let sessionExport;
|
|
904
|
+
if (ctx.config.telemetry?.sessionExport) {
|
|
905
|
+
try {
|
|
906
|
+
sessionExport = await attachSessionExport({
|
|
907
|
+
config: ctx.config.telemetry.sessionExport
|
|
908
|
+
});
|
|
909
|
+
cliLogger().info(sessionExport.disclosure, {
|
|
910
|
+
[EVENT_NAME_ATTRIBUTE]: BOOT_EVENT_NAMES.TELEMETRY_STATUS,
|
|
911
|
+
"namzu.telemetry.session_export": true
|
|
912
|
+
});
|
|
913
|
+
} catch (err) {
|
|
914
|
+
ctx.formatter.error({
|
|
915
|
+
message: err instanceof Error ? err.message : String(err)
|
|
916
|
+
});
|
|
917
|
+
return 1;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
let sessions;
|
|
921
|
+
try {
|
|
922
|
+
sessions = await openSessions(cwd);
|
|
923
|
+
} catch (error) {
|
|
924
|
+
await sessionExport?.shutdown();
|
|
925
|
+
ctx.formatter.error({
|
|
926
|
+
message: `workspace state is unavailable: ${error instanceof Error ? error.message : String(error)}`
|
|
927
|
+
});
|
|
928
|
+
return 1;
|
|
929
|
+
}
|
|
930
|
+
const resume = await resolveResume(
|
|
931
|
+
sessions,
|
|
932
|
+
{ continueLast: flags.continueLast, sessionId: flags.resume },
|
|
933
|
+
cwd
|
|
934
|
+
);
|
|
935
|
+
if (resume.kind === "error") {
|
|
936
|
+
ctx.formatter.error({ message: resume.message });
|
|
937
|
+
await sessionExport?.shutdown();
|
|
938
|
+
return EXIT_USAGE;
|
|
939
|
+
}
|
|
940
|
+
const prior = resume.kind === "resumed" ? resume.messages : [];
|
|
941
|
+
let sessionId;
|
|
942
|
+
try {
|
|
943
|
+
sessionId = resume.kind === "resumed" ? asSessionId(resume.sessionId) : await startConversation(sessions);
|
|
944
|
+
} catch (error) {
|
|
945
|
+
closeSessions(sessions);
|
|
946
|
+
await sessionExport?.shutdown();
|
|
947
|
+
ctx.formatter.error({
|
|
948
|
+
message: `could not start a conversation: ${error instanceof Error ? error.message : String(error)}`
|
|
949
|
+
});
|
|
950
|
+
return 1;
|
|
951
|
+
}
|
|
952
|
+
const session = await createAgentSession(prefs, probe.detected, {
|
|
953
|
+
cwd,
|
|
954
|
+
...structuredOutput ? { structuredOutput } : {},
|
|
955
|
+
scope: {
|
|
956
|
+
sessionId,
|
|
957
|
+
topicId: sessions.topicId,
|
|
958
|
+
projectId: sessions.projectId,
|
|
959
|
+
tenantId: sessions.tenantId
|
|
960
|
+
},
|
|
961
|
+
stateRoot: sessions.root,
|
|
962
|
+
conversationSessions: sessions,
|
|
963
|
+
rules: permissions.rules,
|
|
964
|
+
...sessionExport ? { onSessionEvent: sessionExport.listener } : {},
|
|
965
|
+
// The operator's --gate commands, as a standing condition on the
|
|
966
|
+
// answer. Spread rather than passed as undefined so a turn without
|
|
967
|
+
// gates is byte-identical to the one that shipped before them.
|
|
968
|
+
...gate ?? {},
|
|
969
|
+
permissionMode: modeResult.mode,
|
|
970
|
+
// Run from the user's own terminal, so a page can be opened on their
|
|
971
|
+
// desktop. Never `exec --json`, `drain` or a scheduled run.
|
|
972
|
+
openUrl: true,
|
|
973
|
+
...ctx.config.mcpServers ? { mcpServers: ctx.config.mcpServers } : {},
|
|
974
|
+
...ctx.config.plugins ? { plugins: ctx.config.plugins } : {},
|
|
975
|
+
...ctx.config.skills ? { skills: ctx.config.skills } : {},
|
|
976
|
+
...ctx.config.web ? { web: ctx.config.web } : {},
|
|
977
|
+
...ctx.config.hooks ? { hooks: ctx.config.hooks } : {},
|
|
978
|
+
...ctx.config.compaction ? { compaction: ctx.config.compaction } : {},
|
|
979
|
+
...ctx.config.memory ? { memory: ctx.config.memory } : {},
|
|
980
|
+
...Object.keys({ ...ctx.config.limits, ...limitsFromFlags }).length > 0 ? { limits: { ...ctx.config.limits, ...limitsFromFlags } } : {},
|
|
981
|
+
...ctx.config.sandbox ? { sandbox: ctx.config.sandbox } : {},
|
|
982
|
+
// `!== undefined`, not truthiness: an empty list is the operator
|
|
983
|
+
// turning the default screen OFF, and a falsy check would drop it.
|
|
984
|
+
...ctx.config.toolResultScreens !== void 0 ? { toolResultScreens: ctx.config.toolResultScreens } : {}
|
|
985
|
+
});
|
|
986
|
+
if (!session.hasProvider) {
|
|
987
|
+
await session.close();
|
|
988
|
+
closeSessions(sessions);
|
|
989
|
+
await sessionExport?.shutdown();
|
|
990
|
+
ctx.formatter.error({
|
|
991
|
+
message: session.errorHint ?? "agent is not ready"
|
|
992
|
+
});
|
|
993
|
+
return 1;
|
|
994
|
+
}
|
|
995
|
+
if (session.mcpFailed.length > 0) {
|
|
996
|
+
for (const f of session.mcpFailed) {
|
|
997
|
+
ctx.formatter.error({
|
|
998
|
+
message: `tool server "${f.name}" is not available: ${f.reason}`
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
await session.close();
|
|
1002
|
+
closeSessions(sessions);
|
|
1003
|
+
await sessionExport?.shutdown();
|
|
1004
|
+
return 1;
|
|
1005
|
+
}
|
|
1006
|
+
for (const notice of session.configNotices) {
|
|
1007
|
+
ctx.formatter.info(notice);
|
|
1008
|
+
}
|
|
1009
|
+
for (const s of session.mcpConnected) {
|
|
1010
|
+
ctx.formatter.info(`tool server ${s.name} \xB7 ${s.toolCount} tools`);
|
|
1011
|
+
}
|
|
1012
|
+
ctx.formatter.info(
|
|
1013
|
+
`namzu \xB7 ${session.providerSummary}${session.modelSummary ? ` \xB7 ${session.modelSummary}` : ""}`
|
|
1014
|
+
);
|
|
1015
|
+
if (session.instructionFiles.length > 0) {
|
|
1016
|
+
ctx.formatter.info(
|
|
1017
|
+
`project instructions: ${session.instructionFiles.map((p) => relative(cwd, p) || p).join(", ")}`
|
|
1018
|
+
);
|
|
1019
|
+
}
|
|
1020
|
+
for (const skip of session.skippedInstructionFiles) {
|
|
1021
|
+
ctx.formatter.error({
|
|
1022
|
+
message: `skipped ${relative(cwd, skip.path) || skip.path}: ${skip.reason}`
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
const extraSystem = await loadSkillsContext(cwd, flags.skills, ctx.config.skills);
|
|
1026
|
+
if (resume.kind === "resumed") {
|
|
1027
|
+
ctx.formatter.info(`resuming ${resume.sessionId} \xB7 ${prior.length} messages`);
|
|
1028
|
+
}
|
|
1029
|
+
let text = "";
|
|
1030
|
+
const measured = {};
|
|
1031
|
+
const jsonResult = /* @__PURE__ */ __name((value) => ({
|
|
1032
|
+
text: value,
|
|
1033
|
+
...measured.usage ? {
|
|
1034
|
+
usage: {
|
|
1035
|
+
totalTokens: measured.usage.totalTokens,
|
|
1036
|
+
cost: measured.usage.cost
|
|
1037
|
+
}
|
|
1038
|
+
} : {},
|
|
1039
|
+
...measured.budget ? { budget: measured.budget } : {}
|
|
1040
|
+
}), "jsonResult");
|
|
1041
|
+
let stopReason;
|
|
1042
|
+
const stop = {
|
|
1043
|
+
failed: null,
|
|
1044
|
+
paused: null,
|
|
1045
|
+
busy: false
|
|
1046
|
+
};
|
|
1047
|
+
const turnAbort = new AbortController();
|
|
1048
|
+
let stopped = false;
|
|
1049
|
+
let phase = "running";
|
|
1050
|
+
const afterPhase = /* @__PURE__ */ __name(() => {
|
|
1051
|
+
phase = stop.busy ? "not-started" : stop.paused ? "paused" : "ended";
|
|
1052
|
+
}, "afterPhase");
|
|
1053
|
+
termination.onTerminate(async (signal) => {
|
|
1054
|
+
stopped = true;
|
|
1055
|
+
ctx.formatter.error({ message: stoppedBy(signal, sessionId, phase, stop.paused) });
|
|
1056
|
+
turnAbort.abort(new TurnCancelled("user"));
|
|
1057
|
+
await session.close();
|
|
1058
|
+
closeSessions(sessions);
|
|
1059
|
+
await sessionExport?.shutdown();
|
|
1060
|
+
});
|
|
1061
|
+
const consume = /* @__PURE__ */ __name(async (stream) => {
|
|
1062
|
+
stop.failed = null;
|
|
1063
|
+
stop.paused = null;
|
|
1064
|
+
for await (const event of stream) {
|
|
1065
|
+
if (event.kind === "delta") text += event.text;
|
|
1066
|
+
else if (event.kind === "tool-start")
|
|
1067
|
+
ctx.formatter.info(`Tool: ${event.toolName} ${event.summary}`);
|
|
1068
|
+
else if (event.kind === "context") ctx.formatter.info(event.text);
|
|
1069
|
+
else if (event.kind === "error" || event.kind === "paused") {
|
|
1070
|
+
if (event.budget) measured.budget = event.budget;
|
|
1071
|
+
stop.failed = describeTurnInterruption(event);
|
|
1072
|
+
if (event.kind === "error" && event.turnInProgress) {
|
|
1073
|
+
stop.busy = true;
|
|
1074
|
+
stop.failed = `conversation ${event.turnInProgress.sessionId} already has a ${event.turnInProgress.state} turn ${event.turnInProgress.activeTurnId}; nothing was started. Finish it with \`namzu drain\`, or abandon it with /abandon in the TUI.`;
|
|
1075
|
+
}
|
|
1076
|
+
if (event.kind === "paused") stop.paused = event;
|
|
1077
|
+
} else if (event.kind === "usage") {
|
|
1078
|
+
measured.usage = event;
|
|
1079
|
+
if (event.budget) measured.budget = event.budget;
|
|
1080
|
+
} else if (event.kind === "done") {
|
|
1081
|
+
if (event.text !== void 0) text = event.text;
|
|
1082
|
+
stopReason = event.stopReason;
|
|
1083
|
+
if (event.budget) measured.budget = event.budget;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}, "consume");
|
|
1087
|
+
const finalPrompt = pipedAfterStartup ? composePrompt(fromArgs, await pipedRead) : promptUntilPiped;
|
|
1088
|
+
await consume(
|
|
1089
|
+
session.send([...prior, { role: "user", content: finalPrompt, timestamp: Date.now() }], {
|
|
1090
|
+
signal: turnAbort.signal,
|
|
1091
|
+
...extraSystem ? { extraSystem } : {},
|
|
1092
|
+
...flags.effort !== null ? { effort: flags.effort } : {}
|
|
1093
|
+
})
|
|
1094
|
+
);
|
|
1095
|
+
afterPhase();
|
|
1096
|
+
const waitBudgetMs = flags.waitForProviderMs ?? ctx.config.limits?.waitForProviderMs ?? 0;
|
|
1097
|
+
let waits = 0;
|
|
1098
|
+
let waitedMs = 0;
|
|
1099
|
+
while (!stopped && stop.paused && waitBudgetMs > 0 && (stop.paused.providerError || stop.paused.failure)) {
|
|
1100
|
+
const paused2 = stop.paused;
|
|
1101
|
+
const asked = retryAfterMs(paused2);
|
|
1102
|
+
const decision = pauseWait({
|
|
1103
|
+
waited: waits,
|
|
1104
|
+
...asked !== void 0 ? { retryAfterMs: asked } : {},
|
|
1105
|
+
waitedMs,
|
|
1106
|
+
budgetMs: waitBudgetMs
|
|
1107
|
+
});
|
|
1108
|
+
if (decision.kind === "stop") {
|
|
1109
|
+
stop.failed = `${stop.failed}
|
|
1110
|
+
Not resumed: ${decision.reason}.`;
|
|
1111
|
+
break;
|
|
1112
|
+
}
|
|
1113
|
+
waits += 1;
|
|
1114
|
+
ctx.formatter.info(
|
|
1115
|
+
`provider paused the turn: waiting ${duration(decision.delayMs)}, then resuming from ${paused2.checkpointId} (wait ${waits}, ${duration(waitedMs)} of ${duration(waitBudgetMs)} spent)`
|
|
1116
|
+
);
|
|
1117
|
+
await new Promise((resolve2) => setTimeout(resolve2, decision.delayMs));
|
|
1118
|
+
if (stopped) break;
|
|
1119
|
+
waitedMs += decision.delayMs;
|
|
1120
|
+
phase = "running";
|
|
1121
|
+
await consume(
|
|
1122
|
+
session.resumePaused({
|
|
1123
|
+
turnId: paused2.turnId,
|
|
1124
|
+
checkpointId: paused2.checkpointId,
|
|
1125
|
+
signal: turnAbort.signal
|
|
1126
|
+
})
|
|
1127
|
+
);
|
|
1128
|
+
afterPhase();
|
|
1129
|
+
}
|
|
1130
|
+
if (stopped) return 1;
|
|
1131
|
+
const failed = stop.failed;
|
|
1132
|
+
const paused = stop.paused !== null || stop.busy;
|
|
1133
|
+
await session.close();
|
|
1134
|
+
closeSessions(sessions);
|
|
1135
|
+
await sessionExport?.shutdown();
|
|
1136
|
+
if (measured.budget) {
|
|
1137
|
+
ctx.formatter.info(
|
|
1138
|
+
`Tokens: ${measured.budget.ownTokens} own \xB7 ${measured.budget.treeTokens} including descendants`
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
if (failed) {
|
|
1142
|
+
const partial = text.trim();
|
|
1143
|
+
if (partial) {
|
|
1144
|
+
ctx.formatter.print(ctx.formatter.name === "json" ? jsonResult(partial) : partial);
|
|
1145
|
+
}
|
|
1146
|
+
ctx.formatter.error({
|
|
1147
|
+
message: `${failed}${partial ? " \u2014 the output above is partial" : ""}`
|
|
1148
|
+
});
|
|
1149
|
+
return paused ? 75 : 1;
|
|
1150
|
+
}
|
|
1151
|
+
ctx.formatter.print(ctx.formatter.name === "json" ? jsonResult(text.trim()) : text.trim());
|
|
1152
|
+
if (stopReason && stopReason !== "end_turn") {
|
|
1153
|
+
ctx.formatter.error({
|
|
1154
|
+
message: `turn did not finish normally: ${stopReason}${text.trim() ? " \u2014 the output above is partial" : ""}`
|
|
1155
|
+
});
|
|
1156
|
+
return 1;
|
|
1157
|
+
}
|
|
1158
|
+
return 0;
|
|
1159
|
+
}
|
|
1160
|
+
__name(execPrint, "execPrint");
|
|
1161
|
+
var execCommand = {
|
|
1162
|
+
name: "exec",
|
|
1163
|
+
aliases: ["e"],
|
|
1164
|
+
description: "Run a single prompt headlessly: print the reply, or stream events with --json",
|
|
1165
|
+
passThrough: true,
|
|
1166
|
+
help: [
|
|
1167
|
+
"Usage: namzu exec [options] <prompt...>",
|
|
1168
|
+
' echo "<prompt>" | namzu exec',
|
|
1169
|
+
' cat file.txt | namzu exec "summarise this"',
|
|
1170
|
+
" namzu exec --json [--session <id>] <prompt...>",
|
|
1171
|
+
"",
|
|
1172
|
+
"Run a single prompt headlessly. Everything that is not an option is the",
|
|
1173
|
+
"prompt. `namzu e` is the same command.",
|
|
1174
|
+
"",
|
|
1175
|
+
"By default the reply is printed on stdout and status lines go to stderr.",
|
|
1176
|
+
"Piped input is used too, not discarded: with no prompt argument it IS",
|
|
1177
|
+
"the prompt, and alongside one it is appended as material the question",
|
|
1178
|
+
"is about. `namzu exec -` reads the prompt from stdin explicitly.",
|
|
1179
|
+
"",
|
|
1180
|
+
"Options:",
|
|
1181
|
+
" --json Stream one JSON event per line instead of the reply",
|
|
1182
|
+
" --output-schema <f> Bind the final answer to the JSON Schema in file f,",
|
|
1183
|
+
" using the provider\u2019s native structured output",
|
|
1184
|
+
" --cwd <path> Directory the agent works in (default: this one)",
|
|
1185
|
+
" --provider <id> Provider to answer with",
|
|
1186
|
+
" --model <id> Model to answer with",
|
|
1187
|
+
" --skills <a,b,c> Load these skills as context for the turn",
|
|
1188
|
+
" --continue, -c Resume the most recent conversation here",
|
|
1189
|
+
" --resume <id> Resume that conversation, and no other",
|
|
1190
|
+
" --session <id> With --json: bind the turn to the host conversation",
|
|
1191
|
+
" keyed by this id",
|
|
1192
|
+
" --gate <command> Verify proposed answers with this command; repeatable",
|
|
1193
|
+
" --gate-retries <n> Fix attempts a failing gate allows (default 3)",
|
|
1194
|
+
" --max-iterations <n> Main-loop iteration limit (default 50; 0 unlimited)",
|
|
1195
|
+
" --token-budget <n> Tree token limit (default unlimited; 0 removes a configured cap)",
|
|
1196
|
+
" --effort <level> Explicit reasoning effort (supported levels depend on the model)",
|
|
1197
|
+
" --wait-for-provider <d> Wait out provider pauses (a rate limit, an outage)",
|
|
1198
|
+
" for up to this long in total \u2014 90s, 30m, 2h \u2014 resuming",
|
|
1199
|
+
" from the checkpoint each time (default: none; exit 75)",
|
|
1200
|
+
" --permission-mode <m> prompt | accept-edits | auto | strict | plan \u2014",
|
|
1201
|
+
" what happens to a call no [permissions] rule",
|
|
1202
|
+
" decided (default: auto)",
|
|
1203
|
+
" --trust Accept this folder for THIS turn",
|
|
1204
|
+
" -- End of options; the rest is the prompt verbatim",
|
|
1205
|
+
"",
|
|
1206
|
+
"A folder has to be trusted before namzu will work in it, because namzu",
|
|
1207
|
+
"reads its files, runs commands in it and executes its code. Run `namzu`",
|
|
1208
|
+
"here once and accept the prompt to trust it permanently, or pass --trust",
|
|
1209
|
+
"to accept it for one turn. --trust does not remember; that is the point.",
|
|
1210
|
+
"",
|
|
1211
|
+
"--yolo does NOT imply --trust: one is about which tools may run inside a",
|
|
1212
|
+
"folder, the other about the folder.",
|
|
1213
|
+
"",
|
|
1214
|
+
"By default tools run without asking, because there is nobody to ask, and",
|
|
1215
|
+
"the safety gate still refuses catastrophic commands. Use --permission-mode",
|
|
1216
|
+
"strict for an unattended turn that must refuse anything no rule allowed.",
|
|
1217
|
+
"",
|
|
1218
|
+
"A mode only decides calls no rule decided: it can never reopen a deny.",
|
|
1219
|
+
"",
|
|
1220
|
+
"--gate checks proposed answers with operator-supplied commands. Every",
|
|
1221
|
+
"command must complete successfully; a failure returns diagnostics to the",
|
|
1222
|
+
"model for correction. Repeat the flag to check several commands in order.",
|
|
1223
|
+
"Budget exhaustion or cancellation may stop a turn before verification.",
|
|
1224
|
+
"",
|
|
1225
|
+
"A failed gate may skip a retry when its Git change detector is unchanged.",
|
|
1226
|
+
"The attempt still counts. Exhausted review attempts stop the turn with",
|
|
1227
|
+
"answer_rejected and a non-zero exit.",
|
|
1228
|
+
"",
|
|
1229
|
+
"The working directory\u2019s AGENTS.md files \u2014 that directory and every one up",
|
|
1230
|
+
"to the repository root \u2014 are loaded as standing instructions for the turn,",
|
|
1231
|
+
"and the ones that were loaded are named on stderr.",
|
|
1232
|
+
"",
|
|
1233
|
+
"--continue and --resume refuse when the conversation cannot be reopened,",
|
|
1234
|
+
"and say why. Neither ever falls back to starting a new one: leave both",
|
|
1235
|
+
"out if that is what you want.",
|
|
1236
|
+
"",
|
|
1237
|
+
"Needs a provider. Set a credential in the environment, or run namzu",
|
|
1238
|
+
"once to pick one interactively.",
|
|
1239
|
+
"",
|
|
1240
|
+
"A turn the provider pauses keeps a checkpoint. Without --wait-for-provider",
|
|
1241
|
+
"it exits 75 at once and a wrapper decides when to try again; with it, the",
|
|
1242
|
+
"turn waits the provider\u2019s own delay when it named one (otherwise a minute,",
|
|
1243
|
+
"doubling, at most fifteen) and resumes from the checkpoint in this process,",
|
|
1244
|
+
"until the budget is spent. The `limits.waitForProviderMs` config key sets",
|
|
1245
|
+
"the same budget for every turn in the folder.",
|
|
1246
|
+
"",
|
|
1247
|
+
"Exit codes: 0 on a reply, 1 on a failed or unfinished turn, 2 when no",
|
|
1248
|
+
"prompt was supplied, 64 when an argument is wrong, 75 when the provider",
|
|
1249
|
+
"paused the turn (a rate limit or an outage) and a checkpoint was kept \u2014",
|
|
1250
|
+
"wait, then try again \u2014 or when the conversation already has an active",
|
|
1251
|
+
"turn (a paused one: finish it with `namzu drain`, or abandon it in the",
|
|
1252
|
+
"TUI with /abandon), and 77 when the folder has not been trusted and",
|
|
1253
|
+
"nothing was done.",
|
|
1254
|
+
"",
|
|
1255
|
+
"With --json:",
|
|
1256
|
+
"",
|
|
1257
|
+
"Each line is one event as the turn unfolds \u2014 text deltas, tool starts and",
|
|
1258
|
+
"ends, usage, then a terminal done event. done.text is the settled answer;",
|
|
1259
|
+
"earlier deltas may include progress or answers later rejected by",
|
|
1260
|
+
"verification. History is bound with --session <id>; --continue, --resume",
|
|
1261
|
+
"and --wait-for-provider are refused. Without --session, optional stdin",
|
|
1262
|
+
"must be one complete JSON Message[]; invalid or provider-incomplete tool",
|
|
1263
|
+
"history is refused before a turn.",
|
|
1264
|
+
"",
|
|
1265
|
+
"Every failure is an event on stdout. The exit code says whether YOU can",
|
|
1266
|
+
"do anything about it: 0 when changing what you send would reach the turn",
|
|
1267
|
+
"(a wrong option, no prompt, a bad --cwd) and when a turn started and",
|
|
1268
|
+
"failed; 1 when it would not (no provider, a tool server that is not",
|
|
1269
|
+
"there, a conversation that cannot be opened); 75 when the --session",
|
|
1270
|
+
"conversation already has an active turn (a paused one: finish it with",
|
|
1271
|
+
'`namzu drain`), and the error event carries code "turn_in_progress"; 77',
|
|
1272
|
+
"when the folder has not been trusted, which only a person can change."
|
|
1273
|
+
].join("\n"),
|
|
1274
|
+
handler: withTerminationHandling(async (args, termination) => {
|
|
1275
|
+
const flags = parseExecFlags(args.rawArgs);
|
|
1276
|
+
const structuredOutput = loadExecOutputSchema(flags.outputSchema);
|
|
1277
|
+
return flags.json ? execJson(args, termination, flags, structuredOutput) : execPrint(args, termination, flags, structuredOutput);
|
|
1278
|
+
})
|
|
1279
|
+
};
|
|
1280
|
+
export {
|
|
1281
|
+
composePrompt,
|
|
1282
|
+
execCommand
|
|
1283
|
+
};
|
|
1284
|
+
//# sourceMappingURL=exec-COV235L5.js.map
|