@namzu/cli 35.0.0 → 36.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +764 -0
- package/README.md +160 -394
- package/assets/pal-blender-mcp.py +123 -0
- package/assets/pal-godot-mcp-pin.json +135 -0
- package/assets/pal-godot-mcp.cjs +418 -0
- package/dist/bin-main.d.ts +3 -0
- package/dist/bin-main.d.ts.map +1 -0
- package/dist/bin.d.ts +2 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +85 -23
- package/dist/bin.js.map +6 -1
- package/dist/boot-narrative.d.ts +16 -0
- package/dist/boot-narrative.d.ts.map +1 -0
- package/dist/checkpoints/manifest.d.ts +107 -0
- package/dist/checkpoints/manifest.d.ts.map +1 -0
- package/dist/checkpoints/store.d.ts +280 -40
- package/dist/checkpoints/store.d.ts.map +1 -1
- package/dist/checkpoints/undo-plan.d.ts +83 -0
- package/dist/checkpoints/undo-plan.d.ts.map +1 -0
- package/dist/checkpoints/wrap.d.ts +4 -0
- package/dist/checkpoints/wrap.d.ts.map +1 -1
- package/dist/chunks/acp-5CWS2GLJ.js +13448 -0
- package/dist/chunks/acp-5CWS2GLJ.js.map +6 -0
- package/dist/chunks/activity-command-HK7YJTXV.js +262 -0
- package/dist/chunks/activity-command-HK7YJTXV.js.map +6 -0
- package/dist/chunks/add-ULH5DUNX.js +712 -0
- package/dist/chunks/add-ULH5DUNX.js.map +6 -0
- package/dist/chunks/agent-UEK2U3RE.js +87 -0
- package/dist/chunks/agent-UEK2U3RE.js.map +6 -0
- package/dist/chunks/agent-session-V7JRTODS.js +46 -0
- package/dist/chunks/agent-session-V7JRTODS.js.map +6 -0
- package/dist/chunks/archive-C4A3HPLF.js +84 -0
- package/dist/chunks/archive-C4A3HPLF.js.map +6 -0
- package/dist/chunks/bin-main-EEJHRDIC.js +126 -0
- package/dist/chunks/bin-main-EEJHRDIC.js.map +6 -0
- package/dist/chunks/browser-CRX4HM4C.js +31 -0
- package/dist/chunks/browser-CRX4HM4C.js.map +6 -0
- package/dist/chunks/chat-FVBATC4E.js +101 -0
- package/dist/chunks/chat-FVBATC4E.js.map +6 -0
- package/dist/chunks/chunk-2A37JQKY.js +1355 -0
- package/dist/chunks/chunk-2A37JQKY.js.map +6 -0
- package/dist/chunks/chunk-2NJ2XUXJ.js +283 -0
- package/dist/chunks/chunk-2NJ2XUXJ.js.map +6 -0
- package/dist/chunks/chunk-4HAE7PYX.js +74 -0
- package/dist/chunks/chunk-4HAE7PYX.js.map +6 -0
- package/dist/chunks/chunk-5GRV6P5C.js +69 -0
- package/dist/chunks/chunk-5GRV6P5C.js.map +6 -0
- package/dist/chunks/chunk-5PQVJBIO.js +168 -0
- package/dist/chunks/chunk-5PQVJBIO.js.map +6 -0
- package/dist/chunks/chunk-62I7HLAP.js +1142 -0
- package/dist/chunks/chunk-62I7HLAP.js.map +6 -0
- package/dist/chunks/chunk-63CGV3XY.js +161 -0
- package/dist/chunks/chunk-63CGV3XY.js.map +6 -0
- package/dist/chunks/chunk-6LLJQ3KY.js +225 -0
- package/dist/chunks/chunk-6LLJQ3KY.js.map +6 -0
- package/dist/chunks/chunk-6YG7D7U4.js +159 -0
- package/dist/chunks/chunk-6YG7D7U4.js.map +6 -0
- package/dist/chunks/chunk-76FLAFCG.js +51 -0
- package/dist/chunks/chunk-76FLAFCG.js.map +6 -0
- package/dist/chunks/chunk-7WJOQ6EA.js +106 -0
- package/dist/chunks/chunk-7WJOQ6EA.js.map +6 -0
- package/dist/chunks/chunk-A22MBIYU.js +42 -0
- package/dist/chunks/chunk-A22MBIYU.js.map +6 -0
- package/dist/chunks/chunk-A5DWGNGR.js +73 -0
- package/dist/chunks/chunk-A5DWGNGR.js.map +6 -0
- package/dist/chunks/chunk-A5UXODFL.js +76 -0
- package/dist/chunks/chunk-A5UXODFL.js.map +6 -0
- package/dist/chunks/chunk-AHIDYIRB.js +329 -0
- package/dist/chunks/chunk-AHIDYIRB.js.map +6 -0
- package/dist/chunks/chunk-AIY4PCDR.js +164 -0
- package/dist/chunks/chunk-AIY4PCDR.js.map +6 -0
- package/dist/chunks/chunk-AK2U3N2A.js +31 -0
- package/dist/chunks/chunk-AK2U3N2A.js.map +6 -0
- package/dist/chunks/chunk-AN7FO7NS.js +247 -0
- package/dist/chunks/chunk-AN7FO7NS.js.map +6 -0
- package/dist/chunks/chunk-AXIGFKJF.js +34 -0
- package/dist/chunks/chunk-AXIGFKJF.js.map +6 -0
- package/dist/chunks/chunk-C5WBEO3X.js +46 -0
- package/dist/chunks/chunk-C5WBEO3X.js.map +6 -0
- package/dist/chunks/chunk-C5XYHYMX.js +675 -0
- package/dist/chunks/chunk-C5XYHYMX.js.map +6 -0
- package/dist/chunks/chunk-CG65NUSJ.js +115 -0
- package/dist/chunks/chunk-CG65NUSJ.js.map +6 -0
- package/dist/chunks/chunk-CHIEVVQ2.js +32 -0
- package/dist/chunks/chunk-CHIEVVQ2.js.map +6 -0
- package/dist/chunks/chunk-E5VLANCO.js +101 -0
- package/dist/chunks/chunk-E5VLANCO.js.map +6 -0
- package/dist/chunks/chunk-EBOHVFOB.js +648 -0
- package/dist/chunks/chunk-EBOHVFOB.js.map +6 -0
- package/dist/chunks/chunk-EEDZOGV4.js +47 -0
- package/dist/chunks/chunk-EEDZOGV4.js.map +6 -0
- package/dist/chunks/chunk-EIYM6TY7.js +1479 -0
- package/dist/chunks/chunk-EIYM6TY7.js.map +6 -0
- package/dist/chunks/chunk-EWKJGHRO.js +82559 -0
- package/dist/chunks/chunk-EWKJGHRO.js.map +6 -0
- package/dist/chunks/chunk-EY7UNVER.js +311 -0
- package/dist/chunks/chunk-EY7UNVER.js.map +6 -0
- package/dist/chunks/chunk-FTMTO72X.js +95 -0
- package/dist/chunks/chunk-FTMTO72X.js.map +6 -0
- package/dist/chunks/chunk-FXS3AG6B.js +25326 -0
- package/dist/chunks/chunk-FXS3AG6B.js.map +6 -0
- package/dist/chunks/chunk-GIXSS6KW.js +2228 -0
- package/dist/chunks/chunk-GIXSS6KW.js.map +6 -0
- package/dist/chunks/chunk-GMCOZ3CU.js +245 -0
- package/dist/chunks/chunk-GMCOZ3CU.js.map +6 -0
- package/dist/chunks/chunk-GNBMKISG.js +19 -0
- package/dist/chunks/chunk-GNBMKISG.js.map +6 -0
- package/dist/chunks/chunk-GWQEMJFS.js +28 -0
- package/dist/chunks/chunk-GWQEMJFS.js.map +6 -0
- package/dist/chunks/chunk-H6B6AROX.js +151 -0
- package/dist/chunks/chunk-H6B6AROX.js.map +6 -0
- package/dist/chunks/chunk-HBBB2CAC.js +75 -0
- package/dist/chunks/chunk-HBBB2CAC.js.map +6 -0
- package/dist/chunks/chunk-HE7WUOX2.js +26 -0
- package/dist/chunks/chunk-HE7WUOX2.js.map +6 -0
- package/dist/chunks/chunk-HFJHHCTY.js +303 -0
- package/dist/chunks/chunk-HFJHHCTY.js.map +6 -0
- package/dist/chunks/chunk-HPMWYIBY.js +773 -0
- package/dist/chunks/chunk-HPMWYIBY.js.map +6 -0
- package/dist/chunks/chunk-HQM2WSQT.js +106 -0
- package/dist/chunks/chunk-HQM2WSQT.js.map +6 -0
- package/dist/chunks/chunk-ITZK4B66.js +787 -0
- package/dist/chunks/chunk-ITZK4B66.js.map +6 -0
- package/dist/chunks/chunk-J72CRUNX.js +154 -0
- package/dist/chunks/chunk-J72CRUNX.js.map +6 -0
- package/dist/chunks/chunk-JORONMD3.js +18 -0
- package/dist/chunks/chunk-JORONMD3.js.map +6 -0
- package/dist/chunks/chunk-JPPC4LJF.js +271 -0
- package/dist/chunks/chunk-JPPC4LJF.js.map +6 -0
- package/dist/chunks/chunk-JV3LONAU.js +76 -0
- package/dist/chunks/chunk-JV3LONAU.js.map +6 -0
- package/dist/chunks/chunk-K76WV7TN.js +71 -0
- package/dist/chunks/chunk-K76WV7TN.js.map +6 -0
- package/dist/chunks/chunk-KCWUQRZV.js +828 -0
- package/dist/chunks/chunk-KCWUQRZV.js.map +6 -0
- package/dist/chunks/chunk-KONYGNG6.js +7661 -0
- package/dist/chunks/chunk-KONYGNG6.js.map +6 -0
- package/dist/chunks/chunk-KU3W6IHV.js +109 -0
- package/dist/chunks/chunk-KU3W6IHV.js.map +6 -0
- package/dist/chunks/chunk-LQMHASKR.js +171 -0
- package/dist/chunks/chunk-LQMHASKR.js.map +6 -0
- package/dist/chunks/chunk-LXB3S4IC.js +19 -0
- package/dist/chunks/chunk-LXB3S4IC.js.map +6 -0
- package/dist/chunks/chunk-MZP6SH3M.js +3497 -0
- package/dist/chunks/chunk-MZP6SH3M.js.map +6 -0
- package/dist/chunks/chunk-N5IF64K3.js +1858 -0
- package/dist/chunks/chunk-N5IF64K3.js.map +6 -0
- package/dist/chunks/chunk-NADQQMMG.js +46 -0
- package/dist/chunks/chunk-NADQQMMG.js.map +6 -0
- package/dist/chunks/chunk-NQY5P2EB.js +20 -0
- package/dist/chunks/chunk-NQY5P2EB.js.map +6 -0
- package/dist/chunks/chunk-NUGPLXVK.js +228 -0
- package/dist/chunks/chunk-NUGPLXVK.js.map +6 -0
- package/dist/chunks/chunk-O7DBCVNY.js +110 -0
- package/dist/chunks/chunk-O7DBCVNY.js.map +6 -0
- package/dist/chunks/chunk-OEW7CJKK.js +140 -0
- package/dist/chunks/chunk-OEW7CJKK.js.map +6 -0
- package/dist/chunks/chunk-OH6TB27S.js +111 -0
- package/dist/chunks/chunk-OH6TB27S.js.map +6 -0
- package/dist/chunks/chunk-OLPOM3DR.js +127 -0
- package/dist/chunks/chunk-OLPOM3DR.js.map +6 -0
- package/dist/chunks/chunk-PYG7DZ2D.js +380 -0
- package/dist/chunks/chunk-PYG7DZ2D.js.map +6 -0
- package/dist/chunks/chunk-Q24K7536.js +661 -0
- package/dist/chunks/chunk-Q24K7536.js.map +6 -0
- package/dist/chunks/chunk-Q5YM2GCX.js +283 -0
- package/dist/chunks/chunk-Q5YM2GCX.js.map +6 -0
- package/dist/chunks/chunk-R7DCDBRN.js +106 -0
- package/dist/chunks/chunk-R7DCDBRN.js.map +6 -0
- package/dist/chunks/chunk-RC6X3ZY6.js +1439 -0
- package/dist/chunks/chunk-RC6X3ZY6.js.map +6 -0
- package/dist/chunks/chunk-SGS435PR.js +11111 -0
- package/dist/chunks/chunk-SGS435PR.js.map +6 -0
- package/dist/chunks/chunk-SKKWMMFP.js +474 -0
- package/dist/chunks/chunk-SKKWMMFP.js.map +6 -0
- package/dist/chunks/chunk-SRU3MDHZ.js +75 -0
- package/dist/chunks/chunk-SRU3MDHZ.js.map +6 -0
- package/dist/chunks/chunk-TBIX6JRE.js +24 -0
- package/dist/chunks/chunk-TBIX6JRE.js.map +6 -0
- package/dist/chunks/chunk-THNCQJ33.js +11265 -0
- package/dist/chunks/chunk-THNCQJ33.js.map +6 -0
- package/dist/chunks/chunk-THZXXVHM.js +2953 -0
- package/dist/chunks/chunk-THZXXVHM.js.map +6 -0
- package/dist/chunks/chunk-TIGWWAJI.js +765 -0
- package/dist/chunks/chunk-TIGWWAJI.js.map +6 -0
- package/dist/chunks/chunk-UDBEU2FR.js +97 -0
- package/dist/chunks/chunk-UDBEU2FR.js.map +6 -0
- package/dist/chunks/chunk-UOOQPODR.js +257 -0
- package/dist/chunks/chunk-UOOQPODR.js.map +6 -0
- package/dist/chunks/chunk-US5ZFPAU.js +400 -0
- package/dist/chunks/chunk-US5ZFPAU.js.map +6 -0
- package/dist/chunks/chunk-UWWGSDZ5.js +134 -0
- package/dist/chunks/chunk-UWWGSDZ5.js.map +6 -0
- package/dist/chunks/chunk-UXVYJWN5.js +1373 -0
- package/dist/chunks/chunk-UXVYJWN5.js.map +6 -0
- package/dist/chunks/chunk-V7TQR6AR.js +818 -0
- package/dist/chunks/chunk-V7TQR6AR.js.map +6 -0
- package/dist/chunks/chunk-VRL2WNQN.js +7534 -0
- package/dist/chunks/chunk-VRL2WNQN.js.map +6 -0
- package/dist/chunks/chunk-WATMFOHB.js +319 -0
- package/dist/chunks/chunk-WATMFOHB.js.map +6 -0
- package/dist/chunks/chunk-WHODOMXA.js +132 -0
- package/dist/chunks/chunk-WHODOMXA.js.map +6 -0
- package/dist/chunks/chunk-WM2JEUGV.js +207 -0
- package/dist/chunks/chunk-WM2JEUGV.js.map +6 -0
- package/dist/chunks/chunk-XEUQN4JC.js +54 -0
- package/dist/chunks/chunk-XEUQN4JC.js.map +6 -0
- package/dist/chunks/chunk-XHOD3RDN.js +517 -0
- package/dist/chunks/chunk-XHOD3RDN.js.map +6 -0
- package/dist/chunks/chunk-Y7B67G22.js +26 -0
- package/dist/chunks/chunk-Y7B67G22.js.map +6 -0
- package/dist/chunks/chunk-ZKEWE6K4.js +399 -0
- package/dist/chunks/chunk-ZKEWE6K4.js.map +6 -0
- package/dist/chunks/chunk-ZPR4IMRT.js +36 -0
- package/dist/chunks/chunk-ZPR4IMRT.js.map +6 -0
- package/dist/chunks/chunk-ZWA2JRJV.js +45 -0
- package/dist/chunks/chunk-ZWA2JRJV.js.map +6 -0
- package/dist/chunks/cli-runtime-7YAOEJGS.js +129 -0
- package/dist/chunks/cli-runtime-7YAOEJGS.js.map +6 -0
- package/dist/chunks/commands-QPVRB3RK.js +21 -0
- package/dist/chunks/commands-QPVRB3RK.js.map +6 -0
- package/dist/chunks/computer-GXDY4H35.js +493 -0
- package/dist/chunks/computer-GXDY4H35.js.map +6 -0
- package/dist/chunks/crash-report-S3BTEPYR.js +21 -0
- package/dist/chunks/crash-report-S3BTEPYR.js.map +6 -0
- package/dist/chunks/devtools-LBE4PAQN.js +3851 -0
- package/dist/chunks/devtools-LBE4PAQN.js.map +6 -0
- package/dist/chunks/dist-3GJFRS2X.js +520 -0
- package/dist/chunks/dist-3GJFRS2X.js.map +6 -0
- package/dist/chunks/dist-BFC7XUCT.js +555 -0
- package/dist/chunks/dist-BFC7XUCT.js.map +6 -0
- package/dist/chunks/dist-ERN5DRKK.js +1415 -0
- package/dist/chunks/dist-ERN5DRKK.js.map +6 -0
- package/dist/chunks/dist-EY3OJBQH.js +1339 -0
- package/dist/chunks/dist-EY3OJBQH.js.map +6 -0
- package/dist/chunks/dist-G42HPNIE.js +514 -0
- package/dist/chunks/dist-G42HPNIE.js.map +6 -0
- package/dist/chunks/dist-SKRHHPUR.js +1018 -0
- package/dist/chunks/dist-SKRHHPUR.js.map +6 -0
- package/dist/chunks/dist-Z47L7ZAJ.js +40654 -0
- package/dist/chunks/dist-Z47L7ZAJ.js.map +6 -0
- package/dist/chunks/doctor-IE3PLXZK.js +28 -0
- package/dist/chunks/doctor-IE3PLXZK.js.map +6 -0
- package/dist/chunks/drain-ESXUKOE6.js +471 -0
- package/dist/chunks/drain-ESXUKOE6.js.map +6 -0
- package/dist/chunks/endpoint-M2DDENPP.js +15 -0
- package/dist/chunks/endpoint-M2DDENPP.js.map +6 -0
- package/dist/chunks/eval-53UONRWR.js +187 -0
- package/dist/chunks/eval-53UONRWR.js.map +6 -0
- package/dist/chunks/exec-COV235L5.js +1284 -0
- package/dist/chunks/exec-COV235L5.js.map +6 -0
- package/dist/chunks/home-QS7RBP34.js +16 -0
- package/dist/chunks/home-QS7RBP34.js.map +6 -0
- package/dist/chunks/host-queries-LDEBHKBX.js +152 -0
- package/dist/chunks/host-queries-LDEBHKBX.js.map +6 -0
- package/dist/chunks/lib-KXZZJJG2.js +2657 -0
- package/dist/chunks/lib-KXZZJJG2.js.map +6 -0
- package/dist/chunks/lifecycle-6NF6NJNV.js +63 -0
- package/dist/chunks/lifecycle-6NF6NJNV.js.map +6 -0
- package/dist/chunks/list-DQZU7NEF.js +293 -0
- package/dist/chunks/list-DQZU7NEF.js.map +6 -0
- package/dist/chunks/login-IQGNP5XY.js +29 -0
- package/dist/chunks/login-IQGNP5XY.js.map +6 -0
- package/dist/chunks/logs-KSG7SFAB.js +116 -0
- package/dist/chunks/logs-KSG7SFAB.js.map +6 -0
- package/dist/chunks/mcp-WFXKXGNM.js +763 -0
- package/dist/chunks/mcp-WFXKXGNM.js.map +6 -0
- package/dist/chunks/message-command-O7ZH4I4C.js +170 -0
- package/dist/chunks/message-command-O7ZH4I4C.js.map +6 -0
- package/dist/chunks/node-QB2FA2ZB.js +916 -0
- package/dist/chunks/node-QB2FA2ZB.js.map +6 -0
- package/dist/chunks/operator-tools-LTPV3CH5.js +115 -0
- package/dist/chunks/operator-tools-LTPV3CH5.js.map +6 -0
- package/dist/chunks/output-schema-UM3P5AOR.js +11 -0
- package/dist/chunks/output-schema-UM3P5AOR.js.map +6 -0
- package/dist/chunks/pal-GBYJHBP3.js +200 -0
- package/dist/chunks/pal-GBYJHBP3.js.map +6 -0
- package/dist/chunks/paths-DXYFKIJU.js +10 -0
- package/dist/chunks/paths-DXYFKIJU.js.map +6 -0
- package/dist/chunks/pica-WNHDDIFX.js +1736 -0
- package/dist/chunks/pica-WNHDDIFX.js.map +6 -0
- package/dist/chunks/providers-J42J2PDA.js +160 -0
- package/dist/chunks/providers-J42J2PDA.js.map +6 -0
- package/dist/chunks/resident-7D6IM5LP.js +1314 -0
- package/dist/chunks/resident-7D6IM5LP.js.map +6 -0
- package/dist/chunks/resume-command-XZWGUXRK.js +22 -0
- package/dist/chunks/resume-command-XZWGUXRK.js.map +6 -0
- package/dist/chunks/schedule-JLIOF3MS.js +143 -0
- package/dist/chunks/schedule-JLIOF3MS.js.map +6 -0
- package/dist/chunks/serve-S7UWNIR3.js +21 -0
- package/dist/chunks/serve-S7UWNIR3.js.map +6 -0
- package/dist/chunks/service-YBU5VTKQ.js +1633 -0
- package/dist/chunks/service-YBU5VTKQ.js.map +6 -0
- package/dist/chunks/session-step-2HJSIJNN.js +26 -0
- package/dist/chunks/session-step-2HJSIJNN.js.map +6 -0
- package/dist/chunks/skills-HV2MOBEW.js +282 -0
- package/dist/chunks/skills-HV2MOBEW.js.map +6 -0
- package/dist/chunks/state-6HV3D3O4.js +717 -0
- package/dist/chunks/state-6HV3D3O4.js.map +6 -0
- package/dist/chunks/store-6J2MUGON.js +82 -0
- package/dist/chunks/store-6J2MUGON.js.map +6 -0
- package/dist/chunks/store-GDP2EW27.js +34 -0
- package/dist/chunks/store-GDP2EW27.js.map +6 -0
- package/dist/chunks/store-VXNKMMNW.js +42 -0
- package/dist/chunks/store-VXNKMMNW.js.map +6 -0
- package/dist/chunks/tui-DDWX2WYH.js +56903 -0
- package/dist/chunks/tui-DDWX2WYH.js.map +6 -0
- package/dist/chunks/upgrade-MC5JB7DK.js +315 -0
- package/dist/chunks/upgrade-MC5JB7DK.js.map +6 -0
- package/dist/chunks/webapi-6HUHZUAH.js +2715 -0
- package/dist/chunks/webapi-6HUHZUAH.js.map +6 -0
- package/dist/chunks/worktree-6YPRX6SU.js +116 -0
- package/dist/chunks/worktree-6YPRX6SU.js.map +6 -0
- package/dist/cli-runtime.d.ts +19 -0
- package/dist/cli-runtime.d.ts.map +1 -0
- package/dist/cli.d.ts +0 -15
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/acp-harness.d.ts +64 -0
- package/dist/commands/acp-harness.d.ts.map +1 -0
- package/dist/commands/acp-provider-retry.d.ts +27 -0
- package/dist/commands/acp-provider-retry.d.ts.map +1 -0
- package/dist/commands/acp.d.ts +134 -3
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/computer.d.ts +3 -0
- package/dist/commands/computer.d.ts.map +1 -0
- package/dist/commands/desktop-host-changes.d.ts +65 -0
- package/dist/commands/desktop-host-changes.d.ts.map +1 -0
- package/dist/commands/desktop-host-header.d.ts +30 -0
- package/dist/commands/desktop-host-header.d.ts.map +1 -0
- package/dist/commands/desktop-host.d.ts +354 -0
- package/dist/commands/desktop-host.d.ts.map +1 -0
- package/dist/commands/desktop-model-catalogue.d.ts +25 -0
- package/dist/commands/desktop-model-catalogue.d.ts.map +1 -0
- package/dist/commands/effort-levels.d.ts +3 -0
- package/dist/commands/effort-levels.d.ts.map +1 -0
- package/dist/commands/exec-flags.d.ts +4 -0
- package/dist/commands/exec-flags.d.ts.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/lazy.d.ts +20 -0
- package/dist/commands/lazy.d.ts.map +1 -0
- package/dist/commands/manifest.d.ts +33 -0
- package/dist/commands/manifest.d.ts.map +1 -0
- package/dist/commands/pal.d.ts +5 -0
- package/dist/commands/pal.d.ts.map +1 -0
- package/dist/commands/permission-preview.d.ts +38 -0
- package/dist/commands/permission-preview.d.ts.map +1 -0
- package/dist/commands/registry.d.ts +10 -0
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/serve.d.ts +1 -12
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/stdin.d.ts.map +1 -1
- package/dist/commands/upgrade.d.ts +14 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/compile-cache-enable.d.ts +2 -0
- package/dist/compile-cache-enable.d.ts.map +1 -0
- package/dist/compile-cache.d.ts +53 -0
- package/dist/compile-cache.d.ts.map +1 -0
- package/dist/computer/bundle.d.ts +18 -0
- package/dist/computer/bundle.d.ts.map +1 -0
- package/dist/computer/run.d.ts +26 -0
- package/dist/computer/run.d.ts.map +1 -0
- package/dist/computer/sentences.d.ts +30 -0
- package/dist/computer/sentences.d.ts.map +1 -0
- package/dist/config/load.d.ts +10 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/context/capabilities.d.ts +25 -2
- package/dist/context/capabilities.d.ts.map +1 -1
- package/dist/context/runtime-message.d.ts.map +1 -1
- package/dist/crash-report.d.ts +22 -0
- package/dist/crash-report.d.ts.map +1 -0
- package/dist/debug-requested.d.ts +7 -0
- package/dist/debug-requested.d.ts.map +1 -0
- package/dist/doctor/checks/credentials.d.ts.map +1 -1
- package/dist/exit-codes.d.ts +9 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/index.js +105 -17
- package/dist/index.js.map +6 -1
- package/dist/integrations/harness/claude-adapter.d.ts +20 -0
- package/dist/integrations/harness/claude-adapter.d.ts.map +1 -0
- package/dist/integrations/harness/claude-protocol.d.ts +67 -0
- package/dist/integrations/harness/claude-protocol.d.ts.map +1 -0
- package/dist/integrations/harness/codex-adapter.d.ts +80 -0
- package/dist/integrations/harness/codex-adapter.d.ts.map +1 -0
- package/dist/integrations/harness/codex-protocol.d.ts +22 -0
- package/dist/integrations/harness/codex-protocol.d.ts.map +1 -0
- package/dist/integrations/harness/model-cache.d.ts +16 -0
- package/dist/integrations/harness/model-cache.d.ts.map +1 -0
- package/dist/integrations/harness/native-executable.d.ts +8 -0
- package/dist/integrations/harness/native-executable.d.ts.map +1 -0
- package/dist/integrations/harness/process.d.ts +25 -0
- package/dist/integrations/harness/process.d.ts.map +1 -0
- package/dist/integrations/peers/runtime.d.ts +64 -0
- package/dist/integrations/peers/runtime.d.ts.map +1 -0
- package/dist/integrations/plugins/inventory.d.ts +27 -0
- package/dist/integrations/plugins/inventory.d.ts.map +1 -0
- package/dist/integrations/providers/composer-settings.d.ts +33 -0
- package/dist/integrations/providers/composer-settings.d.ts.map +1 -0
- package/dist/integrations/providers/connections.d.ts +37 -0
- package/dist/integrations/providers/connections.d.ts.map +1 -0
- package/dist/integrations/providers/credential-store.d.ts +35 -0
- package/dist/integrations/providers/credential-store.d.ts.map +1 -1
- package/dist/integrations/providers/discover.d.ts +27 -1
- package/dist/integrations/providers/discover.d.ts.map +1 -1
- package/dist/integrations/providers/index.d.ts +2 -2
- package/dist/integrations/providers/index.d.ts.map +1 -1
- package/dist/integrations/providers/picker-operation.d.ts +6 -0
- package/dist/integrations/providers/picker-operation.d.ts.map +1 -0
- package/dist/integrations/providers/setup.d.ts +16 -1
- package/dist/integrations/providers/setup.d.ts.map +1 -1
- package/dist/integrations/resident/runner-worker.js +190 -161
- package/dist/integrations/resident/runner-worker.js.map +6 -1
- package/dist/integrations/sessions/display-title.d.ts +8 -0
- package/dist/integrations/sessions/display-title.d.ts.map +1 -1
- package/dist/integrations/sessions/store.d.ts +23 -9
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/task-context.d.ts +1 -1
- package/dist/integrations/sessions/task-context.d.ts.map +1 -1
- package/dist/integrations/sessions/transcript-export.d.ts.map +1 -1
- package/dist/integrations/subagents/activity.d.ts +9 -6
- package/dist/integrations/subagents/activity.d.ts.map +1 -1
- package/dist/integrations/subagents/operator-journal.d.ts +20 -0
- package/dist/integrations/subagents/operator-journal.d.ts.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +11 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/trust/store.d.ts +14 -0
- package/dist/integrations/trust/store.d.ts.map +1 -1
- package/dist/integrations/web/search.d.ts +1 -1
- package/dist/pals/actions.d.ts +57 -0
- package/dist/pals/actions.d.ts.map +1 -0
- package/dist/pals/activity-command.d.ts +3 -0
- package/dist/pals/activity-command.d.ts.map +1 -0
- package/dist/pals/activity.d.ts +18 -0
- package/dist/pals/activity.d.ts.map +1 -0
- package/dist/pals/agent-session.d.ts +19 -0
- package/dist/pals/agent-session.d.ts.map +1 -0
- package/dist/pals/channel-actions.d.ts +5 -0
- package/dist/pals/channel-actions.d.ts.map +1 -0
- package/dist/pals/channel-local.d.ts +7 -0
- package/dist/pals/channel-local.d.ts.map +1 -0
- package/dist/pals/channel.d.ts +20 -0
- package/dist/pals/channel.d.ts.map +1 -0
- package/dist/pals/chat.d.ts +6 -0
- package/dist/pals/chat.d.ts.map +1 -0
- package/dist/pals/communication.d.ts +47 -0
- package/dist/pals/communication.d.ts.map +1 -0
- package/dist/pals/conversations.d.ts +26 -0
- package/dist/pals/conversations.d.ts.map +1 -0
- package/dist/pals/desktop-communication.d.ts +111 -0
- package/dist/pals/desktop-communication.d.ts.map +1 -0
- package/dist/pals/dispatch.d.ts +13 -0
- package/dist/pals/dispatch.d.ts.map +1 -0
- package/dist/pals/environment.d.ts +103 -0
- package/dist/pals/environment.d.ts.map +1 -0
- package/dist/pals/guest-mcp-transport.d.ts +28 -0
- package/dist/pals/guest-mcp-transport.d.ts.map +1 -0
- package/dist/pals/guest-mcp.d.ts +22 -0
- package/dist/pals/guest-mcp.d.ts.map +1 -0
- package/dist/pals/inbox-start.d.ts +35 -0
- package/dist/pals/inbox-start.d.ts.map +1 -0
- package/dist/pals/message-command.d.ts +3 -0
- package/dist/pals/message-command.d.ts.map +1 -0
- package/dist/pals/operator-tools.d.ts +23 -0
- package/dist/pals/operator-tools.d.ts.map +1 -0
- package/dist/pals/public-transcript.d.ts +4 -0
- package/dist/pals/public-transcript.d.ts.map +1 -0
- package/dist/pals/review.d.ts +16 -0
- package/dist/pals/review.d.ts.map +1 -0
- package/dist/pals/store.d.ts +16 -0
- package/dist/pals/store.d.ts.map +1 -0
- package/dist/pals/tui-session.d.ts +11 -0
- package/dist/pals/tui-session.d.ts.map +1 -0
- package/dist/permissions/mode-names.d.ts +2 -0
- package/dist/permissions/mode-names.d.ts.map +1 -0
- package/dist/resume-invocation.d.ts +1 -1
- package/dist/resume-invocation.d.ts.map +1 -1
- package/dist/resume-shell.d.ts +8 -0
- package/dist/resume-shell.d.ts.map +1 -0
- package/dist/schedule/build.d.ts +12 -3
- package/dist/schedule/build.d.ts.map +1 -1
- package/dist/schedule/commands/add.d.ts +1 -1
- package/dist/schedule/commands/add.d.ts.map +1 -1
- package/dist/schedule/commands/lifecycle.d.ts.map +1 -1
- package/dist/schedule/commands/list.d.ts +3 -1
- package/dist/schedule/commands/list.d.ts.map +1 -1
- package/dist/schedule/daemon/daemon.d.ts +2 -0
- package/dist/schedule/daemon/daemon.d.ts.map +1 -1
- package/dist/schedule/delivery.d.ts +66 -0
- package/dist/schedule/delivery.d.ts.map +1 -0
- package/dist/schedule/fire/fire.d.ts +1 -1
- package/dist/schedule/fire/fire.d.ts.map +1 -1
- package/dist/schedule/fire/run-script.d.ts +2 -2
- package/dist/schedule/fire/run-script.d.ts.map +1 -1
- package/dist/schedule/fire/script-report.d.ts +31 -0
- package/dist/schedule/fire/script-report.d.ts.map +1 -0
- package/dist/schedule/floor.d.ts +1 -1
- package/dist/schedule/floor.d.ts.map +1 -1
- package/dist/schedule/folder.d.ts +6 -0
- package/dist/schedule/folder.d.ts.map +1 -1
- package/dist/schedule/resume-command.d.ts +3 -3
- package/dist/schedule/resume-command.d.ts.map +1 -1
- package/dist/schedule/store/history.d.ts.map +1 -1
- package/dist/schedule/store/jobs.d.ts +6 -6
- package/dist/schedule/store/jobs.d.ts.map +1 -1
- package/dist/schedule/store/script-state.d.ts +31 -0
- package/dist/schedule/store/script-state.d.ts.map +1 -0
- package/dist/schedule/store/state.d.ts +4 -2
- package/dist/schedule/store/state.d.ts.map +1 -1
- package/dist/schedule/types.d.ts +61 -16
- package/dist/schedule/types.d.ts.map +1 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/terminal/host.d.ts +22 -0
- package/dist/terminal/host.d.ts.map +1 -0
- package/dist/terminal/manager.d.ts +124 -0
- package/dist/terminal/manager.d.ts.map +1 -0
- package/dist/terminal/protocol.d.ts +162 -0
- package/dist/terminal/protocol.d.ts.map +1 -0
- package/dist/terminal/pty.d.ts +85 -0
- package/dist/terminal/pty.d.ts.map +1 -0
- package/dist/terminal/ring.d.ts +23 -0
- package/dist/terminal/ring.d.ts.map +1 -0
- package/dist/terminal/screen.d.ts +31 -0
- package/dist/terminal/screen.d.ts.map +1 -0
- package/dist/termination-state.d.ts +19 -0
- package/dist/termination-state.d.ts.map +1 -0
- package/dist/termination.d.ts +2 -9
- package/dist/termination.d.ts.map +1 -1
- package/dist/tui/AgentExplorer.d.ts +4 -1
- package/dist/tui/AgentExplorer.d.ts.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/BackgroundJobsPanel.d.ts.map +1 -1
- package/dist/tui/BrandHeader.d.ts.map +1 -1
- package/dist/tui/ChildComposer.d.ts +22 -0
- package/dist/tui/ChildComposer.d.ts.map +1 -0
- package/dist/tui/ChoicePicker.d.ts.map +1 -1
- package/dist/tui/Composer.d.ts +21 -3
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/ComposerFrame.d.ts.map +1 -1
- package/dist/tui/CopyPicker.d.ts.map +1 -1
- package/dist/tui/EditPromptPicker.d.ts.map +1 -1
- package/dist/tui/EffortSlider.d.ts.map +1 -1
- package/dist/tui/LiveActivity.d.ts +7 -1
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/PendingInputPanel.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/ProviderSetup.d.ts.map +1 -1
- package/dist/tui/ResumePicker.d.ts.map +1 -1
- package/dist/tui/SaveSkillOverlay.d.ts.map +1 -1
- package/dist/tui/ScheduleReviewOverlay.d.ts +1 -1
- package/dist/tui/ScheduleReviewOverlay.d.ts.map +1 -1
- package/dist/tui/StatusBar.d.ts +7 -1
- package/dist/tui/StatusBar.d.ts.map +1 -1
- package/dist/tui/StatusPanel.d.ts.map +1 -1
- package/dist/tui/TextPrompt.d.ts.map +1 -1
- package/dist/tui/ToolOutputViewer.d.ts.map +1 -1
- package/dist/tui/Transcript.d.ts +3 -0
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/TranscriptScrollView.d.ts +23 -0
- package/dist/tui/TranscriptScrollView.d.ts.map +1 -0
- package/dist/tui/TrustPrompt.d.ts +8 -0
- package/dist/tui/TrustPrompt.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +125 -3
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/browser-notices.d.ts.map +1 -1
- package/dist/tui/capability-notice.d.ts +38 -0
- package/dist/tui/capability-notice.d.ts.map +1 -0
- package/dist/tui/console-input.d.ts +31 -0
- package/dist/tui/console-input.d.ts.map +1 -0
- package/dist/tui/conversation-evidence-view.d.ts.map +1 -1
- package/dist/tui/credential-entry.d.ts.map +1 -1
- package/dist/tui/exit-summary.d.ts +9 -1
- package/dist/tui/exit-summary.d.ts.map +1 -1
- package/dist/tui/external-editor.d.ts.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/key-hints.d.ts +51 -0
- package/dist/tui/key-hints.d.ts.map +1 -0
- package/dist/tui/launch-settings.d.ts +34 -0
- package/dist/tui/launch-settings.d.ts.map +1 -0
- package/dist/tui/log-pane.d.ts.map +1 -1
- package/dist/tui/model-choices.d.ts +39 -1
- package/dist/tui/model-choices.d.ts.map +1 -1
- package/dist/tui/model-search.d.ts +4 -1
- package/dist/tui/model-search.d.ts.map +1 -1
- package/dist/tui/output-size-watch.d.ts +32 -0
- package/dist/tui/output-size-watch.d.ts.map +1 -0
- package/dist/tui/permission-review.d.ts.map +1 -1
- package/dist/tui/person-terms.d.ts +58 -0
- package/dist/tui/person-terms.d.ts.map +1 -0
- package/dist/tui/plain-failure.d.ts +27 -0
- package/dist/tui/plain-failure.d.ts.map +1 -0
- package/dist/tui/plain-interruption.d.ts +46 -0
- package/dist/tui/plain-interruption.d.ts.map +1 -0
- package/dist/tui/provider-list.d.ts.map +1 -1
- package/dist/tui/render-mode.d.ts +19 -0
- package/dist/tui/render-mode.d.ts.map +1 -0
- package/dist/tui/schedule/host-commands.d.ts +2 -9
- package/dist/tui/schedule/host-commands.d.ts.map +1 -1
- package/dist/tui/schedule/integration.d.ts +8 -0
- package/dist/tui/schedule/integration.d.ts.map +1 -1
- package/dist/tui/schedule/source-deliveries.d.ts +37 -0
- package/dist/tui/schedule/source-deliveries.d.ts.map +1 -0
- package/dist/tui/schedule/startup.d.ts.map +1 -1
- package/dist/tui/schedule/tool-host.d.ts +3 -1
- package/dist/tui/schedule/tool-host.d.ts.map +1 -1
- package/dist/tui/setup-text.d.ts +14 -0
- package/dist/tui/setup-text.d.ts.map +1 -0
- package/dist/tui/shell-escape.d.ts.map +1 -1
- package/dist/tui/skills/suggest-setting.d.ts.map +1 -1
- package/dist/tui/slashCommands.d.ts +4 -1
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/terminal-choice-text.d.ts +7 -0
- package/dist/tui/terminal-choice-text.d.ts.map +1 -1
- package/dist/tui/tidy-tool-output.d.ts +83 -0
- package/dist/tui/tidy-tool-output.d.ts.map +1 -0
- package/dist/tui/tool-presentation.d.ts +6 -0
- package/dist/tui/tool-presentation.d.ts.map +1 -0
- package/dist/tui/transcript-scroll.d.ts +73 -0
- package/dist/tui/transcript-scroll.d.ts.map +1 -0
- package/dist/tui/triggers/copy.d.ts.map +1 -1
- package/dist/tui/triggers/setting.d.ts.map +1 -1
- package/dist/tui/turn-interruption.d.ts +1 -1
- package/dist/tui/turn-interruption.d.ts.map +1 -1
- package/dist/tui/turn-limits-settings.d.ts +4 -4
- package/dist/tui/turn-limits-settings.d.ts.map +1 -1
- package/dist/tui/types.d.ts +10 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/web-activity.d.ts +3 -2
- package/dist/tui/web-activity.d.ts.map +1 -1
- package/dist/tui/zen-free-refusal.d.ts +17 -0
- package/dist/tui/zen-free-refusal.d.ts.map +1 -0
- package/dist/usage-error.d.ts +15 -0
- package/dist/usage-error.d.ts.map +1 -0
- package/dist/warning-filter.d.ts +30 -0
- package/dist/warning-filter.d.ts.map +1 -0
- package/package.json +21 -10
- package/skills/schedule-task/SKILL.md +74 -20
- package/dist/browser/commands.js +0 -365
- package/dist/browser/commands.js.map +0 -1
- package/dist/browser/control.js +0 -140
- package/dist/browser/control.js.map +0 -1
- package/dist/browser/describe.js +0 -27
- package/dist/browser/describe.js.map +0 -1
- package/dist/checkpoints/store.js +0 -192
- package/dist/checkpoints/store.js.map +0 -1
- package/dist/checkpoints/wrap.js +0 -37
- package/dist/checkpoints/wrap.js.map +0 -1
- package/dist/cli.js +0 -602
- package/dist/cli.js.map +0 -1
- package/dist/commands/acp.js +0 -388
- package/dist/commands/acp.js.map +0 -1
- package/dist/commands/archive.js +0 -65
- package/dist/commands/archive.js.map +0 -1
- package/dist/commands/browser.js +0 -16
- package/dist/commands/browser.js.map +0 -1
- package/dist/commands/doctor.js +0 -267
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/drain.js +0 -498
- package/dist/commands/drain.js.map +0 -1
- package/dist/commands/eval.js +0 -237
- package/dist/commands/eval.js.map +0 -1
- package/dist/commands/exec-flags.js +0 -334
- package/dist/commands/exec-flags.js.map +0 -1
- package/dist/commands/exec-json.js +0 -497
- package/dist/commands/exec-json.js.map +0 -1
- package/dist/commands/exec.js +0 -688
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/host-queries.js +0 -156
- package/dist/commands/host-queries.js.map +0 -1
- package/dist/commands/login.js +0 -315
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/mcp-oauth-login.js +0 -213
- package/dist/commands/mcp-oauth-login.js.map +0 -1
- package/dist/commands/mcp.js +0 -461
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/prior-messages.js +0 -329
- package/dist/commands/prior-messages.js.map +0 -1
- package/dist/commands/provider-wait.js +0 -65
- package/dist/commands/provider-wait.js.map +0 -1
- package/dist/commands/registry.js +0 -40
- package/dist/commands/registry.js.map +0 -1
- package/dist/commands/resident-flags.js +0 -193
- package/dist/commands/resident-flags.js.map +0 -1
- package/dist/commands/resident-learning.js +0 -293
- package/dist/commands/resident-learning.js.map +0 -1
- package/dist/commands/resident.js +0 -419
- package/dist/commands/resident.js.map +0 -1
- package/dist/commands/resume.js +0 -109
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/schedule.js +0 -131
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/serve.js +0 -21
- package/dist/commands/serve.js.map +0 -1
- package/dist/commands/skills.js +0 -178
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/state.js +0 -110
- package/dist/commands/state.js.map +0 -1
- package/dist/commands/stdin.js +0 -69
- package/dist/commands/stdin.js.map +0 -1
- package/dist/commands/types.js +0 -2
- package/dist/commands/types.js.map +0 -1
- package/dist/commands/upgrade-progress.js +0 -54
- package/dist/commands/upgrade-progress.js.map +0 -1
- package/dist/commands/upgrade.js +0 -232
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/worktree.js +0 -86
- package/dist/commands/worktree.js.map +0 -1
- package/dist/config/composer-triggers.js +0 -80
- package/dist/config/composer-triggers.js.map +0 -1
- package/dist/config/debug.js +0 -126
- package/dist/config/debug.js.map +0 -1
- package/dist/config/load.js +0 -1208
- package/dist/config/load.js.map +0 -1
- package/dist/config/schema.js +0 -13
- package/dist/config/schema.js.map +0 -1
- package/dist/config/tool-result-screens.js +0 -104
- package/dist/config/tool-result-screens.js.map +0 -1
- package/dist/config/trusted-project-context.js +0 -28
- package/dist/config/trusted-project-context.js.map +0 -1
- package/dist/config/turn-guards.js +0 -46
- package/dist/config/turn-guards.js.map +0 -1
- package/dist/config/user-config.js +0 -118
- package/dist/config/user-config.js.map +0 -1
- package/dist/context/capabilities.js +0 -164
- package/dist/context/capabilities.js.map +0 -1
- package/dist/context/directories.js +0 -69
- package/dist/context/directories.js.map +0 -1
- package/dist/context/doctrine.js +0 -24
- package/dist/context/doctrine.js.map +0 -1
- package/dist/context/environment.js +0 -255
- package/dist/context/environment.js.map +0 -1
- package/dist/context/project-path.js +0 -16
- package/dist/context/project-path.js.map +0 -1
- package/dist/context/project-tracker.js +0 -217
- package/dist/context/project-tracker.js.map +0 -1
- package/dist/context/project.js +0 -256
- package/dist/context/project.js.map +0 -1
- package/dist/context/runtime-message.js +0 -30
- package/dist/context/runtime-message.js.map +0 -1
- package/dist/context/sandbox.js +0 -114
- package/dist/context/sandbox.js.map +0 -1
- package/dist/context/turn-snapshot.js +0 -122
- package/dist/context/turn-snapshot.js.map +0 -1
- package/dist/doctor/checks/browser.js +0 -63
- package/dist/doctor/checks/browser.js.map +0 -1
- package/dist/doctor/checks/chain.js +0 -211
- package/dist/doctor/checks/chain.js.map +0 -1
- package/dist/doctor/checks/credentials.js +0 -98
- package/dist/doctor/checks/credentials.js.map +0 -1
- package/dist/doctor/checks/index.js +0 -72
- package/dist/doctor/checks/index.js.map +0 -1
- package/dist/doctor/checks/invariants.js +0 -79
- package/dist/doctor/checks/invariants.js.map +0 -1
- package/dist/doctor/checks/logging.js +0 -69
- package/dist/doctor/checks/logging.js.map +0 -1
- package/dist/doctor/checks/providers.js +0 -30
- package/dist/doctor/checks/providers.js.map +0 -1
- package/dist/doctor/checks/runtime.js +0 -40
- package/dist/doctor/checks/runtime.js.map +0 -1
- package/dist/doctor/checks/sandbox.js +0 -76
- package/dist/doctor/checks/sandbox.js.map +0 -1
- package/dist/doctor/checks/scheduler.js +0 -74
- package/dist/doctor/checks/scheduler.js.map +0 -1
- package/dist/doctor/checks/session-export.js +0 -62
- package/dist/doctor/checks/session-export.js.map +0 -1
- package/dist/doctor/checks/telemetry.js +0 -58
- package/dist/doctor/checks/telemetry.js.map +0 -1
- package/dist/doctor/checks/vault.js +0 -67
- package/dist/doctor/checks/vault.js.map +0 -1
- package/dist/doctor/index.js +0 -3
- package/dist/doctor/index.js.map +0 -1
- package/dist/doctor/registry.js +0 -230
- package/dist/doctor/registry.js.map +0 -1
- package/dist/exit-codes.js +0 -62
- package/dist/exit-codes.js.map +0 -1
- package/dist/installation.js +0 -48
- package/dist/installation.js.map +0 -1
- package/dist/integrations/clipboard/image.js +0 -119
- package/dist/integrations/clipboard/image.js.map +0 -1
- package/dist/integrations/clipboard/text.js +0 -43
- package/dist/integrations/clipboard/text.js.map +0 -1
- package/dist/integrations/files/attachment-store.js +0 -86
- package/dist/integrations/files/attachment-store.js.map +0 -1
- package/dist/integrations/mcp/oauth-store.js +0 -549
- package/dist/integrations/mcp/oauth-store.js.map +0 -1
- package/dist/integrations/mcp/servers.js +0 -611
- package/dist/integrations/mcp/servers.js.map +0 -1
- package/dist/integrations/mcp/user-config.js +0 -92
- package/dist/integrations/mcp/user-config.js.map +0 -1
- package/dist/integrations/notifications/desktop/freedesktop.js +0 -33
- package/dist/integrations/notifications/desktop/freedesktop.js.map +0 -1
- package/dist/integrations/notifications/desktop/macos.js +0 -17
- package/dist/integrations/notifications/desktop/macos.js.map +0 -1
- package/dist/integrations/notifications/desktop/sanitize.js +0 -49
- package/dist/integrations/notifications/desktop/sanitize.js.map +0 -1
- package/dist/integrations/notifications/desktop/throttle.js +0 -39
- package/dist/integrations/notifications/desktop/throttle.js.map +0 -1
- package/dist/integrations/notifications/desktop/windows-toast.js +0 -56
- package/dist/integrations/notifications/desktop/windows-toast.js.map +0 -1
- package/dist/integrations/notifications/desktop.js +0 -199
- package/dist/integrations/notifications/desktop.js.map +0 -1
- package/dist/integrations/notifications/terminal.js +0 -46
- package/dist/integrations/notifications/terminal.js.map +0 -1
- package/dist/integrations/npm-invocation.js +0 -23
- package/dist/integrations/npm-invocation.js.map +0 -1
- package/dist/integrations/plugins/runtime.js +0 -189
- package/dist/integrations/plugins/runtime.js.map +0 -1
- package/dist/integrations/plugins/settings.js +0 -106
- package/dist/integrations/plugins/settings.js.map +0 -1
- package/dist/integrations/providers/access.js +0 -23
- package/dist/integrations/providers/access.js.map +0 -1
- package/dist/integrations/providers/chain-capabilities.js +0 -211
- package/dist/integrations/providers/chain-capabilities.js.map +0 -1
- package/dist/integrations/providers/codex-device-login.js +0 -195
- package/dist/integrations/providers/codex-device-login.js.map +0 -1
- package/dist/integrations/providers/codex-oauth.js +0 -95
- package/dist/integrations/providers/codex-oauth.js.map +0 -1
- package/dist/integrations/providers/credential-provider.js +0 -74
- package/dist/integrations/providers/credential-provider.js.map +0 -1
- package/dist/integrations/providers/credential-store.js +0 -657
- package/dist/integrations/providers/credential-store.js.map +0 -1
- package/dist/integrations/providers/current-credential.js +0 -45
- package/dist/integrations/providers/current-credential.js.map +0 -1
- package/dist/integrations/providers/discover.js +0 -313
- package/dist/integrations/providers/discover.js.map +0 -1
- package/dist/integrations/providers/gemini-credentials.js +0 -148
- package/dist/integrations/providers/gemini-credentials.js.map +0 -1
- package/dist/integrations/providers/harness-credentials.js +0 -344
- package/dist/integrations/providers/harness-credentials.js.map +0 -1
- package/dist/integrations/providers/identity.js +0 -64
- package/dist/integrations/providers/identity.js.map +0 -1
- package/dist/integrations/providers/index.js +0 -14
- package/dist/integrations/providers/index.js.map +0 -1
- package/dist/integrations/providers/keychain.js +0 -78
- package/dist/integrations/providers/keychain.js.map +0 -1
- package/dist/integrations/providers/model-reasoning.js +0 -51
- package/dist/integrations/providers/model-reasoning.js.map +0 -1
- package/dist/integrations/providers/oauth.js +0 -302
- package/dist/integrations/providers/oauth.js.map +0 -1
- package/dist/integrations/providers/preferences.js +0 -287
- package/dist/integrations/providers/preferences.js.map +0 -1
- package/dist/integrations/providers/register.js +0 -154
- package/dist/integrations/providers/register.js.map +0 -1
- package/dist/integrations/providers/registry.js +0 -289
- package/dist/integrations/providers/registry.js.map +0 -1
- package/dist/integrations/providers/setup.js +0 -158
- package/dist/integrations/providers/setup.js.map +0 -1
- package/dist/integrations/providers/subscription-login.js +0 -328
- package/dist/integrations/providers/subscription-login.js.map +0 -1
- package/dist/integrations/providers/zen-catalogue.js +0 -196
- package/dist/integrations/providers/zen-catalogue.js.map +0 -1
- package/dist/integrations/resident/foreground.js +0 -95
- package/dist/integrations/resident/foreground.js.map +0 -1
- package/dist/integrations/resident/inspection.js +0 -282
- package/dist/integrations/resident/inspection.js.map +0 -1
- package/dist/integrations/resident/learning-sources.js +0 -79
- package/dist/integrations/resident/learning-sources.js.map +0 -1
- package/dist/integrations/resident/learning-storage.js +0 -55
- package/dist/integrations/resident/learning-storage.js.map +0 -1
- package/dist/integrations/resident/lifecycle-errors.js +0 -15
- package/dist/integrations/resident/lifecycle-errors.js.map +0 -1
- package/dist/integrations/resident/owned-runner.js +0 -91
- package/dist/integrations/resident/owned-runner.js.map +0 -1
- package/dist/integrations/resident/runner-control.js +0 -238
- package/dist/integrations/resident/runner-control.js.map +0 -1
- package/dist/integrations/resident/runner-launch.js +0 -142
- package/dist/integrations/resident/runner-launch.js.map +0 -1
- package/dist/integrations/resident/runner-store.js +0 -284
- package/dist/integrations/resident/runner-store.js.map +0 -1
- package/dist/integrations/resident/session-log-reads.js +0 -125
- package/dist/integrations/resident/session-log-reads.js.map +0 -1
- package/dist/integrations/resident/session-step.js +0 -476
- package/dist/integrations/resident/session-step.js.map +0 -1
- package/dist/integrations/resident/storage.js +0 -183
- package/dist/integrations/resident/storage.js.map +0 -1
- package/dist/integrations/resident/tool-evidence.js +0 -123
- package/dist/integrations/resident/tool-evidence.js.map +0 -1
- package/dist/integrations/resident/verification.js +0 -109
- package/dist/integrations/resident/verification.js.map +0 -1
- package/dist/integrations/sessions/checkpoint-view.js +0 -48
- package/dist/integrations/sessions/checkpoint-view.js.map +0 -1
- package/dist/integrations/sessions/context-inventory.js +0 -44
- package/dist/integrations/sessions/context-inventory.js.map +0 -1
- package/dist/integrations/sessions/conversation-search.js +0 -572
- package/dist/integrations/sessions/conversation-search.js.map +0 -1
- package/dist/integrations/sessions/display-title.js +0 -5
- package/dist/integrations/sessions/display-title.js.map +0 -1
- package/dist/integrations/sessions/evidence-page-validation.js +0 -74
- package/dist/integrations/sessions/evidence-page-validation.js.map +0 -1
- package/dist/integrations/sessions/evidence-recall.js +0 -117
- package/dist/integrations/sessions/evidence-recall.js.map +0 -1
- package/dist/integrations/sessions/store.js +0 -780
- package/dist/integrations/sessions/store.js.map +0 -1
- package/dist/integrations/sessions/task-context.js +0 -96
- package/dist/integrations/sessions/task-context.js.map +0 -1
- package/dist/integrations/sessions/transcript-export.js +0 -342
- package/dist/integrations/sessions/transcript-export.js.map +0 -1
- package/dist/integrations/state/home.js +0 -17
- package/dist/integrations/state/home.js.map +0 -1
- package/dist/integrations/state/identity.js +0 -49
- package/dist/integrations/state/identity.js.map +0 -1
- package/dist/integrations/state/immutable-json.js +0 -38
- package/dist/integrations/state/immutable-json.js.map +0 -1
- package/dist/integrations/state/private-directory.js +0 -43
- package/dist/integrations/state/private-directory.js.map +0 -1
- package/dist/integrations/state/project.js +0 -13
- package/dist/integrations/state/project.js.map +0 -1
- package/dist/integrations/state/report.js +0 -626
- package/dist/integrations/state/report.js.map +0 -1
- package/dist/integrations/state/retention.js +0 -18
- package/dist/integrations/state/retention.js.map +0 -1
- package/dist/integrations/subagents/NamzuCliAgent.js +0 -9
- package/dist/integrations/subagents/NamzuCliAgent.js.map +0 -1
- package/dist/integrations/subagents/activity.js +0 -759
- package/dist/integrations/subagents/activity.js.map +0 -1
- package/dist/integrations/subagents/batches.js +0 -172
- package/dist/integrations/subagents/batches.js.map +0 -1
- package/dist/integrations/subagents/definitions.js +0 -26
- package/dist/integrations/subagents/definitions.js.map +0 -1
- package/dist/integrations/subagents/model-effort.js +0 -12
- package/dist/integrations/subagents/model-effort.js.map +0 -1
- package/dist/integrations/subagents/parent.js +0 -47
- package/dist/integrations/subagents/parent.js.map +0 -1
- package/dist/integrations/subagents/policy.js +0 -3
- package/dist/integrations/subagents/policy.js.map +0 -1
- package/dist/integrations/subagents/replay.js +0 -295
- package/dist/integrations/subagents/replay.js.map +0 -1
- package/dist/integrations/subagents/runtime.js +0 -1317
- package/dist/integrations/subagents/runtime.js.map +0 -1
- package/dist/integrations/subagents/saved-agents.js +0 -102
- package/dist/integrations/subagents/saved-agents.js.map +0 -1
- package/dist/integrations/subagents/slash.js +0 -45
- package/dist/integrations/subagents/slash.js.map +0 -1
- package/dist/integrations/subagents/worktree-driver.js +0 -72
- package/dist/integrations/subagents/worktree-driver.js.map +0 -1
- package/dist/integrations/telemetry/session-export.js +0 -119
- package/dist/integrations/telemetry/session-export.js.map +0 -1
- package/dist/integrations/trust/store.js +0 -73
- package/dist/integrations/trust/store.js.map +0 -1
- package/dist/integrations/updates.js +0 -115
- package/dist/integrations/updates.js.map +0 -1
- package/dist/integrations/web/exa-search.js +0 -154
- package/dist/integrations/web/exa-search.js.map +0 -1
- package/dist/integrations/web/open-url.js +0 -73
- package/dist/integrations/web/open-url.js.map +0 -1
- package/dist/integrations/web/search.js +0 -68
- package/dist/integrations/web/search.js.map +0 -1
- package/dist/integrations/worktrees/managed.js +0 -231
- package/dist/integrations/worktrees/managed.js.map +0 -1
- package/dist/logging.js +0 -115
- package/dist/logging.js.map +0 -1
- package/dist/memory/io.js +0 -177
- package/dist/memory/io.js.map +0 -1
- package/dist/memory/presentation.js +0 -76
- package/dist/memory/presentation.js.map +0 -1
- package/dist/memory/store.js +0 -180
- package/dist/memory/store.js.map +0 -1
- package/dist/memory/typed.js +0 -336
- package/dist/memory/typed.js.map +0 -1
- package/dist/output/formatter.js +0 -16
- package/dist/output/formatter.js.map +0 -1
- package/dist/output/index.js +0 -22
- package/dist/output/index.js.map +0 -1
- package/dist/output/json.js +0 -51
- package/dist/output/json.js.map +0 -1
- package/dist/output/text.js +0 -50
- package/dist/output/text.js.map +0 -1
- package/dist/output/yaml.js +0 -26
- package/dist/output/yaml.js.map +0 -1
- package/dist/output-schema.js +0 -18
- package/dist/output-schema.js.map +0 -1
- package/dist/permissions/browser-sites.js +0 -270
- package/dist/permissions/browser-sites.js.map +0 -1
- package/dist/permissions/canonical-project.js +0 -13
- package/dist/permissions/canonical-project.js.map +0 -1
- package/dist/permissions/checks.js +0 -128
- package/dist/permissions/checks.js.map +0 -1
- package/dist/permissions/headless-trust.js +0 -86
- package/dist/permissions/headless-trust.js.map +0 -1
- package/dist/permissions/live-mode.js +0 -62
- package/dist/permissions/live-mode.js.map +0 -1
- package/dist/permissions/mode.js +0 -65
- package/dist/permissions/mode.js.map +0 -1
- package/dist/permissions/rules.js +0 -358
- package/dist/permissions/rules.js.map +0 -1
- package/dist/release-notes.js +0 -64
- package/dist/release-notes.js.map +0 -1
- package/dist/resume-invocation.js +0 -24
- package/dist/resume-invocation.js.map +0 -1
- package/dist/schedule/build.js +0 -374
- package/dist/schedule/build.js.map +0 -1
- package/dist/schedule/changes.js +0 -78
- package/dist/schedule/changes.js.map +0 -1
- package/dist/schedule/commands/add.js +0 -603
- package/dist/schedule/commands/add.js.map +0 -1
- package/dist/schedule/commands/args.js +0 -80
- package/dist/schedule/commands/args.js.map +0 -1
- package/dist/schedule/commands/confirm-prompt.js +0 -21
- package/dist/schedule/commands/confirm-prompt.js.map +0 -1
- package/dist/schedule/commands/lifecycle.js +0 -586
- package/dist/schedule/commands/lifecycle.js.map +0 -1
- package/dist/schedule/commands/list.js +0 -260
- package/dist/schedule/commands/list.js.map +0 -1
- package/dist/schedule/commands/logs.js +0 -106
- package/dist/schedule/commands/logs.js.map +0 -1
- package/dist/schedule/commands/service.js +0 -458
- package/dist/schedule/commands/service.js.map +0 -1
- package/dist/schedule/daemon/daemon.js +0 -1265
- package/dist/schedule/daemon/daemon.js.map +0 -1
- package/dist/schedule/daemon/endpoint.js +0 -158
- package/dist/schedule/daemon/endpoint.js.map +0 -1
- package/dist/schedule/daemon/exit.js +0 -8
- package/dist/schedule/daemon/exit.js.map +0 -1
- package/dist/schedule/daemon/log.js +0 -53
- package/dist/schedule/daemon/log.js.map +0 -1
- package/dist/schedule/daemon/notify.js +0 -158
- package/dist/schedule/daemon/notify.js.map +0 -1
- package/dist/schedule/daemon/retention.js +0 -46
- package/dist/schedule/daemon/retention.js.map +0 -1
- package/dist/schedule/daemon/sessions.js +0 -52
- package/dist/schedule/daemon/sessions.js.map +0 -1
- package/dist/schedule/env.js +0 -106
- package/dist/schedule/env.js.map +0 -1
- package/dist/schedule/fire/browser-preflight.js +0 -73
- package/dist/schedule/fire/browser-preflight.js.map +0 -1
- package/dist/schedule/fire/calls.js +0 -114
- package/dist/schedule/fire/calls.js.map +0 -1
- package/dist/schedule/fire/fire.js +0 -681
- package/dist/schedule/fire/fire.js.map +0 -1
- package/dist/schedule/fire/result.js +0 -19
- package/dist/schedule/fire/result.js.map +0 -1
- package/dist/schedule/fire/run-script.js +0 -81
- package/dist/schedule/fire/run-script.js.map +0 -1
- package/dist/schedule/fire/unattended-note.js +0 -51
- package/dist/schedule/fire/unattended-note.js.map +0 -1
- package/dist/schedule/fire/wake-gate.js +0 -90
- package/dist/schedule/fire/wake-gate.js.map +0 -1
- package/dist/schedule/floor.js +0 -1561
- package/dist/schedule/floor.js.map +0 -1
- package/dist/schedule/folder.js +0 -84
- package/dist/schedule/folder.js.map +0 -1
- package/dist/schedule/paths.js +0 -53
- package/dist/schedule/paths.js.map +0 -1
- package/dist/schedule/policy.js +0 -414
- package/dist/schedule/policy.js.map +0 -1
- package/dist/schedule/resume-command.js +0 -72
- package/dist/schedule/resume-command.js.map +0 -1
- package/dist/schedule/script-check.js +0 -146
- package/dist/schedule/script-check.js.map +0 -1
- package/dist/schedule/script-shell.js +0 -5
- package/dist/schedule/script-shell.js.map +0 -1
- package/dist/schedule/service/detect.js +0 -29
- package/dist/schedule/service/detect.js.map +0 -1
- package/dist/schedule/service/index.js +0 -361
- package/dist/schedule/service/index.js.map +0 -1
- package/dist/schedule/service/launchd.js +0 -84
- package/dist/schedule/service/launchd.js.map +0 -1
- package/dist/schedule/service/manifest.js +0 -16
- package/dist/schedule/service/manifest.js.map +0 -1
- package/dist/schedule/service/names.js +0 -22
- package/dist/schedule/service/names.js.map +0 -1
- package/dist/schedule/service/quote.js +0 -64
- package/dist/schedule/service/quote.js.map +0 -1
- package/dist/schedule/service/runner.js +0 -31
- package/dist/schedule/service/runner.js.map +0 -1
- package/dist/schedule/service/systemd.js +0 -96
- package/dist/schedule/service/systemd.js.map +0 -1
- package/dist/schedule/service/windows-task.js +0 -199
- package/dist/schedule/service/windows-task.js.map +0 -1
- package/dist/schedule/service/wsl.js +0 -121
- package/dist/schedule/service/wsl.js.map +0 -1
- package/dist/schedule/store/atomic.js +0 -138
- package/dist/schedule/store/atomic.js.map +0 -1
- package/dist/schedule/store/claims.js +0 -57
- package/dist/schedule/store/claims.js.map +0 -1
- package/dist/schedule/store/digest.js +0 -139
- package/dist/schedule/store/digest.js.map +0 -1
- package/dist/schedule/store/history.js +0 -117
- package/dist/schedule/store/history.js.map +0 -1
- package/dist/schedule/store/jobs.js +0 -277
- package/dist/schedule/store/jobs.js.map +0 -1
- package/dist/schedule/store/state.js +0 -38
- package/dist/schedule/store/state.js.map +0 -1
- package/dist/schedule/types.js +0 -33
- package/dist/schedule/types.js.map +0 -1
- package/dist/schedule/visible-source.js +0 -59
- package/dist/schedule/visible-source.js.map +0 -1
- package/dist/skills/audit.js +0 -75
- package/dist/skills/audit.js.map +0 -1
- package/dist/skills/catalog.js +0 -226
- package/dist/skills/catalog.js.map +0 -1
- package/dist/skills/directory.js +0 -51
- package/dist/skills/directory.js.map +0 -1
- package/dist/skills/save.js +0 -344
- package/dist/skills/save.js.map +0 -1
- package/dist/skills/store.js +0 -351
- package/dist/skills/store.js.map +0 -1
- package/dist/termination.js +0 -143
- package/dist/termination.js.map +0 -1
- package/dist/test-support/toolset.js +0 -27
- package/dist/test-support/toolset.js.map +0 -1
- package/dist/tui/AgentExplorer.js +0 -789
- package/dist/tui/AgentExplorer.js.map +0 -1
- package/dist/tui/App.js +0 -8499
- package/dist/tui/App.js.map +0 -1
- package/dist/tui/BackgroundJobsPanel.js +0 -129
- package/dist/tui/BackgroundJobsPanel.js.map +0 -1
- package/dist/tui/BrandHeader.js +0 -14
- package/dist/tui/BrandHeader.js.map +0 -1
- package/dist/tui/Checklist.js +0 -90
- package/dist/tui/Checklist.js.map +0 -1
- package/dist/tui/ChoicePicker.js +0 -64
- package/dist/tui/ChoicePicker.js.map +0 -1
- package/dist/tui/Composer.js +0 -939
- package/dist/tui/Composer.js.map +0 -1
- package/dist/tui/ComposerFrame.js +0 -79
- package/dist/tui/ComposerFrame.js.map +0 -1
- package/dist/tui/CopyPicker.js +0 -19
- package/dist/tui/CopyPicker.js.map +0 -1
- package/dist/tui/EditPromptPicker.js +0 -17
- package/dist/tui/EditPromptPicker.js.map +0 -1
- package/dist/tui/EffortSlider.js +0 -134
- package/dist/tui/EffortSlider.js.map +0 -1
- package/dist/tui/LiveActivity.js +0 -89
- package/dist/tui/LiveActivity.js.map +0 -1
- package/dist/tui/Markdown.js +0 -137
- package/dist/tui/Markdown.js.map +0 -1
- package/dist/tui/PendingInputPanel.js +0 -108
- package/dist/tui/PendingInputPanel.js.map +0 -1
- package/dist/tui/PermissionOverlay.js +0 -278
- package/dist/tui/PermissionOverlay.js.map +0 -1
- package/dist/tui/Picker.js +0 -1310
- package/dist/tui/Picker.js.map +0 -1
- package/dist/tui/ProviderSetup.js +0 -125
- package/dist/tui/ProviderSetup.js.map +0 -1
- package/dist/tui/ResumePicker.js +0 -34
- package/dist/tui/ResumePicker.js.map +0 -1
- package/dist/tui/SaveSkillOverlay.js +0 -118
- package/dist/tui/SaveSkillOverlay.js.map +0 -1
- package/dist/tui/ScheduleReviewOverlay.js +0 -166
- package/dist/tui/ScheduleReviewOverlay.js.map +0 -1
- package/dist/tui/StatusBar.js +0 -182
- package/dist/tui/StatusBar.js.map +0 -1
- package/dist/tui/StatusPanel.js +0 -11
- package/dist/tui/StatusPanel.js.map +0 -1
- package/dist/tui/TaskList.js +0 -43
- package/dist/tui/TaskList.js.map +0 -1
- package/dist/tui/TextPrompt.js +0 -185
- package/dist/tui/TextPrompt.js.map +0 -1
- package/dist/tui/ToolOutputViewer.js +0 -39
- package/dist/tui/ToolOutputViewer.js.map +0 -1
- package/dist/tui/Transcript.js +0 -235
- package/dist/tui/Transcript.js.map +0 -1
- package/dist/tui/TrustPrompt.js +0 -13
- package/dist/tui/TrustPrompt.js.map +0 -1
- package/dist/tui/ViewportBound.js +0 -55
- package/dist/tui/ViewportBound.js.map +0 -1
- package/dist/tui/agent-transcript-rows.js +0 -115
- package/dist/tui/agent-transcript-rows.js.map +0 -1
- package/dist/tui/agent.js +0 -4301
- package/dist/tui/agent.js.map +0 -1
- package/dist/tui/browser-notices.js +0 -107
- package/dist/tui/browser-notices.js.map +0 -1
- package/dist/tui/choice-selection.js +0 -38
- package/dist/tui/choice-selection.js.map +0 -1
- package/dist/tui/compact-transcript.js +0 -46
- package/dist/tui/compact-transcript.js.map +0 -1
- package/dist/tui/consent-timing.js +0 -48
- package/dist/tui/consent-timing.js.map +0 -1
- package/dist/tui/conversation-evidence-view.js +0 -96
- package/dist/tui/conversation-evidence-view.js.map +0 -1
- package/dist/tui/conversation-history.js +0 -33
- package/dist/tui/conversation-history.js.map +0 -1
- package/dist/tui/copy-targets.js +0 -189
- package/dist/tui/copy-targets.js.map +0 -1
- package/dist/tui/credential-entry.js +0 -134
- package/dist/tui/credential-entry.js.map +0 -1
- package/dist/tui/edit-prompts.js +0 -35
- package/dist/tui/edit-prompts.js.map +0 -1
- package/dist/tui/exit-summary.js +0 -30
- package/dist/tui/exit-summary.js.map +0 -1
- package/dist/tui/external-editor.js +0 -169
- package/dist/tui/external-editor.js.map +0 -1
- package/dist/tui/hypermode.js +0 -58
- package/dist/tui/hypermode.js.map +0 -1
- package/dist/tui/index.js +0 -81
- package/dist/tui/index.js.map +0 -1
- package/dist/tui/live-window.js +0 -281
- package/dist/tui/live-window.js.map +0 -1
- package/dist/tui/log-pane.js +0 -100
- package/dist/tui/log-pane.js.map +0 -1
- package/dist/tui/login-prompt.js +0 -105
- package/dist/tui/login-prompt.js.map +0 -1
- package/dist/tui/logo.js +0 -9
- package/dist/tui/logo.js.map +0 -1
- package/dist/tui/markdown-block-cache.js +0 -76
- package/dist/tui/markdown-block-cache.js.map +0 -1
- package/dist/tui/markdown-table.js +0 -175
- package/dist/tui/markdown-table.js.map +0 -1
- package/dist/tui/markdown-wrap.js +0 -189
- package/dist/tui/markdown-wrap.js.map +0 -1
- package/dist/tui/markdownParser.js +0 -237
- package/dist/tui/markdownParser.js.map +0 -1
- package/dist/tui/mentions.js +0 -150
- package/dist/tui/mentions.js.map +0 -1
- package/dist/tui/model-catalogue-view.js +0 -75
- package/dist/tui/model-catalogue-view.js.map +0 -1
- package/dist/tui/model-choices.js +0 -157
- package/dist/tui/model-choices.js.map +0 -1
- package/dist/tui/model-search.js +0 -28
- package/dist/tui/model-search.js.map +0 -1
- package/dist/tui/model-selection-intent.js +0 -96
- package/dist/tui/model-selection-intent.js.map +0 -1
- package/dist/tui/model-switch-tool.js +0 -74
- package/dist/tui/model-switch-tool.js.map +0 -1
- package/dist/tui/model-switch.js +0 -106
- package/dist/tui/model-switch.js.map +0 -1
- package/dist/tui/notices.js +0 -27
- package/dist/tui/notices.js.map +0 -1
- package/dist/tui/open-browser.js +0 -147
- package/dist/tui/open-browser.js.map +0 -1
- package/dist/tui/permission-review.js +0 -858
- package/dist/tui/permission-review.js.map +0 -1
- package/dist/tui/plugin-view.js +0 -59
- package/dist/tui/plugin-view.js.map +0 -1
- package/dist/tui/provider-list.js +0 -327
- package/dist/tui/provider-list.js.map +0 -1
- package/dist/tui/provider-selection.js +0 -16
- package/dist/tui/provider-selection.js.map +0 -1
- package/dist/tui/schedule/host-commands.js +0 -428
- package/dist/tui/schedule/host-commands.js.map +0 -1
- package/dist/tui/schedule/integration.js +0 -150
- package/dist/tui/schedule/integration.js.map +0 -1
- package/dist/tui/schedule/loop-host.js +0 -153
- package/dist/tui/schedule/loop-host.js.map +0 -1
- package/dist/tui/schedule/resume.js +0 -333
- package/dist/tui/schedule/resume.js.map +0 -1
- package/dist/tui/schedule/startup.js +0 -121
- package/dist/tui/schedule/startup.js.map +0 -1
- package/dist/tui/schedule/tool-host.js +0 -619
- package/dist/tui/schedule/tool-host.js.map +0 -1
- package/dist/tui/selection-window.js +0 -37
- package/dist/tui/selection-window.js.map +0 -1
- package/dist/tui/shell-escape.js +0 -110
- package/dist/tui/shell-escape.js.map +0 -1
- package/dist/tui/skills/learning.js +0 -131
- package/dist/tui/skills/learning.js.map +0 -1
- package/dist/tui/skills/suggest-setting.js +0 -55
- package/dist/tui/skills/suggest-setting.js.map +0 -1
- package/dist/tui/skills/suggestion-ledger.js +0 -52
- package/dist/tui/skills/suggestion-ledger.js.map +0 -1
- package/dist/tui/slashCommands.js +0 -1588
- package/dist/tui/slashCommands.js.map +0 -1
- package/dist/tui/status-card.js +0 -30
- package/dist/tui/status-card.js.map +0 -1
- package/dist/tui/status-panel-layout.js +0 -42
- package/dist/tui/status-panel-layout.js.map +0 -1
- package/dist/tui/stream-blocks.js +0 -187
- package/dist/tui/stream-blocks.js.map +0 -1
- package/dist/tui/task-activity.js +0 -157
- package/dist/tui/task-activity.js.map +0 -1
- package/dist/tui/terminal-choice-text.js +0 -118
- package/dist/tui/terminal-choice-text.js.map +0 -1
- package/dist/tui/terminal-display.js +0 -65
- package/dist/tui/terminal-display.js.map +0 -1
- package/dist/tui/terminal-hyperlinks.js +0 -70
- package/dist/tui/terminal-hyperlinks.js.map +0 -1
- package/dist/tui/theme.js +0 -34
- package/dist/tui/theme.js.map +0 -1
- package/dist/tui/triggers/analyze.js +0 -221
- package/dist/tui/triggers/analyze.js.map +0 -1
- package/dist/tui/triggers/context-text.js +0 -44
- package/dist/tui/triggers/context-text.js.map +0 -1
- package/dist/tui/triggers/copy.js +0 -163
- package/dist/tui/triggers/copy.js.map +0 -1
- package/dist/tui/triggers/detect.js +0 -295
- package/dist/tui/triggers/detect.js.map +0 -1
- package/dist/tui/triggers/fold.js +0 -44
- package/dist/tui/triggers/fold.js.map +0 -1
- package/dist/tui/triggers/pattern.js +0 -243
- package/dist/tui/triggers/pattern.js.map +0 -1
- package/dist/tui/triggers/provenance.js +0 -98
- package/dist/tui/triggers/provenance.js.map +0 -1
- package/dist/tui/triggers/registry.js +0 -164
- package/dist/tui/triggers/registry.js.map +0 -1
- package/dist/tui/triggers/setting.js +0 -61
- package/dist/tui/triggers/setting.js.map +0 -1
- package/dist/tui/triggers/verbs.js +0 -140
- package/dist/tui/triggers/verbs.js.map +0 -1
- package/dist/tui/turn-interruption.js +0 -160
- package/dist/tui/turn-interruption.js.map +0 -1
- package/dist/tui/turn-limits-settings.js +0 -88
- package/dist/tui/turn-limits-settings.js.map +0 -1
- package/dist/tui/types.js +0 -7
- package/dist/tui/types.js.map +0 -1
- package/dist/tui/units.js +0 -20
- package/dist/tui/units.js.map +0 -1
- package/dist/tui/use-selection-index.js +0 -13
- package/dist/tui/use-selection-index.js.map +0 -1
- package/dist/tui/web-activity.js +0 -105
- package/dist/tui/web-activity.js.map +0 -1
- package/dist/tui/workspace-diff.js +0 -101
- package/dist/tui/workspace-diff.js.map +0 -1
- package/dist/tui/workspace-review.js +0 -67
- package/dist/tui/workspace-review.js.map +0 -1
- package/dist/user-commands/store.js +0 -235
- package/dist/user-commands/store.js.map +0 -1
- package/dist/version.js +0 -23
- package/dist/version.js.map +0 -1
|
@@ -0,0 +1,1355 @@
|
|
|
1
|
+
import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
2
|
+
const require = __namzuCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
PROVIDER_REGISTRY,
|
|
5
|
+
unsupportedProviderMessage
|
|
6
|
+
} from "./chunk-6LLJQ3KY.js";
|
|
7
|
+
import {
|
|
8
|
+
findActiveZenModel
|
|
9
|
+
} from "./chunk-AHIDYIRB.js";
|
|
10
|
+
import {
|
|
11
|
+
isExperimentalFreeZenModel
|
|
12
|
+
} from "./chunk-GIXSS6KW.js";
|
|
13
|
+
import {
|
|
14
|
+
apiKeysPath,
|
|
15
|
+
credentialsPath,
|
|
16
|
+
googleApiKeyPath,
|
|
17
|
+
readStoredApiKey,
|
|
18
|
+
readStoredCodexCredential,
|
|
19
|
+
readStoredGeminiApiKey,
|
|
20
|
+
readStoredSubscriptionCredential
|
|
21
|
+
} from "./chunk-Q24K7536.js";
|
|
22
|
+
import {
|
|
23
|
+
namzuHomePath
|
|
24
|
+
} from "./chunk-NQY5P2EB.js";
|
|
25
|
+
import {
|
|
26
|
+
EnvCredentialProvider,
|
|
27
|
+
ProviderRegistry,
|
|
28
|
+
resolveProviderCapabilities
|
|
29
|
+
} from "./chunk-EWKJGHRO.js";
|
|
30
|
+
import {
|
|
31
|
+
__name
|
|
32
|
+
} from "./chunk-76FLAFCG.js";
|
|
33
|
+
|
|
34
|
+
// src/integrations/providers/access.ts
|
|
35
|
+
function hasApiCredential(entry, apiKey) {
|
|
36
|
+
if (entry.id === "zen" || entry.id === "zen-go") {
|
|
37
|
+
return Boolean(apiKey?.trim() && apiKey.trim() !== "public");
|
|
38
|
+
}
|
|
39
|
+
return Boolean(apiKey);
|
|
40
|
+
}
|
|
41
|
+
__name(hasApiCredential, "hasApiCredential");
|
|
42
|
+
function requiresCredentialForModel(entry, model) {
|
|
43
|
+
return entry.requiresApiKey || entry.id === "zen" && !isExperimentalFreeZenModel("zen", findActiveZenModel("zen", model));
|
|
44
|
+
}
|
|
45
|
+
__name(requiresCredentialForModel, "requiresCredentialForModel");
|
|
46
|
+
function canSelectModel(entry, apiKey, model) {
|
|
47
|
+
return hasApiCredential(entry, apiKey) || !requiresCredentialForModel(entry, model);
|
|
48
|
+
}
|
|
49
|
+
__name(canSelectModel, "canSelectModel");
|
|
50
|
+
|
|
51
|
+
// src/context/environment.ts
|
|
52
|
+
import { execFile } from "node:child_process";
|
|
53
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
54
|
+
import { promisify } from "node:util";
|
|
55
|
+
var run = promisify(execFile);
|
|
56
|
+
var GIT_TIMEOUT_MS = 2e3;
|
|
57
|
+
function detectWsl(env = process.env, probe2 = {}) {
|
|
58
|
+
const distro = env.WSL_DISTRO_NAME?.trim() || null;
|
|
59
|
+
const socket = env.WSL_INTEROP?.trim() || null;
|
|
60
|
+
if (!distro && !socket) return void 0;
|
|
61
|
+
const exists = probe2.exists ?? existsSync;
|
|
62
|
+
const list = probe2.list ?? ((path) => {
|
|
63
|
+
try {
|
|
64
|
+
return readdirSync(path);
|
|
65
|
+
} catch {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const interop = socket !== null || exists("/proc/sys/fs/binfmt_misc/WSLInterop");
|
|
70
|
+
const mountRoot = probe2.mountRoot ?? readWslMountRoot();
|
|
71
|
+
const drives = list(mountRoot === "/" ? "/" : mountRoot.slice(0, -1)).filter((name) => /^[a-z]$/i.test(name)).sort().map((name) => `${mountRoot}${name}`);
|
|
72
|
+
return { distro, interop, drives, mountRoot };
|
|
73
|
+
}
|
|
74
|
+
__name(detectWsl, "detectWsl");
|
|
75
|
+
var DEFAULT_WSL_MOUNT_ROOT = "/mnt/";
|
|
76
|
+
function parseWslMountRoot(wslConf) {
|
|
77
|
+
if (!wslConf) return DEFAULT_WSL_MOUNT_ROOT;
|
|
78
|
+
let inAutomount = false;
|
|
79
|
+
let root;
|
|
80
|
+
for (const raw of wslConf.replace(/^\uFEFF/, "").split(/\r?\n/)) {
|
|
81
|
+
const line = raw.trim();
|
|
82
|
+
if (line.length === 0 || line.startsWith("#") || line.startsWith(";")) continue;
|
|
83
|
+
const section = /^\[([^\]]+)\]$/.exec(line);
|
|
84
|
+
if (section) {
|
|
85
|
+
inAutomount = (section[1] ?? "").trim().toLowerCase() === "automount";
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const eq = line.indexOf("=");
|
|
89
|
+
if (!inAutomount || eq <= 0 || line.slice(0, eq).trim().toLowerCase() !== "root") continue;
|
|
90
|
+
let value = line.slice(eq + 1).replace(/\s[#;].*$/, "").trim();
|
|
91
|
+
if (/^(["']).*\1$/.test(value)) value = value.slice(1, -1);
|
|
92
|
+
root = value;
|
|
93
|
+
}
|
|
94
|
+
if (!root || !root.startsWith("/")) return DEFAULT_WSL_MOUNT_ROOT;
|
|
95
|
+
return root.endsWith("/") ? root : `${root}/`;
|
|
96
|
+
}
|
|
97
|
+
__name(parseWslMountRoot, "parseWslMountRoot");
|
|
98
|
+
function readWslMountRoot(readFile = (path) => {
|
|
99
|
+
try {
|
|
100
|
+
return readFileSync(path, "utf8");
|
|
101
|
+
} catch {
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
}) {
|
|
105
|
+
return parseWslMountRoot(readFile("/etc/wsl.conf"));
|
|
106
|
+
}
|
|
107
|
+
__name(readWslMountRoot, "readWslMountRoot");
|
|
108
|
+
function wslSystem32(mountRoot = DEFAULT_WSL_MOUNT_ROOT) {
|
|
109
|
+
return `${mountRoot}c/Windows/System32`;
|
|
110
|
+
}
|
|
111
|
+
__name(wslSystem32, "wslSystem32");
|
|
112
|
+
function localIsoDate(now) {
|
|
113
|
+
const pad = /* @__PURE__ */ __name((n) => String(n).padStart(2, "0"), "pad");
|
|
114
|
+
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
|
|
115
|
+
}
|
|
116
|
+
__name(localIsoDate, "localIsoDate");
|
|
117
|
+
async function git(cwd, args) {
|
|
118
|
+
try {
|
|
119
|
+
const { stdout } = await run("git", [...args], { cwd, timeout: GIT_TIMEOUT_MS });
|
|
120
|
+
const out = stdout.trim();
|
|
121
|
+
return out.length > 0 ? out : null;
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
__name(git, "git");
|
|
127
|
+
async function readEnvironmentFacts(cwd, now = /* @__PURE__ */ new Date()) {
|
|
128
|
+
const [insideWorkTree, branch] = await Promise.all([
|
|
129
|
+
git(cwd, ["rev-parse", "--is-inside-work-tree"]),
|
|
130
|
+
git(cwd, ["symbolic-ref", "--short", "HEAD"])
|
|
131
|
+
]);
|
|
132
|
+
const isRepository = insideWorkTree === "true";
|
|
133
|
+
return {
|
|
134
|
+
today: localIsoDate(now),
|
|
135
|
+
// A repository with no symbolic HEAD is on a detached one. Distinguishing
|
|
136
|
+
// that from "not a repository" matters: on a detached HEAD a commit goes
|
|
137
|
+
// nowhere reachable, and an agent about to commit should know.
|
|
138
|
+
branch: isRepository ? branch ?? "detached" : null,
|
|
139
|
+
isRepository
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
__name(readEnvironmentFacts, "readEnvironmentFacts");
|
|
143
|
+
function composeEnvironmentPrompt(facts) {
|
|
144
|
+
const lines = [`Today's date is ${facts.today}.`];
|
|
145
|
+
if (!facts.isRepository) {
|
|
146
|
+
lines.push("The working directory is not a git repository.");
|
|
147
|
+
} else if (facts.branch === "detached") {
|
|
148
|
+
lines.push(
|
|
149
|
+
"The working directory is a git repository with a detached HEAD \u2014 no branch is checked out, so a commit made here is not reachable from any branch."
|
|
150
|
+
);
|
|
151
|
+
} else {
|
|
152
|
+
lines.push(`The working directory is a git repository on branch \`${facts.branch}\`.`);
|
|
153
|
+
}
|
|
154
|
+
if (facts.additionalDirectories && facts.additionalDirectories.length > 0) {
|
|
155
|
+
lines.push(
|
|
156
|
+
`Besides the working directory, the file tools may reach these directories, by absolute path: ${facts.additionalDirectories.map((d) => `\`${d}\``).join(", ")}. Relative paths still resolve against the working directory.`
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
if (facts.boundary) lines.push(...boundaryLines(facts.boundary));
|
|
160
|
+
if (facts.wsl) lines.push(...wslLines(facts.wsl, facts.boundary));
|
|
161
|
+
lines.push(
|
|
162
|
+
"These are facts about right now. Prefer them over any date or branch you would otherwise assume."
|
|
163
|
+
);
|
|
164
|
+
return `## Environment
|
|
165
|
+
|
|
166
|
+
${lines.join("\n")}`;
|
|
167
|
+
}
|
|
168
|
+
__name(composeEnvironmentPrompt, "composeEnvironmentPrompt");
|
|
169
|
+
function boundaryLines(boundary) {
|
|
170
|
+
if (!boundary.sandbox) {
|
|
171
|
+
const outside = boundary.interactive ? "A path anywhere else is not refused outright: the user is asked to approve that call first, every time \u2014 in plan mode too, for a read; the strict permission mode refuses it. When you need a directory repeatedly, suggest the user add it with `/add-dir <path>`." : "A path anywhere else is refused in this session, because it needs a person to approve it and nobody is at the terminal. If you need one, say which directory and why, so the user can add it (`--add-dir <path>`) and run again.";
|
|
172
|
+
return [
|
|
173
|
+
"Tools run on this machine, not in a sandbox: shell commands and file changes go through the permission settings, which may ask the user before they run.",
|
|
174
|
+
`The file tools reach the working directory and any added directories directly. ${outside} A refusal that remains is a decision, not a missing file; say so rather than retrying another spelling.`
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
const { environment, enforced } = boundary.sandbox;
|
|
178
|
+
const network = enforced.includes("network") ? " The network is cut inside it." : " It does not cut the network on this machine.";
|
|
179
|
+
const escapeRoute = boundary.escape === "ask" ? "When one command genuinely cannot work inside it (it needs the network, a path it does not mount, or a host tool), set `dangerously_disable_sandbox: true` on that one `bash` call: the user is asked to approve it every time, whatever else is approved; the plan and strict permission modes refuse it. Never use it to get around a permission refusal." : boundary.escape === "unattended" ? "When one command genuinely cannot work inside it, `dangerously_disable_sandbox: true` on that `bash` call runs it on the host: this session is configured to allow that without asking, and every use is recorded. Use it only when the sandbox is the obstacle." : "Commands cannot leave the sandbox in this session. When one needs something the sandbox withholds, say what and why, and let the user decide.";
|
|
180
|
+
const files = enforced.includes("filesystem") ? " Inside it, commands can read and write the working directory and the added directories; the system directories programs need are readable, /tmp is private to the command, and the rest of this machine (the home directory, other projects, other mounts) cannot be reached from it, so no spelling of such a path will be found." : " It does not confine the file system here, so commands can still see files outside the working directory.";
|
|
181
|
+
return [
|
|
182
|
+
`Shell commands run in a sandbox (${environment}${enforced.length > 0 ? `, enforcing ${enforced.join(", ")}` : ", enforcing nothing on this platform"}).${files}${network} The file tools reach only the working directory and the added directories.`,
|
|
183
|
+
`To reach another directory, ask the user to add it with \`/add-dir <path>\` (the next turn binds it). ${escapeRoute}`
|
|
184
|
+
];
|
|
185
|
+
}
|
|
186
|
+
__name(boundaryLines, "boundaryLines");
|
|
187
|
+
function wslLines(wsl, boundary) {
|
|
188
|
+
const sandboxed = boundary?.sandbox?.enforced.includes("filesystem") === true;
|
|
189
|
+
const fileTools = boundary?.sandbox !== void 0 ? "the file tools reach them only once added with `/add-dir`" : boundary?.interactive === false ? "a file tool reaching them is refused in this session, since nobody is here to approve it" : "a file tool reaching them asks for approval first, like any other outside path";
|
|
190
|
+
const root = wsl.mountRoot ?? DEFAULT_WSL_MOUNT_ROOT;
|
|
191
|
+
const drives = wsl.drives.length > 0 ? `Windows drives are mounted under ${wsl.drives.map((d) => `\`${d}\``).join(", ")} (\`C:\\Users\` is \`${root}c/Users\`; \`wslpath -w\` and \`wslpath -u\` convert).` : `No Windows drive is mounted under \`${root === "/" ? "/" : root.slice(0, -1)}\` right now.`;
|
|
192
|
+
const reach = sandboxed ? "They are outside the sandbox, so a command there needs `/add-dir` or the sandbox escape." : `They are outside the working directory, so ${fileTools}.`;
|
|
193
|
+
const interop = wsl.interop ? `Windows programs start from the shell through WSL interop, by their \`.exe\` name: \`powershell.exe -NoProfile -Command ...\`, \`cmd.exe /c ...\`, \`explorer.exe .\` (it exits 1 even when it succeeds). \`cmd.exe\` started from a Linux directory warns that UNC paths are unsupported and falls back to C:\\Windows, so \`cd\` under \`${root}c\` first or use \`powershell.exe\`. If a name is not found, the Windows side of \`PATH\` was not appended; \`cmd.exe\` is under \`${wslSystem32(root)}\` and \`powershell.exe\` under its \`WindowsPowerShell/v1.0\`.${sandboxed ? " The sandbox does not mount the Windows drives those programs live on, so running one needs the sandbox escape." : ""}` : "WSL interop is off here, so Windows `.exe` programs cannot be started from the shell.";
|
|
194
|
+
return [
|
|
195
|
+
`This machine is Windows Subsystem for Linux${wsl.distro ? ` (distro \`${wsl.distro}\`)` : ""}. ${drives} ${reach}`,
|
|
196
|
+
interop
|
|
197
|
+
];
|
|
198
|
+
}
|
|
199
|
+
__name(wslLines, "wslLines");
|
|
200
|
+
|
|
201
|
+
// src/integrations/providers/harness-credentials.ts
|
|
202
|
+
import { execFileSync } from "node:child_process";
|
|
203
|
+
import { randomBytes } from "node:crypto";
|
|
204
|
+
import {
|
|
205
|
+
closeSync,
|
|
206
|
+
fsyncSync,
|
|
207
|
+
openSync,
|
|
208
|
+
readFileSync as readFileSync2,
|
|
209
|
+
renameSync,
|
|
210
|
+
statSync,
|
|
211
|
+
unlinkSync,
|
|
212
|
+
writeFileSync
|
|
213
|
+
} from "node:fs";
|
|
214
|
+
import { homedir } from "node:os";
|
|
215
|
+
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
216
|
+
var MAX_CREDENTIAL_FILE_BYTES = 1024 * 1024;
|
|
217
|
+
function claudeCredentialsPath(home = homedir(), env = process.env) {
|
|
218
|
+
const configured = env.CLAUDE_CONFIG_DIR;
|
|
219
|
+
return join(configured ? resolve(configured) : join(home, ".claude"), ".credentials.json");
|
|
220
|
+
}
|
|
221
|
+
__name(claudeCredentialsPath, "claudeCredentialsPath");
|
|
222
|
+
function windowsPathToWsl(path, mountRoot = DEFAULT_WSL_MOUNT_ROOT) {
|
|
223
|
+
const normalized = path.trim().replaceAll("\\", "/");
|
|
224
|
+
const match = /^([A-Za-z]):\/(.+)$/u.exec(normalized);
|
|
225
|
+
if (!match?.[1] || !match[2] || match[2].split("/").includes("..")) return null;
|
|
226
|
+
return `${mountRoot}${match[1].toLowerCase()}/${match[2]}`;
|
|
227
|
+
}
|
|
228
|
+
__name(windowsPathToWsl, "windowsPathToWsl");
|
|
229
|
+
function wslWindowsHome(env = process.env, run2 = execFileSync, command, mountRoot) {
|
|
230
|
+
if (!env.WSL_DISTRO_NAME && !env.WSL_INTEROP) return null;
|
|
231
|
+
const root = mountRoot ?? readWslMountRoot();
|
|
232
|
+
const cmd = command ?? `${wslSystem32(root)}/cmd.exe`;
|
|
233
|
+
try {
|
|
234
|
+
if (!statSync(cmd).isFile()) return null;
|
|
235
|
+
const output = run2(cmd, ["/d", "/s", "/c", "echo", "%USERPROFILE%"], {
|
|
236
|
+
encoding: "utf8",
|
|
237
|
+
timeout: 1e3,
|
|
238
|
+
// The interop shim that fronts a Windows process does not honour
|
|
239
|
+
// SIGTERM the way a Linux process does; a probe that overran its
|
|
240
|
+
// second was left alive, and the synchronous call waited on it for
|
|
241
|
+
// as long as Windows took to answer. SIGKILL is what actually ends
|
|
242
|
+
// it, and the answer is "no paired home", which is the correct one
|
|
243
|
+
// for a probe that could not be made in time.
|
|
244
|
+
killSignal: "SIGKILL",
|
|
245
|
+
windowsHide: true,
|
|
246
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
247
|
+
});
|
|
248
|
+
return windowsPathToWsl(String(output), root);
|
|
249
|
+
} catch {
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
__name(wslWindowsHome, "wslWindowsHome");
|
|
254
|
+
function readClaudeFileCredentialCandidates(home, env = process.env, windowsHome = home === void 0 ? wslWindowsHome(env) : null) {
|
|
255
|
+
return claudeCredentialSearchPaths(home, env, windowsHome).flatMap((path) => {
|
|
256
|
+
const credential = readClaudeCredentialFile(path);
|
|
257
|
+
return credential ? [{ path, credential }] : [];
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
__name(readClaudeFileCredentialCandidates, "readClaudeFileCredentialCandidates");
|
|
261
|
+
function claudeCredentialSearchPaths(home, env = process.env, windowsHome = home === void 0 ? wslWindowsHome(env) : null) {
|
|
262
|
+
const paths = env.CLAUDE_CONFIG_DIR ? [claudeCredentialsPath(home, env)] : [
|
|
263
|
+
claudeCredentialsPath(home, env),
|
|
264
|
+
...windowsHome ? [claudeCredentialsPath(windowsHome, {})] : []
|
|
265
|
+
];
|
|
266
|
+
return [...new Set(paths)];
|
|
267
|
+
}
|
|
268
|
+
__name(claudeCredentialSearchPaths, "claudeCredentialSearchPaths");
|
|
269
|
+
function codexCredentialsPath(home = homedir(), env = process.env) {
|
|
270
|
+
const configured = env.CODEX_HOME?.trim();
|
|
271
|
+
const root = configured ? isAbsolute(configured) ? configured : resolve(configured) : join(home, ".codex");
|
|
272
|
+
return join(root, "auth.json");
|
|
273
|
+
}
|
|
274
|
+
__name(codexCredentialsPath, "codexCredentialsPath");
|
|
275
|
+
function opencodeCredentialsPath(home = homedir(), env = process.env) {
|
|
276
|
+
const configured = env.XDG_DATA_HOME?.trim();
|
|
277
|
+
const root = configured && isAbsolute(configured) ? configured : join(home, ".local", "share");
|
|
278
|
+
return join(root, "opencode", "auth.json");
|
|
279
|
+
}
|
|
280
|
+
__name(opencodeCredentialsPath, "opencodeCredentialsPath");
|
|
281
|
+
function readOpenCodeApiCredentialCandidates(home, env = process.env, windowsHome = home === void 0 ? wslWindowsHome(env) : null) {
|
|
282
|
+
const parse = /* @__PURE__ */ __name((value, source) => {
|
|
283
|
+
const root = record(value);
|
|
284
|
+
return ["opencode", "opencode-go"].flatMap((id) => {
|
|
285
|
+
const entry = record(root?.[id]);
|
|
286
|
+
const apiKey = typeof entry?.key === "string" ? entry.key.trim() : void 0;
|
|
287
|
+
return entry?.type === "api" && apiKey && apiKey !== "public" ? [
|
|
288
|
+
{
|
|
289
|
+
provider: id === "opencode" ? "zen" : "zen-go",
|
|
290
|
+
apiKey,
|
|
291
|
+
source
|
|
292
|
+
}
|
|
293
|
+
] : [];
|
|
294
|
+
});
|
|
295
|
+
}, "parse");
|
|
296
|
+
if (env.OPENCODE_AUTH_CONTENT !== void 0) {
|
|
297
|
+
try {
|
|
298
|
+
if (Buffer.byteLength(env.OPENCODE_AUTH_CONTENT, "utf8") > MAX_CREDENTIAL_FILE_BYTES)
|
|
299
|
+
return [];
|
|
300
|
+
return parse(JSON.parse(env.OPENCODE_AUTH_CONTENT), {
|
|
301
|
+
kind: "env",
|
|
302
|
+
envName: "OPENCODE_AUTH_CONTENT"
|
|
303
|
+
});
|
|
304
|
+
} catch {
|
|
305
|
+
return [];
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
const paths = env.XDG_DATA_HOME?.trim() && isAbsolute(env.XDG_DATA_HOME.trim()) ? [opencodeCredentialsPath(home, env)] : [
|
|
309
|
+
opencodeCredentialsPath(home, env),
|
|
310
|
+
...windowsHome ? [opencodeCredentialsPath(windowsHome, {})] : []
|
|
311
|
+
];
|
|
312
|
+
return [...new Set(paths)].flatMap(
|
|
313
|
+
(path) => parse(readCredentialJson(path), { kind: "opencode-file", path })
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
__name(readOpenCodeApiCredentialCandidates, "readOpenCodeApiCredentialCandidates");
|
|
317
|
+
function readCredentialJson(path) {
|
|
318
|
+
try {
|
|
319
|
+
const stat = statSync(path);
|
|
320
|
+
if (!stat.isFile() || stat.size <= 0 || stat.size > MAX_CREDENTIAL_FILE_BYTES) return null;
|
|
321
|
+
return JSON.parse(readFileSync2(path, "utf8"));
|
|
322
|
+
} catch {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
__name(readCredentialJson, "readCredentialJson");
|
|
327
|
+
function record(value) {
|
|
328
|
+
return typeof value === "object" && value !== null ? value : null;
|
|
329
|
+
}
|
|
330
|
+
__name(record, "record");
|
|
331
|
+
function optionalString(value) {
|
|
332
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
333
|
+
}
|
|
334
|
+
__name(optionalString, "optionalString");
|
|
335
|
+
function optionalFiniteNumber(value) {
|
|
336
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
337
|
+
}
|
|
338
|
+
__name(optionalFiniteNumber, "optionalFiniteNumber");
|
|
339
|
+
function optionalStringArray(value) {
|
|
340
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) return void 0;
|
|
341
|
+
return value;
|
|
342
|
+
}
|
|
343
|
+
__name(optionalStringArray, "optionalStringArray");
|
|
344
|
+
function readClaudeFileCredential(home = homedir(), env = process.env) {
|
|
345
|
+
return readClaudeCredentialFile(claudeCredentialsPath(home, env));
|
|
346
|
+
}
|
|
347
|
+
__name(readClaudeFileCredential, "readClaudeFileCredential");
|
|
348
|
+
function readClaudeCredentialFile(path) {
|
|
349
|
+
const root = record(readCredentialJson(path));
|
|
350
|
+
const oauth = record(root?.claudeAiOauth);
|
|
351
|
+
const accessToken = optionalString(oauth?.accessToken);
|
|
352
|
+
if (!accessToken) return null;
|
|
353
|
+
return {
|
|
354
|
+
accessToken,
|
|
355
|
+
refreshToken: optionalString(oauth?.refreshToken),
|
|
356
|
+
expiresAt: optionalFiniteNumber(oauth?.expiresAt),
|
|
357
|
+
scopes: optionalStringArray(oauth?.scopes)
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
__name(readClaudeCredentialFile, "readClaudeCredentialFile");
|
|
361
|
+
function sameClaudeCredential(left, right) {
|
|
362
|
+
return left.accessToken === right.accessToken && left.refreshToken === right.refreshToken && left.expiresAt === right.expiresAt && JSON.stringify(left.scopes ?? []) === JSON.stringify(right.scopes ?? []);
|
|
363
|
+
}
|
|
364
|
+
__name(sameClaudeCredential, "sameClaudeCredential");
|
|
365
|
+
function replaceClaudeCredentialFile(path, expected, replacement) {
|
|
366
|
+
const root = record(readCredentialJson(path));
|
|
367
|
+
const oauth = record(root?.claudeAiOauth);
|
|
368
|
+
const current = readClaudeCredentialFile(path);
|
|
369
|
+
if (!root || !oauth || !current) return { replaced: false, current };
|
|
370
|
+
if (!sameClaudeCredential(current, expected)) return { replaced: false, current };
|
|
371
|
+
const updated = {
|
|
372
|
+
...root,
|
|
373
|
+
claudeAiOauth: {
|
|
374
|
+
...oauth,
|
|
375
|
+
accessToken: replacement.accessToken,
|
|
376
|
+
...replacement.refreshToken === void 0 ? {} : { refreshToken: replacement.refreshToken },
|
|
377
|
+
...replacement.expiresAt === void 0 ? {} : { expiresAt: replacement.expiresAt },
|
|
378
|
+
...replacement.scopes === void 0 ? {} : { scopes: replacement.scopes }
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
const tempPath = join(
|
|
382
|
+
dirname(path),
|
|
383
|
+
`.${basename(path)}.namzu-${process.pid}-${randomBytes(8).toString("hex")}.tmp`
|
|
384
|
+
);
|
|
385
|
+
let descriptor;
|
|
386
|
+
try {
|
|
387
|
+
descriptor = openSync(tempPath, "wx", 384);
|
|
388
|
+
writeFileSync(descriptor, `${JSON.stringify(updated, null, 2)}
|
|
389
|
+
`, "utf8");
|
|
390
|
+
fsyncSync(descriptor);
|
|
391
|
+
closeSync(descriptor);
|
|
392
|
+
descriptor = void 0;
|
|
393
|
+
const beforeCommit = readClaudeCredentialFile(path);
|
|
394
|
+
if (!beforeCommit || !sameClaudeCredential(beforeCommit, expected)) {
|
|
395
|
+
return { replaced: false, current: beforeCommit };
|
|
396
|
+
}
|
|
397
|
+
renameSync(tempPath, path);
|
|
398
|
+
return { replaced: true, current: replacement };
|
|
399
|
+
} finally {
|
|
400
|
+
if (descriptor !== void 0) {
|
|
401
|
+
try {
|
|
402
|
+
closeSync(descriptor);
|
|
403
|
+
} catch {
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
try {
|
|
407
|
+
unlinkSync(tempPath);
|
|
408
|
+
} catch {
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
__name(replaceClaudeCredentialFile, "replaceClaudeCredentialFile");
|
|
413
|
+
function codexCredentialFromTokens(tokens) {
|
|
414
|
+
if (tokens.accessToken.length === 0) return null;
|
|
415
|
+
const claims = jwtClaims(tokens.accessToken);
|
|
416
|
+
const accountId = tokens.accountId ?? claims.accountId;
|
|
417
|
+
if (!accountId) return null;
|
|
418
|
+
return {
|
|
419
|
+
accessToken: tokens.accessToken,
|
|
420
|
+
...tokens.refreshToken ? { refreshToken: tokens.refreshToken } : {},
|
|
421
|
+
accountId,
|
|
422
|
+
...claims.expiresAt === void 0 ? {} : { expiresAt: claims.expiresAt }
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
__name(codexCredentialFromTokens, "codexCredentialFromTokens");
|
|
426
|
+
function jwtClaims(token) {
|
|
427
|
+
const parts = token.split(".");
|
|
428
|
+
if (parts.length !== 3 || !parts[1]) return {};
|
|
429
|
+
try {
|
|
430
|
+
const payload = record(JSON.parse(Buffer.from(parts[1], "base64url").toString("utf8")));
|
|
431
|
+
const auth = record(payload?.["https://api.openai.com/auth"]);
|
|
432
|
+
const exp = optionalFiniteNumber(payload?.exp);
|
|
433
|
+
return {
|
|
434
|
+
...exp === void 0 ? {} : { expiresAt: exp * 1e3 },
|
|
435
|
+
...optionalString(auth?.chatgpt_account_id) ? { accountId: optionalString(auth?.chatgpt_account_id) } : {}
|
|
436
|
+
};
|
|
437
|
+
} catch {
|
|
438
|
+
return {};
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
__name(jwtClaims, "jwtClaims");
|
|
442
|
+
function readCodexFileCredential(home = homedir(), env = process.env) {
|
|
443
|
+
return readCodexCredentialFile(codexCredentialsPath(home, env));
|
|
444
|
+
}
|
|
445
|
+
__name(readCodexFileCredential, "readCodexFileCredential");
|
|
446
|
+
function readCodexFileCredentialCandidates(home, env = process.env, windowsHome = home === void 0 ? wslWindowsHome(env) : null) {
|
|
447
|
+
const paths = env.CODEX_HOME?.trim() ? [codexCredentialsPath(home, env)] : [
|
|
448
|
+
codexCredentialsPath(home, env),
|
|
449
|
+
...windowsHome ? [codexCredentialsPath(windowsHome, {})] : []
|
|
450
|
+
];
|
|
451
|
+
return [...new Set(paths)].flatMap((path) => {
|
|
452
|
+
const credential = readCodexCredentialFile(path);
|
|
453
|
+
return credential ? [{ path, credential }] : [];
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
__name(readCodexFileCredentialCandidates, "readCodexFileCredentialCandidates");
|
|
457
|
+
function readCodexCredentialFile(path) {
|
|
458
|
+
const root = record(readCredentialJson(path));
|
|
459
|
+
const tokens = record(root?.tokens);
|
|
460
|
+
const accessToken = optionalString(tokens?.access_token);
|
|
461
|
+
if (!accessToken) return null;
|
|
462
|
+
const accessClaims = jwtClaims(accessToken);
|
|
463
|
+
const idToken = optionalString(tokens?.id_token);
|
|
464
|
+
const idClaims = idToken ? jwtClaims(idToken) : {};
|
|
465
|
+
const accountId = optionalString(tokens?.account_id) ?? accessClaims.accountId ?? idClaims.accountId;
|
|
466
|
+
if (!accountId) return null;
|
|
467
|
+
return codexCredentialFromTokens({
|
|
468
|
+
accessToken,
|
|
469
|
+
...optionalString(tokens?.refresh_token) ? { refreshToken: optionalString(tokens?.refresh_token) } : {},
|
|
470
|
+
accountId
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
__name(readCodexCredentialFile, "readCodexCredentialFile");
|
|
474
|
+
function preferFresherCredential(left, right, now = Date.now()) {
|
|
475
|
+
if (!left) return right;
|
|
476
|
+
if (!right) return left;
|
|
477
|
+
const leftExpiry = left.expiresAt ?? Number.POSITIVE_INFINITY;
|
|
478
|
+
const rightExpiry = right.expiresAt ?? Number.POSITIVE_INFINITY;
|
|
479
|
+
const leftFresh = leftExpiry > now + 6e4;
|
|
480
|
+
const rightFresh = rightExpiry > now + 6e4;
|
|
481
|
+
if (leftFresh !== rightFresh) return leftFresh ? left : right;
|
|
482
|
+
return leftExpiry >= rightExpiry ? left : right;
|
|
483
|
+
}
|
|
484
|
+
__name(preferFresherCredential, "preferFresherCredential");
|
|
485
|
+
|
|
486
|
+
// src/integrations/providers/gemini-credentials.ts
|
|
487
|
+
import { constants, closeSync as closeSync2, fstatSync, openSync as openSync2, readSync } from "node:fs";
|
|
488
|
+
import { homedir as homedir2 } from "node:os";
|
|
489
|
+
import { join as join2 } from "node:path";
|
|
490
|
+
var REFRESH_URL = "https://oauth2.googleapis.com/token";
|
|
491
|
+
var MAX_BYTES = 1024 * 1024;
|
|
492
|
+
function readGeminiCredentialFile(path) {
|
|
493
|
+
let fd;
|
|
494
|
+
try {
|
|
495
|
+
fd = openSync2(path, constants.O_RDONLY | constants.O_NONBLOCK);
|
|
496
|
+
const stat = fstatSync(fd);
|
|
497
|
+
if (!stat.isFile() || stat.size > MAX_BYTES) return null;
|
|
498
|
+
const buffer = Buffer.alloc(MAX_BYTES + 1);
|
|
499
|
+
let size = 0;
|
|
500
|
+
while (size < buffer.length) {
|
|
501
|
+
const count = readSync(fd, buffer, size, buffer.length - size, null);
|
|
502
|
+
if (count === 0) break;
|
|
503
|
+
size += count;
|
|
504
|
+
}
|
|
505
|
+
if (size > MAX_BYTES) return null;
|
|
506
|
+
const value = JSON.parse(buffer.subarray(0, size).toString("utf8"));
|
|
507
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
508
|
+
const record2 = value;
|
|
509
|
+
if (typeof record2.access_token !== "string" || !record2.access_token.trim()) return null;
|
|
510
|
+
if (record2.expiry_date !== void 0 && (typeof record2.expiry_date !== "number" || !Number.isFinite(record2.expiry_date) || record2.expiry_date <= 0))
|
|
511
|
+
return null;
|
|
512
|
+
return {
|
|
513
|
+
accessToken: record2.access_token,
|
|
514
|
+
...typeof record2.refresh_token === "string" && record2.refresh_token.trim() ? { refreshToken: record2.refresh_token } : {},
|
|
515
|
+
...typeof record2.expiry_date === "number" ? { expiresAt: record2.expiry_date } : {}
|
|
516
|
+
};
|
|
517
|
+
} catch {
|
|
518
|
+
return null;
|
|
519
|
+
} finally {
|
|
520
|
+
if (fd !== void 0) closeSync2(fd);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
__name(readGeminiCredentialFile, "readGeminiCredentialFile");
|
|
524
|
+
function readGeminiFileCredentialCandidates(home, env = process.env, windowsHome = home === void 0 ? wslWindowsHome(env) : null) {
|
|
525
|
+
const paths = env.GEMINI_CLI_HOME ? [join2(env.GEMINI_CLI_HOME, ".gemini", "oauth_creds.json")] : [
|
|
526
|
+
join2(home ?? homedir2(), ".gemini", "oauth_creds.json"),
|
|
527
|
+
...windowsHome ? [join2(windowsHome, ".gemini", "oauth_creds.json")] : []
|
|
528
|
+
];
|
|
529
|
+
return [...new Set(paths)].flatMap((path) => {
|
|
530
|
+
const credential = readGeminiCredentialFile(path);
|
|
531
|
+
return credential && (credential.expiresAt === void 0 || credential.expiresAt > Date.now() + 6e4 || credential.refreshToken) ? [{ path, credential }] : [];
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
__name(readGeminiFileCredentialCandidates, "readGeminiFileCredentialCandidates");
|
|
535
|
+
function createGeminiAccessTokenResolver(path, fetchFn = globalThis.fetch, env = process.env) {
|
|
536
|
+
let source;
|
|
537
|
+
let cached;
|
|
538
|
+
let pending;
|
|
539
|
+
return async (signal) => {
|
|
540
|
+
signal?.throwIfAborted();
|
|
541
|
+
const owner = readGeminiCredentialFile(path);
|
|
542
|
+
if (!owner)
|
|
543
|
+
throw new Error("Gemini CLI sign-in is no longer available. Sign in with Gemini CLI again.");
|
|
544
|
+
const fingerprint = JSON.stringify(owner);
|
|
545
|
+
if (source !== fingerprint) {
|
|
546
|
+
source = fingerprint;
|
|
547
|
+
cached = owner;
|
|
548
|
+
pending = void 0;
|
|
549
|
+
}
|
|
550
|
+
const current = cached ?? owner;
|
|
551
|
+
if (current.expiresAt === void 0 || current.expiresAt > Date.now() + 6e4)
|
|
552
|
+
return current.accessToken;
|
|
553
|
+
if (!current.refreshToken)
|
|
554
|
+
throw new Error("Gemini CLI sign-in has expired. Sign in with Gemini CLI again.");
|
|
555
|
+
const clientId = env.GOOGLE_OAUTH_CLIENT_ID?.trim();
|
|
556
|
+
const clientSecret = env.GOOGLE_OAUTH_CLIENT_SECRET?.trim();
|
|
557
|
+
if (!clientId || !clientSecret)
|
|
558
|
+
throw new Error(
|
|
559
|
+
"Gemini CLI sign-in has expired. Refresh it in Gemini CLI, or configure the matching GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET."
|
|
560
|
+
);
|
|
561
|
+
if (!pending) {
|
|
562
|
+
const refresh = current.refreshToken;
|
|
563
|
+
const operation = (async () => {
|
|
564
|
+
const response = await fetchFn(REFRESH_URL, {
|
|
565
|
+
method: "POST",
|
|
566
|
+
redirect: "error",
|
|
567
|
+
signal: AbortSignal.timeout(15e3),
|
|
568
|
+
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
569
|
+
body: new URLSearchParams({
|
|
570
|
+
client_id: clientId,
|
|
571
|
+
client_secret: clientSecret,
|
|
572
|
+
refresh_token: refresh,
|
|
573
|
+
grant_type: "refresh_token"
|
|
574
|
+
})
|
|
575
|
+
});
|
|
576
|
+
if (!response.ok)
|
|
577
|
+
throw new Error(
|
|
578
|
+
`Gemini CLI sign-in could not be refreshed (HTTP ${response.status}). Sign in with Gemini CLI again.`
|
|
579
|
+
);
|
|
580
|
+
const value = await response.json();
|
|
581
|
+
if (typeof value.access_token !== "string" || !value.access_token || typeof value.expires_in !== "number" || !Number.isFinite(value.expires_in) || value.expires_in <= 0)
|
|
582
|
+
throw new Error("Google returned an invalid sign-in refresh response.");
|
|
583
|
+
if (source === fingerprint)
|
|
584
|
+
cached = {
|
|
585
|
+
accessToken: value.access_token,
|
|
586
|
+
refreshToken: typeof value.refresh_token === "string" ? value.refresh_token : refresh,
|
|
587
|
+
expiresAt: Date.now() + value.expires_in * 1e3
|
|
588
|
+
};
|
|
589
|
+
return value.access_token;
|
|
590
|
+
})();
|
|
591
|
+
pending = operation;
|
|
592
|
+
void operation.finally(() => {
|
|
593
|
+
if (pending === operation) pending = void 0;
|
|
594
|
+
}).catch(() => {
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
if (!signal) return pending;
|
|
598
|
+
signal.throwIfAborted();
|
|
599
|
+
return new Promise((resolve2, reject) => {
|
|
600
|
+
const abort = /* @__PURE__ */ __name(() => reject(signal.reason), "abort");
|
|
601
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
602
|
+
pending?.then(resolve2, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
603
|
+
});
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
__name(createGeminiAccessTokenResolver, "createGeminiAccessTokenResolver");
|
|
607
|
+
|
|
608
|
+
// src/integrations/providers/keychain.ts
|
|
609
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
610
|
+
import { platform } from "node:os";
|
|
611
|
+
var KEYCHAIN_SERVICE = "Claude Code-credentials";
|
|
612
|
+
function readAgentKeychainCredential() {
|
|
613
|
+
if (platform() !== "darwin") return null;
|
|
614
|
+
let raw;
|
|
615
|
+
try {
|
|
616
|
+
raw = execFileSync2("security", ["find-generic-password", "-s", KEYCHAIN_SERVICE, "-w"], {
|
|
617
|
+
encoding: "utf8",
|
|
618
|
+
timeout: 5e3,
|
|
619
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
620
|
+
}).trim();
|
|
621
|
+
} catch {
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
624
|
+
if (raw.length === 0) return null;
|
|
625
|
+
let parsed;
|
|
626
|
+
try {
|
|
627
|
+
parsed = JSON.parse(raw);
|
|
628
|
+
} catch {
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
if (typeof parsed !== "object" || parsed === null) return null;
|
|
632
|
+
const env = parsed.claudeAiOauth;
|
|
633
|
+
if (typeof env !== "object" || env === null) return null;
|
|
634
|
+
const oauth = env;
|
|
635
|
+
const accessToken = oauth.accessToken;
|
|
636
|
+
if (typeof accessToken !== "string" || accessToken.length === 0) return null;
|
|
637
|
+
return {
|
|
638
|
+
accessToken,
|
|
639
|
+
refreshToken: typeof oauth.refreshToken === "string" ? oauth.refreshToken : void 0,
|
|
640
|
+
expiresAt: typeof oauth.expiresAt === "number" ? oauth.expiresAt : void 0,
|
|
641
|
+
scopes: Array.isArray(oauth.scopes) ? oauth.scopes.filter((s) => typeof s === "string") : void 0
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
__name(readAgentKeychainCredential, "readAgentKeychainCredential");
|
|
645
|
+
function isAnthropicOAuthToken(value) {
|
|
646
|
+
if (value.startsWith("sk-ant-api")) return false;
|
|
647
|
+
if (value.startsWith("sk-ant-oat")) return true;
|
|
648
|
+
if (value.startsWith("eyJ")) return true;
|
|
649
|
+
if (value.startsWith("cc-")) return true;
|
|
650
|
+
return false;
|
|
651
|
+
}
|
|
652
|
+
__name(isAnthropicOAuthToken, "isAnthropicOAuthToken");
|
|
653
|
+
|
|
654
|
+
// src/integrations/providers/discover.ts
|
|
655
|
+
function signedInSubscriptionProviders(detected) {
|
|
656
|
+
return detected.filter((provider) => {
|
|
657
|
+
if (provider.entry.id === "google") return provider.source.kind === "gemini-file";
|
|
658
|
+
if (provider.entry.subscriptionLogin === void 0) return false;
|
|
659
|
+
return [provider.source, ...provider.alternatives].some(
|
|
660
|
+
(source) => source.kind === "claude-file" || source.kind === "codex-file" || source.kind === "keychain" || source.kind === "stored" || source.kind === "env" && source.envName === "CLAUDE_CODE_OAUTH_TOKEN"
|
|
661
|
+
);
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
__name(signedInSubscriptionProviders, "signedInSubscriptionProviders");
|
|
665
|
+
var DEFAULT_PROBE_TIMEOUT_MS = 300;
|
|
666
|
+
async function discoverProviders(opts = {}) {
|
|
667
|
+
const env = opts.env ?? process.env;
|
|
668
|
+
const credentials = new EnvCredentialProvider({ env, anyKey: true });
|
|
669
|
+
const detected = [];
|
|
670
|
+
const geminiCredentials = readGeminiFileCredentialCandidates(opts.home, env, opts.windowsHome);
|
|
671
|
+
const storedCredential = opts.skipStored ? null : readStoredSubscriptionCredential(...opts.home === void 0 ? [] : [opts.home]);
|
|
672
|
+
const storedCodexCredential = opts.skipStored ? null : readStoredCodexCredential(...opts.home === void 0 ? [] : [opts.home]);
|
|
673
|
+
const storedGeminiApiKey = opts.skipStored ? null : readStoredGeminiApiKey(...opts.home === void 0 ? [] : [opts.home]);
|
|
674
|
+
const keychainCredential = opts.skipKeychain || env.CLAUDE_CONFIG_DIR ? null : readAgentKeychainCredential();
|
|
675
|
+
const claudeFileCredentials = readClaudeFileCredentialCandidates(opts.home, env, opts.windowsHome);
|
|
676
|
+
const openCodeCredentials = readOpenCodeApiCredentialCandidates(opts.home, env, opts.windowsHome);
|
|
677
|
+
const codexFileCredentials = readCodexFileCredentialCandidates(
|
|
678
|
+
opts.home,
|
|
679
|
+
env,
|
|
680
|
+
opts.windowsHome
|
|
681
|
+
).filter(
|
|
682
|
+
(candidate) => candidate.credential.expiresAt === void 0 || candidate.credential.expiresAt - Date.now() > 6e4
|
|
683
|
+
);
|
|
684
|
+
const usableCodexFileCredential = codexFileCredentials.reduce((current, candidate) => {
|
|
685
|
+
if (!current) return candidate;
|
|
686
|
+
return preferFresherCredential(current.credential, candidate.credential) === candidate.credential ? candidate : current;
|
|
687
|
+
}, null);
|
|
688
|
+
const probes = /* @__PURE__ */ new Map();
|
|
689
|
+
if (!opts.skipProbes) {
|
|
690
|
+
for (const probed of Object.values(PROVIDER_REGISTRY)) {
|
|
691
|
+
if (probed.probeUrl) probes.set(probed.id, probe(probed.probeUrl, opts));
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
for (const id of Object.keys(PROVIDER_REGISTRY)) {
|
|
695
|
+
const entry = PROVIDER_REGISTRY[id];
|
|
696
|
+
const sources = [];
|
|
697
|
+
let apiKey;
|
|
698
|
+
let anonymousSelected = false;
|
|
699
|
+
let oauth;
|
|
700
|
+
let codex;
|
|
701
|
+
let gemini;
|
|
702
|
+
if (id === "anthropic") {
|
|
703
|
+
const borrowedCandidates = [
|
|
704
|
+
...claudeFileCredentials.map(({ credential, path }) => ({
|
|
705
|
+
credential,
|
|
706
|
+
source: { kind: "claude-file", path }
|
|
707
|
+
})),
|
|
708
|
+
...keychainCredential ? [
|
|
709
|
+
{
|
|
710
|
+
credential: keychainCredential,
|
|
711
|
+
source: {
|
|
712
|
+
kind: "keychain",
|
|
713
|
+
service: KEYCHAIN_SERVICE
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
] : []
|
|
717
|
+
].filter(
|
|
718
|
+
(candidate) => candidate.credential.expiresAt === void 0 || candidate.credential.expiresAt - Date.now() > 6e4 || candidate.source.kind === "claude-file" && candidate.credential.refreshToken !== void 0
|
|
719
|
+
);
|
|
720
|
+
const borrowed = borrowedCandidates.reduce(
|
|
721
|
+
(current, candidate) => {
|
|
722
|
+
if (!current) return candidate;
|
|
723
|
+
return preferFresherCredential(current.credential, candidate.credential) === candidate.credential ? candidate : current;
|
|
724
|
+
},
|
|
725
|
+
null
|
|
726
|
+
);
|
|
727
|
+
if (borrowed) {
|
|
728
|
+
if (apiKey === void 0) {
|
|
729
|
+
apiKey = borrowed.credential.accessToken;
|
|
730
|
+
oauth = {
|
|
731
|
+
refreshToken: borrowed.credential.refreshToken,
|
|
732
|
+
expiresAt: borrowed.credential.expiresAt,
|
|
733
|
+
origin: borrowed.source.kind === "claude-file" ? "claude-file" : "keychain",
|
|
734
|
+
...borrowed.source.kind === "claude-file" ? { sourcePath: borrowed.source.path } : {}
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
sources.push(borrowed.source);
|
|
738
|
+
}
|
|
739
|
+
for (const candidate of borrowedCandidates) {
|
|
740
|
+
if (candidate !== borrowed) sources.push(candidate.source);
|
|
741
|
+
}
|
|
742
|
+
if (storedCredential) {
|
|
743
|
+
if (apiKey === void 0) {
|
|
744
|
+
apiKey = storedCredential.accessToken;
|
|
745
|
+
oauth = {
|
|
746
|
+
refreshToken: storedCredential.refreshToken,
|
|
747
|
+
expiresAt: storedCredential.expiresAt,
|
|
748
|
+
origin: "stored"
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
sources.push({
|
|
752
|
+
kind: "stored",
|
|
753
|
+
path: credentialsPath(...opts.home === void 0 ? [] : [opts.home])
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
if (id === "codex" && (storedCodexCredential || usableCodexFileCredential)) {
|
|
758
|
+
const credential = usableCodexFileCredential?.credential ?? storedCodexCredential;
|
|
759
|
+
if (!credential) throw new Error("unreachable");
|
|
760
|
+
apiKey = credential.accessToken;
|
|
761
|
+
sources.push({
|
|
762
|
+
kind: usableCodexFileCredential ? "codex-file" : "stored",
|
|
763
|
+
path: usableCodexFileCredential ? usableCodexFileCredential.path : credentialsPath(...opts.home === void 0 ? [] : [opts.home])
|
|
764
|
+
});
|
|
765
|
+
codex = {
|
|
766
|
+
accountId: credential.accountId,
|
|
767
|
+
expiresAt: credential.expiresAt,
|
|
768
|
+
origin: usableCodexFileCredential ? "codex-file" : "stored"
|
|
769
|
+
};
|
|
770
|
+
if (storedCodexCredential && usableCodexFileCredential) {
|
|
771
|
+
sources.push({
|
|
772
|
+
kind: "stored",
|
|
773
|
+
path: credentialsPath(...opts.home === void 0 ? [] : [opts.home])
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
for (const candidate of codexFileCredentials) {
|
|
777
|
+
if (candidate !== usableCodexFileCredential) {
|
|
778
|
+
sources.push({ kind: "codex-file", path: candidate.path });
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
for (const envName of entry.envVars) {
|
|
783
|
+
const resolved = await credentials.resolve(envName);
|
|
784
|
+
if (anonymousSelected) continue;
|
|
785
|
+
if ((id === "zen" || id === "zen-go") && resolved?.value.trim() === "public") {
|
|
786
|
+
if (sources.length === 0) {
|
|
787
|
+
anonymousSelected = true;
|
|
788
|
+
sources.push({ kind: "env", envName });
|
|
789
|
+
}
|
|
790
|
+
continue;
|
|
791
|
+
}
|
|
792
|
+
if (resolved && hasApiCredential(entry, resolved.value)) {
|
|
793
|
+
if (apiKey === void 0) apiKey = resolved.value;
|
|
794
|
+
sources.push({ kind: "env", envName });
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
if (!opts.skipStored && id !== "google" && entry.acceptsTypedCredential) {
|
|
798
|
+
const saved = readStoredApiKey(id, opts.home);
|
|
799
|
+
if (saved && hasApiCredential(entry, saved)) {
|
|
800
|
+
if (apiKey === void 0) apiKey = saved;
|
|
801
|
+
sources.push({ kind: "stored-api-key", path: apiKeysPath(opts.home) });
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
if (id === "google") {
|
|
805
|
+
if (storedGeminiApiKey && hasApiCredential(entry, storedGeminiApiKey)) {
|
|
806
|
+
if (apiKey === void 0) apiKey = storedGeminiApiKey;
|
|
807
|
+
sources.push({
|
|
808
|
+
kind: "stored-gemini-key",
|
|
809
|
+
path: googleApiKeyPath(...opts.home === void 0 ? [] : [opts.home])
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
const borrowed = geminiCredentials[0];
|
|
813
|
+
if (borrowed) {
|
|
814
|
+
if (apiKey === void 0) {
|
|
815
|
+
apiKey = borrowed.credential.accessToken;
|
|
816
|
+
const projectId = env.GOOGLE_CLOUD_PROJECT?.trim() || env.GOOGLE_CLOUD_PROJECT_ID?.trim();
|
|
817
|
+
gemini = {
|
|
818
|
+
sourcePath: borrowed.path,
|
|
819
|
+
...projectId ? { projectId } : {}
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
sources.push({ kind: "gemini-file", path: borrowed.path });
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (id === "zen" || id === "zen-go") {
|
|
826
|
+
for (const candidate of openCodeCredentials) {
|
|
827
|
+
if (anonymousSelected) break;
|
|
828
|
+
if (candidate.provider !== id) continue;
|
|
829
|
+
if (apiKey === void 0) apiKey = candidate.apiKey;
|
|
830
|
+
sources.push(candidate.source);
|
|
831
|
+
}
|
|
832
|
+
if (id === "zen" && sources.length === 0) sources.push({ kind: "public" });
|
|
833
|
+
}
|
|
834
|
+
if (id === "zen-go" && anonymousSelected) continue;
|
|
835
|
+
if (sources.length === 0 && entry.probeUrl && probes.has(id)) {
|
|
836
|
+
const reachable = await probes.get(id);
|
|
837
|
+
if (reachable) {
|
|
838
|
+
sources.push({ kind: "probe", url: entry.probeUrl });
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
if (sources.length > 0) {
|
|
842
|
+
detected.push({
|
|
843
|
+
entry,
|
|
844
|
+
source: sources[0],
|
|
845
|
+
apiKey,
|
|
846
|
+
baseUrl: entry.defaultBaseUrl,
|
|
847
|
+
...oauth ? { oauth } : {},
|
|
848
|
+
...codex ? { codex } : {},
|
|
849
|
+
...gemini ? { gemini } : {},
|
|
850
|
+
alternatives: sources.slice(1)
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
return detected.sort((left, right) => automaticRank(left) - automaticRank(right));
|
|
855
|
+
}
|
|
856
|
+
__name(discoverProviders, "discoverProviders");
|
|
857
|
+
function isAnonymousZen(provider) {
|
|
858
|
+
return provider.entry.id === "zen" && !hasApiCredential(provider.entry, provider.apiKey);
|
|
859
|
+
}
|
|
860
|
+
__name(isAnonymousZen, "isAnonymousZen");
|
|
861
|
+
var AUTOMATIC_ORDER = ["sign-in", "key", "local", "free"];
|
|
862
|
+
function automaticKind(provider) {
|
|
863
|
+
if (isAnonymousZen(provider)) return "free";
|
|
864
|
+
if (signedInSubscriptionProviders([provider]).length > 0) return "sign-in";
|
|
865
|
+
if (provider.source?.kind === "probe") return "local";
|
|
866
|
+
return "key";
|
|
867
|
+
}
|
|
868
|
+
__name(automaticKind, "automaticKind");
|
|
869
|
+
function automaticRank(provider) {
|
|
870
|
+
return AUTOMATIC_ORDER.indexOf(automaticKind(provider));
|
|
871
|
+
}
|
|
872
|
+
__name(automaticRank, "automaticRank");
|
|
873
|
+
function automaticChoice(detected) {
|
|
874
|
+
const ranked = [...detected].sort((left, right) => automaticRank(left) - automaticRank(right));
|
|
875
|
+
const provider = ranked[0];
|
|
876
|
+
return provider ? { provider, kind: automaticKind(provider) } : null;
|
|
877
|
+
}
|
|
878
|
+
__name(automaticChoice, "automaticChoice");
|
|
879
|
+
function describeAutomaticChoice(choice) {
|
|
880
|
+
const { provider, kind } = choice;
|
|
881
|
+
const product = provider.entry.label.replace(/\s*\(.*\)\s*$/, "").trim() || provider.entry.label;
|
|
882
|
+
switch (kind) {
|
|
883
|
+
case "sign-in": {
|
|
884
|
+
const account = provider.entry.id === "anthropic" ? "Claude" : provider.entry.id === "codex" ? "ChatGPT or Codex" : product;
|
|
885
|
+
return `Using your ${account} sign-in, found on this computer.`;
|
|
886
|
+
}
|
|
887
|
+
case "key":
|
|
888
|
+
return `Using your ${product} key, found on this computer.`;
|
|
889
|
+
case "local":
|
|
890
|
+
return `Using ${product} running on this computer.`;
|
|
891
|
+
case "free":
|
|
892
|
+
return "Using Zen's free models (experimental).";
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
__name(describeAutomaticChoice, "describeAutomaticChoice");
|
|
896
|
+
async function probe(url, opts) {
|
|
897
|
+
const fetchFn = opts.fetch ?? globalThis.fetch;
|
|
898
|
+
const controller = new AbortController();
|
|
899
|
+
const timer = setTimeout(
|
|
900
|
+
() => controller.abort(),
|
|
901
|
+
opts.probeTimeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS
|
|
902
|
+
);
|
|
903
|
+
try {
|
|
904
|
+
const res = await fetchFn(url, {
|
|
905
|
+
method: "GET",
|
|
906
|
+
signal: controller.signal
|
|
907
|
+
});
|
|
908
|
+
return res.ok;
|
|
909
|
+
} catch {
|
|
910
|
+
return false;
|
|
911
|
+
} finally {
|
|
912
|
+
clearTimeout(timer);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
__name(probe, "probe");
|
|
916
|
+
function findDetected(list, id) {
|
|
917
|
+
return list.find((d) => d.entry.id === id) ?? null;
|
|
918
|
+
}
|
|
919
|
+
__name(findDetected, "findDetected");
|
|
920
|
+
|
|
921
|
+
// src/integrations/providers/preferences.ts
|
|
922
|
+
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
923
|
+
import { chmodSync, mkdirSync, readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
924
|
+
import { dirname as dirname2, join as join3 } from "node:path";
|
|
925
|
+
var FILE_MODE = 384;
|
|
926
|
+
var DIR_MODE = 448;
|
|
927
|
+
var PREFERENCES_FILE_VERSION = 3;
|
|
928
|
+
function chainPositionName(index) {
|
|
929
|
+
return index === 0 ? "primary provider" : `fallback #${index}`;
|
|
930
|
+
}
|
|
931
|
+
__name(chainPositionName, "chainPositionName");
|
|
932
|
+
var PreferencesError = class extends Error {
|
|
933
|
+
static {
|
|
934
|
+
__name(this, "PreferencesError");
|
|
935
|
+
}
|
|
936
|
+
constructor(message) {
|
|
937
|
+
super(message);
|
|
938
|
+
this.name = "PreferencesError";
|
|
939
|
+
}
|
|
940
|
+
};
|
|
941
|
+
function primaryProvider(prefs) {
|
|
942
|
+
const first = prefs.providers?.[0];
|
|
943
|
+
if (!first) {
|
|
944
|
+
throw new PreferencesError("preferences.providers is empty \u2014 no provider to run");
|
|
945
|
+
}
|
|
946
|
+
return first;
|
|
947
|
+
}
|
|
948
|
+
__name(primaryProvider, "primaryProvider");
|
|
949
|
+
function preferencesPath(home) {
|
|
950
|
+
return join3(namzuHomePath(home), "preferences.json");
|
|
951
|
+
}
|
|
952
|
+
__name(preferencesPath, "preferencesPath");
|
|
953
|
+
function readPreferences(home) {
|
|
954
|
+
const path = preferencesPath(home);
|
|
955
|
+
let raw;
|
|
956
|
+
try {
|
|
957
|
+
raw = readFileSync3(path, "utf8");
|
|
958
|
+
} catch (err) {
|
|
959
|
+
if (err.code === "ENOENT") return { status: "missing" };
|
|
960
|
+
throw new PreferencesError(
|
|
961
|
+
`could not read ${path}: ${err instanceof Error ? err.message : String(err)}`
|
|
962
|
+
);
|
|
963
|
+
}
|
|
964
|
+
let parsed;
|
|
965
|
+
try {
|
|
966
|
+
parsed = JSON.parse(raw);
|
|
967
|
+
} catch (err) {
|
|
968
|
+
throw new PreferencesError(
|
|
969
|
+
`${path} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`
|
|
970
|
+
);
|
|
971
|
+
}
|
|
972
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
973
|
+
throw new PreferencesError(`${path} top-level must be an object`);
|
|
974
|
+
}
|
|
975
|
+
const v = parsed;
|
|
976
|
+
if (v.version === 1) {
|
|
977
|
+
return {
|
|
978
|
+
status: "needs-repick",
|
|
979
|
+
reason: "preferences file uses an older schema (v1) \u2014 namzu now picks an LLM provider client directly. Please re-pick."
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
if (v.version === 2) {
|
|
983
|
+
const migrated = migrateV2(parsed);
|
|
984
|
+
if (!migrated) {
|
|
985
|
+
throw new PreferencesError(`${path} has an unexpected shape for a v2 file`);
|
|
986
|
+
}
|
|
987
|
+
const invalid2 = describeInvalidChain(migrated.providers);
|
|
988
|
+
if (invalid2) return { status: "needs-repick", reason: `${invalid2} \u2014 please re-pick.` };
|
|
989
|
+
return { status: "ok", prefs: migrated };
|
|
990
|
+
}
|
|
991
|
+
if (v.version !== PREFERENCES_FILE_VERSION) {
|
|
992
|
+
return {
|
|
993
|
+
status: "needs-repick",
|
|
994
|
+
reason: `preferences file at unsupported version ${String(v.version)} \u2014 please re-pick.`
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
if (!isPreferences(parsed)) {
|
|
998
|
+
throw new PreferencesError(`${path} has an unexpected shape`);
|
|
999
|
+
}
|
|
1000
|
+
const invalid = describeInvalidChain(parsed.providers);
|
|
1001
|
+
if (invalid) return { status: "needs-repick", reason: `${invalid} \u2014 please re-pick.` };
|
|
1002
|
+
return { status: "ok", prefs: parsed };
|
|
1003
|
+
}
|
|
1004
|
+
__name(readPreferences, "readPreferences");
|
|
1005
|
+
function writePreferences(prefs, home) {
|
|
1006
|
+
if (prefs.version !== PREFERENCES_FILE_VERSION) {
|
|
1007
|
+
throw new PreferencesError(
|
|
1008
|
+
`unsupported preferences version: ${String(prefs.version)} (expected ${PREFERENCES_FILE_VERSION})`
|
|
1009
|
+
);
|
|
1010
|
+
}
|
|
1011
|
+
if (!Array.isArray(prefs.providers) || prefs.providers.length === 0) {
|
|
1012
|
+
throw new PreferencesError("preferences.providers must list at least one provider");
|
|
1013
|
+
}
|
|
1014
|
+
const invalid = describeInvalidChain(prefs.providers);
|
|
1015
|
+
if (invalid) throw new PreferencesError(invalid);
|
|
1016
|
+
const path = preferencesPath(home);
|
|
1017
|
+
mkdirSync(dirname2(path), { recursive: true, mode: DIR_MODE });
|
|
1018
|
+
const body = `${JSON.stringify(prefs, null, 2)}
|
|
1019
|
+
`;
|
|
1020
|
+
const tmp = `${path}.tmp.${process.pid}.${randomBytes2(4).toString("hex")}`;
|
|
1021
|
+
writeFileSync2(tmp, body, { mode: FILE_MODE });
|
|
1022
|
+
chmodSync(tmp, FILE_MODE);
|
|
1023
|
+
renameSync2(tmp, path);
|
|
1024
|
+
}
|
|
1025
|
+
__name(writePreferences, "writePreferences");
|
|
1026
|
+
function migrateV2(value) {
|
|
1027
|
+
const v = value;
|
|
1028
|
+
if (typeof v.provider !== "string" || v.provider.length === 0) return null;
|
|
1029
|
+
if (v.model !== void 0 && typeof v.model !== "string") return null;
|
|
1030
|
+
if (!isSubagents(v.subagents)) return null;
|
|
1031
|
+
const member = {
|
|
1032
|
+
id: v.provider,
|
|
1033
|
+
...typeof v.model === "string" ? { model: v.model } : {}
|
|
1034
|
+
};
|
|
1035
|
+
return {
|
|
1036
|
+
version: PREFERENCES_FILE_VERSION,
|
|
1037
|
+
providers: [member],
|
|
1038
|
+
...v.subagents !== void 0 ? { subagents: v.subagents } : {}
|
|
1039
|
+
};
|
|
1040
|
+
}
|
|
1041
|
+
__name(migrateV2, "migrateV2");
|
|
1042
|
+
function describeInvalidChain(members) {
|
|
1043
|
+
if (members.length === 0) {
|
|
1044
|
+
return "preferences lists no providers";
|
|
1045
|
+
}
|
|
1046
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1047
|
+
for (const [index, member] of members.entries()) {
|
|
1048
|
+
const position = chainPositionName(index);
|
|
1049
|
+
if (!(member.id in PROVIDER_REGISTRY)) {
|
|
1050
|
+
return `${position} "${member.id}" is not a provider namzu knows (known: ${Object.keys(PROVIDER_REGISTRY).join(", ")})`;
|
|
1051
|
+
}
|
|
1052
|
+
if (index === 0 && !PROVIDER_REGISTRY[member.id].constructible) {
|
|
1053
|
+
return unsupportedProviderMessage(member.id);
|
|
1054
|
+
}
|
|
1055
|
+
const key = JSON.stringify([member.id, member.model ?? null]);
|
|
1056
|
+
if (seen.has(key)) {
|
|
1057
|
+
const shown = member.model ? `${member.id} (${member.model})` : member.id;
|
|
1058
|
+
return `${position} repeats "${shown}", which is already earlier in the chain \u2014 a provider cannot be its own fallback`;
|
|
1059
|
+
}
|
|
1060
|
+
seen.add(key);
|
|
1061
|
+
}
|
|
1062
|
+
return null;
|
|
1063
|
+
}
|
|
1064
|
+
__name(describeInvalidChain, "describeInvalidChain");
|
|
1065
|
+
function isSubagents(value) {
|
|
1066
|
+
if (value === void 0) return true;
|
|
1067
|
+
if (typeof value !== "object" || value === null) return false;
|
|
1068
|
+
const sa = value;
|
|
1069
|
+
if (!Array.isArray(sa.active)) return false;
|
|
1070
|
+
for (const item of sa.active) {
|
|
1071
|
+
if (typeof item !== "string") return false;
|
|
1072
|
+
}
|
|
1073
|
+
return true;
|
|
1074
|
+
}
|
|
1075
|
+
__name(isSubagents, "isSubagents");
|
|
1076
|
+
function isProviderChoice(value) {
|
|
1077
|
+
if (typeof value !== "object" || value === null) return false;
|
|
1078
|
+
const v = value;
|
|
1079
|
+
if (typeof v.id !== "string" || v.id.length === 0) return false;
|
|
1080
|
+
if (v.model !== void 0 && typeof v.model !== "string") return false;
|
|
1081
|
+
return true;
|
|
1082
|
+
}
|
|
1083
|
+
__name(isProviderChoice, "isProviderChoice");
|
|
1084
|
+
function isPreferences(value) {
|
|
1085
|
+
if (typeof value !== "object" || value === null) return false;
|
|
1086
|
+
const v = value;
|
|
1087
|
+
if (v.version !== PREFERENCES_FILE_VERSION) return false;
|
|
1088
|
+
if (!Array.isArray(v.providers)) return false;
|
|
1089
|
+
for (const member of v.providers) {
|
|
1090
|
+
if (!isProviderChoice(member)) return false;
|
|
1091
|
+
}
|
|
1092
|
+
if (v.allowCapabilityMismatch !== void 0 && typeof v.allowCapabilityMismatch !== "boolean") {
|
|
1093
|
+
return false;
|
|
1094
|
+
}
|
|
1095
|
+
if (!isSubagents(v.subagents)) return false;
|
|
1096
|
+
return true;
|
|
1097
|
+
}
|
|
1098
|
+
__name(isPreferences, "isPreferences");
|
|
1099
|
+
|
|
1100
|
+
// src/integrations/providers/chain-capabilities.ts
|
|
1101
|
+
var BOOLEAN_CAPABILITIES = [
|
|
1102
|
+
{
|
|
1103
|
+
key: "supportsTools",
|
|
1104
|
+
has: "it can call tools",
|
|
1105
|
+
lacks: "it cannot call tools",
|
|
1106
|
+
consequence: "tools become unavailable"
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
key: "supportsFunctionCalling",
|
|
1110
|
+
has: "it supports function calling",
|
|
1111
|
+
lacks: "it does not support function calling",
|
|
1112
|
+
consequence: "function calling becomes unavailable"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
key: "supportsStreaming",
|
|
1116
|
+
has: "it can stream replies",
|
|
1117
|
+
lacks: "it cannot stream replies",
|
|
1118
|
+
consequence: "replies stop streaming"
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
key: "supportsVision",
|
|
1122
|
+
has: "it can read image attachments",
|
|
1123
|
+
lacks: "it cannot read image attachments",
|
|
1124
|
+
consequence: "image attachments stop being sent"
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
key: "supportsDocuments",
|
|
1128
|
+
has: "it can read document attachments",
|
|
1129
|
+
lacks: "it cannot read document attachments",
|
|
1130
|
+
consequence: "document attachments stop being sent"
|
|
1131
|
+
}
|
|
1132
|
+
];
|
|
1133
|
+
function describe(index, member) {
|
|
1134
|
+
const entry = PROVIDER_REGISTRY[member.id];
|
|
1135
|
+
return `${chainPositionName(index)} (${entry ? entry.label : member.id})`;
|
|
1136
|
+
}
|
|
1137
|
+
__name(describe, "describe");
|
|
1138
|
+
function chainCapabilityDisagreements(members, resolved) {
|
|
1139
|
+
const out = [];
|
|
1140
|
+
for (const capability of BOOLEAN_CAPABILITIES) {
|
|
1141
|
+
const firstWithIt = resolved.findIndex(
|
|
1142
|
+
(entry) => entry.kind === "known" && entry.capabilities[capability.key] === true
|
|
1143
|
+
);
|
|
1144
|
+
if (firstWithIt === -1) continue;
|
|
1145
|
+
const has = members[firstWithIt];
|
|
1146
|
+
if (!has) continue;
|
|
1147
|
+
for (const [index, entry] of resolved.entries()) {
|
|
1148
|
+
if (entry.kind !== "known" || index === firstWithIt) continue;
|
|
1149
|
+
if (entry.capabilities[capability.key] === true) continue;
|
|
1150
|
+
const lacks = members[index];
|
|
1151
|
+
if (!lacks) continue;
|
|
1152
|
+
out.push({
|
|
1153
|
+
declaredBy: firstWithIt,
|
|
1154
|
+
missingFrom: index,
|
|
1155
|
+
sentence: `${describe(index, lacks)} declares ${capability.lacks}, while ${describe(firstWithIt, has)} declares ${capability.has} \u2014 if the chain falls over to it, ${capability.consequence}.`
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
out.push(...ceilingDisagreements(members, resolved));
|
|
1160
|
+
return out;
|
|
1161
|
+
}
|
|
1162
|
+
__name(chainCapabilityDisagreements, "chainCapabilityDisagreements");
|
|
1163
|
+
function ceilingDisagreements(members, resolved) {
|
|
1164
|
+
const ceilings = [];
|
|
1165
|
+
for (const [index, entry] of resolved.entries()) {
|
|
1166
|
+
if (entry.kind !== "known") continue;
|
|
1167
|
+
const value = entry.capabilities.maxOutputTokens;
|
|
1168
|
+
if (typeof value === "number") ceilings.push({ index, value });
|
|
1169
|
+
}
|
|
1170
|
+
let largest;
|
|
1171
|
+
for (const ceiling of ceilings) {
|
|
1172
|
+
if (!largest || ceiling.value > largest.value) largest = ceiling;
|
|
1173
|
+
}
|
|
1174
|
+
if (!largest) return [];
|
|
1175
|
+
const out = [];
|
|
1176
|
+
for (const ceiling of ceilings) {
|
|
1177
|
+
if (ceiling.value >= largest.value) continue;
|
|
1178
|
+
const has = members[largest.index];
|
|
1179
|
+
const lacks = members[ceiling.index];
|
|
1180
|
+
if (!has || !lacks) continue;
|
|
1181
|
+
out.push({
|
|
1182
|
+
declaredBy: largest.index,
|
|
1183
|
+
missingFrom: ceiling.index,
|
|
1184
|
+
sentence: `${describe(ceiling.index, lacks)} declares a maximum output of ${ceiling.value} tokens, below ${describe(largest.index, has)} at ${largest.value} \u2014 if the chain falls over to it, replies are capped at ${ceiling.value}.`
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
return out;
|
|
1188
|
+
}
|
|
1189
|
+
__name(ceilingDisagreements, "ceilingDisagreements");
|
|
1190
|
+
function unresolvedMembers(members, resolved) {
|
|
1191
|
+
const out = [];
|
|
1192
|
+
for (const [index, entry] of resolved.entries()) {
|
|
1193
|
+
const member = members[index];
|
|
1194
|
+
if (entry.kind !== "unresolved" || !member) continue;
|
|
1195
|
+
out.push(`${describe(index, member)}: ${entry.reason}`);
|
|
1196
|
+
}
|
|
1197
|
+
return out;
|
|
1198
|
+
}
|
|
1199
|
+
__name(unresolvedMembers, "unresolvedMembers");
|
|
1200
|
+
function describeCapabilityRefusal(disagreements) {
|
|
1201
|
+
if (disagreements.length === 0) return null;
|
|
1202
|
+
return [
|
|
1203
|
+
"The providers in your chain declare different capabilities, so namzu cannot honour the chain as written:",
|
|
1204
|
+
...disagreements.map((d) => ` - ${d.sentence}`),
|
|
1205
|
+
"",
|
|
1206
|
+
"Taking the strongest answer would advertise abilities a fallback does not have. Taking the weakest would cost your primary a capability on every turn, to guard against a failure that happens rarely. Neither is chosen for you.",
|
|
1207
|
+
'Either drop the member that disagrees, or set "allowCapabilityMismatch": true in ~/.namzu/preferences.json to accept the limitation \u2014 it is printed on every launch.'
|
|
1208
|
+
].join("\n");
|
|
1209
|
+
}
|
|
1210
|
+
__name(describeCapabilityRefusal, "describeCapabilityRefusal");
|
|
1211
|
+
function describeAcceptedMismatch(disagreements) {
|
|
1212
|
+
if (disagreements.length === 0) return null;
|
|
1213
|
+
return [
|
|
1214
|
+
"Provider chain: the members declare different capabilities, and you have accepted that.",
|
|
1215
|
+
...disagreements.map((d) => ` - ${d.sentence}`)
|
|
1216
|
+
].join("\n");
|
|
1217
|
+
}
|
|
1218
|
+
__name(describeAcceptedMismatch, "describeAcceptedMismatch");
|
|
1219
|
+
|
|
1220
|
+
// src/integrations/providers/register.ts
|
|
1221
|
+
var registered = /* @__PURE__ */ new Set();
|
|
1222
|
+
async function ensureRegistered(id) {
|
|
1223
|
+
if (registered.has(id)) return;
|
|
1224
|
+
switch (id) {
|
|
1225
|
+
case "anthropic": {
|
|
1226
|
+
const mod = await import("./dist-ERN5DRKK.js");
|
|
1227
|
+
mod.registerAnthropic();
|
|
1228
|
+
break;
|
|
1229
|
+
}
|
|
1230
|
+
case "google": {
|
|
1231
|
+
const mod = await import("./dist-BFC7XUCT.js");
|
|
1232
|
+
mod.registerGoogle();
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
case "openai": {
|
|
1236
|
+
const mod = await import("./dist-SKRHHPUR.js");
|
|
1237
|
+
mod.registerOpenAI();
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1240
|
+
case "codex": {
|
|
1241
|
+
const mod = await import("./dist-SKRHHPUR.js");
|
|
1242
|
+
mod.registerCodex();
|
|
1243
|
+
break;
|
|
1244
|
+
}
|
|
1245
|
+
case "deepseek": {
|
|
1246
|
+
const mod = await import("./dist-G42HPNIE.js");
|
|
1247
|
+
mod.registerDeepSeek();
|
|
1248
|
+
break;
|
|
1249
|
+
}
|
|
1250
|
+
case "openrouter": {
|
|
1251
|
+
const mod = await import("./dist-3GJFRS2X.js");
|
|
1252
|
+
mod.registerOpenRouter();
|
|
1253
|
+
break;
|
|
1254
|
+
}
|
|
1255
|
+
case "zen": {
|
|
1256
|
+
const mod = await import("./dist-Z47L7ZAJ.js");
|
|
1257
|
+
mod.registerZen();
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1260
|
+
case "zen-go": {
|
|
1261
|
+
const mod = await import("./dist-Z47L7ZAJ.js");
|
|
1262
|
+
mod.registerZenGo();
|
|
1263
|
+
break;
|
|
1264
|
+
}
|
|
1265
|
+
case "ollama": {
|
|
1266
|
+
const mod = await import("./dist-EY3OJBQH.js");
|
|
1267
|
+
mod.registerOllama();
|
|
1268
|
+
break;
|
|
1269
|
+
}
|
|
1270
|
+
default:
|
|
1271
|
+
throw new Error(unsupportedProviderMessage(id));
|
|
1272
|
+
}
|
|
1273
|
+
registered.add(id);
|
|
1274
|
+
}
|
|
1275
|
+
__name(ensureRegistered, "ensureRegistered");
|
|
1276
|
+
function isRegistered(id) {
|
|
1277
|
+
return registered.has(id);
|
|
1278
|
+
}
|
|
1279
|
+
__name(isRegistered, "isRegistered");
|
|
1280
|
+
async function resolveChainCapabilities(members) {
|
|
1281
|
+
const out = [];
|
|
1282
|
+
for (const member of members) {
|
|
1283
|
+
if (!(member.id in PROVIDER_REGISTRY)) {
|
|
1284
|
+
out.push({
|
|
1285
|
+
kind: "unresolved",
|
|
1286
|
+
reason: `"${member.id}" is not a provider namzu knows`
|
|
1287
|
+
});
|
|
1288
|
+
continue;
|
|
1289
|
+
}
|
|
1290
|
+
try {
|
|
1291
|
+
await ensureRegistered(member.id);
|
|
1292
|
+
out.push({
|
|
1293
|
+
kind: "known",
|
|
1294
|
+
capabilities: resolveProviderCapabilities({
|
|
1295
|
+
capabilities: ProviderRegistry.getCapabilities(member.id)
|
|
1296
|
+
})
|
|
1297
|
+
});
|
|
1298
|
+
} catch (err) {
|
|
1299
|
+
out.push({
|
|
1300
|
+
kind: "unresolved",
|
|
1301
|
+
reason: err instanceof Error ? err.message : String(err)
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
return out;
|
|
1306
|
+
}
|
|
1307
|
+
__name(resolveChainCapabilities, "resolveChainCapabilities");
|
|
1308
|
+
|
|
1309
|
+
export {
|
|
1310
|
+
hasApiCredential,
|
|
1311
|
+
requiresCredentialForModel,
|
|
1312
|
+
canSelectModel,
|
|
1313
|
+
detectWsl,
|
|
1314
|
+
DEFAULT_WSL_MOUNT_ROOT,
|
|
1315
|
+
readWslMountRoot,
|
|
1316
|
+
wslSystem32,
|
|
1317
|
+
readEnvironmentFacts,
|
|
1318
|
+
composeEnvironmentPrompt,
|
|
1319
|
+
claudeCredentialsPath,
|
|
1320
|
+
wslWindowsHome,
|
|
1321
|
+
claudeCredentialSearchPaths,
|
|
1322
|
+
codexCredentialsPath,
|
|
1323
|
+
readClaudeFileCredential,
|
|
1324
|
+
readClaudeCredentialFile,
|
|
1325
|
+
replaceClaudeCredentialFile,
|
|
1326
|
+
codexCredentialFromTokens,
|
|
1327
|
+
readCodexFileCredential,
|
|
1328
|
+
readCodexCredentialFile,
|
|
1329
|
+
createGeminiAccessTokenResolver,
|
|
1330
|
+
KEYCHAIN_SERVICE,
|
|
1331
|
+
readAgentKeychainCredential,
|
|
1332
|
+
isAnthropicOAuthToken,
|
|
1333
|
+
signedInSubscriptionProviders,
|
|
1334
|
+
discoverProviders,
|
|
1335
|
+
isAnonymousZen,
|
|
1336
|
+
automaticKind,
|
|
1337
|
+
automaticChoice,
|
|
1338
|
+
describeAutomaticChoice,
|
|
1339
|
+
findDetected,
|
|
1340
|
+
PREFERENCES_FILE_VERSION,
|
|
1341
|
+
chainPositionName,
|
|
1342
|
+
PreferencesError,
|
|
1343
|
+
primaryProvider,
|
|
1344
|
+
preferencesPath,
|
|
1345
|
+
readPreferences,
|
|
1346
|
+
writePreferences,
|
|
1347
|
+
chainCapabilityDisagreements,
|
|
1348
|
+
unresolvedMembers,
|
|
1349
|
+
describeCapabilityRefusal,
|
|
1350
|
+
describeAcceptedMismatch,
|
|
1351
|
+
ensureRegistered,
|
|
1352
|
+
isRegistered,
|
|
1353
|
+
resolveChainCapabilities
|
|
1354
|
+
};
|
|
1355
|
+
//# sourceMappingURL=chunk-2A37JQKY.js.map
|