@namzu/cli 42.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.
Files changed (412) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/chunks/{acp-ADQ2PRAY.js → acp-3D2PPXYC.js} +39 -38
  4. package/dist/chunks/acp-3D2PPXYC.js.map +6 -0
  5. package/dist/chunks/{activity-command-JROQLBPA.js → activity-command-WE45L6EF.js} +12 -12
  6. package/dist/chunks/{add-ILLLF6YP.js → add-RLDOB23V.js} +14 -14
  7. package/dist/chunks/{agent-YQI5KOPV.js → agent-VXVUHPUF.js} +30 -29
  8. package/dist/chunks/agent-session-HLH4P7W4.js +59 -0
  9. package/dist/chunks/{archive-55KJKGJB.js → archive-M5SZWEBT.js} +10 -10
  10. package/dist/chunks/{bin-main-332F5KRZ.js → bin-main-HCAGOSEJ.js} +4 -4
  11. package/dist/chunks/{browser-C6AOJ3CH.js → browser-GO5REABI.js} +6 -6
  12. package/dist/chunks/{chat-45H5F3KI.js → chat-ZV3OQQRQ.js} +15 -15
  13. package/dist/chunks/{chunk-6GBZAUYW.js → chunk-2343E2J7.js} +2 -2
  14. package/dist/chunks/{chunk-4TS6ZPOZ.js → chunk-26VFNQCY.js} +3 -3
  15. package/dist/chunks/{chunk-GOGBOZKO.js → chunk-2AUFXSKS.js} +254 -21
  16. package/dist/chunks/chunk-2AUFXSKS.js.map +6 -0
  17. package/dist/chunks/{chunk-A4CKLHKM.js → chunk-2QWVT55W.js} +441 -88
  18. package/dist/chunks/chunk-2QWVT55W.js.map +6 -0
  19. package/dist/chunks/{chunk-XXUL6HHM.js → chunk-3IPE4LDE.js} +2 -2
  20. package/dist/chunks/{chunk-QRGO6R2O.js → chunk-3J4ALTG2.js} +6 -4
  21. package/dist/chunks/chunk-3J4ALTG2.js.map +6 -0
  22. package/dist/chunks/{chunk-L3QW53QL.js → chunk-3PSNEUBW.js} +7 -7
  23. package/dist/chunks/{chunk-YM4DUQ3P.js → chunk-44OG65HR.js} +3 -3
  24. package/dist/chunks/{chunk-AZPS37AQ.js → chunk-4C6462L3.js} +2 -2
  25. package/dist/chunks/{chunk-YPHXWFKQ.js → chunk-4NBV2LZS.js} +2 -2
  26. package/dist/chunks/{chunk-RVSVVL6O.js → chunk-4PSNBASI.js} +3 -3
  27. package/dist/chunks/{chunk-HO2ZUI5Y.js → chunk-4TBPO43I.js} +2 -2
  28. package/dist/chunks/{chunk-URJ7TITR.js → chunk-5OVJ2ZCX.js} +8 -8
  29. package/dist/chunks/{chunk-HXAWIWOZ.js → chunk-5WHSDJCC.js} +2 -2
  30. package/dist/chunks/{chunk-EWSIGY2A.js → chunk-5WJAAPVQ.js} +3 -3
  31. package/dist/chunks/{chunk-BDLDDNNO.js → chunk-5WJXI4JR.js} +2 -2
  32. package/dist/chunks/{chunk-Y3I7AAD6.js → chunk-6LLUYDBO.js} +4 -4
  33. package/dist/chunks/{chunk-FSKJ3EZC.js → chunk-7M6ZU2NT.js} +2 -2
  34. package/dist/chunks/{chunk-Y74CPWYC.js → chunk-7QFW6TV7.js} +49 -23
  35. package/dist/chunks/chunk-7QFW6TV7.js.map +6 -0
  36. package/dist/chunks/{chunk-W2PJ6ZHY.js → chunk-7S2H77Y7.js} +3 -3
  37. package/dist/chunks/{chunk-CW2N2QS2.js → chunk-AN3DBA6N.js} +4 -4
  38. package/dist/chunks/chunk-ARCMOPO3.js +157 -0
  39. package/dist/chunks/chunk-ARCMOPO3.js.map +6 -0
  40. package/dist/chunks/{chunk-FMEGRBJP.js → chunk-AX7KHJVF.js} +2 -2
  41. package/dist/chunks/{chunk-XMOKHCPV.js → chunk-B6QM5F2E.js} +87 -39
  42. package/dist/chunks/chunk-B6QM5F2E.js.map +6 -0
  43. package/dist/chunks/{chunk-XGVCAMNT.js → chunk-CC2HK5I5.js} +2 -2
  44. package/dist/chunks/{chunk-4IIEEOCA.js → chunk-CECVIOY5.js} +3 -3
  45. package/dist/chunks/{chunk-QWBR6FBY.js → chunk-CLXRRUDH.js} +149 -17
  46. package/dist/chunks/chunk-CLXRRUDH.js.map +6 -0
  47. package/dist/chunks/{chunk-N4OY22M2.js → chunk-CQC6GJQE.js} +2 -2
  48. package/dist/chunks/{chunk-DLL2FPUY.js → chunk-DU27LH3W.js} +2 -2
  49. package/dist/chunks/{chunk-Y2DZ27P6.js → chunk-DW3ML3PZ.js} +4 -4
  50. package/dist/chunks/{chunk-RGVJHSMU.js → chunk-E2F7P6GI.js} +2 -2
  51. package/dist/chunks/{chunk-23NRJ2RC.js → chunk-FVYKDRVT.js} +5 -5
  52. package/dist/chunks/{chunk-JD2HLKFO.js → chunk-G7D7FNRZ.js} +2 -2
  53. package/dist/chunks/{chunk-HOY7BUGW.js → chunk-GLCZ7227.js} +207 -8
  54. package/dist/chunks/chunk-GLCZ7227.js.map +6 -0
  55. package/dist/chunks/{chunk-N56FVHCU.js → chunk-GQ6ZQA7C.js} +2 -2
  56. package/dist/chunks/{chunk-7E3V7NNN.js → chunk-GYW5IJ5R.js} +75586 -73631
  57. package/dist/chunks/chunk-GYW5IJ5R.js.map +6 -0
  58. package/dist/chunks/{chunk-YP7AINGL.js → chunk-HOWIEIPK.js} +9 -9
  59. package/dist/chunks/{chunk-FTMTO72X.js → chunk-HSEIISLI.js} +2 -1
  60. package/dist/chunks/{chunk-WHOSI6UQ.js → chunk-I7HAYS6Z.js} +15 -3
  61. package/dist/chunks/chunk-I7HAYS6Z.js.map +6 -0
  62. package/dist/chunks/{chunk-F6WVRMVY.js → chunk-J6LQJ3H4.js} +1610 -488
  63. package/dist/chunks/chunk-J6LQJ3H4.js.map +6 -0
  64. package/dist/chunks/{chunk-ESZ7X37S.js → chunk-JLZP3PRV.js} +4 -4
  65. package/dist/chunks/{chunk-6S4R2USK.js → chunk-JWFCCQGM.js} +6 -5
  66. package/dist/chunks/chunk-JWFCCQGM.js.map +6 -0
  67. package/dist/chunks/{chunk-A3AF5WXZ.js → chunk-LAAQCLVV.js} +6 -6
  68. package/dist/chunks/{chunk-K6LLMOB2.js → chunk-LC4R7FEV.js} +2 -2
  69. package/dist/chunks/{chunk-SIWZZF4M.js → chunk-LEVQANRZ.js} +15 -15
  70. package/dist/chunks/chunk-LEVQANRZ.js.map +6 -0
  71. package/dist/chunks/{chunk-HQZ3GBQI.js → chunk-LYI2HXN4.js} +6 -6
  72. package/dist/chunks/{chunk-S4KDR6G5.js → chunk-ON4RSB2L.js} +4 -4
  73. package/dist/chunks/{chunk-IQQ6TY4W.js → chunk-OQMQL3WF.js} +3 -3
  74. package/dist/chunks/{chunk-YVIM3MXU.js → chunk-PAB3MJVU.js} +2 -2
  75. package/dist/chunks/{chunk-HOIDWHGC.js → chunk-PLYCCNXW.js} +6 -6
  76. package/dist/chunks/{chunk-6PNBIMWH.js → chunk-PYMCT4ZA.js} +3 -3
  77. package/dist/chunks/{chunk-R2LYGFCI.js → chunk-Q7NNEWMZ.js} +4 -4
  78. package/dist/chunks/{chunk-3LNTQLQ4.js → chunk-QRC4LSKT.js} +7 -7
  79. package/dist/chunks/{chunk-BRKD6FMO.js → chunk-QXRLKALD.js} +2 -2
  80. package/dist/chunks/{chunk-XCMCPWMB.js → chunk-R4MQECAY.js} +4 -4
  81. package/dist/chunks/{chunk-M46GKTOI.js → chunk-R7IUMUGJ.js} +2 -2
  82. package/dist/chunks/{chunk-N3C5X6BW.js → chunk-SLVAGDHU.js} +5 -5
  83. package/dist/chunks/{chunk-SRYIMLOK.js → chunk-UFSCA2XZ.js} +2 -2
  84. package/dist/chunks/{chunk-6LVWHXT6.js → chunk-UQKTVCUV.js} +8 -8
  85. package/dist/chunks/{chunk-QT6KYBCC.js → chunk-USAZW2SV.js} +3 -3
  86. package/dist/chunks/{chunk-TW5BCDA5.js → chunk-V3P5BZE4.js} +3 -3
  87. package/dist/chunks/{chunk-JXT47VT6.js → chunk-VESQFRF3.js} +821 -33
  88. package/dist/chunks/chunk-VESQFRF3.js.map +6 -0
  89. package/dist/chunks/{chunk-35VTE7V5.js → chunk-VHS5I4HA.js} +2 -2
  90. package/dist/chunks/{chunk-5XWMKWQQ.js → chunk-W4B3XGK5.js} +45 -3
  91. package/dist/chunks/chunk-W4B3XGK5.js.map +6 -0
  92. package/dist/chunks/{chunk-J4IES4SO.js → chunk-WALXUBIZ.js} +2 -2
  93. package/dist/chunks/{chunk-QUELENQP.js → chunk-WPECMU3F.js} +4 -4
  94. package/dist/chunks/{chunk-SNC5D5UG.js → chunk-XS2JWCGM.js} +13 -13
  95. package/dist/chunks/{chunk-4NO5XFK2.js → chunk-YV227DWZ.js} +2 -2
  96. package/dist/chunks/cli-runtime-35A3RAU6.js +337 -0
  97. package/dist/chunks/cli-runtime-35A3RAU6.js.map +6 -0
  98. package/dist/chunks/{commands-JZT6JJY5.js → commands-OWQUB7JT.js} +5 -5
  99. package/dist/chunks/{crash-report-TWMWHNKY.js → crash-report-KDMLQRS6.js} +6 -6
  100. package/dist/chunks/{dist-AZ5T257L.js → dist-4LKH4B3B.js} +4 -3
  101. package/dist/chunks/dist-4LKH4B3B.js.map +6 -0
  102. package/dist/chunks/{dist-POSMI3PI.js → dist-5A3XKURK.js} +2 -2
  103. package/dist/chunks/{dist-CLKFY67B.js → dist-FURVCE4N.js} +2 -2
  104. package/dist/chunks/{dist-4EGZFRWY.js → dist-RS5H5LHE.js} +2 -2
  105. package/dist/chunks/{dist-6ORFQIRV.js → dist-VKC2OF2P.js} +2 -2
  106. package/dist/chunks/{dist-K5JIOWIQ.js → dist-WPETBMRE.js} +2 -2
  107. package/dist/chunks/{dist-MVLQAON2.js → dist-XFPIH4KV.js} +2 -2
  108. package/dist/chunks/{doctor-UVZBNUNF.js → doctor-ZDM3LGPR.js} +13 -13
  109. package/dist/chunks/{drain-27E6XUNK.js → drain-BCDD6WT4.js} +10 -10
  110. package/dist/chunks/{eval-NRRIWDET.js → eval-CWHRB4CM.js} +2 -2
  111. package/dist/chunks/{exec-KX46LZ36.js → exec-ZL7XCVPV.js} +290 -88
  112. package/dist/chunks/exec-ZL7XCVPV.js.map +6 -0
  113. package/dist/chunks/github-FH7PPWVW.js +347 -0
  114. package/dist/chunks/github-FH7PPWVW.js.map +6 -0
  115. package/dist/chunks/{home-RT2I6VTQ.js → home-B3DTR4JZ.js} +3 -3
  116. package/dist/chunks/{host-queries-ZXGOA6ZL.js → host-queries-RIHABSRA.js} +15 -15
  117. package/dist/chunks/{learn-5KKZ4ZFX.js → learn-FVDHNZ3E.js} +13 -13
  118. package/dist/chunks/{learn-builtin-MSUF4MEJ.js → learn-builtin-DIGVMU2K.js} +16 -16
  119. package/dist/chunks/{lifecycle-TZU6D46R.js → lifecycle-T5KZCOME.js} +23 -23
  120. package/dist/chunks/{list-QCWNMQED.js → list-ALYIIETE.js} +10 -10
  121. package/dist/chunks/{live-V7HRF5KR.js → live-QYXRKG27.js} +12 -12
  122. package/dist/chunks/{login-QFP3PIXG.js → login-YYDHSXYZ.js} +8 -8
  123. package/dist/chunks/{logs-XTXMS4JF.js → logs-HGYW5QG6.js} +4 -4
  124. package/dist/chunks/{mcp-WQFJJ4NO.js → mcp-DXCRUYBA.js} +15 -15
  125. package/dist/chunks/{message-command-QVNUJN47.js → message-command-7A2FC7PW.js} +36 -35
  126. package/dist/chunks/message-command-7A2FC7PW.js.map +6 -0
  127. package/dist/chunks/{operator-tools-2OYRNPCH.js → operator-tools-HM2DKEA3.js} +13 -13
  128. package/dist/chunks/{output-schema-ETVPLUXE.js → output-schema-S4OZKHPX.js} +3 -3
  129. package/dist/chunks/{pal-BYFZCLE2.js → pal-PISV32OY.js} +11 -11
  130. package/dist/chunks/{plain-report-73WHPLHX.js → plain-report-IOYN4O6N.js} +10 -2
  131. package/dist/chunks/{plain-report-73WHPLHX.js.map → plain-report-IOYN4O6N.js.map} +2 -2
  132. package/dist/chunks/{providers-KP5JHTTK.js → providers-UCHYI3MC.js} +6 -6
  133. package/dist/chunks/{resident-BROBTK35.js → resident-Y3WMPAB4.js} +24 -24
  134. package/dist/chunks/{resident-BROBTK35.js.map → resident-Y3WMPAB4.js.map} +1 -1
  135. package/dist/chunks/resume-PM73RFB2.js +23 -0
  136. package/dist/chunks/{resume-command-OKJ2MJPB.js → resume-command-TNYIW6PZ.js} +4 -4
  137. package/dist/chunks/{schedule-TVR3FE32.js → schedule-PPTJ3BJ7.js} +8 -8
  138. package/dist/chunks/{service-6A3TOQKV.js → service-OMRDQOPM.js} +22 -22
  139. package/dist/chunks/{session-step-N4GHA2YE.js → session-step-C54ZEOLL.js} +16 -16
  140. package/dist/chunks/{skills-WXYSPDKL.js → skills-CNZMMJFB.js} +8 -8
  141. package/dist/chunks/{start-check-BUCN5MCU.js → start-check-H4GSB34J.js} +2 -2
  142. package/dist/chunks/{state-PVAVIXHK.js → state-VEYKYIIF.js} +2 -2
  143. package/dist/chunks/{store-O3KC2PPZ.js → store-BGVZ7PVQ.js} +4 -4
  144. package/dist/chunks/{store-NB3KR4XA.js → store-FW3TZA4K.js} +14 -10
  145. package/dist/chunks/{store-D3XUEEAF.js → store-S3M6B7JR.js} +6 -6
  146. package/dist/chunks/{tui-2XOSCALL.js → tui-XJNDU54J.js} +1797 -875
  147. package/dist/chunks/tui-XJNDU54J.js.map +6 -0
  148. package/dist/chunks/{upgrade-FY5ULZQF.js → upgrade-XRCA3O4X.js} +6 -6
  149. package/dist/chunks/{worktree-MVW62U5G.js → worktree-C6G5PFNW.js} +12 -12
  150. package/dist/cli-runtime.d.ts +2 -0
  151. package/dist/cli-runtime.d.ts.map +1 -1
  152. package/dist/cli.d.ts.map +1 -1
  153. package/dist/commands/desktop-host.d.ts +3 -0
  154. package/dist/commands/desktop-host.d.ts.map +1 -1
  155. package/dist/commands/exec-flags.d.ts +14 -0
  156. package/dist/commands/exec-flags.d.ts.map +1 -1
  157. package/dist/commands/exec-json.d.ts +8 -1
  158. package/dist/commands/exec-json.d.ts.map +1 -1
  159. package/dist/commands/exec.d.ts.map +1 -1
  160. package/dist/commands/github.d.ts +20 -0
  161. package/dist/commands/github.d.ts.map +1 -0
  162. package/dist/commands/manifest.d.ts +1 -0
  163. package/dist/commands/manifest.d.ts.map +1 -1
  164. package/dist/commands/resident-flags.d.ts.map +1 -1
  165. package/dist/commands/resume.d.ts +4 -0
  166. package/dist/commands/resume.d.ts.map +1 -1
  167. package/dist/commands/stream-input.d.ts +4 -0
  168. package/dist/commands/stream-input.d.ts.map +1 -0
  169. package/dist/config/load.d.ts.map +1 -1
  170. package/dist/config/schema.d.ts +28 -2
  171. package/dist/config/schema.d.ts.map +1 -1
  172. package/dist/context/environment.d.ts +17 -4
  173. package/dist/context/environment.d.ts.map +1 -1
  174. package/dist/context/system-prompt.d.ts +2 -2
  175. package/dist/context/system-prompt.d.ts.map +1 -1
  176. package/dist/index.js +16 -16
  177. package/dist/integrations/github/pull-request.d.ts +64 -0
  178. package/dist/integrations/github/pull-request.d.ts.map +1 -0
  179. package/dist/integrations/github/workflows.d.ts +49 -0
  180. package/dist/integrations/github/workflows.d.ts.map +1 -0
  181. package/dist/integrations/mcp/elicitation.d.ts +40 -0
  182. package/dist/integrations/mcp/elicitation.d.ts.map +1 -0
  183. package/dist/integrations/mcp/output.d.ts +9 -0
  184. package/dist/integrations/mcp/output.d.ts.map +1 -0
  185. package/dist/integrations/mcp/person-commands.d.ts +18 -0
  186. package/dist/integrations/mcp/person-commands.d.ts.map +1 -0
  187. package/dist/integrations/mcp/person-session.d.ts +15 -0
  188. package/dist/integrations/mcp/person-session.d.ts.map +1 -0
  189. package/dist/integrations/mcp/prompts.d.ts +18 -0
  190. package/dist/integrations/mcp/prompts.d.ts.map +1 -0
  191. package/dist/integrations/mcp/servers.d.ts +70 -3
  192. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  193. package/dist/integrations/peers/runtime.d.ts.map +1 -1
  194. package/dist/integrations/plugins/files.d.ts +43 -0
  195. package/dist/integrations/plugins/files.d.ts.map +1 -0
  196. package/dist/integrations/plugins/runtime.d.ts +5 -1
  197. package/dist/integrations/plugins/runtime.d.ts.map +1 -1
  198. package/dist/integrations/resident/runner-worker.js +21 -21
  199. package/dist/integrations/resident/session-step.d.ts.map +1 -1
  200. package/dist/integrations/sessions/side-question.d.ts +46 -0
  201. package/dist/integrations/sessions/side-question.d.ts.map +1 -0
  202. package/dist/integrations/sessions/store.d.ts +23 -1
  203. package/dist/integrations/sessions/store.d.ts.map +1 -1
  204. package/dist/integrations/small-model/side-model.d.ts +13 -0
  205. package/dist/integrations/small-model/side-model.d.ts.map +1 -1
  206. package/dist/integrations/subagents/activity.d.ts.map +1 -1
  207. package/dist/integrations/subagents/agent-names.d.ts +21 -0
  208. package/dist/integrations/subagents/agent-names.d.ts.map +1 -0
  209. package/dist/integrations/subagents/definitions.d.ts +24 -2
  210. package/dist/integrations/subagents/definitions.d.ts.map +1 -1
  211. package/dist/integrations/subagents/failure-words.d.ts +2 -0
  212. package/dist/integrations/subagents/failure-words.d.ts.map +1 -0
  213. package/dist/integrations/subagents/fork.d.ts +29 -0
  214. package/dist/integrations/subagents/fork.d.ts.map +1 -0
  215. package/dist/integrations/subagents/runtime.d.ts +21 -0
  216. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  217. package/dist/integrations/telemetry/otlp-export.d.ts +67 -0
  218. package/dist/integrations/telemetry/otlp-export.d.ts.map +1 -0
  219. package/dist/permissions/auto-classifier.d.ts +12 -1
  220. package/dist/permissions/auto-classifier.d.ts.map +1 -1
  221. package/dist/permissions/delegated-mode.d.ts +25 -0
  222. package/dist/permissions/delegated-mode.d.ts.map +1 -0
  223. package/dist/permissions/live-mode.d.ts +5 -0
  224. package/dist/permissions/live-mode.d.ts.map +1 -1
  225. package/dist/permissions/live-rules.d.ts +12 -0
  226. package/dist/permissions/live-rules.d.ts.map +1 -0
  227. package/dist/permissions/path-rules.d.ts +43 -0
  228. package/dist/permissions/path-rules.d.ts.map +1 -0
  229. package/dist/permissions/rule-screen.d.ts +36 -0
  230. package/dist/permissions/rule-screen.d.ts.map +1 -0
  231. package/dist/permissions/rule-strings.d.ts +50 -0
  232. package/dist/permissions/rule-strings.d.ts.map +1 -0
  233. package/dist/permissions/rules.d.ts +7 -2
  234. package/dist/permissions/rules.d.ts.map +1 -1
  235. package/dist/permissions/session-allow.d.ts +2 -0
  236. package/dist/permissions/session-allow.d.ts.map +1 -1
  237. package/dist/reminders/changed-files.d.ts +24 -0
  238. package/dist/reminders/changed-files.d.ts.map +1 -0
  239. package/dist/reminders/frame.d.ts +1 -1
  240. package/dist/reminders/frame.d.ts.map +1 -1
  241. package/dist/reminders/index.d.ts +30 -0
  242. package/dist/reminders/index.d.ts.map +1 -1
  243. package/dist/reminders/mcp-instructions.d.ts +27 -0
  244. package/dist/reminders/mcp-instructions.d.ts.map +1 -0
  245. package/dist/reminders/memory-index.d.ts +28 -0
  246. package/dist/reminders/memory-index.d.ts.map +1 -0
  247. package/dist/reminders/model.d.ts +9 -0
  248. package/dist/reminders/model.d.ts.map +1 -0
  249. package/dist/reminders/skills.d.ts +27 -0
  250. package/dist/reminders/skills.d.ts.map +1 -0
  251. package/dist/skills/catalog.d.ts.map +1 -1
  252. package/dist/skills/store.d.ts.map +1 -1
  253. package/dist/tui/App.d.ts +2 -0
  254. package/dist/tui/App.d.ts.map +1 -1
  255. package/dist/tui/Composer.d.ts +17 -4
  256. package/dist/tui/Composer.d.ts.map +1 -1
  257. package/dist/tui/LiveActivity.d.ts.map +1 -1
  258. package/dist/tui/ResumePicker.d.ts.map +1 -1
  259. package/dist/tui/agent.d.ts +42 -1
  260. package/dist/tui/agent.d.ts.map +1 -1
  261. package/dist/tui/composer-undo.d.ts +31 -0
  262. package/dist/tui/composer-undo.d.ts.map +1 -0
  263. package/dist/tui/external-editor.d.ts +5 -1
  264. package/dist/tui/external-editor.d.ts.map +1 -1
  265. package/dist/tui/keymap.d.ts +152 -0
  266. package/dist/tui/keymap.d.ts.map +1 -0
  267. package/dist/tui/mention-file.d.ts +10 -0
  268. package/dist/tui/mention-file.d.ts.map +1 -0
  269. package/dist/tui/mention-sources.d.ts +31 -0
  270. package/dist/tui/mention-sources.d.ts.map +1 -0
  271. package/dist/tui/mentions.d.ts +55 -1
  272. package/dist/tui/mentions.d.ts.map +1 -1
  273. package/dist/tui/plugin-view.d.ts.map +1 -1
  274. package/dist/tui/resume-empty.d.ts +7 -0
  275. package/dist/tui/resume-empty.d.ts.map +1 -1
  276. package/dist/tui/resume-picker-state.d.ts +3 -0
  277. package/dist/tui/resume-picker-state.d.ts.map +1 -1
  278. package/dist/tui/self-mending-pause-row.d.ts +17 -0
  279. package/dist/tui/self-mending-pause-row.d.ts.map +1 -0
  280. package/dist/tui/slashCommands.d.ts +18 -0
  281. package/dist/tui/slashCommands.d.ts.map +1 -1
  282. package/dist/tui/thinking-label.d.ts +24 -0
  283. package/dist/tui/thinking-label.d.ts.map +1 -0
  284. package/dist/tui/tool-server-rows.d.ts +23 -0
  285. package/dist/tui/tool-server-rows.d.ts.map +1 -0
  286. package/dist/tui/types.d.ts +4 -0
  287. package/dist/tui/types.d.ts.map +1 -1
  288. package/dist/user-commands/store.d.ts +10 -1
  289. package/dist/user-commands/store.d.ts.map +1 -1
  290. package/package.json +6 -5
  291. package/dist/chunks/acp-ADQ2PRAY.js.map +0 -6
  292. package/dist/chunks/agent-session-3MUZCWQ4.js +0 -58
  293. package/dist/chunks/chunk-5XWMKWQQ.js.map +0 -6
  294. package/dist/chunks/chunk-6S4R2USK.js.map +0 -6
  295. package/dist/chunks/chunk-7E3V7NNN.js.map +0 -6
  296. package/dist/chunks/chunk-A4CKLHKM.js.map +0 -6
  297. package/dist/chunks/chunk-F6WVRMVY.js.map +0 -6
  298. package/dist/chunks/chunk-GOGBOZKO.js.map +0 -6
  299. package/dist/chunks/chunk-HOY7BUGW.js.map +0 -6
  300. package/dist/chunks/chunk-JXT47VT6.js.map +0 -6
  301. package/dist/chunks/chunk-QRGO6R2O.js.map +0 -6
  302. package/dist/chunks/chunk-QWBR6FBY.js.map +0 -6
  303. package/dist/chunks/chunk-SIWZZF4M.js.map +0 -6
  304. package/dist/chunks/chunk-WHOSI6UQ.js.map +0 -6
  305. package/dist/chunks/chunk-XMOKHCPV.js.map +0 -6
  306. package/dist/chunks/chunk-Y74CPWYC.js.map +0 -6
  307. package/dist/chunks/cli-runtime-HW6GQKC6.js +0 -186
  308. package/dist/chunks/cli-runtime-HW6GQKC6.js.map +0 -6
  309. package/dist/chunks/dist-AZ5T257L.js.map +0 -6
  310. package/dist/chunks/exec-KX46LZ36.js.map +0 -6
  311. package/dist/chunks/message-command-QVNUJN47.js.map +0 -6
  312. package/dist/chunks/resume-7V44GSEU.js +0 -23
  313. package/dist/chunks/tui-2XOSCALL.js.map +0 -6
  314. /package/dist/chunks/{activity-command-JROQLBPA.js.map → activity-command-WE45L6EF.js.map} +0 -0
  315. /package/dist/chunks/{add-ILLLF6YP.js.map → add-RLDOB23V.js.map} +0 -0
  316. /package/dist/chunks/{agent-YQI5KOPV.js.map → agent-VXVUHPUF.js.map} +0 -0
  317. /package/dist/chunks/{agent-session-3MUZCWQ4.js.map → agent-session-HLH4P7W4.js.map} +0 -0
  318. /package/dist/chunks/{archive-55KJKGJB.js.map → archive-M5SZWEBT.js.map} +0 -0
  319. /package/dist/chunks/{bin-main-332F5KRZ.js.map → bin-main-HCAGOSEJ.js.map} +0 -0
  320. /package/dist/chunks/{browser-C6AOJ3CH.js.map → browser-GO5REABI.js.map} +0 -0
  321. /package/dist/chunks/{chat-45H5F3KI.js.map → chat-ZV3OQQRQ.js.map} +0 -0
  322. /package/dist/chunks/{chunk-6GBZAUYW.js.map → chunk-2343E2J7.js.map} +0 -0
  323. /package/dist/chunks/{chunk-4TS6ZPOZ.js.map → chunk-26VFNQCY.js.map} +0 -0
  324. /package/dist/chunks/{chunk-XXUL6HHM.js.map → chunk-3IPE4LDE.js.map} +0 -0
  325. /package/dist/chunks/{chunk-L3QW53QL.js.map → chunk-3PSNEUBW.js.map} +0 -0
  326. /package/dist/chunks/{chunk-YM4DUQ3P.js.map → chunk-44OG65HR.js.map} +0 -0
  327. /package/dist/chunks/{chunk-AZPS37AQ.js.map → chunk-4C6462L3.js.map} +0 -0
  328. /package/dist/chunks/{chunk-YPHXWFKQ.js.map → chunk-4NBV2LZS.js.map} +0 -0
  329. /package/dist/chunks/{chunk-RVSVVL6O.js.map → chunk-4PSNBASI.js.map} +0 -0
  330. /package/dist/chunks/{chunk-HO2ZUI5Y.js.map → chunk-4TBPO43I.js.map} +0 -0
  331. /package/dist/chunks/{chunk-URJ7TITR.js.map → chunk-5OVJ2ZCX.js.map} +0 -0
  332. /package/dist/chunks/{chunk-HXAWIWOZ.js.map → chunk-5WHSDJCC.js.map} +0 -0
  333. /package/dist/chunks/{chunk-EWSIGY2A.js.map → chunk-5WJAAPVQ.js.map} +0 -0
  334. /package/dist/chunks/{chunk-BDLDDNNO.js.map → chunk-5WJXI4JR.js.map} +0 -0
  335. /package/dist/chunks/{chunk-Y3I7AAD6.js.map → chunk-6LLUYDBO.js.map} +0 -0
  336. /package/dist/chunks/{chunk-FSKJ3EZC.js.map → chunk-7M6ZU2NT.js.map} +0 -0
  337. /package/dist/chunks/{chunk-W2PJ6ZHY.js.map → chunk-7S2H77Y7.js.map} +0 -0
  338. /package/dist/chunks/{chunk-CW2N2QS2.js.map → chunk-AN3DBA6N.js.map} +0 -0
  339. /package/dist/chunks/{chunk-FMEGRBJP.js.map → chunk-AX7KHJVF.js.map} +0 -0
  340. /package/dist/chunks/{chunk-XGVCAMNT.js.map → chunk-CC2HK5I5.js.map} +0 -0
  341. /package/dist/chunks/{chunk-4IIEEOCA.js.map → chunk-CECVIOY5.js.map} +0 -0
  342. /package/dist/chunks/{chunk-N4OY22M2.js.map → chunk-CQC6GJQE.js.map} +0 -0
  343. /package/dist/chunks/{chunk-DLL2FPUY.js.map → chunk-DU27LH3W.js.map} +0 -0
  344. /package/dist/chunks/{chunk-Y2DZ27P6.js.map → chunk-DW3ML3PZ.js.map} +0 -0
  345. /package/dist/chunks/{chunk-RGVJHSMU.js.map → chunk-E2F7P6GI.js.map} +0 -0
  346. /package/dist/chunks/{chunk-23NRJ2RC.js.map → chunk-FVYKDRVT.js.map} +0 -0
  347. /package/dist/chunks/{chunk-JD2HLKFO.js.map → chunk-G7D7FNRZ.js.map} +0 -0
  348. /package/dist/chunks/{chunk-N56FVHCU.js.map → chunk-GQ6ZQA7C.js.map} +0 -0
  349. /package/dist/chunks/{chunk-YP7AINGL.js.map → chunk-HOWIEIPK.js.map} +0 -0
  350. /package/dist/chunks/{chunk-FTMTO72X.js.map → chunk-HSEIISLI.js.map} +0 -0
  351. /package/dist/chunks/{chunk-ESZ7X37S.js.map → chunk-JLZP3PRV.js.map} +0 -0
  352. /package/dist/chunks/{chunk-A3AF5WXZ.js.map → chunk-LAAQCLVV.js.map} +0 -0
  353. /package/dist/chunks/{chunk-K6LLMOB2.js.map → chunk-LC4R7FEV.js.map} +0 -0
  354. /package/dist/chunks/{chunk-HQZ3GBQI.js.map → chunk-LYI2HXN4.js.map} +0 -0
  355. /package/dist/chunks/{chunk-S4KDR6G5.js.map → chunk-ON4RSB2L.js.map} +0 -0
  356. /package/dist/chunks/{chunk-IQQ6TY4W.js.map → chunk-OQMQL3WF.js.map} +0 -0
  357. /package/dist/chunks/{chunk-YVIM3MXU.js.map → chunk-PAB3MJVU.js.map} +0 -0
  358. /package/dist/chunks/{chunk-HOIDWHGC.js.map → chunk-PLYCCNXW.js.map} +0 -0
  359. /package/dist/chunks/{chunk-6PNBIMWH.js.map → chunk-PYMCT4ZA.js.map} +0 -0
  360. /package/dist/chunks/{chunk-R2LYGFCI.js.map → chunk-Q7NNEWMZ.js.map} +0 -0
  361. /package/dist/chunks/{chunk-3LNTQLQ4.js.map → chunk-QRC4LSKT.js.map} +0 -0
  362. /package/dist/chunks/{chunk-BRKD6FMO.js.map → chunk-QXRLKALD.js.map} +0 -0
  363. /package/dist/chunks/{chunk-XCMCPWMB.js.map → chunk-R4MQECAY.js.map} +0 -0
  364. /package/dist/chunks/{chunk-M46GKTOI.js.map → chunk-R7IUMUGJ.js.map} +0 -0
  365. /package/dist/chunks/{chunk-N3C5X6BW.js.map → chunk-SLVAGDHU.js.map} +0 -0
  366. /package/dist/chunks/{chunk-SRYIMLOK.js.map → chunk-UFSCA2XZ.js.map} +0 -0
  367. /package/dist/chunks/{chunk-6LVWHXT6.js.map → chunk-UQKTVCUV.js.map} +0 -0
  368. /package/dist/chunks/{chunk-QT6KYBCC.js.map → chunk-USAZW2SV.js.map} +0 -0
  369. /package/dist/chunks/{chunk-TW5BCDA5.js.map → chunk-V3P5BZE4.js.map} +0 -0
  370. /package/dist/chunks/{chunk-35VTE7V5.js.map → chunk-VHS5I4HA.js.map} +0 -0
  371. /package/dist/chunks/{chunk-J4IES4SO.js.map → chunk-WALXUBIZ.js.map} +0 -0
  372. /package/dist/chunks/{chunk-QUELENQP.js.map → chunk-WPECMU3F.js.map} +0 -0
  373. /package/dist/chunks/{chunk-SNC5D5UG.js.map → chunk-XS2JWCGM.js.map} +0 -0
  374. /package/dist/chunks/{chunk-4NO5XFK2.js.map → chunk-YV227DWZ.js.map} +0 -0
  375. /package/dist/chunks/{commands-JZT6JJY5.js.map → commands-OWQUB7JT.js.map} +0 -0
  376. /package/dist/chunks/{crash-report-TWMWHNKY.js.map → crash-report-KDMLQRS6.js.map} +0 -0
  377. /package/dist/chunks/{dist-POSMI3PI.js.map → dist-5A3XKURK.js.map} +0 -0
  378. /package/dist/chunks/{dist-CLKFY67B.js.map → dist-FURVCE4N.js.map} +0 -0
  379. /package/dist/chunks/{dist-4EGZFRWY.js.map → dist-RS5H5LHE.js.map} +0 -0
  380. /package/dist/chunks/{dist-6ORFQIRV.js.map → dist-VKC2OF2P.js.map} +0 -0
  381. /package/dist/chunks/{dist-K5JIOWIQ.js.map → dist-WPETBMRE.js.map} +0 -0
  382. /package/dist/chunks/{dist-MVLQAON2.js.map → dist-XFPIH4KV.js.map} +0 -0
  383. /package/dist/chunks/{doctor-UVZBNUNF.js.map → doctor-ZDM3LGPR.js.map} +0 -0
  384. /package/dist/chunks/{drain-27E6XUNK.js.map → drain-BCDD6WT4.js.map} +0 -0
  385. /package/dist/chunks/{eval-NRRIWDET.js.map → eval-CWHRB4CM.js.map} +0 -0
  386. /package/dist/chunks/{home-RT2I6VTQ.js.map → home-B3DTR4JZ.js.map} +0 -0
  387. /package/dist/chunks/{host-queries-ZXGOA6ZL.js.map → host-queries-RIHABSRA.js.map} +0 -0
  388. /package/dist/chunks/{learn-5KKZ4ZFX.js.map → learn-FVDHNZ3E.js.map} +0 -0
  389. /package/dist/chunks/{learn-builtin-MSUF4MEJ.js.map → learn-builtin-DIGVMU2K.js.map} +0 -0
  390. /package/dist/chunks/{lifecycle-TZU6D46R.js.map → lifecycle-T5KZCOME.js.map} +0 -0
  391. /package/dist/chunks/{list-QCWNMQED.js.map → list-ALYIIETE.js.map} +0 -0
  392. /package/dist/chunks/{live-V7HRF5KR.js.map → live-QYXRKG27.js.map} +0 -0
  393. /package/dist/chunks/{login-QFP3PIXG.js.map → login-YYDHSXYZ.js.map} +0 -0
  394. /package/dist/chunks/{logs-XTXMS4JF.js.map → logs-HGYW5QG6.js.map} +0 -0
  395. /package/dist/chunks/{mcp-WQFJJ4NO.js.map → mcp-DXCRUYBA.js.map} +0 -0
  396. /package/dist/chunks/{operator-tools-2OYRNPCH.js.map → operator-tools-HM2DKEA3.js.map} +0 -0
  397. /package/dist/chunks/{output-schema-ETVPLUXE.js.map → output-schema-S4OZKHPX.js.map} +0 -0
  398. /package/dist/chunks/{pal-BYFZCLE2.js.map → pal-PISV32OY.js.map} +0 -0
  399. /package/dist/chunks/{providers-KP5JHTTK.js.map → providers-UCHYI3MC.js.map} +0 -0
  400. /package/dist/chunks/{resume-7V44GSEU.js.map → resume-PM73RFB2.js.map} +0 -0
  401. /package/dist/chunks/{resume-command-OKJ2MJPB.js.map → resume-command-TNYIW6PZ.js.map} +0 -0
  402. /package/dist/chunks/{schedule-TVR3FE32.js.map → schedule-PPTJ3BJ7.js.map} +0 -0
  403. /package/dist/chunks/{service-6A3TOQKV.js.map → service-OMRDQOPM.js.map} +0 -0
  404. /package/dist/chunks/{session-step-N4GHA2YE.js.map → session-step-C54ZEOLL.js.map} +0 -0
  405. /package/dist/chunks/{skills-WXYSPDKL.js.map → skills-CNZMMJFB.js.map} +0 -0
  406. /package/dist/chunks/{start-check-BUCN5MCU.js.map → start-check-H4GSB34J.js.map} +0 -0
  407. /package/dist/chunks/{state-PVAVIXHK.js.map → state-VEYKYIIF.js.map} +0 -0
  408. /package/dist/chunks/{store-D3XUEEAF.js.map → store-BGVZ7PVQ.js.map} +0 -0
  409. /package/dist/chunks/{store-NB3KR4XA.js.map → store-FW3TZA4K.js.map} +0 -0
  410. /package/dist/chunks/{store-O3KC2PPZ.js.map → store-S3M6B7JR.js.map} +0 -0
  411. /package/dist/chunks/{upgrade-FY5ULZQF.js.map → upgrade-XRCA3O4X.js.map} +0 -0
  412. /package/dist/chunks/{worktree-MVW62U5G.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-HXAWIWOZ.js";
5
+ } from "./chunk-5WHSDJCC.js";
6
6
  import {
7
7
  resolveResume
8
- } from "./chunk-WHOSI6UQ.js";
8
+ } from "./chunk-I7HAYS6Z.js";
9
9
  import {
10
10
  expandHeadlessCommand,
11
11
  hostCommandNames
12
- } from "./chunk-JXT47VT6.js";
12
+ } from "./chunk-VESQFRF3.js";
13
13
  import {
14
14
  withTerminationHandling
15
- } from "./chunk-YPHXWFKQ.js";
15
+ } from "./chunk-4NBV2LZS.js";
16
16
  import "./chunk-TBIX6JRE.js";
