@humain/humain-code 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (899) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/dist/bundle/agent-monitor.js +1 -1
  3. package/dist/bundle/chunks/anthropic-messages-42CGJCSR.js +82 -0
  4. package/dist/bundle/chunks/ask-VH7GNX75.js +97 -0
  5. package/dist/bundle/chunks/azure-openai-responses-DOKKMBUN.js +15 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +200 -179
  7. package/dist/bundle/chunks/bowser-UX7KDMIY.js +92 -0
  8. package/dist/bundle/chunks/{chunk-46C6D7UC.js → chunk-2CYGUEQO.js} +1 -1
  9. package/dist/bundle/chunks/chunk-3RXT35Y3.js +3 -0
  10. package/dist/bundle/chunks/chunk-4BNDLR6C.js +177 -0
  11. package/dist/bundle/chunks/{chunk-MPRAQ6ZI.js → chunk-4LGBXPUD.js} +1 -1
  12. package/dist/bundle/chunks/chunk-4SL6URR3.js +90 -0
  13. package/dist/bundle/chunks/{chunk-7LSTTCSC.js → chunk-52642TYH.js} +316 -148
  14. package/dist/bundle/chunks/{chunk-LSRXA7OS.js → chunk-5C5K4EVJ.js} +3 -3
  15. package/dist/bundle/chunks/{chunk-2JNJJ6SZ.js → chunk-5KUCY54O.js} +3 -3
  16. package/dist/bundle/chunks/{chunk-4TDNOR36.js → chunk-625QJSFJ.js} +1 -1
  17. package/dist/bundle/chunks/chunk-73YX5XGR.js +2461 -0
  18. package/dist/bundle/chunks/chunk-7DIRHF4H.js +17 -0
  19. package/dist/bundle/chunks/{chunk-QJB5YI3I.js → chunk-7PAXKU7M.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-R2KD2HFT.js → chunk-7YB3HRRN.js} +83 -196
  21. package/dist/bundle/chunks/{chunk-DCXHRP6C.js → chunk-A2UZYK23.js} +13 -13
  22. package/dist/bundle/chunks/chunk-A5ZMBTTM.js +12 -0
  23. package/dist/bundle/chunks/{chunk-JKX5EGOT.js → chunk-AER66CNP.js} +13 -13
  24. package/dist/bundle/chunks/chunk-ARTF7ZMQ.js +5 -0
  25. package/dist/bundle/chunks/chunk-B3FT6L6S.js +131 -0
  26. package/dist/bundle/chunks/chunk-BIC5BSNX.js +13 -0
  27. package/dist/bundle/chunks/{chunk-JSHKS7VH.js → chunk-BNZZJ4LO.js} +1 -1
  28. package/dist/bundle/chunks/{chunk-4MKATHT2.js → chunk-CG43CMFH.js} +1 -1
  29. package/dist/bundle/chunks/{chunk-2XD7TLKB.js → chunk-CIAXW64K.js} +16 -16
  30. package/dist/bundle/chunks/{chunk-VFLVWPLZ.js → chunk-CKFLQGJN.js} +20 -16
  31. package/dist/bundle/chunks/chunk-D4UCXXDP.js +115 -0
  32. package/dist/bundle/chunks/{chunk-HQMUDHC3.js → chunk-D6ZWWDW5.js} +6 -5
  33. package/dist/bundle/chunks/{chunk-4GB7A76U.js → chunk-EVDQRT3I.js} +225 -348
  34. package/dist/bundle/chunks/{chunk-FJIISX5W.js → chunk-F74XLJPC.js} +195 -192
  35. package/dist/bundle/chunks/chunk-FDRBTGFJ.js +4 -0
  36. package/dist/bundle/chunks/{chunk-E4VUW4RI.js → chunk-FLWO3H5J.js} +12 -12
  37. package/dist/bundle/chunks/{chunk-KLSRGGOH.js → chunk-G2PFPQX7.js} +2 -2
  38. package/dist/bundle/chunks/chunk-GMPJWLZS.js +57 -0
  39. package/dist/bundle/chunks/{chunk-M5TVWJ5T.js → chunk-H35P7ROY.js} +462 -441
  40. package/dist/bundle/chunks/chunk-HCHCYBNK.js +2 -0
  41. package/dist/bundle/chunks/{chunk-7WE77IE3.js → chunk-HRNYDRL7.js} +1 -1
  42. package/dist/bundle/chunks/chunk-HWFAAGYK.js +23 -0
  43. package/dist/bundle/chunks/{chunk-VSXVZVBE.js → chunk-HWXQCJDP.js} +408 -392
  44. package/dist/bundle/chunks/{chunk-PVNXN2TC.js → chunk-II5C7G67.js} +1 -1
  45. package/dist/bundle/chunks/{chunk-F2H47FRF.js → chunk-IMRZP5SC.js} +182 -137
  46. package/dist/bundle/chunks/{chunk-AW24RHGJ.js → chunk-J5YFXMTM.js} +4 -4
  47. package/dist/bundle/chunks/chunk-J64VNQ6D.js +13 -0
  48. package/dist/bundle/chunks/{chunk-65FLSKDA.js → chunk-K5EFEIFP.js} +5 -4
  49. package/dist/bundle/chunks/{chunk-KI7CHPWC.js → chunk-KJ3QRSSY.js} +46 -43
  50. package/dist/bundle/chunks/{cli-6DJO467D.js → chunk-KSEO2LRK.js} +12 -10
  51. package/dist/bundle/chunks/{chunk-HHWVVNGG.js → chunk-MA2WCMSN.js} +2 -2
  52. package/dist/bundle/chunks/{chunk-L4J7SMJB.js → chunk-MAEKQSFU.js} +1 -1
  53. package/dist/bundle/chunks/chunk-MHQNLTZR.js +8 -0
  54. package/dist/bundle/chunks/chunk-MLOUZAVZ.js +122 -0
  55. package/dist/bundle/chunks/chunk-MQYR4Q6X.js +5 -0
  56. package/dist/bundle/chunks/chunk-MXF3KYLZ.js +4 -0
  57. package/dist/bundle/chunks/{chunk-GY663MNP.js → chunk-MZRTVX7F.js} +1 -1
  58. package/dist/bundle/chunks/chunk-MZYHSWHX.js +59 -0
  59. package/dist/bundle/chunks/{chunk-6HTHDVJC.js → chunk-NPVRWPGX.js} +1 -1
  60. package/dist/bundle/chunks/{chunk-BRSLXHED.js → chunk-O44A4E4K.js} +1 -1
  61. package/dist/bundle/chunks/{chunk-T2ZGMEMV.js → chunk-OADQOW67.js} +175 -260
  62. package/dist/bundle/chunks/chunk-OTVHRZ67.js +17 -0
  63. package/dist/bundle/chunks/{chunk-J4GII2EE.js → chunk-P7SLTLSZ.js} +51 -46
  64. package/dist/bundle/chunks/{chunk-7OZNMWAJ.js → chunk-PPGSQZZF.js} +1 -1
  65. package/dist/bundle/chunks/chunk-PYX6ZCC7.js +29 -0
  66. package/dist/bundle/chunks/chunk-PZ7NYBHJ.js +8 -0
  67. package/dist/bundle/chunks/{chunk-VCMXBP5S.js → chunk-QESIDBMW.js} +1 -7
  68. package/dist/bundle/chunks/chunk-QUWVILLB.js +3 -0
  69. package/dist/bundle/chunks/chunk-QZWUXGY7.js +99 -0
  70. package/dist/bundle/chunks/{chunk-MIAXMK5F.js → chunk-QZXLTW7V.js} +8 -7
  71. package/dist/bundle/chunks/chunk-RP6MWUAP.js +4 -0
  72. package/dist/bundle/chunks/{chunk-MUN4ZZZP.js → chunk-SOE25WIS.js} +1143 -1167
  73. package/dist/bundle/chunks/{chunk-JSZBTGI6.js → chunk-SZZ5PNP6.js} +2 -2
  74. package/dist/bundle/chunks/chunk-T5WECB2D.js +7 -0
  75. package/dist/bundle/chunks/{chunk-2NVGOSBN.js → chunk-T7F2TEIS.js} +37 -13
  76. package/dist/bundle/chunks/{chunk-ZSWU5KKA.js → chunk-UOSJTMCL.js} +7 -3
  77. package/dist/bundle/chunks/{chunk-6P6MMQUH.js → chunk-UTRUALFN.js} +3 -3
  78. package/dist/bundle/chunks/{chunk-PWFM6AQQ.js → chunk-V2HTCZRF.js} +70 -67
  79. package/dist/bundle/chunks/{chunk-JX6YIPNK.js → chunk-WCKS2DPT.js} +1 -1
  80. package/dist/bundle/chunks/chunk-XGOJCV6Z.js +2 -0
  81. package/dist/bundle/chunks/chunk-XGSJX23G.js +1151 -0
  82. package/dist/bundle/chunks/{chunk-7WETECIB.js → chunk-Z7BWHPJ2.js} +1 -1
  83. package/dist/bundle/chunks/chunk-ZFFDBTG3.js +17 -0
  84. package/dist/bundle/chunks/cli-NJLV3XDZ.js +3 -0
  85. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JEZVYITT.js → cloudflare-workers-ai-system-one-ZAZW4M4B.js} +1 -1
  86. package/dist/bundle/chunks/{compat-4ILE5BEC.js → compat-7UJJAO4E.js} +12 -12
  87. package/dist/bundle/chunks/{curator-server-QB4GITGS.js → curator-server-MW645JI3.js} +2 -2
  88. package/dist/bundle/chunks/{dist-NXHRL2KY.js → dist-7PCCEUQF.js} +2 -2
  89. package/dist/bundle/chunks/{dist-I6CI3CG5.js → dist-I53JI67E.js} +9 -9
  90. package/dist/bundle/chunks/{dist-35STTNYA.js → dist-NI2PTSLH.js} +1 -1
  91. package/dist/bundle/chunks/{dist-CBODG4CA.js → dist-VXQT3DQY.js} +6 -6
  92. package/dist/bundle/chunks/{dist-cjs-EROMDUKS.js → dist-cjs-4JQA6W3S.js} +31 -31
  93. package/dist/bundle/chunks/doctor-KJVAYG3F.js +83 -0
  94. package/dist/bundle/chunks/{easter-egg-3d-VZC5WOYV.js → easter-egg-3d-Z24JLXD4.js} +1 -1
  95. package/dist/bundle/chunks/entry-3EL6GOWK.js +2 -0
  96. package/dist/bundle/chunks/{entry-6XDR2IDE.js → entry-4IMREZBD.js} +80 -79
  97. package/dist/bundle/chunks/{execute-6MEJJF2T.js → execute-C4BZQRPQ.js} +23 -22
  98. package/dist/bundle/chunks/{extract-L373D6O7.js → extract-XVQCIS7D.js} +5 -5
  99. package/dist/bundle/chunks/{flow-implementer-XOP4MG5X.js → flow-implementer-GE2ARQKR.js} +5 -5
  100. package/dist/bundle/chunks/github-copilot.js +57 -56
  101. package/dist/bundle/chunks/google-generative-ai-P2P45MYP.js +22 -0
  102. package/dist/bundle/chunks/google-vertex-SHY4IS5F.js +26 -0
  103. package/dist/bundle/chunks/{host-WOLZCWQQ.js → host-YESS2VAB.js} +1 -1
  104. package/dist/bundle/chunks/{index.bundle-HONF3PUD.js → index.bundle-TZT64KLH.js} +102 -89
  105. package/dist/bundle/chunks/{inprocess-MBKFGDM2.js → inprocess-MGMVI6HN.js} +6 -6
  106. package/dist/bundle/chunks/interactive-mode-HHWOE4FD.js +5 -0
  107. package/dist/bundle/chunks/{llama-cpp-classify-KYZT532X.js → llama-cpp-classify-RSRH4KV2.js} +5 -5
  108. package/dist/bundle/chunks/mistral-conversations-YTMJKHHI.js +42 -0
  109. package/dist/bundle/chunks/{node-N7TPBUJB.js → node-FF6QQQLH.js} +1 -1
  110. package/dist/bundle/chunks/openai-codex-responses-NUCJOJSZ.js +97 -0
  111. package/dist/bundle/chunks/openai-completions-E5NRJUHA.js +91 -0
  112. package/dist/bundle/chunks/{openai-decisions-JMSDGR7K.js → openai-decisions-342J5ZYG.js} +1 -1
  113. package/dist/bundle/chunks/openai-responses-BN5Z4HFI.js +26 -0
  114. package/dist/bundle/chunks/openrouter-images-7RNG3JVF.js +12 -0
  115. package/dist/bundle/chunks/{pdfjs-FE3L72A6.js → pdfjs-LSTLRXQW.js} +1415 -1416
  116. package/dist/bundle/chunks/pi-messages-2L7FV5OK.js +22 -0
  117. package/dist/bundle/chunks/questionnaire-session-XEVAK7JS.js +123 -0
  118. package/dist/bundle/chunks/runtime-2FSZRUG5.js +2 -0
  119. package/dist/bundle/chunks/session-picker-666KJIVM.js +4 -0
  120. package/dist/bundle/chunks/startup-ui-INEVSNGK.js +3 -0
  121. package/dist/bundle/chunks/{trace-command-VM7FBWPE.js → trace-command-BCVMZ5ZD.js} +4 -4
  122. package/dist/bundle/chunks/typesafe-system-one-UJUNSZG4.js +3 -0
  123. package/dist/bundle/chunks/{undici-WVNE45GY.js → undici-7IGAYA4S.js} +1 -1
  124. package/dist/bundle/chunks/virtual-modules-UXSSFNV5.js +29 -0
  125. package/dist/bundle/cli-runtime.js +5 -5
  126. package/dist/bundle/flow/package.json +3 -3
  127. package/dist/bundle/index.js +13 -13
  128. package/dist/bundle/orchestrate/package.json +1 -1
  129. package/dist/bundle/rpc-entry.js +5 -4
  130. package/dist/cli/agent-dir-arg.d.ts +12 -0
  131. package/dist/cli/agent-dir-arg.d.ts.map +1 -0
  132. package/dist/cli/agent-dir-arg.js +15 -0
  133. package/dist/cli/agent-dir-arg.js.map +1 -0
  134. package/dist/cli/args.d.ts +9 -0
  135. package/dist/cli/args.d.ts.map +1 -1
  136. package/dist/cli/args.js +19 -5
  137. package/dist/cli/args.js.map +1 -1
  138. package/dist/cli/auth-check.d.ts +1 -1
  139. package/dist/cli/auth-check.d.ts.map +1 -1
  140. package/dist/cli/auth-check.js +4 -2
  141. package/dist/cli/auth-check.js.map +1 -1
  142. package/dist/cli/doctor-config.d.ts +14 -0
  143. package/dist/cli/doctor-config.d.ts.map +1 -0
  144. package/dist/cli/doctor-config.js +92 -0
  145. package/dist/cli/doctor-config.js.map +1 -0
  146. package/dist/cli/doctor-system.d.ts +12 -0
  147. package/dist/cli/doctor-system.d.ts.map +1 -0
  148. package/dist/cli/doctor-system.js +109 -0
  149. package/dist/cli/doctor-system.js.map +1 -0
  150. package/dist/cli/doctor.d.ts +11 -0
  151. package/dist/cli/doctor.d.ts.map +1 -0
  152. package/dist/cli/doctor.js +323 -0
  153. package/dist/cli/doctor.js.map +1 -0
  154. package/dist/cli/doctor.lazy.d.ts +3 -0
  155. package/dist/cli/doctor.lazy.d.ts.map +1 -0
  156. package/dist/cli/doctor.lazy.js +3 -0
  157. package/dist/cli/doctor.lazy.js.map +1 -0
  158. package/dist/cli/list-models.d.ts.map +1 -1
  159. package/dist/cli/list-models.js +0 -4
  160. package/dist/cli/list-models.js.map +1 -1
  161. package/dist/cli/project-trust.d.ts.map +1 -1
  162. package/dist/cli/project-trust.js +6 -6
  163. package/dist/cli/project-trust.js.map +1 -1
  164. package/dist/cli/startup-ui.d.ts +3 -2
  165. package/dist/cli/startup-ui.d.ts.map +1 -1
  166. package/dist/cli/startup-ui.js +23 -10
  167. package/dist/cli/startup-ui.js.map +1 -1
  168. package/dist/config.d.ts +5 -1
  169. package/dist/config.d.ts.map +1 -1
  170. package/dist/config.js +13 -3
  171. package/dist/config.js.map +1 -1
  172. package/dist/coordination/broker/broker.d.ts +3 -3
  173. package/dist/coordination/broker/broker.d.ts.map +1 -1
  174. package/dist/coordination/broker/broker.js +15 -7
  175. package/dist/coordination/broker/broker.js.map +1 -1
  176. package/dist/core/acceptance-command.d.ts +6 -3
  177. package/dist/core/acceptance-command.d.ts.map +1 -1
  178. package/dist/core/acceptance-command.js +43 -12
  179. package/dist/core/acceptance-command.js.map +1 -1
  180. package/dist/core/acceptance-ledger.d.ts +2 -0
  181. package/dist/core/acceptance-ledger.d.ts.map +1 -1
  182. package/dist/core/acceptance-ledger.js +14 -3
  183. package/dist/core/acceptance-ledger.js.map +1 -1
  184. package/dist/core/agent-session-runtime.d.ts +11 -4
  185. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  186. package/dist/core/agent-session-runtime.js +13 -4
  187. package/dist/core/agent-session-runtime.js.map +1 -1
  188. package/dist/core/agent-session-services.d.ts.map +1 -1
  189. package/dist/core/agent-session-services.js +6 -0
  190. package/dist/core/agent-session-services.js.map +1 -1
  191. package/dist/core/agent-session.d.ts +19 -1
  192. package/dist/core/agent-session.d.ts.map +1 -1
  193. package/dist/core/agent-session.js +131 -36
  194. package/dist/core/agent-session.js.map +1 -1
  195. package/dist/core/auth-storage.d.ts.map +1 -1
  196. package/dist/core/auth-storage.js +7 -1
  197. package/dist/core/auth-storage.js.map +1 -1
  198. package/dist/core/bash-executor.d.ts +3 -1
  199. package/dist/core/bash-executor.d.ts.map +1 -1
  200. package/dist/core/bash-executor.js +18 -8
  201. package/dist/core/bash-executor.js.map +1 -1
  202. package/dist/core/compaction/branch-summarization.d.ts +2 -2
  203. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  204. package/dist/core/compaction/branch-summarization.js +9 -15
  205. package/dist/core/compaction/branch-summarization.js.map +1 -1
  206. package/dist/core/compaction/compaction.d.ts.map +1 -1
  207. package/dist/core/compaction/compaction.js +3 -0
  208. package/dist/core/compaction/compaction.js.map +1 -1
  209. package/dist/core/export-html/index.d.ts.map +1 -1
  210. package/dist/core/export-html/index.js +12 -10
  211. package/dist/core/export-html/index.js.map +1 -1
  212. package/dist/core/export-html/template.js +23 -1
  213. package/dist/core/extensions/runner.d.ts.map +1 -1
  214. package/dist/core/extensions/runner.js +13 -2
  215. package/dist/core/extensions/runner.js.map +1 -1
  216. package/dist/core/extensions/types.d.ts +9 -1
  217. package/dist/core/extensions/types.d.ts.map +1 -1
  218. package/dist/core/extensions/types.js.map +1 -1
  219. package/dist/core/footer-data-provider.d.ts.map +1 -1
  220. package/dist/core/footer-data-provider.js +2 -4
  221. package/dist/core/footer-data-provider.js.map +1 -1
  222. package/dist/core/http-dispatcher.d.ts +5 -2
  223. package/dist/core/http-dispatcher.d.ts.map +1 -1
  224. package/dist/core/http-dispatcher.js +6 -3
  225. package/dist/core/http-dispatcher.js.map +1 -1
  226. package/dist/core/keybindings.d.ts +20 -0
  227. package/dist/core/keybindings.d.ts.map +1 -1
  228. package/dist/core/keybindings.js +4 -1
  229. package/dist/core/keybindings.js.map +1 -1
  230. package/dist/core/mcp-servers.d.ts +29 -0
  231. package/dist/core/mcp-servers.d.ts.map +1 -1
  232. package/dist/core/mcp-servers.js +63 -17
  233. package/dist/core/mcp-servers.js.map +1 -1
  234. package/dist/core/messages.d.ts +4 -0
  235. package/dist/core/messages.d.ts.map +1 -1
  236. package/dist/core/messages.js +10 -2
  237. package/dist/core/messages.js.map +1 -1
  238. package/dist/core/model-config.d.ts +36 -0
  239. package/dist/core/model-config.d.ts.map +1 -1
  240. package/dist/core/model-resolver.js +1 -1
  241. package/dist/core/model-resolver.js.map +1 -1
  242. package/dist/core/model-runtime.d.ts.map +1 -1
  243. package/dist/core/model-runtime.js +6 -2
  244. package/dist/core/model-runtime.js.map +1 -1
  245. package/dist/core/nested-tool-calls.d.ts +6 -5
  246. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  247. package/dist/core/nested-tool-calls.js +1 -3
  248. package/dist/core/nested-tool-calls.js.map +1 -1
  249. package/dist/core/os-secret-store.js +1 -1
  250. package/dist/core/os-secret-store.js.map +1 -1
  251. package/dist/core/package-manager.d.ts +3 -1
  252. package/dist/core/package-manager.d.ts.map +1 -1
  253. package/dist/core/package-manager.js +25 -4
  254. package/dist/core/package-manager.js.map +1 -1
  255. package/dist/core/pi-ai-schemas.d.ts +4 -0
  256. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  257. package/dist/core/project-trust.d.ts.map +1 -1
  258. package/dist/core/project-trust.js +1 -1
  259. package/dist/core/project-trust.js.map +1 -1
  260. package/dist/core/provider-composer.d.ts +1 -0
  261. package/dist/core/provider-composer.d.ts.map +1 -1
  262. package/dist/core/provider-composer.js +1 -0
  263. package/dist/core/provider-composer.js.map +1 -1
  264. package/dist/core/resolve-config-value.d.ts +4 -0
  265. package/dist/core/resolve-config-value.d.ts.map +1 -1
  266. package/dist/core/resolve-config-value.js +14 -3
  267. package/dist/core/resolve-config-value.js.map +1 -1
  268. package/dist/core/resource-loader.d.ts.map +1 -1
  269. package/dist/core/resource-loader.js +40 -2
  270. package/dist/core/resource-loader.js.map +1 -1
  271. package/dist/core/runtime-credentials.d.ts.map +1 -1
  272. package/dist/core/runtime-credentials.js +11 -7
  273. package/dist/core/runtime-credentials.js.map +1 -1
  274. package/dist/core/sdk.d.ts.map +1 -1
  275. package/dist/core/sdk.js +8 -4
  276. package/dist/core/sdk.js.map +1 -1
  277. package/dist/core/session-manager.d.ts +22 -1
  278. package/dist/core/session-manager.d.ts.map +1 -1
  279. package/dist/core/session-manager.js +227 -37
  280. package/dist/core/session-manager.js.map +1 -1
  281. package/dist/core/settings-defaults.d.ts +10 -1
  282. package/dist/core/settings-defaults.d.ts.map +1 -1
  283. package/dist/core/settings-defaults.js +7 -1
  284. package/dist/core/settings-defaults.js.map +1 -1
  285. package/dist/core/settings-manager.d.ts +14 -4
  286. package/dist/core/settings-manager.d.ts.map +1 -1
  287. package/dist/core/settings-manager.js +48 -15
  288. package/dist/core/settings-manager.js.map +1 -1
  289. package/dist/core/settings-schema.d.ts +20 -2
  290. package/dist/core/settings-schema.d.ts.map +1 -1
  291. package/dist/core/settings-schema.js +27 -4
  292. package/dist/core/settings-schema.js.map +1 -1
  293. package/dist/core/slash-commands.d.ts.map +1 -1
  294. package/dist/core/slash-commands.js +2 -0
  295. package/dist/core/slash-commands.js.map +1 -1
  296. package/dist/core/tools/bash-jobs.js +2 -2
  297. package/dist/core/tools/bash-jobs.js.map +1 -1
  298. package/dist/core/tools/bash.d.ts +3 -0
  299. package/dist/core/tools/bash.d.ts.map +1 -1
  300. package/dist/core/tools/bash.js +78 -46
  301. package/dist/core/tools/bash.js.map +1 -1
  302. package/dist/core/tools/edit-diff.d.ts +7 -1
  303. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  304. package/dist/core/tools/edit-diff.js +139 -75
  305. package/dist/core/tools/edit-diff.js.map +1 -1
  306. package/dist/core/tools/edit.d.ts.map +1 -1
  307. package/dist/core/tools/edit.js +4 -1
  308. package/dist/core/tools/edit.js.map +1 -1
  309. package/dist/core/tools/output-accumulator.d.ts +21 -6
  310. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  311. package/dist/core/tools/output-accumulator.js +90 -76
  312. package/dist/core/tools/output-accumulator.js.map +1 -1
  313. package/dist/core/tools/render-utils.d.ts +7 -2
  314. package/dist/core/tools/render-utils.d.ts.map +1 -1
  315. package/dist/core/tools/render-utils.js +14 -1
  316. package/dist/core/tools/render-utils.js.map +1 -1
  317. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  318. package/dist/core/tools/renderers/bash.js +9 -3
  319. package/dist/core/tools/renderers/bash.js.map +1 -1
  320. package/dist/core/tools/truncate.d.ts +1 -1
  321. package/dist/core/tools/truncate.d.ts.map +1 -1
  322. package/dist/core/tools/truncate.js +16 -7
  323. package/dist/core/tools/truncate.js.map +1 -1
  324. package/dist/core/tools/write.d.ts.map +1 -1
  325. package/dist/core/tools/write.js +2 -0
  326. package/dist/core/tools/write.js.map +1 -1
  327. package/dist/core/trust-manager.d.ts +2 -0
  328. package/dist/core/trust-manager.d.ts.map +1 -1
  329. package/dist/core/trust-manager.js +5 -4
  330. package/dist/core/trust-manager.js.map +1 -1
  331. package/dist/core/usage-totals.d.ts.map +1 -1
  332. package/dist/core/usage-totals.js +3 -0
  333. package/dist/core/usage-totals.js.map +1 -1
  334. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  335. package/dist/extensions/codemode/execute.js +64 -20
  336. package/dist/extensions/codemode/execute.js.map +1 -1
  337. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  338. package/dist/extensions/codemode/renderer.js +8 -3
  339. package/dist/extensions/codemode/renderer.js.map +1 -1
  340. package/dist/extensions/codemode/tool.d.ts +5 -0
  341. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  342. package/dist/extensions/codemode/tool.js.map +1 -1
  343. package/dist/extensions/llama/client.d.ts.map +1 -1
  344. package/dist/extensions/llama/client.js +3 -13
  345. package/dist/extensions/llama/client.js.map +1 -1
  346. package/dist/extensions/llama/ui.d.ts.map +1 -1
  347. package/dist/extensions/llama/ui.js +2 -1
  348. package/dist/extensions/llama/ui.js.map +1 -1
  349. package/dist/extensions/mcp/cli.d.ts +7 -0
  350. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  351. package/dist/extensions/mcp/cli.js +35 -8
  352. package/dist/extensions/mcp/cli.js.map +1 -1
  353. package/dist/extensions/mcp/config.d.ts +33 -0
  354. package/dist/extensions/mcp/config.d.ts.map +1 -1
  355. package/dist/extensions/mcp/config.js +11 -2
  356. package/dist/extensions/mcp/config.js.map +1 -1
  357. package/dist/extensions/mcp/index.d.ts +8 -0
  358. package/dist/extensions/mcp/index.d.ts.map +1 -1
  359. package/dist/extensions/mcp/index.js +16 -0
  360. package/dist/extensions/mcp/index.js.map +1 -1
  361. package/dist/extensions/mcp/resources.d.ts +1 -1
  362. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  363. package/dist/extensions/mcp/resources.js +4 -3
  364. package/dist/extensions/mcp/resources.js.map +1 -1
  365. package/dist/extensions/mcp/runtime.d.ts +1 -1
  366. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  367. package/dist/extensions/mcp/runtime.js +15 -14
  368. package/dist/extensions/mcp/runtime.js.map +1 -1
  369. package/dist/extensions/mcp/tools.d.ts +1 -24
  370. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  371. package/dist/extensions/mcp/tools.js +10 -163
  372. package/dist/extensions/mcp/tools.js.map +1 -1
  373. package/dist/humain/ask-user-question/index.d.ts +4 -0
  374. package/dist/humain/ask-user-question/index.d.ts.map +1 -0
  375. package/dist/humain/ask-user-question/index.js +18 -0
  376. package/dist/humain/ask-user-question/index.js.map +1 -0
  377. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts +38 -0
  378. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts.map +1 -0
  379. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js +97 -0
  380. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js.map +1 -0
  381. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts +41 -0
  382. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts.map +1 -0
  383. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js +441 -0
  384. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js.map +1 -0
  385. package/dist/humain/ask-user-question/vendor/ask/config.d.ts +39 -0
  386. package/dist/humain/ask-user-question/vendor/ask/config.d.ts.map +1 -0
  387. package/dist/humain/ask-user-question/vendor/ask/config.js +95 -0
  388. package/dist/humain/ask-user-question/vendor/ask/config.js.map +1 -0
  389. package/dist/humain/ask-user-question/vendor/ask/events.d.ts +132 -0
  390. package/dist/humain/ask-user-question/vendor/ask/events.d.ts.map +1 -0
  391. package/dist/humain/ask-user-question/vendor/ask/events.js +50 -0
  392. package/dist/humain/ask-user-question/vendor/ask/events.js.map +1 -0
  393. package/dist/humain/ask-user-question/vendor/ask/index.d.ts +5 -0
  394. package/dist/humain/ask-user-question/vendor/ask/index.d.ts.map +1 -0
  395. package/dist/humain/ask-user-question/vendor/ask/index.js +15 -0
  396. package/dist/humain/ask-user-question/vendor/ask/index.js.map +1 -0
  397. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts +81 -0
  398. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts.map +1 -0
  399. package/dist/humain/ask-user-question/vendor/ask/presentation.js +105 -0
  400. package/dist/humain/ask-user-question/vendor/ask/presentation.js.map +1 -0
  401. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts +28 -0
  402. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts.map +1 -0
  403. package/dist/humain/ask-user-question/vendor/ask/reconcile.js +45 -0
  404. package/dist/humain/ask-user-question/vendor/ask/reconcile.js.map +1 -0
  405. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts +41 -0
  406. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts.map +1 -0
  407. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js +166 -0
  408. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js.map +1 -0
  409. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts +46 -0
  410. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts.map +1 -0
  411. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js +247 -0
  412. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js.map +1 -0
  413. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts +11 -0
  414. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts.map +1 -0
  415. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js +56 -0
  416. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js.map +1 -0
  417. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts +6 -0
  418. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts.map +1 -0
  419. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js +10 -0
  420. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js.map +1 -0
  421. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts +57 -0
  422. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts.map +1 -0
  423. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js +357 -0
  424. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js.map +1 -0
  425. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts +112 -0
  426. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts.map +1 -0
  427. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js +240 -0
  428. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js.map +1 -0
  429. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts +87 -0
  430. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts.map +1 -0
  431. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js +79 -0
  432. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js.map +1 -0
  433. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts +22 -0
  434. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts.map +1 -0
  435. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js +2 -0
  436. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js.map +1 -0
  437. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts +27 -0
  438. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts.map +1 -0
  439. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js +48 -0
  440. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js.map +1 -0
  441. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts +13 -0
  442. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts.map +1 -0
  443. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js +15 -0
  444. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js.map +1 -0
  445. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts +14 -0
  446. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts.map +1 -0
  447. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js +96 -0
  448. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js.map +1 -0
  449. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts +58 -0
  450. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts.map +1 -0
  451. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js +310 -0
  452. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js.map +1 -0
  453. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts +68 -0
  454. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts.map +1 -0
  455. package/dist/humain/ask-user-question/vendor/ask/state/state.js +2 -0
  456. package/dist/humain/ask-user-question/vendor/ask/state/state.js.map +1 -0
  457. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts +24 -0
  458. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts.map +1 -0
  459. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js +114 -0
  460. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js.map +1 -0
  461. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts +18 -0
  462. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts.map +1 -0
  463. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js +29 -0
  464. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js.map +1 -0
  465. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts +41 -0
  466. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts.map +1 -0
  467. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js +99 -0
  468. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js.map +1 -0
  469. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts +37 -0
  470. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts.map +1 -0
  471. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js +70 -0
  472. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js.map +1 -0
  473. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts +129 -0
  474. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts.map +1 -0
  475. package/dist/humain/ask-user-question/vendor/ask/tool/types.js +76 -0
  476. package/dist/humain/ask-user-question/vendor/ask/tool/types.js.map +1 -0
  477. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts +21 -0
  478. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts.map +1 -0
  479. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js +49 -0
  480. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js.map +1 -0
  481. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts +23 -0
  482. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts.map +1 -0
  483. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js +16 -0
  484. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js.map +1 -0
  485. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts +21 -0
  486. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts.map +1 -0
  487. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js +49 -0
  488. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js.map +1 -0
  489. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts +43 -0
  490. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts.map +1 -0
  491. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js +130 -0
  492. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js.map +1 -0
  493. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts +45 -0
  494. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts.map +1 -0
  495. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js +39 -0
  496. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js.map +1 -0
  497. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts +36 -0
  498. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts.map +1 -0
  499. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js +72 -0
  500. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js.map +1 -0
  501. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts +61 -0
  502. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts.map +1 -0
  503. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js +108 -0
  504. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js.map +1 -0
  505. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts +39 -0
  506. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts.map +1 -0
  507. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js +76 -0
  508. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js.map +1 -0
  509. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts +123 -0
  510. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts.map +1 -0
  511. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js +180 -0
  512. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js.map +1 -0
  513. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts +108 -0
  514. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts.map +1 -0
  515. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js +235 -0
  516. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js.map +1 -0
  517. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts +37 -0
  518. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts.map +1 -0
  519. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js +47 -0
  520. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js.map +1 -0
  521. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts +31 -0
  522. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts.map +1 -0
  523. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js +35 -0
  524. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js.map +1 -0
  525. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts +124 -0
  526. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts.map +1 -0
  527. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js +205 -0
  528. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js.map +1 -0
  529. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts +83 -0
  530. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts.map +1 -0
  531. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js +186 -0
  532. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js.map +1 -0
  533. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts +47 -0
  534. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts.map +1 -0
  535. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js +48 -0
  536. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js.map +1 -0
  537. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts +58 -0
  538. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts.map +1 -0
  539. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js +84 -0
  540. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js.map +1 -0
  541. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts +20 -0
  542. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts.map +1 -0
  543. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js +55 -0
  544. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js.map +1 -0
  545. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts +23 -0
  546. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts.map +1 -0
  547. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js +2 -0
  548. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js.map +1 -0
  549. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts +15 -0
  550. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts.map +1 -0
  551. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js +2 -0
  552. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js.map +1 -0
  553. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts +98 -0
  554. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts.map +1 -0
  555. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js +248 -0
  556. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js.map +1 -0
  557. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts +23 -0
  558. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts.map +1 -0
  559. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js +131 -0
  560. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js.map +1 -0
  561. package/dist/humain/ask-user-question/vendor/config/config.d.ts +132 -0
  562. package/dist/humain/ask-user-question/vendor/config/config.d.ts.map +1 -0
  563. package/dist/humain/ask-user-question/vendor/config/config.js +286 -0
  564. package/dist/humain/ask-user-question/vendor/config/config.js.map +1 -0
  565. package/dist/humain/ask-user-question/vendor/config/index.d.ts +2 -0
  566. package/dist/humain/ask-user-question/vendor/config/index.d.ts.map +1 -0
  567. package/dist/humain/ask-user-question/vendor/config/index.js +2 -0
  568. package/dist/humain/ask-user-question/vendor/config/index.js.map +1 -0
  569. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts +64 -0
  570. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts.map +1 -0
  571. package/dist/humain/ask-user-question/vendor/i18n/i18n.js +185 -0
  572. package/dist/humain/ask-user-question/vendor/i18n/i18n.js.map +1 -0
  573. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts +44 -0
  574. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts.map +1 -0
  575. package/dist/humain/ask-user-question/vendor/i18n/loader.js +55 -0
  576. package/dist/humain/ask-user-question/vendor/i18n/loader.js.map +1 -0
  577. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +26 -16
  578. package/dist/humain/brand-logo.d.ts +2 -0
  579. package/dist/humain/brand-logo.d.ts.map +1 -1
  580. package/dist/humain/brand-logo.js +4 -0
  581. package/dist/humain/brand-logo.js.map +1 -1
  582. package/dist/humain/bundled-extension-names.d.ts +1 -0
  583. package/dist/humain/bundled-extension-names.d.ts.map +1 -1
  584. package/dist/humain/bundled-extension-names.js +1 -0
  585. package/dist/humain/bundled-extension-names.js.map +1 -1
  586. package/dist/humain/checklist/footer-progress.d.ts +7 -0
  587. package/dist/humain/checklist/footer-progress.d.ts.map +1 -0
  588. package/dist/humain/checklist/footer-progress.js +15 -0
  589. package/dist/humain/checklist/footer-progress.js.map +1 -0
  590. package/dist/humain/checklist/glyphs.d.ts +7 -0
  591. package/dist/humain/checklist/glyphs.d.ts.map +1 -0
  592. package/dist/humain/checklist/glyphs.js +8 -0
  593. package/dist/humain/checklist/glyphs.js.map +1 -0
  594. package/dist/humain/checklist/index.d.ts +6 -0
  595. package/dist/humain/checklist/index.d.ts.map +1 -0
  596. package/dist/humain/checklist/index.js +37 -0
  597. package/dist/humain/checklist/index.js.map +1 -0
  598. package/dist/humain/checklist/progress.d.ts +37 -0
  599. package/dist/humain/checklist/progress.d.ts.map +1 -0
  600. package/dist/humain/checklist/progress.js +234 -0
  601. package/dist/humain/checklist/progress.js.map +1 -0
  602. package/dist/humain/checklist/projector.d.ts +53 -0
  603. package/dist/humain/checklist/projector.d.ts.map +1 -0
  604. package/dist/humain/checklist/projector.js +198 -0
  605. package/dist/humain/checklist/projector.js.map +1 -0
  606. package/dist/humain/checklist/sidebar.d.ts +18 -0
  607. package/dist/humain/checklist/sidebar.d.ts.map +1 -0
  608. package/dist/humain/checklist/sidebar.js +38 -0
  609. package/dist/humain/checklist/sidebar.js.map +1 -0
  610. package/dist/humain/checklist/status-segment.d.ts +19 -0
  611. package/dist/humain/checklist/status-segment.d.ts.map +1 -0
  612. package/dist/humain/checklist/status-segment.js +59 -0
  613. package/dist/humain/checklist/status-segment.js.map +1 -0
  614. package/dist/humain/checklist/vendor/add-task-dialog.d.ts +54 -0
  615. package/dist/humain/checklist/vendor/add-task-dialog.d.ts.map +1 -0
  616. package/dist/humain/checklist/vendor/add-task-dialog.js +238 -0
  617. package/dist/humain/checklist/vendor/add-task-dialog.js.map +1 -0
  618. package/dist/humain/checklist/vendor/commands.d.ts +38 -0
  619. package/dist/humain/checklist/vendor/commands.d.ts.map +1 -0
  620. package/dist/humain/checklist/vendor/commands.js +193 -0
  621. package/dist/humain/checklist/vendor/commands.js.map +1 -0
  622. package/dist/humain/checklist/vendor/index.d.ts +3 -0
  623. package/dist/humain/checklist/vendor/index.d.ts.map +1 -0
  624. package/dist/humain/checklist/vendor/index.js +276 -0
  625. package/dist/humain/checklist/vendor/index.js.map +1 -0
  626. package/dist/humain/checklist/vendor/render.d.ts +97 -0
  627. package/dist/humain/checklist/vendor/render.d.ts.map +1 -0
  628. package/dist/humain/checklist/vendor/render.js +354 -0
  629. package/dist/humain/checklist/vendor/render.js.map +1 -0
  630. package/dist/humain/checklist/vendor/settings.d.ts +11 -0
  631. package/dist/humain/checklist/vendor/settings.d.ts.map +1 -0
  632. package/dist/humain/checklist/vendor/settings.js +8 -0
  633. package/dist/humain/checklist/vendor/settings.js.map +1 -0
  634. package/dist/humain/checklist/vendor/store.d.ts +120 -0
  635. package/dist/humain/checklist/vendor/store.d.ts.map +1 -0
  636. package/dist/humain/checklist/vendor/store.js +990 -0
  637. package/dist/humain/checklist/vendor/store.js.map +1 -0
  638. package/dist/humain/checklist/vendor/tools.d.ts +21 -0
  639. package/dist/humain/checklist/vendor/tools.d.ts.map +1 -0
  640. package/dist/humain/checklist/vendor/tools.js +162 -0
  641. package/dist/humain/checklist/vendor/tools.js.map +1 -0
  642. package/dist/humain/checklist/vendor/types.d.ts +188 -0
  643. package/dist/humain/checklist/vendor/types.d.ts.map +1 -0
  644. package/dist/humain/checklist/vendor/types.js +32 -0
  645. package/dist/humain/checklist/vendor/types.js.map +1 -0
  646. package/dist/humain/gateway/catalog.d.ts +1 -0
  647. package/dist/humain/gateway/catalog.d.ts.map +1 -1
  648. package/dist/humain/gateway/catalog.js +1 -0
  649. package/dist/humain/gateway/catalog.js.map +1 -1
  650. package/dist/humain/gateway/client.d.ts +1 -0
  651. package/dist/humain/gateway/client.d.ts.map +1 -1
  652. package/dist/humain/gateway/client.js +8 -1
  653. package/dist/humain/gateway/client.js.map +1 -1
  654. package/dist/humain/gateway/http.d.ts.map +1 -1
  655. package/dist/humain/gateway/http.js +11 -3
  656. package/dist/humain/gateway/http.js.map +1 -1
  657. package/dist/humain/gateway/images.d.ts +3 -0
  658. package/dist/humain/gateway/images.d.ts.map +1 -0
  659. package/dist/humain/gateway/images.js +73 -0
  660. package/dist/humain/gateway/images.js.map +1 -0
  661. package/dist/humain/gateway/provider.js +1 -1
  662. package/dist/humain/gateway/provider.js.map +1 -1
  663. package/dist/humain/hcode/account-store.d.ts.map +1 -1
  664. package/dist/humain/hcode/account-store.js +3 -1
  665. package/dist/humain/hcode/account-store.js.map +1 -1
  666. package/dist/humain/hcode/account.d.ts.map +1 -1
  667. package/dist/humain/hcode/account.js +23 -13
  668. package/dist/humain/hcode/account.js.map +1 -1
  669. package/dist/humain/hcode/images.d.ts.map +1 -1
  670. package/dist/humain/hcode/images.js +19 -13
  671. package/dist/humain/hcode/images.js.map +1 -1
  672. package/dist/humain/hcode/login-failure.d.ts +1 -0
  673. package/dist/humain/hcode/login-failure.d.ts.map +1 -1
  674. package/dist/humain/hcode/login-failure.js +1 -0
  675. package/dist/humain/hcode/login-failure.js.map +1 -1
  676. package/dist/humain/hcode/provider.d.ts.map +1 -1
  677. package/dist/humain/hcode/provider.js +2 -1
  678. package/dist/humain/hcode/provider.js.map +1 -1
  679. package/dist/humain/hcode/run-credential.d.ts +1 -0
  680. package/dist/humain/hcode/run-credential.d.ts.map +1 -1
  681. package/dist/humain/hcode/run-credential.js +12 -4
  682. package/dist/humain/hcode/run-credential.js.map +1 -1
  683. package/dist/humain/index.d.ts.map +1 -1
  684. package/dist/humain/index.js +4 -0
  685. package/dist/humain/index.js.map +1 -1
  686. package/dist/humain/node-provider.d.ts.map +1 -1
  687. package/dist/humain/node-provider.js +37 -8
  688. package/dist/humain/node-provider.js.map +1 -1
  689. package/dist/main.d.ts +1 -1
  690. package/dist/main.d.ts.map +1 -1
  691. package/dist/main.js +36 -26
  692. package/dist/main.js.map +1 -1
  693. package/dist/modes/interactive/chat-viewport.js +1 -1
  694. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  695. package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
  696. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  697. package/dist/modes/interactive/components/bash-execution.js +7 -4
  698. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  699. package/dist/modes/interactive/components/config-selector.js +1 -1
  700. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  701. package/dist/modes/interactive/components/custom-editor.d.ts +2 -0
  702. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  703. package/dist/modes/interactive/components/custom-editor.js +20 -1
  704. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  705. package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
  706. package/dist/modes/interactive/components/extension-editor.js +2 -2
  707. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  708. package/dist/modes/interactive/components/footer.d.ts +7 -0
  709. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  710. package/dist/modes/interactive/components/footer.js +74 -1
  711. package/dist/modes/interactive/components/footer.js.map +1 -1
  712. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  713. package/dist/modes/interactive/components/mermaid.js +11 -4
  714. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  715. package/dist/modes/interactive/components/model-selector.d.ts +2 -0
  716. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  717. package/dist/modes/interactive/components/model-selector.js +56 -8
  718. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  719. package/dist/modes/interactive/components/oauth-selector.d.ts +13 -1
  720. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  721. package/dist/modes/interactive/components/oauth-selector.js +10 -9
  722. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  723. package/dist/modes/interactive/components/session-selector.js +3 -3
  724. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  725. package/dist/modes/interactive/components/settings-selector.d.ts +4 -3
  726. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  727. package/dist/modes/interactive/components/settings-selector.js +83 -37
  728. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  729. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  730. package/dist/modes/interactive/components/settings-submenu.js +3 -3
  731. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  732. package/dist/modes/interactive/components/status-indicator.d.ts +18 -7
  733. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  734. package/dist/modes/interactive/components/status-indicator.js +70 -24
  735. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  736. package/dist/modes/interactive/components/status-line.d.ts +16 -0
  737. package/dist/modes/interactive/components/status-line.d.ts.map +1 -0
  738. package/dist/modes/interactive/components/status-line.js +51 -0
  739. package/dist/modes/interactive/components/status-line.js.map +1 -0
  740. package/dist/modes/interactive/components/tool-execution.d.ts +5 -0
  741. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  742. package/dist/modes/interactive/components/tool-execution.js +8 -1
  743. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  744. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  745. package/dist/modes/interactive/components/visual-truncate.js +11 -3
  746. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  747. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  748. package/dist/modes/interactive/external-editor.js +13 -3
  749. package/dist/modes/interactive/external-editor.js.map +1 -1
  750. package/dist/modes/interactive/interactive-mode.d.ts +17 -1
  751. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  752. package/dist/modes/interactive/interactive-mode.js +232 -108
  753. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  754. package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
  755. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
  756. package/dist/modes/interactive/program-status-reporter.js +4 -0
  757. package/dist/modes/interactive/program-status-reporter.js.map +1 -1
  758. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  759. package/dist/modes/interactive/session-share.js +9 -1
  760. package/dist/modes/interactive/session-share.js.map +1 -1
  761. package/dist/modes/print-mode.d.ts.map +1 -1
  762. package/dist/modes/print-mode.js +34 -7
  763. package/dist/modes/print-mode.js.map +1 -1
  764. package/dist/modes/rpc/jsonl.js +6 -5
  765. package/dist/modes/rpc/jsonl.js.map +1 -1
  766. package/dist/modes/rpc/rpc-client.d.ts +2 -0
  767. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  768. package/dist/modes/rpc/rpc-client.js +9 -2
  769. package/dist/modes/rpc/rpc-client.js.map +1 -1
  770. package/dist/modes/rpc/rpc-mode.d.ts +2 -1
  771. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  772. package/dist/modes/rpc/rpc-mode.js +113 -13
  773. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  774. package/dist/modes/rpc/rpc-types.d.ts +22 -1
  775. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  776. package/dist/modes/rpc/rpc-types.js.map +1 -1
  777. package/dist/modes/uncaught-errors.d.ts +20 -0
  778. package/dist/modes/uncaught-errors.d.ts.map +1 -0
  779. package/dist/modes/uncaught-errors.js +56 -0
  780. package/dist/modes/uncaught-errors.js.map +1 -0
  781. package/dist/package-manager-cli.d.ts.map +1 -1
  782. package/dist/package-manager-cli.js +10 -1
  783. package/dist/package-manager-cli.js.map +1 -1
  784. package/dist/utils/clipboard-image.js +1 -1
  785. package/dist/utils/clipboard-image.js.map +1 -1
  786. package/dist/utils/clipboard.js +2 -2
  787. package/dist/utils/clipboard.js.map +1 -1
  788. package/dist/utils/image-process.d.ts +5 -0
  789. package/dist/utils/image-process.d.ts.map +1 -1
  790. package/dist/utils/image-process.js +22 -4
  791. package/dist/utils/image-process.js.map +1 -1
  792. package/dist/utils/output-files.d.ts +44 -7
  793. package/dist/utils/output-files.d.ts.map +1 -1
  794. package/dist/utils/output-files.js +206 -12
  795. package/dist/utils/output-files.js.map +1 -1
  796. package/dist/utils/piped-stdin.d.ts +21 -0
  797. package/dist/utils/piped-stdin.d.ts.map +1 -0
  798. package/dist/utils/piped-stdin.js +60 -0
  799. package/dist/utils/piped-stdin.js.map +1 -0
  800. package/dist/utils/shell.d.ts +5 -2
  801. package/dist/utils/shell.d.ts.map +1 -1
  802. package/dist/utils/shell.js +77 -8
  803. package/dist/utils/shell.js.map +1 -1
  804. package/dist/utils/syntax-highlight.d.ts +33 -2
  805. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  806. package/dist/utils/syntax-highlight.js +77 -10
  807. package/dist/utils/syntax-highlight.js.map +1 -1
  808. package/dist/utils/tools-manager.d.ts +1 -0
  809. package/dist/utils/tools-manager.d.ts.map +1 -1
  810. package/dist/utils/tools-manager.js +9 -8
  811. package/dist/utils/tools-manager.js.map +1 -1
  812. package/dist/utils/wsl.d.ts +8 -2
  813. package/dist/utils/wsl.d.ts.map +1 -1
  814. package/dist/utils/wsl.js +12 -3
  815. package/dist/utils/wsl.js.map +1 -1
  816. package/docs/cli.md +39 -3
  817. package/docs/codemode.md +7 -3
  818. package/docs/compaction.md +1 -1
  819. package/docs/development.md +6 -0
  820. package/docs/environment-variables.md +3 -2
  821. package/docs/extensions.md +19 -5
  822. package/docs/keybindings.md +2 -0
  823. package/docs/llama-cpp.md +2 -2
  824. package/docs/message-types.md +1 -0
  825. package/docs/models-configuration.md +14 -3
  826. package/docs/models.md +29 -7
  827. package/docs/providers.md +20 -2
  828. package/docs/rpc-commands.md +25 -2
  829. package/docs/rpc.md +20 -0
  830. package/docs/run-preflight.md +2 -2
  831. package/docs/session-format.md +9 -0
  832. package/docs/settings.md +35 -5
  833. package/docs/shell-aliases.md +1 -1
  834. package/docs/slash-commands.md +3 -1
  835. package/docs/terminal-setup.md +25 -0
  836. package/docs/windows.md +2 -1
  837. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  838. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  839. package/examples/rpc-extension-ui.ts +8 -7
  840. package/npm-shrinkwrap.json +209 -180
  841. package/package.json +26 -20
  842. package/schemas/keybindings.schema.json +12 -0
  843. package/schemas/models.schema.json +20 -7
  844. package/schemas/settings.schema.json +43 -5
  845. package/src/coordination/UPSTREAM.md +27 -1
  846. package/src/coordination/upstream.json +3 -3
  847. package/src/humain/ask-user-question/UPSTREAM.md +31 -0
  848. package/src/humain/ask-user-question/upstream.json +258 -0
  849. package/src/humain/ask-user-question/vendor/ask/LICENSE +21 -0
  850. package/src/humain/ask-user-question/vendor/ask/locales/de.json +38 -0
  851. package/src/humain/ask-user-question/vendor/ask/locales/en.json +41 -0
  852. package/src/humain/ask-user-question/vendor/ask/locales/es.json +38 -0
  853. package/src/humain/ask-user-question/vendor/ask/locales/fr.json +38 -0
  854. package/src/humain/ask-user-question/vendor/ask/locales/pt-BR.json +38 -0
  855. package/src/humain/ask-user-question/vendor/ask/locales/pt.json +38 -0
  856. package/src/humain/ask-user-question/vendor/ask/locales/ru.json +38 -0
  857. package/src/humain/ask-user-question/vendor/ask/locales/uk.json +38 -0
  858. package/src/humain/ask-user-question/vendor/ask/locales/zh.json +40 -0
  859. package/src/humain/ask-user-question/vendor/config/LICENSE +21 -0
  860. package/src/humain/ask-user-question/vendor/i18n/LICENSE +21 -0
  861. package/src/humain/caveman/UPSTREAM.md +44 -11
  862. package/src/humain/caveman/upstream.json +3 -3
  863. package/src/humain/caveman/vendor/NOTICE +4 -0
  864. package/dist/bundle/chunks/anthropic-messages-XFCDMGD6.js +0 -77
  865. package/dist/bundle/chunks/azure-openai-responses-F4KQM3NK.js +0 -15
  866. package/dist/bundle/chunks/bowser-DXKSTXFQ.js +0 -89
  867. package/dist/bundle/chunks/chunk-3E37CJCE.js +0 -34
  868. package/dist/bundle/chunks/chunk-3HVHETMU.js +0 -18
  869. package/dist/bundle/chunks/chunk-6JTCRCNF.js +0 -74
  870. package/dist/bundle/chunks/chunk-B3ZLWVDA.js +0 -80
  871. package/dist/bundle/chunks/chunk-F77J5EQZ.js +0 -3
  872. package/dist/bundle/chunks/chunk-GPLWWO5Q.js +0 -121
  873. package/dist/bundle/chunks/chunk-GV5OVRKK.js +0 -4
  874. package/dist/bundle/chunks/chunk-JBSWWCT5.js +0 -12
  875. package/dist/bundle/chunks/chunk-JWOPWHVH.js +0 -51
  876. package/dist/bundle/chunks/chunk-KRBELWQH.js +0 -7
  877. package/dist/bundle/chunks/chunk-PFBAIRCY.js +0 -56
  878. package/dist/bundle/chunks/chunk-Q5RKNQ2T.js +0 -73
  879. package/dist/bundle/chunks/chunk-QFDZEUFU.js +0 -12
  880. package/dist/bundle/chunks/chunk-SKCJ25SX.js +0 -24
  881. package/dist/bundle/chunks/chunk-UZOIHLNU.js +0 -23
  882. package/dist/bundle/chunks/chunk-YSWDFV2L.js +0 -11
  883. package/dist/bundle/chunks/chunk-YZMQXAJM.js +0 -8
  884. package/dist/bundle/chunks/chunk-ZAHVC5V2.js +0 -3591
  885. package/dist/bundle/chunks/entry-2GZ3PTWQ.js +0 -2
  886. package/dist/bundle/chunks/google-generative-ai-WIASMWS3.js +0 -22
  887. package/dist/bundle/chunks/google-vertex-WSPHRZIZ.js +0 -25
  888. package/dist/bundle/chunks/interactive-mode-3322RQEH.js +0 -5
  889. package/dist/bundle/chunks/mistral-conversations-7JYDDRUT.js +0 -43
  890. package/dist/bundle/chunks/openai-codex-responses-7PAML4NF.js +0 -102
  891. package/dist/bundle/chunks/openai-completions-UJDAIGTK.js +0 -87
  892. package/dist/bundle/chunks/openai-responses-2WNCE6AY.js +0 -26
  893. package/dist/bundle/chunks/openrouter-images-V3UCCO6X.js +0 -8
  894. package/dist/bundle/chunks/pi-messages-TQ7LJUNQ.js +0 -28
  895. package/dist/bundle/chunks/runtime-H7LYNKCZ.js +0 -2
  896. package/dist/bundle/chunks/session-picker-EYKCMFQR.js +0 -4
  897. package/dist/bundle/chunks/startup-ui-7ODOR34R.js +0 -3
  898. package/dist/bundle/chunks/typesafe-system-one-YP7GGN4C.js +0 -3
  899. package/dist/bundle/chunks/virtual-modules-47MGUPYN.js +0 -28
