@namzu/cli 43.0.0 → 44.0.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 +104 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-GKYFK7VQ.js → acp-3D2PPXYC.js} +39 -38
- package/dist/chunks/acp-3D2PPXYC.js.map +6 -0
- package/dist/chunks/{activity-command-TOTM3MOY.js → activity-command-WE45L6EF.js} +12 -12
- package/dist/chunks/{add-4GRA6X5I.js → add-RLDOB23V.js} +14 -14
- package/dist/chunks/{agent-KEI53I7S.js → agent-VXVUHPUF.js} +30 -29
- package/dist/chunks/agent-session-HLH4P7W4.js +59 -0
- package/dist/chunks/{archive-OOQMVBUH.js → archive-M5SZWEBT.js} +10 -10
- package/dist/chunks/{bin-main-L67SJQV2.js → bin-main-HCAGOSEJ.js} +4 -4
- package/dist/chunks/{browser-GDIYUWKT.js → browser-GO5REABI.js} +6 -6
- package/dist/chunks/{chat-FUQOCA7Q.js → chat-ZV3OQQRQ.js} +15 -15
- package/dist/chunks/{chunk-4V2V2FMP.js → chunk-2343E2J7.js} +2 -2
- package/dist/chunks/{chunk-W6ZZLT64.js → chunk-26VFNQCY.js} +3 -3
- package/dist/chunks/{chunk-ODOM3I7B.js → chunk-2AUFXSKS.js} +248 -19
- package/dist/chunks/chunk-2AUFXSKS.js.map +6 -0
- package/dist/chunks/{chunk-XV3FGIHS.js → chunk-2QWVT55W.js} +235 -8
- package/dist/chunks/chunk-2QWVT55W.js.map +6 -0
- package/dist/chunks/{chunk-TAAAO6PM.js → chunk-3IPE4LDE.js} +2 -2
- package/dist/chunks/{chunk-VWNLO4OM.js → chunk-3J4ALTG2.js} +6 -4
- package/dist/chunks/chunk-3J4ALTG2.js.map +6 -0
- package/dist/chunks/{chunk-DABNNT6R.js → chunk-3PSNEUBW.js} +7 -7
- package/dist/chunks/{chunk-NXM3BLL4.js → chunk-44OG65HR.js} +3 -3
- package/dist/chunks/{chunk-OUGL6FI2.js → chunk-4C6462L3.js} +2 -2
- package/dist/chunks/{chunk-LCVRXUEV.js → chunk-4NBV2LZS.js} +2 -2
- package/dist/chunks/{chunk-HAAL3DME.js → chunk-4PSNBASI.js} +3 -3
- package/dist/chunks/{chunk-RHT52Z5X.js → chunk-4TBPO43I.js} +2 -2
- package/dist/chunks/{chunk-2S4VEEVB.js → chunk-5OVJ2ZCX.js} +8 -8
- package/dist/chunks/{chunk-VNK6EA2D.js → chunk-5WHSDJCC.js} +2 -2
- package/dist/chunks/{chunk-NOG4Z42R.js → chunk-5WJAAPVQ.js} +3 -3
- package/dist/chunks/{chunk-EADX2OKC.js → chunk-5WJXI4JR.js} +2 -2
- package/dist/chunks/{chunk-UB5YVQJM.js → chunk-6LLUYDBO.js} +4 -4
- package/dist/chunks/{chunk-OK4UNUNI.js → chunk-7M6ZU2NT.js} +2 -2
- package/dist/chunks/{chunk-PXSTTFI7.js → chunk-7QFW6TV7.js} +49 -23
- package/dist/chunks/chunk-7QFW6TV7.js.map +6 -0
- package/dist/chunks/{chunk-GURZ2GEB.js → chunk-7S2H77Y7.js} +3 -3
- package/dist/chunks/{chunk-TZQT5JL3.js → chunk-AN3DBA6N.js} +4 -4
- package/dist/chunks/chunk-ARCMOPO3.js +157 -0
- package/dist/chunks/chunk-ARCMOPO3.js.map +6 -0
- package/dist/chunks/{chunk-6G3XZZRF.js → chunk-AX7KHJVF.js} +2 -2
- package/dist/chunks/{chunk-6WK7YVAX.js → chunk-B6QM5F2E.js} +87 -39
- package/dist/chunks/chunk-B6QM5F2E.js.map +6 -0
- package/dist/chunks/{chunk-TYMIKXOD.js → chunk-CC2HK5I5.js} +2 -2
- package/dist/chunks/{chunk-BHW43OKH.js → chunk-CECVIOY5.js} +3 -3
- package/dist/chunks/{chunk-IY7XWRXE.js → chunk-CLXRRUDH.js} +149 -17
- package/dist/chunks/chunk-CLXRRUDH.js.map +6 -0
- package/dist/chunks/{chunk-XZPLOQBA.js → chunk-CQC6GJQE.js} +2 -2
- package/dist/chunks/{chunk-NWW46AII.js → chunk-DU27LH3W.js} +2 -2
- package/dist/chunks/{chunk-BBERAGUX.js → chunk-DW3ML3PZ.js} +4 -4
- package/dist/chunks/{chunk-TIBFEO2R.js → chunk-E2F7P6GI.js} +2 -2
- package/dist/chunks/{chunk-OIOA7BRC.js → chunk-FVYKDRVT.js} +5 -5
- package/dist/chunks/{chunk-VRUEY647.js → chunk-G7D7FNRZ.js} +2 -2
- package/dist/chunks/{chunk-Z3VSDOCX.js → chunk-GLCZ7227.js} +207 -8
- package/dist/chunks/chunk-GLCZ7227.js.map +6 -0
- package/dist/chunks/{chunk-MJRLJDNK.js → chunk-GQ6ZQA7C.js} +2 -2
- package/dist/chunks/{chunk-GNG6HJIV.js → chunk-GYW5IJ5R.js} +75544 -73973
- package/dist/chunks/chunk-GYW5IJ5R.js.map +6 -0
- package/dist/chunks/{chunk-W6Z7RNVL.js → chunk-HOWIEIPK.js} +9 -9
- package/dist/chunks/{chunk-FTMTO72X.js → chunk-HSEIISLI.js} +2 -1
- package/dist/chunks/{chunk-FFXSL2SL.js → chunk-I7HAYS6Z.js} +15 -3
- package/dist/chunks/chunk-I7HAYS6Z.js.map +6 -0
- package/dist/chunks/{chunk-3SQVE73V.js → chunk-J6LQJ3H4.js} +1377 -425
- package/dist/chunks/chunk-J6LQJ3H4.js.map +6 -0
- package/dist/chunks/{chunk-54TFQUPM.js → chunk-JLZP3PRV.js} +4 -4
- package/dist/chunks/{chunk-UPXD4LJ5.js → chunk-JWFCCQGM.js} +6 -5
- package/dist/chunks/chunk-JWFCCQGM.js.map +6 -0
- package/dist/chunks/{chunk-XGOM2KHV.js → chunk-LAAQCLVV.js} +6 -6
- package/dist/chunks/{chunk-DXTK4EMM.js → chunk-LC4R7FEV.js} +2 -2
- package/dist/chunks/{chunk-P73IFAYM.js → chunk-LEVQANRZ.js} +15 -15
- package/dist/chunks/chunk-LEVQANRZ.js.map +6 -0
- package/dist/chunks/{chunk-VTU23NBS.js → chunk-LYI2HXN4.js} +6 -6
- package/dist/chunks/{chunk-I7FY5SK5.js → chunk-ON4RSB2L.js} +4 -4
- package/dist/chunks/{chunk-AEZ7YTIJ.js → chunk-OQMQL3WF.js} +3 -3
- package/dist/chunks/{chunk-IJUCXVG5.js → chunk-PAB3MJVU.js} +2 -2
- package/dist/chunks/{chunk-B4I264HC.js → chunk-PLYCCNXW.js} +6 -6
- package/dist/chunks/{chunk-EM5AM5BR.js → chunk-PYMCT4ZA.js} +3 -3
- package/dist/chunks/{chunk-5QCBUBKO.js → chunk-Q7NNEWMZ.js} +4 -4
- package/dist/chunks/{chunk-EDP5FDN4.js → chunk-QRC4LSKT.js} +7 -7
- package/dist/chunks/{chunk-2R44UHEU.js → chunk-QXRLKALD.js} +2 -2
- package/dist/chunks/{chunk-WQDMDSPW.js → chunk-R4MQECAY.js} +4 -4
- package/dist/chunks/{chunk-CD5X75DB.js → chunk-R7IUMUGJ.js} +2 -2
- package/dist/chunks/{chunk-V5YIGRUD.js → chunk-SLVAGDHU.js} +5 -5
- package/dist/chunks/{chunk-2C5QF5ZM.js → chunk-UFSCA2XZ.js} +2 -2
- package/dist/chunks/{chunk-LAQTQNQE.js → chunk-UQKTVCUV.js} +8 -8
- package/dist/chunks/{chunk-VNFXDLKD.js → chunk-USAZW2SV.js} +3 -3
- package/dist/chunks/{chunk-M3RKXXZE.js → chunk-V3P5BZE4.js} +3 -3
- package/dist/chunks/{chunk-BNYTG2ZC.js → chunk-VESQFRF3.js} +328 -18
- package/dist/chunks/chunk-VESQFRF3.js.map +6 -0
- package/dist/chunks/{chunk-NJ6P3WPZ.js → chunk-VHS5I4HA.js} +2 -2
- package/dist/chunks/{chunk-752S5IP3.js → chunk-W4B3XGK5.js} +45 -3
- package/dist/chunks/chunk-W4B3XGK5.js.map +6 -0
- package/dist/chunks/{chunk-7WQS7BP2.js → chunk-WALXUBIZ.js} +2 -2
- package/dist/chunks/{chunk-LWPTVYRU.js → chunk-WPECMU3F.js} +4 -4
- package/dist/chunks/{chunk-N4DS6G4I.js → chunk-XS2JWCGM.js} +13 -13
- package/dist/chunks/{chunk-SM377CLQ.js → chunk-YV227DWZ.js} +2 -2
- package/dist/chunks/cli-runtime-35A3RAU6.js +337 -0
- package/dist/chunks/cli-runtime-35A3RAU6.js.map +6 -0
- package/dist/chunks/{commands-4ZTQFX2X.js → commands-OWQUB7JT.js} +5 -5
- package/dist/chunks/{crash-report-Y6U6CH73.js → crash-report-KDMLQRS6.js} +6 -6
- package/dist/chunks/{dist-GTK2JZSU.js → dist-4LKH4B3B.js} +4 -3
- package/dist/chunks/dist-4LKH4B3B.js.map +6 -0
- package/dist/chunks/{dist-3YHUITAK.js → dist-5A3XKURK.js} +2 -2
- package/dist/chunks/{dist-ZNMZHP7A.js → dist-FURVCE4N.js} +2 -2
- package/dist/chunks/{dist-TKVIIUPJ.js → dist-RS5H5LHE.js} +2 -2
- package/dist/chunks/{dist-XP72U44M.js → dist-VKC2OF2P.js} +2 -2
- package/dist/chunks/{dist-OKRQSUWC.js → dist-WPETBMRE.js} +2 -2
- package/dist/chunks/{dist-J36EH26G.js → dist-XFPIH4KV.js} +2 -2
- package/dist/chunks/{doctor-WKZ7BGFC.js → doctor-ZDM3LGPR.js} +13 -13
- package/dist/chunks/{drain-VOM6IT3C.js → drain-BCDD6WT4.js} +10 -10
- package/dist/chunks/{eval-7MDLH5UR.js → eval-CWHRB4CM.js} +2 -2
- package/dist/chunks/{exec-YBTNNBSS.js → exec-ZL7XCVPV.js} +290 -88
- package/dist/chunks/exec-ZL7XCVPV.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-B3DTR4JZ.js} +3 -3
- package/dist/chunks/{host-queries-A3XQQHI4.js → host-queries-RIHABSRA.js} +15 -15
- package/dist/chunks/{learn-N2FNKNCW.js → learn-FVDHNZ3E.js} +13 -13
- package/dist/chunks/{learn-builtin-3SQNWE77.js → learn-builtin-DIGVMU2K.js} +16 -16
- package/dist/chunks/{lifecycle-TIEMDICJ.js → lifecycle-T5KZCOME.js} +23 -23
- package/dist/chunks/{list-HGGKMHPQ.js → list-ALYIIETE.js} +10 -10
- package/dist/chunks/{live-JHNWMJIE.js → live-QYXRKG27.js} +12 -12
- package/dist/chunks/{login-CLFAZ2WB.js → login-YYDHSXYZ.js} +8 -8
- package/dist/chunks/{logs-A5HZQ3XA.js → logs-HGYW5QG6.js} +4 -4
- package/dist/chunks/{mcp-V27XPHVU.js → mcp-DXCRUYBA.js} +15 -15
- package/dist/chunks/{message-command-HBTDJ6WS.js → message-command-7A2FC7PW.js} +36 -35
- package/dist/chunks/message-command-7A2FC7PW.js.map +6 -0
- package/dist/chunks/{operator-tools-7YJWXVYR.js → operator-tools-HM2DKEA3.js} +13 -13
- package/dist/chunks/{output-schema-NEJ27MH6.js → output-schema-S4OZKHPX.js} +3 -3
- package/dist/chunks/{pal-LX2FA7N2.js → pal-PISV32OY.js} +11 -11
- package/dist/chunks/{providers-XRDUL4OO.js → providers-UCHYI3MC.js} +6 -6
- package/dist/chunks/{resident-T6QB5MX7.js → resident-Y3WMPAB4.js} +24 -24
- package/dist/chunks/{resident-T6QB5MX7.js.map → resident-Y3WMPAB4.js.map} +1 -1
- package/dist/chunks/resume-PM73RFB2.js +23 -0
- package/dist/chunks/{resume-command-VSFQAVVN.js → resume-command-TNYIW6PZ.js} +4 -4
- package/dist/chunks/{schedule-GCBVV54F.js → schedule-PPTJ3BJ7.js} +8 -8
- package/dist/chunks/{service-UQPEAJKT.js → service-OMRDQOPM.js} +22 -22
- package/dist/chunks/{session-step-OKCO6S7R.js → session-step-C54ZEOLL.js} +16 -16
- package/dist/chunks/{skills-LCTXKJCR.js → skills-CNZMMJFB.js} +8 -8
- package/dist/chunks/{start-check-NAACA6IE.js → start-check-H4GSB34J.js} +2 -2
- package/dist/chunks/{state-GNWJY3F2.js → state-VEYKYIIF.js} +2 -2
- package/dist/chunks/{store-KGH5U7KF.js → store-BGVZ7PVQ.js} +4 -4
- package/dist/chunks/{store-7ZXMZ6ES.js → store-FW3TZA4K.js} +14 -10
- package/dist/chunks/{store-44ZZJVF3.js → store-S3M6B7JR.js} +6 -6
- package/dist/chunks/{tui-TNCMJCJJ.js → tui-XJNDU54J.js} +1469 -773
- package/dist/chunks/tui-XJNDU54J.js.map +6 -0
- package/dist/chunks/{upgrade-DU4I5ACF.js → upgrade-XRCA3O4X.js} +6 -6
- package/dist/chunks/{worktree-XGJCKZQJ.js → worktree-C6G5PFNW.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 +14 -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/schema.d.ts +21 -2
- package/dist/config/schema.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 +16 -16
- 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 +21 -21
- 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 +21 -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/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-IY7XWRXE.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/message-command-HBTDJ6WS.js.map +0 -6
- package/dist/chunks/resume-YPKHTYLO.js +0 -23
- package/dist/chunks/tui-TNCMJCJJ.js.map +0 -6
- /package/dist/chunks/{activity-command-TOTM3MOY.js.map → activity-command-WE45L6EF.js.map} +0 -0
- /package/dist/chunks/{add-4GRA6X5I.js.map → add-RLDOB23V.js.map} +0 -0
- /package/dist/chunks/{agent-KEI53I7S.js.map → agent-VXVUHPUF.js.map} +0 -0
- /package/dist/chunks/{agent-session-4IF5H4YO.js.map → agent-session-HLH4P7W4.js.map} +0 -0
- /package/dist/chunks/{archive-OOQMVBUH.js.map → archive-M5SZWEBT.js.map} +0 -0
- /package/dist/chunks/{bin-main-L67SJQV2.js.map → bin-main-HCAGOSEJ.js.map} +0 -0
- /package/dist/chunks/{browser-GDIYUWKT.js.map → browser-GO5REABI.js.map} +0 -0
- /package/dist/chunks/{chat-FUQOCA7Q.js.map → chat-ZV3OQQRQ.js.map} +0 -0
- /package/dist/chunks/{chunk-4V2V2FMP.js.map → chunk-2343E2J7.js.map} +0 -0
- /package/dist/chunks/{chunk-W6ZZLT64.js.map → chunk-26VFNQCY.js.map} +0 -0
- /package/dist/chunks/{chunk-TAAAO6PM.js.map → chunk-3IPE4LDE.js.map} +0 -0
- /package/dist/chunks/{chunk-DABNNT6R.js.map → chunk-3PSNEUBW.js.map} +0 -0
- /package/dist/chunks/{chunk-NXM3BLL4.js.map → chunk-44OG65HR.js.map} +0 -0
- /package/dist/chunks/{chunk-OUGL6FI2.js.map → chunk-4C6462L3.js.map} +0 -0
- /package/dist/chunks/{chunk-LCVRXUEV.js.map → chunk-4NBV2LZS.js.map} +0 -0
- /package/dist/chunks/{chunk-HAAL3DME.js.map → chunk-4PSNBASI.js.map} +0 -0
- /package/dist/chunks/{chunk-RHT52Z5X.js.map → chunk-4TBPO43I.js.map} +0 -0
- /package/dist/chunks/{chunk-2S4VEEVB.js.map → chunk-5OVJ2ZCX.js.map} +0 -0
- /package/dist/chunks/{chunk-VNK6EA2D.js.map → chunk-5WHSDJCC.js.map} +0 -0
- /package/dist/chunks/{chunk-NOG4Z42R.js.map → chunk-5WJAAPVQ.js.map} +0 -0
- /package/dist/chunks/{chunk-EADX2OKC.js.map → chunk-5WJXI4JR.js.map} +0 -0
- /package/dist/chunks/{chunk-UB5YVQJM.js.map → chunk-6LLUYDBO.js.map} +0 -0
- /package/dist/chunks/{chunk-OK4UNUNI.js.map → chunk-7M6ZU2NT.js.map} +0 -0
- /package/dist/chunks/{chunk-GURZ2GEB.js.map → chunk-7S2H77Y7.js.map} +0 -0
- /package/dist/chunks/{chunk-TZQT5JL3.js.map → chunk-AN3DBA6N.js.map} +0 -0
- /package/dist/chunks/{chunk-6G3XZZRF.js.map → chunk-AX7KHJVF.js.map} +0 -0
- /package/dist/chunks/{chunk-TYMIKXOD.js.map → chunk-CC2HK5I5.js.map} +0 -0
- /package/dist/chunks/{chunk-BHW43OKH.js.map → chunk-CECVIOY5.js.map} +0 -0
- /package/dist/chunks/{chunk-XZPLOQBA.js.map → chunk-CQC6GJQE.js.map} +0 -0
- /package/dist/chunks/{chunk-NWW46AII.js.map → chunk-DU27LH3W.js.map} +0 -0
- /package/dist/chunks/{chunk-BBERAGUX.js.map → chunk-DW3ML3PZ.js.map} +0 -0
- /package/dist/chunks/{chunk-TIBFEO2R.js.map → chunk-E2F7P6GI.js.map} +0 -0
- /package/dist/chunks/{chunk-OIOA7BRC.js.map → chunk-FVYKDRVT.js.map} +0 -0
- /package/dist/chunks/{chunk-VRUEY647.js.map → chunk-G7D7FNRZ.js.map} +0 -0
- /package/dist/chunks/{chunk-MJRLJDNK.js.map → chunk-GQ6ZQA7C.js.map} +0 -0
- /package/dist/chunks/{chunk-W6Z7RNVL.js.map → chunk-HOWIEIPK.js.map} +0 -0
- /package/dist/chunks/{chunk-FTMTO72X.js.map → chunk-HSEIISLI.js.map} +0 -0
- /package/dist/chunks/{chunk-54TFQUPM.js.map → chunk-JLZP3PRV.js.map} +0 -0
- /package/dist/chunks/{chunk-XGOM2KHV.js.map → chunk-LAAQCLVV.js.map} +0 -0
- /package/dist/chunks/{chunk-DXTK4EMM.js.map → chunk-LC4R7FEV.js.map} +0 -0
- /package/dist/chunks/{chunk-VTU23NBS.js.map → chunk-LYI2HXN4.js.map} +0 -0
- /package/dist/chunks/{chunk-I7FY5SK5.js.map → chunk-ON4RSB2L.js.map} +0 -0
- /package/dist/chunks/{chunk-AEZ7YTIJ.js.map → chunk-OQMQL3WF.js.map} +0 -0
- /package/dist/chunks/{chunk-IJUCXVG5.js.map → chunk-PAB3MJVU.js.map} +0 -0
- /package/dist/chunks/{chunk-B4I264HC.js.map → chunk-PLYCCNXW.js.map} +0 -0
- /package/dist/chunks/{chunk-EM5AM5BR.js.map → chunk-PYMCT4ZA.js.map} +0 -0
- /package/dist/chunks/{chunk-5QCBUBKO.js.map → chunk-Q7NNEWMZ.js.map} +0 -0
- /package/dist/chunks/{chunk-EDP5FDN4.js.map → chunk-QRC4LSKT.js.map} +0 -0
- /package/dist/chunks/{chunk-2R44UHEU.js.map → chunk-QXRLKALD.js.map} +0 -0
- /package/dist/chunks/{chunk-WQDMDSPW.js.map → chunk-R4MQECAY.js.map} +0 -0
- /package/dist/chunks/{chunk-CD5X75DB.js.map → chunk-R7IUMUGJ.js.map} +0 -0
- /package/dist/chunks/{chunk-V5YIGRUD.js.map → chunk-SLVAGDHU.js.map} +0 -0
- /package/dist/chunks/{chunk-2C5QF5ZM.js.map → chunk-UFSCA2XZ.js.map} +0 -0
- /package/dist/chunks/{chunk-LAQTQNQE.js.map → chunk-UQKTVCUV.js.map} +0 -0
- /package/dist/chunks/{chunk-VNFXDLKD.js.map → chunk-USAZW2SV.js.map} +0 -0
- /package/dist/chunks/{chunk-M3RKXXZE.js.map → chunk-V3P5BZE4.js.map} +0 -0
- /package/dist/chunks/{chunk-NJ6P3WPZ.js.map → chunk-VHS5I4HA.js.map} +0 -0
- /package/dist/chunks/{chunk-7WQS7BP2.js.map → chunk-WALXUBIZ.js.map} +0 -0
- /package/dist/chunks/{chunk-LWPTVYRU.js.map → chunk-WPECMU3F.js.map} +0 -0
- /package/dist/chunks/{chunk-N4DS6G4I.js.map → chunk-XS2JWCGM.js.map} +0 -0
- /package/dist/chunks/{chunk-SM377CLQ.js.map → chunk-YV227DWZ.js.map} +0 -0
- /package/dist/chunks/{commands-4ZTQFX2X.js.map → commands-OWQUB7JT.js.map} +0 -0
- /package/dist/chunks/{crash-report-Y6U6CH73.js.map → crash-report-KDMLQRS6.js.map} +0 -0
- /package/dist/chunks/{dist-3YHUITAK.js.map → dist-5A3XKURK.js.map} +0 -0
- /package/dist/chunks/{dist-ZNMZHP7A.js.map → dist-FURVCE4N.js.map} +0 -0
- /package/dist/chunks/{dist-TKVIIUPJ.js.map → dist-RS5H5LHE.js.map} +0 -0
- /package/dist/chunks/{dist-XP72U44M.js.map → dist-VKC2OF2P.js.map} +0 -0
- /package/dist/chunks/{dist-OKRQSUWC.js.map → dist-WPETBMRE.js.map} +0 -0
- /package/dist/chunks/{dist-J36EH26G.js.map → dist-XFPIH4KV.js.map} +0 -0
- /package/dist/chunks/{doctor-WKZ7BGFC.js.map → doctor-ZDM3LGPR.js.map} +0 -0
- /package/dist/chunks/{drain-VOM6IT3C.js.map → drain-BCDD6WT4.js.map} +0 -0
- /package/dist/chunks/{eval-7MDLH5UR.js.map → eval-CWHRB4CM.js.map} +0 -0
- /package/dist/chunks/{home-UID64VNR.js.map → home-B3DTR4JZ.js.map} +0 -0
- /package/dist/chunks/{host-queries-A3XQQHI4.js.map → host-queries-RIHABSRA.js.map} +0 -0
- /package/dist/chunks/{learn-N2FNKNCW.js.map → learn-FVDHNZ3E.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-3SQNWE77.js.map → learn-builtin-DIGVMU2K.js.map} +0 -0
- /package/dist/chunks/{lifecycle-TIEMDICJ.js.map → lifecycle-T5KZCOME.js.map} +0 -0
- /package/dist/chunks/{list-HGGKMHPQ.js.map → list-ALYIIETE.js.map} +0 -0
- /package/dist/chunks/{live-JHNWMJIE.js.map → live-QYXRKG27.js.map} +0 -0
- /package/dist/chunks/{login-CLFAZ2WB.js.map → login-YYDHSXYZ.js.map} +0 -0
- /package/dist/chunks/{logs-A5HZQ3XA.js.map → logs-HGYW5QG6.js.map} +0 -0
- /package/dist/chunks/{mcp-V27XPHVU.js.map → mcp-DXCRUYBA.js.map} +0 -0
- /package/dist/chunks/{operator-tools-7YJWXVYR.js.map → operator-tools-HM2DKEA3.js.map} +0 -0
- /package/dist/chunks/{output-schema-NEJ27MH6.js.map → output-schema-S4OZKHPX.js.map} +0 -0
- /package/dist/chunks/{pal-LX2FA7N2.js.map → pal-PISV32OY.js.map} +0 -0
- /package/dist/chunks/{providers-XRDUL4OO.js.map → providers-UCHYI3MC.js.map} +0 -0
- /package/dist/chunks/{resume-YPKHTYLO.js.map → resume-PM73RFB2.js.map} +0 -0
- /package/dist/chunks/{resume-command-VSFQAVVN.js.map → resume-command-TNYIW6PZ.js.map} +0 -0
- /package/dist/chunks/{schedule-GCBVV54F.js.map → schedule-PPTJ3BJ7.js.map} +0 -0
- /package/dist/chunks/{service-UQPEAJKT.js.map → service-OMRDQOPM.js.map} +0 -0
- /package/dist/chunks/{session-step-OKCO6S7R.js.map → session-step-C54ZEOLL.js.map} +0 -0
- /package/dist/chunks/{skills-LCTXKJCR.js.map → skills-CNZMMJFB.js.map} +0 -0
- /package/dist/chunks/{start-check-NAACA6IE.js.map → start-check-H4GSB34J.js.map} +0 -0
- /package/dist/chunks/{state-GNWJY3F2.js.map → state-VEYKYIIF.js.map} +0 -0
- /package/dist/chunks/{store-44ZZJVF3.js.map → store-BGVZ7PVQ.js.map} +0 -0
- /package/dist/chunks/{store-7ZXMZ6ES.js.map → store-FW3TZA4K.js.map} +0 -0
- /package/dist/chunks/{store-KGH5U7KF.js.map → store-S3M6B7JR.js.map} +0 -0
- /package/dist/chunks/{upgrade-DU4I5ACF.js.map → upgrade-XRCA3O4X.js.map} +0 -0
- /package/dist/chunks/{worktree-XGJCKZQJ.js.map → worktree-C6G5PFNW.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-5WHSDJCC.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveResume
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-I7HAYS6Z.js";
|
|
9
9
|
import {
|
|
10
10
|
expandHeadlessCommand,
|
|
11
11
|
hostCommandNames
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VESQFRF3.js";
|
|
13
13
|
import {
|
|
14
14
|
withTerminationHandling
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4NBV2LZS.js";
|
|
16
16
|
import "./chunk-TBIX6JRE.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-5WJAAPVQ.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-CC2HK5I5.js";
|
|
27
27
|
import {
|
|
28
28
|
completionNotice,
|
|
29
29
|
runTokens
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-ON4RSB2L.js";
|
|
31
|
+
import "./chunk-CECVIOY5.js";
|
|
32
|
+
import "./chunk-ARCMOPO3.js";
|
|
33
|
+
import "./chunk-3J4ALTG2.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-2AUFXSKS.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,60 @@ import {
|
|
|
57
60
|
parseExecFlags,
|
|
58
61
|
resolveWorkingDirectory,
|
|
59
62
|
unknownOptionMessage
|
|
60
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-W4B3XGK5.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-3IPE4LDE.js";
|
|
68
71
|
import {
|
|
69
72
|
describeTurnInterruption,
|
|
70
73
|
retryAfterMs
|
|
71
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-5WJXI4JR.js";
|
|
72
75
|
import {
|
|
73
76
|
resolvePermissionMode
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-WALXUBIZ.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-CLXRRUDH.js";
|
|
87
|
+
import "./chunk-OQMQL3WF.js";
|
|
84
88
|
import "./chunk-JQIBPPOL.js";
|
|
85
|
-
import "./chunk-
|
|
86
|
-
import "./chunk-
|
|
87
|
-
import "./chunk-
|
|
89
|
+
import "./chunk-AX7KHJVF.js";
|
|
90
|
+
import "./chunk-JLZP3PRV.js";
|
|
91
|
+
import "./chunk-R7IUMUGJ.js";
|
|
92
|
+
import "./chunk-LXB3S4IC.js";
|
|
88
93
|
import {
|
|
89
94
|
attachSessionExport
|
|
90
|
-
} from "./chunk-
|
|
91
|
-
import "./chunk-LXB3S4IC.js";
|
|
95
|
+
} from "./chunk-HSEIISLI.js";
|
|
92
96
|
import "./chunk-OH6TB27S.js";
|
|
93
97
|
import {
|
|
94
98
|
compilePermissionLayers,
|
|
95
99
|
permissionLayersOf,
|
|
96
100
|
warnLegacyMcpPermissionNames
|
|
97
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-GLCZ7227.js";
|
|
98
102
|
import "./chunk-WMEZTDLT.js";
|
|
99
103
|
import {
|
|
100
104
|
cliLogger,
|
|
101
105
|
contextLogging,
|
|
102
106
|
createStderrSink,
|
|
103
107
|
installCliLogging
|
|
104
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-G7D7FNRZ.js";
|
|
105
109
|
import "./chunk-SIG7WHBU.js";
|
|
106
110
|
import "./chunk-U5UV2YRE.js";
|
|
107
111
|
import "./chunk-IE5XIE4W.js";
|
|
108
112
|
import "./chunk-B73OIFL6.js";
|
|
109
|
-
import "./chunk-
|
|
113
|
+
import "./chunk-DU27LH3W.js";
|
|
110
114
|
import "./chunk-JORONMD3.js";
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
115
|
+
import "./chunk-QXRLKALD.js";
|
|
116
|
+
import "./chunk-PAB3MJVU.js";
|
|
113
117
|
import {
|
|
114
118
|
BOOT_EVENT_NAMES,
|
|
115
119
|
EVENT_NAME_ATTRIBUTE,
|
|
@@ -124,7 +128,7 @@ import {
|
|
|
124
128
|
isRuntimeContextMessageSource,
|
|
125
129
|
isWorkingMemoryMessage,
|
|
126
130
|
jsonLinesSink
|
|
127
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-GYW5IJ5R.js";
|
|
128
132
|
import {
|
|
129
133
|
__name
|
|
130
134
|
} from "./chunk-76FLAFCG.js";
|
|
@@ -535,6 +539,51 @@ async function readStdin(opts = {}) {
|
|
|
535
539
|
}
|
|
536
540
|
__name(readStdin, "readStdin");
|
|
537
541
|
|
|
542
|
+
// src/commands/stream-input.ts
|
|
543
|
+
import { StringDecoder } from "node:string_decoder";
|
|
544
|
+
var MAX_LINE_BYTES = 1024 * 1024;
|
|
545
|
+
function userText(line, number) {
|
|
546
|
+
let value;
|
|
547
|
+
try {
|
|
548
|
+
value = JSON.parse(line);
|
|
549
|
+
} catch {
|
|
550
|
+
throw new Error(`stdin line ${number}: expected a JSON user message`);
|
|
551
|
+
}
|
|
552
|
+
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)))
|
|
553
|
+
throw new Error(
|
|
554
|
+
`stdin line ${number}: expected {"role":"user","content":"..."} with optional timestamp`
|
|
555
|
+
);
|
|
556
|
+
return value.content;
|
|
557
|
+
}
|
|
558
|
+
__name(userText, "userText");
|
|
559
|
+
async function* streamUserInput(input) {
|
|
560
|
+
const decoder = new StringDecoder("utf8");
|
|
561
|
+
let pending = "";
|
|
562
|
+
let number = 0;
|
|
563
|
+
for await (const chunk of input) {
|
|
564
|
+
const text = typeof chunk === "string" ? chunk : decoder.write(chunk);
|
|
565
|
+
let start = 0;
|
|
566
|
+
for (let end = text.indexOf("\n"); end !== -1; end = text.indexOf("\n", start)) {
|
|
567
|
+
const part = text.slice(start, end);
|
|
568
|
+
if (Buffer.byteLength(pending) + Buffer.byteLength(part) > MAX_LINE_BYTES)
|
|
569
|
+
throw new Error("stdin message exceeds 1 MiB");
|
|
570
|
+
const line = pending + part;
|
|
571
|
+
pending = "";
|
|
572
|
+
number += 1;
|
|
573
|
+
if (line.trim()) yield userText(line, number);
|
|
574
|
+
start = end + 1;
|
|
575
|
+
}
|
|
576
|
+
const tail = text.slice(start);
|
|
577
|
+
if (Buffer.byteLength(pending) + Buffer.byteLength(tail) > MAX_LINE_BYTES)
|
|
578
|
+
throw new Error("stdin message exceeds 1 MiB");
|
|
579
|
+
pending += tail;
|
|
580
|
+
}
|
|
581
|
+
pending += decoder.end();
|
|
582
|
+
if (Buffer.byteLength(pending) > MAX_LINE_BYTES) throw new Error("stdin message exceeds 1 MiB");
|
|
583
|
+
if (pending.trim()) yield userText(pending, number + 1);
|
|
584
|
+
}
|
|
585
|
+
__name(streamUserInput, "streamUserInput");
|
|
586
|
+
|
|
538
587
|
// src/commands/exec-json.ts
|
|
539
588
|
var EXIT_TURN_IN_PROGRESS = 75;
|
|
540
589
|
function defaultPrefs(detected) {
|
|
@@ -551,6 +600,23 @@ function writeJsonLine(o) {
|
|
|
551
600
|
`);
|
|
552
601
|
}
|
|
553
602
|
__name(writeJsonLine, "writeJsonLine");
|
|
603
|
+
function initEvent(session, permissionMode, cwd, sessionId) {
|
|
604
|
+
return {
|
|
605
|
+
kind: "init",
|
|
606
|
+
...sessionId ? { sessionId } : {},
|
|
607
|
+
cwd,
|
|
608
|
+
provider: session.providerSummary,
|
|
609
|
+
model: session.modelSummary,
|
|
610
|
+
permissionMode,
|
|
611
|
+
tools: [...session.toolNames()],
|
|
612
|
+
mcpServers: [
|
|
613
|
+
...session.mcpConnected.map((s) => ({ name: s.name, status: "connected" })),
|
|
614
|
+
...session.mcpFailed.map((s) => ({ name: s.name, status: "failed" }))
|
|
615
|
+
],
|
|
616
|
+
slashCommands: hostCommandNames()
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
__name(initEvent, "initEvent");
|
|
554
620
|
async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOutput) {
|
|
555
621
|
let ctx = bootstrapCtx;
|
|
556
622
|
const write = writeJsonLine;
|
|
@@ -571,6 +637,14 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
571
637
|
};
|
|
572
638
|
if (flags.unknown.length > 0) return fail(unknownOptionMessage(flags.unknown));
|
|
573
639
|
if (structuredOutput && "error" in structuredOutput) return fail(structuredOutput.error);
|
|
640
|
+
if (flags.forkSession) {
|
|
641
|
+
return fail("exec --json does not take --fork-session; it belongs to the default mode.");
|
|
642
|
+
}
|
|
643
|
+
if (flags.noSessionPersistence && flags.session !== null) {
|
|
644
|
+
return fail(
|
|
645
|
+
"--no-session-persistence cannot be combined with --session; drop --session for a stateless turn."
|
|
646
|
+
);
|
|
647
|
+
}
|
|
574
648
|
if (flags.continueLast || flags.resume !== null) {
|
|
575
649
|
return fail(
|
|
576
650
|
"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 +656,26 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
582
656
|
);
|
|
583
657
|
}
|
|
584
658
|
const sessionKey = flags.session;
|
|
585
|
-
const
|
|
586
|
-
if (
|
|
659
|
+
const streamed = flags.inputFormat === "stream-json";
|
|
660
|
+
if (streamed && flags.rest.length > 0)
|
|
661
|
+
return fail("streamed input takes its prompts from stdin, not arguments");
|
|
662
|
+
if (streamed && process.stdin.isTTY) return fail("streamed input requires a pipe on stdin");
|
|
663
|
+
const inputs = streamed ? streamUserInput(process.stdin) : void 0;
|
|
664
|
+
let prompt = flags.rest.join(" ").trim();
|
|
665
|
+
try {
|
|
666
|
+
if (inputs) prompt = (await inputs.next()).value ?? "";
|
|
667
|
+
else if (flags.inputFormat === "text") {
|
|
668
|
+
const piped = await readStdin({ deadline: Boolean(prompt) });
|
|
669
|
+
prompt = prompt && piped.trim() ? `${prompt}
|
|
670
|
+
|
|
671
|
+
<stdin>
|
|
672
|
+
${piped.trim()}
|
|
673
|
+
</stdin>` : prompt || piped.trim();
|
|
674
|
+
}
|
|
675
|
+
} catch (error) {
|
|
676
|
+
return fail(error instanceof Error ? error.message : String(error));
|
|
677
|
+
}
|
|
678
|
+
if (!prompt) return fail("no prompt \u2014 pass it as an argument or supply stdin with --input-format");
|
|
587
679
|
const resolved = resolveWorkingDirectory(flags.cwd);
|
|
588
680
|
if ("error" in resolved) return fail(resolved.error);
|
|
589
681
|
const requestedCwd = resolved.cwd;
|
|
@@ -617,14 +709,14 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
617
709
|
let cli;
|
|
618
710
|
let conversationId = null;
|
|
619
711
|
let prior = [];
|
|
620
|
-
if (!sessionKey) {
|
|
712
|
+
if (!sessionKey && flags.inputFormat === null) {
|
|
621
713
|
const parsed = parsePriorMessages(await readStdin({ deadline: true }));
|
|
622
714
|
if (!parsed.ok) return fail(`invalid stdin history: ${parsed.error}`);
|
|
623
715
|
prior = [...parsed.messages];
|
|
624
716
|
}
|
|
625
717
|
try {
|
|
626
|
-
cli = await openSessions(cwd);
|
|
627
718
|
if (sessionKey) {
|
|
719
|
+
cli = await openSessions(cwd);
|
|
628
720
|
conversationId = await resolveConversation(cli, sessionKey);
|
|
629
721
|
prior = await loadConversation(cli, conversationId);
|
|
630
722
|
}
|
|
@@ -640,7 +732,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
640
732
|
}
|
|
641
733
|
const logging = contextLogging(ctx);
|
|
642
734
|
installCliLogging(jsonLinesSink(process.stderr), logging.level);
|
|
643
|
-
const { probeAgentSession, createAgentSession } = await import("./agent-
|
|
735
|
+
const { probeAgentSession, createAgentSession } = await import("./agent-VXVUHPUF.js");
|
|
644
736
|
const probe = await probeAgentSession();
|
|
645
737
|
let prefs = probe.preferences ?? defaultPrefs(probe.detected);
|
|
646
738
|
if (!prefs) {
|
|
@@ -676,17 +768,17 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
676
768
|
cwd,
|
|
677
769
|
...structuredOutput ? { structuredOutput } : {},
|
|
678
770
|
monitorTimeoutCapMs: EXEC_MONITOR_CAP_MS,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
771
|
+
...cli && conversationId ? {
|
|
772
|
+
scope: {
|
|
773
|
+
sessionId: conversationId,
|
|
774
|
+
topicId: cli.topicId,
|
|
775
|
+
projectId: cli.projectId,
|
|
776
|
+
tenantId: cli.tenantId
|
|
777
|
+
},
|
|
778
|
+
stateRoot: cli.root,
|
|
779
|
+
conversationSessions: cli
|
|
780
|
+
} : { sessionId: generateSessionId(), ephemeral: true },
|
|
686
781
|
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
782
|
rules: permissions.rules,
|
|
691
783
|
...run.appendSystem ? { appendSystem: run.appendSystem } : {},
|
|
692
784
|
// The operator's --gate commands, as a standing condition on the
|
|
@@ -748,6 +840,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
748
840
|
}
|
|
749
841
|
}, "reportMcpDiscoveries");
|
|
750
842
|
reportMcpDiscoveries();
|
|
843
|
+
write(initEvent(session, modeResult.mode, cwd, conversationId));
|
|
751
844
|
const extraSystem = await loadSkillsContext(cwd, flags.skills, ctx.config.skills);
|
|
752
845
|
const userMessage = {
|
|
753
846
|
role: "user",
|
|
@@ -784,7 +877,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
784
877
|
}
|
|
785
878
|
turnAbort.abort(new TurnCancelled("user"));
|
|
786
879
|
await session.close();
|
|
787
|
-
closeSessions(cli);
|
|
880
|
+
if (cli) closeSessions(cli);
|
|
788
881
|
});
|
|
789
882
|
let paused;
|
|
790
883
|
let history;
|
|
@@ -827,26 +920,72 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
827
920
|
}
|
|
828
921
|
}, "stream");
|
|
829
922
|
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;
|
|
923
|
+
let inputMessages = messages;
|
|
924
|
+
let typedInput = prompt;
|
|
925
|
+
while (true) {
|
|
841
926
|
await stream(
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
...monitorReport !== void 0 ? [monitorReportMessage(monitorReport)] : []
|
|
846
|
-
],
|
|
847
|
-
void 0,
|
|
848
|
-
spendLimitUsd > 0 ? { costLimitUsd: spendLimitUsd - closedTurnsUsd } : void 0
|
|
927
|
+
inputMessages,
|
|
928
|
+
typedInput,
|
|
929
|
+
closedTurnsUsd > 0 && spendLimitUsd > 0 ? { costLimitUsd: spendLimitUsd - closedTurnsUsd } : void 0
|
|
849
930
|
);
|
|
931
|
+
for (let rounds = 0; (watch || monitorWatch) && !stopped && !paused && !busy && rounds < MAX_REPORT_TURNS; rounds += 1) {
|
|
932
|
+
const workflowReport = watch ? await watch.report({
|
|
933
|
+
signal: turnAbort.signal,
|
|
934
|
+
...ctx.config.limits?.timeoutMs ? { timeoutMs: ctx.config.limits.timeoutMs } : {}
|
|
935
|
+
}) : void 0;
|
|
936
|
+
const monitorReport = stopped ? void 0 : await monitorWatch?.report({ signal: turnAbort.signal });
|
|
937
|
+
if (stopped || workflowReport === void 0 && monitorReport === void 0) break;
|
|
938
|
+
closedTurnsUsd += openTurnUsd;
|
|
939
|
+
openTurnUsd = 0;
|
|
940
|
+
if (spendLimitUsd > 0 && closedTurnsUsd >= spendLimitUsd) break;
|
|
941
|
+
await stream(
|
|
942
|
+
[
|
|
943
|
+
...history ?? inputMessages,
|
|
944
|
+
...workflowReport !== void 0 ? [reportMessage(workflowReport)] : [],
|
|
945
|
+
...monitorReport !== void 0 ? [monitorReportMessage(monitorReport)] : []
|
|
946
|
+
],
|
|
947
|
+
void 0,
|
|
948
|
+
spendLimitUsd > 0 ? { costLimitUsd: spendLimitUsd - closedTurnsUsd } : void 0
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
if (!inputs || stopped || paused || busy) break;
|
|
952
|
+
reportMcpDiscoveries();
|
|
953
|
+
write({
|
|
954
|
+
...terminalEvent ?? { kind: "done" },
|
|
955
|
+
...commandSpend(earlierBudgets, budget, session.workflows) ? { budget: commandSpend(earlierBudgets, budget, session.workflows) } : {}
|
|
956
|
+
});
|
|
957
|
+
const next = await inputs.next();
|
|
958
|
+
if (next.done) {
|
|
959
|
+
await session.close();
|
|
960
|
+
if (cli) closeSessions(cli);
|
|
961
|
+
watch?.dispose();
|
|
962
|
+
ended = true;
|
|
963
|
+
return EXIT_OK;
|
|
964
|
+
}
|
|
965
|
+
if (!history)
|
|
966
|
+
throw new Error(
|
|
967
|
+
"streamed input requires settled conversation history before the next prompt"
|
|
968
|
+
);
|
|
969
|
+
closedTurnsUsd += openTurnUsd;
|
|
970
|
+
openTurnUsd = 0;
|
|
971
|
+
if (spendLimitUsd > 0 && closedTurnsUsd >= spendLimitUsd)
|
|
972
|
+
throw new Error(describeSpendStop(spendLimitUsd));
|
|
973
|
+
terminalEvent = void 0;
|
|
974
|
+
typedInput = next.value;
|
|
975
|
+
const nextExpansion = expandHeadlessCommand(next.value, {
|
|
976
|
+
cwd,
|
|
977
|
+
builtins: hostCommandNames(),
|
|
978
|
+
...ctx.config.skills ? { skills: ctx.config.skills } : {}
|
|
979
|
+
});
|
|
980
|
+
if (nextExpansion.kind === "refused") throw new Error(nextExpansion.reason);
|
|
981
|
+
inputMessages = [
|
|
982
|
+
...history,
|
|
983
|
+
{
|
|
984
|
+
role: "user",
|
|
985
|
+
content: nextExpansion.kind === "expanded" ? nextExpansion.prompt : next.value,
|
|
986
|
+
timestamp: Date.now()
|
|
987
|
+
}
|
|
988
|
+
];
|
|
850
989
|
}
|
|
851
990
|
watch?.dispose();
|
|
852
991
|
} catch (err) {
|
|
@@ -859,7 +998,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
859
998
|
state: `after the turn failed (${message})${inConversation}.`
|
|
860
999
|
};
|
|
861
1000
|
await session.close();
|
|
862
|
-
closeSessions(cli);
|
|
1001
|
+
if (cli) closeSessions(cli);
|
|
863
1002
|
if (stopped) return EXIT_OK;
|
|
864
1003
|
ended = true;
|
|
865
1004
|
return fail(message);
|
|
@@ -885,7 +1024,7 @@ async function execJson({ ctx: bootstrapCtx }, termination, flags, structuredOut
|
|
|
885
1024
|
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
1025
|
};
|
|
887
1026
|
await session.close();
|
|
888
|
-
closeSessions(cli);
|
|
1027
|
+
if (cli) closeSessions(cli);
|
|
889
1028
|
if (stopped) return EXIT_OK;
|
|
890
1029
|
ended = true;
|
|
891
1030
|
write(settled.last);
|
|
@@ -955,6 +1094,12 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
955
1094
|
ctx.formatter.error({ message: structuredOutput.error });
|
|
956
1095
|
return EXIT_USAGE;
|
|
957
1096
|
}
|
|
1097
|
+
if (flags.forkSession && !flags.continueLast && flags.resume === null) {
|
|
1098
|
+
ctx.formatter.error({
|
|
1099
|
+
message: "--fork-session copies a conversation to carry on in; pass --continue or --resume <id> with it"
|
|
1100
|
+
});
|
|
1101
|
+
return EXIT_USAGE;
|
|
1102
|
+
}
|
|
958
1103
|
if (flags.session !== null) {
|
|
959
1104
|
ctx.formatter.error({
|
|
960
1105
|
message: "--session binds a host conversation for `exec --json`; this mode resumes with --continue or --resume <id>"
|
|
@@ -1011,7 +1156,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1011
1156
|
const promptUntilPiped = expansion.kind === "expanded" ? expansion.prompt : prompt;
|
|
1012
1157
|
const logging = contextLogging(ctx);
|
|
1013
1158
|
installCliLogging(createStderrSink(logging.format), logging.level);
|
|
1014
|
-
const { probeAgentSession, createAgentSession } = await import("./agent-
|
|
1159
|
+
const { probeAgentSession, createAgentSession } = await import("./agent-VXVUHPUF.js");
|
|
1015
1160
|
const probe = await probeAgentSession();
|
|
1016
1161
|
let prefs = probe.preferences ?? defaultPrefs2(probe.detected);
|
|
1017
1162
|
if (!prefs) {
|
|
@@ -1072,51 +1217,79 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1072
1217
|
return 1;
|
|
1073
1218
|
}
|
|
1074
1219
|
}
|
|
1220
|
+
const ephemeral = flags.noSessionPersistence;
|
|
1075
1221
|
let sessions;
|
|
1076
1222
|
try {
|
|
1077
|
-
|
|
1223
|
+
if (!ephemeral || flags.continueLast || flags.resume !== null) {
|
|
1224
|
+
sessions = ephemeral ? await openSessions(cwd, { readOnly: true }) : await openSessions(cwd);
|
|
1225
|
+
}
|
|
1078
1226
|
} catch (error) {
|
|
1079
1227
|
await sessionExport?.shutdown();
|
|
1228
|
+
if (ephemeral && error.code === "ENOENT") {
|
|
1229
|
+
ctx.formatter.error({
|
|
1230
|
+
message: `no previous conversation in ${cwd} \u2014 run without --continue or --resume to start one, or pass --cwd if you meant a different directory`
|
|
1231
|
+
});
|
|
1232
|
+
return EXIT_USAGE;
|
|
1233
|
+
}
|
|
1080
1234
|
ctx.formatter.error({
|
|
1081
1235
|
message: `workspace state is unavailable: ${error instanceof Error ? error.message : String(error)}`
|
|
1082
1236
|
});
|
|
1083
1237
|
return 1;
|
|
1084
1238
|
}
|
|
1085
1239
|
const resume = await resolveResume(
|
|
1086
|
-
sessions,
|
|
1240
|
+
sessions ?? null,
|
|
1087
1241
|
{ continueLast: flags.continueLast, sessionId: flags.resume },
|
|
1088
1242
|
cwd
|
|
1089
1243
|
);
|
|
1090
1244
|
if (resume.kind === "error") {
|
|
1091
1245
|
ctx.formatter.error({ message: resume.message });
|
|
1246
|
+
if (sessions) closeSessions(sessions);
|
|
1092
1247
|
await sessionExport?.shutdown();
|
|
1093
1248
|
return EXIT_USAGE;
|
|
1094
1249
|
}
|
|
1095
|
-
|
|
1250
|
+
let prior = resume.kind === "resumed" ? resume.messages : [];
|
|
1096
1251
|
let sessionId;
|
|
1097
1252
|
try {
|
|
1098
|
-
|
|
1253
|
+
if (ephemeral) {
|
|
1254
|
+
prior = prior.map(({ id: _id, ...message }) => message);
|
|
1255
|
+
sessionId = generateSessionId();
|
|
1256
|
+
if (sessions) closeSessions(sessions);
|
|
1257
|
+
sessions = void 0;
|
|
1258
|
+
} else if (sessions && resume.kind === "resumed" && flags.forkSession) {
|
|
1259
|
+
const copy = await forkConversation(sessions, asSessionId(resume.sessionId));
|
|
1260
|
+
sessionId = copy.id;
|
|
1261
|
+
prior = copy.messages;
|
|
1262
|
+
} else if (sessions) {
|
|
1263
|
+
sessionId = resume.kind === "resumed" ? asSessionId(resume.sessionId) : await startConversation(sessions);
|
|
1264
|
+
} else {
|
|
1265
|
+
throw new Error("conversation store is unavailable");
|
|
1266
|
+
}
|
|
1099
1267
|
} catch (error) {
|
|
1100
|
-
closeSessions(sessions);
|
|
1268
|
+
if (sessions) closeSessions(sessions);
|
|
1101
1269
|
await sessionExport?.shutdown();
|
|
1102
1270
|
ctx.formatter.error({
|
|
1103
1271
|
message: `could not start a conversation: ${error instanceof Error ? error.message : String(error)}`
|
|
1104
1272
|
});
|
|
1105
1273
|
return 1;
|
|
1106
1274
|
}
|
|
1275
|
+
const release = /* @__PURE__ */ __name(async () => {
|
|
1276
|
+
if (sessions) closeSessions(sessions);
|
|
1277
|
+
}, "release");
|
|
1107
1278
|
const session = await createAgentSession(prefs, probe.detected, {
|
|
1108
1279
|
cwd,
|
|
1109
1280
|
...structuredOutput ? { structuredOutput } : {},
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1281
|
+
...sessions ? {
|
|
1282
|
+
scope: {
|
|
1283
|
+
sessionId,
|
|
1284
|
+
topicId: sessions.topicId,
|
|
1285
|
+
projectId: sessions.projectId,
|
|
1286
|
+
tenantId: sessions.tenantId
|
|
1287
|
+
},
|
|
1288
|
+
stateRoot: sessions.root,
|
|
1289
|
+
conversationSessions: sessions
|
|
1290
|
+
} : { sessionId, ephemeral: true },
|
|
1117
1291
|
learningObservations: ctx.config.learningObservations !== false,
|
|
1118
1292
|
monitorTimeoutCapMs: EXEC_MONITOR_CAP_MS,
|
|
1119
|
-
conversationSessions: sessions,
|
|
1120
1293
|
rules: permissions.rules,
|
|
1121
1294
|
...run.appendSystem ? { appendSystem: run.appendSystem } : {},
|
|
1122
1295
|
...sessionExport ? { onSessionEvent: sessionExport.listener } : {},
|
|
@@ -1147,7 +1320,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1147
1320
|
});
|
|
1148
1321
|
if (!session.hasProvider) {
|
|
1149
1322
|
await session.close();
|
|
1150
|
-
|
|
1323
|
+
await release();
|
|
1151
1324
|
await sessionExport?.shutdown();
|
|
1152
1325
|
ctx.formatter.error({
|
|
1153
1326
|
message: session.errorHint ?? "agent is not ready"
|
|
@@ -1156,7 +1329,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1156
1329
|
}
|
|
1157
1330
|
if (modeResult.mode === "classify" && session.autoMode?.available === false) {
|
|
1158
1331
|
await session.close();
|
|
1159
|
-
|
|
1332
|
+
await release();
|
|
1160
1333
|
await sessionExport?.shutdown();
|
|
1161
1334
|
ctx.formatter.error({ message: session.autoMode.reason ?? "Auto mode is not available." });
|
|
1162
1335
|
return EXIT_USAGE;
|
|
@@ -1168,7 +1341,7 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1168
1341
|
});
|
|
1169
1342
|
}
|
|
1170
1343
|
await session.close();
|
|
1171
|
-
|
|
1344
|
+
await release();
|
|
1172
1345
|
await sessionExport?.shutdown();
|
|
1173
1346
|
return 1;
|
|
1174
1347
|
}
|
|
@@ -1193,7 +1366,10 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1193
1366
|
}
|
|
1194
1367
|
const extraSystem = await loadSkillsContext(cwd, flags.skills, ctx.config.skills);
|
|
1195
1368
|
if (resume.kind === "resumed") {
|
|
1196
|
-
|
|
1369
|
+
const copied = sessionId === resume.sessionId ? "" : ephemeral ? " \xB7 as a copy that is not kept" : ` \xB7 carrying on in a copy, ${sessionId}`;
|
|
1370
|
+
ctx.formatter.info(`resuming ${resume.sessionId} \xB7 ${prior.length} messages${copied}`);
|
|
1371
|
+
} else if (ephemeral) {
|
|
1372
|
+
ctx.formatter.info("this run is not kept");
|
|
1197
1373
|
}
|
|
1198
1374
|
let text = "";
|
|
1199
1375
|
const measured = {};
|
|
@@ -1226,10 +1402,12 @@ async function execPrint({ ctx: bootstrapCtx }, termination, flags, structuredOu
|
|
|
1226
1402
|
}, "afterPhase");
|
|
1227
1403
|
termination.onTerminate(async (signal) => {
|
|
1228
1404
|
stopped = true;
|
|
1229
|
-
ctx.formatter.error({
|
|
1405
|
+
ctx.formatter.error({
|
|
1406
|
+
message: ephemeral ? `stopped by ${signal}; this run is not kept` : stoppedBy(signal, sessionId, phase, stop.paused)
|
|
1407
|
+
});
|
|
1230
1408
|
turnAbort.abort(new TurnCancelled("user"));
|
|
1231
1409
|
await session.close();
|
|
1232
|
-
|
|
1410
|
+
await release();
|
|
1233
1411
|
await sessionExport?.shutdown();
|
|
1234
1412
|
});
|
|
1235
1413
|
const consume = /* @__PURE__ */ __name(async (stream) => {
|
|
@@ -1359,7 +1537,7 @@ Not resumed: ${decision.reason}.`;
|
|
|
1359
1537
|
const failed = stop.failed;
|
|
1360
1538
|
const paused = stop.paused !== null || stop.busy;
|
|
1361
1539
|
await session.close();
|
|
1362
|
-
|
|
1540
|
+
await release();
|
|
1363
1541
|
await sessionExport?.shutdown();
|
|
1364
1542
|
const spent = spend();
|
|
1365
1543
|
if (spent) {
|
|
@@ -1407,6 +1585,13 @@ var execCommand = {
|
|
|
1407
1585
|
"",
|
|
1408
1586
|
"Options:",
|
|
1409
1587
|
" --json Stream one JSON event per line instead of the reply",
|
|
1588
|
+
" --print, -p Explicit headless print mode (exec is already headless)",
|
|
1589
|
+
" --output-format <f> text | json (final result) | stream-json (same as --json)",
|
|
1590
|
+
" --input-format <f> text | stream-json; explicit text stdin is prompt material.",
|
|
1591
|
+
" stream-json requires streaming output; one native user",
|
|
1592
|
+
' message per line: {"role":"user","content":"..."}.',
|
|
1593
|
+
" Each line starts a turn as it arrives, before stdin EOF.",
|
|
1594
|
+
" No prompt arguments; each turn ends with done.",
|
|
1410
1595
|
" --output-schema <f> Bind the final answer to the JSON Schema in file f,",
|
|
1411
1596
|
" using the provider\u2019s native structured output",
|
|
1412
1597
|
" --mcp-config <f> Add the tool servers in file f for this run; repeatable",
|
|
@@ -1416,6 +1601,12 @@ var execCommand = {
|
|
|
1416
1601
|
" --skills <a,b,c> Load these skills as context for the turn",
|
|
1417
1602
|
" --continue, -c Resume the most recent conversation here",
|
|
1418
1603
|
" --resume <id> Resume that conversation, and no other",
|
|
1604
|
+
" --fork-session With --continue or --resume: carry on in a copy, leaving",
|
|
1605
|
+
" the original as it was",
|
|
1606
|
+
" --no-session-persistence",
|
|
1607
|
+
" Keep no record of this run; a resumed conversation is",
|
|
1608
|
+
" worked on in memory and the original is not written to.",
|
|
1609
|
+
" With --json: explicit stateless mode; refuses --session",
|
|
1419
1610
|
" --session <id> With --json: bind the turn to the host conversation",
|
|
1420
1611
|
" keyed by this id",
|
|
1421
1612
|
" --gate <command> Verify proposed answers with this command; repeatable",
|
|
@@ -1520,7 +1711,9 @@ var execCommand = {
|
|
|
1520
1711
|
flags = parseExecFlags(args.rawArgs);
|
|
1521
1712
|
} catch (error) {
|
|
1522
1713
|
const message = error instanceof Error ? error.message : String(error);
|
|
1523
|
-
if (args.rawArgs.includes("--json"))
|
|
1714
|
+
if (args.rawArgs.includes("--json") || args.rawArgs.includes("--output-format=stream-json") || args.rawArgs.some(
|
|
1715
|
+
(arg, index) => arg === "--output-format" && args.rawArgs[index + 1] === "stream-json"
|
|
1716
|
+
)) {
|
|
1524
1717
|
writeJsonLine({ kind: "error", message });
|
|
1525
1718
|
writeJsonLine({ kind: "done" });
|
|
1526
1719
|
return 0;
|
|
@@ -1529,11 +1722,20 @@ var execCommand = {
|
|
|
1529
1722
|
return EXIT_USAGE;
|
|
1530
1723
|
}
|
|
1531
1724
|
const structuredOutput = loadExecOutputSchema(flags.outputSchema);
|
|
1532
|
-
|
|
1725
|
+
const formatted = flags.outputFormat === "text" || flags.outputFormat === "json" ? {
|
|
1726
|
+
...args,
|
|
1727
|
+
ctx: {
|
|
1728
|
+
...args.ctx,
|
|
1729
|
+
formatter: createFormatter(flags.outputFormat, {
|
|
1730
|
+
quiet: contextLogging(args.ctx).level === "silent"
|
|
1731
|
+
})
|
|
1732
|
+
}
|
|
1733
|
+
} : args;
|
|
1734
|
+
return flags.json ? execJson(formatted, termination, flags, structuredOutput) : execPrint(formatted, termination, flags, structuredOutput);
|
|
1533
1735
|
})
|
|
1534
1736
|
};
|
|
1535
1737
|
export {
|
|
1536
1738
|
composePrompt,
|
|
1537
1739
|
execCommand
|
|
1538
1740
|
};
|
|
1539
|
-
//# sourceMappingURL=exec-
|
|
1741
|
+
//# sourceMappingURL=exec-ZL7XCVPV.js.map
|