@humain/humain-code 0.8.3 → 0.8.5

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 (926) hide show
  1. package/CHANGELOG.md +147 -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-2RXTZK2V.js +177 -0
  10. package/dist/bundle/chunks/{chunk-2XD7TLKB.js → chunk-3OOOEJV4.js} +16 -16
  11. package/dist/bundle/chunks/chunk-3RXT35Y3.js +3 -0
  12. package/dist/bundle/chunks/{chunk-MPRAQ6ZI.js → chunk-4LGBXPUD.js} +1 -1
  13. package/dist/bundle/chunks/chunk-4SL6URR3.js +90 -0
  14. package/dist/bundle/chunks/{chunk-AW24RHGJ.js → chunk-53DWQSBC.js} +4 -4
  15. package/dist/bundle/chunks/{chunk-LSRXA7OS.js → chunk-5C5K4EVJ.js} +3 -3
  16. package/dist/bundle/chunks/{chunk-2JNJJ6SZ.js → chunk-5KUCY54O.js} +3 -3
  17. package/dist/bundle/chunks/{chunk-4TDNOR36.js → chunk-625QJSFJ.js} +1 -1
  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-7XRMMCKG.js +2477 -0
  21. package/dist/bundle/chunks/{chunk-R2KD2HFT.js → chunk-7YB3HRRN.js} +83 -196
  22. package/dist/bundle/chunks/{chunk-DCXHRP6C.js → chunk-A2UZYK23.js} +13 -13
  23. package/dist/bundle/chunks/chunk-A5ZMBTTM.js +12 -0
  24. package/dist/bundle/chunks/{chunk-JKX5EGOT.js → chunk-AER66CNP.js} +13 -13
  25. package/dist/bundle/chunks/chunk-B3FT6L6S.js +131 -0
  26. package/dist/bundle/chunks/{chunk-VSXVZVBE.js → chunk-BDNX23GT.js} +433 -412
  27. package/dist/bundle/chunks/chunk-BIC5BSNX.js +13 -0
  28. package/dist/bundle/chunks/{chunk-JSHKS7VH.js → chunk-BNZZJ4LO.js} +1 -1
  29. package/dist/bundle/chunks/{chunk-4MKATHT2.js → chunk-CG43CMFH.js} +1 -1
  30. package/dist/bundle/chunks/{chunk-VFLVWPLZ.js → chunk-CKFLQGJN.js} +20 -16
  31. package/dist/bundle/chunks/{chunk-7LSTTCSC.js → chunk-COZTJAOY.js} +348 -177
  32. package/dist/bundle/chunks/chunk-D4UCXXDP.js +115 -0
  33. package/dist/bundle/chunks/{chunk-HQMUDHC3.js → chunk-D6ZWWDW5.js} +6 -5
  34. package/dist/bundle/chunks/{chunk-MUN4ZZZP.js → chunk-EWPEY4F4.js} +1341 -1366
  35. package/dist/bundle/chunks/{chunk-FJIISX5W.js → chunk-F74XLJPC.js} +195 -192
  36. package/dist/bundle/chunks/chunk-FDRBTGFJ.js +4 -0
  37. package/dist/bundle/chunks/chunk-FHP5BULR.js +5 -0
  38. package/dist/bundle/chunks/{chunk-E4VUW4RI.js → chunk-FLWO3H5J.js} +12 -12
  39. package/dist/bundle/chunks/{chunk-KLSRGGOH.js → chunk-G2PFPQX7.js} +2 -2
  40. package/dist/bundle/chunks/chunk-GMPJWLZS.js +57 -0
  41. package/dist/bundle/chunks/{chunk-M5TVWJ5T.js → chunk-H35P7ROY.js} +462 -441
  42. package/dist/bundle/chunks/chunk-HCHCYBNK.js +2 -0
  43. package/dist/bundle/chunks/{chunk-7WE77IE3.js → chunk-HRNYDRL7.js} +1 -1
  44. package/dist/bundle/chunks/chunk-HWFAAGYK.js +23 -0
  45. package/dist/bundle/chunks/{chunk-PVNXN2TC.js → chunk-II5C7G67.js} +1 -1
  46. package/dist/bundle/chunks/{chunk-F2H47FRF.js → chunk-IMRZP5SC.js} +182 -137
  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-N3W4ALAM.js +1151 -0
  60. package/dist/bundle/chunks/{chunk-6HTHDVJC.js → chunk-NPVRWPGX.js} +1 -1
  61. package/dist/bundle/chunks/{chunk-BRSLXHED.js → chunk-O44A4E4K.js} +1 -1
  62. package/dist/bundle/chunks/{chunk-T2ZGMEMV.js → chunk-OADQOW67.js} +175 -260
  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-SASR4VNV.js +17 -0
  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-4GB7A76U.js → chunk-VWUEKLRH.js} +225 -348
  80. package/dist/bundle/chunks/{chunk-JX6YIPNK.js → chunk-WCKS2DPT.js} +1 -1
  81. package/dist/bundle/chunks/chunk-XGOJCV6Z.js +2 -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-2RC4CJNV.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-3DAGUOYC.js} +2 -2
  89. package/dist/bundle/chunks/{dist-I6CI3CG5.js → dist-K4QIXV5O.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-EH7X36SK.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-J6QTLBTH.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-OHNEKTFB.js} +6 -6
  106. package/dist/bundle/chunks/interactive-mode-ZREVRX7W.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-6FVRJTM3.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/bug-report.d.ts +24 -1
  203. package/dist/core/bug-report.d.ts.map +1 -1
  204. package/dist/core/bug-report.js +216 -19
  205. package/dist/core/bug-report.js.map +1 -1
  206. package/dist/core/compaction/branch-summarization.d.ts +2 -2
  207. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  208. package/dist/core/compaction/branch-summarization.js +9 -15
  209. package/dist/core/compaction/branch-summarization.js.map +1 -1
  210. package/dist/core/compaction/compaction.d.ts.map +1 -1
  211. package/dist/core/compaction/compaction.js +3 -0
  212. package/dist/core/compaction/compaction.js.map +1 -1
  213. package/dist/core/export-html/index.d.ts.map +1 -1
  214. package/dist/core/export-html/index.js +12 -10
  215. package/dist/core/export-html/index.js.map +1 -1
  216. package/dist/core/export-html/template.js +23 -1
  217. package/dist/core/extensions/containment.d.ts +26 -0
  218. package/dist/core/extensions/containment.d.ts.map +1 -0
  219. package/dist/core/extensions/containment.js +66 -0
  220. package/dist/core/extensions/containment.js.map +1 -0
  221. package/dist/core/extensions/loader.d.ts.map +1 -1
  222. package/dist/core/extensions/loader.js +65 -7
  223. package/dist/core/extensions/loader.js.map +1 -1
  224. package/dist/core/extensions/runner.d.ts +2 -1
  225. package/dist/core/extensions/runner.d.ts.map +1 -1
  226. package/dist/core/extensions/runner.js +68 -12
  227. package/dist/core/extensions/runner.js.map +1 -1
  228. package/dist/core/extensions/types.d.ts +14 -3
  229. package/dist/core/extensions/types.d.ts.map +1 -1
  230. package/dist/core/extensions/types.js.map +1 -1
  231. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  232. package/dist/core/extensions/wrapper.js +4 -1
  233. package/dist/core/extensions/wrapper.js.map +1 -1
  234. package/dist/core/footer-data-provider.d.ts.map +1 -1
  235. package/dist/core/footer-data-provider.js +2 -4
  236. package/dist/core/footer-data-provider.js.map +1 -1
  237. package/dist/core/http-dispatcher.d.ts +5 -2
  238. package/dist/core/http-dispatcher.d.ts.map +1 -1
  239. package/dist/core/http-dispatcher.js +6 -3
  240. package/dist/core/http-dispatcher.js.map +1 -1
  241. package/dist/core/keybindings.d.ts +20 -0
  242. package/dist/core/keybindings.d.ts.map +1 -1
  243. package/dist/core/keybindings.js +4 -1
  244. package/dist/core/keybindings.js.map +1 -1
  245. package/dist/core/mcp-servers.d.ts +29 -0
  246. package/dist/core/mcp-servers.d.ts.map +1 -1
  247. package/dist/core/mcp-servers.js +63 -17
  248. package/dist/core/mcp-servers.js.map +1 -1
  249. package/dist/core/messages.d.ts +4 -0
  250. package/dist/core/messages.d.ts.map +1 -1
  251. package/dist/core/messages.js +10 -2
  252. package/dist/core/messages.js.map +1 -1
  253. package/dist/core/model-config.d.ts +36 -0
  254. package/dist/core/model-config.d.ts.map +1 -1
  255. package/dist/core/model-resolver.js +1 -1
  256. package/dist/core/model-resolver.js.map +1 -1
  257. package/dist/core/model-runtime.d.ts.map +1 -1
  258. package/dist/core/model-runtime.js +6 -2
  259. package/dist/core/model-runtime.js.map +1 -1
  260. package/dist/core/nested-tool-calls.d.ts +6 -5
  261. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  262. package/dist/core/nested-tool-calls.js +1 -3
  263. package/dist/core/nested-tool-calls.js.map +1 -1
  264. package/dist/core/os-secret-store.js +1 -1
  265. package/dist/core/os-secret-store.js.map +1 -1
  266. package/dist/core/package-manager.d.ts +3 -1
  267. package/dist/core/package-manager.d.ts.map +1 -1
  268. package/dist/core/package-manager.js +25 -4
  269. package/dist/core/package-manager.js.map +1 -1
  270. package/dist/core/pi-ai-schemas.d.ts +4 -0
  271. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  272. package/dist/core/project-trust.d.ts.map +1 -1
  273. package/dist/core/project-trust.js +1 -1
  274. package/dist/core/project-trust.js.map +1 -1
  275. package/dist/core/provider-composer.d.ts +1 -0
  276. package/dist/core/provider-composer.d.ts.map +1 -1
  277. package/dist/core/provider-composer.js +1 -0
  278. package/dist/core/provider-composer.js.map +1 -1
  279. package/dist/core/resolve-config-value.d.ts +4 -0
  280. package/dist/core/resolve-config-value.d.ts.map +1 -1
  281. package/dist/core/resolve-config-value.js +14 -3
  282. package/dist/core/resolve-config-value.js.map +1 -1
  283. package/dist/core/resource-loader.d.ts.map +1 -1
  284. package/dist/core/resource-loader.js +40 -2
  285. package/dist/core/resource-loader.js.map +1 -1
  286. package/dist/core/runtime-credentials.d.ts.map +1 -1
  287. package/dist/core/runtime-credentials.js +11 -7
  288. package/dist/core/runtime-credentials.js.map +1 -1
  289. package/dist/core/sdk.d.ts.map +1 -1
  290. package/dist/core/sdk.js +8 -4
  291. package/dist/core/sdk.js.map +1 -1
  292. package/dist/core/session-manager.d.ts +22 -1
  293. package/dist/core/session-manager.d.ts.map +1 -1
  294. package/dist/core/session-manager.js +227 -37
  295. package/dist/core/session-manager.js.map +1 -1
  296. package/dist/core/settings-defaults.d.ts +10 -1
  297. package/dist/core/settings-defaults.d.ts.map +1 -1
  298. package/dist/core/settings-defaults.js +7 -1
  299. package/dist/core/settings-defaults.js.map +1 -1
  300. package/dist/core/settings-manager.d.ts +14 -4
  301. package/dist/core/settings-manager.d.ts.map +1 -1
  302. package/dist/core/settings-manager.js +48 -15
  303. package/dist/core/settings-manager.js.map +1 -1
  304. package/dist/core/settings-schema.d.ts +20 -2
  305. package/dist/core/settings-schema.d.ts.map +1 -1
  306. package/dist/core/settings-schema.js +27 -4
  307. package/dist/core/settings-schema.js.map +1 -1
  308. package/dist/core/slash-commands.d.ts.map +1 -1
  309. package/dist/core/slash-commands.js +2 -0
  310. package/dist/core/slash-commands.js.map +1 -1
  311. package/dist/core/tools/bash-jobs.js +2 -2
  312. package/dist/core/tools/bash-jobs.js.map +1 -1
  313. package/dist/core/tools/bash.d.ts +3 -0
  314. package/dist/core/tools/bash.d.ts.map +1 -1
  315. package/dist/core/tools/bash.js +78 -46
  316. package/dist/core/tools/bash.js.map +1 -1
  317. package/dist/core/tools/edit-diff.d.ts +7 -1
  318. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  319. package/dist/core/tools/edit-diff.js +139 -75
  320. package/dist/core/tools/edit-diff.js.map +1 -1
  321. package/dist/core/tools/edit.d.ts.map +1 -1
  322. package/dist/core/tools/edit.js +4 -1
  323. package/dist/core/tools/edit.js.map +1 -1
  324. package/dist/core/tools/output-accumulator.d.ts +21 -6
  325. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  326. package/dist/core/tools/output-accumulator.js +90 -76
  327. package/dist/core/tools/output-accumulator.js.map +1 -1
  328. package/dist/core/tools/render-utils.d.ts +7 -2
  329. package/dist/core/tools/render-utils.d.ts.map +1 -1
  330. package/dist/core/tools/render-utils.js +14 -1
  331. package/dist/core/tools/render-utils.js.map +1 -1
  332. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  333. package/dist/core/tools/renderers/bash.js +9 -3
  334. package/dist/core/tools/renderers/bash.js.map +1 -1
  335. package/dist/core/tools/truncate.d.ts +1 -1
  336. package/dist/core/tools/truncate.d.ts.map +1 -1
  337. package/dist/core/tools/truncate.js +16 -7
  338. package/dist/core/tools/truncate.js.map +1 -1
  339. package/dist/core/tools/write.d.ts.map +1 -1
  340. package/dist/core/tools/write.js +2 -0
  341. package/dist/core/tools/write.js.map +1 -1
  342. package/dist/core/trust-manager.d.ts +2 -0
  343. package/dist/core/trust-manager.d.ts.map +1 -1
  344. package/dist/core/trust-manager.js +5 -4
  345. package/dist/core/trust-manager.js.map +1 -1
  346. package/dist/core/usage-totals.d.ts.map +1 -1
  347. package/dist/core/usage-totals.js +3 -0
  348. package/dist/core/usage-totals.js.map +1 -1
  349. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  350. package/dist/extensions/codemode/execute.js +64 -20
  351. package/dist/extensions/codemode/execute.js.map +1 -1
  352. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  353. package/dist/extensions/codemode/renderer.js +8 -3
  354. package/dist/extensions/codemode/renderer.js.map +1 -1
  355. package/dist/extensions/codemode/tool.d.ts +5 -0
  356. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  357. package/dist/extensions/codemode/tool.js.map +1 -1
  358. package/dist/extensions/llama/client.d.ts.map +1 -1
  359. package/dist/extensions/llama/client.js +3 -13
  360. package/dist/extensions/llama/client.js.map +1 -1
  361. package/dist/extensions/llama/ui.d.ts.map +1 -1
  362. package/dist/extensions/llama/ui.js +2 -1
  363. package/dist/extensions/llama/ui.js.map +1 -1
  364. package/dist/extensions/mcp/cli.d.ts +7 -0
  365. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  366. package/dist/extensions/mcp/cli.js +35 -8
  367. package/dist/extensions/mcp/cli.js.map +1 -1
  368. package/dist/extensions/mcp/config.d.ts +33 -0
  369. package/dist/extensions/mcp/config.d.ts.map +1 -1
  370. package/dist/extensions/mcp/config.js +11 -2
  371. package/dist/extensions/mcp/config.js.map +1 -1
  372. package/dist/extensions/mcp/index.d.ts +8 -0
  373. package/dist/extensions/mcp/index.d.ts.map +1 -1
  374. package/dist/extensions/mcp/index.js +16 -0
  375. package/dist/extensions/mcp/index.js.map +1 -1
  376. package/dist/extensions/mcp/resources.d.ts +1 -1
  377. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  378. package/dist/extensions/mcp/resources.js +4 -3
  379. package/dist/extensions/mcp/resources.js.map +1 -1
  380. package/dist/extensions/mcp/runtime.d.ts +1 -1
  381. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  382. package/dist/extensions/mcp/runtime.js +15 -14
  383. package/dist/extensions/mcp/runtime.js.map +1 -1
  384. package/dist/extensions/mcp/tools.d.ts +1 -24
  385. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  386. package/dist/extensions/mcp/tools.js +10 -163
  387. package/dist/extensions/mcp/tools.js.map +1 -1
  388. package/dist/humain/ask-user-question/index.d.ts +4 -0
  389. package/dist/humain/ask-user-question/index.d.ts.map +1 -0
  390. package/dist/humain/ask-user-question/index.js +18 -0
  391. package/dist/humain/ask-user-question/index.js.map +1 -0
  392. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts +38 -0
  393. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts.map +1 -0
  394. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js +97 -0
  395. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js.map +1 -0
  396. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts +41 -0
  397. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts.map +1 -0
  398. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js +441 -0
  399. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js.map +1 -0
  400. package/dist/humain/ask-user-question/vendor/ask/config.d.ts +39 -0
  401. package/dist/humain/ask-user-question/vendor/ask/config.d.ts.map +1 -0
  402. package/dist/humain/ask-user-question/vendor/ask/config.js +95 -0
  403. package/dist/humain/ask-user-question/vendor/ask/config.js.map +1 -0
  404. package/dist/humain/ask-user-question/vendor/ask/events.d.ts +132 -0
  405. package/dist/humain/ask-user-question/vendor/ask/events.d.ts.map +1 -0
  406. package/dist/humain/ask-user-question/vendor/ask/events.js +50 -0
  407. package/dist/humain/ask-user-question/vendor/ask/events.js.map +1 -0
  408. package/dist/humain/ask-user-question/vendor/ask/index.d.ts +5 -0
  409. package/dist/humain/ask-user-question/vendor/ask/index.d.ts.map +1 -0
  410. package/dist/humain/ask-user-question/vendor/ask/index.js +15 -0
  411. package/dist/humain/ask-user-question/vendor/ask/index.js.map +1 -0
  412. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts +81 -0
  413. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts.map +1 -0
  414. package/dist/humain/ask-user-question/vendor/ask/presentation.js +105 -0
  415. package/dist/humain/ask-user-question/vendor/ask/presentation.js.map +1 -0
  416. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts +28 -0
  417. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts.map +1 -0
  418. package/dist/humain/ask-user-question/vendor/ask/reconcile.js +45 -0
  419. package/dist/humain/ask-user-question/vendor/ask/reconcile.js.map +1 -0
  420. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts +41 -0
  421. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts.map +1 -0
  422. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js +166 -0
  423. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js.map +1 -0
  424. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts +46 -0
  425. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts.map +1 -0
  426. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js +247 -0
  427. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js.map +1 -0
  428. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts +11 -0
  429. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts.map +1 -0
  430. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js +56 -0
  431. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js.map +1 -0
  432. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts +6 -0
  433. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts.map +1 -0
  434. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js +10 -0
  435. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js.map +1 -0
  436. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts +57 -0
  437. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts.map +1 -0
  438. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js +357 -0
  439. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js.map +1 -0
  440. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts +112 -0
  441. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts.map +1 -0
  442. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js +240 -0
  443. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js.map +1 -0
  444. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts +87 -0
  445. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts.map +1 -0
  446. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js +79 -0
  447. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js.map +1 -0
  448. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts +22 -0
  449. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts.map +1 -0
  450. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js +2 -0
  451. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js.map +1 -0
  452. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts +27 -0
  453. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts.map +1 -0
  454. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js +48 -0
  455. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js.map +1 -0
  456. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts +13 -0
  457. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts.map +1 -0
  458. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js +15 -0
  459. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js.map +1 -0
  460. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts +14 -0
  461. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts.map +1 -0
  462. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js +96 -0
  463. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js.map +1 -0
  464. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts +58 -0
  465. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts.map +1 -0
  466. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js +310 -0
  467. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js.map +1 -0
  468. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts +68 -0
  469. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts.map +1 -0
  470. package/dist/humain/ask-user-question/vendor/ask/state/state.js +2 -0
  471. package/dist/humain/ask-user-question/vendor/ask/state/state.js.map +1 -0
  472. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts +24 -0
  473. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts.map +1 -0
  474. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js +114 -0
  475. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js.map +1 -0
  476. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts +18 -0
  477. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts.map +1 -0
  478. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js +29 -0
  479. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js.map +1 -0
  480. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts +41 -0
  481. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts.map +1 -0
  482. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js +99 -0
  483. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js.map +1 -0
  484. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts +37 -0
  485. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts.map +1 -0
  486. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js +70 -0
  487. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js.map +1 -0
  488. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts +129 -0
  489. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts.map +1 -0
  490. package/dist/humain/ask-user-question/vendor/ask/tool/types.js +76 -0
  491. package/dist/humain/ask-user-question/vendor/ask/tool/types.js.map +1 -0
  492. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts +21 -0
  493. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts.map +1 -0
  494. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js +49 -0
  495. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js.map +1 -0
  496. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts +23 -0
  497. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts.map +1 -0
  498. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js +16 -0
  499. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js.map +1 -0
  500. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts +21 -0
  501. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts.map +1 -0
  502. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js +49 -0
  503. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js.map +1 -0
  504. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts +43 -0
  505. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts.map +1 -0
  506. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js +130 -0
  507. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js.map +1 -0
  508. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts +45 -0
  509. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts.map +1 -0
  510. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js +39 -0
  511. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js.map +1 -0
  512. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts +36 -0
  513. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts.map +1 -0
  514. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js +72 -0
  515. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js.map +1 -0
  516. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts +61 -0
  517. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts.map +1 -0
  518. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js +108 -0
  519. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js.map +1 -0
  520. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts +39 -0
  521. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts.map +1 -0
  522. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js +76 -0
  523. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js.map +1 -0
  524. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts +123 -0
  525. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts.map +1 -0
  526. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js +180 -0
  527. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js.map +1 -0
  528. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts +108 -0
  529. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts.map +1 -0
  530. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js +235 -0
  531. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js.map +1 -0
  532. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts +37 -0
  533. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts.map +1 -0
  534. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js +47 -0
  535. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js.map +1 -0
  536. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts +31 -0
  537. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts.map +1 -0
  538. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js +35 -0
  539. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js.map +1 -0
  540. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts +124 -0
  541. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts.map +1 -0
  542. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js +205 -0
  543. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js.map +1 -0
  544. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts +83 -0
  545. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts.map +1 -0
  546. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js +186 -0
  547. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js.map +1 -0
  548. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts +47 -0
  549. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts.map +1 -0
  550. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js +48 -0
  551. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js.map +1 -0
  552. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts +58 -0
  553. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts.map +1 -0
  554. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js +84 -0
  555. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js.map +1 -0
  556. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts +20 -0
  557. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts.map +1 -0
  558. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js +55 -0
  559. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js.map +1 -0
  560. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts +23 -0
  561. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts.map +1 -0
  562. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js +2 -0
  563. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js.map +1 -0
  564. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts +15 -0
  565. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts.map +1 -0
  566. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js +2 -0
  567. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js.map +1 -0
  568. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts +98 -0
  569. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts.map +1 -0
  570. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js +248 -0
  571. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js.map +1 -0
  572. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts +23 -0
  573. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts.map +1 -0
  574. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js +131 -0
  575. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js.map +1 -0
  576. package/dist/humain/ask-user-question/vendor/config/config.d.ts +132 -0
  577. package/dist/humain/ask-user-question/vendor/config/config.d.ts.map +1 -0
  578. package/dist/humain/ask-user-question/vendor/config/config.js +286 -0
  579. package/dist/humain/ask-user-question/vendor/config/config.js.map +1 -0
  580. package/dist/humain/ask-user-question/vendor/config/index.d.ts +2 -0
  581. package/dist/humain/ask-user-question/vendor/config/index.d.ts.map +1 -0
  582. package/dist/humain/ask-user-question/vendor/config/index.js +2 -0
  583. package/dist/humain/ask-user-question/vendor/config/index.js.map +1 -0
  584. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts +64 -0
  585. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts.map +1 -0
  586. package/dist/humain/ask-user-question/vendor/i18n/i18n.js +185 -0
  587. package/dist/humain/ask-user-question/vendor/i18n/i18n.js.map +1 -0
  588. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts +44 -0
  589. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts.map +1 -0
  590. package/dist/humain/ask-user-question/vendor/i18n/loader.js +55 -0
  591. package/dist/humain/ask-user-question/vendor/i18n/loader.js.map +1 -0
  592. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +26 -16
  593. package/dist/humain/brand-logo.d.ts +2 -0
  594. package/dist/humain/brand-logo.d.ts.map +1 -1
  595. package/dist/humain/brand-logo.js +4 -0
  596. package/dist/humain/brand-logo.js.map +1 -1
  597. package/dist/humain/bundled-extension-names.d.ts +1 -0
  598. package/dist/humain/bundled-extension-names.d.ts.map +1 -1
  599. package/dist/humain/bundled-extension-names.js +1 -0
  600. package/dist/humain/bundled-extension-names.js.map +1 -1
  601. package/dist/humain/checklist/footer-progress.d.ts +7 -0
  602. package/dist/humain/checklist/footer-progress.d.ts.map +1 -0
  603. package/dist/humain/checklist/footer-progress.js +15 -0
  604. package/dist/humain/checklist/footer-progress.js.map +1 -0
  605. package/dist/humain/checklist/glyphs.d.ts +7 -0
  606. package/dist/humain/checklist/glyphs.d.ts.map +1 -0
  607. package/dist/humain/checklist/glyphs.js +8 -0
  608. package/dist/humain/checklist/glyphs.js.map +1 -0
  609. package/dist/humain/checklist/index.d.ts +6 -0
  610. package/dist/humain/checklist/index.d.ts.map +1 -0
  611. package/dist/humain/checklist/index.js +37 -0
  612. package/dist/humain/checklist/index.js.map +1 -0
  613. package/dist/humain/checklist/progress.d.ts +37 -0
  614. package/dist/humain/checklist/progress.d.ts.map +1 -0
  615. package/dist/humain/checklist/progress.js +234 -0
  616. package/dist/humain/checklist/progress.js.map +1 -0
  617. package/dist/humain/checklist/projector.d.ts +53 -0
  618. package/dist/humain/checklist/projector.d.ts.map +1 -0
  619. package/dist/humain/checklist/projector.js +198 -0
  620. package/dist/humain/checklist/projector.js.map +1 -0
  621. package/dist/humain/checklist/sidebar.d.ts +18 -0
  622. package/dist/humain/checklist/sidebar.d.ts.map +1 -0
  623. package/dist/humain/checklist/sidebar.js +38 -0
  624. package/dist/humain/checklist/sidebar.js.map +1 -0
  625. package/dist/humain/checklist/status-segment.d.ts +19 -0
  626. package/dist/humain/checklist/status-segment.d.ts.map +1 -0
  627. package/dist/humain/checklist/status-segment.js +59 -0
  628. package/dist/humain/checklist/status-segment.js.map +1 -0
  629. package/dist/humain/checklist/vendor/add-task-dialog.d.ts +54 -0
  630. package/dist/humain/checklist/vendor/add-task-dialog.d.ts.map +1 -0
  631. package/dist/humain/checklist/vendor/add-task-dialog.js +238 -0
  632. package/dist/humain/checklist/vendor/add-task-dialog.js.map +1 -0
  633. package/dist/humain/checklist/vendor/commands.d.ts +38 -0
  634. package/dist/humain/checklist/vendor/commands.d.ts.map +1 -0
  635. package/dist/humain/checklist/vendor/commands.js +205 -0
  636. package/dist/humain/checklist/vendor/commands.js.map +1 -0
  637. package/dist/humain/checklist/vendor/index.d.ts +3 -0
  638. package/dist/humain/checklist/vendor/index.d.ts.map +1 -0
  639. package/dist/humain/checklist/vendor/index.js +276 -0
  640. package/dist/humain/checklist/vendor/index.js.map +1 -0
  641. package/dist/humain/checklist/vendor/render.d.ts +97 -0
  642. package/dist/humain/checklist/vendor/render.d.ts.map +1 -0
  643. package/dist/humain/checklist/vendor/render.js +354 -0
  644. package/dist/humain/checklist/vendor/render.js.map +1 -0
  645. package/dist/humain/checklist/vendor/settings.d.ts +11 -0
  646. package/dist/humain/checklist/vendor/settings.d.ts.map +1 -0
  647. package/dist/humain/checklist/vendor/settings.js +8 -0
  648. package/dist/humain/checklist/vendor/settings.js.map +1 -0
  649. package/dist/humain/checklist/vendor/store.d.ts +120 -0
  650. package/dist/humain/checklist/vendor/store.d.ts.map +1 -0
  651. package/dist/humain/checklist/vendor/store.js +990 -0
  652. package/dist/humain/checklist/vendor/store.js.map +1 -0
  653. package/dist/humain/checklist/vendor/tools.d.ts +21 -0
  654. package/dist/humain/checklist/vendor/tools.d.ts.map +1 -0
  655. package/dist/humain/checklist/vendor/tools.js +162 -0
  656. package/dist/humain/checklist/vendor/tools.js.map +1 -0
  657. package/dist/humain/checklist/vendor/types.d.ts +188 -0
  658. package/dist/humain/checklist/vendor/types.d.ts.map +1 -0
  659. package/dist/humain/checklist/vendor/types.js +32 -0
  660. package/dist/humain/checklist/vendor/types.js.map +1 -0
  661. package/dist/humain/flow-loader.d.ts.map +1 -1
  662. package/dist/humain/flow-loader.js +31 -5
  663. package/dist/humain/flow-loader.js.map +1 -1
  664. package/dist/humain/gateway/catalog.d.ts +1 -0
  665. package/dist/humain/gateway/catalog.d.ts.map +1 -1
  666. package/dist/humain/gateway/catalog.js +1 -0
  667. package/dist/humain/gateway/catalog.js.map +1 -1
  668. package/dist/humain/gateway/client.d.ts +1 -0
  669. package/dist/humain/gateway/client.d.ts.map +1 -1
  670. package/dist/humain/gateway/client.js +8 -1
  671. package/dist/humain/gateway/client.js.map +1 -1
  672. package/dist/humain/gateway/http.d.ts.map +1 -1
  673. package/dist/humain/gateway/http.js +11 -3
  674. package/dist/humain/gateway/http.js.map +1 -1
  675. package/dist/humain/gateway/images.d.ts +3 -0
  676. package/dist/humain/gateway/images.d.ts.map +1 -0
  677. package/dist/humain/gateway/images.js +73 -0
  678. package/dist/humain/gateway/images.js.map +1 -0
  679. package/dist/humain/gateway/provider.js +1 -1
  680. package/dist/humain/gateway/provider.js.map +1 -1
  681. package/dist/humain/hcode/account-store.d.ts.map +1 -1
  682. package/dist/humain/hcode/account-store.js +3 -1
  683. package/dist/humain/hcode/account-store.js.map +1 -1
  684. package/dist/humain/hcode/account.d.ts.map +1 -1
  685. package/dist/humain/hcode/account.js +23 -13
  686. package/dist/humain/hcode/account.js.map +1 -1
  687. package/dist/humain/hcode/images.d.ts.map +1 -1
  688. package/dist/humain/hcode/images.js +19 -13
  689. package/dist/humain/hcode/images.js.map +1 -1
  690. package/dist/humain/hcode/login-failure.d.ts +1 -0
  691. package/dist/humain/hcode/login-failure.d.ts.map +1 -1
  692. package/dist/humain/hcode/login-failure.js +1 -0
  693. package/dist/humain/hcode/login-failure.js.map +1 -1
  694. package/dist/humain/hcode/provider.d.ts.map +1 -1
  695. package/dist/humain/hcode/provider.js +2 -1
  696. package/dist/humain/hcode/provider.js.map +1 -1
  697. package/dist/humain/hcode/run-credential.d.ts +1 -0
  698. package/dist/humain/hcode/run-credential.d.ts.map +1 -1
  699. package/dist/humain/hcode/run-credential.js +12 -4
  700. package/dist/humain/hcode/run-credential.js.map +1 -1
  701. package/dist/humain/index.d.ts.map +1 -1
  702. package/dist/humain/index.js +4 -0
  703. package/dist/humain/index.js.map +1 -1
  704. package/dist/humain/node-provider.d.ts.map +1 -1
  705. package/dist/humain/node-provider.js +37 -8
  706. package/dist/humain/node-provider.js.map +1 -1
  707. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  708. package/dist/humain/web-access/vendor/index.js +11 -1
  709. package/dist/humain/web-access/vendor/index.js.map +1 -1
  710. package/dist/main.d.ts +1 -1
  711. package/dist/main.d.ts.map +1 -1
  712. package/dist/main.js +36 -26
  713. package/dist/main.js.map +1 -1
  714. package/dist/modes/interactive/bug-report.d.ts.map +1 -1
  715. package/dist/modes/interactive/bug-report.js +48 -12
  716. package/dist/modes/interactive/bug-report.js.map +1 -1
  717. package/dist/modes/interactive/chat-viewport.js +1 -1
  718. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  719. package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
  720. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  721. package/dist/modes/interactive/components/bash-execution.js +7 -4
  722. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  723. package/dist/modes/interactive/components/config-selector.js +1 -1
  724. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  725. package/dist/modes/interactive/components/custom-editor.d.ts +2 -0
  726. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  727. package/dist/modes/interactive/components/custom-editor.js +20 -1
  728. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  729. package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
  730. package/dist/modes/interactive/components/extension-editor.js +2 -2
  731. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  732. package/dist/modes/interactive/components/footer.d.ts +7 -0
  733. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  734. package/dist/modes/interactive/components/footer.js +74 -1
  735. package/dist/modes/interactive/components/footer.js.map +1 -1
  736. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  737. package/dist/modes/interactive/components/mermaid.js +11 -4
  738. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  739. package/dist/modes/interactive/components/model-selector.d.ts +2 -0
  740. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  741. package/dist/modes/interactive/components/model-selector.js +56 -8
  742. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  743. package/dist/modes/interactive/components/oauth-selector.d.ts +13 -1
  744. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  745. package/dist/modes/interactive/components/oauth-selector.js +10 -9
  746. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  747. package/dist/modes/interactive/components/session-selector.js +3 -3
  748. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  749. package/dist/modes/interactive/components/settings-selector.d.ts +4 -3
  750. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  751. package/dist/modes/interactive/components/settings-selector.js +83 -37
  752. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  753. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  754. package/dist/modes/interactive/components/settings-submenu.js +3 -3
  755. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  756. package/dist/modes/interactive/components/status-indicator.d.ts +18 -7
  757. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  758. package/dist/modes/interactive/components/status-indicator.js +70 -24
  759. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  760. package/dist/modes/interactive/components/status-line.d.ts +16 -0
  761. package/dist/modes/interactive/components/status-line.d.ts.map +1 -0
  762. package/dist/modes/interactive/components/status-line.js +51 -0
  763. package/dist/modes/interactive/components/status-line.js.map +1 -0
  764. package/dist/modes/interactive/components/tool-execution.d.ts +5 -0
  765. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  766. package/dist/modes/interactive/components/tool-execution.js +8 -1
  767. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  768. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  769. package/dist/modes/interactive/components/visual-truncate.js +11 -3
  770. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  771. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  772. package/dist/modes/interactive/external-editor.js +13 -3
  773. package/dist/modes/interactive/external-editor.js.map +1 -1
  774. package/dist/modes/interactive/interactive-mode.d.ts +20 -4
  775. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  776. package/dist/modes/interactive/interactive-mode.js +260 -154
  777. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  778. package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
  779. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
  780. package/dist/modes/interactive/program-status-reporter.js +4 -0
  781. package/dist/modes/interactive/program-status-reporter.js.map +1 -1
  782. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  783. package/dist/modes/interactive/session-share.js +9 -1
  784. package/dist/modes/interactive/session-share.js.map +1 -1
  785. package/dist/modes/print-mode.d.ts.map +1 -1
  786. package/dist/modes/print-mode.js +34 -7
  787. package/dist/modes/print-mode.js.map +1 -1
  788. package/dist/modes/rpc/jsonl.js +6 -5
  789. package/dist/modes/rpc/jsonl.js.map +1 -1
  790. package/dist/modes/rpc/rpc-client.d.ts +2 -0
  791. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  792. package/dist/modes/rpc/rpc-client.js +9 -2
  793. package/dist/modes/rpc/rpc-client.js.map +1 -1
  794. package/dist/modes/rpc/rpc-mode.d.ts +2 -1
  795. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  796. package/dist/modes/rpc/rpc-mode.js +113 -13
  797. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  798. package/dist/modes/rpc/rpc-types.d.ts +22 -1
  799. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  800. package/dist/modes/rpc/rpc-types.js.map +1 -1
  801. package/dist/modes/uncaught-errors.d.ts +20 -0
  802. package/dist/modes/uncaught-errors.d.ts.map +1 -0
  803. package/dist/modes/uncaught-errors.js +56 -0
  804. package/dist/modes/uncaught-errors.js.map +1 -0
  805. package/dist/package-manager-cli.d.ts.map +1 -1
  806. package/dist/package-manager-cli.js +10 -1
  807. package/dist/package-manager-cli.js.map +1 -1
  808. package/dist/utils/clipboard-image.js +1 -1
  809. package/dist/utils/clipboard-image.js.map +1 -1
  810. package/dist/utils/clipboard.js +2 -2
  811. package/dist/utils/clipboard.js.map +1 -1
  812. package/dist/utils/image-process.d.ts +5 -0
  813. package/dist/utils/image-process.d.ts.map +1 -1
  814. package/dist/utils/image-process.js +22 -4
  815. package/dist/utils/image-process.js.map +1 -1
  816. package/dist/utils/output-files.d.ts +44 -7
  817. package/dist/utils/output-files.d.ts.map +1 -1
  818. package/dist/utils/output-files.js +206 -12
  819. package/dist/utils/output-files.js.map +1 -1
  820. package/dist/utils/piped-stdin.d.ts +21 -0
  821. package/dist/utils/piped-stdin.d.ts.map +1 -0
  822. package/dist/utils/piped-stdin.js +60 -0
  823. package/dist/utils/piped-stdin.js.map +1 -0
  824. package/dist/utils/shell.d.ts +5 -2
  825. package/dist/utils/shell.d.ts.map +1 -1
  826. package/dist/utils/shell.js +77 -8
  827. package/dist/utils/shell.js.map +1 -1
  828. package/dist/utils/syntax-highlight.d.ts +33 -2
  829. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  830. package/dist/utils/syntax-highlight.js +77 -10
  831. package/dist/utils/syntax-highlight.js.map +1 -1
  832. package/dist/utils/tools-manager.d.ts +1 -0
  833. package/dist/utils/tools-manager.d.ts.map +1 -1
  834. package/dist/utils/tools-manager.js +9 -8
  835. package/dist/utils/tools-manager.js.map +1 -1
  836. package/dist/utils/wsl.d.ts +8 -2
  837. package/dist/utils/wsl.d.ts.map +1 -1
  838. package/dist/utils/wsl.js +12 -3
  839. package/dist/utils/wsl.js.map +1 -1
  840. package/docs/cli.md +39 -3
  841. package/docs/codemode.md +7 -3
  842. package/docs/compaction.md +1 -1
  843. package/docs/development.md +6 -0
  844. package/docs/environment-variables.md +3 -2
  845. package/docs/extensions.md +21 -5
  846. package/docs/flow.md +2 -0
  847. package/docs/humain-code.md +1 -1
  848. package/docs/keybindings.md +2 -0
  849. package/docs/llama-cpp.md +2 -2
  850. package/docs/message-types.md +1 -0
  851. package/docs/models-configuration.md +14 -3
  852. package/docs/models.md +29 -7
  853. package/docs/providers.md +20 -2
  854. package/docs/rpc-commands.md +25 -2
  855. package/docs/rpc.md +20 -0
  856. package/docs/run-preflight.md +2 -2
  857. package/docs/session-format.md +9 -0
  858. package/docs/settings.md +35 -5
  859. package/docs/shell-aliases.md +1 -1
  860. package/docs/slash-commands.md +3 -1
  861. package/docs/terminal-setup.md +25 -0
  862. package/docs/windows.md +2 -1
  863. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  864. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  865. package/examples/rpc-extension-ui.ts +8 -7
  866. package/npm-shrinkwrap.json +209 -180
  867. package/package.json +26 -20
  868. package/schemas/keybindings.schema.json +12 -0
  869. package/schemas/models.schema.json +20 -7
  870. package/schemas/settings.schema.json +43 -5
  871. package/src/coordination/UPSTREAM.md +27 -1
  872. package/src/coordination/upstream.json +3 -3
  873. package/src/humain/ask-user-question/UPSTREAM.md +31 -0
  874. package/src/humain/ask-user-question/upstream.json +258 -0
  875. package/src/humain/ask-user-question/vendor/ask/LICENSE +21 -0
  876. package/src/humain/ask-user-question/vendor/ask/locales/de.json +38 -0
  877. package/src/humain/ask-user-question/vendor/ask/locales/en.json +41 -0
  878. package/src/humain/ask-user-question/vendor/ask/locales/es.json +38 -0
  879. package/src/humain/ask-user-question/vendor/ask/locales/fr.json +38 -0
  880. package/src/humain/ask-user-question/vendor/ask/locales/pt-BR.json +38 -0
  881. package/src/humain/ask-user-question/vendor/ask/locales/pt.json +38 -0
  882. package/src/humain/ask-user-question/vendor/ask/locales/ru.json +38 -0
  883. package/src/humain/ask-user-question/vendor/ask/locales/uk.json +38 -0
  884. package/src/humain/ask-user-question/vendor/ask/locales/zh.json +40 -0
  885. package/src/humain/ask-user-question/vendor/config/LICENSE +21 -0
  886. package/src/humain/ask-user-question/vendor/i18n/LICENSE +21 -0
  887. package/src/humain/caveman/UPSTREAM.md +44 -11
  888. package/src/humain/caveman/upstream.json +3 -3
  889. package/src/humain/caveman/vendor/NOTICE +4 -0
  890. package/src/humain/web-access/UPSTREAM.md +8 -0
  891. package/dist/bundle/chunks/anthropic-messages-XFCDMGD6.js +0 -77
  892. package/dist/bundle/chunks/azure-openai-responses-F4KQM3NK.js +0 -15
  893. package/dist/bundle/chunks/bowser-DXKSTXFQ.js +0 -89
  894. package/dist/bundle/chunks/chunk-3E37CJCE.js +0 -34
  895. package/dist/bundle/chunks/chunk-3HVHETMU.js +0 -18
  896. package/dist/bundle/chunks/chunk-6JTCRCNF.js +0 -74
  897. package/dist/bundle/chunks/chunk-B3ZLWVDA.js +0 -80
  898. package/dist/bundle/chunks/chunk-F77J5EQZ.js +0 -3
  899. package/dist/bundle/chunks/chunk-GPLWWO5Q.js +0 -121
  900. package/dist/bundle/chunks/chunk-GV5OVRKK.js +0 -4
  901. package/dist/bundle/chunks/chunk-JBSWWCT5.js +0 -12
  902. package/dist/bundle/chunks/chunk-JWOPWHVH.js +0 -51
  903. package/dist/bundle/chunks/chunk-KRBELWQH.js +0 -7
  904. package/dist/bundle/chunks/chunk-PFBAIRCY.js +0 -56
  905. package/dist/bundle/chunks/chunk-Q5RKNQ2T.js +0 -73
  906. package/dist/bundle/chunks/chunk-QFDZEUFU.js +0 -12
  907. package/dist/bundle/chunks/chunk-SKCJ25SX.js +0 -24
  908. package/dist/bundle/chunks/chunk-UZOIHLNU.js +0 -23
  909. package/dist/bundle/chunks/chunk-YSWDFV2L.js +0 -11
  910. package/dist/bundle/chunks/chunk-YZMQXAJM.js +0 -8
  911. package/dist/bundle/chunks/chunk-ZAHVC5V2.js +0 -3591
  912. package/dist/bundle/chunks/entry-2GZ3PTWQ.js +0 -2
  913. package/dist/bundle/chunks/google-generative-ai-WIASMWS3.js +0 -22
  914. package/dist/bundle/chunks/google-vertex-WSPHRZIZ.js +0 -25
  915. package/dist/bundle/chunks/interactive-mode-3322RQEH.js +0 -5
  916. package/dist/bundle/chunks/mistral-conversations-7JYDDRUT.js +0 -43
  917. package/dist/bundle/chunks/openai-codex-responses-7PAML4NF.js +0 -102
  918. package/dist/bundle/chunks/openai-completions-UJDAIGTK.js +0 -87
  919. package/dist/bundle/chunks/openai-responses-2WNCE6AY.js +0 -26
  920. package/dist/bundle/chunks/openrouter-images-V3UCCO6X.js +0 -8
  921. package/dist/bundle/chunks/pi-messages-TQ7LJUNQ.js +0 -28
  922. package/dist/bundle/chunks/runtime-H7LYNKCZ.js +0 -2
  923. package/dist/bundle/chunks/session-picker-EYKCMFQR.js +0 -4
  924. package/dist/bundle/chunks/startup-ui-7ODOR34R.js +0 -3
  925. package/dist/bundle/chunks/typesafe-system-one-YP7GGN4C.js +0 -3
  926. package/dist/bundle/chunks/virtual-modules-47MGUPYN.js +0 -28