17
- import "./chunk-EWSIGY2A.js";
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-XGVCAMNT.js";
26
+ } from "./chunk-CC2HK5I5.js";
27
27
  import {
28
28
  completionNotice,
29
29
  runTokens
30
- } from "./chunk-S4KDR6G5.js";
31
- import "./chunk-4IIEEOCA.js";
32
- import "./chunk-QRGO6R2O.js";
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-GOGBOZKO.js";
42
- import "./chunk-KONYGNG6.js";
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-5XWMKWQQ.js";
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-XXUL6HHM.js";
70
+ } from "./chunk-3IPE4LDE.js";
68
71
  import {
69
72
  describeTurnInterruption,
70
73
  retryAfterMs
71
- } from "./chunk-BDLDDNNO.js";
74
+ } from "./chunk-5WJXI4JR.js";
72
75
  import {
73
76
  resolvePermissionMode
74
- } from "./chunk-J4IES4SO.js";
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-QWBR6FBY.js";
83
- import "./chunk-IQQ6TY4W.js";
86
+ } from "./chunk-CLXRRUDH.js";
87
+ import "./chunk-OQMQL3WF.js";
84
88
  import "./chunk-JQIBPPOL.js";
85
- import "./chunk-FMEGRBJP.js";
86
- import "./chunk-ESZ7X37S.js";
87
- import "./chunk-M46GKTOI.js";
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-FTMTO72X.js";
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-HOY7BUGW.js";
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-JD2HLKFO.js";
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-DLL2FPUY.js";
113
+ import "./chunk-DU27LH3W.js";
110
114
  import "./chunk-JORONMD3.js";
