@humain/humain-code 0.8.3 → 0.8.4

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 (899) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/dist/bundle/agent-monitor.js +1 -1
  3. package/dist/bundle/chunks/anthropic-messages-42CGJCSR.js +82 -0
  4. package/dist/bundle/chunks/ask-VH7GNX75.js +97 -0
  5. package/dist/bundle/chunks/azure-openai-responses-DOKKMBUN.js +15 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +200 -179
  7. package/dist/bundle/chunks/bowser-UX7KDMIY.js +92 -0
  8. package/dist/bundle/chunks/{chunk-46C6D7UC.js → chunk-2CYGUEQO.js} +1 -1
  9. package/dist/bundle/chunks/chunk-3RXT35Y3.js +3 -0
  10. package/dist/bundle/chunks/chunk-4BNDLR6C.js +177 -0
  11. package/dist/bundle/chunks/{chunk-MPRAQ6ZI.js → chunk-4LGBXPUD.js} +1 -1
  12. package/dist/bundle/chunks/chunk-4SL6URR3.js +90 -0
  13. package/dist/bundle/chunks/{chunk-7LSTTCSC.js → chunk-52642TYH.js} +316 -148
  14. package/dist/bundle/chunks/{chunk-LSRXA7OS.js → chunk-5C5K4EVJ.js} +3 -3
  15. package/dist/bundle/chunks/{chunk-2JNJJ6SZ.js → chunk-5KUCY54O.js} +3 -3
  16. package/dist/bundle/chunks/{chunk-4TDNOR36.js → chunk-625QJSFJ.js} +1 -1
  17. package/dist/bundle/chunks/chunk-73YX5XGR.js +2461 -0
  18. package/dist/bundle/chunks/chunk-7DIRHF4H.js +17 -0
  19. package/dist/bundle/chunks/{chunk-QJB5YI3I.js → chunk-7PAXKU7M.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-R2KD2HFT.js → chunk-7YB3HRRN.js} +83 -196
  21. package/dist/bundle/chunks/{chunk-DCXHRP6C.js → chunk-A2UZYK23.js} +13 -13
  22. package/dist/bundle/chunks/chunk-A5ZMBTTM.js +12 -0
  23. package/dist/bundle/chunks/{chunk-JKX5EGOT.js → chunk-AER66CNP.js} +13 -13
  24. package/dist/bundle/chunks/chunk-ARTF7ZMQ.js +5 -0
  25. package/dist/bundle/chunks/chunk-B3FT6L6S.js +131 -0
  26. package/dist/bundle/chunks/chunk-BIC5BSNX.js +13 -0
  27. package/dist/bundle/chunks/{chunk-JSHKS7VH.js → chunk-BNZZJ4LO.js} +1 -1
  28. package/dist/bundle/chunks/{chunk-4MKATHT2.js → chunk-CG43CMFH.js} +1 -1
  29. package/dist/bundle/chunks/{chunk-2XD7TLKB.js → chunk-CIAXW64K.js} +16 -16
  30. package/dist/bundle/chunks/{chunk-VFLVWPLZ.js → chunk-CKFLQGJN.js} +20 -16
  31. package/dist/bundle/chunks/chunk-D4UCXXDP.js +115 -0
  32. package/dist/bundle/chunks/{chunk-HQMUDHC3.js → chunk-D6ZWWDW5.js} +6 -5
  33. package/dist/bundle/chunks/{chunk-4GB7A76U.js → chunk-EVDQRT3I.js} +225 -348
  34. package/dist/bundle/chunks/{chunk-FJIISX5W.js → chunk-F74XLJPC.js} +195 -192
  35. package/dist/bundle/chunks/chunk-FDRBTGFJ.js +4 -0
  36. package/dist/bundle/chunks/{chunk-E4VUW4RI.js → chunk-FLWO3H5J.js} +12 -12
  37. package/dist/bundle/chunks/{chunk-KLSRGGOH.js → chunk-G2PFPQX7.js} +2 -2
  38. package/dist/bundle/chunks/chunk-GMPJWLZS.js +57 -0
  39. package/dist/bundle/chunks/{chunk-M5TVWJ5T.js → chunk-H35P7ROY.js} +462 -441
  40. package/dist/bundle/chunks/chunk-HCHCYBNK.js +2 -0
  41. package/dist/bundle/chunks/{chunk-7WE77IE3.js → chunk-HRNYDRL7.js} +1 -1
  42. package/dist/bundle/chunks/chunk-HWFAAGYK.js +23 -0
  43. package/dist/bundle/chunks/{chunk-VSXVZVBE.js → chunk-HWXQCJDP.js} +408 -392
  44. package/dist/bundle/chunks/{chunk-PVNXN2TC.js → chunk-II5C7G67.js} +1 -1
  45. package/dist/bundle/chunks/{chunk-F2H47FRF.js → chunk-IMRZP5SC.js} +182 -137
  46. package/dist/bundle/chunks/{chunk-AW24RHGJ.js → chunk-J5YFXMTM.js} +4 -4
  47. package/dist/bundle/chunks/chunk-J64VNQ6D.js +13 -0
  48. package/dist/bundle/chunks/{chunk-65FLSKDA.js → chunk-K5EFEIFP.js} +5 -4
  49. package/dist/bundle/chunks/{chunk-KI7CHPWC.js → chunk-KJ3QRSSY.js} +46 -43
  50. package/dist/bundle/chunks/{cli-6DJO467D.js → chunk-KSEO2LRK.js} +12 -10
  51. package/dist/bundle/chunks/{chunk-HHWVVNGG.js → chunk-MA2WCMSN.js} +2 -2
  52. package/dist/bundle/chunks/{chunk-L4J7SMJB.js → chunk-MAEKQSFU.js} +1 -1
  53. package/dist/bundle/chunks/chunk-MHQNLTZR.js +8 -0
  54. package/dist/bundle/chunks/chunk-MLOUZAVZ.js +122 -0
  55. package/dist/bundle/chunks/chunk-MQYR4Q6X.js +5 -0
  56. package/dist/bundle/chunks/chunk-MXF3KYLZ.js +4 -0
  57. package/dist/bundle/chunks/{chunk-GY663MNP.js → chunk-MZRTVX7F.js} +1 -1
  58. package/dist/bundle/chunks/chunk-MZYHSWHX.js +59 -0
  59. package/dist/bundle/chunks/{chunk-6HTHDVJC.js → chunk-NPVRWPGX.js} +1 -1
  60. package/dist/bundle/chunks/{chunk-BRSLXHED.js → chunk-O44A4E4K.js} +1 -1
  61. package/dist/bundle/chunks/{chunk-T2ZGMEMV.js → chunk-OADQOW67.js} +175 -260
  62. package/dist/bundle/chunks/chunk-OTVHRZ67.js +17 -0
  63. package/dist/bundle/chunks/{chunk-J4GII2EE.js → chunk-P7SLTLSZ.js} +51 -46
  64. package/dist/bundle/chunks/{chunk-7OZNMWAJ.js → chunk-PPGSQZZF.js} +1 -1
  65. package/dist/bundle/chunks/chunk-PYX6ZCC7.js +29 -0
  66. package/dist/bundle/chunks/chunk-PZ7NYBHJ.js +8 -0
  67. package/dist/bundle/chunks/{chunk-VCMXBP5S.js → chunk-QESIDBMW.js} +1 -7
  68. package/dist/bundle/chunks/chunk-QUWVILLB.js +3 -0
  69. package/dist/bundle/chunks/chunk-QZWUXGY7.js +99 -0
  70. package/dist/bundle/chunks/{chunk-MIAXMK5F.js → chunk-QZXLTW7V.js} +8 -7
  71. package/dist/bundle/chunks/chunk-RP6MWUAP.js +4 -0
  72. package/dist/bundle/chunks/{chunk-MUN4ZZZP.js → chunk-SOE25WIS.js} +1143 -1167
  73. package/dist/bundle/chunks/{chunk-JSZBTGI6.js → chunk-SZZ5PNP6.js} +2 -2
  74. package/dist/bundle/chunks/chunk-T5WECB2D.js +7 -0
  75. package/dist/bundle/chunks/{chunk-2NVGOSBN.js → chunk-T7F2TEIS.js} +37 -13
  76. package/dist/bundle/chunks/{chunk-ZSWU5KKA.js → chunk-UOSJTMCL.js} +7 -3
  77. package/dist/bundle/chunks/{chunk-6P6MMQUH.js → chunk-UTRUALFN.js} +3 -3
  78. package/dist/bundle/chunks/{chunk-PWFM6AQQ.js → chunk-V2HTCZRF.js} +70 -67
  79. package/dist/bundle/chunks/{chunk-JX6YIPNK.js → chunk-WCKS2DPT.js} +1 -1
  80. package/dist/bundle/chunks/chunk-XGOJCV6Z.js +2 -0
  81. package/dist/bundle/chunks/chunk-XGSJX23G.js +1151 -0
  82. package/dist/bundle/chunks/{chunk-7WETECIB.js → chunk-Z7BWHPJ2.js} +1 -1
  83. package/dist/bundle/chunks/chunk-ZFFDBTG3.js +17 -0
  84. package/dist/bundle/chunks/cli-NJLV3XDZ.js +3 -0
  85. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JEZVYITT.js → cloudflare-workers-ai-system-one-ZAZW4M4B.js} +1 -1
  86. package/dist/bundle/chunks/{compat-4ILE5BEC.js → compat-7UJJAO4E.js} +12 -12
  87. package/dist/bundle/chunks/{curator-server-QB4GITGS.js → curator-server-MW645JI3.js} +2 -2
  88. package/dist/bundle/chunks/{dist-NXHRL2KY.js → dist-7PCCEUQF.js} +2 -2
  89. package/dist/bundle/chunks/{dist-I6CI3CG5.js → dist-I53JI67E.js} +9 -9
  90. package/dist/bundle/chunks/{dist-35STTNYA.js → dist-NI2PTSLH.js} +1 -1
  91. package/dist/bundle/chunks/{dist-CBODG4CA.js → dist-VXQT3DQY.js} +6 -6
  92. package/dist/bundle/chunks/{dist-cjs-EROMDUKS.js → dist-cjs-4JQA6W3S.js} +31 -31
  93. package/dist/bundle/chunks/doctor-KJVAYG3F.js +83 -0
  94. package/dist/bundle/chunks/{easter-egg-3d-VZC5WOYV.js → easter-egg-3d-Z24JLXD4.js} +1 -1
  95. package/dist/bundle/chunks/entry-3EL6GOWK.js +2 -0
  96. package/dist/bundle/chunks/{entry-6XDR2IDE.js → entry-4IMREZBD.js} +80 -79
  97. package/dist/bundle/chunks/{execute-6MEJJF2T.js → execute-C4BZQRPQ.js} +23 -22
  98. package/dist/bundle/chunks/{extract-L373D6O7.js → extract-XVQCIS7D.js} +5 -5
  99. package/dist/bundle/chunks/{flow-implementer-XOP4MG5X.js → flow-implementer-GE2ARQKR.js} +5 -5
  100. package/dist/bundle/chunks/github-copilot.js +57 -56
  101. package/dist/bundle/chunks/google-generative-ai-P2P45MYP.js +22 -0
  102. package/dist/bundle/chunks/google-vertex-SHY4IS5F.js +26 -0
  103. package/dist/bundle/chunks/{host-WOLZCWQQ.js → host-YESS2VAB.js} +1 -1
  104. package/dist/bundle/chunks/{index.bundle-HONF3PUD.js → index.bundle-TZT64KLH.js} +102 -89
  105. package/dist/bundle/chunks/{inprocess-MBKFGDM2.js → inprocess-MGMVI6HN.js} +6 -6
  106. package/dist/bundle/chunks/interactive-mode-HHWOE4FD.js +5 -0
  107. package/dist/bundle/chunks/{llama-cpp-classify-KYZT532X.js → llama-cpp-classify-RSRH4KV2.js} +5 -5
  108. package/dist/bundle/chunks/mistral-conversations-YTMJKHHI.js +42 -0
  109. package/dist/bundle/chunks/{node-N7TPBUJB.js → node-FF6QQQLH.js} +1 -1
  110. package/dist/bundle/chunks/openai-codex-responses-NUCJOJSZ.js +97 -0
  111. package/dist/bundle/chunks/openai-completions-E5NRJUHA.js +91 -0
  112. package/dist/bundle/chunks/{openai-decisions-JMSDGR7K.js → openai-decisions-342J5ZYG.js} +1 -1
  113. package/dist/bundle/chunks/openai-responses-BN5Z4HFI.js +26 -0
  114. package/dist/bundle/chunks/openrouter-images-7RNG3JVF.js +12 -0
  115. package/dist/bundle/chunks/{pdfjs-FE3L72A6.js → pdfjs-LSTLRXQW.js} +1415 -1416
  116. package/dist/bundle/chunks/pi-messages-2L7FV5OK.js +22 -0
  117. package/dist/bundle/chunks/questionnaire-session-XEVAK7JS.js +123 -0
  118. package/dist/bundle/chunks/runtime-2FSZRUG5.js +2 -0
  119. package/dist/bundle/chunks/session-picker-666KJIVM.js +4 -0
  120. package/dist/bundle/chunks/startup-ui-INEVSNGK.js +3 -0
  121. package/dist/bundle/chunks/{trace-command-VM7FBWPE.js → trace-command-BCVMZ5ZD.js} +4 -4
  122. package/dist/bundle/chunks/typesafe-system-one-UJUNSZG4.js +3 -0
  123. package/dist/bundle/chunks/{undici-WVNE45GY.js → undici-7IGAYA4S.js} +1 -1
  124. package/dist/bundle/chunks/virtual-modules-UXSSFNV5.js +29 -0
  125. package/dist/bundle/cli-runtime.js +5 -5
  126. package/dist/bundle/flow/package.json +3 -3
  127. package/dist/bundle/index.js +13 -13
  128. package/dist/bundle/orchestrate/package.json +1 -1
  129. package/dist/bundle/rpc-entry.js +5 -4
  130. package/dist/cli/agent-dir-arg.d.ts +12 -0
  131. package/dist/cli/agent-dir-arg.d.ts.map +1 -0
  132. package/dist/cli/agent-dir-arg.js +15 -0
  133. package/dist/cli/agent-dir-arg.js.map +1 -0
  134. package/dist/cli/args.d.ts +9 -0
  135. package/dist/cli/args.d.ts.map +1 -1
  136. package/dist/cli/args.js +19 -5
  137. package/dist/cli/args.js.map +1 -1
  138. package/dist/cli/auth-check.d.ts +1 -1
  139. package/dist/cli/auth-check.d.ts.map +1 -1
  140. package/dist/cli/auth-check.js +4 -2
  141. package/dist/cli/auth-check.js.map +1 -1
  142. package/dist/cli/doctor-config.d.ts +14 -0
  143. package/dist/cli/doctor-config.d.ts.map +1 -0
  144. package/dist/cli/doctor-config.js +92 -0
  145. package/dist/cli/doctor-config.js.map +1 -0
  146. package/dist/cli/doctor-system.d.ts +12 -0
  147. package/dist/cli/doctor-system.d.ts.map +1 -0
  148. package/dist/cli/doctor-system.js +109 -0
  149. package/dist/cli/doctor-system.js.map +1 -0
  150. package/dist/cli/doctor.d.ts +11 -0
  151. package/dist/cli/doctor.d.ts.map +1 -0
  152. package/dist/cli/doctor.js +323 -0
  153. package/dist/cli/doctor.js.map +1 -0
  154. package/dist/cli/doctor.lazy.d.ts +3 -0
  155. package/dist/cli/doctor.lazy.d.ts.map +1 -0
  156. package/dist/cli/doctor.lazy.js +3 -0
  157. package/dist/cli/doctor.lazy.js.map +1 -0
  158. package/dist/cli/list-models.d.ts.map +1 -1
  159. package/dist/cli/list-models.js +0 -4
  160. package/dist/cli/list-models.js.map +1 -1
  161. package/dist/cli/project-trust.d.ts.map +1 -1
  162. package/dist/cli/project-trust.js +6 -6
  163. package/dist/cli/project-trust.js.map +1 -1
  164. package/dist/cli/startup-ui.d.ts +3 -2
  165. package/dist/cli/startup-ui.d.ts.map +1 -1
  166. package/dist/cli/startup-ui.js +23 -10
  167. package/dist/cli/startup-ui.js.map +1 -1
  168. package/dist/config.d.ts +5 -1
  169. package/dist/config.d.ts.map +1 -1
  170. package/dist/config.js +13 -3
  171. package/dist/config.js.map +1 -1
  172. package/dist/coordination/broker/broker.d.ts +3 -3
  173. package/dist/coordination/broker/broker.d.ts.map +1 -1
  174. package/dist/coordination/broker/broker.js +15 -7
  175. package/dist/coordination/broker/broker.js.map +1 -1
  176. package/dist/core/acceptance-command.d.ts +6 -3
  177. package/dist/core/acceptance-command.d.ts.map +1 -1
  178. package/dist/core/acceptance-command.js +43 -12
  179. package/dist/core/acceptance-command.js.map +1 -1
  180. package/dist/core/acceptance-ledger.d.ts +2 -0
  181. package/dist/core/acceptance-ledger.d.ts.map +1 -1
  182. package/dist/core/acceptance-ledger.js +14 -3
  183. package/dist/core/acceptance-ledger.js.map +1 -1
  184. package/dist/core/agent-session-runtime.d.ts +11 -4
  185. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  186. package/dist/core/agent-session-runtime.js +13 -4
  187. package/dist/core/agent-session-runtime.js.map +1 -1
  188. package/dist/core/agent-session-services.d.ts.map +1 -1
  189. package/dist/core/agent-session-services.js +6 -0
  190. package/dist/core/agent-session-services.js.map +1 -1
  191. package/dist/core/agent-session.d.ts +19 -1
  192. package/dist/core/agent-session.d.ts.map +1 -1
  193. package/dist/core/agent-session.js +131 -36
  194. package/dist/core/agent-session.js.map +1 -1
  195. package/dist/core/auth-storage.d.ts.map +1 -1
  196. package/dist/core/auth-storage.js +7 -1
  197. package/dist/core/auth-storage.js.map +1 -1
  198. package/dist/core/bash-executor.d.ts +3 -1
  199. package/dist/core/bash-executor.d.ts.map +1 -1
  200. package/dist/core/bash-executor.js +18 -8
  201. package/dist/core/bash-executor.js.map +1 -1
  202. package/dist/core/compaction/branch-summarization.d.ts +2 -2
  203. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  204. package/dist/core/compaction/branch-summarization.js +9 -15
  205. package/dist/core/compaction/branch-summarization.js.map +1 -1
  206. package/dist/core/compaction/compaction.d.ts.map +1 -1
  207. package/dist/core/compaction/compaction.js +3 -0
  208. package/dist/core/compaction/compaction.js.map +1 -1
  209. package/dist/core/export-html/index.d.ts.map +1 -1
  210. package/dist/core/export-html/index.js +12 -10
  211. package/dist/core/export-html/index.js.map +1 -1
  212. package/dist/core/export-html/template.js +23 -1
  213. package/dist/core/extensions/runner.d.ts.map +1 -1
  214. package/dist/core/extensions/runner.js +13 -2
  215. package/dist/core/extensions/runner.js.map +1 -1
  216. package/dist/core/extensions/types.d.ts +9 -1
  217. package/dist/core/extensions/types.d.ts.map +1 -1
  218. package/dist/core/extensions/types.js.map +1 -1
  219. package/dist/core/footer-data-provider.d.ts.map +1 -1
  220. package/dist/core/footer-data-provider.js +2 -4
  221. package/dist/core/footer-data-provider.js.map +1 -1
  222. package/dist/core/http-dispatcher.d.ts +5 -2
  223. package/dist/core/http-dispatcher.d.ts.map +1 -1
  224. package/dist/core/http-dispatcher.js +6 -3
  225. package/dist/core/http-dispatcher.js.map +1 -1
  226. package/dist/core/keybindings.d.ts +20 -0
  227. package/dist/core/keybindings.d.ts.map +1 -1
  228. package/dist/core/keybindings.js +4 -1
  229. package/dist/core/keybindings.js.map +1 -1
  230. package/dist/core/mcp-servers.d.ts +29 -0
  231. package/dist/core/mcp-servers.d.ts.map +1 -1
  232. package/dist/core/mcp-servers.js +63 -17
  233. package/dist/core/mcp-servers.js.map +1 -1
  234. package/dist/core/messages.d.ts +4 -0
  235. package/dist/core/messages.d.ts.map +1 -1
  236. package/dist/core/messages.js +10 -2
  237. package/dist/core/messages.js.map +1 -1
  238. package/dist/core/model-config.d.ts +36 -0
  239. package/dist/core/model-config.d.ts.map +1 -1
  240. package/dist/core/model-resolver.js +1 -1
  241. package/dist/core/model-resolver.js.map +1 -1
  242. package/dist/core/model-runtime.d.ts.map +1 -1
  243. package/dist/core/model-runtime.js +6 -2
  244. package/dist/core/model-runtime.js.map +1 -1
  245. package/dist/core/nested-tool-calls.d.ts +6 -5
  246. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  247. package/dist/core/nested-tool-calls.js +1 -3
  248. package/dist/core/nested-tool-calls.js.map +1 -1
  249. package/dist/core/os-secret-store.js +1 -1
  250. package/dist/core/os-secret-store.js.map +1 -1
  251. package/dist/core/package-manager.d.ts +3 -1
  252. package/dist/core/package-manager.d.ts.map +1 -1
  253. package/dist/core/package-manager.js +25 -4
  254. package/dist/core/package-manager.js.map +1 -1
  255. package/dist/core/pi-ai-schemas.d.ts +4 -0
  256. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  257. package/dist/core/project-trust.d.ts.map +1 -1
  258. package/dist/core/project-trust.js +1 -1
  259. package/dist/core/project-trust.js.map +1 -1
  260. package/dist/core/provider-composer.d.ts +1 -0
  261. package/dist/core/provider-composer.d.ts.map +1 -1
  262. package/dist/core/provider-composer.js +1 -0
  263. package/dist/core/provider-composer.js.map +1 -1
  264. package/dist/core/resolve-config-value.d.ts +4 -0
  265. package/dist/core/resolve-config-value.d.ts.map +1 -1
  266. package/dist/core/resolve-config-value.js +14 -3
  267. package/dist/core/resolve-config-value.js.map +1 -1
  268. package/dist/core/resource-loader.d.ts.map +1 -1
  269. package/dist/core/resource-loader.js +40 -2
  270. package/dist/core/resource-loader.js.map +1 -1
  271. package/dist/core/runtime-credentials.d.ts.map +1 -1
  272. package/dist/core/runtime-credentials.js +11 -7
  273. package/dist/core/runtime-credentials.js.map +1 -1
  274. package/dist/core/sdk.d.ts.map +1 -1
  275. package/dist/core/sdk.js +8 -4
  276. package/dist/core/sdk.js.map +1 -1
  277. package/dist/core/session-manager.d.ts +22 -1
  278. package/dist/core/session-manager.d.ts.map +1 -1
  279. package/dist/core/session-manager.js +227 -37
  280. package/dist/core/session-manager.js.map +1 -1
  281. package/dist/core/settings-defaults.d.ts +10 -1
  282. package/dist/core/settings-defaults.d.ts.map +1 -1
  283. package/dist/core/settings-defaults.js +7 -1
  284. package/dist/core/settings-defaults.js.map +1 -1
  285. package/dist/core/settings-manager.d.ts +14 -4
  286. package/dist/core/settings-manager.d.ts.map +1 -1
  287. package/dist/core/settings-manager.js +48 -15
  288. package/dist/core/settings-manager.js.map +1 -1
  289. package/dist/core/settings-schema.d.ts +20 -2
  290. package/dist/core/settings-schema.d.ts.map +1 -1
  291. package/dist/core/settings-schema.js +27 -4
  292. package/dist/core/settings-schema.js.map +1 -1
  293. package/dist/core/slash-commands.d.ts.map +1 -1
  294. package/dist/core/slash-commands.js +2 -0
  295. package/dist/core/slash-commands.js.map +1 -1
  296. package/dist/core/tools/bash-jobs.js +2 -2
  297. package/dist/core/tools/bash-jobs.js.map +1 -1
  298. package/dist/core/tools/bash.d.ts +3 -0
  299. package/dist/core/tools/bash.d.ts.map +1 -1
  300. package/dist/core/tools/bash.js +78 -46
  301. package/dist/core/tools/bash.js.map +1 -1
  302. package/dist/core/tools/edit-diff.d.ts +7 -1
  303. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  304. package/dist/core/tools/edit-diff.js +139 -75
  305. package/dist/core/tools/edit-diff.js.map +1 -1
  306. package/dist/core/tools/edit.d.ts.map +1 -1
  307. package/dist/core/tools/edit.js +4 -1
  308. package/dist/core/tools/edit.js.map +1 -1
  309. package/dist/core/tools/output-accumulator.d.ts +21 -6
  310. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  311. package/dist/core/tools/output-accumulator.js +90 -76
  312. package/dist/core/tools/output-accumulator.js.map +1 -1
  313. package/dist/core/tools/render-utils.d.ts +7 -2
  314. package/dist/core/tools/render-utils.d.ts.map +1 -1
  315. package/dist/core/tools/render-utils.js +14 -1
  316. package/dist/core/tools/render-utils.js.map +1 -1
  317. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  318. package/dist/core/tools/renderers/bash.js +9 -3
  319. package/dist/core/tools/renderers/bash.js.map +1 -1
  320. package/dist/core/tools/truncate.d.ts +1 -1
  321. package/dist/core/tools/truncate.d.ts.map +1 -1
  322. package/dist/core/tools/truncate.js +16 -7
  323. package/dist/core/tools/truncate.js.map +1 -1
  324. package/dist/core/tools/write.d.ts.map +1 -1
  325. package/dist/core/tools/write.js +2 -0
  326. package/dist/core/tools/write.js.map +1 -1
  327. package/dist/core/trust-manager.d.ts +2 -0
  328. package/dist/core/trust-manager.d.ts.map +1 -1
  329. package/dist/core/trust-manager.js +5 -4
  330. package/dist/core/trust-manager.js.map +1 -1
  331. package/dist/core/usage-totals.d.ts.map +1 -1
  332. package/dist/core/usage-totals.js +3 -0
  333. package/dist/core/usage-totals.js.map +1 -1
  334. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  335. package/dist/extensions/codemode/execute.js +64 -20
  336. package/dist/extensions/codemode/execute.js.map +1 -1
  337. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  338. package/dist/extensions/codemode/renderer.js +8 -3
  339. package/dist/extensions/codemode/renderer.js.map +1 -1
  340. package/dist/extensions/codemode/tool.d.ts +5 -0
  341. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  342. package/dist/extensions/codemode/tool.js.map +1 -1
  343. package/dist/extensions/llama/client.d.ts.map +1 -1
  344. package/dist/extensions/llama/client.js +3 -13
  345. package/dist/extensions/llama/client.js.map +1 -1
  346. package/dist/extensions/llama/ui.d.ts.map +1 -1
  347. package/dist/extensions/llama/ui.js +2 -1
  348. package/dist/extensions/llama/ui.js.map +1 -1
  349. package/dist/extensions/mcp/cli.d.ts +7 -0
  350. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  351. package/dist/extensions/mcp/cli.js +35 -8
  352. package/dist/extensions/mcp/cli.js.map +1 -1
  353. package/dist/extensions/mcp/config.d.ts +33 -0
  354. package/dist/extensions/mcp/config.d.ts.map +1 -1
  355. package/dist/extensions/mcp/config.js +11 -2
  356. package/dist/extensions/mcp/config.js.map +1 -1
  357. package/dist/extensions/mcp/index.d.ts +8 -0
  358. package/dist/extensions/mcp/index.d.ts.map +1 -1
  359. package/dist/extensions/mcp/index.js +16 -0
  360. package/dist/extensions/mcp/index.js.map +1 -1
  361. package/dist/extensions/mcp/resources.d.ts +1 -1
  362. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  363. package/dist/extensions/mcp/resources.js +4 -3
  364. package/dist/extensions/mcp/resources.js.map +1 -1
  365. package/dist/extensions/mcp/runtime.d.ts +1 -1
  366. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  367. package/dist/extensions/mcp/runtime.js +15 -14
  368. package/dist/extensions/mcp/runtime.js.map +1 -1
  369. package/dist/extensions/mcp/tools.d.ts +1 -24
  370. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  371. package/dist/extensions/mcp/tools.js +10 -163
  372. package/dist/extensions/mcp/tools.js.map +1 -1
  373. package/dist/humain/ask-user-question/index.d.ts +4 -0
  374. package/dist/humain/ask-user-question/index.d.ts.map +1 -0
  375. package/dist/humain/ask-user-question/index.js +18 -0
  376. package/dist/humain/ask-user-question/index.js.map +1 -0
  377. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts +38 -0
  378. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts.map +1 -0
  379. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js +97 -0
  380. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js.map +1 -0
  381. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts +41 -0
  382. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts.map +1 -0
  383. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js +441 -0
  384. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js.map +1 -0
  385. package/dist/humain/ask-user-question/vendor/ask/config.d.ts +39 -0
  386. package/dist/humain/ask-user-question/vendor/ask/config.d.ts.map +1 -0
  387. package/dist/humain/ask-user-question/vendor/ask/config.js +95 -0
  388. package/dist/humain/ask-user-question/vendor/ask/config.js.map +1 -0
  389. package/dist/humain/ask-user-question/vendor/ask/events.d.ts +132 -0
  390. package/dist/humain/ask-user-question/vendor/ask/events.d.ts.map +1 -0
  391. package/dist/humain/ask-user-question/vendor/ask/events.js +50 -0
  392. package/dist/humain/ask-user-question/vendor/ask/events.js.map +1 -0
  393. package/dist/humain/ask-user-question/vendor/ask/index.d.ts +5 -0
  394. package/dist/humain/ask-user-question/vendor/ask/index.d.ts.map +1 -0
  395. package/dist/humain/ask-user-question/vendor/ask/index.js +15 -0
  396. package/dist/humain/ask-user-question/vendor/ask/index.js.map +1 -0
  397. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts +81 -0
  398. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts.map +1 -0
  399. package/dist/humain/ask-user-question/vendor/ask/presentation.js +105 -0
  400. package/dist/humain/ask-user-question/vendor/ask/presentation.js.map +1 -0
  401. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts +28 -0
  402. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts.map +1 -0
  403. package/dist/humain/ask-user-question/vendor/ask/reconcile.js +45 -0
  404. package/dist/humain/ask-user-question/vendor/ask/reconcile.js.map +1 -0
  405. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts +41 -0
  406. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts.map +1 -0
  407. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js +166 -0
  408. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js.map +1 -0
  409. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts +46 -0
  410. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts.map +1 -0
  411. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js +247 -0
  412. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js.map +1 -0
  413. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts +11 -0
  414. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts.map +1 -0
  415. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js +56 -0
  416. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js.map +1 -0
  417. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts +6 -0
  418. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts.map +1 -0
  419. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js +10 -0
  420. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js.map +1 -0
  421. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts +57 -0
  422. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts.map +1 -0
  423. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js +357 -0
  424. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js.map +1 -0
  425. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts +112 -0
  426. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts.map +1 -0
  427. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js +240 -0
  428. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js.map +1 -0
  429. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts +87 -0
  430. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts.map +1 -0
  431. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js +79 -0
  432. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js.map +1 -0
  433. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts +22 -0
  434. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts.map +1 -0
  435. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js +2 -0
  436. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js.map +1 -0
  437. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts +27 -0
  438. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts.map +1 -0
  439. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js +48 -0
  440. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js.map +1 -0
  441. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts +13 -0
  442. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts.map +1 -0
  443. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js +15 -0
  444. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js.map +1 -0
  445. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts +14 -0
  446. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts.map +1 -0
  447. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js +96 -0
  448. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js.map +1 -0
  449. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts +58 -0
  450. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts.map +1 -0
  451. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js +310 -0
  452. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js.map +1 -0
  453. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts +68 -0
  454. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts.map +1 -0
  455. package/dist/humain/ask-user-question/vendor/ask/state/state.js +2 -0
  456. package/dist/humain/ask-user-question/vendor/ask/state/state.js.map +1 -0
  457. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts +24 -0
  458. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts.map +1 -0
  459. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js +114 -0
  460. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js.map +1 -0
  461. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts +18 -0
  462. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts.map +1 -0
  463. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js +29 -0
  464. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js.map +1 -0
  465. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts +41 -0
  466. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts.map +1 -0
  467. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js +99 -0
  468. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js.map +1 -0
  469. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts +37 -0
  470. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts.map +1 -0
  471. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js +70 -0
  472. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js.map +1 -0
  473. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts +129 -0
  474. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts.map +1 -0
  475. package/dist/humain/ask-user-question/vendor/ask/tool/types.js +76 -0
  476. package/dist/humain/ask-user-question/vendor/ask/tool/types.js.map +1 -0
  477. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts +21 -0
  478. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts.map +1 -0
  479. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js +49 -0
  480. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js.map +1 -0
  481. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts +23 -0
  482. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts.map +1 -0
  483. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js +16 -0
  484. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js.map +1 -0
  485. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts +21 -0
  486. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts.map +1 -0
  487. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js +49 -0
  488. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js.map +1 -0
  489. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts +43 -0
  490. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts.map +1 -0
  491. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js +130 -0
  492. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js.map +1 -0
  493. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts +45 -0
  494. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts.map +1 -0
  495. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js +39 -0
  496. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js.map +1 -0
  497. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts +36 -0
  498. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts.map +1 -0
  499. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js +72 -0
  500. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js.map +1 -0
  501. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts +61 -0
  502. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts.map +1 -0
  503. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js +108 -0
  504. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js.map +1 -0
  505. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts +39 -0
  506. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts.map +1 -0
  507. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js +76 -0
  508. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js.map +1 -0
  509. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts +123 -0
  510. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts.map +1 -0
  511. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js +180 -0
  512. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js.map +1 -0
  513. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts +108 -0
  514. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts.map +1 -0
  515. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js +235 -0
  516. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js.map +1 -0
  517. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts +37 -0
  518. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts.map +1 -0
  519. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js +47 -0
  520. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js.map +1 -0
  521. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts +31 -0
  522. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts.map +1 -0
  523. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js +35 -0
  524. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js.map +1 -0
  525. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts +124 -0
  526. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts.map +1 -0
  527. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js +205 -0
  528. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js.map +1 -0
  529. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts +83 -0
  530. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts.map +1 -0
  531. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js +186 -0
  532. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js.map +1 -0
  533. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts +47 -0
  534. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts.map +1 -0
  535. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js +48 -0
  536. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js.map +1 -0
  537. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts +58 -0
  538. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts.map +1 -0
  539. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js +84 -0
  540. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js.map +1 -0
  541. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts +20 -0
  542. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts.map +1 -0
  543. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js +55 -0
  544. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js.map +1 -0
  545. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts +23 -0
  546. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts.map +1 -0
  547. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js +2 -0
  548. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js.map +1 -0
  549. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts +15 -0
  550. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts.map +1 -0
  551. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js +2 -0
  552. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js.map +1 -0
  553. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts +98 -0
  554. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts.map +1 -0
  555. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js +248 -0
  556. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js.map +1 -0
  557. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts +23 -0
  558. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts.map +1 -0
  559. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js +131 -0
  560. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js.map +1 -0
  561. package/dist/humain/ask-user-question/vendor/config/config.d.ts +132 -0
  562. package/dist/humain/ask-user-question/vendor/config/config.d.ts.map +1 -0
  563. package/dist/humain/ask-user-question/vendor/config/config.js +286 -0
  564. package/dist/humain/ask-user-question/vendor/config/config.js.map +1 -0
  565. package/dist/humain/ask-user-question/vendor/config/index.d.ts +2 -0
  566. package/dist/humain/ask-user-question/vendor/config/index.d.ts.map +1 -0
  567. package/dist/humain/ask-user-question/vendor/config/index.js +2 -0
  568. package/dist/humain/ask-user-question/vendor/config/index.js.map +1 -0
  569. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts +64 -0
  570. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts.map +1 -0
  571. package/dist/humain/ask-user-question/vendor/i18n/i18n.js +185 -0
  572. package/dist/humain/ask-user-question/vendor/i18n/i18n.js.map +1 -0
  573. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts +44 -0
  574. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts.map +1 -0
  575. package/dist/humain/ask-user-question/vendor/i18n/loader.js +55 -0
  576. package/dist/humain/ask-user-question/vendor/i18n/loader.js.map +1 -0
  577. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +26 -16
  578. package/dist/humain/brand-logo.d.ts +2 -0
  579. package/dist/humain/brand-logo.d.ts.map +1 -1
  580. package/dist/humain/brand-logo.js +4 -0
  581. package/dist/humain/brand-logo.js.map +1 -1
  582. package/dist/humain/bundled-extension-names.d.ts +1 -0
  583. package/dist/humain/bundled-extension-names.d.ts.map +1 -1
  584. package/dist/humain/bundled-extension-names.js +1 -0
  585. package/dist/humain/bundled-extension-names.js.map +1 -1
  586. package/dist/humain/checklist/footer-progress.d.ts +7 -0
  587. package/dist/humain/checklist/footer-progress.d.ts.map +1 -0
  588. package/dist/humain/checklist/footer-progress.js +15 -0
  589. package/dist/humain/checklist/footer-progress.js.map +1 -0
  590. package/dist/humain/checklist/glyphs.d.ts +7 -0
  591. package/dist/humain/checklist/glyphs.d.ts.map +1 -0
  592. package/dist/humain/checklist/glyphs.js +8 -0
  593. package/dist/humain/checklist/glyphs.js.map +1 -0
  594. package/dist/humain/checklist/index.d.ts +6 -0
  595. package/dist/humain/checklist/index.d.ts.map +1 -0
  596. package/dist/humain/checklist/index.js +37 -0
  597. package/dist/humain/checklist/index.js.map +1 -0
  598. package/dist/humain/checklist/progress.d.ts +37 -0
  599. package/dist/humain/checklist/progress.d.ts.map +1 -0
  600. package/dist/humain/checklist/progress.js +234 -0
  601. package/dist/humain/checklist/progress.js.map +1 -0
  602. package/dist/humain/checklist/projector.d.ts +53 -0
  603. package/dist/humain/checklist/projector.d.ts.map +1 -0
  604. package/dist/humain/checklist/projector.js +198 -0
  605. package/dist/humain/checklist/projector.js.map +1 -0
  606. package/dist/humain/checklist/sidebar.d.ts +18 -0
  607. package/dist/humain/checklist/sidebar.d.ts.map +1 -0
  608. package/dist/humain/checklist/sidebar.js +38 -0
  609. package/dist/humain/checklist/sidebar.js.map +1 -0
  610. package/dist/humain/checklist/status-segment.d.ts +19 -0
  611. package/dist/humain/checklist/status-segment.d.ts.map +1 -0
  612. package/dist/humain/checklist/status-segment.js +59 -0
  613. package/dist/humain/checklist/status-segment.js.map +1 -0
  614. package/dist/humain/checklist/vendor/add-task-dialog.d.ts +54 -0
  615. package/dist/humain/checklist/vendor/add-task-dialog.d.ts.map +1 -0
  616. package/dist/humain/checklist/vendor/add-task-dialog.js +238 -0
  617. package/dist/humain/checklist/vendor/add-task-dialog.js.map +1 -0
  618. package/dist/humain/checklist/vendor/commands.d.ts +38 -0
  619. package/dist/humain/checklist/vendor/commands.d.ts.map +1 -0
  620. package/dist/humain/checklist/vendor/commands.js +193 -0
  621. package/dist/humain/checklist/vendor/commands.js.map +1 -0
  622. package/dist/humain/checklist/vendor/index.d.ts +3 -0
  623. package/dist/humain/checklist/vendor/index.d.ts.map +1 -0
  624. package/dist/humain/checklist/vendor/index.js +276 -0
  625. package/dist/humain/checklist/vendor/index.js.map +1 -0
  626. package/dist/humain/checklist/vendor/render.d.ts +97 -0
  627. package/dist/humain/checklist/vendor/render.d.ts.map +1 -0
  628. package/dist/humain/checklist/vendor/render.js +354 -0
  629. package/dist/humain/checklist/vendor/render.js.map +1 -0
  630. package/dist/humain/checklist/vendor/settings.d.ts +11 -0
  631. package/dist/humain/checklist/vendor/settings.d.ts.map +1 -0
  632. package/dist/humain/checklist/vendor/settings.js +8 -0
  633. package/dist/humain/checklist/vendor/settings.js.map +1 -0
  634. package/dist/humain/checklist/vendor/store.d.ts +120 -0
  635. package/dist/humain/checklist/vendor/store.d.ts.map +1 -0
  636. package/dist/humain/checklist/vendor/store.js +990 -0
  637. package/dist/humain/checklist/vendor/store.js.map +1 -0
  638. package/dist/humain/checklist/vendor/tools.d.ts +21 -0
  639. package/dist/humain/checklist/vendor/tools.d.ts.map +1 -0
  640. package/dist/humain/checklist/vendor/tools.js +162 -0
  641. package/dist/humain/checklist/vendor/tools.js.map +1 -0
  642. package/dist/humain/checklist/vendor/types.d.ts +188 -0
  643. package/dist/humain/checklist/vendor/types.d.ts.map +1 -0
  644. package/dist/humain/checklist/vendor/types.js +32 -0
  645. package/dist/humain/checklist/vendor/types.js.map +1 -0
  646. package/dist/humain/gateway/catalog.d.ts +1 -0
  647. package/dist/humain/gateway/catalog.d.ts.map +1 -1
  648. package/dist/humain/gateway/catalog.js +1 -0
  649. package/dist/humain/gateway/catalog.js.map +1 -1
  650. package/dist/humain/gateway/client.d.ts +1 -0
  651. package/dist/humain/gateway/client.d.ts.map +1 -1
  652. package/dist/humain/gateway/client.js +8 -1
  653. package/dist/humain/gateway/client.js.map +1 -1
  654. package/dist/humain/gateway/http.d.ts.map +1 -1
  655. package/dist/humain/gateway/http.js +11 -3
  656. package/dist/humain/gateway/http.js.map +1 -1
  657. package/dist/humain/gateway/images.d.ts +3 -0
  658. package/dist/humain/gateway/images.d.ts.map +1 -0
  659. package/dist/humain/gateway/images.js +73 -0
  660. package/dist/humain/gateway/images.js.map +1 -0
  661. package/dist/humain/gateway/provider.js +1 -1
  662. package/dist/humain/gateway/provider.js.map +1 -1
  663. package/dist/humain/hcode/account-store.d.ts.map +1 -1
  664. package/dist/humain/hcode/account-store.js +3 -1
  665. package/dist/humain/hcode/account-store.js.map +1 -1
  666. package/dist/humain/hcode/account.d.ts.map +1 -1
  667. package/dist/humain/hcode/account.js +23 -13
  668. package/dist/humain/hcode/account.js.map +1 -1
  669. package/dist/humain/hcode/images.d.ts.map +1 -1
  670. package/dist/humain/hcode/images.js +19 -13
  671. package/dist/humain/hcode/images.js.map +1 -1
  672. package/dist/humain/hcode/login-failure.d.ts +1 -0
  673. package/dist/humain/hcode/login-failure.d.ts.map +1 -1
  674. package/dist/humain/hcode/login-failure.js +1 -0
  675. package/dist/humain/hcode/login-failure.js.map +1 -1
  676. package/dist/humain/hcode/provider.d.ts.map +1 -1
  677. package/dist/humain/hcode/provider.js +2 -1
  678. package/dist/humain/hcode/provider.js.map +1 -1
  679. package/dist/humain/hcode/run-credential.d.ts +1 -0
  680. package/dist/humain/hcode/run-credential.d.ts.map +1 -1
  681. package/dist/humain/hcode/run-credential.js +12 -4
  682. package/dist/humain/hcode/run-credential.js.map +1 -1
  683. package/dist/humain/index.d.ts.map +1 -1
  684. package/dist/humain/index.js +4 -0
  685. package/dist/humain/index.js.map +1 -1
  686. package/dist/humain/node-provider.d.ts.map +1 -1
  687. package/dist/humain/node-provider.js +37 -8
  688. package/dist/humain/node-provider.js.map +1 -1
  689. package/dist/main.d.ts +1 -1
  690. package/dist/main.d.ts.map +1 -1
  691. package/dist/main.js +36 -26
  692. package/dist/main.js.map +1 -1
  693. package/dist/modes/interactive/chat-viewport.js +1 -1
  694. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  695. package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
  696. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  697. package/dist/modes/interactive/components/bash-execution.js +7 -4
  698. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  699. package/dist/modes/interactive/components/config-selector.js +1 -1
  700. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  701. package/dist/modes/interactive/components/custom-editor.d.ts +2 -0
  702. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  703. package/dist/modes/interactive/components/custom-editor.js +20 -1
  704. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  705. package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
  706. package/dist/modes/interactive/components/extension-editor.js +2 -2
  707. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  708. package/dist/modes/interactive/components/footer.d.ts +7 -0
  709. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  710. package/dist/modes/interactive/components/footer.js +74 -1
  711. package/dist/modes/interactive/components/footer.js.map +1 -1
  712. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  713. package/dist/modes/interactive/components/mermaid.js +11 -4
  714. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  715. package/dist/modes/interactive/components/model-selector.d.ts +2 -0
  716. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  717. package/dist/modes/interactive/components/model-selector.js +56 -8
  718. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  719. package/dist/modes/interactive/components/oauth-selector.d.ts +13 -1
  720. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  721. package/dist/modes/interactive/components/oauth-selector.js +10 -9
  722. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  723. package/dist/modes/interactive/components/session-selector.js +3 -3
  724. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  725. package/dist/modes/interactive/components/settings-selector.d.ts +4 -3
  726. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  727. package/dist/modes/interactive/components/settings-selector.js +83 -37
  728. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  729. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  730. package/dist/modes/interactive/components/settings-submenu.js +3 -3
  731. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  732. package/dist/modes/interactive/components/status-indicator.d.ts +18 -7
  733. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  734. package/dist/modes/interactive/components/status-indicator.js +70 -24
  735. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  736. package/dist/modes/interactive/components/status-line.d.ts +16 -0
  737. package/dist/modes/interactive/components/status-line.d.ts.map +1 -0
  738. package/dist/modes/interactive/components/status-line.js +51 -0
  739. package/dist/modes/interactive/components/status-line.js.map +1 -0
  740. package/dist/modes/interactive/components/tool-execution.d.ts +5 -0
  741. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  742. package/dist/modes/interactive/components/tool-execution.js +8 -1
  743. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  744. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  745. package/dist/modes/interactive/components/visual-truncate.js +11 -3
  746. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  747. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  748. package/dist/modes/interactive/external-editor.js +13 -3
  749. package/dist/modes/interactive/external-editor.js.map +1 -1
  750. package/dist/modes/interactive/interactive-mode.d.ts +17 -1
  751. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  752. package/dist/modes/interactive/interactive-mode.js +232 -108
  753. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  754. package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
  755. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
  756. package/dist/modes/interactive/program-status-reporter.js +4 -0
  757. package/dist/modes/interactive/program-status-reporter.js.map +1 -1
  758. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  759. package/dist/modes/interactive/session-share.js +9 -1
  760. package/dist/modes/interactive/session-share.js.map +1 -1
  761. package/dist/modes/print-mode.d.ts.map +1 -1
  762. package/dist/modes/print-mode.js +34 -7
  763. package/dist/modes/print-mode.js.map +1 -1
  764. package/dist/modes/rpc/jsonl.js +6 -5
  765. package/dist/modes/rpc/jsonl.js.map +1 -1
  766. package/dist/modes/rpc/rpc-client.d.ts +2 -0
  767. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  768. package/dist/modes/rpc/rpc-client.js +9 -2
  769. package/dist/modes/rpc/rpc-client.js.map +1 -1
  770. package/dist/modes/rpc/rpc-mode.d.ts +2 -1
  771. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  772. package/dist/modes/rpc/rpc-mode.js +113 -13
  773. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  774. package/dist/modes/rpc/rpc-types.d.ts +22 -1
  775. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  776. package/dist/modes/rpc/rpc-types.js.map +1 -1
  777. package/dist/modes/uncaught-errors.d.ts +20 -0
  778. package/dist/modes/uncaught-errors.d.ts.map +1 -0
  779. package/dist/modes/uncaught-errors.js +56 -0
  780. package/dist/modes/uncaught-errors.js.map +1 -0
  781. package/dist/package-manager-cli.d.ts.map +1 -1
  782. package/dist/package-manager-cli.js +10 -1
  783. package/dist/package-manager-cli.js.map +1 -1
  784. package/dist/utils/clipboard-image.js +1 -1
  785. package/dist/utils/clipboard-image.js.map +1 -1
  786. package/dist/utils/clipboard.js +2 -2
  787. package/dist/utils/clipboard.js.map +1 -1
  788. package/dist/utils/image-process.d.ts +5 -0
  789. package/dist/utils/image-process.d.ts.map +1 -1
  790. package/dist/utils/image-process.js +22 -4
  791. package/dist/utils/image-process.js.map +1 -1
  792. package/dist/utils/output-files.d.ts +44 -7
  793. package/dist/utils/output-files.d.ts.map +1 -1
  794. package/dist/utils/output-files.js +206 -12
  795. package/dist/utils/output-files.js.map +1 -1
  796. package/dist/utils/piped-stdin.d.ts +21 -0
  797. package/dist/utils/piped-stdin.d.ts.map +1 -0
  798. package/dist/utils/piped-stdin.js +60 -0
  799. package/dist/utils/piped-stdin.js.map +1 -0
  800. package/dist/utils/shell.d.ts +5 -2
  801. package/dist/utils/shell.d.ts.map +1 -1
  802. package/dist/utils/shell.js +77 -8
  803. package/dist/utils/shell.js.map +1 -1
  804. package/dist/utils/syntax-highlight.d.ts +33 -2
  805. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  806. package/dist/utils/syntax-highlight.js +77 -10
  807. package/dist/utils/syntax-highlight.js.map +1 -1
  808. package/dist/utils/tools-manager.d.ts +1 -0
  809. package/dist/utils/tools-manager.d.ts.map +1 -1
  810. package/dist/utils/tools-manager.js +9 -8
  811. package/dist/utils/tools-manager.js.map +1 -1
  812. package/dist/utils/wsl.d.ts +8 -2
  813. package/dist/utils/wsl.d.ts.map +1 -1
  814. package/dist/utils/wsl.js +12 -3
  815. package/dist/utils/wsl.js.map +1 -1
  816. package/docs/cli.md +39 -3
  817. package/docs/codemode.md +7 -3
  818. package/docs/compaction.md +1 -1
  819. package/docs/development.md +6 -0
  820. package/docs/environment-variables.md +3 -2
  821. package/docs/extensions.md +19 -5
  822. package/docs/keybindings.md +2 -0
  823. package/docs/llama-cpp.md +2 -2
  824. package/docs/message-types.md +1 -0
  825. package/docs/models-configuration.md +14 -3
  826. package/docs/models.md +29 -7
  827. package/docs/providers.md +20 -2
  828. package/docs/rpc-commands.md +25 -2
  829. package/docs/rpc.md +20 -0
  830. package/docs/run-preflight.md +2 -2
  831. package/docs/session-format.md +9 -0
  832. package/docs/settings.md +35 -5
  833. package/docs/shell-aliases.md +1 -1
  834. package/docs/slash-commands.md +3 -1
  835. package/docs/terminal-setup.md +25 -0
  836. package/docs/windows.md +2 -1
  837. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  838. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  839. package/examples/rpc-extension-ui.ts +8 -7
  840. package/npm-shrinkwrap.json +209 -180
  841. package/package.json +26 -20
  842. package/schemas/keybindings.schema.json +12 -0
  843. package/schemas/models.schema.json +20 -7
  844. package/schemas/settings.schema.json +43 -5
  845. package/src/coordination/UPSTREAM.md +27 -1
  846. package/src/coordination/upstream.json +3 -3
  847. package/src/humain/ask-user-question/UPSTREAM.md +31 -0
  848. package/src/humain/ask-user-question/upstream.json +258 -0
  849. package/src/humain/ask-user-question/vendor/ask/LICENSE +21 -0
  850. package/src/humain/ask-user-question/vendor/ask/locales/de.json +38 -0
  851. package/src/humain/ask-user-question/vendor/ask/locales/en.json +41 -0
  852. package/src/humain/ask-user-question/vendor/ask/locales/es.json +38 -0
  853. package/src/humain/ask-user-question/vendor/ask/locales/fr.json +38 -0
  854. package/src/humain/ask-user-question/vendor/ask/locales/pt-BR.json +38 -0
  855. package/src/humain/ask-user-question/vendor/ask/locales/pt.json +38 -0
  856. package/src/humain/ask-user-question/vendor/ask/locales/ru.json +38 -0
  857. package/src/humain/ask-user-question/vendor/ask/locales/uk.json +38 -0
  858. package/src/humain/ask-user-question/vendor/ask/locales/zh.json +40 -0
  859. package/src/humain/ask-user-question/vendor/config/LICENSE +21 -0
  860. package/src/humain/ask-user-question/vendor/i18n/LICENSE +21 -0
  861. package/src/humain/caveman/UPSTREAM.md +44 -11
  862. package/src/humain/caveman/upstream.json +3 -3
  863. package/src/humain/caveman/vendor/NOTICE +4 -0
  864. package/dist/bundle/chunks/anthropic-messages-XFCDMGD6.js +0 -77
  865. package/dist/bundle/chunks/azure-openai-responses-F4KQM3NK.js +0 -15
  866. package/dist/bundle/chunks/bowser-DXKSTXFQ.js +0 -89
  867. package/dist/bundle/chunks/chunk-3E37CJCE.js +0 -34
  868. package/dist/bundle/chunks/chunk-3HVHETMU.js +0 -18
  869. package/dist/bundle/chunks/chunk-6JTCRCNF.js +0 -74
  870. package/dist/bundle/chunks/chunk-B3ZLWVDA.js +0 -80
  871. package/dist/bundle/chunks/chunk-F77J5EQZ.js +0 -3
  872. package/dist/bundle/chunks/chunk-GPLWWO5Q.js +0 -121
  873. package/dist/bundle/chunks/chunk-GV5OVRKK.js +0 -4
  874. package/dist/bundle/chunks/chunk-JBSWWCT5.js +0 -12
  875. package/dist/bundle/chunks/chunk-JWOPWHVH.js +0 -51
  876. package/dist/bundle/chunks/chunk-KRBELWQH.js +0 -7
  877. package/dist/bundle/chunks/chunk-PFBAIRCY.js +0 -56
  878. package/dist/bundle/chunks/chunk-Q5RKNQ2T.js +0 -73
  879. package/dist/bundle/chunks/chunk-QFDZEUFU.js +0 -12
  880. package/dist/bundle/chunks/chunk-SKCJ25SX.js +0 -24
  881. package/dist/bundle/chunks/chunk-UZOIHLNU.js +0 -23
  882. package/dist/bundle/chunks/chunk-YSWDFV2L.js +0 -11
  883. package/dist/bundle/chunks/chunk-YZMQXAJM.js +0 -8
  884. package/dist/bundle/chunks/chunk-ZAHVC5V2.js +0 -3591
  885. package/dist/bundle/chunks/entry-2GZ3PTWQ.js +0 -2
  886. package/dist/bundle/chunks/google-generative-ai-WIASMWS3.js +0 -22
  887. package/dist/bundle/chunks/google-vertex-WSPHRZIZ.js +0 -25
  888. package/dist/bundle/chunks/interactive-mode-3322RQEH.js +0 -5
  889. package/dist/bundle/chunks/mistral-conversations-7JYDDRUT.js +0 -43
  890. package/dist/bundle/chunks/openai-codex-responses-7PAML4NF.js +0 -102
  891. package/dist/bundle/chunks/openai-completions-UJDAIGTK.js +0 -87
  892. package/dist/bundle/chunks/openai-responses-2WNCE6AY.js +0 -26
  893. package/dist/bundle/chunks/openrouter-images-V3UCCO6X.js +0 -8
  894. package/dist/bundle/chunks/pi-messages-TQ7LJUNQ.js +0 -28
  895. package/dist/bundle/chunks/runtime-H7LYNKCZ.js +0 -2
  896. package/dist/bundle/chunks/session-picker-EYKCMFQR.js +0 -4
  897. package/dist/bundle/chunks/startup-ui-7ODOR34R.js +0 -3
  898. package/dist/bundle/chunks/typesafe-system-one-YP7GGN4C.js +0 -3
  899. package/dist/bundle/chunks/virtual-modules-47MGUPYN.js +0 -28
