@namzu/cli 43.0.0 → 44.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 +131 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-GKYFK7VQ.js → acp-JCGPYVIA.js} +40 -38
- package/dist/chunks/acp-JCGPYVIA.js.map +6 -0
- package/dist/chunks/{activity-command-TOTM3MOY.js → activity-command-UCUGH2LW.js} +12 -12
- package/dist/chunks/{add-4GRA6X5I.js → add-TNGQA6CH.js} +15 -14
- package/dist/chunks/add-TNGQA6CH.js.map +6 -0
- package/dist/chunks/{agent-KEI53I7S.js → agent-F7HY5T3U.js} +31 -29
- package/dist/chunks/agent-session-FFLSUP5P.js +60 -0
- package/dist/chunks/{archive-OOQMVBUH.js → archive-3L6VJWS4.js} +10 -10
- package/dist/chunks/{bin-main-L67SJQV2.js → bin-main-YEEDVZXH.js} +5 -5
- package/dist/chunks/{browser-GDIYUWKT.js → browser-UHJ43DUU.js} +6 -6
- package/dist/chunks/{chat-FUQOCA7Q.js → chat-DDPHHLQJ.js} +15 -15
- package/dist/chunks/{chunk-BHW43OKH.js → chunk-3A4UOMMU.js} +3 -3
- package/dist/chunks/{chunk-2R44UHEU.js → chunk-3LCJJT2F.js} +2 -2
- package/dist/chunks/chunk-3NJPNX6V.js +65 -0
- package/dist/chunks/chunk-3NJPNX6V.js.map +6 -0
- package/dist/chunks/{chunk-WQDMDSPW.js → chunk-3UK2GDVX.js} +4 -4
- package/dist/chunks/{chunk-2S4VEEVB.js → chunk-4LHT2QDO.js} +8 -8
- package/dist/chunks/{chunk-VWNLO4OM.js → chunk-4YJ4EI4X.js} +6 -4
- package/dist/chunks/chunk-4YJ4EI4X.js.map +6 -0
- package/dist/chunks/{chunk-V5YIGRUD.js → chunk-4Z4VYMTT.js} +5 -5
- package/dist/chunks/chunk-5PJIJTP2.js +157 -0
- package/dist/chunks/chunk-5PJIJTP2.js.map +6 -0
- package/dist/chunks/{chunk-FFXSL2SL.js → chunk-6WXVHAS6.js} +15 -3
- package/dist/chunks/chunk-6WXVHAS6.js.map +6 -0
- package/dist/chunks/{chunk-BNYTG2ZC.js → chunk-72ZSHKT7.js} +328 -18
- package/dist/chunks/chunk-72ZSHKT7.js.map +6 -0
- package/dist/chunks/{chunk-NJ6P3WPZ.js → chunk-76DOZYZP.js} +2 -2
- package/dist/chunks/{chunk-IJUCXVG5.js → chunk-7DYH6R67.js} +2 -2
- package/dist/chunks/{chunk-EM5AM5BR.js → chunk-7HRVTREO.js} +3 -3
- package/dist/chunks/{chunk-SM377CLQ.js → chunk-AH3DBEMR.js} +2 -2
- package/dist/chunks/{chunk-TZQT5JL3.js → chunk-B45X6IGD.js} +4 -4
- package/dist/chunks/{chunk-MJRLJDNK.js → chunk-B5KDTZYH.js} +2 -2
- package/dist/chunks/{chunk-NWW46AII.js → chunk-BKZW4DRY.js} +2 -2
- package/dist/chunks/{chunk-HAAL3DME.js → chunk-CFHRQGO2.js} +3 -3
- package/dist/chunks/{chunk-XZPLOQBA.js → chunk-CLVP63AB.js} +2 -2
- package/dist/chunks/{chunk-XV3FGIHS.js → chunk-DASSBULE.js} +235 -8
- package/dist/chunks/chunk-DASSBULE.js.map +6 -0
- package/dist/chunks/{chunk-M3RKXXZE.js → chunk-DYJY4COC.js} +3 -3
- package/dist/chunks/{chunk-NXM3BLL4.js → chunk-EBN4YPIN.js} +3 -3
- package/dist/chunks/{chunk-B4I264HC.js → chunk-EYYWIMVU.js} +6 -6
- package/dist/chunks/{chunk-752S5IP3.js → chunk-F37FVPVW.js} +59 -6
- package/dist/chunks/chunk-F37FVPVW.js.map +6 -0
- package/dist/chunks/{chunk-RHT52Z5X.js → chunk-GKMPPOXW.js} +2 -2
- package/dist/chunks/{chunk-GURZ2GEB.js → chunk-GX74LDJL.js} +3 -3
- package/dist/chunks/{chunk-OUGL6FI2.js → chunk-HI7UZRIV.js} +2 -2
- package/dist/chunks/{chunk-FTMTO72X.js → chunk-HSEIISLI.js} +2 -1
- package/dist/chunks/{chunk-LWPTVYRU.js → chunk-I47Q4G4X.js} +4 -4
- package/dist/chunks/{chunk-5QCBUBKO.js → chunk-IDU2KLLT.js} +4 -4
- package/dist/chunks/{chunk-DXTK4EMM.js → chunk-IYNTTEQA.js} +2 -2
- package/dist/chunks/{chunk-XGOM2KHV.js → chunk-J7PV6OOX.js} +6 -6
- package/dist/chunks/{chunk-Z3VSDOCX.js → chunk-JS4C7HNH.js} +207 -8
- package/dist/chunks/chunk-JS4C7HNH.js.map +6 -0
- package/dist/chunks/{chunk-I7FY5SK5.js → chunk-KEOBHC65.js} +11 -4
- package/dist/chunks/chunk-KEOBHC65.js.map +6 -0
- package/dist/chunks/{chunk-LAQTQNQE.js → chunk-MT4ONV77.js} +8 -8
- package/dist/chunks/{chunk-EADX2OKC.js → chunk-MZUVCANX.js} +2 -2
- package/dist/chunks/{chunk-TAAAO6PM.js → chunk-N4IDJ5V2.js} +2 -2
- package/dist/chunks/{chunk-DABNNT6R.js → chunk-NB5LGTUL.js} +7 -7
- package/dist/chunks/{chunk-6WK7YVAX.js → chunk-OAISYZM4.js} +125 -48
- package/dist/chunks/chunk-OAISYZM4.js.map +6 -0
- package/dist/chunks/{chunk-EDP5FDN4.js → chunk-OERIIND6.js} +7 -7
- package/dist/chunks/{chunk-GNG6HJIV.js → chunk-OKDDIWD7.js} +75646 -74040
- package/dist/chunks/chunk-OKDDIWD7.js.map +6 -0
- package/dist/chunks/{chunk-54TFQUPM.js → chunk-OZLMT5WB.js} +4 -4
- package/dist/chunks/{chunk-NOG4Z42R.js → chunk-PEJV6XTK.js} +3 -3
- package/dist/chunks/{chunk-TYMIKXOD.js → chunk-RBTQ5ZQU.js} +2 -2
- package/dist/chunks/{chunk-TIBFEO2R.js → chunk-RMBD3YZ5.js} +2 -2
- package/dist/chunks/{chunk-ODOM3I7B.js → chunk-SBKOTD2M.js} +302 -26
- package/dist/chunks/chunk-SBKOTD2M.js.map +6 -0
- package/dist/chunks/{chunk-VTU23NBS.js → chunk-SEYQW7MF.js} +6 -6
- package/dist/chunks/{chunk-3SQVE73V.js → chunk-SYOISB7S.js} +1400 -428
- package/dist/chunks/chunk-SYOISB7S.js.map +6 -0
- package/dist/chunks/{chunk-OIOA7BRC.js → chunk-TKCRF7DK.js} +5 -5
- package/dist/chunks/{chunk-PXSTTFI7.js → chunk-UEPYLY5U.js} +49 -23
- package/dist/chunks/chunk-UEPYLY5U.js.map +6 -0
- package/dist/chunks/{chunk-VNK6EA2D.js → chunk-UVSKCXL6.js} +2 -2
- package/dist/chunks/{chunk-P73IFAYM.js → chunk-UXDNVRJ5.js} +15 -15
- package/dist/chunks/chunk-UXDNVRJ5.js.map +6 -0
- package/dist/chunks/{chunk-2C5QF5ZM.js → chunk-UZYTWQYW.js} +2 -2
- package/dist/chunks/{chunk-6G3XZZRF.js → chunk-V2EGJD7W.js} +2 -2
- package/dist/chunks/{chunk-UPXD4LJ5.js → chunk-VKYIL6BJ.js} +6 -5
- package/dist/chunks/chunk-VKYIL6BJ.js.map +6 -0
- package/dist/chunks/{chunk-LCVRXUEV.js → chunk-VPZBVRXT.js} +2 -2
- package/dist/chunks/{chunk-AEZ7YTIJ.js → chunk-W6OOY44A.js} +3 -3
- package/dist/chunks/{chunk-4V2V2FMP.js → chunk-WEAIQEWJ.js} +2 -2
- package/dist/chunks/{chunk-W6ZZLT64.js → chunk-WG5LLHJX.js} +3 -3
- package/dist/chunks/{chunk-BBERAGUX.js → chunk-WIU25RLZ.js} +4 -4
- package/dist/chunks/{chunk-VRUEY647.js → chunk-WOY7SAUB.js} +2 -2
- package/dist/chunks/{chunk-7WQS7BP2.js → chunk-WQ72OU4F.js} +2 -2
- package/dist/chunks/{chunk-UB5YVQJM.js → chunk-WTPIGLX7.js} +4 -4
- package/dist/chunks/{chunk-VNFXDLKD.js → chunk-WUUZJCAA.js} +3 -3
- package/dist/chunks/{chunk-IY7XWRXE.js → chunk-XHCUNLST.js} +149 -17
- package/dist/chunks/chunk-XHCUNLST.js.map +6 -0
- package/dist/chunks/{chunk-OK4UNUNI.js → chunk-Y6HB4AJE.js} +2 -2
- package/dist/chunks/{chunk-CD5X75DB.js → chunk-YSGVHT54.js} +2 -2
- package/dist/chunks/{chunk-N4DS6G4I.js → chunk-ZNY5ZPBB.js} +13 -13
- package/dist/chunks/{chunk-W6Z7RNVL.js → chunk-ZRPLJYFM.js} +9 -9
- package/dist/chunks/cli-runtime-VRAUDAKZ.js +338 -0
- package/dist/chunks/cli-runtime-VRAUDAKZ.js.map +6 -0
- package/dist/chunks/{commands-4ZTQFX2X.js → commands-Q3FSPHGU.js} +5 -5
- package/dist/chunks/{crash-report-Y6U6CH73.js → crash-report-6XW44BV6.js} +6 -6
- package/dist/chunks/{dist-TKVIIUPJ.js → dist-4SPA7VSK.js} +2 -2
- package/dist/chunks/{dist-GTK2JZSU.js → dist-5DDSGOSA.js} +40 -4
- package/dist/chunks/dist-5DDSGOSA.js.map +6 -0
- package/dist/chunks/{dist-XP72U44M.js → dist-6XC3YARD.js} +2 -2
- package/dist/chunks/{dist-J36EH26G.js → dist-KNYBFHXB.js} +2 -2
- package/dist/chunks/{dist-3YHUITAK.js → dist-NG6RAO2C.js} +2 -2
- package/dist/chunks/{dist-ZNMZHP7A.js → dist-VEEXDONU.js} +2 -2
- package/dist/chunks/{dist-OKRQSUWC.js → dist-VYUROH2A.js} +2 -2
- package/dist/chunks/{doctor-WKZ7BGFC.js → doctor-ZDXK5W6E.js} +13 -13
- package/dist/chunks/{drain-VOM6IT3C.js → drain-NQLOKED3.js} +11 -11
- package/dist/chunks/{eval-7MDLH5UR.js → eval-A2G4KS62.js} +2 -2
- package/dist/chunks/{exec-YBTNNBSS.js → exec-EWGVFJNZ.js} +297 -89
- package/dist/chunks/exec-EWGVFJNZ.js.map +6 -0
- package/dist/chunks/github-FH7PPWVW.js +347 -0
- package/dist/chunks/github-FH7PPWVW.js.map +6 -0
- package/dist/chunks/{home-UID64VNR.js → home-5N3FSKF7.js} +3 -3
- package/dist/chunks/{host-queries-A3XQQHI4.js → host-queries-R2KVVFTJ.js} +16 -16
- package/dist/chunks/{learn-N2FNKNCW.js → learn-SAVZB4Q7.js} +14 -14
- package/dist/chunks/{learn-builtin-3SQNWE77.js → learn-builtin-ZWX7Q3X2.js} +17 -17
- package/dist/chunks/{lifecycle-TIEMDICJ.js → lifecycle-2RFARBGC.js} +24 -23
- package/dist/chunks/{list-HGGKMHPQ.js → list-D63Z2LT4.js} +11 -10
- package/dist/chunks/list-D63Z2LT4.js.map +6 -0
- package/dist/chunks/{live-JHNWMJIE.js → live-XC3V46W3.js} +12 -12
- package/dist/chunks/{login-CLFAZ2WB.js → login-NIX66V67.js} +8 -8
- package/dist/chunks/{logs-A5HZQ3XA.js → logs-LJSWQUT5.js} +4 -4
- package/dist/chunks/{mcp-V27XPHVU.js → mcp-OCEDFJA5.js} +16 -15
- package/dist/chunks/mcp-OCEDFJA5.js.map +6 -0
- package/dist/chunks/{message-command-HBTDJ6WS.js → message-command-THJZ4EIM.js} +37 -35
- package/dist/chunks/message-command-THJZ4EIM.js.map +6 -0
- package/dist/chunks/{operator-tools-7YJWXVYR.js → operator-tools-C7KZGWFJ.js} +13 -13
- package/dist/chunks/{output-schema-NEJ27MH6.js → output-schema-4BLF2AFQ.js} +3 -3
- package/dist/chunks/{pal-LX2FA7N2.js → pal-7IB6LZJX.js} +11 -11
- package/dist/chunks/{providers-XRDUL4OO.js → providers-NCGZXLFH.js} +6 -6
- package/dist/chunks/{resident-T6QB5MX7.js → resident-EODT4UTE.js} +25 -25
- package/dist/chunks/{resident-T6QB5MX7.js.map → resident-EODT4UTE.js.map} +1 -1
- package/dist/chunks/resume-2RX7TSTR.js +23 -0
- package/dist/chunks/{resume-command-VSFQAVVN.js → resume-command-YJ6LCKON.js} +4 -4
- package/dist/chunks/{schedule-GCBVV54F.js → schedule-LWY6AMC3.js} +8 -8
- package/dist/chunks/{service-UQPEAJKT.js → service-RQZF7NCJ.js} +23 -22
- package/dist/chunks/service-RQZF7NCJ.js.map +6 -0
- package/dist/chunks/session-step-YIL6LV2J.js +33 -0
- package/dist/chunks/{skills-LCTXKJCR.js → skills-3KYQHENX.js} +9 -9
- package/dist/chunks/{start-check-NAACA6IE.js → start-check-OKGZSWUG.js} +2 -2
- package/dist/chunks/{state-GNWJY3F2.js → state-ER7R4WEN.js} +2 -2
- package/dist/chunks/{store-7ZXMZ6ES.js → store-C654AJPG.js} +14 -10
- package/dist/chunks/{store-44ZZJVF3.js → store-EQQRW7NJ.js} +6 -6
- package/dist/chunks/{store-KGH5U7KF.js → store-HWGRIA5X.js} +4 -4
- package/dist/chunks/{tui-TNCMJCJJ.js → tui-UYHIDUPB.js} +1470 -774
- package/dist/chunks/tui-UYHIDUPB.js.map +6 -0
- package/dist/chunks/{upgrade-DU4I5ACF.js → upgrade-D6Q5EAMR.js} +6 -6
- package/dist/chunks/{worktree-XGJCKZQJ.js → worktree-UFFQMC2B.js} +12 -12
- package/dist/cli-runtime.d.ts +2 -0
- package/dist/cli-runtime.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/desktop-host.d.ts +3 -0
- package/dist/commands/desktop-host.d.ts.map +1 -1
- package/dist/commands/exec-flags.d.ts +16 -0
- package/dist/commands/exec-flags.d.ts.map +1 -1
- package/dist/commands/exec-json.d.ts +8 -1
- package/dist/commands/exec-json.d.ts.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/github.d.ts +20 -0
- package/dist/commands/github.d.ts.map +1 -0
- package/dist/commands/manifest.d.ts +1 -0
- package/dist/commands/manifest.d.ts.map +1 -1
- package/dist/commands/resident-flags.d.ts.map +1 -1
- package/dist/commands/resume.d.ts +4 -0
- package/dist/commands/resume.d.ts.map +1 -1
- package/dist/commands/stream-input.d.ts +4 -0
- package/dist/commands/stream-input.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/model-environment.d.ts +18 -0
- package/dist/config/model-environment.d.ts.map +1 -0
- package/dist/config/schema.d.ts +25 -2
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/turn-guards.d.ts +2 -0
- package/dist/config/turn-guards.d.ts.map +1 -1
- package/dist/context/environment.d.ts +17 -4
- package/dist/context/environment.d.ts.map +1 -1
- package/dist/context/system-prompt.d.ts +2 -2
- package/dist/context/system-prompt.d.ts.map +1 -1
- package/dist/index.js +17 -17
- package/dist/integrations/github/pull-request.d.ts +64 -0
- package/dist/integrations/github/pull-request.d.ts.map +1 -0
- package/dist/integrations/github/workflows.d.ts +49 -0
- package/dist/integrations/github/workflows.d.ts.map +1 -0
- package/dist/integrations/mcp/elicitation.d.ts +40 -0
- package/dist/integrations/mcp/elicitation.d.ts.map +1 -0
- package/dist/integrations/mcp/output.d.ts +9 -0
- package/dist/integrations/mcp/output.d.ts.map +1 -0
- package/dist/integrations/mcp/person-commands.d.ts +18 -0
- package/dist/integrations/mcp/person-commands.d.ts.map +1 -0
- package/dist/integrations/mcp/person-session.d.ts +15 -0
- package/dist/integrations/mcp/person-session.d.ts.map +1 -0
- package/dist/integrations/mcp/prompts.d.ts +18 -0
- package/dist/integrations/mcp/prompts.d.ts.map +1 -0
- package/dist/integrations/mcp/servers.d.ts +33 -1
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/peers/runtime.d.ts.map +1 -1
- package/dist/integrations/plugins/files.d.ts +43 -0
- package/dist/integrations/plugins/files.d.ts.map +1 -0
- package/dist/integrations/plugins/runtime.d.ts +5 -1
- package/dist/integrations/plugins/runtime.d.ts.map +1 -1
- package/dist/integrations/resident/runner-worker.js +22 -22
- package/dist/integrations/resident/session-step.d.ts.map +1 -1
- package/dist/integrations/sessions/side-question.d.ts +46 -0
- package/dist/integrations/sessions/side-question.d.ts.map +1 -0
- package/dist/integrations/sessions/store.d.ts +23 -1
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/subagents/agent-names.d.ts +21 -0
- package/dist/integrations/subagents/agent-names.d.ts.map +1 -0
- package/dist/integrations/subagents/definitions.d.ts +24 -2
- package/dist/integrations/subagents/definitions.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts +28 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/telemetry/otlp-export.d.ts +67 -0
- package/dist/integrations/telemetry/otlp-export.d.ts.map +1 -0
- package/dist/permissions/auto-classifier.d.ts +12 -1
- package/dist/permissions/auto-classifier.d.ts.map +1 -1
- package/dist/permissions/delegated-mode.d.ts +25 -0
- package/dist/permissions/delegated-mode.d.ts.map +1 -0
- package/dist/permissions/live-mode.d.ts +5 -0
- package/dist/permissions/live-mode.d.ts.map +1 -1
- package/dist/permissions/live-rules.d.ts +12 -0
- package/dist/permissions/live-rules.d.ts.map +1 -0
- package/dist/permissions/path-rules.d.ts +43 -0
- package/dist/permissions/path-rules.d.ts.map +1 -0
- package/dist/permissions/rule-screen.d.ts +36 -0
- package/dist/permissions/rule-screen.d.ts.map +1 -0
- package/dist/permissions/rule-strings.d.ts +50 -0
- package/dist/permissions/rule-strings.d.ts.map +1 -0
- package/dist/permissions/rules.d.ts +7 -2
- package/dist/permissions/rules.d.ts.map +1 -1
- package/dist/permissions/session-allow.d.ts +2 -0
- package/dist/permissions/session-allow.d.ts.map +1 -1
- package/dist/reminders/changed-files.d.ts +24 -0
- package/dist/reminders/changed-files.d.ts.map +1 -0
- package/dist/reminders/frame.d.ts +1 -1
- package/dist/reminders/frame.d.ts.map +1 -1
- package/dist/reminders/index.d.ts +30 -0
- package/dist/reminders/index.d.ts.map +1 -1
- package/dist/reminders/mcp-instructions.d.ts +27 -0
- package/dist/reminders/mcp-instructions.d.ts.map +1 -0
- package/dist/reminders/memory-index.d.ts +28 -0
- package/dist/reminders/memory-index.d.ts.map +1 -0
- package/dist/reminders/model.d.ts +9 -0
- package/dist/reminders/model.d.ts.map +1 -0
- package/dist/reminders/skills.d.ts +27 -0
- package/dist/reminders/skills.d.ts.map +1 -0
- package/dist/skills/catalog.d.ts.map +1 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/Composer.d.ts +4 -1
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/ResumePicker.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +27 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/mention-file.d.ts +10 -0
- package/dist/tui/mention-file.d.ts.map +1 -0
- package/dist/tui/mention-sources.d.ts +31 -0
- package/dist/tui/mention-sources.d.ts.map +1 -0
- package/dist/tui/mentions.d.ts +55 -1
- package/dist/tui/mentions.d.ts.map +1 -1
- package/dist/tui/plugin-view.d.ts.map +1 -1
- package/dist/tui/resume-empty.d.ts +7 -0
- package/dist/tui/resume-empty.d.ts.map +1 -1
- package/dist/tui/resume-picker-state.d.ts +3 -0
- package/dist/tui/resume-picker-state.d.ts.map +1 -1
- package/dist/tui/slashCommands.d.ts +16 -0
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/thinking-label.d.ts +24 -0
- package/dist/tui/thinking-label.d.ts.map +1 -0
- package/dist/tui/types.d.ts +4 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/user-commands/store.d.ts +10 -1
- package/dist/user-commands/store.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/chunks/acp-GKYFK7VQ.js.map +0 -6
- package/dist/chunks/add-4GRA6X5I.js.map +0 -6
- package/dist/chunks/agent-session-4IF5H4YO.js +0 -58
- package/dist/chunks/chunk-3SQVE73V.js.map +0 -6
- package/dist/chunks/chunk-6WK7YVAX.js.map +0 -6
- package/dist/chunks/chunk-752S5IP3.js.map +0 -6
- package/dist/chunks/chunk-BNYTG2ZC.js.map +0 -6
- package/dist/chunks/chunk-FFXSL2SL.js.map +0 -6
- package/dist/chunks/chunk-GNG6HJIV.js.map +0 -6
- package/dist/chunks/chunk-I7FY5SK5.js.map +0 -6
- package/dist/chunks/chunk-IY7XWRXE.js.map +0 -6
- package/dist/chunks/chunk-LXB3S4IC.js +0 -19
- package/dist/chunks/chunk-LXB3S4IC.js.map +0 -6
- package/dist/chunks/chunk-ODOM3I7B.js.map +0 -6
- package/dist/chunks/chunk-P73IFAYM.js.map +0 -6
- package/dist/chunks/chunk-PXSTTFI7.js.map +0 -6
- package/dist/chunks/chunk-UPXD4LJ5.js.map +0 -6
- package/dist/chunks/chunk-VWNLO4OM.js.map +0 -6
- package/dist/chunks/chunk-XV3FGIHS.js.map +0 -6
- package/dist/chunks/chunk-Z3VSDOCX.js.map +0 -6
- package/dist/chunks/cli-runtime-Y6RGQSMF.js +0 -186
- package/dist/chunks/cli-runtime-Y6RGQSMF.js.map +0 -6
- package/dist/chunks/dist-GTK2JZSU.js.map +0 -6
- package/dist/chunks/exec-YBTNNBSS.js.map +0 -6
- package/dist/chunks/list-HGGKMHPQ.js.map +0 -6
- package/dist/chunks/mcp-V27XPHVU.js.map +0 -6
- package/dist/chunks/message-command-HBTDJ6WS.js.map +0 -6
- package/dist/chunks/resume-YPKHTYLO.js +0 -23
- package/dist/chunks/service-UQPEAJKT.js.map +0 -6
- package/dist/chunks/session-step-OKCO6S7R.js +0 -33
- package/dist/chunks/tui-TNCMJCJJ.js.map +0 -6
- /package/dist/chunks/{activity-command-TOTM3MOY.js.map → activity-command-UCUGH2LW.js.map} +0 -0
- /package/dist/chunks/{agent-KEI53I7S.js.map → agent-F7HY5T3U.js.map} +0 -0
- /package/dist/chunks/{agent-session-4IF5H4YO.js.map → agent-session-FFLSUP5P.js.map} +0 -0
- /package/dist/chunks/{archive-OOQMVBUH.js.map → archive-3L6VJWS4.js.map} +0 -0
- /package/dist/chunks/{bin-main-L67SJQV2.js.map → bin-main-YEEDVZXH.js.map} +0 -0
- /package/dist/chunks/{browser-GDIYUWKT.js.map → browser-UHJ43DUU.js.map} +0 -0
- /package/dist/chunks/{chat-FUQOCA7Q.js.map → chat-DDPHHLQJ.js.map} +0 -0
- /package/dist/chunks/{chunk-BHW43OKH.js.map → chunk-3A4UOMMU.js.map} +0 -0
- /package/dist/chunks/{chunk-2R44UHEU.js.map → chunk-3LCJJT2F.js.map} +0 -0
- /package/dist/chunks/{chunk-WQDMDSPW.js.map → chunk-3UK2GDVX.js.map} +0 -0
- /package/dist/chunks/{chunk-2S4VEEVB.js.map → chunk-4LHT2QDO.js.map} +0 -0
- /package/dist/chunks/{chunk-V5YIGRUD.js.map → chunk-4Z4VYMTT.js.map} +0 -0
- /package/dist/chunks/{chunk-NJ6P3WPZ.js.map → chunk-76DOZYZP.js.map} +0 -0
- /package/dist/chunks/{chunk-IJUCXVG5.js.map → chunk-7DYH6R67.js.map} +0 -0
- /package/dist/chunks/{chunk-EM5AM5BR.js.map → chunk-7HRVTREO.js.map} +0 -0
- /package/dist/chunks/{chunk-SM377CLQ.js.map → chunk-AH3DBEMR.js.map} +0 -0
- /package/dist/chunks/{chunk-TZQT5JL3.js.map → chunk-B45X6IGD.js.map} +0 -0
- /package/dist/chunks/{chunk-MJRLJDNK.js.map → chunk-B5KDTZYH.js.map} +0 -0
- /package/dist/chunks/{chunk-NWW46AII.js.map → chunk-BKZW4DRY.js.map} +0 -0
- /package/dist/chunks/{chunk-HAAL3DME.js.map → chunk-CFHRQGO2.js.map} +0 -0
- /package/dist/chunks/{chunk-XZPLOQBA.js.map → chunk-CLVP63AB.js.map} +0 -0
- /package/dist/chunks/{chunk-M3RKXXZE.js.map → chunk-DYJY4COC.js.map} +0 -0
- /package/dist/chunks/{chunk-NXM3BLL4.js.map → chunk-EBN4YPIN.js.map} +0 -0
- /package/dist/chunks/{chunk-B4I264HC.js.map → chunk-EYYWIMVU.js.map} +0 -0
- /package/dist/chunks/{chunk-RHT52Z5X.js.map → chunk-GKMPPOXW.js.map} +0 -0
- /package/dist/chunks/{chunk-GURZ2GEB.js.map → chunk-GX74LDJL.js.map} +0 -0
- /package/dist/chunks/{chunk-OUGL6FI2.js.map → chunk-HI7UZRIV.js.map} +0 -0
- /package/dist/chunks/{chunk-FTMTO72X.js.map → chunk-HSEIISLI.js.map} +0 -0
- /package/dist/chunks/{chunk-LWPTVYRU.js.map → chunk-I47Q4G4X.js.map} +0 -0
- /package/dist/chunks/{chunk-5QCBUBKO.js.map → chunk-IDU2KLLT.js.map} +0 -0
- /package/dist/chunks/{chunk-DXTK4EMM.js.map → chunk-IYNTTEQA.js.map} +0 -0
- /package/dist/chunks/{chunk-XGOM2KHV.js.map → chunk-J7PV6OOX.js.map} +0 -0
- /package/dist/chunks/{chunk-LAQTQNQE.js.map → chunk-MT4ONV77.js.map} +0 -0
- /package/dist/chunks/{chunk-EADX2OKC.js.map → chunk-MZUVCANX.js.map} +0 -0
- /package/dist/chunks/{chunk-TAAAO6PM.js.map → chunk-N4IDJ5V2.js.map} +0 -0
- /package/dist/chunks/{chunk-DABNNT6R.js.map → chunk-NB5LGTUL.js.map} +0 -0
- /package/dist/chunks/{chunk-EDP5FDN4.js.map → chunk-OERIIND6.js.map} +0 -0
- /package/dist/chunks/{chunk-54TFQUPM.js.map → chunk-OZLMT5WB.js.map} +0 -0
- /package/dist/chunks/{chunk-NOG4Z42R.js.map → chunk-PEJV6XTK.js.map} +0 -0
- /package/dist/chunks/{chunk-TYMIKXOD.js.map → chunk-RBTQ5ZQU.js.map} +0 -0
- /package/dist/chunks/{chunk-TIBFEO2R.js.map → chunk-RMBD3YZ5.js.map} +0 -0
- /package/dist/chunks/{chunk-VTU23NBS.js.map → chunk-SEYQW7MF.js.map} +0 -0
- /package/dist/chunks/{chunk-OIOA7BRC.js.map → chunk-TKCRF7DK.js.map} +0 -0
- /package/dist/chunks/{chunk-VNK6EA2D.js.map → chunk-UVSKCXL6.js.map} +0 -0
- /package/dist/chunks/{chunk-2C5QF5ZM.js.map → chunk-UZYTWQYW.js.map} +0 -0
- /package/dist/chunks/{chunk-6G3XZZRF.js.map → chunk-V2EGJD7W.js.map} +0 -0
- /package/dist/chunks/{chunk-LCVRXUEV.js.map → chunk-VPZBVRXT.js.map} +0 -0
- /package/dist/chunks/{chunk-AEZ7YTIJ.js.map → chunk-W6OOY44A.js.map} +0 -0
- /package/dist/chunks/{chunk-4V2V2FMP.js.map → chunk-WEAIQEWJ.js.map} +0 -0
- /package/dist/chunks/{chunk-W6ZZLT64.js.map → chunk-WG5LLHJX.js.map} +0 -0
- /package/dist/chunks/{chunk-BBERAGUX.js.map → chunk-WIU25RLZ.js.map} +0 -0
- /package/dist/chunks/{chunk-VRUEY647.js.map → chunk-WOY7SAUB.js.map} +0 -0
- /package/dist/chunks/{chunk-7WQS7BP2.js.map → chunk-WQ72OU4F.js.map} +0 -0
- /package/dist/chunks/{chunk-UB5YVQJM.js.map → chunk-WTPIGLX7.js.map} +0 -0
- /package/dist/chunks/{chunk-VNFXDLKD.js.map → chunk-WUUZJCAA.js.map} +0 -0
- /package/dist/chunks/{chunk-OK4UNUNI.js.map → chunk-Y6HB4AJE.js.map} +0 -0
- /package/dist/chunks/{chunk-CD5X75DB.js.map → chunk-YSGVHT54.js.map} +0 -0
- /package/dist/chunks/{chunk-N4DS6G4I.js.map → chunk-ZNY5ZPBB.js.map} +0 -0
- /package/dist/chunks/{chunk-W6Z7RNVL.js.map → chunk-ZRPLJYFM.js.map} +0 -0
- /package/dist/chunks/{commands-4ZTQFX2X.js.map → commands-Q3FSPHGU.js.map} +0 -0
- /package/dist/chunks/{crash-report-Y6U6CH73.js.map → crash-report-6XW44BV6.js.map} +0 -0
- /package/dist/chunks/{dist-TKVIIUPJ.js.map → dist-4SPA7VSK.js.map} +0 -0
- /package/dist/chunks/{dist-XP72U44M.js.map → dist-6XC3YARD.js.map} +0 -0
- /package/dist/chunks/{dist-J36EH26G.js.map → dist-KNYBFHXB.js.map} +0 -0
- /package/dist/chunks/{dist-3YHUITAK.js.map → dist-NG6RAO2C.js.map} +0 -0
- /package/dist/chunks/{dist-ZNMZHP7A.js.map → dist-VEEXDONU.js.map} +0 -0
- /package/dist/chunks/{dist-OKRQSUWC.js.map → dist-VYUROH2A.js.map} +0 -0
- /package/dist/chunks/{doctor-WKZ7BGFC.js.map → doctor-ZDXK5W6E.js.map} +0 -0
- /package/dist/chunks/{drain-VOM6IT3C.js.map → drain-NQLOKED3.js.map} +0 -0
- /package/dist/chunks/{eval-7MDLH5UR.js.map → eval-A2G4KS62.js.map} +0 -0
- /package/dist/chunks/{home-UID64VNR.js.map → home-5N3FSKF7.js.map} +0 -0
- /package/dist/chunks/{host-queries-A3XQQHI4.js.map → host-queries-R2KVVFTJ.js.map} +0 -0
- /package/dist/chunks/{learn-N2FNKNCW.js.map → learn-SAVZB4Q7.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-3SQNWE77.js.map → learn-builtin-ZWX7Q3X2.js.map} +0 -0
- /package/dist/chunks/{lifecycle-TIEMDICJ.js.map → lifecycle-2RFARBGC.js.map} +0 -0
- /package/dist/chunks/{live-JHNWMJIE.js.map → live-XC3V46W3.js.map} +0 -0
- /package/dist/chunks/{login-CLFAZ2WB.js.map → login-NIX66V67.js.map} +0 -0
- /package/dist/chunks/{logs-A5HZQ3XA.js.map → logs-LJSWQUT5.js.map} +0 -0
- /package/dist/chunks/{operator-tools-7YJWXVYR.js.map → operator-tools-C7KZGWFJ.js.map} +0 -0
- /package/dist/chunks/{output-schema-NEJ27MH6.js.map → output-schema-4BLF2AFQ.js.map} +0 -0
- /package/dist/chunks/{pal-LX2FA7N2.js.map → pal-7IB6LZJX.js.map} +0 -0
- /package/dist/chunks/{providers-XRDUL4OO.js.map → providers-NCGZXLFH.js.map} +0 -0
- /package/dist/chunks/{resume-YPKHTYLO.js.map → resume-2RX7TSTR.js.map} +0 -0
- /package/dist/chunks/{resume-command-VSFQAVVN.js.map → resume-command-YJ6LCKON.js.map} +0 -0
- /package/dist/chunks/{schedule-GCBVV54F.js.map → schedule-LWY6AMC3.js.map} +0 -0
- /package/dist/chunks/{session-step-OKCO6S7R.js.map → session-step-YIL6LV2J.js.map} +0 -0
- /package/dist/chunks/{skills-LCTXKJCR.js.map → skills-3KYQHENX.js.map} +0 -0
- /package/dist/chunks/{start-check-NAACA6IE.js.map → start-check-OKGZSWUG.js.map} +0 -0
- /package/dist/chunks/{state-GNWJY3F2.js.map → state-ER7R4WEN.js.map} +0 -0
- /package/dist/chunks/{store-44ZZJVF3.js.map → store-C654AJPG.js.map} +0 -0
- /package/dist/chunks/{store-7ZXMZ6ES.js.map → store-EQQRW7NJ.js.map} +0 -0
- /package/dist/chunks/{store-KGH5U7KF.js.map → store-HWGRIA5X.js.map} +0 -0
- /package/dist/chunks/{upgrade-DU4I5ACF.js.map → upgrade-D6Q5EAMR.js.map} +0 -0
- /package/dist/chunks/{worktree-XGJCKZQJ.js.map → worktree-UFFQMC2B.js.map} +0 -0
|
@@ -2,19 +2,19 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __namzuCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
loadOutputSchema
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UVSKCXL6.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveResume
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6WXVHAS6.js";
|
|
9
9
|
import {
|
|
10
10
|
expandHeadlessCommand,
|
|
11
11
|
hostCommandNames
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-72ZSHKT7.js";
|
|
13
13
|
import {
|
|
14
14
|
withTerminationHandling
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VPZBVRXT.js";
|
|
16
16
|
import "./chunk-TBIX6JRE.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-PEJV6XTK.js";
|
|
18
18
|
import "./chunk-JV3LONAU.js";
|
|
19
19
|
import {
|
|
20
20
|
describeSpendStop,
|
|
@@ -23,13 +23,14 @@ import {
|
|
|
23
23
|
import "./chunk-2OVZNENW.js";
|
|
24
24
|
import {
|
|
25
25
|
decideHeadlessTrust
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RBTQ5ZQU.js";
|
|
27
27
|
import {
|
|
28
28
|
completionNotice,
|
|
29
29
|
runTokens
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-KEOBHC65.js";
|
|
31
|
+
import "./chunk-3A4UOMMU.js";
|
|
32
|
+
import "./chunk-5PJIJTP2.js";
|
|
33
|
+
import "./chunk-4YJ4EI4X.js";
|
|
33
34
|
import {
|
|
34
35
|
resolveTrustedProjectContext
|
|
35
36
|
} from "./chunk-CHIEVVQ2.js";
|
|
@@ -38,8 +39,10 @@ import "./chunk-GNBMKISG.js";
|
|
|
38
39
|
import {
|
|
39
40
|
pendingProjectMcpServers,
|
|
40
41
|
pendingServersMessage
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import
|
|
42
|
+
} from "./chunk-SBKOTD2M.js";
|
|
43
|
+
import {
|
|
44
|
+
createFormatter
|
|
45
|
+
} from "./chunk-KONYGNG6.js";
|
|
43
46
|
import "./chunk-LCGXWCVU.js";
|
|
44
47
|
import "./chunk-XPS3W7FC.js";
|
|
45
48
|
import {
|
|
@@ -57,59 +60,62 @@ import {
|
|
|
57
60
|
parseExecFlags,
|
|
58
61
|
resolveWorkingDirectory,
|
|
59
62
|
unknownOptionMessage
|
|
60
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-F37FVPVW.js";
|
|
61
64
|
import {
|
|
62
65
|
duration,
|
|
63
66
|
pauseWait
|
|
64
67
|
} from "./chunk-XEUQN4JC.js";
|
|
65
68
|
import {
|
|
66
69
|
launchRefusal
|
|
67
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-N4IDJ5V2.js";
|
|
68
71
|
import {
|
|
69
72
|
describeTurnInterruption,
|
|
70
73
|
retryAfterMs
|
|
71
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-MZUVCANX.js";
|
|
72
75
|
import {
|
|
73
76
|
resolvePermissionMode
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-WQ72OU4F.js";
|
|
75
78
|
import "./chunk-IYUW2RAA.js";
|
|
76
79
|
import {
|
|
77
80
|
closeSessions,
|
|
81
|
+
forkConversation,
|
|
78
82
|
loadConversation,
|
|
79
83
|
openSessions,
|
|
80
84
|
resolveConversation,
|
|
81
85
|
startConversation
|
|
82
|
-
} from "./chunk-
|
|
83
|
-
import "./chunk-
|
|
86
|
+
} from "./chunk-XHCUNLST.js";
|
|
87
|
+
import "./chunk-W6OOY44A.js";
|
|
84
88
|
import "./chunk-JQIBPPOL.js";
|
|
85
|
-
import "./chunk-
|
|
86
|
-
import "./chunk-
|
|
87
|
-
import "./chunk-
|
|
89
|
+
import "./chunk-V2EGJD7W.js";
|
|
90
|
+
import "./chunk-OZLMT5WB.js";
|
|
91
|
+
import "./chunk-YSGVHT54.js";
|
|
88
92
|
import {
|
|
89
93
|
attachSessionExport
|
|
90
|
-
} from "./chunk-
|
|
91
|
-
import "./chunk-LXB3S4IC.js";
|
|
94
|
+
} from "./chunk-HSEIISLI.js";
|
|
92
95
|
import "./chunk-OH6TB27S.js";
|
|
93
96
|
import {
|
|
94
97
|
compilePermissionLayers,
|
|
95
98
|
permissionLayersOf,
|
|
96
99
|
warnLegacyMcpPermissionNames
|
|
97
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-JS4C7HNH.js";
|
|
98
101
|
import "./chunk-WMEZTDLT.js";
|
|
99
102
|
import {
|
|
100
103
|
cliLogger,
|
|
101
104
|
contextLogging,
|
|
102
105
|
createStderrSink,
|
|
103
106
|
installCliLogging
|
|
104
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-WOY7SAUB.js";
|
|
105
108
|
import "./chunk-SIG7WHBU.js";
|
|
109
|
+
import {
|
|
110
|
+
withModelLaunchEnvironment
|
|
111
|
+
} from "./chunk-3NJPNX6V.js";
|
|
106
112
|
import "./chunk-U5UV2YRE.js";
|
|
107
113
|
import "./chunk-IE5XIE4W.js";
|
|
108
114
|
import "./chunk-B73OIFL6.js";
|
|
109
|
-
import "./chunk-
|
|
115
|
+
import "./chunk-BKZW4DRY.js";
|
|
110
116
|
import "./chunk-JORONMD3.js";
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
117
|
+
import "./chunk-3LCJJT2F.js";
|
|
118
|
+
import "./chunk-7DYH6R67.js";
|
|
113
119
|
import {
|
|
114
120
|
BOOT_EVENT_NAMES,
|
|
115
121
|
EVENT_NAME_ATTRIBUTE,
|
|
@@ -124,7 +130,7 @@ import {
|
|
|
124
130
|
isRuntimeContextMessageSource,
|
|
125
131
|
isWorkingMemoryMessage,
|
|
126
132
|
jsonLinesSink
|
|
127
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-OKDDIWD7.js";
|
|
128
134
|
import {
|
|
129
135
|
__name
|
|
130
136
|
} from "./chunk-76FLAFCG.js";
|
|
@@ -535,6 +541,51 @@ async function readStdin(opts = {}) {
|
|
|
535
541
|
}
|
|
536
542
|
__name(readStdin, "readStdin");
|
|
537
543
|
|
|
544
|
+
// src/commands/stream-input.ts
|
|
545
|
+
import { StringDecoder } from "node:string_decoder";
|
|
546
|
+
var MAX_LINE_BYTES = 1024 * 1024;
|
|
547
|
+
function userText(line, number) {
|
|
548
|
+
let value;
|
|
549
|
+
try {
|
|
550
|
+
value = JSON.parse(line);
|
|
551
|
+
} catch {
|
|
552
|
+
throw new Error(`stdin line ${number}: expected a JSON user message`);
|
|
553
|
+
}
|
|
554
|
+
if (value === null || typeof value !== "object" || Array.isArray(value) || !("role" in value) || value.role !== "user" || !("content" in value) || typeof value.content !== "string" || !value.content.trim() || Object.keys(value).some((key) => !["role", "content", "timestamp"].includes(key)) || "timestamp" in value && (typeof value.timestamp !== "number" || !Number.isFinite(value.timestamp)))
|
|
555
|
+
throw new Error(
|
|
556
|
+
`stdin line ${number}: expected {"role":"user","content":"..."} with optional timestamp`
|
|
557
|
+
);
|
|
558
|
+
return value.content;
|
|
559
|
+
}
|
|
560
|
+
__name(userText, "userText");
|
|
561
|
+
async function* streamUserInput(input) {
|
|
562
|
+
const decoder = new StringDecoder("utf8");
|
|
563
|
+
let pending = "";
|
|
564
|
+
let number = 0;
|
|
565
|
+
for await (const chunk of input) {
|
|
566
|
+
const text = typeof chunk === "string" ? chunk : decoder.write(chunk);
|
|
567
|
+
let start = 0;
|
|
568
|
+
for (let end = text.indexOf("\n"); end !== -1; end = text.indexOf("\n", start)) {
|
|
569
|
+
const part = text.slice(start, end);
|
|
570
|
+
if (Buffer.byteLength(pending) + Buffer.byteLength(part) > MAX_LINE_BYTES)
|
|
571
|
+
throw new Error("stdin message exceeds 1 MiB");
|
|
572
|
+
const line = pending + part;
|
|
573
|
+
pending = "";
|
|
574
|
+
number += 1;
|
|
575
|
+
if (line.trim()) yield userText(line, number);
|
|
576
|
+
start = end + 1;
|
|
577
|
+
}
|
|
578
|
+
const tail = text.slice(start);
|
|
579
|
+
if (Buffer.byteLength(pending) + Buffer.byteLength(tail) > MAX_LINE_BYTES)
|
|
580
|
+
throw new Error("stdin message exceeds 1 MiB");
|
|
581
|
+
pending += tail;
|
|
582
|
+
}
|
|
583
|
+
pending += decoder.end();
|
|
584
|
+
if (Buffer.byteLength(pending) > MAX_LINE_BYTES) throw new Error("stdin message exceeds 1 MiB");
|
|
585
|
+
if (pending.trim()) yield userText(pending, number + 1);
|
|
586
|
+
}
|
|
587
|
+
__name(streamUserInput, "streamUserInput");
|
|
588
|
+
|
|
538
589
|
// src/commands/exec-json.ts
|
|
539
590
|
var EXIT_TURN_IN_PROGRESS = 75;
|
|
540
591
|
function defaultPrefs(detected) {
|
|
@@ -551,6 +602,23 @@ function writeJsonLine(o) {
|
|
|
551
602
|
`);
|
|
552
603
|
}
|
|
553
604
|
__name(writeJsonLine, "writeJsonLine");
|
|
605
|
+
function initEvent(session, permissionMode, cwd, sessionId) {
|
|
606
|
+
return {
|
|
607
|
+
kind: "init",
|
|
608
|
+
...sessionId ? { sessionId } : {},
|
|
609
|
+
cwd,
|
|
610
|
+
provider: session.providerSummary,
|
|
611
|
+
model: session.modelSummary,
|
|
612
|
+
permissionMode,
|
|
613
|
+
tools: [...session.toolNames()],
|
|
614
|
+
mcpServers: [
|
|
615
|
+
...session.mcpConnected.map((s) => ({ name: s.name, status: "connected" })),
|
|
616
|
+
...session.mcpFailed.map((s) => ({ name: s.name, status: "failed" }))
|
|
617
|
+
],
|
|
618
|
+
slashCommands: hostCommandNames()
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
__name(initEvent, "initEvent");
|
|
554
622
|
async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOutput) {
|
|
555
623
|
let ctx = bootstrapCtx;
|
|
556
624
|
const write = writeJsonLine;
|
|
@@ -567,10 +635,19 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
567
635
|
const limitsFromFlags = {
|
|
568
636
|
...flags.maxIterations !== null ? { maxIterations: flags.maxIterations } : {},
|
|
569
637
|
...flags.tokenBudget !== null ? { tokenBudget: flags.tokenBudget } : {},
|
|
638
|
+
...flags.maxOutputTokens !== null ? { maxResponseTokens: flags.maxOutputTokens } : {},
|
|
570
639
|
...flags.maxBudgetUsd !== null ? { costLimitUsd: flags.maxBudgetUsd } : {}
|
|
571
640
|
};
|
|
572
641
|
if (flags.unknown.length > 0) return fail(unknownOptionMessage(flags.unknown));
|
|
573
642
|
if (structuredOutput && "error" in structuredOutput) return fail(structuredOutput.error);
|
|
643
|
+
if (flags.forkSession) {
|
|
644
|
+
return fail("exec --json does not take --fork-session; it belongs to the default mode.");
|
|
645
|
+
}
|
|
646
|
+
if (flags.noSessionPersistence && flags.session !== null) {
|
|
647
|
+
return fail(
|
|
648
|
+
"--no-session-persistence cannot be combined with --session; drop --session for a stateless turn."
|
|
649
|
+
);
|
|
650
|
+
}
|
|
574
651
|
if (flags.continueLast || flags.resume !== null) {
|
|
575
652
|
return fail(
|
|
576
653
|
"exec --json does not take --continue or --resume; they belong to the default mode. Bind history with --session <id>, which keys a persisted conversation in this folder."
|
|
@@ -582,8 +659,26 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
582
659
|
);
|
|
583
660
|
}
|
|
584
661
|
const sessionKey = flags.session;
|
|
585
|
-
const
|
|
586
|
-
if (
|
|
662
|
+
const streamed = flags.inputFormat === "stream-json";
|
|
663
|
+
if (streamed && flags.rest.length > 0)
|
|
664
|
+
return fail("streamed input takes its prompts from stdin, not arguments");
|
|
665
|
+
if (streamed && process.stdin.isTTY) return fail("streamed input requires a pipe on stdin");
|
|
666
|
+
const inputs = streamed ? streamUserInput(process.stdin) : void 0;
|
|
667
|
+
let prompt = flags.rest.join(" ").trim();
|
|
668
|
+
try {
|
|
669
|
+
if (inputs) prompt = (await inputs.next()).value ?? "";
|
|
670
|
+
else if (flags.inputFormat === "text") {
|
|
671
|
+
const piped = await readStdin({ deadline: Boolean(prompt) });
|
|
672
|
+
prompt = prompt && piped.trim() ? `${prompt}
|
|
673
|
+
|
|
674
|
+
<stdin>
|
|
675
|
+
${piped.trim()}
|
|
676
|
+
</stdin>` : prompt || piped.trim();
|
|
677
|
+
}
|
|
678
|
+
} catch (error) {
|
|
679
|
+
return fail(error instanceof Error ? error.message : String(error));
|
|
680
|
+
}
|
|
681
|
+
if (!prompt) return fail("no prompt \u2014 pass it as an argument or supply stdin with --input-format");
|
|
587
682
|
const resolved = resolveWorkingDirectory(flags.cwd);
|
|
588
683
|
if ("error" in resolved) return fail(resolved.error);
|
|
589
684
|
const requestedCwd = resolved.cwd;
|
|
@@ -617,14 +712,14 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
617
712
|
let cli;
|
|
618
713
|
let conversationId = null;
|
|
619
714
|
let prior = [];
|
|
620
|
-
if (!sessionKey) {
|
|
715
|
+
if (!sessionKey && flags.inputFormat === null) {
|
|
621
716
|
const parsed = parsePriorMessages(await readStdin({ deadline: true }));
|
|
622
717
|
if (!parsed.ok) return fail(`invalid stdin history: ${parsed.error}`);
|
|
623
718
|
prior = [...parsed.messages];
|
|
624
719
|
}
|
|
625
720
|
try {
|
|
626
|
-
cli = await openSessions(cwd);
|
|
627
721
|
if (sessionKey) {
|
|
722
|
+
cli = await openSessions(cwd);
|
|
628
723
|
conversationId = await resolveConversation(cli, sessionKey);
|
|
629
724
|
prior = await loadConversation(cli, conversationId);
|
|
630
725
|
}
|
|
@@ -640,7 +735,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
640
735
|
}
|
|
641
736
|
const logging = contextLogging(ctx);
|
|
642
737
|
installCliLogging(jsonLinesSink(process.stderr), logging.level);
|
|
643
|
-
const { probeAgentSession, createAgentSession } = await import("./agent-
|
|
738
|
+
const { probeAgentSession, createAgentSession } = await import("./agent-F7HY5T3U.js");
|
|
644
739
|
const probe = await probeAgentSession();
|
|
645
740
|
let prefs = probe.preferences ?? defaultPrefs(probe.detected);
|
|
646
741
|
if (!prefs) {
|
|
@@ -676,17 +771,17 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
676
771
|
cwd,
|
|
677
772
|
...structuredOutput ? { structuredOutput } : {},
|
|
678
773
|
monitorTimeoutCapMs: EXEC_MONITOR_CAP_MS,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
774
|
+
...cli && conversationId ? {
|
|
775
|
+
scope: {
|
|
776
|
+
sessionId: conversationId,
|
|
777
|
+
topicId: cli.topicId,
|
|
778
|
+
projectId: cli.projectId,
|
|
779
|
+
tenantId: cli.tenantId
|
|
780
|
+
},
|
|
781
|
+
stateRoot: cli.root,
|
|
782
|
+
conversationSessions: cli
|
|
783
|
+
} : { sessionId: generateSessionId(), ephemeral: true },
|
|
686
784
|
learningObservations: ctx.config.learningObservations !== false,
|
|
687
|
-
// A keyed conversation appends to its log; a stateless one runs in an
|
|
688
|
-
// in-memory log, so nothing is written for it.
|
|
689
|
-
...conversationId ? { conversationSessions: cli } : { ephemeral: true },
|
|
690
785
|
rules: permissions.rules,
|
|
691
786
|
...run.appendSystem ? { appendSystem: run.appendSystem } : {},
|
|
692
787
|
// The operator's --gate commands, as a standing condition on the
|
|
@@ -748,6 +843,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
748
843
|
}
|
|
749
844
|
}, "reportMcpDiscoveries");
|
|
750
845
|
reportMcpDiscoveries();
|
|
846
|
+
write(initEvent(session, modeResult.mode, cwd, conversationId));
|
|
751
847
|
const extraSystem = await loadSkillsContext(cwd, flags.skills, ctx.config.skills);
|
|
752
848
|
const userMessage = {
|
|
753
849
|
role: "user",
|
|
@@ -784,7 +880,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
784
880
|
}
|
|
785
881
|
turnAbort.abort(new TurnCancelled("user"));
|
|
786
882
|
await session.close();
|
|
787
|
-
closeSessions(cli);
|
|
883
|
+
if (cli) closeSessions(cli);
|
|
788
884
|
});
|
|
789
885
|
let paused;
|
|
790
886
|
let history;
|
|
@@ -827,26 +923,72 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
827
923
|
}
|
|
828
924
|
}, "stream");
|
|
829
925
|
try {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
signal: turnAbort.signal,
|
|
834
|
-
...ctx.config.limits?.timeoutMs ? { timeoutMs: ctx.config.limits.timeoutMs } : {}
|
|
835
|
-
}) : void 0;
|
|
836
|
-
const monitorReport = stopped ? void 0 : await monitorWatch?.report({ signal: turnAbort.signal });
|
|
837
|
-
if (stopped || workflowReport === void 0 && monitorReport === void 0) break;
|
|
838
|
-
closedTurnsUsd += openTurnUsd;
|
|
839
|
-
openTurnUsd = 0;
|
|
840
|
-
if (spendLimitUsd > 0 && closedTurnsUsd >= spendLimitUsd) break;
|
|
926
|
+
let inputMessages = messages;
|
|
927
|
+
let typedInput = prompt;
|
|
928
|
+
while (true) {
|
|
841
929
|
await stream(
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
...monitorReport !== void 0 ? [monitorReportMessage(monitorReport)] : []
|
|
846
|
-
],
|
|
847
|
-
void 0,
|
|
848
|
-
spendLimitUsd > 0 ? { costLimitUsd: spendLimitUsd - closedTurnsUsd } : void 0
|
|
930
|
+
inputMessages,
|
|
931
|
+
typedInput,
|
|
932
|
+
closedTurnsUsd > 0 && spendLimitUsd > 0 ? { costLimitUsd: spendLimitUsd - closedTurnsUsd } : void 0
|
|
849
933
|
);
|
|
934
|
+
for (let rounds = 0; (watch || monitorWatch) && !stopped && !paused && !busy && rounds < MAX_REPORT_TURNS; rounds += 1) {
|
|
935
|
+
const workflowReport = watch ? await watch.report({
|
|
936
|
+
signal: turnAbort.signal,
|
|
937
|
+
...ctx.config.limits?.timeoutMs ? { timeoutMs: ctx.config.limits.timeoutMs } : {}
|
|
938
|
+
}) : void 0;
|
|
939
|
+
const monitorReport = stopped ? void 0 : await monitorWatch?.report({ signal: turnAbort.signal });
|
|
940
|
+
if (stopped || workflowReport === void 0 && monitorReport === void 0) break;
|
|
941
|
+
closedTurnsUsd += openTurnUsd;
|
|
942
|
+
openTurnUsd = 0;
|
|
943
|
+
if (spendLimitUsd > 0 && closedTurnsUsd >= spendLimitUsd) break;
|
|
944
|
+
await stream(
|
|
945
|
+
[
|
|
946
|
+
...history ?? inputMessages,
|
|
947
|
+
...workflowReport !== void 0 ? [reportMessage(workflowReport)] : [],
|
|
948
|
+
...monitorReport !== void 0 ? [monitorReportMessage(monitorReport)] : []
|
|
949
|
+
],
|
|
950
|
+
void 0,
|
|
951
|
+
spendLimitUsd > 0 ? { costLimitUsd: spendLimitUsd - closedTurnsUsd } : void 0
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
if (!inputs || stopped || paused || busy) break;
|
|
955
|
+
reportMcpDiscoveries();
|
|
956
|
+
write({
|
|
957
|
+
...terminalEvent ?? { kind: "done" },
|
|
958
|
+
...commandSpend(earlierBudgets, budget, session.workflows) ? { budget: commandSpend(earlierBudgets, budget, session.workflows) } : {}
|
|
959
|
+
});
|
|
960
|
+
const next = await inputs.next();
|
|
961
|
+
if (next.done) {
|
|
962
|
+
await session.close();
|
|
963
|
+
if (cli) closeSessions(cli);
|
|
964
|
+
watch?.dispose();
|
|
965
|
+
ended = true;
|
|
966
|
+
return EXIT_OK;
|
|
967
|
+
}
|
|
968
|
+
if (!history)
|
|
969
|
+
throw new Error(
|
|
970
|
+
"streamed input requires settled conversation history before the next prompt"
|
|
971
|
+
);
|
|
972
|
+
closedTurnsUsd += openTurnUsd;
|
|
973
|
+
openTurnUsd = 0;
|
|
974
|
+
if (spendLimitUsd > 0 && closedTurnsUsd >= spendLimitUsd)
|
|
975
|
+
throw new Error(describeSpendStop(spendLimitUsd));
|
|
976
|
+
terminalEvent = void 0;
|
|
977
|
+
typedInput = next.value;
|
|
978
|
+
const nextExpansion = expandHeadlessCommand(next.value, {
|
|
979
|
+
cwd,
|
|
980
|
+
builtins: hostCommandNames(),
|
|
981
|
+
...ctx.config.skills ? { skills: ctx.config.skills } : {}
|
|
982
|
+
});
|
|
983
|
+
if (nextExpansion.kind === "refused") throw new Error(nextExpansion.reason);
|
|
984
|
+
inputMessages = [
|
|
985
|
+
...history,
|
|
986
|
+
{
|
|
987
|
+
role: "user",
|
|
988
|
+
content: nextExpansion.kind === "expanded" ? nextExpansion.prompt : next.value,
|
|
989
|
+
timestamp: Date.now()
|
|
990
|
+
}
|
|
991
|
+
];
|
|
850
992
|
}
|
|
851
993
|
watch?.dispose();
|
|
852
994
|
} catch (err) {
|
|
@@ -859,7 +1001,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
859
1001
|
state: `after the turn failed (${message})${inConversation}.`
|
|
860
1002
|
};
|
|
861
1003
|
await session.close();
|
|
862
|
-
closeSessions(cli);
|
|
1004
|
+
if (cli) closeSessions(cli);
|
|
863
1005
|
if (stopped) return EXIT_OK;
|
|
864
1006
|
ended = true;
|
|
865
1007
|
return fail(message);
|
|
@@ -885,7 +1027,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
885
1027
|
state: paused ? `while the turn was paused: it keeps checkpoint ${paused.checkpointId}${inConversation}. Continue it with /resume or \`namzu drain\`, or close it with /abandon in the TUI.` : `after the turn ended; it is recorded${inConversation}, and nothing is left to close.`
|
|
886
1028
|
};
|
|
887
1029
|
await session.close();
|
|
888
|
-
closeSessions(cli);
|
|
1030
|
+
if (cli) closeSessions(cli);
|
|
889
1031
|
if (stopped) return EXIT_OK;
|
|
890
1032
|
ended = true;
|
|
891
1033
|
write(settled.last);
|
|
@@ -945,6 +1087,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
945
1087
|
const limitsFromFlags = {
|
|
946
1088
|
...flags.maxIterations !== null ? { maxIterations: flags.maxIterations } : {},
|
|
947
1089
|
...flags.tokenBudget !== null ? { tokenBudget: flags.tokenBudget } : {},
|
|
1090
|
+
...flags.maxOutputTokens !== null ? { maxResponseTokens: flags.maxOutputTokens } : {},
|
|
948
1091
|
...flags.maxBudgetUsd !== null ? { costLimitUsd: flags.maxBudgetUsd } : {}
|
|
949
1092
|
};
|
|
950
1093
|
if (flags.unknown.length > 0) {
|
|
@@ -955,6 +1098,12 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
955
1098
|
ctx.formatter.error({ message: structuredOutput.error });
|
|
956
1099
|
return EXIT_USAGE;
|
|
957
1100
|
}
|
|
1101
|
+
if (flags.forkSession && !flags.continueLast && flags.resume === null) {
|
|
1102
|
+
ctx.formatter.error({
|
|
1103
|
+
message: "--fork-session copies a conversation to carry on in; pass --continue or --resume <id> with it"
|
|
1104
|
+
});
|
|
1105
|
+
return EXIT_USAGE;
|
|
1106
|
+
}
|
|
958
1107
|
if (flags.session !== null) {
|
|
959
1108
|
ctx.formatter.error({
|
|
960
1109
|
message: "--session binds a host conversation for `exec --json`; this mode resumes with --continue or --resume <id>"
|
|
@@ -1011,7 +1160,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1011
1160
|
const promptUntilPiped = expansion.kind === "expanded" ? expansion.prompt : prompt;
|
|
1012
1161
|
const logging = contextLogging(ctx);
|
|
1013
1162
|
installCliLogging(createStderrSink(logging.format), logging.level);
|
|
1014
|
-
const { probeAgentSession, createAgentSession } = await import("./agent-
|
|
1163
|
+
const { probeAgentSession, createAgentSession } = await import("./agent-F7HY5T3U.js");
|
|
1015
1164
|
const probe = await probeAgentSession();
|
|
1016
1165
|
let prefs = probe.preferences ?? defaultPrefs2(probe.detected);
|
|
1017
1166
|
if (!prefs) {
|
|
@@ -1072,51 +1221,79 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1072
1221
|
return 1;
|
|
1073
1222
|
}
|
|
1074
1223
|
}
|
|
1224
|
+
const ephemeral = flags.noSessionPersistence;
|
|
1075
1225
|
let sessions;
|
|
1076
1226
|
try {
|
|
1077
|
-
|
|
1227
|
+
if (!ephemeral || flags.continueLast || flags.resume !== null) {
|
|
1228
|
+
sessions = ephemeral ? await openSessions(cwd, { readOnly: true }) : await openSessions(cwd);
|
|
1229
|
+
}
|
|
1078
1230
|
} catch (error) {
|
|
1079
1231
|
await sessionExport?.shutdown();
|
|
1232
|
+
if (ephemeral && error.code === "ENOENT") {
|
|
1233
|
+
ctx.formatter.error({
|
|
1234
|
+
message: `no previous conversation in ${cwd} \u2014 run without --continue or --resume to start one, or pass --cwd if you meant a different directory`
|
|
1235
|
+
});
|
|
1236
|
+
return EXIT_USAGE;
|
|
1237
|
+
}
|
|
1080
1238
|
ctx.formatter.error({
|
|
1081
1239
|
message: `workspace state is unavailable: ${error instanceof Error ? error.message : String(error)}`
|
|
1082
1240
|
});
|
|
1083
1241
|
return 1;
|
|
1084
1242
|
}
|
|
1085
1243
|
const resume = await resolveResume(
|
|
1086
|
-
sessions,
|
|
1244
|
+
sessions ?? null,
|
|
1087
1245
|
{ continueLast: flags.continueLast, sessionId: flags.resume },
|
|
1088
1246
|
cwd
|
|
1089
1247
|
);
|
|
1090
1248
|
if (resume.kind === "error") {
|
|
1091
1249
|
ctx.formatter.error({ message: resume.message });
|
|
1250
|
+
if (sessions) closeSessions(sessions);
|
|
1092
1251
|
await sessionExport?.shutdown();
|
|
1093
1252
|
return EXIT_USAGE;
|
|
1094
1253
|
}
|
|
1095
|
-
|
|
1254
|
+
let prior = resume.kind === "resumed" ? resume.messages : [];
|
|
1096
1255
|
let sessionId;
|
|
1097
1256
|
try {
|
|
1098
|
-
|
|
1257
|
+
if (ephemeral) {
|
|
1258
|
+
prior = prior.map(({ id: _id, ...message }) => message);
|
|
1259
|
+
sessionId = generateSessionId();
|
|
1260
|
+
if (sessions) closeSessions(sessions);
|
|
1261
|
+
sessions = void 0;
|
|
1262
|
+
} else if (sessions && resume.kind === "resumed" && flags.forkSession) {
|
|
1263
|
+
const copy = await forkConversation(sessions, asSessionId(resume.sessionId));
|
|
1264
|
+
sessionId = copy.id;
|
|
1265
|
+
prior = copy.messages;
|
|
1266
|
+
} else if (sessions) {
|
|
1267
|
+
sessionId = resume.kind === "resumed" ? asSessionId(resume.sessionId) : await startConversation(sessions);
|
|
1268
|
+
} else {
|
|
1269
|
+
throw new Error("conversation store is unavailable");
|
|
1270
|
+
}
|
|
1099
1271
|
} catch (error) {
|
|
1100
|
-
closeSessions(sessions);
|
|
1272
|
+
if (sessions) closeSessions(sessions);
|
|
1101
1273
|
await sessionExport?.shutdown();
|
|
1102
1274
|
ctx.formatter.error({
|
|
1103
1275
|
message: `could not start a conversation: ${error instanceof Error ? error.message : String(error)}`
|
|
1104
1276
|
});
|
|
1105
1277
|
return 1;
|
|
1106
1278
|
}
|
|
1279
|
+
const release = /* @__PURE__ */ __name(async () => {
|
|
1280
|
+
if (sessions) closeSessions(sessions);
|
|
1281
|
+
}, "release");
|
|
1107
1282
|
const session = await createAgentSession(prefs, probe.detected, {
|
|
1108
1283
|
cwd,
|
|
1109
1284
|
...structuredOutput ? { structuredOutput } : {},
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1285
|
+
...sessions ? {
|
|
1286
|
+
scope: {
|
|
1287
|
+
sessionId,
|
|
1288
|
+
topicId: sessions.topicId,
|
|
1289
|
+
projectId: sessions.projectId,
|
|
1290
|
+
tenantId: sessions.tenantId
|
|
1291
|
+
},
|
|
1292
|
+
stateRoot: sessions.root,
|
|
1293
|
+
conversationSessions: sessions
|
|
1294
|
+
} : { sessionId, ephemeral: true },
|
|
1117
1295
|
learningObservations: ctx.config.learningObservations !== false,
|
|
1118
1296
|
monitorTimeoutCapMs: EXEC_MONITOR_CAP_MS,
|
|
1119
|
-
conversationSessions: sessions,
|
|
1120
1297
|
rules: permissions.rules,
|
|
1121
1298
|
...run.appendSystem ? { appendSystem: run.appendSystem } : {},
|
|
1122
1299
|
...sessionExport ? { onSessionEvent: sessionExport.listener } : {},
|
|
@@ -1147,7 +1324,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1147
1324
|
});
|
|
1148
1325
|
if (!session.hasProvider) {
|
|
1149
1326
|
await session.close();
|
|
1150
|
-
|
|
1327
|
+
await release();
|
|
1151
1328
|
await sessionExport?.shutdown();
|
|
1152
1329
|
ctx.formatter.error({
|
|
1153
1330
|
message: session.errorHint ?? "agent is not ready"
|
|
@@ -1156,7 +1333,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1156
1333
|
}
|
|
1157
1334
|
if (modeResult.mode === "classify" && session.autoMode?.available === false) {
|
|
1158
1335
|
await session.close();
|
|
1159
|
-
|
|
1336
|
+
await release();
|
|
1160
1337
|
await sessionExport?.shutdown();
|
|
1161
1338
|
ctx.formatter.error({ message: session.autoMode.reason ?? "Auto mode is not available." });
|
|
1162
1339
|
return EXIT_USAGE;
|
|
@@ -1168,7 +1345,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1168
1345
|
});
|
|
1169
1346
|
}
|
|
1170
1347
|
await session.close();
|
|
1171
|
-
|
|
1348
|
+
await release();
|
|
1172
1349
|
await sessionExport?.shutdown();
|
|
1173
1350
|
return 1;
|
|
1174
1351
|
}
|
|
@@ -1193,7 +1370,10 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1193
1370
|
}
|
|
1194
1371
|
const extraSystem = await loadSkillsContext(cwd, flags.skills, ctx.config.skills);
|
|
1195
1372
|
if (resume.kind === "resumed") {
|
|
1196
|
-
|
|
1373
|
+
const copied = sessionId === resume.sessionId ? "" : ephemeral ? " \xB7 as a copy that is not kept" : ` \xB7 carrying on in a copy, ${sessionId}`;
|
|
1374
|
+
ctx.formatter.info(`resuming ${resume.sessionId} \xB7 ${prior.length} messages${copied}`);
|
|
1375
|
+
} else if (ephemeral) {
|
|
1376
|
+
ctx.formatter.info("this run is not kept");
|
|
1197
1377
|
}
|
|
1198
1378
|
let text = "";
|
|
1199
1379
|
const measured = {};
|
|
@@ -1226,10 +1406,12 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1226
1406
|
}, "afterPhase");
|
|
1227
1407
|
termination.onTerminate(async (signal) => {
|
|
1228
1408
|
stopped = true;
|
|
1229
|
-
ctx.formatter.error({
|
|
1409
|
+
ctx.formatter.error({
|
|
1410
|
+
message: ephemeral ? `stopped by ${signal}; this run is not kept` : stoppedBy(signal, sessionId, phase, stop.paused)
|
|
1411
|
+
});
|
|
1230
1412
|
turnAbort.abort(new TurnCancelled("user"));
|
|
1231
1413
|
await session.close();
|
|
1232
|
-
|
|
1414
|
+
await release();
|
|
1233
1415
|
await sessionExport?.shutdown();
|
|
1234
1416
|
});
|
|
1235
1417
|
const consume = /* @__PURE__ */ __name(async (stream) => {
|
|
@@ -1359,7 +1541,7 @@ Not resumed: ${decision.reason}.`;
|
|
|
1359
1541
|
const failed = stop.failed;
|
|
1360
1542
|
const paused = stop.paused !== null || stop.busy;
|
|
1361
1543
|
await session.close();
|
|
1362
|
-
|
|
1544
|
+
await release();
|
|
1363
1545
|
await sessionExport?.shutdown();
|
|
1364
1546
|
const spent = spend();
|
|
1365
1547
|
if (spent) {
|
|
@@ -1407,6 +1589,13 @@ var execCommand = {
|
|
|
1407
1589
|
"",
|
|
1408
1590
|
"Options:",
|
|
1409
1591
|
" --json Stream one JSON event per line instead of the reply",
|
|
1592
|
+
" --print, -p Explicit headless print mode (exec is already headless)",
|
|
1593
|
+
" --output-format <f> text | json (final result) | stream-json (same as --json)",
|
|
1594
|
+
" --input-format <f> text | stream-json; explicit text stdin is prompt material.",
|
|
1595
|
+
" stream-json requires streaming output; one native user",
|
|
1596
|
+
' message per line: {"role":"user","content":"..."}.',
|
|
1597
|
+
" Each line starts a turn as it arrives, before stdin EOF.",
|
|
1598
|
+
" No prompt arguments; each turn ends with done.",
|
|
1410
1599
|
" --output-schema <f> Bind the final answer to the JSON Schema in file f,",
|
|
1411
1600
|
" using the provider\u2019s native structured output",
|
|
1412
1601
|
" --mcp-config <f> Add the tool servers in file f for this run; repeatable",
|
|
@@ -1416,12 +1605,20 @@ var execCommand = {
|
|
|
1416
1605
|
" --skills <a,b,c> Load these skills as context for the turn",
|
|
1417
1606
|
" --continue, -c Resume the most recent conversation here",
|
|
1418
1607
|
" --resume <id> Resume that conversation, and no other",
|
|
1608
|
+
" --fork-session With --continue or --resume: carry on in a copy, leaving",
|
|
1609
|
+
" the original as it was",
|
|
1610
|
+
" --no-session-persistence",
|
|
1611
|
+
" Keep no record of this run; a resumed conversation is",
|
|
1612
|
+
" worked on in memory and the original is not written to.",
|
|
1613
|
+
" With --json: explicit stateless mode; refuses --session",
|
|
1419
1614
|
" --session <id> With --json: bind the turn to the host conversation",
|
|
1420
1615
|
" keyed by this id",
|
|
1421
1616
|
" --gate <command> Verify proposed answers with this command; repeatable",
|
|
1422
1617
|
" --gate-retries <n> Fix attempts a failing gate allows (default 3)",
|
|
1423
1618
|
" --max-iterations <n> Main-loop iteration limit (default 50; 0 unlimited)",
|
|
1424
1619
|
" --token-budget <n> Tree token limit (default unlimited; 0 removes a configured cap)",
|
|
1620
|
+
" --max-output-tokens <n> Per-call output allowance, including reasoning; overrides",
|
|
1621
|
+
" NAMZU_MAX_OUTPUT_TOKENS and limits.maxResponseTokens",
|
|
1425
1622
|
" --append-system-prompt <text|@file>",
|
|
1426
1623
|
" Add standing instructions for this run; @file reads them",
|
|
1427
1624
|
" from a file. They go after the cached part of the prompt.",
|
|
@@ -1517,10 +1714,12 @@ var execCommand = {
|
|
|
1517
1714
|
handler: withTerminationHandling(async (args, termination) => {
|
|
1518
1715
|
let flags;
|
|
1519
1716
|
try {
|
|
1520
|
-
flags = parseExecFlags(args.rawArgs);
|
|
1717
|
+
flags = withModelLaunchEnvironment(parseExecFlags(args.rawArgs));
|
|
1521
1718
|
} catch (error) {
|
|
1522
1719
|
const message = error instanceof Error ? error.message : String(error);
|
|
1523
|
-
if (args.rawArgs.includes("--json"))
|
|
1720
|
+
if (args.rawArgs.includes("--json") || args.rawArgs.includes("--output-format=stream-json") || args.rawArgs.some(
|
|
1721
|
+
(arg, index) => arg === "--output-format" && args.rawArgs[index + 1] === "stream-json"
|
|
1722
|
+
)) {
|
|
1524
1723
|
writeJsonLine({ kind: "error", message });
|
|
1525
1724
|
writeJsonLine({ kind: "done" });
|
|
1526
1725
|
return 0;
|
|
@@ -1529,11 +1728,20 @@ var execCommand = {
|
|
|
1529
1728
|
return EXIT_USAGE;
|
|
1530
1729
|
}
|
|
1531
1730
|
const structuredOutput = loadExecOutputSchema(flags.outputSchema);
|
|
1532
|
-
|
|
1731
|
+
const formatted = flags.outputFormat === "text" || flags.outputFormat === "json" ? {
|
|
1732
|
+
...args,
|
|
1733
|
+
ctx: {
|
|
1734
|
+
...args.ctx,
|
|
1735
|
+
formatter: createFormatter(flags.outputFormat, {
|
|
1736
|
+
quiet: contextLogging(args.ctx).level === "silent"
|
|
1737
|
+
})
|
|
1738
|
+
}
|
|
1739
|
+
} : args;
|
|
1740
|
+
return flags.json ? execJson(formatted, termination, flags, structuredOutput) : execPrint(formatted, termination, flags, structuredOutput);
|
|
1533
1741
|
})
|
|
1534
1742
|
};
|
|
1535
1743
|
export {
|
|
1536
1744
|
composePrompt,
|
|
1537
1745
|
execCommand
|
|
1538
1746
|
};
|
|
1539
|
-
//# sourceMappingURL=exec-
|
|
1747
|
+
//# sourceMappingURL=exec-EWGVFJNZ.js.map
|