111
- import "./chunk-BRKD6FMO.js";
112
- import "./chunk-YVIM3MXU.js";
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-7E3V7NNN.js";
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 prompt = flags.rest.join(" ").trim();
586
- if (!prompt) return fail("no prompt \u2014 pass it as an argument");
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-YQI5KOPV.js");
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
- scope: {
680
- sessionId: conversationId ?? generateSessionId(),
681
- topicId: cli.topicId,
682
- projectId: cli.projectId,
683
- tenantId: cli.tenantId
684
- },
685
- stateRoot: cli.root,
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
- await stream(messages, prompt);
831
- for (let rounds = 0; (watch || monitorWatch) && !stopped && !paused && !busy && rounds < MAX_REPORT_TURNS; rounds += 1) {
832
- const workflowReport = watch ? await watch.report({
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
- ...history ?? messages,
844
- ...workflowReport !== void 0 ? [reportMessage(workflowReport)] : [],
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-YQI5KOPV.js");
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
- sessions = await openSessions(cwd);
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
- const prior = resume.kind === "resumed" ? resume.messages : [];
1250
+ let prior = resume.kind === "resumed" ? resume.messages : [];
1096
1251
  let sessionId;
1097
1252
  try {
1098
- sessionId = resume.kind === "resumed" ? asSessionId(resume.sessionId) : await startConversation(sessions);
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
- scope: {
1111
- sessionId,
1112
- topicId: sessions.topicId,
1113
- projectId: sessions.projectId,
1114
- tenantId: sessions.tenantId
1115
- },
1116
- stateRoot: sessions.root,
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
- closeSessions(sessions);
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
- closeSessions(sessions);
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
- closeSessions(sessions);
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
- ctx.formatter.info(`resuming ${resume.sessionId} \xB7 ${prior.length} messages`);
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({ message: stoppedBy(signal, sessionId, phase, stop.paused) });
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
- closeSessions(sessions);
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
- closeSessions(sessions);
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
- return flags.json ? execJson(args, termination, flags, structuredOutput) : execPrint(args, termination, flags, structuredOutput);
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-KX46LZ36.js.map
1741
+ //# sourceMappingURL=exec-ZL7XCVPV.js.map