@@ -0,0 +1,180 @@
1
+ import { visibleWidth } from "@earendil-works/pi-tui";
2
+ import { BORDER_HORIZONTAL_OVERHEAD, BORDER_INNER_PADDING_HORIZONTAL } from "./preview-box-renderer.js";
3
+ /** Min terminal/pane width for the side-by-side layout to engage. */
4
+ export const PREVIEW_MIN_WIDTH = 100;
5
+ /** Visual gap between options column and preview column in side-by-side. */
6
+ export const PREVIEW_COLUMN_GAP = 2;
7
+ /** 1 col padding inside the preview column (between gap and `│`). */
8
+ export const PREVIEW_PADDING_LEFT = 1;
9
+ /** Empty rows between options and preview blocks in stacked (narrow) layout. */
10
+ export const STACKED_GAP_ROWS = 1;
11
+ /** Floor for the adaptive left column width — prevents collapse on short labels. */
12
+ export const MIN_LEFT = 30;
13
+ /** Ceiling ratio: left column never exceeds this fraction of pane width. */
14
+ export const MAX_LEFT_RATIO = 0.5;
15
+ /** Floor for the preview column width — prevents right-side collapse on narrow terminals. */
16
+ export const MIN_PREVIEW_WIDTH = 45;
17
+ /** visibleWidth(" ✔") = 2 (space + ✔ codepoint). Reserved on the longest-label measurement
18
+ * so a confirmed row never gets truncated when MIN_LEFT clamps the column. */
19
+ export const CONFIRMED_OVERHEAD = 2;
20
+ /**
21
+ * Decide layout mode from terminal + pane widths. Pure of inputs.
22
+ *
23
+ * The terminal-width gate is the AND check from the previous `preview-pane.ts` —
24
+ * lifted here so the decision is computed ONCE per render and threaded explicitly
25
+ * through `previewBlockHeight`. Removes the bug class where `previewBlockHeight`
26
+ * re-derived `sideBySide` from a column width (already < pane width post-split),
27
+ * capping height too short.
28
+ */
29
+ export function decideLayout(terminalWidth, paneWidth) {
30
+ return terminalWidth >= PREVIEW_MIN_WIDTH && paneWidth >= PREVIEW_MIN_WIDTH ? "side-by-side" : "stacked";
31
+ }
32
+ /**
33
+ * Compute the adaptive left column width from option labels.
34
+ * Pure function — deterministic for a given (items, totalForNumbering, paneWidth).
35
+ *
36
+ * Pipeline:
37
+ * 1. Measure: longest visible label width + prefix overhead + confirmed-mark overhead
38
+ * 2. Clamp: floor MIN_LEFT, ceiling paneWidth * MAX_LEFT_RATIO
39
+ * 3. Safety net: never exceed available = paneWidth - GAP - MIN_PREVIEW_WIDTH
40
+ */
41
+ export function adaptiveLeftWidth(items, totalForNumbering, paneWidth) {
42
+ const prefixW = String(Math.max(1, totalForNumbering)).length + 4; // digits + "❯ " + ". "
43
+ const confirmedOverhead = CONFIRMED_OVERHEAD; // visibleWidth(" ✔") = 2 (space + ✔ codepoint)
44
+ let maxLabel = 0;
45
+ for (const item of items) {
46
+ const w = visibleWidth(item.label);
47
+ if (w > maxLabel)
48
+ maxLabel = w;
49
+ }
50
+ const desired = maxLabel + prefixW + confirmedOverhead;
51
+ const ratioCapped = Math.min(desired, Math.floor(paneWidth * MAX_LEFT_RATIO));
52
+ const available = paneWidth - PREVIEW_COLUMN_GAP - MIN_PREVIEW_WIDTH;
53
+ return Math.max(MIN_LEFT, Math.min(ratioCapped, Math.max(1, available)));
54
+ }
55
+ /**
56
+ * Cross-tab maximum left-column width. Aggregates `adaptiveLeftWidth` over every tab
57
+ * and returns the widest result, so the options column stays stable on tab switch.
58
+ *
59
+ * Pure function — `tabs.length` MUST equal `itemsByTab.length`. Numbering uses
60
+ * `items.length` for every tab (the chat row slot that once added +1 on single-select
61
+ * has been removed).
62
+ * Floor is `MIN_LEFT` so an all-empty input still produces a usable column.
63
+ */
64
+ export function crossTabMaxLeftWidth(tabs, itemsByTab, paneWidth) {
65
+ let max = MIN_LEFT;
66
+ for (let i = 0; i < tabs.length; i++) {
67
+ const items = itemsByTab[i] ?? [];
68
+ const totalForNumbering = items.length;
69
+ const tabWidth = adaptiveLeftWidth(items, totalForNumbering, paneWidth);
70
+ if (tabWidth > max)
71
+ max = tabWidth;
72
+ }
73
+ return max;
74
+ }
75
+ /**
76
+ * Source-line probe: measures the widest source line across all options' previews.
77
+ * Returns 0 when no option carries a preview.
78
+ *
79
+ * V1 heuristic — works well for tree/table/heading/list content where source-line
80
+ * width ≈ rendered width. Paragraphs overstate (source width "wants" the full pane);
81
+ * the worst case is "donation does nothing useful" — fallback to the label-driven path.
82
+ * Upgrade path: replace with a render-width probe that invokes Markdown at a probe width.
83
+ *
84
+ * Pure function — O(total chars) per question; no Markdown invocation, no cache interaction.
85
+ */
86
+ export function previewSourceWidth(question) {
87
+ let max = 0;
88
+ for (const option of question.options) {
89
+ const text = option.preview;
90
+ if (!text)
91
+ continue;
92
+ for (const line of text.split("\n")) {
93
+ const w = visibleWidth(line);
94
+ if (w > max)
95
+ max = w;
96
+ }
97
+ }
98
+ return max;
99
+ }
100
+ /**
101
+ * Cross-tab/cross-option preview budget. Iterates all questions, computes each question's
102
+ * preview appetite via `previewSourceWidth`, adds box + padding overhead (5 cols), and
103
+ * returns the widest result. Floor is `MIN_PREVIEW_WIDTH` so a previewless question still
104
+ * reserves a usable column. Ceiling ensures the left column retains its `MIN_LEFT` floor.
105
+ *
106
+ * Pure function — same cross-tab max pattern as `crossTabMaxLeftWidth`.
107
+ */
108
+ export function crossTabPreviewBudget(questions, paneWidth) {
109
+ let max = MIN_PREVIEW_WIDTH;
110
+ for (const question of questions) {
111
+ const rawWidth = previewSourceWidth(question);
112
+ const capped = Math.min(rawWidth, paneWidth - PREVIEW_COLUMN_GAP - MIN_LEFT);
113
+ const budget = capped + BORDER_HORIZONTAL_OVERHEAD + 2 * BORDER_INNER_PADDING_HORIZONTAL + PREVIEW_PADDING_LEFT;
114
+ if (budget > max)
115
+ max = budget;
116
+ }
117
+ return max;
118
+ }
119
+ /**
120
+ * Cross-tab left-column width with slack donation. Combines the label-driven width
121
+ * (from `crossTabMaxLeftWidth`) with the slack donated by narrow previews.
122
+ *
123
+ * Pipeline:
124
+ * 1. `labelDriven` = `crossTabMaxLeftWidth(tabs, itemsByTab, paneWidth)`
125
+ * 2. `previewBudget` = `crossTabPreviewBudget(questions, paneWidth)`
126
+ * 3. `slackDonation` = `paneWidth − GAP − previewBudget`
127
+ * 4. Return `min(max(labelDriven, slackDonation), ceiling)` where `ceiling` is the
128
+ * tighter of the preview-width safety limit and `MAX_LEFT_RATIO`
129
+ *
130
+ * Invariants (hold at side-by-side widths, paneWidth ≥ PREVIEW_MIN_WIDTH — the only
131
+ * mode that consumes this value; narrower panes can pull both ceilings under MIN_LEFT):
132
+ * - Floor: result ≥ MIN_LEFT (ratioCeiling ≥ 50 once paneWidth ≥ 100)
133
+ * - Options cap: left column ≤ paneWidth × MAX_LEFT_RATIO
134
+ * - Preview floor: right column ≥ MIN_PREVIEW_WIDTH — enforced transitively by the
135
+ * MAX_LEFT_RATIO cap (right column keeps ≥ paneWidth/2 − GAP ≥ 48 cols);
136
+ * previewSafetyCeiling is defensive depth that binds only if MAX_LEFT_RATIO
137
+ * ever rises above ~0.53
138
+ * - Cross-tab stability: both reductions are tab-independent
139
+ * - Determinism: pure of (questions, itemsByTab, paneWidth)
140
+ *
141
+ * `crossTabMaxLeftWidth` is NOT replaced — it continues to exist as the primitive.
142
+ * Donation obeys the same `MAX_LEFT_RATIO` cap as the label-driven path; the preview
143
+ * composer right-aligns narrower boxes inside the remaining column.
144
+ */
145
+ export function crossTabLeftWidthWithDonation(tabs, itemsByTab, questions, paneWidth) {
146
+ const labelDriven = crossTabMaxLeftWidth(tabs, itemsByTab, paneWidth);
147
+ const previewBudget = crossTabPreviewBudget(questions, paneWidth);
148
+ const slackDonation = paneWidth - PREVIEW_COLUMN_GAP - previewBudget;
149
+ // At side-by-side widths the ratio ceiling is always the tighter bound
150
+ // (paneWidth/2 ≤ paneWidth − GAP − MIN_PREVIEW_WIDTH once paneWidth ≥ 94);
151
+ // previewSafetyCeiling stays as defensive depth should MAX_LEFT_RATIO grow.
152
+ const previewSafetyCeiling = paneWidth - PREVIEW_COLUMN_GAP - MIN_PREVIEW_WIDTH;
153
+ const ratioCeiling = Math.floor(paneWidth * MAX_LEFT_RATIO);
154
+ const ceiling = Math.min(previewSafetyCeiling, ratioCeiling);
155
+ return Math.min(Math.max(labelDriven, slackDonation), Math.max(1, ceiling));
156
+ }
157
+ /**
158
+ * Width allocation for side-by-side mode.
159
+ * `adaptiveLeft` is the pre-computed left column width (from `adaptiveLeftWidth`,
160
+ * cross-tab aggregated). The Math.max(1, ...) calls keep both columns >= 1 col on
161
+ * extreme inputs.
162
+ */
163
+ export function columnWidths(paneWidth, adaptiveLeft) {
164
+ const gap = PREVIEW_COLUMN_GAP;
165
+ const leftWidth = Math.min(adaptiveLeft, Math.max(1, paneWidth - gap - 1));
166
+ const rightWidth = Math.max(1, paneWidth - leftWidth - gap);
167
+ return { leftWidth, rightWidth, gap };
168
+ }
169
+ /**
170
+ * Returns the widths actually passed to `options.render` and `previewLines` inside
171
+ * `render()`. Stacked uses the full pane width for both; side-by-side splits via
172
+ * `columnWidths`, with the preview column offset by `PREVIEW_PADDING_LEFT`.
173
+ */
174
+ export function bodyWidths(paneWidth, mode, adaptiveLeft) {
175
+ if (mode === "stacked")
176
+ return { optionsWidth: paneWidth, previewWidth: paneWidth };
177
+ const { leftWidth, rightWidth } = columnWidths(paneWidth, adaptiveLeft);
178
+ return { optionsWidth: leftWidth, previewWidth: Math.max(1, rightWidth - PREVIEW_PADDING_LEFT) };
179
+ }
180
+ //# sourceMappingURL=preview-layout-decider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-layout-decider.js","sourceRoot":"","sources":["../../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAExG,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AACrC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,oFAAoF;AACpF,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAC3B,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,6FAA6F;AAC7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC;+EAC+E;AAC/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAIpC;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,aAAqB,EAAE,SAAiB;IACpE,OAAO,aAAa,IAAI,iBAAiB,IAAI,SAAS,IAAI,iBAAiB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1G,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAChC,KAAoC,EACpC,iBAAyB,EACzB,SAAiB;IAEjB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GA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YAAY,EAAE,SAAS,EAAE,CAAC;IACpF,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACxE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,oBAAoB,CAAC,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import { visibleWidth } from \"@earendil-works/pi-tui\";\nimport type { QuestionData } from \"../../../tool/types.ts\";\nimport type { WrappingSelectItem } from \"../wrapping-select.ts\";\nimport { BORDER_HORIZONTAL_OVERHEAD, BORDER_INNER_PADDING_HORIZONTAL } from \"./preview-box-renderer.ts\";\n\n/** Min terminal/pane width for the side-by-side layout to engage. */\nexport const PREVIEW_MIN_WIDTH = 100;\n/** Visual gap between options column and preview column in side-by-side. */\nexport const PREVIEW_COLUMN_GAP = 2;\n/** 1 col padding inside the preview column (between gap and `│`). */\nexport const PREVIEW_PADDING_LEFT = 1;\n/** Empty rows between options and preview blocks in stacked (narrow) layout. */\nexport const STACKED_GAP_ROWS = 1;\n\n/** Floor for the adaptive left column width — prevents collapse on short labels. */\nexport const MIN_LEFT = 30;\n/** Ceiling ratio: left column never exceeds this fraction of pane width. */\nexport const MAX_LEFT_RATIO = 0.5;\n/** Floor for the preview column width — prevents right-side collapse on narrow terminals. */\nexport const MIN_PREVIEW_WIDTH = 45;\n/** visibleWidth(\" ✔\") = 2 (space + ✔ codepoint). Reserved on the longest-label measurement\n * so a confirmed row never gets truncated when MIN_LEFT clamps the column. */\nexport const CONFIRMED_OVERHEAD = 2;\n\nexport type PreviewLayoutMode = \"side-by-side\" | \"stacked\";\n\n/**\n * Decide layout mode from terminal + pane widths. Pure of inputs.\n *\n * The terminal-width gate is the AND check from the previous `preview-pane.ts` —\n * lifted here so the decision is computed ONCE per render and threaded explicitly\n * through `previewBlockHeight`. Removes the bug class where `previewBlockHeight`\n * re-derived `sideBySide` from a column width (already < pane width post-split),\n * capping height too short.\n */\nexport function decideLayout(terminalWidth: number, paneWidth: number): PreviewLayoutMode {\n\treturn terminalWidth >= PREVIEW_MIN_WIDTH && paneWidth >= PREVIEW_MIN_WIDTH ? \"side-by-side\" : \"stacked\";\n}\n\n/**\n * Compute the adaptive left column width from option labels.\n * Pure function — deterministic for a given (items, totalForNumbering, paneWidth).\n *\n * Pipeline:\n * 1. Measure: longest visible label width + prefix overhead + confirmed-mark overhead\n * 2. Clamp: floor MIN_LEFT, ceiling paneWidth * MAX_LEFT_RATIO\n * 3. Safety net: never exceed available = paneWidth - GAP - MIN_PREVIEW_WIDTH\n */\nexport function adaptiveLeftWidth(\n\titems: readonly WrappingSelectItem[],\n\ttotalForNumbering: number,\n\tpaneWidth: number,\n): number {\n\tconst prefixW = String(Math.max(1, totalForNumbering)).length + 4; // digits + \"❯ \" + \". \"\n\tconst confirmedOverhead = CONFIRMED_OVERHEAD; // visibleWidth(\" ✔\") = 2 (space + ✔ codepoint)\n\tlet maxLabel = 0;\n\tfor (const item of items) {\n\t\tconst w = visibleWidth(item.label);\n\t\tif (w > maxLabel) maxLabel = w;\n\t}\n\tconst desired = maxLabel + prefixW + confirmedOverhead;\n\tconst ratioCapped = Math.min(desired, Math.floor(paneWidth * MAX_LEFT_RATIO));\n\tconst available = paneWidth - PREVIEW_COLUMN_GAP - MIN_PREVIEW_WIDTH;\n\treturn Math.max(MIN_LEFT, Math.min(ratioCapped, Math.max(1, available)));\n}\n\n/**\n * Cross-tab maximum left-column width. Aggregates `adaptiveLeftWidth` over every tab\n * and returns the widest result, so the options column stays stable on tab switch.\n *\n * Pure function — `tabs.length` MUST equal `itemsByTab.length`. Numbering uses\n * `items.length` for every tab (the chat row slot that once added +1 on single-select\n * has been removed).\n * Floor is `MIN_LEFT` so an all-empty input still produces a usable column.\n */\nexport function crossTabMaxLeftWidth(\n\ttabs: ReadonlyArray<{ multiSelect?: boolean }>,\n\titemsByTab: ReadonlyArray<readonly WrappingSelectItem[]>,\n\tpaneWidth: number,\n): number {\n\tlet max = MIN_LEFT;\n\tfor (let i = 0; i < tabs.length; i++) {\n\t\tconst items = itemsByTab[i] ?? [];\n\t\tconst totalForNumbering = items.length;\n\t\tconst tabWidth = adaptiveLeftWidth(items, totalForNumbering, paneWidth);\n\t\tif (tabWidth > max) max = tabWidth;\n\t}\n\treturn max;\n}\n\n/**\n * Source-line probe: measures the widest source line across all options' previews.\n * Returns 0 when no option carries a preview.\n *\n * V1 heuristic — works well for tree/table/heading/list content where source-line\n * width ≈ rendered width. Paragraphs overstate (source width \"wants\" the full pane);\n * the worst case is \"donation does nothing useful\" — fallback to the label-driven path.\n * Upgrade path: replace with a render-width probe that invokes Markdown at a probe width.\n *\n * Pure function — O(total chars) per question; no Markdown invocation, no cache interaction.\n */\nexport function previewSourceWidth(question: QuestionData): number {\n\tlet max = 0;\n\tfor (const option of question.options) {\n\t\tconst text = option.preview;\n\t\tif (!text) continue;\n\t\tfor (const line of text.split(\"\\n\")) {\n\t\t\tconst w = visibleWidth(line);\n\t\t\tif (w > max) max = w;\n\t\t}\n\t}\n\treturn max;\n}\n\n/**\n * Cross-tab/cross-option preview budget. Iterates all questions, computes each question's\n * preview appetite via `previewSourceWidth`, adds box + padding overhead (5 cols), and\n * returns the widest result. Floor is `MIN_PREVIEW_WIDTH` so a previewless question still\n * reserves a usable column. Ceiling ensures the left column retains its `MIN_LEFT` floor.\n *\n * Pure function — same cross-tab max pattern as `crossTabMaxLeftWidth`.\n */\nexport function crossTabPreviewBudget(questions: readonly QuestionData[], paneWidth: number): number {\n\tlet max = MIN_PREVIEW_WIDTH;\n\tfor (const question of questions) {\n\t\tconst rawWidth = previewSourceWidth(question);\n\t\tconst capped = Math.min(rawWidth, paneWidth - PREVIEW_COLUMN_GAP - MIN_LEFT);\n\t\tconst budget = capped + BORDER_HORIZONTAL_OVERHEAD + 2 * BORDER_INNER_PADDING_HORIZONTAL + PREVIEW_PADDING_LEFT;\n\t\tif (budget > max) max = budget;\n\t}\n\treturn max;\n}\n\n/**\n * Cross-tab left-column width with slack donation. Combines the label-driven width\n * (from `crossTabMaxLeftWidth`) with the slack donated by narrow previews.\n *\n * Pipeline:\n * 1. `labelDriven` = `crossTabMaxLeftWidth(tabs, itemsByTab, paneWidth)`\n * 2. `previewBudget` = `crossTabPreviewBudget(questions, paneWidth)`\n * 3. `slackDonation` = `paneWidth − GAP − previewBudget`\n * 4. Return `min(max(labelDriven, slackDonation), ceiling)` where `ceiling` is the\n * tighter of the preview-width safety limit and `MAX_LEFT_RATIO`\n *\n * Invariants (hold at side-by-side widths, paneWidth ≥ PREVIEW_MIN_WIDTH — the only\n * mode that consumes this value; narrower panes can pull both ceilings under MIN_LEFT):\n * - Floor: result ≥ MIN_LEFT (ratioCeiling ≥ 50 once paneWidth ≥ 100)\n * - Options cap: left column ≤ paneWidth × MAX_LEFT_RATIO\n * - Preview floor: right column ≥ MIN_PREVIEW_WIDTH — enforced transitively by the\n * MAX_LEFT_RATIO cap (right column keeps ≥ paneWidth/2 − GAP ≥ 48 cols);\n * previewSafetyCeiling is defensive depth that binds only if MAX_LEFT_RATIO\n * ever rises above ~0.53\n * - Cross-tab stability: both reductions are tab-independent\n * - Determinism: pure of (questions, itemsByTab, paneWidth)\n *\n * `crossTabMaxLeftWidth` is NOT replaced — it continues to exist as the primitive.\n * Donation obeys the same `MAX_LEFT_RATIO` cap as the label-driven path; the preview\n * composer right-aligns narrower boxes inside the remaining column.\n */\nexport function crossTabLeftWidthWithDonation(\n\ttabs: ReadonlyArray<{ multiSelect?: boolean }>,\n\titemsByTab: ReadonlyArray<readonly WrappingSelectItem[]>,\n\tquestions: readonly QuestionData[],\n\tpaneWidth: number,\n): number {\n\tconst labelDriven = crossTabMaxLeftWidth(tabs, itemsByTab, paneWidth);\n\tconst previewBudget = crossTabPreviewBudget(questions, paneWidth);\n\tconst slackDonation = paneWidth - PREVIEW_COLUMN_GAP - previewBudget;\n\t// At side-by-side widths the ratio ceiling is always the tighter bound\n\t// (paneWidth/2 ≤ paneWidth − GAP − MIN_PREVIEW_WIDTH once paneWidth ≥ 94);\n\t// previewSafetyCeiling stays as defensive depth should MAX_LEFT_RATIO grow.\n\tconst previewSafetyCeiling = paneWidth - PREVIEW_COLUMN_GAP - MIN_PREVIEW_WIDTH;\n\tconst ratioCeiling = Math.floor(paneWidth * MAX_LEFT_RATIO);\n\tconst ceiling = Math.min(previewSafetyCeiling, ratioCeiling);\n\treturn Math.min(Math.max(labelDriven, slackDonation), Math.max(1, ceiling));\n}\n\n/**\n * Width allocation for side-by-side mode.\n * `adaptiveLeft` is the pre-computed left column width (from `adaptiveLeftWidth`,\n * cross-tab aggregated). The Math.max(1, ...) calls keep both columns >= 1 col on\n * extreme inputs.\n */\nexport function columnWidths(\n\tpaneWidth: number,\n\tadaptiveLeft: number,\n): { leftWidth: number; rightWidth: number; gap: number } {\n\tconst gap = PREVIEW_COLUMN_GAP;\n\tconst leftWidth = Math.min(adaptiveLeft, Math.max(1, paneWidth - gap - 1));\n\tconst rightWidth = Math.max(1, paneWidth - leftWidth - gap);\n\treturn { leftWidth, rightWidth, gap };\n}\n\n/**\n * Returns the widths actually passed to `options.render` and `previewLines` inside\n * `render()`. Stacked uses the full pane width for both; side-by-side splits via\n * `columnWidths`, with the preview column offset by `PREVIEW_PADDING_LEFT`.\n */\nexport function bodyWidths(\n\tpaneWidth: number,\n\tmode: PreviewLayoutMode,\n\tadaptiveLeft: number,\n): { optionsWidth: number; previewWidth: number } {\n\tif (mode === \"stacked\") return { optionsWidth: paneWidth, previewWidth: paneWidth };\n\tconst { leftWidth, rightWidth } = columnWidths(paneWidth, adaptiveLeft);\n\treturn { optionsWidth: leftWidth, previewWidth: Math.max(1, rightWidth - PREVIEW_PADDING_LEFT) };\n}\n"]}
@@ -0,0 +1,108 @@
1
+ import { type Component } from "@earendil-works/pi-tui";
2
+ import type { Theme } from "../../../../../../../modes/interactive/theme/theme.ts";
3
+ import type { QuestionData } from "../../../tool/types.ts";
4
+ import type { StatefulView } from "../../stateful-view.ts";
5
+ import type { OptionListView } from "../option-list-view.ts";
6
+ import type { PreviewBlockRenderer } from "./preview-block-renderer.ts";
7
+ export { MAX_PREVIEW_HEIGHT_SIDE_BY_SIDE, MAX_PREVIEW_HEIGHT_STACKED, NO_PREVIEW_TEXT, NOTES_AFFORDANCE_OVERHEAD, } from "./markdown-content-cache.ts";
8
+ export { NOTES_AFFORDANCE_TEXT, NOTES_EDIT_AFFORDANCE_TEXT, PreviewBlockRenderer } from "./preview-block-renderer.ts";
9
+ export { BORDER_HORIZONTAL_OVERHEAD, BORDER_INNER_PADDING_HORIZONTAL, BORDER_VERTICAL_OVERHEAD, BOX_MIN_CONTENT_WIDTH, renderBorderedBox, stripFenceMarkers, } from "./preview-box-renderer.ts";
10
+ export { PREVIEW_COLUMN_GAP, PREVIEW_MIN_WIDTH, PREVIEW_PADDING_LEFT, STACKED_GAP_ROWS, } from "./preview-layout-decider.ts";
11
+ /**
12
+ * Per-tick projection of PreviewPane state. Replaces the prior
13
+ * `setNotesVisible(boolean)` sliver-setter and the sibling reads of
14
+ * `optionListView.getSelectedIndex()` / `isFocused()`. The pane now reads
15
+ * `selectedIndex` and `focused` from its own props — both derived from
16
+ * canonical state via `selectPreviewPaneProps`. `OptionListView` and
17
+ * `PreviewPane` see the same source of truth without the cross-component
18
+ * live read.
19
+ */
20
+ export interface PreviewPaneProps {
21
+ notesVisible: boolean;
22
+ /** The question carries a saved note — the affordance offers to edit it rather than add one (#197). */
23
+ hasNote: boolean;
24
+ selectedIndex: number;
25
+ focused: boolean;
26
+ /**
27
+ * True while the "other" (custom-answer) row is focused and accepting input
28
+ * (`state.inputMode`, set by the reducer via `ROW_INTENT_META.other.activatesInputMode`).
29
+ * Surfaced by `selectPreviewPaneProps` from canonical state; drives the full-width
30
+ * early-returns below so the inline input isn't cramped into the narrow left column.
31
+ */
32
+ inputMode: boolean;
33
+ }
34
+ export interface PreviewPaneConfig {
35
+ question: QuestionData;
36
+ theme: Theme;
37
+ getTerminalWidth: () => number;
38
+ optionListView: OptionListView;
39
+ previewBlock: PreviewBlockRenderer;
40
+ }
41
+ /**
42
+ * Thin layout composer. Receives `selectedIndex` / `focused` / `notesVisible`
43
+ * via `setProps` per tick (computed by `selectPreviewPaneProps` from canonical
44
+ * state). Delegates option-side rendering to `OptionListView` (which still
45
+ * owns its render-time state — input buffer, confirmedIndex) and preview-side
46
+ * rendering to `PreviewBlockRenderer` (which owns the markdown cache and
47
+ * bordered-box composition).
48
+ *
49
+ * `naturalHeight` and `maxNaturalHeight` query both children's heights; `render`
50
+ * combines them via `decideLayout` (mode threaded into both calls — never
51
+ * re-derived).
52
+ */
53
+ export declare class PreviewPane implements StatefulView<PreviewPaneProps>, Component {
54
+ private readonly question;
55
+ private readonly getTerminalWidth;
56
+ private readonly optionListView;
57
+ private readonly previewBlock;
58
+ private readonly theme;
59
+ private props;
60
+ /**
61
+ * Rows the dialog can give this body this frame, set by `DialogView` before each render;
62
+ * undefined when unconstrained. A body taller than this fits itself instead of being cut
63
+ * by the dialog's scroll window: the options scroll within their column around the focused
64
+ * option, and the preview box shrinks but always closes (#210).
65
+ */
66
+ private rowAllowance;
67
+ /**
68
+ * Cross-tab max left-width getter. Set exactly once by `buildQuestionnaire.injectGlobalLeftWidth`
69
+ * before any render. Initialized to a throwing sentinel so missing injection is a hard fail
70
+ * rather than a silent fallback to a magic constant — render is illegal until injected.
71
+ */
72
+ private globalLeftWidth;
73
+ constructor(config: PreviewPaneConfig);
74
+ setGlobalLeftWidth(getter: (paneWidth: number) => number): void;
75
+ private getAdaptiveLeft;
76
+ setProps(props: PreviewPaneProps): void;
77
+ /** Render-time geometry from `DialogView` (not canonical state, so not a prop). */
78
+ /** The notes affordance under the preview: shown while focused with the notes editor closed. */
79
+ private notesAffordance;
80
+ setRowAllowance(rows: number | undefined): void;
81
+ handleInput(_data: string): void;
82
+ invalidate(): void;
83
+ render(width: number): string[];
84
+ /**
85
+ * Options + preview for the current layout mode, fitted to `rowAllowance` when set. The
86
+ * returned focus range is in the same row coordinates as `lines`, so `render`,
87
+ * `focusedItemRowRange` and `naturalHeight` agree by construction.
88
+ */
89
+ private layout;
90
+ /**
91
+ * Stacked: options, a blank gap, then the preview block. When that exceeds the allowance,
92
+ * keep the focused option (plus a row either side for the overflow arrows) and give the
93
+ * preview the rest, so the preview of the option being considered stays in view instead
94
+ * of falling below the dialog's scroll window.
95
+ */
96
+ private layoutStacked;
97
+ /**
98
+ * Side-by-side: options column left, preview block right. Under an allowance the options
99
+ * column scrolls around the focused option and the preview block shrinks, so neither
100
+ * column exceeds it and the dialog never slices through the preview box.
101
+ */
102
+ private layoutSideBySide;
103
+ focusedItemRowRange(width: number): [number, number];
104
+ naturalHeight(width: number): number;
105
+ maxNaturalHeight(width: number): number;
106
+ private renderPaddedPreviewLines;
107
+ }
108
+ //# sourceMappingURL=preview-pane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-pane.d.ts","sourceRoot":"","sources":["../../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAiC,MAAM,wBAAwB,CAAC;AACvF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uDAAuD,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAmB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAczF,OAAO,EACN,+BAA+B,EAC/B,0BAA0B,EAC1B,eAAe,EACf,yBAAyB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACtH,OAAO,EACN,0BAA0B,EAC1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E,gBAAgB,GAAG,IAAI,CAEtC;IAED,mFAAmF;IACnF,gGAAgG;IAChG,OAAO,CAAC,eAAe;IAMvB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAE9C;IAED,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAG;IAEnC,UAAU,IAAI,IAAI,CAGjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAW9B;IAED;;;;OAIG;IACH,OAAO,CAAC,MAAM;IAKd;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAiCrB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAkCxB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAOnD;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAcnC;IAED,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAqBtC;IAED,OAAO,CAAC,wBAAwB;CAmBhC"}
@@ -0,0 +1,235 @@
1
+ import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
2
+ import { windowLines } from "../../scroll-window.js";
3
+ import { bodyWidths, columnWidths, decideLayout, PREVIEW_PADDING_LEFT, STACKED_GAP_ROWS, } from "./preview-layout-decider.js";
4
+ /** Smallest preview box worth showing: top border, one content line, bottom border. */
5
+ const MIN_BOX_ROWS = 3;
6
+ // ----- Re-exports for test imports — keep `./preview-pane.js` as the public surface -----
7
+ export { MAX_PREVIEW_HEIGHT_SIDE_BY_SIDE, MAX_PREVIEW_HEIGHT_STACKED, NO_PREVIEW_TEXT, NOTES_AFFORDANCE_OVERHEAD, } from "./markdown-content-cache.js";
8
+ export { NOTES_AFFORDANCE_TEXT, NOTES_EDIT_AFFORDANCE_TEXT, PreviewBlockRenderer } from "./preview-block-renderer.js";
9
+ export { BORDER_HORIZONTAL_OVERHEAD, BORDER_INNER_PADDING_HORIZONTAL, BORDER_VERTICAL_OVERHEAD, BOX_MIN_CONTENT_WIDTH, renderBorderedBox, stripFenceMarkers, } from "./preview-box-renderer.js";
10
+ export { PREVIEW_COLUMN_GAP, PREVIEW_MIN_WIDTH, PREVIEW_PADDING_LEFT, STACKED_GAP_ROWS, } from "./preview-layout-decider.js";
11
+ /**
12
+ * Thin layout composer. Receives `selectedIndex` / `focused` / `notesVisible`
13
+ * via `setProps` per tick (computed by `selectPreviewPaneProps` from canonical
14
+ * state). Delegates option-side rendering to `OptionListView` (which still
15
+ * owns its render-time state — input buffer, confirmedIndex) and preview-side
16
+ * rendering to `PreviewBlockRenderer` (which owns the markdown cache and
17
+ * bordered-box composition).
18
+ *
19
+ * `naturalHeight` and `maxNaturalHeight` query both children's heights; `render`
20
+ * combines them via `decideLayout` (mode threaded into both calls — never
21
+ * re-derived).
22
+ */
23
+ export class PreviewPane {
24
+ question;
25
+ getTerminalWidth;
26
+ optionListView;
27
+ previewBlock;
28
+ theme;
29
+ props;
30
+ /**
31
+ * Rows the dialog can give this body this frame, set by `DialogView` before each render;
32
+ * undefined when unconstrained. A body taller than this fits itself instead of being cut
33
+ * by the dialog's scroll window: the options scroll within their column around the focused
34
+ * option, and the preview box shrinks but always closes (#210).
35
+ */
36
+ rowAllowance;
37
+ /**
38
+ * Cross-tab max left-width getter. Set exactly once by `buildQuestionnaire.injectGlobalLeftWidth`
39
+ * before any render. Initialized to a throwing sentinel so missing injection is a hard fail
40
+ * rather than a silent fallback to a magic constant — render is illegal until injected.
41
+ */
42
+ globalLeftWidth = () => {
43
+ throw new Error("PreviewPane.setGlobalLeftWidth must be called before render()");
44
+ };
45
+ constructor(config) {
46
+ this.question = config.question;
47
+ this.getTerminalWidth = config.getTerminalWidth;
48
+ this.optionListView = config.optionListView;
49
+ this.previewBlock = config.previewBlock;
50
+ this.theme = config.theme;
51
+ this.props = { notesVisible: false, hasNote: false, selectedIndex: 0, focused: false, inputMode: false };
52
+ }
53
+ setGlobalLeftWidth(getter) {
54
+ this.globalLeftWidth = getter;
55
+ }
56
+ getAdaptiveLeft(paneWidth) {
57
+ return this.globalLeftWidth(paneWidth);
58
+ }
59
+ setProps(props) {
60
+ this.props = props;
61
+ }
62
+ /** Render-time geometry from `DialogView` (not canonical state, so not a prop). */
63
+ /** The notes affordance under the preview: shown while focused with the notes editor closed. */
64
+ notesAffordance() {
65
+ const { focused, notesVisible, hasNote } = this.props;
66
+ if (!focused || notesVisible)
67
+ return "none";
68
+ return hasNote ? "edit" : "add";
69
+ }
70
+ setRowAllowance(rows) {
71
+ this.rowAllowance = rows;
72
+ }
73
+ handleInput(_data) { }
74
+ invalidate() {
75
+ this.previewBlock.invalidate();
76
+ this.optionListView.invalidate();
77
+ }
78
+ render(width) {
79
+ if (this.question.multiSelect === true)
80
+ return this.optionListView.render(width);
81
+ // Spec: hide the preview pane entirely when no option carries a `preview`.
82
+ if (!this.previewBlock.hasAnyPreview())
83
+ return this.optionListView.render(width);
84
+ // `inputMode` (typing on the "other" custom-answer row): the preview is irrelevant —
85
+ // the row sits at index `options.length`, out of bounds for any option's preview — so
86
+ // render the option list at the full pane width instead of the cramped left column.
87
+ // Side-by-side + preview block resume verbatim on nav-away (inputMode clears).
88
+ if (this.props.inputMode)
89
+ return this.optionListView.render(width);
90
+ return this.layout(width).lines;
91
+ }
92
+ /**
93
+ * Options + preview for the current layout mode, fitted to `rowAllowance` when set. The
94
+ * returned focus range is in the same row coordinates as `lines`, so `render`,
95
+ * `focusedItemRowRange` and `naturalHeight` agree by construction.
96
+ */
97
+ layout(width) {
98
+ const mode = decideLayout(this.getTerminalWidth(), width);
99
+ return mode === "side-by-side" ? this.layoutSideBySide(width, mode) : this.layoutStacked(width, mode);
100
+ }
101
+ /**
102
+ * Stacked: options, a blank gap, then the preview block. When that exceeds the allowance,
103
+ * keep the focused option (plus a row either side for the overflow arrows) and give the
104
+ * preview the rest, so the preview of the option being considered stays in view instead
105
+ * of falling below the dialog's scroll window.
106
+ */
107
+ layoutStacked(width, mode) {
108
+ const { selectedIndex } = this.props;
109
+ const affordance = this.notesAffordance();
110
+ const options = this.optionListView.render(width);
111
+ const focus = this.optionListView.focusedItemRowRange(width);
112
+ const gap = Array(STACKED_GAP_ROWS).fill("");
113
+ const allowance = this.rowAllowance;
114
+ const fullBlock = this.previewBlock.blockHeight(width, selectedIndex, mode);
115
+ if (allowance === undefined || options.length + STACKED_GAP_ROWS + fullBlock <= allowance) {
116
+ return {
117
+ lines: [...options, ...gap, ...this.previewBlock.renderBlock(width, selectedIndex, mode, affordance)],
118
+ focus,
119
+ };
120
+ }
121
+ // Prefer keeping a row either side of the focused option for the overflow arrows; give
122
+ // those up only when they are what keeps the preview box (border + 1 line) from fitting.
123
+ const focusRows = focus ? focus[1] - focus[0] : 1;
124
+ const previewRowsWith = (optionsFloor) => Math.min(fullBlock, allowance - STACKED_GAP_ROWS - Math.min(options.length, optionsFloor));
125
+ const roomy = previewRowsWith(focusRows + 2);
126
+ const previewRows = roomy >= MIN_BOX_ROWS ? roomy : previewRowsWith(focusRows);
127
+ const block = this.previewBlock.renderBlock(width, selectedIndex, mode, affordance, previewRows);
128
+ const optionRows = allowance - (block.length > 0 ? STACKED_GAP_ROWS + block.length : 0);
129
+ const windowed = windowLines(options, Math.max(1, optionRows), focus, this.theme);
130
+ return {
131
+ lines: block.length > 0 ? [...windowed.lines, ...gap, ...block] : windowed.lines,
132
+ focus: windowed.focus,
133
+ };
134
+ }
135
+ /**
136
+ * Side-by-side: options column left, preview block right. Under an allowance the options
137
+ * column scrolls around the focused option and the preview block shrinks, so neither
138
+ * column exceeds it and the dialog never slices through the preview box.
139
+ */
140
+ layoutSideBySide(width, mode) {
141
+ const adaptiveLeft = this.getAdaptiveLeft(width);
142
+ const { leftWidth, rightWidth, gap } = columnWidths(width, adaptiveLeft);
143
+ const allowance = this.rowAllowance;
144
+ const left = allowance === undefined
145
+ ? {
146
+ lines: this.optionListView.render(leftWidth),
147
+ focus: this.optionListView.focusedItemRowRange(leftWidth),
148
+ }
149
+ : windowLines(this.optionListView.render(leftWidth), allowance, this.optionListView.focusedItemRowRange(leftWidth), this.theme);
150
+ const rightLines = this.renderPaddedPreviewLines(rightWidth, mode, allowance);
151
+ const rows = Math.max(left.lines.length, rightLines.length);
152
+ const gapStr = " ".repeat(gap);
153
+ const out = [];
154
+ for (let i = 0; i < rows; i++) {
155
+ const leftRaw = left.lines[i] ?? "";
156
+ const rightRaw = rightLines[i] ?? "";
157
+ const leftClamped = truncateToWidth(leftRaw, leftWidth, "");
158
+ const leftPad = " ".repeat(Math.max(0, leftWidth - visibleWidth(leftClamped)));
159
+ const joined = `${leftClamped}${leftPad}${gapStr}${rightRaw}`;
160
+ out.push(truncateToWidth(joined, width, ""));
161
+ }
162
+ return { lines: out, focus: left.focus };
163
+ }
164
+ focusedItemRowRange(width) {
165
+ if (this.question.multiSelect === true)
166
+ return this.optionListView.focusedItemRowRange(width);
167
+ if (!this.previewBlock.hasAnyPreview())
168
+ return this.optionListView.focusedItemRowRange(width);
169
+ // `inputMode`: compute the focused row range against the FULL pane width (not the
170
+ // side-by-side leftWidth), mirroring `render`'s full-width option list.
171
+ if (this.props.inputMode)
172
+ return this.optionListView.focusedItemRowRange(width);
173
+ return this.layout(width).focus ?? [0, 1];
174
+ }
175
+ naturalHeight(width) {
176
+ if (this.question.multiSelect === true)
177
+ return this.optionListView.render(width).length;
178
+ if (!this.previewBlock.hasAnyPreview())
179
+ return this.optionListView.render(width).length;
180
+ // `inputMode`: height is the full-width option list only (no preview block) — preserves
181
+ // the `naturalHeight === render.length` parity invariant.
182
+ if (this.props.inputMode)
183
+ return this.optionListView.render(width).length;
184
+ if (this.rowAllowance !== undefined)
185
+ return this.layout(width).lines.length;
186
+ const mode = decideLayout(this.getTerminalWidth(), width);
187
+ const adaptiveLeft = this.getAdaptiveLeft(width);
188
+ const { optionsWidth, previewWidth } = bodyWidths(width, mode, adaptiveLeft);
189
+ const optionsHeight = this.optionListView.render(optionsWidth).length;
190
+ const previewBlockHeight = this.previewBlock.blockHeight(previewWidth, this.props.selectedIndex, mode);
191
+ if (mode === "side-by-side")
192
+ return Math.max(optionsHeight, previewBlockHeight);
193
+ return optionsHeight + STACKED_GAP_ROWS + previewBlockHeight;
194
+ }
195
+ maxNaturalHeight(width) {
196
+ if (this.question.multiSelect === true)
197
+ return this.optionListView.render(width).length;
198
+ if (!this.previewBlock.hasAnyPreview())
199
+ return this.optionListView.render(width).length;
200
+ // `inputMode`: like naturalHeight — full-width option list only, so the
201
+ // `maxNaturalHeight >= naturalHeight` parity invariant holds (both equal the list height).
202
+ if (this.props.inputMode)
203
+ return this.optionListView.render(width).length;
204
+ const mode = decideLayout(this.getTerminalWidth(), width);
205
+ const adaptiveLeft = this.getAdaptiveLeft(width);
206
+ const { optionsWidth, previewWidth } = bodyWidths(width, mode, adaptiveLeft);
207
+ const optionsHeight = this.optionListView.render(optionsWidth).length;
208
+ let maxPreviewBlock = 0;
209
+ for (let i = 0; i < this.question.options.length; i++) {
210
+ const h = this.previewBlock.blockHeight(previewWidth, i, mode);
211
+ if (h > maxPreviewBlock)
212
+ maxPreviewBlock = h;
213
+ }
214
+ const max = mode === "side-by-side"
215
+ ? Math.max(optionsHeight, maxPreviewBlock)
216
+ : optionsHeight + STACKED_GAP_ROWS + maxPreviewBlock;
217
+ // A fitted body never exceeds the allowance, whichever option is focused.
218
+ return this.rowAllowance === undefined ? max : Math.min(max, this.rowAllowance);
219
+ }
220
+ renderPaddedPreviewLines(colWidth, mode, maxRows) {
221
+ const inner = Math.max(1, colWidth - PREVIEW_PADDING_LEFT);
222
+ const contentLines = this.previewBlock.renderBlock(inner, this.props.selectedIndex, mode, this.notesAffordance(), maxRows);
223
+ const boxWidth = Math.max(1, visibleWidth(contentLines[0] ?? ""));
224
+ const boxAlignedPad = Math.max(PREVIEW_PADDING_LEFT, colWidth - boxWidth);
225
+ return contentLines.map((line) => {
226
+ if (line === "")
227
+ return "";
228
+ // A line wider than the box (a long-locale notes affordance) slides left to
229
+ // stay fully visible; truncation engages only when the column itself runs out.
230
+ const pad = Math.max(PREVIEW_PADDING_LEFT, Math.min(boxAlignedPad, colWidth - visibleWidth(line)));
231
+ return `${" ".repeat(pad)}${truncateToWidth(line, colWidth - pad, "")}`;
232
+ });
233
+ }
234
+ }
235
+ //# sourceMappingURL=preview-pane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-pane.js","sourceRoot":"","sources":["../../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGvF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,OAAO,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,oBAAoB,EAEpB,gBAAgB,GAChB,MAAM,6BAA6B,CAAC;AAErC,uFAAuF;AACvF,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB,2FAA2F;AAC3F,OAAO,EACN,+BAA+B,EAC/B,0BAA0B,EAC1B,eAAe,EACf,yBAAyB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACtH,OAAO,EACN,0BAA0B,EAC1B,+BAA+B,EAC/B,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,6BAA6B,CAAC;AAkCrC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAW;IACN,QAAQ,CAAe;IACvB,gBAAgB,CAAe;IAC/B,cAAc,CAAiB;IAC/B,YAAY,CAAuB;IACnC,KAAK,CAAQ;IACtB,KAAK,CAAmB;IAChC;;;;;OAKG;IACK,YAAY,CAAqB;IACzC;;;;OAIG;IACK,eAAe,GAAk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G,GAAG,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnG,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC;QACzE,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { type Component, truncateToWidth, visibleWidth } from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../../../../../../modes/interactive/theme/theme.ts\";\nimport type { QuestionData } from \"../../../tool/types.ts\";\nimport { windowLines } from \"../../scroll-window.ts\";\nimport type { StatefulView } from \"../../stateful-view.ts\";\nimport type { OptionListView } from \"../option-list-view.ts\";\nimport type { NotesAffordance, PreviewBlockRenderer } from \"./preview-block-renderer.ts\";\nimport {\n\tbodyWidths,\n\tcolumnWidths,\n\tdecideLayout,\n\tPREVIEW_PADDING_LEFT,\n\ttype PreviewLayoutMode,\n\tSTACKED_GAP_ROWS,\n} from \"./preview-layout-decider.ts\";\n\n/** Smallest preview box worth showing: top border, one content line, bottom border. */\nconst MIN_BOX_ROWS = 3;\n\n// ----- Re-exports for test imports — keep `./preview-pane.js` as the public surface -----\nexport {\n\tMAX_PREVIEW_HEIGHT_SIDE_BY_SIDE,\n\tMAX_PREVIEW_HEIGHT_STACKED,\n\tNO_PREVIEW_TEXT,\n\tNOTES_AFFORDANCE_OVERHEAD,\n} from \"./markdown-content-cache.ts\";\nexport { NOTES_AFFORDANCE_TEXT, NOTES_EDIT_AFFORDANCE_TEXT, PreviewBlockRenderer } from \"./preview-block-renderer.ts\";\nexport {\n\tBORDER_HORIZONTAL_OVERHEAD,\n\tBORDER_INNER_PADDING_HORIZONTAL,\n\tBORDER_VERTICAL_OVERHEAD,\n\tBOX_MIN_CONTENT_WIDTH,\n\trenderBorderedBox,\n\tstripFenceMarkers,\n} from \"./preview-box-renderer.ts\";\nexport {\n\tPREVIEW_COLUMN_GAP,\n\tPREVIEW_MIN_WIDTH,\n\tPREVIEW_PADDING_LEFT,\n\tSTACKED_GAP_ROWS,\n} from \"./preview-layout-decider.ts\";\n\n/**\n * Per-tick projection of PreviewPane state. Replaces the prior\n * `setNotesVisible(boolean)` sliver-setter and the sibling reads of\n * `optionListView.getSelectedIndex()` / `isFocused()`. The pane now reads\n * `selectedIndex` and `focused` from its own props — both derived from\n * canonical state via `selectPreviewPaneProps`. `OptionListView` and\n * `PreviewPane` see the same source of truth without the cross-component\n * live read.\n */\nexport interface PreviewPaneProps {\n\tnotesVisible: boolean;\n\t/** The question carries a saved note — the affordance offers to edit it rather than add one (#197). */\n\thasNote: boolean;\n\tselectedIndex: number;\n\tfocused: boolean;\n\t/**\n\t * True while the \"other\" (custom-answer) row is focused and accepting input\n\t * (`state.inputMode`, set by the reducer via `ROW_INTENT_META.other.activatesInputMode`).\n\t * Surfaced by `selectPreviewPaneProps` from canonical state; drives the full-width\n\t * early-returns below so the inline input isn't cramped into the narrow left column.\n\t */\n\tinputMode: boolean;\n}\n\nexport interface PreviewPaneConfig {\n\tquestion: QuestionData;\n\ttheme: Theme;\n\tgetTerminalWidth: () => number;\n\toptionListView: OptionListView;\n\tpreviewBlock: PreviewBlockRenderer;\n}\n\n/**\n * Thin layout composer. Receives `selectedIndex` / `focused` / `notesVisible`\n * via `setProps` per tick (computed by `selectPreviewPaneProps` from canonical\n * state). Delegates option-side rendering to `OptionListView` (which still\n * owns its render-time state — input buffer, confirmedIndex) and preview-side\n * rendering to `PreviewBlockRenderer` (which owns the markdown cache and\n * bordered-box composition).\n *\n * `naturalHeight` and `maxNaturalHeight` query both children's heights; `render`\n * combines them via `decideLayout` (mode threaded into both calls — never\n * re-derived).\n */\nexport class PreviewPane implements StatefulView<PreviewPaneProps>, Component {\n\tprivate readonly question: QuestionData;\n\tprivate readonly getTerminalWidth: () => number;\n\tprivate readonly optionListView: OptionListView;\n\tprivate readonly previewBlock: PreviewBlockRenderer;\n\tprivate readonly theme: Theme;\n\tprivate props: PreviewPaneProps;\n\t/**\n\t * Rows the dialog can give this body this frame, set by `DialogView` before each render;\n\t * undefined when unconstrained. A body taller than this fits itself instead of being cut\n\t * by the dialog's scroll window: the options scroll within their column around the focused\n\t * option, and the preview box shrinks but always closes (#210).\n\t */\n\tprivate rowAllowance: number | undefined;\n\t/**\n\t * Cross-tab max left-width getter. Set exactly once by `buildQuestionnaire.injectGlobalLeftWidth`\n\t * before any render. Initialized to a throwing sentinel so missing injection is a hard fail\n\t * rather than a silent fallback to a magic constant — render is illegal until injected.\n\t */\n\tprivate globalLeftWidth: (paneWidth: number) => number = () => {\n\t\tthrow new Error(\"PreviewPane.setGlobalLeftWidth must be called before render()\");\n\t};\n\n\tconstructor(config: PreviewPaneConfig) {\n\t\tthis.question = config.question;\n\t\tthis.getTerminalWidth = config.getTerminalWidth;\n\t\tthis.optionListView = config.optionListView;\n\t\tthis.previewBlock = config.previewBlock;\n\t\tthis.theme = config.theme;\n\t\tthis.props = { notesVisible: false, hasNote: false, selectedIndex: 0, focused: false, inputMode: false };\n\t}\n\n\tsetGlobalLeftWidth(getter: (paneWidth: number) => number): void {\n\t\tthis.globalLeftWidth = getter;\n\t}\n\n\tprivate getAdaptiveLeft(paneWidth: number): number {\n\t\treturn this.globalLeftWidth(paneWidth);\n\t}\n\n\tsetProps(props: PreviewPaneProps): void {\n\t\tthis.props = props;\n\t}\n\n\t/** Render-time geometry from `DialogView` (not canonical state, so not a prop). */\n\t/** The notes affordance under the preview: shown while focused with the notes editor closed. */\n\tprivate notesAffordance(): NotesAffordance {\n\t\tconst { focused, notesVisible, hasNote } = this.props;\n\t\tif (!focused || notesVisible) return \"none\";\n\t\treturn hasNote ? \"edit\" : \"add\";\n\t}\n\n\tsetRowAllowance(rows: number | undefined): void {\n\t\tthis.rowAllowance = rows;\n\t}\n\n\thandleInput(_data: string): void {}\n\n\tinvalidate(): void {\n\t\tthis.previewBlock.invalidate();\n\t\tthis.optionListView.invalidate();\n\t}\n\n\trender(width: number): string[] {\n\t\tif (this.question.multiSelect === true) return this.optionListView.render(width);\n\t\t// Spec: hide the preview pane entirely when no option carries a `preview`.\n\t\tif (!this.previewBlock.hasAnyPreview()) return this.optionListView.render(width);\n\t\t// `inputMode` (typing on the \"other\" custom-answer row): the preview is irrelevant —\n\t\t// the row sits at index `options.length`, out of bounds for any option's preview — so\n\t\t// render the option list at the full pane width instead of the cramped left column.\n\t\t// Side-by-side + preview block resume verbatim on nav-away (inputMode clears).\n\t\tif (this.props.inputMode) return this.optionListView.render(width);\n\n\t\treturn this.layout(width).lines;\n\t}\n\n\t/**\n\t * Options + preview for the current layout mode, fitted to `rowAllowance` when set. The\n\t * returned focus range is in the same row coordinates as `lines`, so `render`,\n\t * `focusedItemRowRange` and `naturalHeight` agree by construction.\n\t */\n\tprivate layout(width: number): { lines: string[]; focus: [number, number] | undefined } {\n\t\tconst mode = decideLayout(this.getTerminalWidth(), width);\n\t\treturn mode === \"side-by-side\" ? this.layoutSideBySide(width, mode) : this.layoutStacked(width, mode);\n\t}\n\n\t/**\n\t * Stacked: options, a blank gap, then the preview block. When that exceeds the allowance,\n\t * keep the focused option (plus a row either side for the overflow arrows) and give the\n\t * preview the rest, so the preview of the option being considered stays in view instead\n\t * of falling below the dialog's scroll window.\n\t */\n\tprivate layoutStacked(\n\t\twidth: number,\n\t\tmode: PreviewLayoutMode,\n\t): { lines: string[]; focus: [number, number] | undefined } {\n\t\tconst { selectedIndex } = this.props;\n\t\tconst affordance = this.notesAffordance();\n\t\tconst options = this.optionListView.render(width);\n\t\tconst focus = this.optionListView.focusedItemRowRange(width);\n\t\tconst gap = Array<string>(STACKED_GAP_ROWS).fill(\"\");\n\t\tconst allowance = this.rowAllowance;\n\t\tconst fullBlock = this.previewBlock.blockHeight(width, selectedIndex, mode);\n\t\tif (allowance === undefined || options.length + STACKED_GAP_ROWS + fullBlock <= allowance) {\n\t\t\treturn {\n\t\t\t\tlines: [...options, ...gap, ...this.previewBlock.renderBlock(width, selectedIndex, mode, affordance)],\n\t\t\t\tfocus,\n\t\t\t};\n\t\t}\n\t\t// Prefer keeping a row either side of the focused option for the overflow arrows; give\n\t\t// those up only when they are what keeps the preview box (border + 1 line) from fitting.\n\t\tconst focusRows = focus ? focus[1] - focus[0] : 1;\n\t\tconst previewRowsWith = (optionsFloor: number) =>\n\t\t\tMath.min(fullBlock, allowance - STACKED_GAP_ROWS - Math.min(options.length, optionsFloor));\n\t\tconst roomy = previewRowsWith(focusRows + 2);\n\t\tconst previewRows = roomy >= MIN_BOX_ROWS ? roomy : previewRowsWith(focusRows);\n\t\tconst block = this.previewBlock.renderBlock(width, selectedIndex, mode, affordance, previewRows);\n\t\tconst optionRows = allowance - (block.length > 0 ? STACKED_GAP_ROWS + block.length : 0);\n\t\tconst windowed = windowLines(options, Math.max(1, optionRows), focus, this.theme);\n\t\treturn {\n\t\t\tlines: block.length > 0 ? [...windowed.lines, ...gap, ...block] : windowed.lines,\n\t\t\tfocus: windowed.focus,\n\t\t};\n\t}\n\n\t/**\n\t * Side-by-side: options column left, preview block right. Under an allowance the options\n\t * column scrolls around the focused option and the preview block shrinks, so neither\n\t * column exceeds it and the dialog never slices through the preview box.\n\t */\n\tprivate layoutSideBySide(\n\t\twidth: number,\n\t\tmode: PreviewLayoutMode,\n\t): { lines: string[]; focus: [number, number] | undefined } {\n\t\tconst adaptiveLeft = this.getAdaptiveLeft(width);\n\t\tconst { leftWidth, rightWidth, gap } = columnWidths(width, adaptiveLeft);\n\t\tconst allowance = this.rowAllowance;\n\t\tconst left =\n\t\t\tallowance === undefined\n\t\t\t\t? {\n\t\t\t\t\t\tlines: this.optionListView.render(leftWidth),\n\t\t\t\t\t\tfocus: this.optionListView.focusedItemRowRange(leftWidth),\n\t\t\t\t\t}\n\t\t\t\t: windowLines(\n\t\t\t\t\t\tthis.optionListView.render(leftWidth),\n\t\t\t\t\t\tallowance,\n\t\t\t\t\t\tthis.optionListView.focusedItemRowRange(leftWidth),\n\t\t\t\t\t\tthis.theme,\n\t\t\t\t\t);\n\t\tconst rightLines = this.renderPaddedPreviewLines(rightWidth, mode, allowance);\n\t\tconst rows = Math.max(left.lines.length, rightLines.length);\n\t\tconst gapStr = \" \".repeat(gap);\n\t\tconst out: string[] = [];\n\t\tfor (let i = 0; i < rows; i++) {\n\t\t\tconst leftRaw = left.lines[i] ?? \"\";\n\t\t\tconst rightRaw = rightLines[i] ?? \"\";\n\t\t\tconst leftClamped = truncateToWidth(leftRaw, leftWidth, \"\");\n\t\t\tconst leftPad = \" \".repeat(Math.max(0, leftWidth - visibleWidth(leftClamped)));\n\t\t\tconst joined = `${leftClamped}${leftPad}${gapStr}${rightRaw}`;\n\t\t\tout.push(truncateToWidth(joined, width, \"\"));\n\t\t}\n\t\treturn { lines: out, focus: left.focus };\n\t}\n\n\tfocusedItemRowRange(width: number): [number, number] {\n\t\tif (this.question.multiSelect === true) return this.optionListView.focusedItemRowRange(width);\n\t\tif (!this.previewBlock.hasAnyPreview()) return this.optionListView.focusedItemRowRange(width);\n\t\t// `inputMode`: compute the focused row range against the FULL pane width (not the\n\t\t// side-by-side leftWidth), mirroring `render`'s full-width option list.\n\t\tif (this.props.inputMode) return this.optionListView.focusedItemRowRange(width);\n\t\treturn this.layout(width).focus ?? [0, 1];\n\t}\n\n\tnaturalHeight(width: number): number {\n\t\tif (this.question.multiSelect === true) return this.optionListView.render(width).length;\n\t\tif (!this.previewBlock.hasAnyPreview()) return this.optionListView.render(width).length;\n\t\t// `inputMode`: height is the full-width option list only (no preview block) — preserves\n\t\t// the `naturalHeight === render.length` parity invariant.\n\t\tif (this.props.inputMode) return this.optionListView.render(width).length;\n\t\tif (this.rowAllowance !== undefined) return this.layout(width).lines.length;\n\t\tconst mode = decideLayout(this.getTerminalWidth(), width);\n\t\tconst adaptiveLeft = this.getAdaptiveLeft(width);\n\t\tconst { optionsWidth, previewWidth } = bodyWidths(width, mode, adaptiveLeft);\n\t\tconst optionsHeight = this.optionListView.render(optionsWidth).length;\n\t\tconst previewBlockHeight = this.previewBlock.blockHeight(previewWidth, this.props.selectedIndex, mode);\n\t\tif (mode === \"side-by-side\") return Math.max(optionsHeight, previewBlockHeight);\n\t\treturn optionsHeight + STACKED_GAP_ROWS + previewBlockHeight;\n\t}\n\n\tmaxNaturalHeight(width: number): number {\n\t\tif (this.question.multiSelect === true) return this.optionListView.render(width).length;\n\t\tif (!this.previewBlock.hasAnyPreview()) return this.optionListView.render(width).length;\n\t\t// `inputMode`: like naturalHeight — full-width option list only, so the\n\t\t// `maxNaturalHeight >= naturalHeight` parity invariant holds (both equal the list height).\n\t\tif (this.props.inputMode) return this.optionListView.render(width).length;\n\t\tconst mode = decideLayout(this.getTerminalWidth(), width);\n\t\tconst adaptiveLeft = this.getAdaptiveLeft(width);\n\t\tconst { optionsWidth, previewWidth } = bodyWidths(width, mode, adaptiveLeft);\n\t\tconst optionsHeight = this.optionListView.render(optionsWidth).length;\n\t\tlet maxPreviewBlock = 0;\n\t\tfor (let i = 0; i < this.question.options.length; i++) {\n\t\t\tconst h = this.previewBlock.blockHeight(previewWidth, i, mode);\n\t\t\tif (h > maxPreviewBlock) maxPreviewBlock = h;\n\t\t}\n\t\tconst max =\n\t\t\tmode === \"side-by-side\"\n\t\t\t\t? Math.max(optionsHeight, maxPreviewBlock)\n\t\t\t\t: optionsHeight + STACKED_GAP_ROWS + maxPreviewBlock;\n\t\t// A fitted body never exceeds the allowance, whichever option is focused.\n\t\treturn this.rowAllowance === undefined ? max : Math.min(max, this.rowAllowance);\n\t}\n\n\tprivate renderPaddedPreviewLines(colWidth: number, mode: PreviewLayoutMode, maxRows: number | undefined): string[] {\n\t\tconst inner = Math.max(1, colWidth - PREVIEW_PADDING_LEFT);\n\t\tconst contentLines = this.previewBlock.renderBlock(\n\t\t\tinner,\n\t\t\tthis.props.selectedIndex,\n\t\t\tmode,\n\t\t\tthis.notesAffordance(),\n\t\t\tmaxRows,\n\t\t);\n\t\tconst boxWidth = Math.max(1, visibleWidth(contentLines[0] ?? \"\"));\n\t\tconst boxAlignedPad = Math.max(PREVIEW_PADDING_LEFT, colWidth - boxWidth);\n\t\treturn contentLines.map((line) => {\n\t\t\tif (line === \"\") return \"\";\n\t\t\t// A line wider than the box (a long-locale notes affordance) slides left to\n\t\t\t// stay fully visible; truncation engages only when the column itself runs out.\n\t\t\tconst pad = Math.max(PREVIEW_PADDING_LEFT, Math.min(boxAlignedPad, colWidth - visibleWidth(line)));\n\t\t\treturn `${\" \".repeat(pad)}${truncateToWidth(line, colWidth - pad, \"\")}`;\n\t\t});\n\t}\n}\n"]}