@@ -1 +1 @@
1
- {"version":3,"file":"custom-editor.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/custom-editor.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,OAAO,EAAE,MAAM,EAAkD,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE9G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQnD;;GAEG;AACH,MAAM,OAAO,YAAa,S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8BAA8B;QAC9B,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACrD,IAAI,MAAM,KAAK,+BAA+B,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;gBAC7G,SAAS;YACV,CAAC;YACD,IAAI,MAAM,KAAK,eAAe,IAAI,MAAM,KAAK,UAAU,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC;gBACnG,OAAO,EAAE,CAAC;gBACV,OAAO;YACR,CAAC;QACF,CAAC;QAED,qCAAqC;QACrC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACD","sourcesContent":["// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commit a6df6a2c; modified for HUMAIN Code CLI.\nimport { Editor, type EditorOptions, type EditorTheme, type TUI, visibleWidth } from \"@earendil-works/pi-tui\";\nimport type { AppKeybinding, KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport type { StatusIndicator } from \"./status-indicator.ts\";\n\nexport type CustomEditorOptions = EditorOptions & {\n\t/** Render working, compaction, summarization, and retry status in the editor's top border. */\n\tembedWorkingStatus?: boolean;\n};\n\n/**\n * Custom editor that handles app-level keybindings for coding-agent.\n */\nexport class CustomEditor extends Editor {\n\tprivate keybindings: KeybindingsManager;\n\tprivate workingStatusIndicator: StatusIndicator | undefined;\n\tprivate accentLabel: string | undefined;\n\t/** The status last drawn in the border and its width: the same text on every frame between spinner ticks. */\n\tprivate borderStatus = { text: \"\", width: 0 };\n\tpublic readonly embedWorkingStatus: boolean;\n\tpublic actionHandlers: Map<AppKeybinding, () => void> = new Map();\n\n\t// Special handlers that can be dynamically replaced\n\tpublic onEscape?: () => void;\n\tpublic onCtrlD?: () => void;\n\tpublic onPasteImage?: () => void;\n\t/** Live session state for the busy-only follow-up action. Unset means idle. */\n\tpublic isAgentBusy?: () => boolean;\n\t/** Handler for extension-registered shortcuts. Returns true if handled. */\n\tpublic onExtensionShortcut?: (data: string) => boolean;\n\n\tconstructor(tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager, options?: CustomEditorOptions) {\n\t\tsuper(tui, theme, options);\n\t\tthis.keybindings = keybindings;\n\t\tthis.embedWorkingStatus = options?.embedWorkingStatus ?? false;\n\t}\n\n\tsetWorkingStatusIndicator(indicator: StatusIndicator | undefined): void {\n\t\tthis.workingStatusIndicator = indicator;\n\t}\n\n\tsetAccentLabel(label: string | undefined): void {\n\t\tthis.accentLabel =\n\t\t\tlabel === undefined\n\t\t\t\t? undefined\n\t\t\t\t: stripAnsi(label)\n\t\t\t\t\t\t.replace(/\\s/g, \" \")\n\t\t\t\t\t\t.replace(/\\p{Cc}/gu, \"\")\n\t\t\t\t\t\t.replace(/ +/g, \" \")\n\t\t\t\t\t\t.trim() || undefined;\n\t}\n\n\tprotected override renderTopBorder(width: number, hiddenLineCount: number): string {\n\t\tif (this.accentLabel) {\n\t\t\tconst labelBlock = ` ${this.accentLabel} ─`;\n\t\t\tconst labelBlockWidth = visibleWidth(labelBlock);\n\t\t\tif (width - labelBlockWidth >= 10) {\n\t\t\t\treturn this.renderTopBorderContent(width - labelBlockWidth, hiddenLineCount) + this.borderColor(labelBlock);\n\t\t\t}\n\t\t}\n\t\treturn this.renderTopBorderContent(width, hiddenLineCount);\n\t}\n\n\tprivate renderTopBorderContent(width: number, hiddenLineCount: number): string {\n\t\tif (!this.embedWorkingStatus || !this.workingStatusIndicator || width <= 0) {\n\t\t\treturn super.renderTopBorder(width, hiddenLineCount);\n\t\t}\n\n\t\tlet status = this.workingStatusIndicator.renderInBorder(Math.max(1, width - 5));\n\t\tif (status !== this.borderStatus.text) this.borderStatus = { text: status, width: visibleWidth(status) };\n\t\tlet statusWidth = this.borderStatus.width;\n\t\tif (statusWidth === 0) return super.renderTopBorder(width, hiddenLineCount);\n\n\t\tconst overflowLabel = hiddenLineCount > 0 ? ` ↑ ${hiddenLineCount} more ` : undefined;\n\t\tconst overflowLabelWidth = overflowLabel ? visibleWidth(overflowLabel) : 0;\n\t\tconst overflowStart = Math.floor((width - overflowLabelWidth) / 2);\n\t\tconst canFitOverflow = () =>\n\t\t\toverflowLabel !== undefined && overflowLabelWidth + 2 <= width && overflowStart - (3 + statusWidth + 1) >= 1;\n\n\t\tif (overflowLabel && !canFitOverflow()) {\n\t\t\tstatus = this.workingStatusIndicator.renderSpinnerInBorder(width);\n\t\t\tstatusWidth = visibleWidth(status);\n\t\t}\n\n\t\tif (canFitOverflow()) {\n\t\t\tconst leftBlockWidth = 3 + statusWidth + 1;\n\t\t\treturn (\n\t\t\t\tthis.borderColor(\"── \") +\n\t\t\t\tstatus +\n\t\t\t\tthis.borderColor(\n\t\t\t\t\t` ${\"─\".repeat(overflowStart - leftBlockWidth)}${overflowLabel}${\"─\".repeat(width - overflowStart - overflowLabelWidth)}`,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif (width >= statusWidth + 5) {\n\t\t\treturn this.borderColor(\"── \") + status + this.borderColor(` ${\"─\".repeat(width - statusWidth - 4)}`);\n\t\t}\n\n\t\tstatus = this.workingStatusIndicator.renderSpinnerInBorder(width);\n\t\tstatusWidth = visibleWidth(status);\n\t\tconst prefixWidth = Math.min(3, Math.max(0, width - statusWidth));\n\t\treturn (\n\t\t\tthis.borderColor(\"─\".repeat(prefixWidth)) +\n\t\t\tstatus +\n\t\t\tthis.borderColor(\"─\".repeat(Math.max(0, width - prefixWidth - statusWidth)))\n\t\t);\n\t}\n\n\t/**\n\t * Register a handler for an app action.\n\t */\n\tonAction(action: AppKeybinding, handler: () => void): void {\n\t\tthis.actionHandlers.set(action, handler);\n\t}\n\n\thandleInput(data: string): void {\n\t\t// Check extension-registered shortcuts first\n\t\tif (this.onExtensionShortcut?.(data)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Selection page keys move an open autocomplete menu before app actions run.\n\t\t// This lets users bind Ctrl+V even though it pastes images by default.\n\t\tif (\n\t\t\tthis.isShowingAutocomplete() &&\n\t\t\t(this.keybindings.matches(data, \"tui.select.pageUp\") || this.keybindings.matches(data, \"tui.select.pageDown\"))\n\t\t) {\n\t\t\tsuper.handleInput(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Check for clipboard paste keybinding\n\t\tif (this.keybindings.matches(data, \"app.clipboard.pasteImage\")) {\n\t\t\tthis.onPasteImage?.();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check app keybindings first\n\n\t\t// Escape/interrupt - only if autocomplete is NOT active\n\t\tif (this.keybindings.matches(data, \"app.interrupt\")) {\n\t\t\tif (!this.isShowingAutocomplete()) {\n\t\t\t\t// Use dynamic onEscape if set, otherwise registered handler\n\t\t\t\tconst handler = this.onEscape ?? this.actionHandlers.get(\"app.interrupt\");\n\t\t\t\tif (handler) {\n\t\t\t\t\thandler();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Let parent handle escape for autocomplete cancellation\n\t\t\tsuper.handleInput(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Exit (Ctrl+D) - only when editor is empty\n\t\tif (this.keybindings.matches(data, \"app.exit\")) {\n\t\t\tif (this.getText().length === 0) {\n\t\t\t\tconst handler = this.onCtrlD ?? this.actionHandlers.get(\"app.exit\");\n\t\t\t\tif (handler) handler();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Fall through to editor handling for delete-char-forward when not empty\n\t\t}\n\n\t\t// Explicit history bindings take precedence over app actions while the editor is focused.\n\t\t// This lets users bind Ctrl+P even though it cycles models by default.\n\t\tif (\n\t\t\tthis.keybindings.matches(data, \"tui.editor.historyPrevious\") ||\n\t\t\tthis.keybindings.matches(data, \"tui.editor.historyNext\")\n\t\t) {\n\t\t\tsuper.handleInput(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Completion wins over the busy-only queue shortcut when both use the same key.\n\t\tif (\n\t\t\tthis.isShowingAutocomplete() &&\n\t\t\t(this.keybindings.matches(data, \"tui.input.tab\") || this.keybindings.matches(data, \"tui.select.confirm\")) &&\n\t\t\tthis.keybindings.matches(data, \"app.message.followUpWhileBusy\")\n\t\t) {\n\t\t\tsuper.handleInput(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Check all other app actions\n\t\tfor (const [action, handler] of this.actionHandlers) {\n\t\t\tif (action === \"app.message.followUpWhileBusy\" && (!this.isAgentBusy?.() || !this.getExpandedText().trim())) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (action !== \"app.interrupt\" && action !== \"app.exit\" && this.keybindings.matches(data, action)) {\n\t\t\t\thandler();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Pass to parent for editor handling\n\t\tsuper.handleInput(data);\n\t}\n}\n"]}
1
+ {"version":3,"file":"custom-editor.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/custom-editor.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,OAAO,EAAE,MAAM,EAAkD,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE9G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQnD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IAC/B,WAAW,CAAqB;IAChC,sBAAsB,CAA8B;IACpD,WAAW,CAAqB;IACxC,8EAA8E;IACvE,kBAAkB,CAA6B;IACtD,6GAA6G;IACrG,YAAY,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC9B,kBAAkB,CAAU;IACrC,cAAc,GAAmC,IAAI,GAAG,EAAE,CAAC;IAElE,oDAAoD;IAC7C,QAAQ,CAAc;IACtB,OAAO,CAAc;IACrB,YAAY,CAAc;IACjC,+EAA+E;IACxE,WAAW,CAAiB;IACnC,2E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EAAE,oBAAoB,CAAC,CAAC;YACzG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,+BAA+B,CAAC,EAC9D,CAAC;YACF,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO;QACR,CAAC;QAED,iGAAiG;QACjG,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACxE,IAAI,eAAe,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,sBAAsB,CAAC,EAAE,CAAC;YAC/E,IAAI,IAAI,CAAC,mBAAmB,EAAE,KAAK,SAAS,EAAE,CAAC;gBAC9C,OAAO;YACR,CAAC;YACD,eAAe,EAAE,CAAC;YAClB,OAAO;QACR,CAAC;QAED,8BAA8B;QAC9B,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACrD,IAAI,MAAM,KAAK,+BAA+B,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;gBAC7G,SAAS;YACV,CAAC;YACD,IACC,MAAM,KAAK,eAAe;gBAC1B,MAAM,KAAK,UAAU;gBACrB,MAAM,KAAK,sBAAsB;gBACjC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,EACrC,CAAC;gBACF,OAAO,EAAE,CAAC;gBACV,OAAO;YACR,CAAC;QACF,CAAC;QAED,qCAAqC;QACrC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACD","sourcesContent":["// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commit a6df6a2c; modified for HUMAIN Code CLI.\nimport { Editor, type EditorOptions, type EditorTheme, type TUI, visibleWidth } from \"@earendil-works/pi-tui\";\nimport type { AppKeybinding, KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport type { StatusIndicator } from \"./status-indicator.ts\";\n\nexport type CustomEditorOptions = EditorOptions & {\n\t/** Render working, compaction, summarization, and retry status in the editor's top border. */\n\tembedWorkingStatus?: boolean;\n};\n\n/**\n * Custom editor that handles app-level keybindings for coding-agent.\n */\nexport class CustomEditor extends Editor {\n\tprivate keybindings: KeybindingsManager;\n\tprivate workingStatusIndicator: StatusIndicator | undefined;\n\tprivate accentLabel: string | undefined;\n\t/** Optional complete session status, rendered inside the input top border. */\n\tpublic renderStatusBorder?: (width: number) => string;\n\t/** The status last drawn in the border and its width: the same text on every frame between spinner ticks. */\n\tprivate borderStatus = { text: \"\", width: 0 };\n\tpublic readonly embedWorkingStatus: boolean;\n\tpublic actionHandlers: Map<AppKeybinding, () => void> = new Map();\n\n\t// Special handlers that can be dynamically replaced\n\tpublic onEscape?: () => void;\n\tpublic onCtrlD?: () => void;\n\tpublic onPasteImage?: () => void;\n\t/** Live session state for the busy-only follow-up action. Unset means idle. */\n\tpublic isAgentBusy?: () => boolean;\n\t/** Handler for extension-registered shortcuts. Returns true if handled. */\n\tpublic onExtensionShortcut?: (data: string) => boolean;\n\n\tconstructor(tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager, options?: CustomEditorOptions) {\n\t\tsuper(tui, theme, options);\n\t\tthis.keybindings = keybindings;\n\t\tthis.embedWorkingStatus = options?.embedWorkingStatus ?? false;\n\t}\n\n\tsetWorkingStatusIndicator(indicator: StatusIndicator | undefined): void {\n\t\tthis.workingStatusIndicator = indicator;\n\t}\n\n\tsetAccentLabel(label: string | undefined): void {\n\t\tthis.accentLabel =\n\t\t\tlabel === undefined\n\t\t\t\t? undefined\n\t\t\t\t: stripAnsi(label)\n\t\t\t\t\t\t.replace(/\\s/g, \" \")\n\t\t\t\t\t\t.replace(/\\p{Cc}/gu, \"\")\n\t\t\t\t\t\t.replace(/ +/g, \" \")\n\t\t\t\t\t\t.trim() || undefined;\n\t}\n\n\tprotected override renderTopBorder(width: number, hiddenLineCount: number): string {\n\t\tif (this.accentLabel) {\n\t\t\tconst labelBlock = ` ${this.accentLabel} ─`;\n\t\t\tconst labelBlockWidth = visibleWidth(labelBlock);\n\t\t\tif (width - labelBlockWidth >= 10) {\n\t\t\t\treturn this.renderTopBorderContent(width - labelBlockWidth, hiddenLineCount) + this.borderColor(labelBlock);\n\t\t\t}\n\t\t}\n\t\treturn this.renderTopBorderContent(width, hiddenLineCount);\n\t}\n\n\tprivate renderTopBorderContent(width: number, hiddenLineCount: number): string {\n\t\tif (this.renderStatusBorder && width > 4) {\n\t\t\tconst overflow = hiddenLineCount > 0 ? `↑ ${hiddenLineCount} more ` : \"\";\n\t\t\tconst prefix = visibleWidth(overflow) + 5 < width ? `── ${overflow}` : \"── \";\n\t\t\treturn (\n\t\t\t\tthis.borderColor(prefix) + this.renderStatusBorder(width - visibleWidth(prefix) - 1) + this.borderColor(\"─\")\n\t\t\t);\n\t\t}\n\t\tif (!this.embedWorkingStatus || !this.workingStatusIndicator || width <= 0) {\n\t\t\treturn super.renderTopBorder(width, hiddenLineCount);\n\t\t}\n\n\t\tlet status = this.workingStatusIndicator.renderInBorder(Math.max(1, width - 5));\n\t\tif (status !== this.borderStatus.text) this.borderStatus = { text: status, width: visibleWidth(status) };\n\t\tlet statusWidth = this.borderStatus.width;\n\t\tif (statusWidth === 0) return super.renderTopBorder(width, hiddenLineCount);\n\n\t\tconst overflowLabel = hiddenLineCount > 0 ? ` ↑ ${hiddenLineCount} more ` : undefined;\n\t\tconst overflowLabelWidth = overflowLabel ? visibleWidth(overflowLabel) : 0;\n\t\tconst overflowStart = Math.floor((width - overflowLabelWidth) / 2);\n\t\tconst canFitOverflow = () =>\n\t\t\toverflowLabel !== undefined && overflowLabelWidth + 2 <= width && overflowStart - (3 + statusWidth + 1) >= 1;\n\n\t\tif (overflowLabel && !canFitOverflow()) {\n\t\t\tstatus = this.workingStatusIndicator.renderSpinnerInBorder(width);\n\t\t\tstatusWidth = visibleWidth(status);\n\t\t}\n\n\t\tif (canFitOverflow()) {\n\t\t\tconst leftBlockWidth = 3 + statusWidth + 1;\n\t\t\treturn (\n\t\t\t\tthis.borderColor(\"── \") +\n\t\t\t\tstatus +\n\t\t\t\tthis.borderColor(\n\t\t\t\t\t` ${\"─\".repeat(overflowStart - leftBlockWidth)}${overflowLabel}${\"─\".repeat(width - overflowStart - overflowLabelWidth)}`,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif (width >= statusWidth + 5) {\n\t\t\treturn this.borderColor(\"── \") + status + this.borderColor(` ${\"─\".repeat(width - statusWidth - 4)}`);\n\t\t}\n\n\t\tstatus = this.workingStatusIndicator.renderSpinnerInBorder(width);\n\t\tstatusWidth = visibleWidth(status);\n\t\tconst prefixWidth = Math.min(3, Math.max(0, width - statusWidth));\n\t\treturn (\n\t\t\tthis.borderColor(\"─\".repeat(prefixWidth)) +\n\t\t\tstatus +\n\t\t\tthis.borderColor(\"─\".repeat(Math.max(0, width - prefixWidth - statusWidth)))\n\t\t);\n\t}\n\n\t/**\n\t * Register a handler for an app action.\n\t */\n\tonAction(action: AppKeybinding, handler: () => void): void {\n\t\tthis.actionHandlers.set(action, handler);\n\t}\n\n\thandleInput(data: string): void {\n\t\t// Check extension-registered shortcuts first\n\t\tif (this.onExtensionShortcut?.(data)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Selection page keys move an open autocomplete menu before app actions run.\n\t\t// This lets users bind Ctrl+V even though it pastes images by default.\n\t\tif (\n\t\t\tthis.isShowingAutocomplete() &&\n\t\t\t(this.keybindings.matches(data, \"tui.select.pageUp\") || this.keybindings.matches(data, \"tui.select.pageDown\"))\n\t\t) {\n\t\t\tsuper.handleInput(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Check for clipboard paste keybinding\n\t\tif (this.keybindings.matches(data, \"app.clipboard.pasteImage\")) {\n\t\t\tthis.onPasteImage?.();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check app keybindings first\n\n\t\t// Escape/interrupt - only if autocomplete is NOT active\n\t\tif (this.keybindings.matches(data, \"app.interrupt\")) {\n\t\t\tif (!this.isShowingAutocomplete()) {\n\t\t\t\t// Use dynamic onEscape if set, otherwise registered handler\n\t\t\t\tconst handler = this.onEscape ?? this.actionHandlers.get(\"app.interrupt\");\n\t\t\t\tif (handler) {\n\t\t\t\t\thandler();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Let parent handle escape for autocomplete cancellation\n\t\t\tsuper.handleInput(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Exit (Ctrl+D) - only when editor is empty\n\t\tif (this.keybindings.matches(data, \"app.exit\")) {\n\t\t\tif (this.getText().length === 0) {\n\t\t\t\tconst handler = this.onCtrlD ?? this.actionHandlers.get(\"app.exit\");\n\t\t\t\tif (handler) handler();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Fall through to editor handling for delete-char-forward when not empty\n\t\t}\n\n\t\t// Explicit history bindings take precedence over app actions while the editor is focused.\n\t\t// This lets users bind Ctrl+P even though it cycles models by default.\n\t\tif (\n\t\t\tthis.keybindings.matches(data, \"tui.editor.historyPrevious\") ||\n\t\t\tthis.keybindings.matches(data, \"tui.editor.historyNext\")\n\t\t) {\n\t\t\tsuper.handleInput(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Completion wins over the busy-only queue shortcut when both use the same key.\n\t\tif (\n\t\t\tthis.isShowingAutocomplete() &&\n\t\t\t(this.keybindings.matches(data, \"tui.input.tab\") || this.keybindings.matches(data, \"tui.select.confirm\")) &&\n\t\t\tthis.keybindings.matches(data, \"app.message.followUpWhileBusy\")\n\t\t) {\n\t\t\tsuper.handleInput(data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Follow-up submit (Alt+Enter) - apply the selected autocomplete suggestion just like Enter does\n\t\tconst followUpHandler = this.actionHandlers.get(\"app.message.followUp\");\n\t\tif (followUpHandler && this.keybindings.matches(data, \"app.message.followUp\")) {\n\t\t\tif (this.confirmAutocomplete() === \"applied\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfollowUpHandler();\n\t\t\treturn;\n\t\t}\n\n\t\t// Check all other app actions\n\t\tfor (const [action, handler] of this.actionHandlers) {\n\t\t\tif (action === \"app.message.followUpWhileBusy\" && (!this.isAgentBusy?.() || !this.getExpandedText().trim())) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (\n\t\t\t\taction !== \"app.interrupt\" &&\n\t\t\t\taction !== \"app.exit\" &&\n\t\t\t\taction !== \"app.message.followUp\" &&\n\t\t\t\tthis.keybindings.matches(data, action)\n\t\t\t) {\n\t\t\t\thandler();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Pass to parent for editor handling\n\t\tsuper.handleInput(data);\n\t}\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Multi-line editor component for extensions.
3
- * Supports Ctrl+G for external editor.
3
+ * Supports the app.editor.external keybinding for an external editor.
4
4
  */
5
5
  import { Container, type EditorOptions, type Focusable, type TUI } from "@earendil-works/pi-tui";
6
6
  import type { KeybindingsManager } from "../../../core/keybindings.ts";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Multi-line editor component for extensions.
3
- * Supports Ctrl+G for external editor.
3
+ * Supports the app.editor.external keybinding for an external editor.
4
4
  */
5
5
  import { Container, Editor, getKeybindings, Spacer, Text, } from "@earendil-works/pi-tui";
6
6
  import { editInExternalEditor } from "../external-editor.js";
@@ -59,7 +59,7 @@ export class ExtensionEditorComponent extends Container {
59
59
  this.addChild(this.externalEditorStatus);
60
60
  this.addChild(new Spacer(1));
61
61
  // Add hint
62
- const hint = keyHint("tui.select.confirm", "submit") +
62
+ const hint = keyHint("tui.input.submit", "submit") +
63
63
  " " +
64
64
  keyHint("tui.input.newLine", "newline") +
65
65
  " " +
@@ -1 +1 @@
1
- {"version":3,"file":"extension-editor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K,CAAC,wBAAwB;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC;gBACzC,OAAO,EAAE,IAAI,CAAC,qBAAqB;gBACnC,OAAO;aACP,CAAC,CAAC;YACH,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACzG,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBAClC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACrC,CAAC;QACF,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;CACD","sourcesContent":["/**\n * Multi-line editor component for extensions.\n * Supports Ctrl+G for external editor.\n */\n\nimport {\n\tContainer,\n\tEditor,\n\ttype EditorOptions,\n\ttype Focusable,\n\tgetKeybindings,\n\tSpacer,\n\tText,\n\ttype TUI,\n} from \"@earendil-works/pi-tui\";\nimport type { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport { editInExternalEditor } from \"../external-editor.ts\";\nimport { getEditorTheme, theme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyHint } from \"./keybinding-hints.ts\";\n\nexport interface ExtensionEditorOptions extends EditorOptions {\n\tdescription?: string;\n}\n\nexport class ExtensionEditorComponent extends Container implements Focusable {\n\tprivate editor: Editor;\n\tprivate onSubmitCallback: (value: string) => void;\n\tprivate onCancelCallback: () => void;\n\tprivate tui: TUI;\n\tprivate keybindings: KeybindingsManager;\n\tprivate externalEditorCommand: string;\n\t/** Shows external editor failures; renders nothing while empty. */\n\tprivate externalEditorStatus = new Text(\"\", 1, 0);\n\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.editor.focused = value;\n\t}\n\n\tconstructor(\n\t\ttui: TUI,\n\t\tkeybindings: KeybindingsManager,\n\t\ttitle: string,\n\t\tprefill: string | undefined,\n\t\tonSubmit: (value: string) => void,\n\t\tonCancel: () => void,\n\t\toptions?: ExtensionEditorOptions,\n\t\texternalEditorCommand?: string,\n\t) {\n\t\tsuper();\n\n\t\tthis.tui = tui;\n\t\tthis.keybindings = keybindings;\n\t\tthis.externalEditorCommand =\n\t\t\texternalEditorCommand ||\n\t\t\tprocess.env.VISUAL ||\n\t\t\tprocess.env.EDITOR ||\n\t\t\t(process.platform === \"win32\" ? \"notepad\" : \"nano\");\n\t\tthis.onSubmitCallback = onSubmit;\n\t\tthis.onCancelCallback = onCancel;\n\t\tconst { description, ...editorOptions } = options ?? {};\n\n\t\t// Add top border\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add title and optional description\n\t\tthis.addChild(new Text(theme.fg(\"accent\", title), 1, 0));\n\t\tif (description) {\n\t\t\tthis.addChild(new Spacer(1));\n\t\t\tthis.addChild(new Text(theme.fg(\"text\", description), 1, 0));\n\t\t}\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Create editor\n\t\tthis.editor = new Editor(tui, getEditorTheme(), editorOptions);\n\t\tif (prefill) {\n\t\t\tthis.editor.setText(prefill);\n\t\t}\n\t\t// Wire up Enter to submit (Shift+Enter for newlines, like the main editor)\n\t\tthis.editor.onSubmit = (text: string) => {\n\t\t\tthis.onSubmitCallback(text);\n\t\t};\n\t\tthis.addChild(this.editor);\n\t\tthis.addChild(this.externalEditorStatus);\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add hint\n\t\tconst hint =\n\t\t\tkeyHint(\"tui.select.confirm\", \"submit\") +\n\t\t\t\" \" +\n\t\t\tkeyHint(\"tui.input.newLine\", \"newline\") +\n\t\t\t\" \" +\n\t\t\tkeyHint(\"tui.select.cancel\", \"cancel\") +\n\t\t\t` ${keyHint(\"app.editor.external\", \"external editor\")}`;\n\t\tthis.addChild(new Text(hint, 1, 0));\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add bottom border\n\t\tthis.addChild(new DynamicBorder());\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getKeybindings();\n\t\t// Escape or Ctrl+C to cancel\n\t\tif (kb.matches(keyData, \"tui.select.cancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t\treturn;\n\t\t}\n\n\t\t// External editor (app keybinding)\n\t\tif (this.keybindings.matches(keyData, \"app.editor.external\")) {\n\t\t\tvoid this.handleOpenExternalEditor();\n\t\t\treturn;\n\t\t}\n\n\t\t// Forward to editor\n\t\tthis.editor.handleInput(keyData);\n\t}\n\n\tprivate async handleOpenExternalEditor(): Promise<void> {\n\t\tconst content = this.editor.getText();\n\t\tthis.tui.stop();\n\t\ttry {\n\t\t\tconst result = await editInExternalEditor({\n\t\t\t\tcommand: this.externalEditorCommand,\n\t\t\t\tcontent,\n\t\t\t});\n\t\t\tthis.externalEditorStatus.setText(result.status === \"failed\" ? theme.fg(\"warning\", result.message) : \"\");\n\t\t\tif (result.status === \"complete\") {\n\t\t\t\tthis.editor.setText(result.content);\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.tui.start();\n\t\t\tthis.tui.requestRender(true);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"extension-editor.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/extension-editor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,SAAS,EACT,MAAM,EAGN,cAAc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AE,CAAC;QAChB,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC;gBACzC,OAAO,EAAE,IAAI,CAAC,qBAAqB;gBACnC,OAAO;aACP,CAAC,CAAC;YACH,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACzG,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBAClC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACrC,CAAC;QACF,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;YACjB,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;CACD","sourcesContent":["/**\n * Multi-line editor component for extensions.\n * Supports the app.editor.external keybinding for an external editor.\n */\n\nimport {\n\tContainer,\n\tEditor,\n\ttype EditorOptions,\n\ttype Focusable,\n\tgetKeybindings,\n\tSpacer,\n\tText,\n\ttype TUI,\n} from \"@earendil-works/pi-tui\";\nimport type { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport { editInExternalEditor } from \"../external-editor.ts\";\nimport { getEditorTheme, theme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyHint } from \"./keybinding-hints.ts\";\n\nexport interface ExtensionEditorOptions extends EditorOptions {\n\tdescription?: string;\n}\n\nexport class ExtensionEditorComponent extends Container implements Focusable {\n\tprivate editor: Editor;\n\tprivate onSubmitCallback: (value: string) => void;\n\tprivate onCancelCallback: () => void;\n\tprivate tui: TUI;\n\tprivate keybindings: KeybindingsManager;\n\tprivate externalEditorCommand: string;\n\t/** Shows external editor failures; renders nothing while empty. */\n\tprivate externalEditorStatus = new Text(\"\", 1, 0);\n\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.editor.focused = value;\n\t}\n\n\tconstructor(\n\t\ttui: TUI,\n\t\tkeybindings: KeybindingsManager,\n\t\ttitle: string,\n\t\tprefill: string | undefined,\n\t\tonSubmit: (value: string) => void,\n\t\tonCancel: () => void,\n\t\toptions?: ExtensionEditorOptions,\n\t\texternalEditorCommand?: string,\n\t) {\n\t\tsuper();\n\n\t\tthis.tui = tui;\n\t\tthis.keybindings = keybindings;\n\t\tthis.externalEditorCommand =\n\t\t\texternalEditorCommand ||\n\t\t\tprocess.env.VISUAL ||\n\t\t\tprocess.env.EDITOR ||\n\t\t\t(process.platform === \"win32\" ? \"notepad\" : \"nano\");\n\t\tthis.onSubmitCallback = onSubmit;\n\t\tthis.onCancelCallback = onCancel;\n\t\tconst { description, ...editorOptions } = options ?? {};\n\n\t\t// Add top border\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add title and optional description\n\t\tthis.addChild(new Text(theme.fg(\"accent\", title), 1, 0));\n\t\tif (description) {\n\t\t\tthis.addChild(new Spacer(1));\n\t\t\tthis.addChild(new Text(theme.fg(\"text\", description), 1, 0));\n\t\t}\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Create editor\n\t\tthis.editor = new Editor(tui, getEditorTheme(), editorOptions);\n\t\tif (prefill) {\n\t\t\tthis.editor.setText(prefill);\n\t\t}\n\t\t// Wire up Enter to submit (Shift+Enter for newlines, like the main editor)\n\t\tthis.editor.onSubmit = (text: string) => {\n\t\t\tthis.onSubmitCallback(text);\n\t\t};\n\t\tthis.addChild(this.editor);\n\t\tthis.addChild(this.externalEditorStatus);\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add hint\n\t\tconst hint =\n\t\t\tkeyHint(\"tui.input.submit\", \"submit\") +\n\t\t\t\" \" +\n\t\t\tkeyHint(\"tui.input.newLine\", \"newline\") +\n\t\t\t\" \" +\n\t\t\tkeyHint(\"tui.select.cancel\", \"cancel\") +\n\t\t\t` ${keyHint(\"app.editor.external\", \"external editor\")}`;\n\t\tthis.addChild(new Text(hint, 1, 0));\n\n\t\tthis.addChild(new Spacer(1));\n\n\t\t// Add bottom border\n\t\tthis.addChild(new DynamicBorder());\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getKeybindings();\n\t\t// Escape or Ctrl+C to cancel\n\t\tif (kb.matches(keyData, \"tui.select.cancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t\treturn;\n\t\t}\n\n\t\t// External editor (app keybinding)\n\t\tif (this.keybindings.matches(keyData, \"app.editor.external\")) {\n\t\t\tvoid this.handleOpenExternalEditor();\n\t\t\treturn;\n\t\t}\n\n\t\t// Forward to editor\n\t\tthis.editor.handleInput(keyData);\n\t}\n\n\tprivate async handleOpenExternalEditor(): Promise<void> {\n\t\tconst content = this.editor.getText();\n\t\tthis.tui.stop();\n\t\ttry {\n\t\t\tconst result = await editInExternalEditor({\n\t\t\t\tcommand: this.externalEditorCommand,\n\t\t\t\tcontent,\n\t\t\t});\n\t\t\tthis.externalEditorStatus.setText(result.status === \"failed\" ? theme.fg(\"warning\", result.message) : \"\");\n\t\t\tif (result.status === \"complete\") {\n\t\t\t\tthis.editor.setText(result.content);\n\t\t\t}\n\t\t} finally {\n\t\t\tthis.tui.start();\n\t\t\tthis.tui.requestRender(true);\n\t\t}\n\t}\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { type Component } from "@earendil-works/pi-tui";
2
2
  import type { AgentSession } from "../../../core/agent-session.ts";
3
3
  import type { ReadonlyFooterDataProvider } from "../../../core/footer-data-provider.ts";
4
+ import { type StatusTasksProvider } from "./status-line.ts";
4
5
  /**
5
6
  * Format token counts for compact footer display.
6
7
  */
@@ -11,6 +12,9 @@ export declare function formatCwdForFooter(cwd: string, home: string | undefined
11
12
  * Computes token/context stats from session, gets git branch and extension statuses from provider.
12
13
  */
13
14
  export declare class FooterComponent implements Component {
15
+ /** Interactive mode moves built-in information above the editor, keeping extension statuses here. */
16
+ extensionStatusesOnly: boolean;
17
+ tasksProvider?: StatusTasksProvider;
14
18
  private lastEventAt?;
15
19
  private activitySessionId;
16
20
  private activityTimer?;
@@ -47,6 +51,9 @@ export declare class FooterComponent implements Component {
47
51
  * this changes, so render() keeps the lines it drew from equal inputs.
48
52
  */
49
53
  private renderInputs;
54
+ /** Render compact built-in status using the same cached session statistics as the detailed footer. */
55
+ renderStatus(width: number, state: string, busy: boolean, startedAt?: number, _lastDuration?: number, effortColor?: (text: string) => string, statePriority?: "balanced" | "maintenance"): string;
56
+ renderDetails(width: number): string[];
50
57
  render(width: number): string[];
51
58
  /** The footer's lines, drawn from `inputs` alone. */
52
59
  private renderLines;
@@ -1 +1 @@
1
- {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/footer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAmD,MAAM,wBAAwB,CAAC;AACzG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAiBxF;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAYhF;AA0FD;;;GAGG;AACH,qBAAa,eAAgB,YAAW,SAAS;IAChD,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,aAAa,CAAC,CAAiC;IACvD,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,UAAU,CAA6B;IAC/C,OAAO,CAAC,YA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";
3
3
  import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
4
4
  import { areExperimentalFeaturesEnabled } from "../../../core/experimental.js";
5
5
  import { addUsageToTotals, createUsageTotals, getSessionUsage } from "../../../core/usage-totals.js";
6
+ import { getMcpStatus } from "../../../extensions/mcp/index.js";
6
7
  import { stripAnsi } from "../../../utils/ansi.js";
7
8
  import { getThemeInstance, theme } from "../theme/theme.js";
9
+ import { keyText } from "./keybinding-hints.js";
10
+ import { composeStatusLine } from "./status-line.js";
8
11
  /**
9
12
  * Sanitize text for display in a single-line status.
10
13
  * Removes newlines, tabs, carriage returns, and other control characters.
@@ -63,6 +66,7 @@ const FOOTER_VALUE_INPUTS = [
63
66
  "cacheRead",
64
67
  "cacheWrite",
65
68
  "latestCacheHitRate",
69
+ "tokensPerSecond",
66
70
  "experimental",
67
71
  ];
68
72
  // A compile-time check that every input but the statuses is compared.
@@ -88,6 +92,9 @@ function sameFooterInputs(a, b) {
88
92
  * Computes token/context stats from session, gets git branch and extension statuses from provider.
89
93
  */
90
94
  export class FooterComponent {
95
+ /** Interactive mode moves built-in information above the editor, keeping extension statuses here. */
96
+ extensionStatusesOnly = false;
97
+ tasksProvider;
91
98
  lastEventAt;
92
99
  activitySessionId;
93
100
  activityTimer;
@@ -179,11 +186,16 @@ export class FooterComponent {
179
186
  // Calculate cumulative usage from ALL session entries (not just post-compaction messages)
180
187
  const usageTotals = createUsageTotals();
181
188
  let latestCacheHitRate;
189
+ let tokensPerSecond;
182
190
  const entries = sessionManager.getEntries();
183
191
  for (const { usage } of getSessionUsage(entries))
184
192
  addUsageToTotals(usageTotals, usage);
185
193
  for (const entry of entries) {
186
194
  if (entry.type === "message" && entry.message.role === "assistant") {
195
+ tokensPerSecond =
196
+ entry.message.durationMs && entry.message.durationMs > 0
197
+ ? (entry.message.usage.output * 1000) / entry.message.durationMs
198
+ : undefined;
187
199
  const latestPromptTokens = entry.message.usage.input + entry.message.usage.cacheRead + entry.message.usage.cacheWrite;
188
200
  latestCacheHitRate =
189
201
  latestPromptTokens > 0 ? (entry.message.usage.cacheRead / latestPromptTokens) * 100 : undefined;
@@ -200,6 +212,7 @@ export class FooterComponent {
200
212
  limitsModel,
201
213
  usageTotals,
202
214
  latestCacheHitRate,
215
+ tokensPerSecond,
203
216
  contextUsage,
204
217
  };
205
218
  return this.sessionStats;
@@ -210,7 +223,7 @@ export class FooterComponent {
210
223
  */
211
224
  renderInputs(width) {
212
225
  const state = this.session.state;
213
- const { usageTotals, latestCacheHitRate, contextUsage } = this.getSessionStats();
226
+ const { usageTotals, latestCacheHitRate, tokensPerSecond, contextUsage } = this.getSessionStats();
214
227
  const routed = this.session.routedModel;
215
228
  const pwd = basename(this.session.sessionManager.getCwd()) || sep;
216
229
  const branch = this.footerData.getGitBranch();
@@ -261,6 +274,7 @@ export class FooterComponent {
261
274
  cacheRead: usageTotals.cacheRead,
262
275
  cacheWrite: usageTotals.cacheWrite,
263
276
  latestCacheHitRate,
277
+ tokensPerSecond,
264
278
  experimental: areExperimentalFeaturesEnabled(),
265
279
  extensionStatuses: statuses.size === 0
266
280
  ? NO_EXTENSION_STATUSES
@@ -270,9 +284,68 @@ export class FooterComponent {
270
284
  .map(([, text]) => sanitizeStatusText(text)),
271
285
  };
272
286
  }
287
+ /** Render compact built-in status using the same cached session statistics as the detailed footer. */
288
+ renderStatus(width, state, busy, startedAt = 0, _lastDuration = 0, effortColor, statePriority = "balanced") {
289
+ busy = busy || this.session.isStreaming || this.session.isCompacting || this.session.isRetrying;
290
+ const inputs = this.renderInputs(width);
291
+ const tasks = this.tasksProvider?.getChecklistStatusSegment()?.text ?? "";
292
+ const mcp = getMcpStatus(this.session.sessionManager);
293
+ const percent = inputs.contextPercent;
294
+ const contextColor = (percent ?? 0) > 90 ? "error" : (percent ?? 0) > 70 ? "warning" : "text";
295
+ const contextPercent = `Context ${percent === undefined ? "?" : `${percent.toFixed(1)}%`}`;
296
+ const model = theme.fg("text", inputs.routedModelId ?? inputs.modelName);
297
+ const fullContext = `${contextPercent} of ${formatTokens(inputs.contextWindow)}`;
298
+ const context = theme.fg(contextColor, visibleWidth([state, model, fullContext].join(" › ")) <= width ? fullContext : contextPercent);
299
+ const timing = theme.fg("dim", busy ? `${Math.max(0, Math.floor((performance.now() - startedAt) / 1000))}s` : `last event ${inputs.age}`);
300
+ const essentialWidth = visibleWidth([state, model, context].join(" › "));
301
+ const timingWidth = essentialWidth + 5 + visibleWidth(timing) <= width ? visibleWidth(timing) : 0;
302
+ const leftWidth = timingWidth ? width - timingWidth - 5 : width;
303
+ const left = composeStatusLine(state, model, context, [
304
+ (effortColor ??
305
+ theme.getThinkingBorderColor(this.session.routedModel?.thinkingLevel ?? this.session.thinkingLevel))(inputs.effort),
306
+ theme.fg("dim", inputs.identity),
307
+ tasks,
308
+ theme.fg("dim", `TPS ${inputs.tokensPerSecond?.toFixed(1) ?? "—"} › Hit ${inputs.latestCacheHitRate === undefined ? "—" : `${inputs.latestCacheHitRate.toFixed(1)}%`}`),
309
+ mcp ? theme.fg("dim", `MCP ${mcp.connected}/${mcp.total}`) : "",
310
+ busy ? theme.fg("dim", `${keyText("app.interrupt")} to interrupt`) : "",
311
+ ], leftWidth, statePriority);
312
+ const borderColor = effortColor ??
313
+ theme.getThinkingBorderColor(this.session.routedModel?.thinkingLevel ?? this.session.thinkingLevel);
314
+ if (!timingWidth) {
315
+ const remaining = width - visibleWidth(left);
316
+ return left + borderColor(remaining > 0 ? ` ${"─".repeat(remaining - 1)}` : "");
317
+ }
318
+ return (left +
319
+ borderColor(` ${"─".repeat(width - visibleWidth(left) - timingWidth - 4)} `) +
320
+ timing +
321
+ borderColor(" ─"));
322
+ }
323
+ renderDetails(width) {
324
+ const inputs = this.renderInputs(width);
325
+ const fields = [
326
+ `${inputs.usageIncomplete ? "≥" : ""}$${inputs.cost.toFixed(3)}${inputs.usingSubscription ? " (sub)" : ""}${inputs.usageIncomplete ? " (usage incomplete)" : ""}`,
327
+ `Account ${inputs.accountLabel ?? "—"}`,
328
+ `Provider ${this.session.state.model?.provider ?? "—"}`,
329
+ `In ${formatTokens(inputs.input)}`,
330
+ `Out ${formatTokens(inputs.output)}`,
331
+ `Cache read ${formatTokens(inputs.cacheRead)}`,
332
+ `Cache write ${formatTokens(inputs.cacheWrite)}`,
333
+ `Context ${inputs.contextPercent === undefined ? "?" : `${inputs.contextPercent.toFixed(1)}%`} of ${formatTokens(inputs.contextWindow)}`,
334
+ `Model ${inputs.modelName}`,
335
+ ];
336
+ if (inputs.routedModelId && inputs.routedModelId !== inputs.modelName)
337
+ fields.push(`Routed model ${inputs.routedModelId}`);
338
+ if (inputs.experimental)
339
+ fields.push(theme.bold(theme.fg("warning", "xp")));
340
+ return width < 1 ? [] : [truncateToWidth(theme.fg("dim", fields.join(" › ")), width, "")];
341
+ }
273
342
  render(width) {
274
343
  if (width < 1)
275
344
  return [];
345
+ if (this.extensionStatusesOnly) {
346
+ const statuses = this.renderInputs(width).extensionStatuses;
347
+ return statuses.length ? [truncateToWidth(statuses.join(" "), width, "")] : [];
348
+ }
276
349
  const inputs = this.renderInputs(width);
277
350
  const known = this.rendered;
278
351
  if (known && sameFooterInputs(known.inputs, inputs))
@@ -1 +1 @@
1
- {"version":3,"file":"footer.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/footer.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAkB,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEzG,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAG/E,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAoB,MAAM,+BAA+B,CAAC;AACvH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,gBAA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C,KAAK,CAAC;QACnD,CAAC;QACD,IAAI,KAAK,EAAE,CAAC;YACX,IAAI,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;gBACnE,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC;YAC9E,CAAC;iBAAM,CAAC;gBACP,IAAI,IAAI;oBAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC3B,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAC/C,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBACpC,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IACtE,CAAC;CACD","sourcesContent":["// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commits a6df6a2c, e851bfde; modified for HUMAIN Code CLI.\nimport { basename, isAbsolute, relative, resolve, sep } from \"node:path\";\nimport { type Component, truncateToWidth, visibleWidth, wrapTextWithAnsi } from \"@earendil-works/pi-tui\";\nimport type { AgentSession } from \"../../../core/agent-session.ts\";\nimport { areExperimentalFeaturesEnabled } from \"../../../core/experimental.ts\";\nimport type { ContextUsage } from \"../../../core/extensions/types.ts\";\nimport type { ReadonlyFooterDataProvider } from \"../../../core/footer-data-provider.ts\";\nimport { addUsageToTotals, createUsageTotals, getSessionUsage, type UsageTotals } from \"../../../core/usage-totals.ts\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport { getThemeInstance, type Theme, theme } from \"../theme/theme.ts\";\n\n/**\n * Sanitize text for display in a single-line status.\n * Removes newlines, tabs, carriage returns, and other control characters.\n */\nfunction sanitizeStatusText(text: string): string {\n\t// Replace newlines, tabs, carriage returns with space, then collapse multiple spaces\n\treturn text\n\t\t.replace(/[\\r\\n\\t]/g, \" \")\n\t\t.replace(/ +/g, \" \")\n\t\t.trim();\n}\n\n/**\n * Format token counts for compact footer display.\n */\nexport function formatTokens(count: number): string {\n\tif (count < 1000) return count.toString();\n\tif (count < 10000) return `${(count / 1000).toFixed(1)}k`;\n\tif (count < 1000000) return `${Math.round(count / 1000)}k`;\n\tif (count < 10000000) return `${(count / 1000000).toFixed(1)}M`;\n\treturn `${Math.round(count / 1000000)}M`;\n}\n\nexport function formatCwdForFooter(cwd: string, home: string | undefined): string {\n\tif (!home) return cwd;\n\n\tconst resolvedCwd = resolve(cwd);\n\tconst resolvedHome = resolve(home);\n\tconst relativeToHome = relative(resolvedHome, resolvedCwd);\n\tconst isInsideHome =\n\t\trelativeToHome === \"\" ||\n\t\t(relativeToHome !== \"..\" && !relativeToHome.startsWith(`..${sep}`) && !isAbsolute(relativeToHome));\n\n\tif (!isInsideHome) return cwd;\n\treturn relativeToHome === \"\" ? \"~\" : `~${sep}${relativeToHome}`;\n}\n\n/** What the footer's lines are drawn from (FooterComponent.renderInputs()). */\ninterface FooterInputs {\n\twidth: number;\n\t/** The theme instance in use (`theme` is a proxy to it): another object after a change of theme. */\n\ttheme: Theme | undefined;\n\t/** The working directory's name, the git branch and the session name. */\n\tidentity: string;\n\teffort: string;\n\tmodelName: string;\n\taccountLabel: string | undefined;\n\troutedModelId: string | undefined;\n\t/** The provider, when there are several and it may be shown. */\n\tprovider: string | undefined;\n\t/** How long ago the last event was, as drawn. */\n\tage: string;\n\tcontextPercent: number | undefined;\n\tcontextWindow: number;\n\tusingSubscription: boolean;\n\tusageIncomplete: boolean;\n\tcost: number;\n\tinput: number;\n\toutput: number;\n\tcacheRead: number;\n\tcacheWrite: number;\n\tlatestCacheHitRate: number | undefined;\n\texperimental: boolean;\n\t/** The shown extension statuses, sorted by key. */\n\textensionStatuses: readonly string[];\n}\n\n/** The inputs compared by value: all but the extension statuses. */\nconst FOOTER_VALUE_INPUTS = [\n\t\"width\",\n\t\"theme\",\n\t\"identity\",\n\t\"effort\",\n\t\"modelName\",\n\t\"accountLabel\",\n\t\"routedModelId\",\n\t\"provider\",\n\t\"age\",\n\t\"contextPercent\",\n\t\"contextWindow\",\n\t\"usingSubscription\",\n\t\"usageIncomplete\",\n\t\"cost\",\n\t\"input\",\n\t\"output\",\n\t\"cacheRead\",\n\t\"cacheWrite\",\n\t\"latestCacheHitRate\",\n\t\"experimental\",\n] as const satisfies ReadonlyArray<keyof FooterInputs>;\n\n// A compile-time check that every input but the statuses is compared.\nconst allFooterInputsCompared: Exclude<\n\tkeyof FooterInputs,\n\t(typeof FOOTER_VALUE_INPUTS)[number] | \"extensionStatuses\"\n> extends never\n\t? true\n\t: never = true;\nvoid allFooterInputsCompared;\n\nconst NO_EXTENSION_STATUSES: readonly string[] = [];\n\nfunction sameFooterInputs(a: FooterInputs, b: FooterInputs): boolean {\n\tfor (const key of FOOTER_VALUE_INPUTS) {\n\t\tif (!Object.is(a[key], b[key])) return false;\n\t}\n\tconst statuses = a.extensionStatuses;\n\tif (statuses.length !== b.extensionStatuses.length) return false;\n\tfor (let i = 0; i < statuses.length; i++) {\n\t\tif (statuses[i] !== b.extensionStatuses[i]) return false;\n\t}\n\treturn true;\n}\n\ninterface SessionStats {\n\tsession: AgentSession;\n\tsessionId: string;\n\tleafId: string | null;\n\tentryCount: number;\n\tlimitsModel: unknown;\n\tusageTotals: UsageTotals;\n\tlatestCacheHitRate: number | undefined;\n\tcontextUsage: ContextUsage | undefined;\n}\n\n/**\n * Footer component that shows pwd, token stats, and context usage.\n * Computes token/context stats from session, gets git branch and extension statuses from provider.\n */\nexport class FooterComponent implements Component {\n\tprivate lastEventAt?: number;\n\tprivate activitySessionId: string;\n\tprivate activityTimer?: ReturnType<typeof setInterval>;\n\tprivate session: AgentSession;\n\tprivate footerData: ReadonlyFooterDataProvider;\n\tprivate sessionStats?: SessionStats;\n\t/** What render() drew last, and what it drew it from. */\n\tprivate rendered?: { inputs: FooterInputs; lines: readonly string[] };\n\n\tconstructor(session: AgentSession, footerData: ReadonlyFooterDataProvider, requestRender?: () => void) {\n\t\tthis.session = session;\n\t\tthis.footerData = footerData;\n\t\tthis.activitySessionId = session.sessionManager.getSessionId();\n\t\tthis.refreshActivityFromSession();\n\t\tif (requestRender) this.startActivityTimer(requestRender);\n\t}\n\n\tsetSession(session: AgentSession): void {\n\t\tconst changed = this.session !== session || this.activitySessionId !== session.sessionManager.getSessionId();\n\t\tthis.session = session;\n\t\tif (changed) this.refreshActivityFromSession();\n\t}\n\n\tmarkActivity(): void {\n\t\tthis.lastEventAt = performance.now();\n\t}\n\n\trefreshActivityFromSession(): void {\n\t\tthis.activitySessionId = this.session.sessionManager.getSessionId();\n\t\tthis.lastEventAt = undefined;\n\t\tconst now = Date.now();\n\t\tlet latest = 0;\n\t\tfor (const entry of this.session.sessionManager.getBranch()) {\n\t\t\tif (entry.type !== \"message\") continue;\n\t\t\tif (entry.message.role !== \"user\" && entry.message.role !== \"assistant\" && entry.message.role !== \"toolResult\")\n\t\t\t\tcontinue;\n\t\t\tconst timestamp = Date.parse(entry.timestamp);\n\t\t\tif (Number.isFinite(timestamp) && timestamp > latest && timestamp <= now) latest = timestamp;\n\t\t}\n\t\tif (latest > 0) this.lastEventAt = performance.now() - (now - latest);\n\t}\n\n\tstartActivityTimer(onTick: () => void): void {\n\t\tif (this.activityTimer) return;\n\t\tthis.activityTimer = setInterval(() => {\n\t\t\tif (this.lastEventAt !== undefined) onTick();\n\t\t}, 1000);\n\t\tthis.activityTimer.unref();\n\t}\n\n\t/**\n\t * Keeps the lines render() keeps: they are kept with everything they are drawn from (FooterInputs, the theme instance\n\t * among them, whose colors do not change), and drawn again when any of it changes. Interactive mode invalidates the\n\t * footer on every agent event, and while a reply streams in that is every chunk: the footer was drawn again for each.\n\t * (The git branch is cached and invalidated by the provider.)\n\t */\n\tinvalidate(): void {}\n\n\t/**\n\t * Clean up resources.\n\t * Git watcher cleanup now handled by provider.\n\t */\n\tdispose(): void {\n\t\tif (this.activityTimer) clearInterval(this.activityTimer);\n\t\tthis.activityTimer = undefined;\n\t\t// Git watcher cleanup handled by provider\n\t}\n\n\t/**\n\t * Usage totals and context usage scan the whole session, and the footer renders on every frame.\n\t * Entries are append-only and every append moves the leaf, so the results only change with the\n\t * session, leaf, entry count, or the model whose context window applies.\n\t */\n\tprivate getSessionStats(): SessionStats {\n\t\tconst sessionManager = this.session.sessionManager;\n\t\tconst entryCount = sessionManager.getEntryCount();\n\t\tconst sessionId = sessionManager.getSessionId();\n\t\tconst leafId = sessionManager.getLeafId();\n\t\tconst limitsModel = this.session.routedModel?.model ?? this.session.model;\n\t\tconst cached = this.sessionStats;\n\t\tif (\n\t\t\tcached &&\n\t\t\tcached.session === this.session &&\n\t\t\tcached.sessionId === sessionId &&\n\t\t\tcached.leafId === leafId &&\n\t\t\tcached.entryCount === entryCount &&\n\t\t\tcached.limitsModel === limitsModel\n\t\t) {\n\t\t\treturn cached;\n\t\t}\n\n\t\t// Calculate cumulative usage from ALL session entries (not just post-compaction messages)\n\t\tconst usageTotals = createUsageTotals();\n\t\tlet latestCacheHitRate: number | undefined;\n\n\t\tconst entries = sessionManager.getEntries();\n\t\tfor (const { usage } of getSessionUsage(entries)) addUsageToTotals(usageTotals, usage);\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\t\tconst latestPromptTokens =\n\t\t\t\t\tentry.message.usage.input + entry.message.usage.cacheRead + entry.message.usage.cacheWrite;\n\t\t\t\tlatestCacheHitRate =\n\t\t\t\t\tlatestPromptTokens > 0 ? (entry.message.usage.cacheRead / latestPromptTokens) * 100 : undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Calculate context usage from session (handles compaction correctly).\n\t\t// After compaction, tokens are unknown until the next LLM response.\n\t\tconst contextUsage = this.session.getContextUsage();\n\t\tthis.sessionStats = {\n\t\t\tsession: this.session,\n\t\t\tsessionId,\n\t\t\tleafId,\n\t\t\tentryCount,\n\t\t\tlimitsModel,\n\t\t\tusageTotals,\n\t\t\tlatestCacheHitRate,\n\t\t\tcontextUsage,\n\t\t};\n\t\treturn this.sessionStats;\n\t}\n\n\t/**\n\t * Everything the footer's lines are drawn from. While a reply streams in, the footer is drawn on every frame and none of\n\t * this changes, so render() keeps the lines it drew from equal inputs.\n\t */\n\tprivate renderInputs(width: number): FooterInputs {\n\t\tconst state = this.session.state;\n\t\tconst { usageTotals, latestCacheHitRate, contextUsage } = this.getSessionStats();\n\t\tconst routed = this.session.routedModel;\n\t\tconst pwd = basename(this.session.sessionManager.getCwd()) || sep;\n\t\tconst branch = this.footerData.getGitBranch();\n\t\tconst sessionName = this.session.sessionManager.getSessionName();\n\t\tconst effectiveModel = routed?.model ?? state.model;\n\t\tconst thinkingLevel = routed?.thinkingLevel ?? state.thinkingLevel ?? \"off\";\n\t\tconst elapsed =\n\t\t\tthis.lastEventAt === undefined\n\t\t\t\t? undefined\n\t\t\t\t: Math.max(0, Math.floor((performance.now() - this.lastEventAt) / 1000));\n\t\tconst accountLabel = state.model ? this.footerData.getOAuthAccountLabel(state.model.provider) : undefined;\n\t\tconst statuses = this.footerData.getExtensionStatuses();\n\t\treturn {\n\t\t\twidth,\n\t\t\ttheme: getThemeInstance(),\n\t\t\tidentity: [pwd, branch, sessionName]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.map((text) => stripAnsi(sanitizeStatusText(text!)))\n\t\t\t\t.join(\" · \"),\n\t\t\teffort: this.session.autoEffortSelecting\n\t\t\t\t? \"Choosing effort…\"\n\t\t\t\t: effectiveModel?.reasoning && thinkingLevel !== \"off\"\n\t\t\t\t\t? thinkingLevel[0].toUpperCase() + thinkingLevel.slice(1)\n\t\t\t\t\t: \"Thinking off\",\n\t\t\tmodelName: stripAnsi(sanitizeStatusText(state.model?.id ?? \"no-model\")),\n\t\t\taccountLabel: accountLabel ? stripAnsi(sanitizeStatusText(accountLabel)) : undefined,\n\t\t\troutedModelId: routed ? stripAnsi(sanitizeStatusText(routed.model.id)) : undefined,\n\t\t\tprovider:\n\t\t\t\tthis.footerData.getAvailableProviderCount() > 1 && state.model\n\t\t\t\t\t? stripAnsi(sanitizeStatusText(state.model.provider))\n\t\t\t\t\t: undefined,\n\t\t\tage:\n\t\t\t\telapsed === undefined\n\t\t\t\t\t? \"—\"\n\t\t\t\t\t: elapsed === 0\n\t\t\t\t\t\t? \"now\"\n\t\t\t\t\t\t: elapsed < 60\n\t\t\t\t\t\t\t? `${elapsed}s ago`\n\t\t\t\t\t\t\t: elapsed < 3600\n\t\t\t\t\t\t\t\t? `${Math.floor(elapsed / 60)}m ago`\n\t\t\t\t\t\t\t\t: elapsed < 86400\n\t\t\t\t\t\t\t\t\t? `${Math.floor(elapsed / 3600)}h ago`\n\t\t\t\t\t\t\t\t\t: `${Math.floor(elapsed / 86400)}d ago`,\n\t\t\tcontextPercent: contextUsage?.percent ?? undefined,\n\t\t\tcontextWindow: contextUsage?.contextWindow ?? routed?.model.contextWindow ?? state.model?.contextWindow ?? 0,\n\t\t\tusingSubscription: state.model ? this.session.modelRuntime.isUsingSubscription(state.model.provider) : false,\n\t\t\tusageIncomplete: Boolean(usageTotals.usageIncomplete),\n\t\t\tcost: usageTotals.cost,\n\t\t\tinput: usageTotals.input,\n\t\t\toutput: usageTotals.output,\n\t\t\tcacheRead: usageTotals.cacheRead,\n\t\t\tcacheWrite: usageTotals.cacheWrite,\n\t\t\tlatestCacheHitRate,\n\t\t\texperimental: areExperimentalFeaturesEnabled(),\n\t\t\textensionStatuses:\n\t\t\t\tstatuses.size === 0\n\t\t\t\t\t? NO_EXTENSION_STATUSES\n\t\t\t\t\t: Array.from(statuses.entries())\n\t\t\t\t\t\t\t.filter(([key]) => key !== \"adhd\" && key !== \"caveman\" && key !== \"ponytail\")\n\t\t\t\t\t\t\t.sort(([a], [b]) => a.localeCompare(b))\n\t\t\t\t\t\t\t.map(([, text]) => sanitizeStatusText(text)),\n\t\t};\n\t}\n\n\trender(width: number): string[] {\n\t\tif (width < 1) return [];\n\t\tconst inputs = this.renderInputs(width);\n\t\tconst known = this.rendered;\n\t\tif (known && sameFooterInputs(known.inputs, inputs)) return known.lines.slice();\n\t\tconst lines = this.renderLines(inputs);\n\t\tthis.rendered = { inputs, lines: lines.slice() };\n\t\treturn lines;\n\t}\n\n\t/** The footer's lines, drawn from `inputs` alone. */\n\tprivate renderLines(inputs: FooterInputs): string[] {\n\t\tconst { width, contextPercent } = inputs;\n\t\tconst context = `Context ${contextPercent === undefined ? \"?\" : `${contextPercent.toFixed(1)}%`}/${formatTokens(inputs.contextWindow)}`;\n\t\tconst lines = [truncateToWidth(theme.fg(\"dim\", inputs.identity), width, theme.fg(\"dim\", \"...\"))];\n\n\t\tconst { effort, modelName } = inputs;\n\t\tlet model = modelName;\n\t\tconst modelFields = [theme.fg(\"accent\", effort)];\n\t\tconst activity = theme.fg(\"dim\", `Last event ${inputs.age}`);\n\n\t\t// Append the active OAuth account label when the provider has several pooled accounts and there is room\n\t\tif (inputs.accountLabel) {\n\t\t\tconst withAccount = `${modelName} [${inputs.accountLabel}]`;\n\t\t\tif (visibleWidth(effort) + 3 + visibleWidth(withAccount) + 2 + visibleWidth(activity) <= width)\n\t\t\t\tmodel = withAccount;\n\t\t}\n\t\tmodelFields.push(theme.fg(\"text\", model));\n\t\t// A virtual model routes each request; show where the latest response went.\n\t\tif (inputs.routedModelId !== undefined) modelFields.push(theme.fg(\"muted\", `→ ${inputs.routedModelId}`));\n\t\t// Prepend the provider in parentheses if there are multiple providers and there's enough room\n\t\tif (inputs.provider !== undefined) {\n\t\t\tconst provider = theme.fg(\"dim\", `(${inputs.provider})`);\n\t\t\tif (visibleWidth([...modelFields, provider].join(\" · \")) + 2 + visibleWidth(activity) <= width)\n\t\t\t\tmodelFields.push(provider);\n\t\t}\n\t\tlines.push(...this.renderBand(modelFields, activity, width));\n\n\t\t// Colorize context percentage based on usage\n\t\tconst contextColor = (contextPercent ?? 0) > 90 ? \"error\" : (contextPercent ?? 0) > 70 ? \"warning\" : \"text\";\n\t\tconst { usingSubscription } = inputs;\n\t\t// Build stats line\n\t\tconst statsParts = [theme.fg(contextColor, context)];\n\t\tif (inputs.usageIncomplete) {\n\t\t\tstatsParts.push(\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"muted\",\n\t\t\t\t\t`${inputs.cost > 0 ? `≥$${inputs.cost.toFixed(3)}` : \"Cost unknown\"}${usingSubscription ? \" (sub)\" : \"\"} (usage incomplete)`,\n\t\t\t\t),\n\t\t\t);\n\t\t} else if (inputs.cost || usingSubscription) {\n\t\t\tstatsParts.push(theme.fg(\"muted\", `$${inputs.cost.toFixed(3)}${usingSubscription ? \" (sub)\" : \"\"}`));\n\t\t}\n\t\tstatsParts.push(\n\t\t\ttheme.fg(\"dim\", `In ${formatTokens(inputs.input)}`),\n\t\t\ttheme.fg(\"dim\", `Out ${formatTokens(inputs.output)}`),\n\t\t);\n\t\tif (inputs.experimental) statsParts.push(theme.bold(theme.fg(\"warning\", \"xp\")));\n\t\tlines.push(...this.renderBand(statsParts, undefined, width));\n\t\tconst cacheParts = [theme.fg(\"dim\", `Cache read ${formatTokens(inputs.cacheRead)}`)];\n\t\tif (inputs.cacheWrite) cacheParts.push(theme.fg(\"dim\", `Cache write ${formatTokens(inputs.cacheWrite)}`));\n\t\tcacheParts.push(\n\t\t\ttheme.fg(\n\t\t\t\t\"dim\",\n\t\t\t\t`Hit ${inputs.latestCacheHitRate === undefined ? \"—\" : `${inputs.latestCacheHitRate.toFixed(1)}%`}`,\n\t\t\t),\n\t\t);\n\t\tlines.push(...this.renderBand(cacheParts, theme.fg(\"dim\", \"/settings\"), width));\n\n\t\t// Add extension statuses on a single line, sorted by key alphabetically\n\t\tif (inputs.extensionStatuses.length) {\n\t\t\t// Truncate to terminal width with dim ellipsis for consistency with footer style\n\t\t\tlines.push(truncateToWidth(inputs.extensionStatuses.join(\" \"), width, theme.fg(\"dim\", \"...\")));\n\t\t}\n\t\treturn lines;\n\t}\n\n\tprivate renderBand(fields: string[], right: string | undefined, width: number): string[] {\n\t\tconst lines: string[] = [];\n\t\tlet line = \"\";\n\t\tfor (const field of fields) {\n\t\t\tif (line && visibleWidth(`${line} · ${field}`) > width) {\n\t\t\t\tlines.push(line);\n\t\t\t\tline = \"\";\n\t\t\t}\n\t\t\tif (visibleWidth(field) > width) {\n\t\t\t\tconst wrapped = wrapTextWithAnsi(field, width);\n\t\t\t\tlines.push(...wrapped.slice(0, -1));\n\t\t\t\tline = wrapped.at(-1) ?? \"\";\n\t\t\t} else line = line ? `${line} · ${field}` : field;\n\t\t}\n\t\tif (right) {\n\t\t\tif (line && visibleWidth(line) + 2 + visibleWidth(right) <= width) {\n\t\t\t\tline += \" \".repeat(width - visibleWidth(line) - visibleWidth(right)) + right;\n\t\t\t} else {\n\t\t\t\tif (line) lines.push(line);\n\t\t\t\tconst wrapped = wrapTextWithAnsi(right, width);\n\t\t\t\tlines.push(...wrapped.slice(0, -1));\n\t\t\t\tline = wrapped.at(-1) ?? \"\";\n\t\t\t}\n\t\t}\n\t\tif (line) lines.push(line);\n\t\treturn lines.map((rendered) => truncateToWidth(rendered, width, \"\"));\n\t}\n}\n"]}
1
+ {"version":3,"file":"footer.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/footer.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,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AAI,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QACnD,CAAC;QACD,IAAI,KAAK,EAAE,CAAC;YACX,IAAI,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;gBACnE,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC;YAC9E,CAAC;iBAAM,CAAC;gBACP,IAAI,IAAI;oBAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC3B,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAC/C,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBACpC,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IACtE,CAAC;CACD","sourcesContent":["// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commits a6df6a2c, e851bfde; modified for HUMAIN Code CLI.\nimport { basename, isAbsolute, relative, resolve, sep } from \"node:path\";\nimport { type Component, truncateToWidth, visibleWidth, wrapTextWithAnsi } from \"@earendil-works/pi-tui\";\nimport type { AgentSession } from \"../../../core/agent-session.ts\";\nimport { areExperimentalFeaturesEnabled } from \"../../../core/experimental.ts\";\nimport type { ContextUsage } from \"../../../core/extensions/types.ts\";\nimport type { ReadonlyFooterDataProvider } from \"../../../core/footer-data-provider.ts\";\nimport { addUsageToTotals, createUsageTotals, getSessionUsage, type UsageTotals } from \"../../../core/usage-totals.ts\";\nimport { getMcpStatus } from \"../../../extensions/mcp/index.ts\";\nimport { stripAnsi } from \"../../../utils/ansi.ts\";\nimport { getThemeInstance, type Theme, theme } from \"../theme/theme.ts\";\nimport { keyText } from \"./keybinding-hints.ts\";\nimport { composeStatusLine, type StatusTasksProvider } from \"./status-line.ts\";\n\n/**\n * Sanitize text for display in a single-line status.\n * Removes newlines, tabs, carriage returns, and other control characters.\n */\nfunction sanitizeStatusText(text: string): string {\n\t// Replace newlines, tabs, carriage returns with space, then collapse multiple spaces\n\treturn text\n\t\t.replace(/[\\r\\n\\t]/g, \" \")\n\t\t.replace(/ +/g, \" \")\n\t\t.trim();\n}\n\n/**\n * Format token counts for compact footer display.\n */\nexport function formatTokens(count: number): string {\n\tif (count < 1000) return count.toString();\n\tif (count < 10000) return `${(count / 1000).toFixed(1)}k`;\n\tif (count < 1000000) return `${Math.round(count / 1000)}k`;\n\tif (count < 10000000) return `${(count / 1000000).toFixed(1)}M`;\n\treturn `${Math.round(count / 1000000)}M`;\n}\n\nexport function formatCwdForFooter(cwd: string, home: string | undefined): string {\n\tif (!home) return cwd;\n\n\tconst resolvedCwd = resolve(cwd);\n\tconst resolvedHome = resolve(home);\n\tconst relativeToHome = relative(resolvedHome, resolvedCwd);\n\tconst isInsideHome =\n\t\trelativeToHome === \"\" ||\n\t\t(relativeToHome !== \"..\" && !relativeToHome.startsWith(`..${sep}`) && !isAbsolute(relativeToHome));\n\n\tif (!isInsideHome) return cwd;\n\treturn relativeToHome === \"\" ? \"~\" : `~${sep}${relativeToHome}`;\n}\n\n/** What the footer's lines are drawn from (FooterComponent.renderInputs()). */\ninterface FooterInputs {\n\twidth: number;\n\t/** The theme instance in use (`theme` is a proxy to it): another object after a change of theme. */\n\ttheme: Theme | undefined;\n\t/** The working directory's name, the git branch and the session name. */\n\tidentity: string;\n\teffort: string;\n\tmodelName: string;\n\taccountLabel: string | undefined;\n\troutedModelId: string | undefined;\n\t/** The provider, when there are several and it may be shown. */\n\tprovider: string | undefined;\n\t/** How long ago the last event was, as drawn. */\n\tage: string;\n\tcontextPercent: number | undefined;\n\tcontextWindow: number;\n\tusingSubscription: boolean;\n\tusageIncomplete: boolean;\n\tcost: number;\n\tinput: number;\n\toutput: number;\n\tcacheRead: number;\n\tcacheWrite: number;\n\tlatestCacheHitRate: number | undefined;\n\ttokensPerSecond: number | undefined;\n\texperimental: boolean;\n\t/** The shown extension statuses, sorted by key. */\n\textensionStatuses: readonly string[];\n}\n\n/** The inputs compared by value: all but the extension statuses. */\nconst FOOTER_VALUE_INPUTS = [\n\t\"width\",\n\t\"theme\",\n\t\"identity\",\n\t\"effort\",\n\t\"modelName\",\n\t\"accountLabel\",\n\t\"routedModelId\",\n\t\"provider\",\n\t\"age\",\n\t\"contextPercent\",\n\t\"contextWindow\",\n\t\"usingSubscription\",\n\t\"usageIncomplete\",\n\t\"cost\",\n\t\"input\",\n\t\"output\",\n\t\"cacheRead\",\n\t\"cacheWrite\",\n\t\"latestCacheHitRate\",\n\t\"tokensPerSecond\",\n\t\"experimental\",\n] as const satisfies ReadonlyArray<keyof FooterInputs>;\n\n// A compile-time check that every input but the statuses is compared.\nconst allFooterInputsCompared: Exclude<\n\tkeyof FooterInputs,\n\t(typeof FOOTER_VALUE_INPUTS)[number] | \"extensionStatuses\"\n> extends never\n\t? true\n\t: never = true;\nvoid allFooterInputsCompared;\n\nconst NO_EXTENSION_STATUSES: readonly string[] = [];\n\nfunction sameFooterInputs(a: FooterInputs, b: FooterInputs): boolean {\n\tfor (const key of FOOTER_VALUE_INPUTS) {\n\t\tif (!Object.is(a[key], b[key])) return false;\n\t}\n\tconst statuses = a.extensionStatuses;\n\tif (statuses.length !== b.extensionStatuses.length) return false;\n\tfor (let i = 0; i < statuses.length; i++) {\n\t\tif (statuses[i] !== b.extensionStatuses[i]) return false;\n\t}\n\treturn true;\n}\n\ninterface SessionStats {\n\tsession: AgentSession;\n\tsessionId: string;\n\tleafId: string | null;\n\tentryCount: number;\n\tlimitsModel: unknown;\n\tusageTotals: UsageTotals;\n\tlatestCacheHitRate: number | undefined;\n\ttokensPerSecond: number | undefined;\n\tcontextUsage: ContextUsage | undefined;\n}\n\n/**\n * Footer component that shows pwd, token stats, and context usage.\n * Computes token/context stats from session, gets git branch and extension statuses from provider.\n */\nexport class FooterComponent implements Component {\n\t/** Interactive mode moves built-in information above the editor, keeping extension statuses here. */\n\textensionStatusesOnly = false;\n\ttasksProvider?: StatusTasksProvider;\n\tprivate lastEventAt?: number;\n\tprivate activitySessionId: string;\n\tprivate activityTimer?: ReturnType<typeof setInterval>;\n\tprivate session: AgentSession;\n\tprivate footerData: ReadonlyFooterDataProvider;\n\tprivate sessionStats?: SessionStats;\n\t/** What render() drew last, and what it drew it from. */\n\tprivate rendered?: { inputs: FooterInputs; lines: readonly string[] };\n\n\tconstructor(session: AgentSession, footerData: ReadonlyFooterDataProvider, requestRender?: () => void) {\n\t\tthis.session = session;\n\t\tthis.footerData = footerData;\n\t\tthis.activitySessionId = session.sessionManager.getSessionId();\n\t\tthis.refreshActivityFromSession();\n\t\tif (requestRender) this.startActivityTimer(requestRender);\n\t}\n\n\tsetSession(session: AgentSession): void {\n\t\tconst changed = this.session !== session || this.activitySessionId !== session.sessionManager.getSessionId();\n\t\tthis.session = session;\n\t\tif (changed) this.refreshActivityFromSession();\n\t}\n\n\tmarkActivity(): void {\n\t\tthis.lastEventAt = performance.now();\n\t}\n\n\trefreshActivityFromSession(): void {\n\t\tthis.activitySessionId = this.session.sessionManager.getSessionId();\n\t\tthis.lastEventAt = undefined;\n\t\tconst now = Date.now();\n\t\tlet latest = 0;\n\t\tfor (const entry of this.session.sessionManager.getBranch()) {\n\t\t\tif (entry.type !== \"message\") continue;\n\t\t\tif (entry.message.role !== \"user\" && entry.message.role !== \"assistant\" && entry.message.role !== \"toolResult\")\n\t\t\t\tcontinue;\n\t\t\tconst timestamp = Date.parse(entry.timestamp);\n\t\t\tif (Number.isFinite(timestamp) && timestamp > latest && timestamp <= now) latest = timestamp;\n\t\t}\n\t\tif (latest > 0) this.lastEventAt = performance.now() - (now - latest);\n\t}\n\n\tstartActivityTimer(onTick: () => void): void {\n\t\tif (this.activityTimer) return;\n\t\tthis.activityTimer = setInterval(() => {\n\t\t\tif (this.lastEventAt !== undefined) onTick();\n\t\t}, 1000);\n\t\tthis.activityTimer.unref();\n\t}\n\n\t/**\n\t * Keeps the lines render() keeps: they are kept with everything they are drawn from (FooterInputs, the theme instance\n\t * among them, whose colors do not change), and drawn again when any of it changes. Interactive mode invalidates the\n\t * footer on every agent event, and while a reply streams in that is every chunk: the footer was drawn again for each.\n\t * (The git branch is cached and invalidated by the provider.)\n\t */\n\tinvalidate(): void {}\n\n\t/**\n\t * Clean up resources.\n\t * Git watcher cleanup now handled by provider.\n\t */\n\tdispose(): void {\n\t\tif (this.activityTimer) clearInterval(this.activityTimer);\n\t\tthis.activityTimer = undefined;\n\t\t// Git watcher cleanup handled by provider\n\t}\n\n\t/**\n\t * Usage totals and context usage scan the whole session, and the footer renders on every frame.\n\t * Entries are append-only and every append moves the leaf, so the results only change with the\n\t * session, leaf, entry count, or the model whose context window applies.\n\t */\n\tprivate getSessionStats(): SessionStats {\n\t\tconst sessionManager = this.session.sessionManager;\n\t\tconst entryCount = sessionManager.getEntryCount();\n\t\tconst sessionId = sessionManager.getSessionId();\n\t\tconst leafId = sessionManager.getLeafId();\n\t\tconst limitsModel = this.session.routedModel?.model ?? this.session.model;\n\t\tconst cached = this.sessionStats;\n\t\tif (\n\t\t\tcached &&\n\t\t\tcached.session === this.session &&\n\t\t\tcached.sessionId === sessionId &&\n\t\t\tcached.leafId === leafId &&\n\t\t\tcached.entryCount === entryCount &&\n\t\t\tcached.limitsModel === limitsModel\n\t\t) {\n\t\t\treturn cached;\n\t\t}\n\n\t\t// Calculate cumulative usage from ALL session entries (not just post-compaction messages)\n\t\tconst usageTotals = createUsageTotals();\n\t\tlet latestCacheHitRate: number | undefined;\n\t\tlet tokensPerSecond: number | undefined;\n\n\t\tconst entries = sessionManager.getEntries();\n\t\tfor (const { usage } of getSessionUsage(entries)) addUsageToTotals(usageTotals, usage);\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\t\ttokensPerSecond =\n\t\t\t\t\tentry.message.durationMs && entry.message.durationMs > 0\n\t\t\t\t\t\t? (entry.message.usage.output * 1000) / entry.message.durationMs\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst latestPromptTokens =\n\t\t\t\t\tentry.message.usage.input + entry.message.usage.cacheRead + entry.message.usage.cacheWrite;\n\t\t\t\tlatestCacheHitRate =\n\t\t\t\t\tlatestPromptTokens > 0 ? (entry.message.usage.cacheRead / latestPromptTokens) * 100 : undefined;\n\t\t\t}\n\t\t}\n\n\t\t// Calculate context usage from session (handles compaction correctly).\n\t\t// After compaction, tokens are unknown until the next LLM response.\n\t\tconst contextUsage = this.session.getContextUsage();\n\t\tthis.sessionStats = {\n\t\t\tsession: this.session,\n\t\t\tsessionId,\n\t\t\tleafId,\n\t\t\tentryCount,\n\t\t\tlimitsModel,\n\t\t\tusageTotals,\n\t\t\tlatestCacheHitRate,\n\t\t\ttokensPerSecond,\n\t\t\tcontextUsage,\n\t\t};\n\t\treturn this.sessionStats;\n\t}\n\n\t/**\n\t * Everything the footer's lines are drawn from. While a reply streams in, the footer is drawn on every frame and none of\n\t * this changes, so render() keeps the lines it drew from equal inputs.\n\t */\n\tprivate renderInputs(width: number): FooterInputs {\n\t\tconst state = this.session.state;\n\t\tconst { usageTotals, latestCacheHitRate, tokensPerSecond, contextUsage } = this.getSessionStats();\n\t\tconst routed = this.session.routedModel;\n\t\tconst pwd = basename(this.session.sessionManager.getCwd()) || sep;\n\t\tconst branch = this.footerData.getGitBranch();\n\t\tconst sessionName = this.session.sessionManager.getSessionName();\n\t\tconst effectiveModel = routed?.model ?? state.model;\n\t\tconst thinkingLevel = routed?.thinkingLevel ?? state.thinkingLevel ?? \"off\";\n\t\tconst elapsed =\n\t\t\tthis.lastEventAt === undefined\n\t\t\t\t? undefined\n\t\t\t\t: Math.max(0, Math.floor((performance.now() - this.lastEventAt) / 1000));\n\t\tconst accountLabel = state.model ? this.footerData.getOAuthAccountLabel(state.model.provider) : undefined;\n\t\tconst statuses = this.footerData.getExtensionStatuses();\n\t\treturn {\n\t\t\twidth,\n\t\t\ttheme: getThemeInstance(),\n\t\t\tidentity: [pwd, branch, sessionName]\n\t\t\t\t.filter(Boolean)\n\t\t\t\t.map((text) => stripAnsi(sanitizeStatusText(text!)))\n\t\t\t\t.join(\" · \"),\n\t\t\teffort: this.session.autoEffortSelecting\n\t\t\t\t? \"Choosing effort…\"\n\t\t\t\t: effectiveModel?.reasoning && thinkingLevel !== \"off\"\n\t\t\t\t\t? thinkingLevel[0].toUpperCase() + thinkingLevel.slice(1)\n\t\t\t\t\t: \"Thinking off\",\n\t\t\tmodelName: stripAnsi(sanitizeStatusText(state.model?.id ?? \"no-model\")),\n\t\t\taccountLabel: accountLabel ? stripAnsi(sanitizeStatusText(accountLabel)) : undefined,\n\t\t\troutedModelId: routed ? stripAnsi(sanitizeStatusText(routed.model.id)) : undefined,\n\t\t\tprovider:\n\t\t\t\tthis.footerData.getAvailableProviderCount() > 1 && state.model\n\t\t\t\t\t? stripAnsi(sanitizeStatusText(state.model.provider))\n\t\t\t\t\t: undefined,\n\t\t\tage:\n\t\t\t\telapsed === undefined\n\t\t\t\t\t? \"—\"\n\t\t\t\t\t: elapsed === 0\n\t\t\t\t\t\t? \"now\"\n\t\t\t\t\t\t: elapsed < 60\n\t\t\t\t\t\t\t? `${elapsed}s ago`\n\t\t\t\t\t\t\t: elapsed < 3600\n\t\t\t\t\t\t\t\t? `${Math.floor(elapsed / 60)}m ago`\n\t\t\t\t\t\t\t\t: elapsed < 86400\n\t\t\t\t\t\t\t\t\t? `${Math.floor(elapsed / 3600)}h ago`\n\t\t\t\t\t\t\t\t\t: `${Math.floor(elapsed / 86400)}d ago`,\n\t\t\tcontextPercent: contextUsage?.percent ?? undefined,\n\t\t\tcontextWindow: contextUsage?.contextWindow ?? routed?.model.contextWindow ?? state.model?.contextWindow ?? 0,\n\t\t\tusingSubscription: state.model ? this.session.modelRuntime.isUsingSubscription(state.model.provider) : false,\n\t\t\tusageIncomplete: Boolean(usageTotals.usageIncomplete),\n\t\t\tcost: usageTotals.cost,\n\t\t\tinput: usageTotals.input,\n\t\t\toutput: usageTotals.output,\n\t\t\tcacheRead: usageTotals.cacheRead,\n\t\t\tcacheWrite: usageTotals.cacheWrite,\n\t\t\tlatestCacheHitRate,\n\t\t\ttokensPerSecond,\n\t\t\texperimental: areExperimentalFeaturesEnabled(),\n\t\t\textensionStatuses:\n\t\t\t\tstatuses.size === 0\n\t\t\t\t\t? NO_EXTENSION_STATUSES\n\t\t\t\t\t: Array.from(statuses.entries())\n\t\t\t\t\t\t\t.filter(([key]) => key !== \"adhd\" && key !== \"caveman\" && key !== \"ponytail\")\n\t\t\t\t\t\t\t.sort(([a], [b]) => a.localeCompare(b))\n\t\t\t\t\t\t\t.map(([, text]) => sanitizeStatusText(text)),\n\t\t};\n\t}\n\n\t/** Render compact built-in status using the same cached session statistics as the detailed footer. */\n\trenderStatus(\n\t\twidth: number,\n\t\tstate: string,\n\t\tbusy: boolean,\n\t\tstartedAt = 0,\n\t\t_lastDuration = 0,\n\t\teffortColor?: (text: string) => string,\n\t\tstatePriority: \"balanced\" | \"maintenance\" = \"balanced\",\n\t): string {\n\t\tbusy = busy || this.session.isStreaming || this.session.isCompacting || this.session.isRetrying;\n\t\tconst inputs = this.renderInputs(width);\n\t\tconst tasks = this.tasksProvider?.getChecklistStatusSegment()?.text ?? \"\";\n\t\tconst mcp = getMcpStatus(this.session.sessionManager);\n\t\tconst percent = inputs.contextPercent;\n\t\tconst contextColor = (percent ?? 0) > 90 ? \"error\" : (percent ?? 0) > 70 ? \"warning\" : \"text\";\n\t\tconst contextPercent = `Context ${percent === undefined ? \"?\" : `${percent.toFixed(1)}%`}`;\n\t\tconst model = theme.fg(\"text\", inputs.routedModelId ?? inputs.modelName);\n\t\tconst fullContext = `${contextPercent} of ${formatTokens(inputs.contextWindow)}`;\n\t\tconst context = theme.fg(\n\t\t\tcontextColor,\n\t\t\tvisibleWidth([state, model, fullContext].join(\" › \")) <= width ? fullContext : contextPercent,\n\t\t);\n\t\tconst timing = theme.fg(\n\t\t\t\"dim\",\n\t\t\tbusy ? `${Math.max(0, Math.floor((performance.now() - startedAt) / 1000))}s` : `last event ${inputs.age}`,\n\t\t);\n\t\tconst essentialWidth = visibleWidth([state, model, context].join(\" › \"));\n\t\tconst timingWidth = essentialWidth + 5 + visibleWidth(timing) <= width ? visibleWidth(timing) : 0;\n\t\tconst leftWidth = timingWidth ? width - timingWidth - 5 : width;\n\t\tconst left = composeStatusLine(\n\t\t\tstate,\n\t\t\tmodel,\n\t\t\tcontext,\n\t\t\t[\n\t\t\t\t(\n\t\t\t\t\teffortColor ??\n\t\t\t\t\ttheme.getThinkingBorderColor(this.session.routedModel?.thinkingLevel ?? this.session.thinkingLevel)\n\t\t\t\t)(inputs.effort),\n\t\t\t\ttheme.fg(\"dim\", inputs.identity),\n\t\t\t\ttasks,\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"dim\",\n\t\t\t\t\t`TPS ${inputs.tokensPerSecond?.toFixed(1) ?? \"—\"} › Hit ${inputs.latestCacheHitRate === undefined ? \"—\" : `${inputs.latestCacheHitRate.toFixed(1)}%`}`,\n\t\t\t\t),\n\t\t\t\tmcp ? theme.fg(\"dim\", `MCP ${mcp.connected}/${mcp.total}`) : \"\",\n\t\t\t\tbusy ? theme.fg(\"dim\", `${keyText(\"app.interrupt\")} to interrupt`) : \"\",\n\t\t\t],\n\t\t\tleftWidth,\n\t\t\tstatePriority,\n\t\t);\n\t\tconst borderColor =\n\t\t\teffortColor ??\n\t\t\ttheme.getThinkingBorderColor(this.session.routedModel?.thinkingLevel ?? this.session.thinkingLevel);\n\t\tif (!timingWidth) {\n\t\t\tconst remaining = width - visibleWidth(left);\n\t\t\treturn left + borderColor(remaining > 0 ? ` ${\"─\".repeat(remaining - 1)}` : \"\");\n\t\t}\n\t\treturn (\n\t\t\tleft +\n\t\t\tborderColor(` ${\"─\".repeat(width - visibleWidth(left) - timingWidth - 4)} `) +\n\t\t\ttiming +\n\t\t\tborderColor(\" ─\")\n\t\t);\n\t}\n\n\trenderDetails(width: number): string[] {\n\t\tconst inputs = this.renderInputs(width);\n\t\tconst fields = [\n\t\t\t`${inputs.usageIncomplete ? \"≥\" : \"\"}$${inputs.cost.toFixed(3)}${inputs.usingSubscription ? \" (sub)\" : \"\"}${inputs.usageIncomplete ? \" (usage incomplete)\" : \"\"}`,\n\t\t\t`Account ${inputs.accountLabel ?? \"—\"}`,\n\t\t\t`Provider ${this.session.state.model?.provider ?? \"—\"}`,\n\t\t\t`In ${formatTokens(inputs.input)}`,\n\t\t\t`Out ${formatTokens(inputs.output)}`,\n\t\t\t`Cache read ${formatTokens(inputs.cacheRead)}`,\n\t\t\t`Cache write ${formatTokens(inputs.cacheWrite)}`,\n\t\t\t`Context ${inputs.contextPercent === undefined ? \"?\" : `${inputs.contextPercent.toFixed(1)}%`} of ${formatTokens(inputs.contextWindow)}`,\n\t\t\t`Model ${inputs.modelName}`,\n\t\t];\n\t\tif (inputs.routedModelId && inputs.routedModelId !== inputs.modelName)\n\t\t\tfields.push(`Routed model ${inputs.routedModelId}`);\n\t\tif (inputs.experimental) fields.push(theme.bold(theme.fg(\"warning\", \"xp\")));\n\t\treturn width < 1 ? [] : [truncateToWidth(theme.fg(\"dim\", fields.join(\" › \")), width, \"\")];\n\t}\n\n\trender(width: number): string[] {\n\t\tif (width < 1) return [];\n\t\tif (this.extensionStatusesOnly) {\n\t\t\tconst statuses = this.renderInputs(width).extensionStatuses;\n\t\t\treturn statuses.length ? [truncateToWidth(statuses.join(\" \"), width, \"\")] : [];\n\t\t}\n\t\tconst inputs = this.renderInputs(width);\n\t\tconst known = this.rendered;\n\t\tif (known && sameFooterInputs(known.inputs, inputs)) return known.lines.slice();\n\t\tconst lines = this.renderLines(inputs);\n\t\tthis.rendered = { inputs, lines: lines.slice() };\n\t\treturn lines;\n\t}\n\n\t/** The footer's lines, drawn from `inputs` alone. */\n\tprivate renderLines(inputs: FooterInputs): string[] {\n\t\tconst { width, contextPercent } = inputs;\n\t\tconst context = `Context ${contextPercent === undefined ? \"?\" : `${contextPercent.toFixed(1)}%`}/${formatTokens(inputs.contextWindow)}`;\n\t\tconst lines = [truncateToWidth(theme.fg(\"dim\", inputs.identity), width, theme.fg(\"dim\", \"...\"))];\n\n\t\tconst { effort, modelName } = inputs;\n\t\tlet model = modelName;\n\t\tconst modelFields = [theme.fg(\"accent\", effort)];\n\t\tconst activity = theme.fg(\"dim\", `Last event ${inputs.age}`);\n\n\t\t// Append the active OAuth account label when the provider has several pooled accounts and there is room\n\t\tif (inputs.accountLabel) {\n\t\t\tconst withAccount = `${modelName} [${inputs.accountLabel}]`;\n\t\t\tif (visibleWidth(effort) + 3 + visibleWidth(withAccount) + 2 + visibleWidth(activity) <= width)\n\t\t\t\tmodel = withAccount;\n\t\t}\n\t\tmodelFields.push(theme.fg(\"text\", model));\n\t\t// A virtual model routes each request; show where the latest response went.\n\t\tif (inputs.routedModelId !== undefined) modelFields.push(theme.fg(\"muted\", `→ ${inputs.routedModelId}`));\n\t\t// Prepend the provider in parentheses if there are multiple providers and there's enough room\n\t\tif (inputs.provider !== undefined) {\n\t\t\tconst provider = theme.fg(\"dim\", `(${inputs.provider})`);\n\t\t\tif (visibleWidth([...modelFields, provider].join(\" · \")) + 2 + visibleWidth(activity) <= width)\n\t\t\t\tmodelFields.push(provider);\n\t\t}\n\t\tlines.push(...this.renderBand(modelFields, activity, width));\n\n\t\t// Colorize context percentage based on usage\n\t\tconst contextColor = (contextPercent ?? 0) > 90 ? \"error\" : (contextPercent ?? 0) > 70 ? \"warning\" : \"text\";\n\t\tconst { usingSubscription } = inputs;\n\t\t// Build stats line\n\t\tconst statsParts = [theme.fg(contextColor, context)];\n\t\tif (inputs.usageIncomplete) {\n\t\t\tstatsParts.push(\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"muted\",\n\t\t\t\t\t`${inputs.cost > 0 ? `≥$${inputs.cost.toFixed(3)}` : \"Cost unknown\"}${usingSubscription ? \" (sub)\" : \"\"} (usage incomplete)`,\n\t\t\t\t),\n\t\t\t);\n\t\t} else if (inputs.cost || usingSubscription) {\n\t\t\tstatsParts.push(theme.fg(\"muted\", `$${inputs.cost.toFixed(3)}${usingSubscription ? \" (sub)\" : \"\"}`));\n\t\t}\n\t\tstatsParts.push(\n\t\t\ttheme.fg(\"dim\", `In ${formatTokens(inputs.input)}`),\n\t\t\ttheme.fg(\"dim\", `Out ${formatTokens(inputs.output)}`),\n\t\t);\n\t\tif (inputs.experimental) statsParts.push(theme.bold(theme.fg(\"warning\", \"xp\")));\n\t\tlines.push(...this.renderBand(statsParts, undefined, width));\n\t\tconst cacheParts = [theme.fg(\"dim\", `Cache read ${formatTokens(inputs.cacheRead)}`)];\n\t\tif (inputs.cacheWrite) cacheParts.push(theme.fg(\"dim\", `Cache write ${formatTokens(inputs.cacheWrite)}`));\n\t\tcacheParts.push(\n\t\t\ttheme.fg(\n\t\t\t\t\"dim\",\n\t\t\t\t`Hit ${inputs.latestCacheHitRate === undefined ? \"—\" : `${inputs.latestCacheHitRate.toFixed(1)}%`}`,\n\t\t\t),\n\t\t);\n\t\tlines.push(...this.renderBand(cacheParts, theme.fg(\"dim\", \"/settings\"), width));\n\n\t\t// Add extension statuses on a single line, sorted by key alphabetically\n\t\tif (inputs.extensionStatuses.length) {\n\t\t\t// Truncate to terminal width with dim ellipsis for consistency with footer style\n\t\t\tlines.push(truncateToWidth(inputs.extensionStatuses.join(\" \"), width, theme.fg(\"dim\", \"...\")));\n\t\t}\n\t\treturn lines;\n\t}\n\n\tprivate renderBand(fields: string[], right: string | undefined, width: number): string[] {\n\t\tconst lines: string[] = [];\n\t\tlet line = \"\";\n\t\tfor (const field of fields) {\n\t\t\tif (line && visibleWidth(`${line} · ${field}`) > width) {\n\t\t\t\tlines.push(line);\n\t\t\t\tline = \"\";\n\t\t\t}\n\t\t\tif (visibleWidth(field) > width) {\n\t\t\t\tconst wrapped = wrapTextWithAnsi(field, width);\n\t\t\t\tlines.push(...wrapped.slice(0, -1));\n\t\t\t\tline = wrapped.at(-1) ?? \"\";\n\t\t\t} else line = line ? `${line} · ${field}` : field;\n\t\t}\n\t\tif (right) {\n\t\t\tif (line && visibleWidth(line) + 2 + visibleWidth(right) <= width) {\n\t\t\t\tline += \" \".repeat(width - visibleWidth(line) - visibleWidth(right)) + right;\n\t\t\t} else {\n\t\t\t\tif (line) lines.push(line);\n\t\t\t\tconst wrapped = wrapTextWithAnsi(right, width);\n\t\t\t\tlines.push(...wrapped.slice(0, -1));\n\t\t\t\tline = wrapped.at(-1) ?? \"\";\n\t\t\t}\n\t\t}\n\t\tif (line) lines.push(line);\n\t\treturn lines.map((rendered) => truncateToWidth(rendered, width, \"\"));\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/mermaid.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAU/C,UAAU,yBAAyB;IAClC,OAAO,EAAE,MAAM,oBAAoB,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;CACd;AA+CD,uGAAuG;AACvG,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,yBAAyB,GAAG,mBAAmB,CA8FxG"}
1
+ {"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/mermaid.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAU/C,UAAU,yBAAyB;IAClC,OAAO,EAAE,MAAM,oBAAoB,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;CACd;AA+CD,uGAAuG;AACvG,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,yBAAyB,GAAG,mBAAmB,CAuGxG"}
@@ -123,13 +123,20 @@ export function createMermaidMarkdownTransformer(options) {
123
123
  }
124
124
  return (parts
125
125
  .map(({ raw, art }) => {
126
- if (!art || art.width > context.availableWidth)
126
+ if (!art)
127
127
  return raw;
128
+ const withWarning = (warning) => {
129
+ const styled = options.theme ? options.theme.fg("warning", warning) : warning;
130
+ return `${raw}\n${codeSpan(styled)} \n`;
131
+ };
128
132
  if (!context.isStreaming && art.warnings.length > 0) {
129
133
  const suffix = art.warnings.length > 1 ? ` (+${art.warnings.length - 1} more)` : "";
130
- const warning = `Mermaid diagram not rendered: ${art.warnings[0]}${suffix}`;
131
- const styledWarning = options.theme ? options.theme.fg("warning", warning) : warning;
132
- return `${raw}\n${codeSpan(styledWarning)} \n`;
134
+ return withWarning(`Mermaid diagram not rendered: ${art.warnings[0]}${suffix}`);
135
+ }
136
+ if (art.width > context.availableWidth) {
137
+ return context.isStreaming
138
+ ? raw
139
+ : withWarning(`Mermaid diagram not rendered: needs ${art.width} columns, ${context.availableWidth} available`);
133
140
  }
134
141
  const lines = options.theme ? themedLines(art, options.theme) : art.plain;
135
142
  // Markdown hard breaks keep every diagram row on its own line.