@@ -0,0 +1,49 @@
1
+ import { MAX_QUESTIONS, MIN_OPTIONS, RESERVED_LABELS } from "./types.js";
2
+ export const ERROR_NO_QUESTIONS = "Error: At least one question is required";
3
+ export const ERROR_TOO_MANY_QUESTIONS = `Error: At most ${MAX_QUESTIONS} questions are allowed per invocation`;
4
+ export const ERROR_DUPLICATE_QUESTION = "Error: Question text must be unique within an invocation";
5
+ export const ERROR_TOO_FEW_OPTIONS = `Error: Each question requires at least ${MIN_OPTIONS} options`;
6
+ export const ERROR_RESERVED_LABEL = `Error: Option label is reserved (${RESERVED_LABELS.join(", ")})`;
7
+ export const ERROR_DUPLICATE_OPTION_LABEL = "Error: Option labels must be unique within a question";
8
+ const RESERVED_LABEL_SET = new Set(RESERVED_LABELS);
9
+ /**
10
+ * Pure runtime validator for `QuestionParams`. Covers every guard except
11
+ * `no_ui` (which depends on `ctx.hasUI` and stays inline at the call site).
12
+ * `reserved_label` MUST short-circuit before `duplicate_option_label`.
13
+ */
14
+ export function validateQuestionnaire(typed) {
15
+ if (typed.questions.length === 0) {
16
+ return { ok: false, error: "no_questions", message: ERROR_NO_QUESTIONS };
17
+ }
18
+ if (typed.questions.length > MAX_QUESTIONS) {
19
+ return { ok: false, error: "too_many_questions", message: ERROR_TOO_MANY_QUESTIONS };
20
+ }
21
+ const seenQuestions = new Set();
22
+ for (const q of typed.questions) {
23
+ if (seenQuestions.has(q.question)) {
24
+ return { ok: false, error: "duplicate_question", message: ERROR_DUPLICATE_QUESTION };
25
+ }
26
+ seenQuestions.add(q.question);
27
+ }
28
+ for (const q of typed.questions) {
29
+ if (q.options.length < MIN_OPTIONS) {
30
+ return { ok: false, error: "empty_options", message: ERROR_TOO_FEW_OPTIONS };
31
+ }
32
+ const seenLabels = new Set();
33
+ for (const o of q.options) {
34
+ if (RESERVED_LABEL_SET.has(o.label)) {
35
+ return { ok: false, error: "reserved_label", message: ERROR_RESERVED_LABEL };
36
+ }
37
+ if (seenLabels.has(o.label)) {
38
+ return {
39
+ ok: false,
40
+ error: "duplicate_option_label",
41
+ message: ERROR_DUPLICATE_OPTION_LABEL,
42
+ };
43
+ }
44
+ seenLabels.add(o.label);
45
+ }
46
+ }
47
+ return { ok: true };
48
+ }
49
+ //# sourceMappingURL=validate-questionnaire.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-questionnaire.js","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/tool/validate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AAwB,EAAE,CAAC;QACtF,CAAC;QACD,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,WAAW,EAAE,CAAC;YACpC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC;QAC9E,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;QACrC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;YAC3B,IAAI,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;gBACrC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;YAC9E,CAAC;YACD,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC7B,OAAO;oBACN,EAAE,EAAE,KAAK;oBACT,KAAK,EAAE,wBAAwB;oBAC/B,OAAO,EAAE,4BAA4B;iBACrC,CAAC;YACH,CAAC;YACD,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACrB,CAAC","sourcesContent":["import { MAX_QUESTIONS, MIN_OPTIONS, type QuestionnaireError, type QuestionParams, RESERVED_LABELS } from \"./types.ts\";\n\nexport const ERROR_NO_QUESTIONS = \"Error: At least one question is required\";\nexport const ERROR_TOO_MANY_QUESTIONS = `Error: At most ${MAX_QUESTIONS} questions are allowed per invocation`;\nexport const ERROR_DUPLICATE_QUESTION = \"Error: Question text must be unique within an invocation\";\nexport const ERROR_TOO_FEW_OPTIONS = `Error: Each question requires at least ${MIN_OPTIONS} options`;\nexport const ERROR_RESERVED_LABEL = `Error: Option label is reserved (${RESERVED_LABELS.join(\", \")})`;\nexport const ERROR_DUPLICATE_OPTION_LABEL = \"Error: Option labels must be unique within a question\";\n\nconst RESERVED_LABEL_SET: ReadonlySet<string> = new Set(RESERVED_LABELS);\n\nexport type ValidationResult = { ok: true } | { ok: false; error: QuestionnaireError; message: string };\n\n/**\n * Pure runtime validator for `QuestionParams`. Covers every guard except\n * `no_ui` (which depends on `ctx.hasUI` and stays inline at the call site).\n * `reserved_label` MUST short-circuit before `duplicate_option_label`.\n */\nexport function validateQuestionnaire(typed: QuestionParams): ValidationResult {\n\tif (typed.questions.length === 0) {\n\t\treturn { ok: false, error: \"no_questions\", message: ERROR_NO_QUESTIONS };\n\t}\n\tif (typed.questions.length > MAX_QUESTIONS) {\n\t\treturn { ok: false, error: \"too_many_questions\", message: ERROR_TOO_MANY_QUESTIONS };\n\t}\n\n\tconst seenQuestions = new Set<string>();\n\tfor (const q of typed.questions) {\n\t\tif (seenQuestions.has(q.question)) {\n\t\t\treturn { ok: false, error: \"duplicate_question\", message: ERROR_DUPLICATE_QUESTION };\n\t\t}\n\t\tseenQuestions.add(q.question);\n\t}\n\n\tfor (const q of typed.questions) {\n\t\tif (q.options.length < MIN_OPTIONS) {\n\t\t\treturn { ok: false, error: \"empty_options\", message: ERROR_TOO_FEW_OPTIONS };\n\t\t}\n\t\tconst seenLabels = new Set<string>();\n\t\tfor (const o of q.options) {\n\t\t\tif (RESERVED_LABEL_SET.has(o.label)) {\n\t\t\t\treturn { ok: false, error: \"reserved_label\", message: ERROR_RESERVED_LABEL };\n\t\t\t}\n\t\t\tif (seenLabels.has(o.label)) {\n\t\t\t\treturn {\n\t\t\t\t\tok: false,\n\t\t\t\t\terror: \"duplicate_option_label\",\n\t\t\t\t\tmessage: ERROR_DUPLICATE_OPTION_LABEL,\n\t\t\t\t};\n\t\t\t}\n\t\t\tseenLabels.add(o.label);\n\t\t}\n\t}\n\n\treturn { ok: true };\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import type { BindingContext, GlobalSelector, PerTabBindingContext, PerTabSelector } from "../state/selectors/contract.ts";
2
+ import type { QuestionnaireState } from "../state/state.ts";
3
+ import type { StatefulView } from "./stateful-view.ts";
4
+ import type { TabComponents } from "./tab-components.ts";
5
+ export interface ComponentBinding<P> {
6
+ readonly component: StatefulView<P>;
7
+ readonly select: GlobalSelector<P>;
8
+ }
9
+ export interface PerTabBinding<P> {
10
+ readonly resolve: (tab: TabComponents) => StatefulView<P> | undefined;
11
+ readonly select: PerTabSelector<P>;
12
+ readonly predicate?: PerTabSelector<boolean>;
13
+ }
14
+ export interface BoundGlobalBinding {
15
+ apply(state: QuestionnaireState, ctx: BindingContext): void;
16
+ invalidate(): void;
17
+ }
18
+ export interface BoundPerTabBinding {
19
+ apply(state: QuestionnaireState, ctx: PerTabBindingContext): void;
20
+ }
21
+ export declare function globalBinding<P>(spec: ComponentBinding<P>): BoundGlobalBinding;
22
+ export declare function perTabBinding<P>(spec: PerTabBinding<P>): BoundPerTabBinding;
23
+ //# sourceMappingURL=component-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-binding.d.ts","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/view/component-binding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,aAAa,CAAC,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACtE,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,kBAAkB;IAClC,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5D,UAAU,IAAI,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IAClC,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAClE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAK9E;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAO3E"}
@@ -0,0 +1,16 @@
1
+ export function globalBinding(spec) {
2
+ return {
3
+ apply: (state, ctx) => spec.component.setProps(spec.select(state, ctx)),
4
+ invalidate: () => spec.component.invalidate(),
5
+ };
6
+ }
7
+ export function perTabBinding(spec) {
8
+ return {
9
+ apply: (state, ctx) => {
10
+ if (spec.predicate && !spec.predicate(state, ctx))
11
+ return;
12
+ spec.resolve(ctx.tab)?.setProps(spec.select(state, ctx));
13
+ },
14
+ };
15
+ }
16
+ //# sourceMappingURL=component-binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-binding.js","sourceRoot":"","sources":["../../../../../../src/humain/ask-user-question/vendor/ask/view/component-binding.ts"],"names":[],"mappings":"AA8BA,MAAM,UAAU,aAAa,CAAI,IAAyB;IACzD,OAAO;QACN,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACvE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;KAC7C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAI,IAAsB;IACtD,OAAO;QACN,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YACrB,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;gBAAE,OAAO;YAC1D,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QAC1D,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tBindingContext,\n\tGlobalSelector,\n\tPerTabBindingContext,\n\tPerTabSelector,\n} from \"../state/selectors/contract.ts\";\nimport type { QuestionnaireState } from \"../state/state.ts\";\nimport type { StatefulView } from \"./stateful-view.ts\";\nimport type { TabComponents } from \"./tab-components.ts\";\n\nexport interface ComponentBinding<P> {\n\treadonly component: StatefulView<P>;\n\treadonly select: GlobalSelector<P>;\n}\n\nexport interface PerTabBinding<P> {\n\treadonly resolve: (tab: TabComponents) => StatefulView<P> | undefined;\n\treadonly select: PerTabSelector<P>;\n\treadonly predicate?: PerTabSelector<boolean>;\n}\n\nexport interface BoundGlobalBinding {\n\tapply(state: QuestionnaireState, ctx: BindingContext): void;\n\tinvalidate(): void;\n}\n\nexport interface BoundPerTabBinding {\n\tapply(state: QuestionnaireState, ctx: PerTabBindingContext): void;\n}\n\nexport function globalBinding<P>(spec: ComponentBinding<P>): BoundGlobalBinding {\n\treturn {\n\t\tapply: (state, ctx) => spec.component.setProps(spec.select(state, ctx)),\n\t\tinvalidate: () => spec.component.invalidate(),\n\t};\n}\n\nexport function perTabBinding<P>(spec: PerTabBinding<P>): BoundPerTabBinding {\n\treturn {\n\t\tapply: (state, ctx) => {\n\t\t\tif (spec.predicate && !spec.predicate(state, ctx)) return;\n\t\t\tspec.resolve(ctx.tab)?.setProps(spec.select(state, ctx));\n\t\t},\n\t};\n}\n"]}
@@ -0,0 +1,21 @@
1
+ export interface RenderInlineInputOptions {
2
+ /** Live inline-input buffer. */
3
+ buffer: string;
4
+ /** Cursor offset; `undefined` / out-of-range → end-of-buffer fallback. */
5
+ cursorOffset: number | undefined;
6
+ /** Prefix for the first emitted line (e.g. `❯ 4. `). */
7
+ rowPrefix: string;
8
+ /** Prefix for continuation lines (whitespace of equal visible width). */
9
+ continuationPrefix: string;
10
+ /** Visible columns available for the buffer content (width − prefix width). */
11
+ contentWidth: number;
12
+ /** Per-line styling (single-select: `theme.selectedText`; multi-select: accent+bold). */
13
+ selectedText: (text: string) => string;
14
+ }
15
+ /**
16
+ * Render the inline editor across logical and visually wrapped lines.
17
+ * Cursor visualization follows Pi's editor pattern: reverse-video on the cell at
18
+ * the cursor, with a non-breaking-space cell at end-of-line/end-of-buffer.
19
+ */
20
+ export declare function renderInlineInputRow(opts: RenderInlineInputOptions): string[];
21
+ //# sourceMappingURL=inline-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-input.d.ts","sourceRoot":"","sources":["../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/inline-input.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,wBAAwB;IACxC,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,YAAY,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC;AA+BD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,EAAE,CAO7E"}
@@ -0,0 +1,49 @@
1
+ import { CURSOR_MARKER, wrapTextWithAnsi } from "@earendil-works/pi-tui";
2
+ // Grapheme-aware extraction at the cursor: pi-tui's Editor reports UTF-16
3
+ // line/column positions, so the cursor can land between code units of one cluster
4
+ // (emoji, ZWJ, combining marks). Single-code-unit slicing would split the cluster
5
+ // across the SGR 7/27 boundary. Both single- and multi-select views share this
6
+ // cursor-building core.
7
+ const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
8
+ /**
9
+ * Resolve the cursor offset, falling back to end-of-buffer for `undefined`/out-of-range.
10
+ * Mirrors the original wrapping-select.resolveOffset exactly.
11
+ */
12
+ function resolveCursorOffset(buffer, requested) {
13
+ if (requested !== undefined && requested >= 0 && requested <= buffer.length)
14
+ return requested;
15
+ return buffer.length;
16
+ }
17
+ /**
18
+ * Build the cursor-marked raw string for the whole buffer: `before | CURSOR_MARKER |
19
+ * SGR-7 reverse-video cell | SGR-27 | after`. The cell UNDER the cursor is the single
20
+ * grapheme at the offset (or U+00A0 NBSP at end-of-buffer / on a literal space — NBSP is
21
+ * wrap-safe where a literal space would tokenize as a wrap break). Zero characters shift;
22
+ * the column under the cursor inverts. `CURSOR_MARKER` is zero-width so wrap/truncate math
23
+ * is preserved.
24
+ */
25
+ function buildCursorRaw(buffer, offset) {
26
+ const before = buffer.slice(0, offset);
27
+ const [firstGrapheme] = graphemeSegmenter.segment(buffer.slice(offset));
28
+ const rawAt = firstGrapheme ? firstGrapheme.segment : "";
29
+ // A logical newline has no visible cell. Draw the cursor on an NBSP immediately
30
+ // before it and leave the newline unconsumed so the next logical line still renders.
31
+ const cursorAtLineEnd = rawAt === "\n";
32
+ const atCursor = rawAt === "" || rawAt === " " || cursorAtLineEnd ? "\xa0" : rawAt;
33
+ const after = buffer.slice(offset + (cursorAtLineEnd ? 0 : rawAt.length));
34
+ return `${before}${CURSOR_MARKER}\x1b[7m${atCursor}\x1b[27m${after}`;
35
+ }
36
+ /**
37
+ * Render the inline editor across logical and visually wrapped lines.
38
+ * Cursor visualization follows Pi's editor pattern: reverse-video on the cell at
39
+ * the cursor, with a non-breaking-space cell at end-of-line/end-of-buffer.
40
+ */
41
+ export function renderInlineInputRow(opts) {
42
+ const { buffer, cursorOffset, rowPrefix, continuationPrefix, contentWidth, selectedText } = opts;
43
+ const raw = buildCursorRaw(buffer, resolveCursorOffset(buffer, cursorOffset));
44
+ return wrapTextWithAnsi(raw, contentWidth).map((segment, index) => {
45
+ const prefix = index === 0 ? rowPrefix : continuationPrefix;
46
+ return selectedText(`${prefix}${segment}`);
47
+ });
48
+ }
49
+ //# sourceMappingURL=inline-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-input.js","sourceRoot":"","sources":["../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/inline-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEzE,0EAA0E;AAC1E,kFAAkF;AAClF,kFAAkF;AAClF,+EAA+E;AAC/E,wBAAwB;AACxB,MAAM,iBAAiB,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC;AAiBrF;;;GAGG;AACH,SAAS,mBAAmB,CAAC,MAAc,EAAE,SAA6B;IACzE,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,IAAI,MAAM,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9F,OAAO,MAAM,CAAC,MAAM,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,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C5D,OAAO,YAAY,CAAC,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { CURSOR_MARKER, wrapTextWithAnsi } from \"@earendil-works/pi-tui\";\n\n// Grapheme-aware extraction at the cursor: pi-tui's Editor reports UTF-16\n// line/column positions, so the cursor can land between code units of one cluster\n// (emoji, ZWJ, combining marks). Single-code-unit slicing would split the cluster\n// across the SGR 7/27 boundary. Both single- and multi-select views share this\n// cursor-building core.\nconst graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: \"grapheme\" });\n\nexport interface RenderInlineInputOptions {\n\t/** Live inline-input buffer. */\n\tbuffer: string;\n\t/** Cursor offset; `undefined` / out-of-range → end-of-buffer fallback. */\n\tcursorOffset: number | undefined;\n\t/** Prefix for the first emitted line (e.g. `❯ 4. `). */\n\trowPrefix: string;\n\t/** Prefix for continuation lines (whitespace of equal visible width). */\n\tcontinuationPrefix: string;\n\t/** Visible columns available for the buffer content (width − prefix width). */\n\tcontentWidth: number;\n\t/** Per-line styling (single-select: `theme.selectedText`; multi-select: accent+bold). */\n\tselectedText: (text: string) => string;\n}\n\n/**\n * Resolve the cursor offset, falling back to end-of-buffer for `undefined`/out-of-range.\n * Mirrors the original wrapping-select.resolveOffset exactly.\n */\nfunction resolveCursorOffset(buffer: string, requested: number | undefined): number {\n\tif (requested !== undefined && requested >= 0 && requested <= buffer.length) return requested;\n\treturn buffer.length;\n}\n\n/**\n * Build the cursor-marked raw string for the whole buffer: `before | CURSOR_MARKER |\n * SGR-7 reverse-video cell | SGR-27 | after`. The cell UNDER the cursor is the single\n * grapheme at the offset (or U+00A0 NBSP at end-of-buffer / on a literal space — NBSP is\n * wrap-safe where a literal space would tokenize as a wrap break). Zero characters shift;\n * the column under the cursor inverts. `CURSOR_MARKER` is zero-width so wrap/truncate math\n * is preserved.\n */\nfunction buildCursorRaw(buffer: string, offset: number): string {\n\tconst before = buffer.slice(0, offset);\n\tconst [firstGrapheme] = graphemeSegmenter.segment(buffer.slice(offset));\n\tconst rawAt = firstGrapheme ? firstGrapheme.segment : \"\";\n\t// A logical newline has no visible cell. Draw the cursor on an NBSP immediately\n\t// before it and leave the newline unconsumed so the next logical line still renders.\n\tconst cursorAtLineEnd = rawAt === \"\\n\";\n\tconst atCursor = rawAt === \"\" || rawAt === \" \" || cursorAtLineEnd ? \"\\xa0\" : rawAt;\n\tconst after = buffer.slice(offset + (cursorAtLineEnd ? 0 : rawAt.length));\n\treturn `${before}${CURSOR_MARKER}\\x1b[7m${atCursor}\\x1b[27m${after}`;\n}\n\n/**\n * Render the inline editor across logical and visually wrapped lines.\n * Cursor visualization follows Pi's editor pattern: reverse-video on the cell at\n * the cursor, with a non-breaking-space cell at end-of-line/end-of-buffer.\n */\nexport function renderInlineInputRow(opts: RenderInlineInputOptions): string[] {\n\tconst { buffer, cursorOffset, rowPrefix, continuationPrefix, contentWidth, selectedText } = opts;\n\tconst raw = buildCursorRaw(buffer, resolveCursorOffset(buffer, cursorOffset));\n\treturn wrapTextWithAnsi(raw, contentWidth).map((segment, index) => {\n\t\tconst prefix = index === 0 ? rowPrefix : continuationPrefix;\n\t\treturn selectedText(`${prefix}${segment}`);\n\t});\n}\n"]}
@@ -0,0 +1,43 @@
1
+ import type { Theme } from "../../../../../../modes/interactive/theme/theme.ts";
2
+ import type { QuestionData } from "../../tool/types.ts";
3
+ import type { StatefulView } from "../stateful-view.ts";
4
+ export declare const MULTI_SUBMIT_LABEL = "Submit";
5
+ export interface MultiSelectOtherRowProps {
6
+ /** The "Type something." row is the focused row (optionIndex === options.length). */
7
+ active: boolean;
8
+ /** Non-empty custom text counts as a selected multi-value. */
9
+ checked: boolean;
10
+ /** `state.inputMode` — true once the row has focus and keystrokes append to the buffer. */
11
+ inputMode: boolean;
12
+ /** Live inline-input buffer (read from `runtime.inputBuffer` / `ctx.inputBuffer`). */
13
+ inputBuffer: string;
14
+ inputCursorOffset: number | undefined;
15
+ }
16
+ export interface MultiSelectViewProps {
17
+ rows: ReadonlyArray<{
18
+ checked: boolean;
19
+ active: boolean;
20
+ }>;
21
+ other: MultiSelectOtherRowProps;
22
+ nextActive: boolean;
23
+ nextLabel: string;
24
+ }
25
+ export declare class MultiSelectView implements StatefulView<MultiSelectViewProps> {
26
+ private props;
27
+ private cachedLayout;
28
+ private readonly theme;
29
+ private readonly question;
30
+ constructor(theme: Theme, question: QuestionData);
31
+ setProps(props: MultiSelectViewProps): void;
32
+ handleInput(_data: string): void;
33
+ invalidate(): void;
34
+ render(width: number): string[];
35
+ focusedItemRowRange(width: number): [number, number];
36
+ naturalHeight(width: number): number;
37
+ private layout;
38
+ private appendOptionRows;
39
+ private appendNextRow;
40
+ private renderOtherRow;
41
+ private prefixVisibleWidth;
42
+ }
43
+ //# sourceMappingURL=multi-select-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-select-view.d.ts","sourceRoot":"","sources":["../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/multi-select-view.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAEhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAaxD,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAE3C,MAAM,WAAW,wBAAwB;IACxC,qFAAqF;IACrF,MAAM,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,2FAA2F;IAC3F,SAAS,EAAE,OAAO,CAAC;IACnB,sFAAsF;IACtF,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,aAAa,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC3D,KAAK,EAAE,wBAAwB,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CAClB;AAwBD,qBAAa,eAAgB,YAAW,YAAY,CAAC,oBAAoB,CAAC;IACzE,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,YAAY,CAA0D;IAE9E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAe;IAExC,YAAY,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAS/C;IAED,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAG1C;IAED,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAG;IAEnC,UAAU,IAAI,IAAI,CAEjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAE9B;IAED,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAEnD;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnC;IAED,OAAO,CAAC,MAAM;IAoBd,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,cAAc;IA0BtB,OAAO,CAAC,kBAAkB;CAa1B"}
@@ -0,0 +1,130 @@
1
+ import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
2
+ import { displayLabel } from "../../state/i18n-bridge.js";
3
+ import { renderInlineInputRow } from "./inline-input.js";
4
+ const ACTIVE_POINTER = "❯ ";
5
+ const INACTIVE_POINTER = " ";
6
+ const CHECKED = "[✔]";
7
+ const UNCHECKED = "[ ]";
8
+ const NUMBER_SEPARATOR = ". ";
9
+ const BOX_LABEL_GAP = " ";
10
+ // CC parity: description continuation indents to col 2 (past the pointer slot), NOT to the
11
+ // full prefix column. Wrap width still uses prefixVisibleWidth so naturalHeight matches render.
12
+ const CONTINUATION_INDENT = " ";
13
+ export const MULTI_SUBMIT_LABEL = "Submit";
14
+ export class MultiSelectView {
15
+ props;
16
+ cachedLayout;
17
+ theme;
18
+ question;
19
+ constructor(theme, question) {
20
+ this.theme = theme;
21
+ this.question = question;
22
+ this.props = {
23
+ rows: [],
24
+ other: { active: false, checked: false, inputMode: false, inputBuffer: "", inputCursorOffset: undefined },
25
+ nextActive: false,
26
+ nextLabel: displayLabel("next"),
27
+ };
28
+ }
29
+ setProps(props) {
30
+ this.props = props;
31
+ this.cachedLayout = undefined;
32
+ }
33
+ handleInput(_data) { }
34
+ invalidate() {
35
+ this.cachedLayout = undefined;
36
+ }
37
+ render(width) {
38
+ return this.layout(width).lines;
39
+ }
40
+ focusedItemRowRange(width) {
41
+ return this.layout(width).focusedRange;
42
+ }
43
+ naturalHeight(width) {
44
+ return this.layout(width).lines.length;
45
+ }
46
+ layout(width) {
47
+ if (this.cachedLayout?.width === width)
48
+ return this.cachedLayout.value;
49
+ const build = { lines: [], focusedRange: [0, 0] };
50
+ const contentWidth = Math.max(1, width - this.prefixVisibleWidth());
51
+ const numberWidth = String(Math.max(1, this.question.options.length + 1)).length;
52
+ this.appendOptionRows(build, width, contentWidth, numberWidth);
53
+ const otherStart = build.lines.length;
54
+ build.lines.push(...this.renderOtherRow(contentWidth, numberWidth));
55
+ if (this.props.other.active)
56
+ build.focusedRange = [otherStart, build.lines.length];
57
+ this.appendNextRow(build, width);
58
+ const value = { lines: build.lines, focusedRange: build.focusedRange };
59
+ this.cachedLayout = { width, value };
60
+ return value;
61
+ }
62
+ appendOptionRows(build, width, contentWidth, numberWidth) {
63
+ for (let i = 0; i < this.question.options.length; i++) {
64
+ const opt = this.question.options[i];
65
+ const row = this.props.rows[i];
66
+ if (!opt || !row)
67
+ continue;
68
+ const start = build.lines.length;
69
+ const pointer = row.active ? this.theme.fg("accent", ACTIVE_POINTER) : INACTIVE_POINTER;
70
+ // Checked and active rows share the accent hue, matching the dialog's selection rhythm.
71
+ const box = row.checked ? this.theme.fg("accent", CHECKED) : this.theme.fg("muted", UNCHECKED);
72
+ const label = truncateToWidth(opt.label, contentWidth, "…");
73
+ const styledLabel = row.active ? this.theme.fg("accent", this.theme.bold(label)) : label;
74
+ const number = String(i + 1).padStart(numberWidth, " ");
75
+ build.lines.push(truncateToWidth(`${pointer}${number}${NUMBER_SEPARATOR}${box}${BOX_LABEL_GAP}${styledLabel}`, width, ""));
76
+ if (opt.description) {
77
+ for (const segment of wrapTextWithAnsi(opt.description, contentWidth)) {
78
+ build.lines.push(CONTINUATION_INDENT + this.theme.fg("muted", segment));
79
+ }
80
+ }
81
+ if (row.active)
82
+ build.focusedRange = [start, build.lines.length];
83
+ }
84
+ }
85
+ appendNextRow(build, width) {
86
+ const nextStart = build.lines.length;
87
+ const nextPointer = this.props.nextActive ? this.theme.fg("accent", ACTIVE_POINTER) : INACTIVE_POINTER;
88
+ const nextLabel = this.props.nextActive
89
+ ? this.theme.fg("accent", this.theme.bold(this.props.nextLabel))
90
+ : this.props.nextLabel;
91
+ build.lines.push(truncateToWidth(`${nextPointer}${nextLabel}`, width, ""));
92
+ if (this.props.nextActive)
93
+ build.focusedRange = [nextStart, build.lines.length];
94
+ }
95
+ renderOtherRow(contentWidth, numberWidth) {
96
+ const other = this.props.other;
97
+ const pointer = other.active ? this.theme.fg("accent", ACTIVE_POINTER) : INACTIVE_POINTER;
98
+ const box = other.checked ? this.theme.fg("accent", CHECKED) : this.theme.fg("muted", UNCHECKED);
99
+ const number = String(this.question.options.length + 1).padStart(numberWidth, " ");
100
+ const rowPrefix = `${pointer}${number}${NUMBER_SEPARATOR}${box}${BOX_LABEL_GAP}`;
101
+ const continuationPrefix = " ".repeat(visibleWidth(rowPrefix));
102
+ const selectedText = (text) => this.theme.fg("accent", this.theme.bold(text));
103
+ if (other.active && other.inputMode) {
104
+ return renderInlineInputRow({
105
+ buffer: other.inputBuffer,
106
+ cursorOffset: other.inputCursorOffset,
107
+ rowPrefix,
108
+ continuationPrefix,
109
+ contentWidth,
110
+ selectedText,
111
+ });
112
+ }
113
+ return wrapTextWithAnsi(other.inputBuffer || displayLabel("other"), contentWidth).map((segment, index) => {
114
+ const line = `${index === 0 ? rowPrefix : continuationPrefix}${segment}`;
115
+ return other.active ? selectedText(line) : line;
116
+ });
117
+ }
118
+ prefixVisibleWidth() {
119
+ // Canonical prefix for OPTION rows: INACTIVE_POINTER + numberWidth digits + NUMBER_SEPARATOR
120
+ // + UNCHECKED + BOX_LABEL_GAP. State-independent because ACTIVE/INACTIVE pointer share
121
+ // visibleWidth, CHECKED/UNCHECKED share visibleWidth, and numberWidth is constant per question.
122
+ // The number column fits `options.length + 1` so the "Type something." row's N+1 number
123
+ // is never clipped. The Next sentinel uses a bare `pointer + "Next"` shape — its width
124
+ // never exceeds this prefix at any reasonable terminal width, so it's safe to leave it
125
+ // out of the canonical computation.
126
+ const numberWidth = String(Math.max(1, this.question.options.length + 1)).length;
127
+ return (visibleWidth(INACTIVE_POINTER) + numberWidth + visibleWidth(`${NUMBER_SEPARATOR}${UNCHECKED}${BOX_LABEL_GAP}`));
128
+ }
129
+ }
130
+ //# sourceMappingURL=multi-select-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-select-view.js","sourceRoot":"","sources":["../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/multi-select-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,OAAO,GAAG,KAAK,CAAC;AACtB,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM,gBAAgB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AAE,KAAK,CAAC,iBAAiB;gBACrC,SAAS;gBACT,kBAAkB;gBAClB,YAAY;gBACZ,YAAY;aACZ,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,gBAAgB,CAAC,KAAK,CAAC,WAAW,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YACxG,MAAM,IAAI,GAAG,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,GAAG,OAAO,EAAE,CAAC;YACzE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACjD,CAAC,CAAC,CAAC;IACJ,CAAC;IAEO,kBAAkB;QACzB,6FAA6F;QAC7F,uFAAuF;QACvF,gGAAgG;QAChG,wFAAwF;QACxF,uFAAuF;QACvF,uFAAuF;QACvF,oCAAoC;QACpC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACjF,OAAO,CACN,YAAY,CAAC,gBAAgB,CAAC,GAAG,WAAW,GAAG,YAAY,CAAC,GAAG,gBAAgB,GAAG,SAAS,GAAG,aAAa,EAAE,CAAC,CAC9G,CAAC;IACH,CAAC;CACD","sourcesContent":["import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../../../../../modes/interactive/theme/theme.ts\";\nimport { displayLabel } from \"../../state/i18n-bridge.ts\";\nimport type { QuestionData } from \"../../tool/types.ts\";\nimport type { StatefulView } from \"../stateful-view.ts\";\nimport { renderInlineInputRow } from \"./inline-input.ts\";\n\nconst ACTIVE_POINTER = \"❯ \";\nconst INACTIVE_POINTER = \" \";\nconst CHECKED = \"[✔]\";\nconst UNCHECKED = \"[ ]\";\nconst NUMBER_SEPARATOR = \". \";\nconst BOX_LABEL_GAP = \" \";\n// CC parity: description continuation indents to col 2 (past the pointer slot), NOT to the\n// full prefix column. Wrap width still uses prefixVisibleWidth so naturalHeight matches render.\nconst CONTINUATION_INDENT = \" \";\n\nexport const MULTI_SUBMIT_LABEL = \"Submit\";\n\nexport interface MultiSelectOtherRowProps {\n\t/** The \"Type something.\" row is the focused row (optionIndex === options.length). */\n\tactive: boolean;\n\t/** Non-empty custom text counts as a selected multi-value. */\n\tchecked: boolean;\n\t/** `state.inputMode` — true once the row has focus and keystrokes append to the buffer. */\n\tinputMode: boolean;\n\t/** Live inline-input buffer (read from `runtime.inputBuffer` / `ctx.inputBuffer`). */\n\tinputBuffer: string;\n\tinputCursorOffset: number | undefined;\n}\n\nexport interface MultiSelectViewProps {\n\trows: ReadonlyArray<{ checked: boolean; active: boolean }>;\n\tother: MultiSelectOtherRowProps;\n\tnextActive: boolean;\n\tnextLabel: string;\n}\n\n/**\n * Renders the multi-select option list (one row per option — pointer + checkbox + label —\n * plus zero or more wrapped continuation lines per description).\n *\n * `naturalHeight(width)` is the rendered height for the current props. It grows when\n * the custom-answer editor contains logical or visually wrapped lines, allowing the\n * dialog to reserve exactly the space the active draft needs.\n *\n * One width-keyed layout supplies rendering, height, and focused-row measurement;\n * `setProps` and `invalidate` discard that derived cache.\n */\ninterface MultiSelectLayout {\n\tlines: string[];\n\tfocusedRange: [number, number];\n}\n\n/** Mutable row accumulator threaded through the append helpers during a layout miss. */\ninterface MultiSelectBuild {\n\tlines: string[];\n\tfocusedRange: [number, number];\n}\n\nexport class MultiSelectView implements StatefulView<MultiSelectViewProps> {\n\tprivate props: MultiSelectViewProps;\n\tprivate cachedLayout: { width: number; value: MultiSelectLayout } | undefined;\n\n\tprivate readonly theme: Theme;\n\tprivate readonly question: QuestionData;\n\n\tconstructor(theme: Theme, question: QuestionData) {\n\t\tthis.theme = theme;\n\t\tthis.question = question;\n\t\tthis.props = {\n\t\t\trows: [],\n\t\t\tother: { active: false, checked: false, inputMode: false, inputBuffer: \"\", inputCursorOffset: undefined },\n\t\t\tnextActive: false,\n\t\t\tnextLabel: displayLabel(\"next\"),\n\t\t};\n\t}\n\n\tsetProps(props: MultiSelectViewProps): void {\n\t\tthis.props = props;\n\t\tthis.cachedLayout = undefined;\n\t}\n\n\thandleInput(_data: string): void {}\n\n\tinvalidate(): void {\n\t\tthis.cachedLayout = undefined;\n\t}\n\n\trender(width: number): string[] {\n\t\treturn this.layout(width).lines;\n\t}\n\n\tfocusedItemRowRange(width: number): [number, number] {\n\t\treturn this.layout(width).focusedRange;\n\t}\n\n\tnaturalHeight(width: number): number {\n\t\treturn this.layout(width).lines.length;\n\t}\n\n\tprivate layout(width: number): MultiSelectLayout {\n\t\tif (this.cachedLayout?.width === width) return this.cachedLayout.value;\n\n\t\tconst build: MultiSelectBuild = { lines: [], focusedRange: [0, 0] };\n\t\tconst contentWidth = Math.max(1, width - this.prefixVisibleWidth());\n\t\tconst numberWidth = String(Math.max(1, this.question.options.length + 1)).length;\n\n\t\tthis.appendOptionRows(build, width, contentWidth, numberWidth);\n\n\t\tconst otherStart = build.lines.length;\n\t\tbuild.lines.push(...this.renderOtherRow(contentWidth, numberWidth));\n\t\tif (this.props.other.active) build.focusedRange = [otherStart, build.lines.length];\n\n\t\tthis.appendNextRow(build, width);\n\n\t\tconst value = { lines: build.lines, focusedRange: build.focusedRange };\n\t\tthis.cachedLayout = { width, value };\n\t\treturn value;\n\t}\n\n\tprivate appendOptionRows(build: MultiSelectBuild, width: number, contentWidth: number, numberWidth: number): void {\n\t\tfor (let i = 0; i < this.question.options.length; i++) {\n\t\t\tconst opt = this.question.options[i];\n\t\t\tconst row = this.props.rows[i];\n\t\t\tif (!opt || !row) continue;\n\t\t\tconst start = build.lines.length;\n\t\t\tconst pointer = row.active ? this.theme.fg(\"accent\", ACTIVE_POINTER) : INACTIVE_POINTER;\n\t\t\t// Checked and active rows share the accent hue, matching the dialog's selection rhythm.\n\t\t\tconst box = row.checked ? this.theme.fg(\"accent\", CHECKED) : this.theme.fg(\"muted\", UNCHECKED);\n\t\t\tconst label = truncateToWidth(opt.label, contentWidth, \"…\");\n\t\t\tconst styledLabel = row.active ? this.theme.fg(\"accent\", this.theme.bold(label)) : label;\n\t\t\tconst number = String(i + 1).padStart(numberWidth, \" \");\n\t\t\tbuild.lines.push(\n\t\t\t\ttruncateToWidth(`${pointer}${number}${NUMBER_SEPARATOR}${box}${BOX_LABEL_GAP}${styledLabel}`, width, \"\"),\n\t\t\t);\n\t\t\tif (opt.description) {\n\t\t\t\tfor (const segment of wrapTextWithAnsi(opt.description, contentWidth)) {\n\t\t\t\t\tbuild.lines.push(CONTINUATION_INDENT + this.theme.fg(\"muted\", segment));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (row.active) build.focusedRange = [start, build.lines.length];\n\t\t}\n\t}\n\n\tprivate appendNextRow(build: MultiSelectBuild, width: number): void {\n\t\tconst nextStart = build.lines.length;\n\t\tconst nextPointer = this.props.nextActive ? this.theme.fg(\"accent\", ACTIVE_POINTER) : INACTIVE_POINTER;\n\t\tconst nextLabel = this.props.nextActive\n\t\t\t? this.theme.fg(\"accent\", this.theme.bold(this.props.nextLabel))\n\t\t\t: this.props.nextLabel;\n\t\tbuild.lines.push(truncateToWidth(`${nextPointer}${nextLabel}`, width, \"\"));\n\t\tif (this.props.nextActive) build.focusedRange = [nextStart, build.lines.length];\n\t}\n\n\tprivate renderOtherRow(contentWidth: number, numberWidth: number): string[] {\n\t\tconst other = this.props.other;\n\t\tconst pointer = other.active ? this.theme.fg(\"accent\", ACTIVE_POINTER) : INACTIVE_POINTER;\n\t\tconst box = other.checked ? this.theme.fg(\"accent\", CHECKED) : this.theme.fg(\"muted\", UNCHECKED);\n\t\tconst number = String(this.question.options.length + 1).padStart(numberWidth, \" \");\n\t\tconst rowPrefix = `${pointer}${number}${NUMBER_SEPARATOR}${box}${BOX_LABEL_GAP}`;\n\t\tconst continuationPrefix = \" \".repeat(visibleWidth(rowPrefix));\n\t\tconst selectedText = (text: string) => this.theme.fg(\"accent\", this.theme.bold(text));\n\n\t\tif (other.active && other.inputMode) {\n\t\t\treturn renderInlineInputRow({\n\t\t\t\tbuffer: other.inputBuffer,\n\t\t\t\tcursorOffset: other.inputCursorOffset,\n\t\t\t\trowPrefix,\n\t\t\t\tcontinuationPrefix,\n\t\t\t\tcontentWidth,\n\t\t\t\tselectedText,\n\t\t\t});\n\t\t}\n\n\t\treturn wrapTextWithAnsi(other.inputBuffer || displayLabel(\"other\"), contentWidth).map((segment, index) => {\n\t\t\tconst line = `${index === 0 ? rowPrefix : continuationPrefix}${segment}`;\n\t\t\treturn other.active ? selectedText(line) : line;\n\t\t});\n\t}\n\n\tprivate prefixVisibleWidth(): number {\n\t\t// Canonical prefix for OPTION rows: INACTIVE_POINTER + numberWidth digits + NUMBER_SEPARATOR\n\t\t// + UNCHECKED + BOX_LABEL_GAP. State-independent because ACTIVE/INACTIVE pointer share\n\t\t// visibleWidth, CHECKED/UNCHECKED share visibleWidth, and numberWidth is constant per question.\n\t\t// The number column fits `options.length + 1` so the \"Type something.\" row's N+1 number\n\t\t// is never clipped. The Next sentinel uses a bare `pointer + \"Next\"` shape — its width\n\t\t// never exceeds this prefix at any reasonable terminal width, so it's safe to leave it\n\t\t// out of the canonical computation.\n\t\tconst numberWidth = String(Math.max(1, this.question.options.length + 1)).length;\n\t\treturn (\n\t\t\tvisibleWidth(INACTIVE_POINTER) + numberWidth + visibleWidth(`${NUMBER_SEPARATOR}${UNCHECKED}${BOX_LABEL_GAP}`)\n\t\t);\n\t}\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import type { StatefulView } from "../stateful-view.ts";
2
+ import { type WrappingSelectItem, type WrappingSelectTheme } from "./wrapping-select.ts";
3
+ /**
4
+ * Maximum number of option rows visible in the WrappingSelect window. Lifted here from
5
+ * `preview-pane.ts` so the cap travels with the option-list owner.
6
+ */
7
+ export declare const MAX_VISIBLE_OPTIONS = 10;
8
+ export interface OptionListViewConfig {
9
+ items: readonly WrappingSelectItem[];
10
+ theme: WrappingSelectTheme;
11
+ }
12
+ /**
13
+ * Per-tick projection of OptionListView state. `inputBuffer`
14
+ * is part of the props bag — the session-owned `inlineInput` (a headless
15
+ * `pi-tui` Editor instance) supplies its current `getText()` here per tick.
16
+ * `OptionListView` is purely props-driven; the imperative buffer surface and
17
+ * read-back getters are gone.
18
+ */
19
+ export interface OptionListViewProps {
20
+ selectedIndex: number;
21
+ focused: boolean;
22
+ inputBuffer: string;
23
+ inputCursorOffset?: number;
24
+ /** Optional previously-confirmed indicator. Omit when no marker should be drawn. */
25
+ confirmed?: {
26
+ index: number;
27
+ labelOverride?: string;
28
+ };
29
+ }
30
+ /**
31
+ * Sole owner of the option list's interactive state. Wraps a single
32
+ * `WrappingSelect`. Implements `StatefulView<OptionListViewProps>`:
33
+ * `setProps` is the only mutator; render output reflects the last props
34
+ * received.
35
+ */
36
+ export declare class OptionListView implements StatefulView<OptionListViewProps> {
37
+ private readonly select;
38
+ constructor(config: OptionListViewConfig);
39
+ setProps(props: OptionListViewProps): void;
40
+ handleInput(_data: string): void;
41
+ invalidate(): void;
42
+ render(width: number): string[];
43
+ focusedItemRowRange(width: number): [number, number];
44
+ }
45
+ //# sourceMappingURL=option-list-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"option-list-view.d.ts","sourceRoot":"","sources":["../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/option-list-view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEzG;;;GAGG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACpC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrC,KAAK,EAAE,mBAAmB,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oFAAoF;IACpF,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACtD;AAED;;;;;GAKG;AACH,qBAAa,cAAe,YAAW,YAAY,CAAC,mBAAmB,CAAC;IACvE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IAExC,YAAY,MAAM,EAAE,oBAAoB,EAKvC;IAED,QAAQ,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAMzC;IAED,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAG;IAEnC,UAAU,IAAI,IAAI,CAEjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAE9B;IAED,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAEnD;CACD"}
@@ -0,0 +1,39 @@
1
+ import { WrappingSelect } from "./wrapping-select.js";
2
+ /**
3
+ * Maximum number of option rows visible in the WrappingSelect window. Lifted here from
4
+ * `preview-pane.ts` so the cap travels with the option-list owner.
5
+ */
6
+ export const MAX_VISIBLE_OPTIONS = 10;
7
+ /**
8
+ * Sole owner of the option list's interactive state. Wraps a single
9
+ * `WrappingSelect`. Implements `StatefulView<OptionListViewProps>`:
10
+ * `setProps` is the only mutator; render output reflects the last props
11
+ * received.
12
+ */
13
+ export class OptionListView {
14
+ select;
15
+ constructor(config) {
16
+ this.select = new WrappingSelect(config.items, Math.min(config.items.length, MAX_VISIBLE_OPTIONS), config.theme, {
17
+ numberStartOffset: 0,
18
+ totalItemsForNumbering: config.items.length,
19
+ });
20
+ }
21
+ setProps(props) {
22
+ this.select.setSelectedIndex(props.selectedIndex);
23
+ this.select.setFocused(props.focused);
24
+ this.select.setConfirmedIndex(props.confirmed?.index, props.confirmed?.labelOverride);
25
+ this.select.setInputBuffer(props.inputBuffer);
26
+ this.select.setInputCursorOffset(props.inputCursorOffset);
27
+ }
28
+ handleInput(_data) { }
29
+ invalidate() {
30
+ this.select.invalidate();
31
+ }
32
+ render(width) {
33
+ return this.select.render(width);
34
+ }
35
+ focusedItemRowRange(width) {
36
+ return this.select.focusedItemRowRange(width);
37
+ }
38
+ }
39
+ //# sourceMappingURL=option-list-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"option-list-view.js","sourceRoot":"","sources":["../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/option-list-view.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAqD,MAAM,sBAAsB,CAAC;AAEzG;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAuBtC;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IACT,MAAM,CAAiB;IAExC,YAAY,MAA4B;QACvC,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE;YAChH,iBAAiB,EAAE,CAAC;YACpB,sBAAsB,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;SAC3C,CAAC,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,KAA0B;QAClC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QACtF,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC3D,CAAC;IAED,WAAW,CAAC,KAAa,IAAS,CAAC;IAEnC,UAAU;QACT,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,KAAa;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,mBAAmB,CAAC,KAAa;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;CACD","sourcesContent":["import type { StatefulView } from \"../stateful-view.ts\";\nimport { WrappingSelect, type WrappingSelectItem, type WrappingSelectTheme } from \"./wrapping-select.ts\";\n\n/**\n * Maximum number of option rows visible in the WrappingSelect window. Lifted here from\n * `preview-pane.ts` so the cap travels with the option-list owner.\n */\nexport const MAX_VISIBLE_OPTIONS = 10;\n\nexport interface OptionListViewConfig {\n\titems: readonly WrappingSelectItem[];\n\ttheme: WrappingSelectTheme;\n}\n\n/**\n * Per-tick projection of OptionListView state. `inputBuffer`\n * is part of the props bag — the session-owned `inlineInput` (a headless\n * `pi-tui` Editor instance) supplies its current `getText()` here per tick.\n * `OptionListView` is purely props-driven; the imperative buffer surface and\n * read-back getters are gone.\n */\nexport interface OptionListViewProps {\n\tselectedIndex: number;\n\tfocused: boolean;\n\tinputBuffer: string;\n\tinputCursorOffset?: number;\n\t/** Optional previously-confirmed indicator. Omit when no marker should be drawn. */\n\tconfirmed?: { index: number; labelOverride?: string };\n}\n\n/**\n * Sole owner of the option list's interactive state. Wraps a single\n * `WrappingSelect`. Implements `StatefulView<OptionListViewProps>`:\n * `setProps` is the only mutator; render output reflects the last props\n * received.\n */\nexport class OptionListView implements StatefulView<OptionListViewProps> {\n\tprivate readonly select: WrappingSelect;\n\n\tconstructor(config: OptionListViewConfig) {\n\t\tthis.select = new WrappingSelect(config.items, Math.min(config.items.length, MAX_VISIBLE_OPTIONS), config.theme, {\n\t\t\tnumberStartOffset: 0,\n\t\t\ttotalItemsForNumbering: config.items.length,\n\t\t});\n\t}\n\n\tsetProps(props: OptionListViewProps): void {\n\t\tthis.select.setSelectedIndex(props.selectedIndex);\n\t\tthis.select.setFocused(props.focused);\n\t\tthis.select.setConfirmedIndex(props.confirmed?.index, props.confirmed?.labelOverride);\n\t\tthis.select.setInputBuffer(props.inputBuffer);\n\t\tthis.select.setInputCursorOffset(props.inputCursorOffset);\n\t}\n\n\thandleInput(_data: string): void {}\n\n\tinvalidate(): void {\n\t\tthis.select.invalidate();\n\t}\n\n\trender(width: number): string[] {\n\t\treturn this.select.render(width);\n\t}\n\n\tfocusedItemRowRange(width: number): [number, number] {\n\t\treturn this.select.focusedItemRowRange(width);\n\t}\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import { type MarkdownTheme } from "@earendil-works/pi-tui";
2
+ import type { Theme } from "../../../../../../../modes/interactive/theme/theme.ts";
3
+ import type { QuestionData } from "../../../tool/types.ts";
4
+ /** CC parity in side-by-side layout. */
5
+ export declare const MAX_PREVIEW_HEIGHT_SIDE_BY_SIDE = 20;
6
+ /** Preserves narrow-terminal protection in stacked layout. */
7
+ export declare const MAX_PREVIEW_HEIGHT_STACKED = 15;
8
+ export declare const NO_PREVIEW_TEXT = "No preview available";
9
+ /** 1 blank separator + 1 affordance text row reserved when `hasAnyPreview` (height stability of the affordance row's offset relative to the box). */
10
+ export declare const NOTES_AFFORDANCE_OVERHEAD = 2;
11
+ /**
12
+ * Per-question cache for rendered markdown previews. Width-keyed: switching the
13
+ * inner width invalidates every cached `Markdown`'s render output (pi-tui's
14
+ * `Markdown.render(width)` re-wraps when width changes).
15
+ *
16
+ * Replaces the inline `previewTexts`, `markdownCache`, `cachedWidth` triple from
17
+ * the previous monolithic `preview-pane.ts`. One Markdown per option, lazy on
18
+ * first request, never re-constructed — count semantics frozen by tests.
19
+ */
20
+ export declare class MarkdownContentCache {
21
+ private readonly previewTexts;
22
+ private readonly markdownCache;
23
+ private cachedWidth;
24
+ private readonly theme;
25
+ private readonly markdownTheme;
26
+ constructor(question: QuestionData, theme: Theme, markdownTheme: MarkdownTheme);
27
+ hasAnyPreview(): boolean;
28
+ has(optionIndex: number): boolean;
29
+ /**
30
+ * Compute the body lines for a given option at a given inner width. Width changes
31
+ * invalidate the per-Markdown render cache.
32
+ */
33
+ bodyFor(optionIndex: number, innerWidth: number): string[];
34
+ invalidate(): void;
35
+ }
36
+ //# sourceMappingURL=markdown-content-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-content-cache.d.ts","sourceRoot":"","sources":["../../../../../../../../src/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,aAAa,EAAgB,MAAM,wBAAwB,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uDAAuD,CAAC;AAEnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,wCAAwC;AACxC,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAClD,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,eAAe,yBAAyB,CAAC;AACtD,qJAAqJ;AACrJ,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;;;;;;;GAQG;AACH,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAwB;IACtD,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAE9C,YAAY,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAS7E;IAED,aAAa,IAAI,OAAO,CAEvB;IAED,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAEhC;IAED;;;OAGG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBzD;IAED,UAAU,IAAI,IAAI,CAGjB;CACD"}