@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
package/dist/config/load.js
DELETED
|
@@ -1,1208 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config cascade and runtime admission for @namzu/cli.
|
|
3
|
-
*
|
|
4
|
-
* Resolution order (highest priority first):
|
|
5
|
-
* 1. CLI flags (handled by Commander, merged in `cli.ts`)
|
|
6
|
-
* 2. Environment variables prefixed `NAMZU_`
|
|
7
|
-
* 3. Project config: `./namzu.config.json` (TS variant added in a later
|
|
8
|
-
* milestone when a build step is justified)
|
|
9
|
-
* 4. User config: `$NAMZU_HOME/config.yaml` (`~/.namzu/config.yaml` by default)
|
|
10
|
-
* 5. Built-in defaults from `schema.ts`
|
|
11
|
-
*
|
|
12
|
-
* This module owns steps 2–5. CLI-flag merging happens in `cli.ts`, where
|
|
13
|
-
* Commander knows what was explicitly set rather than merely defaulted.
|
|
14
|
-
*
|
|
15
|
-
* A file that is not there contributes nothing, and that is a default. A file
|
|
16
|
-
* that IS there and cannot be read throws {@link ConfigLoadError} — this loader
|
|
17
|
-
* has no way to say "some of your settings", and will not pretend the ones it
|
|
18
|
-
* failed to read were never written.
|
|
19
|
-
*
|
|
20
|
-
* A source Namzu can parse but whose known key carries an invalid value throws
|
|
21
|
-
* {@link ConfigValueError}. Absence, syntax failure, and semantic rejection are
|
|
22
|
-
* three different states and none is represented by another.
|
|
23
|
-
*/
|
|
24
|
-
import { readFileSync } from 'node:fs';
|
|
25
|
-
import { basename, join, resolve } from 'node:path';
|
|
26
|
-
import { RENAMED_PLUGIN_HOOK_EVENTS, SHELL_HOOK_EVENTS } from '@namzu/sdk';
|
|
27
|
-
import { parse as yamlParse } from 'yaml';
|
|
28
|
-
import { resolveNamzuHome } from '../integrations/state/home.js';
|
|
29
|
-
import { isFormatName } from '../output/index.js';
|
|
30
|
-
import { canonicalBrowserSiteKey, isBrowserSiteLevel, narrower, } from '../permissions/browser-sites.js';
|
|
31
|
-
import { COMPOSER_TRIGGER_IDS, COMPOSER_TRIGGER_LANGUAGES, mergeComposerTriggers, } from './composer-triggers.js';
|
|
32
|
-
import { configMetadataLiteral } from './debug.js';
|
|
33
|
-
import { DEFAULT_CONFIG, } from './schema.js';
|
|
34
|
-
import { TOOL_RESULT_SCREEN_NAMES, TOOL_RESULT_SCREEN_OPTION_KEYS, isToolResultScreenName, } from './tool-result-screens.js';
|
|
35
|
-
/**
|
|
36
|
-
* A machine-wide config that wins the cascade.
|
|
37
|
-
*
|
|
38
|
-
* It exists for the case where the person running namzu is not the person
|
|
39
|
-
* deciding what it may do — a shared build machine, a managed workstation.
|
|
40
|
-
* Applied LAST, so it beats the project file and the environment both, which
|
|
41
|
-
* is the only ordering that makes it worth having.
|
|
42
|
-
*
|
|
43
|
-
* **Its guarantee is the file system's and nothing more.** namzu does not
|
|
44
|
-
* verify a signature, does not check an owner, and cannot tell an
|
|
45
|
-
* administrator's file from one the user wrote there. What stops a user
|
|
46
|
-
* editing it is that the path needs privileges they do not have, on a machine
|
|
47
|
-
* somebody configured that way. That is a real control and a narrow one, and
|
|
48
|
-
* stating it precisely is the difference between a security boundary and the
|
|
49
|
-
* appearance of one.
|
|
50
|
-
*
|
|
51
|
-
* Absent on almost every machine, which is the expected case and not an error.
|
|
52
|
-
*/
|
|
53
|
-
export const MANAGED_CONFIG_PATH = process.platform === 'win32'
|
|
54
|
-
? join(process.env.PROGRAMDATA ?? 'C:\\ProgramData', 'namzu', 'config.json')
|
|
55
|
-
: '/etc/namzu/config.json';
|
|
56
|
-
/**
|
|
57
|
-
* `loadConfig` plus the record of who won each key.
|
|
58
|
-
*
|
|
59
|
-
* A second entry point rather than widening `loadConfig` itself:
|
|
60
|
-
* `loadConfig` is exported from `../index.js` for embedded consumers, and
|
|
61
|
-
* `(opts?: LoadConfigOptions) => NamzuCliConfig` is a signature something out
|
|
62
|
-
* there may already depend on. `loadConfig` below is now defined in terms of
|
|
63
|
-
* this function precisely so the two cannot drift apart — there is one merge
|
|
64
|
-
* to reason about, not two copies of the same precedence logic kept in sync
|
|
65
|
-
* by hand.
|
|
66
|
-
*/
|
|
67
|
-
export function loadConfigWithProvenance(opts = {}) {
|
|
68
|
-
return resolveConfigWithProvenance(opts, {
|
|
69
|
-
includeProject: true,
|
|
70
|
-
deferUnknownProfile: false,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Resolve only process/user/managed authority before a project is trusted.
|
|
75
|
-
*
|
|
76
|
-
* Internal CLI seam: deliberately not re-exported from the package root. A
|
|
77
|
-
* selected profile may be declared by the project layer, so an otherwise
|
|
78
|
-
* unknown profile is deferred until the trusted, full resolution pass.
|
|
79
|
-
*/
|
|
80
|
-
export function loadBootstrapConfigWithProvenance(opts = {}) {
|
|
81
|
-
return resolveConfigWithProvenance(opts, {
|
|
82
|
-
includeProject: false,
|
|
83
|
-
deferUnknownProfile: true,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function resolveConfigWithProvenance(opts, mode) {
|
|
87
|
-
const cwd = opts.cwd ?? process.cwd();
|
|
88
|
-
const env = opts.env ?? process.env;
|
|
89
|
-
const userPath = join(resolveNamzuHome({ ...(opts.home ? { home: opts.home } : {}), env }), 'config.yaml');
|
|
90
|
-
const projectPath = resolve(cwd, 'namzu.config.json');
|
|
91
|
-
const managedPath = opts.managedPath ?? MANAGED_CONFIG_PATH;
|
|
92
|
-
const userCfg = readYamlIfExists(userPath);
|
|
93
|
-
const projectCfg = mode.includeProject ? readJsonIfExists(projectPath) : {};
|
|
94
|
-
const managedCfg = readJsonIfExists(managedPath);
|
|
95
|
-
const { config: envCfg, variables: envVariables } = readEnv(env);
|
|
96
|
-
// The command line first, then the environment. A flag is this turn; a
|
|
97
|
-
// variable is this shell — so the narrower statement wins, the way it does
|
|
98
|
-
// everywhere else here.
|
|
99
|
-
const profileName = opts.profile ?? env.NAMZU_PROFILE;
|
|
100
|
-
const profiles = profileLayers(profileName, [
|
|
101
|
-
[userCfg, userPath],
|
|
102
|
-
[projectCfg, projectPath],
|
|
103
|
-
[managedCfg, managedPath],
|
|
104
|
-
], mode.deferUnknownProfile);
|
|
105
|
-
return mergeConfigs(constantLayer(DEFAULT_CONFIG, { kind: 'default' }), constantLayer(userCfg, { kind: 'user-file', path: userPath }), constantLayer(projectCfg, { kind: 'project-file', path: projectPath }),
|
|
106
|
-
// After both files and before the environment. A profile is a
|
|
107
|
-
// deliberate choice about a set of settings, so it beats the ambient
|
|
108
|
-
// values in the file it came from; a variable is a statement about this
|
|
109
|
-
// one shell, so it beats the profile.
|
|
110
|
-
...profiles, {
|
|
111
|
-
config: envCfg,
|
|
112
|
-
sourceFor: (key) => {
|
|
113
|
-
const variable = envVariables[key];
|
|
114
|
-
// `readEnv` sets `variables[key]` in the same branch it sets
|
|
115
|
-
// `config[key]` — see `ENV_VARIABLE_NAMES` — so this is defined
|
|
116
|
-
// for every key this layer's config actually carries. Reaching
|
|
117
|
-
// `undefined` here means that pairing broke, which is a bug in
|
|
118
|
-
// this file, not a malformed environment.
|
|
119
|
-
if (variable === undefined) {
|
|
120
|
-
throw new Error(`no env variable recorded for config key '${key}'`);
|
|
121
|
-
}
|
|
122
|
-
return { kind: 'env', variable };
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
// Last, so it beats the project file and the environment both. That
|
|
126
|
-
// ordering is the whole of what a managed layer is.
|
|
127
|
-
constantLayer(managedCfg, { kind: 'managed', path: managedPath }));
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* The `permissions` table of each file that declares one: user, project and
|
|
131
|
-
* managed, in cascade order, each on its own.
|
|
132
|
-
*
|
|
133
|
-
* The merged config cannot answer "did ANY file deny this": a project that
|
|
134
|
-
* writes `bash = "allow"` replaces a user's `bash = "deny"` under the same key.
|
|
135
|
-
* A scheduled run takes its allows from its job alone and the denies from
|
|
136
|
-
* every file, so it needs the layers apart. Validated as the cascade
|
|
137
|
-
* validates them; a file that fails to parse throws the same error.
|
|
138
|
-
*/
|
|
139
|
-
export function readPermissionLayers(opts = {}) {
|
|
140
|
-
const cwd = opts.cwd ?? process.cwd();
|
|
141
|
-
const env = opts.env ?? process.env;
|
|
142
|
-
const userPath = join(resolveNamzuHome({ ...(opts.home ? { home: opts.home } : {}), env }), 'config.yaml');
|
|
143
|
-
const projectPath = resolve(cwd, 'namzu.config.json');
|
|
144
|
-
const managedPath = opts.managedPath ?? MANAGED_CONFIG_PATH;
|
|
145
|
-
const layers = [];
|
|
146
|
-
for (const [source, path, config] of [
|
|
147
|
-
['user-file', userPath, readYamlIfExists(userPath)],
|
|
148
|
-
['project-file', projectPath, readJsonIfExists(projectPath)],
|
|
149
|
-
['managed', managedPath, readJsonIfExists(managedPath)],
|
|
150
|
-
]) {
|
|
151
|
-
const browserDenies = Object.entries(config.browser?.sites ?? {})
|
|
152
|
-
.filter(([site, level]) => site !== '*' && level === 'deny')
|
|
153
|
-
.map(([site]) => site);
|
|
154
|
-
if (config.permissions || browserDenies.length > 0)
|
|
155
|
-
layers.push({
|
|
156
|
-
source,
|
|
157
|
-
path,
|
|
158
|
-
permissions: config.permissions ?? {},
|
|
159
|
-
...(browserDenies.length > 0 ? { browserDenies } : {}),
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
return layers;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* The selected profile, once per file that declares it.
|
|
166
|
-
*
|
|
167
|
-
* One layer per file rather than one merged layer, so provenance keeps naming
|
|
168
|
-
* the file a value actually came from — a project profile overriding a user
|
|
169
|
-
* profile of the same name is the ordinary case, and reporting both as "the
|
|
170
|
-
* profile" would leave an operator opening the wrong file.
|
|
171
|
-
*
|
|
172
|
-
* Refuses a name nothing declares. The alternative is a turn under settings
|
|
173
|
-
* nobody chose, reported as success.
|
|
174
|
-
*/
|
|
175
|
-
function profileLayers(name, files, deferUnknown = false) {
|
|
176
|
-
if (name === undefined || name === '')
|
|
177
|
-
return [];
|
|
178
|
-
const layers = [];
|
|
179
|
-
const declared = new Set();
|
|
180
|
-
const declaringFiles = [];
|
|
181
|
-
for (const [config, path] of files) {
|
|
182
|
-
const profiles = config.profiles;
|
|
183
|
-
if (profiles === undefined)
|
|
184
|
-
continue;
|
|
185
|
-
declaringFiles.push(path);
|
|
186
|
-
for (const key of Object.keys(profiles))
|
|
187
|
-
declared.add(key);
|
|
188
|
-
if (!Object.hasOwn(profiles, name))
|
|
189
|
-
continue;
|
|
190
|
-
const selected = profiles[name];
|
|
191
|
-
// `Object.hasOwn` above is the declaration check. Direct indexing alone
|
|
192
|
-
// admits inherited `toString`, `constructor`, and `__proto__` as profiles
|
|
193
|
-
// a file never declared.
|
|
194
|
-
if (selected === undefined)
|
|
195
|
-
continue;
|
|
196
|
-
layers.push(constantLayer(selected, { kind: 'profile', name, path }));
|
|
197
|
-
}
|
|
198
|
-
if (layers.length === 0) {
|
|
199
|
-
if (deferUnknown)
|
|
200
|
-
return [];
|
|
201
|
-
const known = [...declared].sort();
|
|
202
|
-
// The path is where to go and fix it. A file that already declares
|
|
203
|
-
// profiles is the better answer than the one bound to this folder,
|
|
204
|
-
// because a misspelled name usually sits next to the right one — and
|
|
205
|
-
// when nothing declares any, the folder's own file is where the first
|
|
206
|
-
// one would go.
|
|
207
|
-
const where = declaringFiles[0] ?? files[1]?.[1] ?? '';
|
|
208
|
-
throw new ConfigLoadError(where, known.length === 0
|
|
209
|
-
? `No profile named "${name}" — no config file declares any profiles.`
|
|
210
|
-
: `No profile named "${name}". Declared in ${declaringFiles.join(', ')}: ${known.join(', ')}.`);
|
|
211
|
-
}
|
|
212
|
-
return layers;
|
|
213
|
-
}
|
|
214
|
-
export function loadConfig(opts = {}) {
|
|
215
|
-
return loadConfigWithProvenance(opts).config;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* A config file namzu could not read.
|
|
219
|
-
*
|
|
220
|
-
* Its own class rather than a bare `Error` so `cli.ts` can print the message on
|
|
221
|
-
* its own and exit `EXIT_BAD_CONFIG`, instead of the stack trace an internal
|
|
222
|
-
* error deserves and an operator's typo does not.
|
|
223
|
-
*/
|
|
224
|
-
export class ConfigLoadError extends Error {
|
|
225
|
-
/** The file whose contents could not be established. */
|
|
226
|
-
path;
|
|
227
|
-
constructor(path, message, options) {
|
|
228
|
-
super(message, options);
|
|
229
|
-
this.name = 'ConfigLoadError';
|
|
230
|
-
this.path = path;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* A known config key whose explicit value does not satisfy its public type.
|
|
235
|
-
*
|
|
236
|
-
* Kept distinct from {@link ConfigLoadError}: that class means a file could
|
|
237
|
-
* not be read or parsed at all, while this one means the source was readable
|
|
238
|
-
* and named a setting Namzu cannot honour. Public loaders throw both; the
|
|
239
|
-
* standalone binary maps both to `EX_CONFIG`.
|
|
240
|
-
*/
|
|
241
|
-
export class ConfigValueError extends Error {
|
|
242
|
-
source;
|
|
243
|
-
/** Dot/bracket path to the invalid known setting, without its source. */
|
|
244
|
-
settingPath;
|
|
245
|
-
constructor(source, settingPath, message) {
|
|
246
|
-
const origin = source.kind === 'file'
|
|
247
|
-
? `config file ${configMetadataLiteral(source.path)}`
|
|
248
|
-
: `environment variable ${source.variable}`;
|
|
249
|
-
super(`${origin}: ${settingPath} ${message}`);
|
|
250
|
-
this.name = 'ConfigValueError';
|
|
251
|
-
this.source = source;
|
|
252
|
-
this.settingPath = settingPath;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
function readYamlIfExists(path) {
|
|
256
|
-
const raw = readIfPresent(path);
|
|
257
|
-
if (raw === null)
|
|
258
|
-
return {};
|
|
259
|
-
let parsed;
|
|
260
|
-
try {
|
|
261
|
-
parsed = yamlParse(raw);
|
|
262
|
-
}
|
|
263
|
-
catch (cause) {
|
|
264
|
-
throw new ConfigLoadError(path, `${path} is not valid YAML: ${reasonOf(cause)}`, { cause });
|
|
265
|
-
}
|
|
266
|
-
return asConfigObject(path, parsed);
|
|
267
|
-
}
|
|
268
|
-
function readJsonIfExists(path) {
|
|
269
|
-
const raw = readIfPresent(path);
|
|
270
|
-
if (raw === null)
|
|
271
|
-
return {};
|
|
272
|
-
let parsed;
|
|
273
|
-
try {
|
|
274
|
-
parsed = JSON.parse(raw);
|
|
275
|
-
}
|
|
276
|
-
catch (cause) {
|
|
277
|
-
throw new ConfigLoadError(path, `${path} is not valid JSON: ${reasonOf(cause)}`, { cause });
|
|
278
|
-
}
|
|
279
|
-
return asConfigObject(path, parsed);
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* The file's text, or `null` when the file is genuinely not there.
|
|
283
|
-
*
|
|
284
|
-
* Absent and unreadable used to share one `catch`, and the shared answer was
|
|
285
|
-
* `{}` — "no settings". For a file nobody wrote that is the right default. For
|
|
286
|
-
* one that exists and could not be opened it is the wrong one, and wrong in the
|
|
287
|
-
* direction that never announces itself: `permissions` is read from these files,
|
|
288
|
-
* so an unreadable config becomes an empty rule table, and a headless run
|
|
289
|
-
* resolves every call no rule covered to `auto`. The operator's deny list
|
|
290
|
-
* becomes approval of the same calls, on the one path where nobody is watching.
|
|
291
|
-
*
|
|
292
|
-
* So only "the file is not there" reads as no settings. `ENOENT` is the file
|
|
293
|
-
* itself missing; `ENOTDIR` is a parent that is not a directory, which means the
|
|
294
|
-
* same thing — nothing was ever written at that path. A permission error, a
|
|
295
|
-
* directory where a file belongs, or an I/O failure all mean the file exists and
|
|
296
|
-
* its contents could not be established, and that is a refusal.
|
|
297
|
-
*
|
|
298
|
-
* See "an optional dependency may not degrade a check": the
|
|
299
|
-
* degradation that matters is the one turning "I cannot establish this" into
|
|
300
|
-
* "this is satisfied".
|
|
301
|
-
*/
|
|
302
|
-
function readIfPresent(path) {
|
|
303
|
-
try {
|
|
304
|
-
return readFileSync(path, 'utf8');
|
|
305
|
-
}
|
|
306
|
-
catch (cause) {
|
|
307
|
-
const code = cause?.code;
|
|
308
|
-
if (code === 'ENOENT' || code === 'ENOTDIR')
|
|
309
|
-
return null;
|
|
310
|
-
throw new ConfigLoadError(path, `${path} could not be read: ${reasonOf(cause)}`, { cause });
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* The parsed document as a config object, refusing anything that is not one.
|
|
315
|
-
*
|
|
316
|
-
* An empty file parses to `null`, and that is a genuine "no settings" — a file
|
|
317
|
-
* someone emptied says nothing, which is what it looks like. A scalar or a list
|
|
318
|
-
* is different: it is content namzu cannot read as settings, and admitting it as
|
|
319
|
-
* `{}` is the same fail-open as the unreadable file one function up, reached by
|
|
320
|
-
* a different route.
|
|
321
|
-
*/
|
|
322
|
-
function asConfigObject(path, parsed) {
|
|
323
|
-
if (parsed === null || parsed === undefined)
|
|
324
|
-
return {};
|
|
325
|
-
if (typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
326
|
-
throw new ConfigLoadError(path, `${path} must contain a mapping of settings, but its top level is ${describe(parsed)}`);
|
|
327
|
-
}
|
|
328
|
-
return sanitize(parsed, { kind: 'file', path });
|
|
329
|
-
}
|
|
330
|
-
function describe(value) {
|
|
331
|
-
return Array.isArray(value) ? 'a list' : `a ${typeof value}`;
|
|
332
|
-
}
|
|
333
|
-
function reasonOf(cause) {
|
|
334
|
-
return cause instanceof Error ? cause.message : String(cause);
|
|
335
|
-
}
|
|
336
|
-
const COMPOSER_TRIGGERS_KEYS = ['enabled', 'suggest', 'languages', 'builtin'];
|
|
337
|
-
const SKILLS_CONFIG_KEYS = [
|
|
338
|
-
'builtin',
|
|
339
|
-
'disabled',
|
|
340
|
-
'suggest',
|
|
341
|
-
'suggestMinToolCalls',
|
|
342
|
-
];
|
|
343
|
-
const CONFIG_READERS = {
|
|
344
|
-
format: (v, context) => {
|
|
345
|
-
if (typeof v === 'string' && isFormatName(v))
|
|
346
|
-
return v;
|
|
347
|
-
return invalidConfigValue(context, [], 'must be one of "text", "json", or "yaml"');
|
|
348
|
-
},
|
|
349
|
-
quiet: (v, context) => {
|
|
350
|
-
if (typeof v === 'boolean')
|
|
351
|
-
return v;
|
|
352
|
-
return invalidConfigValue(context, [], 'must be a boolean');
|
|
353
|
-
},
|
|
354
|
-
modelCatalogueRefresh: (v, context) => {
|
|
355
|
-
if (typeof v === 'boolean')
|
|
356
|
-
return v;
|
|
357
|
-
return invalidConfigValue(context, [], 'must be a boolean');
|
|
358
|
-
},
|
|
359
|
-
// Shape only. Per-entry validation belongs to `compilePermissions`, which
|
|
360
|
-
// reports a bad effect or an unusable pattern as a diagnostic the user
|
|
361
|
-
// sees; dropping those entries here would silence it.
|
|
362
|
-
permissions: (v, context) => {
|
|
363
|
-
if (isConfigMapping(v))
|
|
364
|
-
return v;
|
|
365
|
-
return invalidConfigValue(context, [], 'must be a mapping of tool names');
|
|
366
|
-
},
|
|
367
|
-
// Shape only, like `permissions` and for the same reason: per-entry
|
|
368
|
-
// validation belongs to `verifyPermissionChecks`, which reports a bad
|
|
369
|
-
// check by index. Dropping a malformed one here would turn "your check is
|
|
370
|
-
// unreadable" into "your check passed".
|
|
371
|
-
permissionChecks: (v, context) => {
|
|
372
|
-
if (Array.isArray(v))
|
|
373
|
-
return v;
|
|
374
|
-
return invalidConfigValue(context, [], 'must be a list');
|
|
375
|
-
},
|
|
376
|
-
// Every declared profile is checked when its file loads, not only when it is
|
|
377
|
-
// selected. Typed config in a lower-precedence layer cannot become valid
|
|
378
|
-
// merely because another layer happens to win today. Unknown profile keys
|
|
379
|
-
// remain non-strict and are ignored by `sanitize`, like unknown base keys.
|
|
380
|
-
profiles: (v, context) => {
|
|
381
|
-
if (!isConfigMapping(v)) {
|
|
382
|
-
return invalidConfigValue(context, [], 'must be a mapping of profile names');
|
|
383
|
-
}
|
|
384
|
-
const profiles = {};
|
|
385
|
-
for (const name of Object.keys(v)) {
|
|
386
|
-
const entry = v[name];
|
|
387
|
-
if (!isConfigMapping(entry)) {
|
|
388
|
-
return invalidConfigValue(context, [name], 'must be a mapping of settings');
|
|
389
|
-
}
|
|
390
|
-
const parsed = sanitize(entry, context.source, [...context.path, name], false);
|
|
391
|
-
// Define rather than assign: `__proto__` is a valid own profile name,
|
|
392
|
-
// not permission to change this dictionary's prototype.
|
|
393
|
-
Object.defineProperty(profiles, name, {
|
|
394
|
-
value: parsed,
|
|
395
|
-
enumerable: true,
|
|
396
|
-
configurable: true,
|
|
397
|
-
writable: true,
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
return profiles;
|
|
401
|
-
},
|
|
402
|
-
// Shape only, for the same reason as `permissions`: an entry that names
|
|
403
|
-
// neither a command nor a url — or both — is reported by name when the
|
|
404
|
-
// connection is attempted. Dropping it here would turn a mistake the
|
|
405
|
-
// operator can see into a server that silently was never there.
|
|
406
|
-
mcpServers: (v, context) => {
|
|
407
|
-
if (isConfigMapping(v))
|
|
408
|
-
return v;
|
|
409
|
-
return invalidConfigValue(context, [], 'must be a mapping of server names');
|
|
410
|
-
},
|
|
411
|
-
memory: (v, context) => {
|
|
412
|
-
if (!isConfigMapping(v))
|
|
413
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
414
|
-
for (const key of Object.keys(v)) {
|
|
415
|
-
if (key !== 'recall' && key !== 'identifierGrounding')
|
|
416
|
-
return invalidConfigValue(context, [key], 'is not a memory key');
|
|
417
|
-
}
|
|
418
|
-
if (v.recall !== undefined && typeof v.recall !== 'boolean') {
|
|
419
|
-
return invalidConfigValue(context, ['recall'], 'must be true or false');
|
|
420
|
-
}
|
|
421
|
-
if (v.identifierGrounding !== undefined && typeof v.identifierGrounding !== 'boolean') {
|
|
422
|
-
return invalidConfigValue(context, ['identifierGrounding'], 'must be true or false');
|
|
423
|
-
}
|
|
424
|
-
return {
|
|
425
|
-
...(v.recall === undefined ? {} : { recall: v.recall }),
|
|
426
|
-
...(v.identifierGrounding === undefined
|
|
427
|
-
? {}
|
|
428
|
-
: { identifierGrounding: v.identifierGrounding }),
|
|
429
|
-
};
|
|
430
|
-
},
|
|
431
|
-
compaction: (v, context) => {
|
|
432
|
-
if (!isConfigMapping(v))
|
|
433
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
434
|
-
const raw = v;
|
|
435
|
-
for (const key of Object.keys(v)) {
|
|
436
|
-
if (key !== 'strategy' &&
|
|
437
|
-
key !== 'contextWindowTokens' &&
|
|
438
|
-
key !== 'consolidate' &&
|
|
439
|
-
key !== 'recallEvidence' &&
|
|
440
|
-
key !== 'resolveEvidenceQueries' &&
|
|
441
|
-
key !== 'retainedToolPreviewChars' &&
|
|
442
|
-
key !== 'deduplicateObservations') {
|
|
443
|
-
return invalidConfigValue(context, [key], 'is not a compaction key');
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
if (raw.deduplicateObservations !== undefined &&
|
|
447
|
-
typeof raw.deduplicateObservations !== 'boolean') {
|
|
448
|
-
return invalidConfigValue(context, ['deduplicateObservations'], 'must be true or false');
|
|
449
|
-
}
|
|
450
|
-
if (raw.recallEvidence !== undefined && typeof raw.recallEvidence !== 'boolean')
|
|
451
|
-
return invalidConfigValue(context, ['recallEvidence'], 'must be true or false');
|
|
452
|
-
if (raw.resolveEvidenceQueries !== undefined && typeof raw.resolveEvidenceQueries !== 'boolean')
|
|
453
|
-
return invalidConfigValue(context, ['resolveEvidenceQueries'], 'must be true or false');
|
|
454
|
-
if (raw.consolidate !== undefined && typeof raw.consolidate !== 'boolean') {
|
|
455
|
-
return invalidConfigValue(context, ['consolidate'], 'must be true or false');
|
|
456
|
-
}
|
|
457
|
-
if (raw.retainedToolPreviewChars !== undefined &&
|
|
458
|
-
(typeof raw.retainedToolPreviewChars !== 'number' ||
|
|
459
|
-
!Number.isSafeInteger(raw.retainedToolPreviewChars) ||
|
|
460
|
-
raw.retainedToolPreviewChars < 0)) {
|
|
461
|
-
return invalidConfigValue(context, ['retainedToolPreviewChars'], 'must be a nonnegative safe integer');
|
|
462
|
-
}
|
|
463
|
-
if (raw.strategy !== undefined &&
|
|
464
|
-
raw.strategy !== 'structured' &&
|
|
465
|
-
raw.strategy !== 'salience') {
|
|
466
|
-
return invalidConfigValue(context, ['strategy'], 'must be `structured` or `salience`');
|
|
467
|
-
}
|
|
468
|
-
if (raw.contextWindowTokens !== undefined &&
|
|
469
|
-
(typeof raw.contextWindowTokens !== 'number' ||
|
|
470
|
-
!Number.isInteger(raw.contextWindowTokens) ||
|
|
471
|
-
raw.contextWindowTokens <= 0)) {
|
|
472
|
-
return invalidConfigValue(context, ['contextWindowTokens'], 'must be a positive integer');
|
|
473
|
-
}
|
|
474
|
-
return {
|
|
475
|
-
...(raw.strategy !== undefined ? { strategy: raw.strategy } : {}),
|
|
476
|
-
...(raw.contextWindowTokens !== undefined
|
|
477
|
-
? { contextWindowTokens: raw.contextWindowTokens }
|
|
478
|
-
: {}),
|
|
479
|
-
...(raw.consolidate !== undefined ? { consolidate: raw.consolidate } : {}),
|
|
480
|
-
...(raw.recallEvidence !== undefined ? { recallEvidence: raw.recallEvidence } : {}),
|
|
481
|
-
...(raw.resolveEvidenceQueries !== undefined
|
|
482
|
-
? { resolveEvidenceQueries: raw.resolveEvidenceQueries }
|
|
483
|
-
: {}),
|
|
484
|
-
...(raw.retainedToolPreviewChars !== undefined
|
|
485
|
-
? { retainedToolPreviewChars: raw.retainedToolPreviewChars }
|
|
486
|
-
: {}),
|
|
487
|
-
...(raw.deduplicateObservations !== undefined
|
|
488
|
-
? { deduplicateObservations: raw.deduplicateObservations }
|
|
489
|
-
: {}),
|
|
490
|
-
};
|
|
491
|
-
},
|
|
492
|
-
additionalDirectories: (v, context) => {
|
|
493
|
-
if (!Array.isArray(v))
|
|
494
|
-
return invalidConfigValue(context, [], 'must be a list of directories');
|
|
495
|
-
for (const [index, entry] of v.entries()) {
|
|
496
|
-
if (typeof entry !== 'string' || entry.trim().length === 0) {
|
|
497
|
-
return invalidConfigValue(context, [index], 'must be a directory path');
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
return v;
|
|
501
|
-
},
|
|
502
|
-
toolResultScreens: (v, context) => {
|
|
503
|
-
if (!Array.isArray(v)) {
|
|
504
|
-
return invalidConfigValue(context, [], 'must be a list of screen names');
|
|
505
|
-
}
|
|
506
|
-
const names = TOOL_RESULT_SCREEN_NAMES.join(', ');
|
|
507
|
-
for (const [index, entry] of v.entries()) {
|
|
508
|
-
if (typeof entry === 'string') {
|
|
509
|
-
if (!isToolResultScreenName(entry)) {
|
|
510
|
-
return invalidConfigValue(context, [index], `must be one of: ${names}`);
|
|
511
|
-
}
|
|
512
|
-
continue;
|
|
513
|
-
}
|
|
514
|
-
if (!isConfigMapping(entry)) {
|
|
515
|
-
return invalidConfigValue(context, [index], 'must be a screen name, or a mapping with a `name`');
|
|
516
|
-
}
|
|
517
|
-
const { name, ...options } = entry;
|
|
518
|
-
if (typeof name !== 'string' || !isToolResultScreenName(name)) {
|
|
519
|
-
return invalidConfigValue(context, [index, 'name'], `must be one of: ${names}`);
|
|
520
|
-
}
|
|
521
|
-
// An option the named screen does not read is refused rather than
|
|
522
|
-
// carried: `{ "name": "injection", "passthroughTools": [...] }`
|
|
523
|
-
// would otherwise install, parse, and exempt nothing, which reads
|
|
524
|
-
// to an operator as the exemption being in force.
|
|
525
|
-
for (const key of Object.keys(options)) {
|
|
526
|
-
if (!TOOL_RESULT_SCREEN_OPTION_KEYS[name].includes(key)) {
|
|
527
|
-
return invalidConfigValue(context, [index, key], `is not an option of the "${name}" screen`);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
const passthroughTools = entry.passthroughTools;
|
|
531
|
-
if (passthroughTools === undefined)
|
|
532
|
-
continue;
|
|
533
|
-
if (!Array.isArray(passthroughTools)) {
|
|
534
|
-
return invalidConfigValue(context, [index, 'passthroughTools'], 'must be a list of tool names');
|
|
535
|
-
}
|
|
536
|
-
for (const [position, toolName] of passthroughTools.entries()) {
|
|
537
|
-
if (typeof toolName !== 'string' || toolName.trim().length === 0) {
|
|
538
|
-
return invalidConfigValue(context, [index, 'passthroughTools', position], 'must be a tool name');
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
return v;
|
|
543
|
-
},
|
|
544
|
-
hooks: (v, context) => {
|
|
545
|
-
if (!isConfigMapping(v))
|
|
546
|
-
return invalidConfigValue(context, [], 'must be a mapping of event → list');
|
|
547
|
-
const events = new Set(SHELL_HOOK_EVENTS);
|
|
548
|
-
const out = {};
|
|
549
|
-
for (const [event, entries] of Object.entries(v)) {
|
|
550
|
-
const renamed = Object.hasOwn(RENAMED_PLUGIN_HOOK_EVENTS, event)
|
|
551
|
-
? RENAMED_PLUGIN_HOOK_EVENTS[event]
|
|
552
|
-
: undefined;
|
|
553
|
-
if (renamed !== undefined) {
|
|
554
|
-
return invalidConfigValue(context, [event], `was renamed; name it \`${renamed}\``);
|
|
555
|
-
}
|
|
556
|
-
if (!events.has(event)) {
|
|
557
|
-
return invalidConfigValue(context, [event], `is not a hook event (${SHELL_HOOK_EVENTS.join(', ')})`);
|
|
558
|
-
}
|
|
559
|
-
if (!Array.isArray(entries))
|
|
560
|
-
return invalidConfigValue(context, [event], 'must be a list of hooks');
|
|
561
|
-
const parsed = [];
|
|
562
|
-
for (const [index, entry] of entries.entries()) {
|
|
563
|
-
if (!isConfigMapping(entry)) {
|
|
564
|
-
return invalidConfigValue(context, [event, index], 'must be a mapping with a `command`');
|
|
565
|
-
}
|
|
566
|
-
const raw = entry;
|
|
567
|
-
for (const key of Object.keys(entry)) {
|
|
568
|
-
if (key !== 'command' && key !== 'matcher' && key !== 'timeoutMs') {
|
|
569
|
-
return invalidConfigValue(context, [event, index, key], 'is not a recognized hook setting');
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
if (typeof raw.command !== 'string' || raw.command.trim().length === 0) {
|
|
573
|
-
return invalidConfigValue(context, [event, index, 'command'], 'must be a non-empty string');
|
|
574
|
-
}
|
|
575
|
-
if (raw.matcher !== undefined && typeof raw.matcher !== 'string') {
|
|
576
|
-
return invalidConfigValue(context, [event, index, 'matcher'], 'must be a string');
|
|
577
|
-
}
|
|
578
|
-
if (raw.timeoutMs !== undefined &&
|
|
579
|
-
(typeof raw.timeoutMs !== 'number' ||
|
|
580
|
-
!Number.isInteger(raw.timeoutMs) ||
|
|
581
|
-
raw.timeoutMs <= 0)) {
|
|
582
|
-
return invalidConfigValue(context, [event, index, 'timeoutMs'], 'must be a positive integer');
|
|
583
|
-
}
|
|
584
|
-
parsed.push({
|
|
585
|
-
command: raw.command,
|
|
586
|
-
...(raw.matcher !== undefined ? { matcher: raw.matcher } : {}),
|
|
587
|
-
...(raw.timeoutMs !== undefined ? { timeoutMs: raw.timeoutMs } : {}),
|
|
588
|
-
});
|
|
589
|
-
}
|
|
590
|
-
out[event] = parsed;
|
|
591
|
-
}
|
|
592
|
-
return out;
|
|
593
|
-
},
|
|
594
|
-
browser: (v, context) => readBrowserConfig(v, context),
|
|
595
|
-
web: (v, context) => {
|
|
596
|
-
if (!isConfigMapping(v))
|
|
597
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
598
|
-
for (const key of Object.keys(v)) {
|
|
599
|
-
if (key !== 'fetch' && key !== 'search' && key !== 'backend')
|
|
600
|
-
return invalidConfigValue(context, [key], 'is not a recognized web setting');
|
|
601
|
-
}
|
|
602
|
-
const raw = v;
|
|
603
|
-
if (raw.backend !== undefined &&
|
|
604
|
-
raw.backend !== 'auto' &&
|
|
605
|
-
raw.backend !== 'exa' &&
|
|
606
|
-
raw.backend !== 'native')
|
|
607
|
-
return invalidConfigValue(context, ['backend'], 'must be auto, exa or native');
|
|
608
|
-
if (raw.search === 'cached' && raw.backend === 'exa')
|
|
609
|
-
return invalidConfigValue(context, ['backend'], 'cached search requires native');
|
|
610
|
-
if (raw.search !== undefined &&
|
|
611
|
-
(typeof raw.search !== 'string' || !['off', 'cached', 'live'].includes(raw.search))) {
|
|
612
|
-
return invalidConfigValue(context, ['search'], 'must be off, cached, or live');
|
|
613
|
-
}
|
|
614
|
-
if (raw.fetch !== undefined && typeof raw.fetch !== 'boolean') {
|
|
615
|
-
return invalidConfigValue(context, ['fetch'], 'must be a boolean');
|
|
616
|
-
}
|
|
617
|
-
return raw;
|
|
618
|
-
},
|
|
619
|
-
limits: (v, context) => {
|
|
620
|
-
if (!isConfigMapping(v))
|
|
621
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
622
|
-
for (const key of Object.keys(v)) {
|
|
623
|
-
if (!['maxIterations', 'tokenBudget', 'timeoutMs', 'waitForProviderMs'].includes(key))
|
|
624
|
-
return invalidConfigValue(context, [key], 'is not a limit (maxIterations, tokenBudget, timeoutMs, waitForProviderMs)');
|
|
625
|
-
const value = v[key];
|
|
626
|
-
const minimum = key === 'waitForProviderMs' ? 1 : 0;
|
|
627
|
-
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < minimum)
|
|
628
|
-
return invalidConfigValue(context, [key], `must be a safe whole number at least ${minimum}`);
|
|
629
|
-
if (key === 'timeoutMs' && value > 2_147_483_647)
|
|
630
|
-
return invalidConfigValue(context, [key], 'must be at most 2147483647 milliseconds; use 0 for unlimited');
|
|
631
|
-
}
|
|
632
|
-
return v;
|
|
633
|
-
},
|
|
634
|
-
plugins: (v, context) => {
|
|
635
|
-
if (!isConfigMapping(v))
|
|
636
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
637
|
-
const known = new Set(['enabled', 'autoDiscovery', 'allowedScopes', 'hookTimeoutMs']);
|
|
638
|
-
for (const key of Object.keys(v)) {
|
|
639
|
-
if (!known.has(key)) {
|
|
640
|
-
return invalidConfigValue(context, [key], 'is not a recognized plugin setting');
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
const raw = v;
|
|
644
|
-
if (raw.enabled !== undefined && typeof raw.enabled !== 'boolean') {
|
|
645
|
-
return invalidConfigValue(context, ['enabled'], 'must be a boolean');
|
|
646
|
-
}
|
|
647
|
-
if (raw.autoDiscovery !== undefined && typeof raw.autoDiscovery !== 'boolean') {
|
|
648
|
-
return invalidConfigValue(context, ['autoDiscovery'], 'must be a boolean');
|
|
649
|
-
}
|
|
650
|
-
let allowedScopes;
|
|
651
|
-
if (raw.allowedScopes !== undefined) {
|
|
652
|
-
if (!Array.isArray(raw.allowedScopes)) {
|
|
653
|
-
return invalidConfigValue(context, ['allowedScopes'], 'must be a list');
|
|
654
|
-
}
|
|
655
|
-
const invalidIndex = raw.allowedScopes.findIndex((scope) => scope !== 'project' && scope !== 'user');
|
|
656
|
-
if (invalidIndex >= 0) {
|
|
657
|
-
return invalidConfigValue(context, ['allowedScopes', invalidIndex], 'must be one of "project" or "user"');
|
|
658
|
-
}
|
|
659
|
-
if (new Set(raw.allowedScopes).size !== raw.allowedScopes.length) {
|
|
660
|
-
return invalidConfigValue(context, ['allowedScopes'], 'must not contain duplicates');
|
|
661
|
-
}
|
|
662
|
-
allowedScopes = raw.allowedScopes;
|
|
663
|
-
}
|
|
664
|
-
if (raw.hookTimeoutMs !== undefined &&
|
|
665
|
-
(!Number.isInteger(raw.hookTimeoutMs) ||
|
|
666
|
-
raw.hookTimeoutMs <= 0 ||
|
|
667
|
-
raw.hookTimeoutMs > 2_147_483_647)) {
|
|
668
|
-
return invalidConfigValue(context, ['hookTimeoutMs'], 'must be an integer from 1 to 2147483647');
|
|
669
|
-
}
|
|
670
|
-
return {
|
|
671
|
-
...(raw.enabled !== undefined ? { enabled: raw.enabled } : {}),
|
|
672
|
-
...(raw.autoDiscovery !== undefined ? { autoDiscovery: raw.autoDiscovery } : {}),
|
|
673
|
-
...(allowedScopes !== undefined ? { allowedScopes } : {}),
|
|
674
|
-
...(raw.hookTimeoutMs !== undefined ? { hookTimeoutMs: raw.hookTimeoutMs } : {}),
|
|
675
|
-
};
|
|
676
|
-
},
|
|
677
|
-
// Read field by field rather than shape-only, unlike the two above.
|
|
678
|
-
// Those hand their entries to a compiler that reports a bad one by name;
|
|
679
|
-
// this one is consumed directly, and a misspelled `require_isolation` or
|
|
680
|
-
// a string where a list belongs would otherwise become "no requirement"
|
|
681
|
-
// — a security control silently downgraded by a typo, which is the
|
|
682
|
-
// failure this whole change exists to remove.
|
|
683
|
-
sandbox: (v, context) => {
|
|
684
|
-
if (!isConfigMapping(v))
|
|
685
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
686
|
-
const raw = v;
|
|
687
|
-
for (const key of ['enabled', 'allowEscape', 'allowUnattendedEscape']) {
|
|
688
|
-
if (raw[key] !== undefined && typeof raw[key] !== 'boolean') {
|
|
689
|
-
return invalidConfigValue(context, [key], 'must be a boolean');
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
if (raw.requireIsolation !== undefined && !Array.isArray(raw.requireIsolation)) {
|
|
693
|
-
return invalidConfigValue(context, ['requireIsolation'], 'must be a list');
|
|
694
|
-
}
|
|
695
|
-
const requireIsolation = raw.requireIsolation;
|
|
696
|
-
const invalidIndex = requireIsolation?.findIndex((value) => value !== 'filesystem' && value !== 'network' && value !== 'process');
|
|
697
|
-
if (invalidIndex !== undefined && invalidIndex >= 0) {
|
|
698
|
-
return invalidConfigValue(context, ['requireIsolation', invalidIndex], 'must be one of "filesystem", "network", or "process"');
|
|
699
|
-
}
|
|
700
|
-
if (raw.workspace !== undefined &&
|
|
701
|
-
raw.workspace !== 'working-directory' &&
|
|
702
|
-
raw.workspace !== 'ephemeral') {
|
|
703
|
-
return invalidConfigValue(context, ['workspace'], 'must be one of "working-directory" or "ephemeral"');
|
|
704
|
-
}
|
|
705
|
-
if (raw.teardownTimeoutMs !== undefined &&
|
|
706
|
-
(!Number.isInteger(raw.teardownTimeoutMs) ||
|
|
707
|
-
raw.teardownTimeoutMs < 0 ||
|
|
708
|
-
raw.teardownTimeoutMs > 2_147_483_647)) {
|
|
709
|
-
return invalidConfigValue(context, ['teardownTimeoutMs'], 'must be an integer from 0 to 2147483647');
|
|
710
|
-
}
|
|
711
|
-
return {
|
|
712
|
-
...(raw.enabled !== undefined ? { enabled: raw.enabled } : {}),
|
|
713
|
-
...(raw.allowEscape !== undefined ? { allowEscape: raw.allowEscape } : {}),
|
|
714
|
-
...(raw.allowUnattendedEscape !== undefined
|
|
715
|
-
? { allowUnattendedEscape: raw.allowUnattendedEscape }
|
|
716
|
-
: {}),
|
|
717
|
-
...(requireIsolation !== undefined
|
|
718
|
-
? {
|
|
719
|
-
requireIsolation: requireIsolation,
|
|
720
|
-
}
|
|
721
|
-
: {}),
|
|
722
|
-
...(raw.workspace !== undefined
|
|
723
|
-
? { workspace: raw.workspace }
|
|
724
|
-
: {}),
|
|
725
|
-
...(raw.teardownTimeoutMs !== undefined
|
|
726
|
-
? { teardownTimeoutMs: raw.teardownTimeoutMs }
|
|
727
|
-
: {}),
|
|
728
|
-
};
|
|
729
|
-
},
|
|
730
|
-
// Field by field, for the same reason as `sandbox` and one stronger:
|
|
731
|
-
// this one decides whether conversation content leaves the machine. A
|
|
732
|
-
// misspelled `redacters` read shape-only could change the export's security
|
|
733
|
-
// posture while it still ran. A malformed known field therefore refuses the
|
|
734
|
-
// config rather than selecting either "off" or a different redactor set.
|
|
735
|
-
telemetry: (v, context) => {
|
|
736
|
-
if (!isConfigMapping(v))
|
|
737
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
738
|
-
const raw = v;
|
|
739
|
-
if (raw.sessionExport === undefined)
|
|
740
|
-
return {};
|
|
741
|
-
const se = raw.sessionExport;
|
|
742
|
-
if (!isConfigMapping(se)) {
|
|
743
|
-
return invalidConfigValue(context, ['sessionExport'], 'must be a mapping');
|
|
744
|
-
}
|
|
745
|
-
const entry = se;
|
|
746
|
-
// No destination, no export. There is nothing to fall back to and
|
|
747
|
-
// nothing safe to guess.
|
|
748
|
-
if (typeof entry.destination !== 'string' || entry.destination.length === 0) {
|
|
749
|
-
return invalidConfigValue(context, ['sessionExport', 'destination'], 'must be a non-empty string');
|
|
750
|
-
}
|
|
751
|
-
let eventTypes;
|
|
752
|
-
if (entry.eventTypes !== undefined) {
|
|
753
|
-
if (!Array.isArray(entry.eventTypes)) {
|
|
754
|
-
return invalidConfigValue(context, ['sessionExport', 'eventTypes'], 'must be a list');
|
|
755
|
-
}
|
|
756
|
-
const invalidIndex = entry.eventTypes.findIndex((event) => typeof event !== 'string');
|
|
757
|
-
if (invalidIndex >= 0) {
|
|
758
|
-
return invalidConfigValue(context, ['sessionExport', 'eventTypes', invalidIndex], 'must be a string');
|
|
759
|
-
}
|
|
760
|
-
eventTypes = entry.eventTypes;
|
|
761
|
-
}
|
|
762
|
-
let redactors;
|
|
763
|
-
if (entry.redactors !== undefined) {
|
|
764
|
-
if (!Array.isArray(entry.redactors)) {
|
|
765
|
-
return invalidConfigValue(context, ['sessionExport', 'redactors'], 'must be a list');
|
|
766
|
-
}
|
|
767
|
-
const invalidIndex = entry.redactors.findIndex((redactor) => redactor !== 'secrets');
|
|
768
|
-
if (invalidIndex >= 0) {
|
|
769
|
-
return invalidConfigValue(context, ['sessionExport', 'redactors', invalidIndex], 'must be "secrets"');
|
|
770
|
-
}
|
|
771
|
-
redactors = entry.redactors;
|
|
772
|
-
}
|
|
773
|
-
return {
|
|
774
|
-
sessionExport: {
|
|
775
|
-
destination: entry.destination,
|
|
776
|
-
...(eventTypes !== undefined ? { eventTypes } : {}),
|
|
777
|
-
...(redactors !== undefined ? { redactors } : {}),
|
|
778
|
-
},
|
|
779
|
-
};
|
|
780
|
-
},
|
|
781
|
-
// TUI notifications are terminal escape writes only. Invalid nested values
|
|
782
|
-
// refuse rather than silently selecting a different event/protocol or
|
|
783
|
-
// disabling the feature the operator explicitly configured.
|
|
784
|
-
skills: (v, context) => {
|
|
785
|
-
if (!isConfigMapping(v))
|
|
786
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
787
|
-
for (const key of Object.keys(v)) {
|
|
788
|
-
if (!SKILLS_CONFIG_KEYS.includes(key)) {
|
|
789
|
-
return invalidConfigValue(context, [key], `is not a skills setting (${SKILLS_CONFIG_KEYS.join(', ')})`);
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
const raw = v;
|
|
793
|
-
if (raw.builtin !== undefined && typeof raw.builtin !== 'boolean') {
|
|
794
|
-
return invalidConfigValue(context, ['builtin'], 'must be true or false');
|
|
795
|
-
}
|
|
796
|
-
if (raw.suggest !== undefined && typeof raw.suggest !== 'boolean') {
|
|
797
|
-
return invalidConfigValue(context, ['suggest'], 'must be true or false');
|
|
798
|
-
}
|
|
799
|
-
if (raw.suggestMinToolCalls !== undefined &&
|
|
800
|
-
(typeof raw.suggestMinToolCalls !== 'number' ||
|
|
801
|
-
!Number.isInteger(raw.suggestMinToolCalls) ||
|
|
802
|
-
raw.suggestMinToolCalls < 1)) {
|
|
803
|
-
return invalidConfigValue(context, ['suggestMinToolCalls'], 'must be a whole number of at least 1');
|
|
804
|
-
}
|
|
805
|
-
if (raw.disabled !== undefined &&
|
|
806
|
-
(!Array.isArray(raw.disabled) ||
|
|
807
|
-
raw.disabled.some((name) => typeof name !== 'string' || name.trim() === ''))) {
|
|
808
|
-
return invalidConfigValue(context, ['disabled'], 'must be a list of skill names');
|
|
809
|
-
}
|
|
810
|
-
return {
|
|
811
|
-
...(raw.builtin !== undefined ? { builtin: raw.builtin } : {}),
|
|
812
|
-
...(raw.disabled !== undefined
|
|
813
|
-
? { disabled: raw.disabled.map((name) => name.trim()) }
|
|
814
|
-
: {}),
|
|
815
|
-
...(raw.suggest !== undefined ? { suggest: raw.suggest } : {}),
|
|
816
|
-
...(raw.suggestMinToolCalls !== undefined
|
|
817
|
-
? { suggestMinToolCalls: raw.suggestMinToolCalls }
|
|
818
|
-
: {}),
|
|
819
|
-
};
|
|
820
|
-
},
|
|
821
|
-
schedule: (v, context) => {
|
|
822
|
-
if (!isConfigMapping(v))
|
|
823
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
824
|
-
for (const key of Object.keys(v)) {
|
|
825
|
-
if (key !== 'maxConcurrentRuns' && key !== 'notifications') {
|
|
826
|
-
return invalidConfigValue(context, [key], 'is not a schedule setting (maxConcurrentRuns, notifications)');
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
const raw = v;
|
|
830
|
-
if (raw.maxConcurrentRuns !== undefined &&
|
|
831
|
-
(typeof raw.maxConcurrentRuns !== 'number' ||
|
|
832
|
-
!Number.isSafeInteger(raw.maxConcurrentRuns) ||
|
|
833
|
-
raw.maxConcurrentRuns < 1 ||
|
|
834
|
-
raw.maxConcurrentRuns > 16)) {
|
|
835
|
-
return invalidConfigValue(context, ['maxConcurrentRuns'], 'must be a whole number from 1 to 16');
|
|
836
|
-
}
|
|
837
|
-
if (raw.notifications !== undefined && typeof raw.notifications !== 'boolean') {
|
|
838
|
-
return invalidConfigValue(context, ['notifications'], 'must be a boolean');
|
|
839
|
-
}
|
|
840
|
-
return {
|
|
841
|
-
...(raw.maxConcurrentRuns !== undefined
|
|
842
|
-
? { maxConcurrentRuns: raw.maxConcurrentRuns }
|
|
843
|
-
: {}),
|
|
844
|
-
...(raw.notifications !== undefined ? { notifications: raw.notifications } : {}),
|
|
845
|
-
};
|
|
846
|
-
},
|
|
847
|
-
// Shape only: the words themselves are matched by the interactive
|
|
848
|
-
// terminal, which is the only reader. A wrong key or value still refuses,
|
|
849
|
-
// because an operator who wrote `enabled: flase` believes it is off.
|
|
850
|
-
composerTriggers: (v, context) => {
|
|
851
|
-
if (!isConfigMapping(v))
|
|
852
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
853
|
-
for (const key of Object.keys(v)) {
|
|
854
|
-
if (!COMPOSER_TRIGGERS_KEYS.includes(key)) {
|
|
855
|
-
return invalidConfigValue(context, [key], `is not a composerTriggers setting (${COMPOSER_TRIGGERS_KEYS.join(', ')})`);
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
const raw = v;
|
|
859
|
-
for (const key of ['enabled', 'suggest']) {
|
|
860
|
-
if (raw[key] !== undefined && typeof raw[key] !== 'boolean')
|
|
861
|
-
return invalidConfigValue(context, [key], 'must be true or false');
|
|
862
|
-
}
|
|
863
|
-
let languages;
|
|
864
|
-
if (raw.languages !== undefined) {
|
|
865
|
-
if (!Array.isArray(raw.languages))
|
|
866
|
-
return invalidConfigValue(context, ['languages'], 'must be a list: en, tr');
|
|
867
|
-
languages = [];
|
|
868
|
-
for (const [index, language] of raw.languages.entries()) {
|
|
869
|
-
if (!COMPOSER_TRIGGER_LANGUAGES.includes(language))
|
|
870
|
-
return invalidConfigValue(context, ['languages', index], 'must be en or tr');
|
|
871
|
-
languages.push(language);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
let builtin;
|
|
875
|
-
if (raw.builtin !== undefined) {
|
|
876
|
-
if (!isConfigMapping(raw.builtin))
|
|
877
|
-
return invalidConfigValue(context, ['builtin'], 'must be a mapping of trigger to arm, suggest or off');
|
|
878
|
-
builtin = {};
|
|
879
|
-
for (const [id, arming] of Object.entries(raw.builtin)) {
|
|
880
|
-
if (!COMPOSER_TRIGGER_IDS.includes(id))
|
|
881
|
-
return invalidConfigValue(context, ['builtin', id], `is not a built-in trigger (${COMPOSER_TRIGGER_IDS.join(', ')})`);
|
|
882
|
-
if (arming !== 'arm' && arming !== 'suggest' && arming !== 'off')
|
|
883
|
-
return invalidConfigValue(context, ['builtin', id], 'must be arm, suggest or off');
|
|
884
|
-
builtin[id] = arming;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
return {
|
|
888
|
-
...(raw.enabled !== undefined ? { enabled: raw.enabled } : {}),
|
|
889
|
-
...(raw.suggest !== undefined ? { suggest: raw.suggest } : {}),
|
|
890
|
-
...(languages !== undefined ? { languages } : {}),
|
|
891
|
-
...(builtin !== undefined ? { builtin } : {}),
|
|
892
|
-
};
|
|
893
|
-
},
|
|
894
|
-
tui: (v, context) => {
|
|
895
|
-
if (!isConfigMapping(v))
|
|
896
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
897
|
-
const raw = v;
|
|
898
|
-
let notifications;
|
|
899
|
-
if (typeof raw.notifications === 'boolean')
|
|
900
|
-
notifications = raw.notifications;
|
|
901
|
-
else if (Array.isArray(raw.notifications)) {
|
|
902
|
-
const invalidIndex = raw.notifications.findIndex((event) => event !== 'turn-settled' && event !== 'approval-required');
|
|
903
|
-
if (invalidIndex >= 0) {
|
|
904
|
-
return invalidConfigValue(context, ['notifications', invalidIndex], 'must be one of "turn-settled" or "approval-required"');
|
|
905
|
-
}
|
|
906
|
-
notifications = raw.notifications;
|
|
907
|
-
}
|
|
908
|
-
else if (raw.notifications !== undefined) {
|
|
909
|
-
return invalidConfigValue(context, ['notifications'], 'must be a boolean or a list');
|
|
910
|
-
}
|
|
911
|
-
const method = raw.notificationMethod;
|
|
912
|
-
if (method !== undefined && method !== 'osc9' && method !== 'bel') {
|
|
913
|
-
return invalidConfigValue(context, ['notificationMethod'], 'must be "osc9" or "bel"');
|
|
914
|
-
}
|
|
915
|
-
return {
|
|
916
|
-
...(notifications !== undefined ? { notifications } : {}),
|
|
917
|
-
...(method !== undefined ? { notificationMethod: method } : {}),
|
|
918
|
-
};
|
|
919
|
-
},
|
|
920
|
-
};
|
|
921
|
-
export const ENV_VARIABLE_NAMES = {
|
|
922
|
-
format: 'NAMZU_FORMAT',
|
|
923
|
-
quiet: 'NAMZU_QUIET',
|
|
924
|
-
permissions: undefined,
|
|
925
|
-
// Deliberately not env-settable, and for a sharper reason than the rest:
|
|
926
|
-
// a variable that could replace the checks could also empty them, which
|
|
927
|
-
// would silence the one thing that says a policy stopped meaning what its
|
|
928
|
-
// author wrote — from a shell profile, with nothing in the config file to
|
|
929
|
-
// show for it.
|
|
930
|
-
permissionChecks: undefined,
|
|
931
|
-
// The SET of profiles is not env-settable — it is the thing being chosen
|
|
932
|
-
// BETWEEN, and a variable that could replace it could hand a shell a
|
|
933
|
-
// profile the files never declared. `NAMZU_PROFILE` selects one of the
|
|
934
|
-
// declared profiles and is read in the cascade rather than here, because
|
|
935
|
-
// it does not set a config field.
|
|
936
|
-
profiles: undefined,
|
|
937
|
-
mcpServers: undefined,
|
|
938
|
-
// Executable code must never be enabled by ambient shell state. The file
|
|
939
|
-
// and its provenance are the reviewable source of this authority.
|
|
940
|
-
plugins: undefined,
|
|
941
|
-
sandbox: undefined,
|
|
942
|
-
limits: undefined,
|
|
943
|
-
// Outbound reach is opted into in the file, never from the environment.
|
|
944
|
-
web: undefined,
|
|
945
|
-
// A browser signed in to the operator's sites, and which of them it may
|
|
946
|
-
// change: a file decision, never a shell's.
|
|
947
|
-
browser: undefined,
|
|
948
|
-
// A hook runs a command with the operator's authority; the file is the only
|
|
949
|
-
// place one may be declared.
|
|
950
|
-
hooks: undefined,
|
|
951
|
-
additionalDirectories: undefined,
|
|
952
|
-
// Absent here for the reason `additionalDirectories` is: the environment
|
|
953
|
-
// carries scalars, and a screen is a list of names whose meaning belongs
|
|
954
|
-
// where a project's runs are reviewed.
|
|
955
|
-
toolResultScreens: undefined,
|
|
956
|
-
// A strategy is a property of a project's runs, declared where they are reviewed.
|
|
957
|
-
compaction: undefined,
|
|
958
|
-
memory: undefined,
|
|
959
|
-
// Deliberately not env-settable. A `NAMZU_TELEMETRY_SESSION_EXPORT=/tmp/x`
|
|
960
|
-
// in a shell profile would start exporting conversation content with
|
|
961
|
-
// nothing in the config file to show for it — the disclosure would be
|
|
962
|
-
// honest and the *reason* would be invisible.
|
|
963
|
-
telemetry: undefined,
|
|
964
|
-
// Terminal notifications are an interactive UI choice. An environment
|
|
965
|
-
// variable in a shell profile must not start producing them invisibly.
|
|
966
|
-
tui: undefined,
|
|
967
|
-
// How many unattended runs a machine starts is the machine owner's to say,
|
|
968
|
-
// in a file; never a variable a profile could carry invisibly.
|
|
969
|
-
schedule: undefined,
|
|
970
|
-
// A list of names and a switch that decide what reaches the model's prompt;
|
|
971
|
-
// declared in a file, where a project's runs are reviewed.
|
|
972
|
-
skills: undefined,
|
|
973
|
-
// What typed words do in the operator's own composer: a file decision,
|
|
974
|
-
// never a variable a shell profile could carry invisibly.
|
|
975
|
-
composerTriggers: undefined,
|
|
976
|
-
// A scalar switch, and the one a CI job or a test harness needs to keep a
|
|
977
|
-
// launch off the network without writing a config file.
|
|
978
|
-
modelCatalogueRefresh: 'NAMZU_MODEL_CATALOGUE_REFRESH',
|
|
979
|
-
};
|
|
980
|
-
function readEnv(env) {
|
|
981
|
-
const config = {};
|
|
982
|
-
const variables = {};
|
|
983
|
-
const formatVar = ENV_VARIABLE_NAMES.format;
|
|
984
|
-
if (formatVar) {
|
|
985
|
-
const format = env[formatVar];
|
|
986
|
-
if (format !== undefined) {
|
|
987
|
-
if (!isFormatName(format)) {
|
|
988
|
-
throw new ConfigValueError({ kind: 'environment', variable: formatVar }, 'format', 'must be one of "text", "json", or "yaml"');
|
|
989
|
-
}
|
|
990
|
-
config.format = format;
|
|
991
|
-
variables.format = formatVar;
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
const quietVar = ENV_VARIABLE_NAMES.quiet;
|
|
995
|
-
if (quietVar) {
|
|
996
|
-
const quiet = env[quietVar];
|
|
997
|
-
if (quiet !== undefined) {
|
|
998
|
-
if (quiet !== '1' && quiet !== 'true' && quiet !== '0' && quiet !== 'false') {
|
|
999
|
-
throw new ConfigValueError({ kind: 'environment', variable: quietVar }, 'quiet', 'must be one of "1", "true", "0", or "false"');
|
|
1000
|
-
}
|
|
1001
|
-
config.quiet = quiet === '1' || quiet === 'true';
|
|
1002
|
-
variables.quiet = quietVar;
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
const refreshVar = ENV_VARIABLE_NAMES.modelCatalogueRefresh;
|
|
1006
|
-
if (refreshVar) {
|
|
1007
|
-
const refresh = env[refreshVar];
|
|
1008
|
-
if (refresh !== undefined) {
|
|
1009
|
-
if (refresh !== '1' && refresh !== 'true' && refresh !== '0' && refresh !== 'false') {
|
|
1010
|
-
throw new ConfigValueError({ kind: 'environment', variable: refreshVar }, 'modelCatalogueRefresh', 'must be one of "1", "true", "0", or "false"');
|
|
1011
|
-
}
|
|
1012
|
-
config.modelCatalogueRefresh = refresh === '1' || refresh === 'true';
|
|
1013
|
-
variables.modelCatalogueRefresh = refreshVar;
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
return { config, variables };
|
|
1017
|
-
}
|
|
1018
|
-
function sanitize(value, source, prefix = [], allowProfiles = true) {
|
|
1019
|
-
const v = value;
|
|
1020
|
-
const out = {};
|
|
1021
|
-
for (const key of Object.keys(CONFIG_READERS)) {
|
|
1022
|
-
if (!Object.hasOwn(v, key))
|
|
1023
|
-
continue;
|
|
1024
|
-
if (!allowProfiles && (key === 'profiles' || key === 'plugins')) {
|
|
1025
|
-
throw new ConfigValueError(source, formatSettingPath([...prefix, key]), key === 'plugins'
|
|
1026
|
-
? 'cannot be declared inside a profile because profiles may be selected by the environment'
|
|
1027
|
-
: 'cannot be declared inside a profile');
|
|
1028
|
-
}
|
|
1029
|
-
const parsed = CONFIG_READERS[key](v[key], {
|
|
1030
|
-
source,
|
|
1031
|
-
path: [...prefix, key],
|
|
1032
|
-
});
|
|
1033
|
-
out[key] = parsed;
|
|
1034
|
-
}
|
|
1035
|
-
return out;
|
|
1036
|
-
}
|
|
1037
|
-
function isConfigMapping(value) {
|
|
1038
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
1039
|
-
}
|
|
1040
|
-
function invalidConfigValue(context, suffix, message) {
|
|
1041
|
-
throw new ConfigValueError(context.source, formatSettingPath([...context.path, ...suffix]), message);
|
|
1042
|
-
}
|
|
1043
|
-
function formatSettingPath(segments) {
|
|
1044
|
-
let out = '';
|
|
1045
|
-
for (const segment of segments) {
|
|
1046
|
-
if (typeof segment === 'number') {
|
|
1047
|
-
out += `[${segment}]`;
|
|
1048
|
-
continue;
|
|
1049
|
-
}
|
|
1050
|
-
if (/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(segment)) {
|
|
1051
|
-
out += out === '' ? segment : `.${segment}`;
|
|
1052
|
-
continue;
|
|
1053
|
-
}
|
|
1054
|
-
out += `[${configMetadataLiteral(segment)}]`;
|
|
1055
|
-
}
|
|
1056
|
-
return out;
|
|
1057
|
-
}
|
|
1058
|
-
function constantLayer(config, source) {
|
|
1059
|
-
return { config, sourceFor: () => source };
|
|
1060
|
-
}
|
|
1061
|
-
/**
|
|
1062
|
-
* Merges cascade layers lowest-precedence first onto `MutableConfig`, with no
|
|
1063
|
-
* cast on the result — see that type's own doc comment for why the cast used
|
|
1064
|
-
* to be the bug this shape prevents. Still a per-key loop rather than
|
|
1065
|
-
* `Object.assign`, now for two reasons instead of one: the original reason (a
|
|
1066
|
-
* key `MutableConfig` cannot carry must fail to compile, not vanish) plus
|
|
1067
|
-
* recording `ConfigProvenance` in the same pass a key is written, so a key
|
|
1068
|
-
* can never land in one map and not the other.
|
|
1069
|
-
*/
|
|
1070
|
-
function mergeConfigs(...layers) {
|
|
1071
|
-
const out = {};
|
|
1072
|
-
const provenance = {};
|
|
1073
|
-
for (const layer of layers) {
|
|
1074
|
-
for (const key of Object.keys(layer.config)) {
|
|
1075
|
-
if (key === 'browser' && layer.config.browser) {
|
|
1076
|
-
// Merged, not replaced: see `mergeBrowserConfig`.
|
|
1077
|
-
out.browser = mergeBrowserConfig(out.browser, layer.config.browser, layer.sourceFor(key));
|
|
1078
|
-
provenance[key] = layer.sourceFor(key);
|
|
1079
|
-
continue;
|
|
1080
|
-
}
|
|
1081
|
-
if (key === 'composerTriggers' && layer.config.composerTriggers) {
|
|
1082
|
-
// Merged per key; a project layer only lowers. See `mergeComposerTriggers`.
|
|
1083
|
-
out.composerTriggers = mergeComposerTriggers(out.composerTriggers, layer.config.composerTriggers, isProjectSource(layer.sourceFor(key)));
|
|
1084
|
-
provenance[key] = layer.sourceFor(key);
|
|
1085
|
-
continue;
|
|
1086
|
-
}
|
|
1087
|
-
// Same widened-view assignment as `sanitize`: a cast on the target,
|
|
1088
|
-
// not the value, is what lets a generic key write onto a
|
|
1089
|
-
// heterogeneous mapped type without silently dropping a field this
|
|
1090
|
-
// function cannot carry.
|
|
1091
|
-
;
|
|
1092
|
-
out[key] = layer.config[key];
|
|
1093
|
-
provenance[key] = layer.sourceFor(key);
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
return { config: out, provenance };
|
|
1097
|
-
}
|
|
1098
|
-
// ---------------------------------------------------------------------------
|
|
1099
|
-
// browser
|
|
1100
|
-
// ---------------------------------------------------------------------------
|
|
1101
|
-
const BROWSER_KEYS = new Set([
|
|
1102
|
-
'enabled',
|
|
1103
|
-
'defaultProfile',
|
|
1104
|
-
'engine',
|
|
1105
|
-
'headless',
|
|
1106
|
-
'sites',
|
|
1107
|
-
'keepOpen',
|
|
1108
|
-
]);
|
|
1109
|
-
/** `@namzu/browser`'s profile names, restated so reading config does not load Playwright. */
|
|
1110
|
-
const BROWSER_PROFILE_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
1111
|
-
function readBrowserConfig(v, context) {
|
|
1112
|
-
if (!isConfigMapping(v))
|
|
1113
|
-
return invalidConfigValue(context, [], 'must be a mapping');
|
|
1114
|
-
for (const key of Object.keys(v)) {
|
|
1115
|
-
if (!BROWSER_KEYS.has(key)) {
|
|
1116
|
-
return invalidConfigValue(context, [key], 'is not a browser setting (enabled, defaultProfile, engine, headless, sites, keepOpen)');
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
const raw = v;
|
|
1120
|
-
for (const key of ['enabled', 'keepOpen']) {
|
|
1121
|
-
if (raw[key] !== undefined && typeof raw[key] !== 'boolean')
|
|
1122
|
-
return invalidConfigValue(context, [key], 'must be true or false');
|
|
1123
|
-
}
|
|
1124
|
-
if (raw.defaultProfile !== undefined &&
|
|
1125
|
-
(typeof raw.defaultProfile !== 'string' ||
|
|
1126
|
-
raw.defaultProfile.length > 64 ||
|
|
1127
|
-
!BROWSER_PROFILE_NAME.test(raw.defaultProfile))) {
|
|
1128
|
-
return invalidConfigValue(context, ['defaultProfile'], 'must be a profile name: lowercase letters, digits and single hyphens, at most 64 characters');
|
|
1129
|
-
}
|
|
1130
|
-
if (raw.engine !== undefined && !['auto', 'windows', 'local'].includes(raw.engine))
|
|
1131
|
-
return invalidConfigValue(context, ['engine'], 'must be auto, windows or local');
|
|
1132
|
-
if (raw.headless !== undefined && !['auto', 'always', 'never'].includes(raw.headless))
|
|
1133
|
-
return invalidConfigValue(context, ['headless'], 'must be auto, always or never');
|
|
1134
|
-
let sites;
|
|
1135
|
-
if (raw.sites !== undefined) {
|
|
1136
|
-
if (!isConfigMapping(raw.sites))
|
|
1137
|
-
return invalidConfigValue(context, ['sites'], 'must be a mapping of site to level');
|
|
1138
|
-
sites = {};
|
|
1139
|
-
for (const [key, level] of Object.entries(raw.sites)) {
|
|
1140
|
-
// Refused, not dropped: a site rule that silently vanished is a deny
|
|
1141
|
-
// the operator believes in and the gate never sees.
|
|
1142
|
-
if (!isBrowserSiteLevel(level))
|
|
1143
|
-
return invalidConfigValue(context, ['sites', key], 'must be deny, read, ask or act');
|
|
1144
|
-
const verdict = canonicalBrowserSiteKey(key);
|
|
1145
|
-
if (!verdict.ok)
|
|
1146
|
-
return invalidConfigValue(context, ['sites', key], verdict.reason);
|
|
1147
|
-
const existing = sites[verdict.key];
|
|
1148
|
-
sites[verdict.key] = existing === undefined ? level : narrower(existing, level);
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
return {
|
|
1152
|
-
...(raw.enabled !== undefined ? { enabled: raw.enabled } : {}),
|
|
1153
|
-
...(raw.defaultProfile !== undefined ? { defaultProfile: raw.defaultProfile } : {}),
|
|
1154
|
-
...(raw.engine !== undefined ? { engine: raw.engine } : {}),
|
|
1155
|
-
...(raw.headless !== undefined ? { headless: raw.headless } : {}),
|
|
1156
|
-
...(sites !== undefined ? { sites } : {}),
|
|
1157
|
-
...(raw.keepOpen !== undefined ? { keepOpen: raw.keepOpen } : {}),
|
|
1158
|
-
};
|
|
1159
|
-
}
|
|
1160
|
-
function isProjectSource(source) {
|
|
1161
|
-
return (source.kind === 'project-file' ||
|
|
1162
|
-
(source.kind === 'profile' && basename(source.path) === 'namzu.config.json'));
|
|
1163
|
-
}
|
|
1164
|
-
/**
|
|
1165
|
-
* `browser` from one more layer, over what the layers below it said.
|
|
1166
|
-
*
|
|
1167
|
-
* Merged key by key, the later layer winning, with three exceptions, all in
|
|
1168
|
-
* the direction of less reach:
|
|
1169
|
-
*
|
|
1170
|
-
* - `enabled: false` in any file holds; a later file cannot switch it on.
|
|
1171
|
-
* - `sites` are merged per site. A site any file denies stays denied, and
|
|
1172
|
-
* once a file has denied every other site (`"*": deny`), a later file's
|
|
1173
|
-
* new sites are ignored: they would open what that file closed.
|
|
1174
|
-
* - `defaultProfile` is refused in a project file. A profile carries the
|
|
1175
|
-
* operator's sign-ins, and a repository must not pick which ones its
|
|
1176
|
-
* agent runs under.
|
|
1177
|
-
*/
|
|
1178
|
-
export function mergeBrowserConfig(below, layer, source) {
|
|
1179
|
-
if (layer.defaultProfile !== undefined && isProjectSource(source)) {
|
|
1180
|
-
throw new ConfigValueError({ kind: 'file', path: 'path' in source ? source.path : 'namzu.config.json' }, 'browser.defaultProfile', 'cannot be set in a project file: a profile holds your sign-ins, so choose it in your user config or with /browser profile');
|
|
1181
|
-
}
|
|
1182
|
-
if (!below)
|
|
1183
|
-
return layer;
|
|
1184
|
-
let sites = below.sites;
|
|
1185
|
-
if (layer.sites) {
|
|
1186
|
-
const merged = { ...(below.sites ?? {}) };
|
|
1187
|
-
const closed = below.sites?.['*'] === 'deny';
|
|
1188
|
-
for (const [key, level] of Object.entries(layer.sites)) {
|
|
1189
|
-
const existing = merged[key];
|
|
1190
|
-
if (existing === undefined) {
|
|
1191
|
-
if (closed && key !== '*')
|
|
1192
|
-
continue;
|
|
1193
|
-
merged[key] = level;
|
|
1194
|
-
continue;
|
|
1195
|
-
}
|
|
1196
|
-
merged[key] = existing === 'deny' ? 'deny' : level;
|
|
1197
|
-
}
|
|
1198
|
-
sites = merged;
|
|
1199
|
-
}
|
|
1200
|
-
const enabled = below.enabled === false || layer.enabled === false ? false : (layer.enabled ?? below.enabled);
|
|
1201
|
-
return {
|
|
1202
|
-
...below,
|
|
1203
|
-
...layer,
|
|
1204
|
-
...(enabled !== undefined ? { enabled } : {}),
|
|
1205
|
-
...(sites !== undefined ? { sites } : {}),
|
|
1206
|
-
};
|
|
1207
|
-
}
|
|
1208
|
-
//# sourceMappingURL=load.js.map
|