@humain/humain-code 0.8.3 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (926) hide show
  1. package/CHANGELOG.md +147 -0
  2. package/dist/bundle/agent-monitor.js +1 -1
  3. package/dist/bundle/chunks/anthropic-messages-42CGJCSR.js +82 -0
  4. package/dist/bundle/chunks/ask-VH7GNX75.js +97 -0
  5. package/dist/bundle/chunks/azure-openai-responses-DOKKMBUN.js +15 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +200 -179
  7. package/dist/bundle/chunks/bowser-UX7KDMIY.js +92 -0
  8. package/dist/bundle/chunks/{chunk-46C6D7UC.js → chunk-2CYGUEQO.js} +1 -1
  9. package/dist/bundle/chunks/chunk-2RXTZK2V.js +177 -0
  10. package/dist/bundle/chunks/{chunk-2XD7TLKB.js → chunk-3OOOEJV4.js} +16 -16
  11. package/dist/bundle/chunks/chunk-3RXT35Y3.js +3 -0
  12. package/dist/bundle/chunks/{chunk-MPRAQ6ZI.js → chunk-4LGBXPUD.js} +1 -1
  13. package/dist/bundle/chunks/chunk-4SL6URR3.js +90 -0
  14. package/dist/bundle/chunks/{chunk-AW24RHGJ.js → chunk-53DWQSBC.js} +4 -4
  15. package/dist/bundle/chunks/{chunk-LSRXA7OS.js → chunk-5C5K4EVJ.js} +3 -3
  16. package/dist/bundle/chunks/{chunk-2JNJJ6SZ.js → chunk-5KUCY54O.js} +3 -3
  17. package/dist/bundle/chunks/{chunk-4TDNOR36.js → chunk-625QJSFJ.js} +1 -1
  18. package/dist/bundle/chunks/chunk-7DIRHF4H.js +17 -0
  19. package/dist/bundle/chunks/{chunk-QJB5YI3I.js → chunk-7PAXKU7M.js} +1 -1
  20. package/dist/bundle/chunks/chunk-7XRMMCKG.js +2477 -0
  21. package/dist/bundle/chunks/{chunk-R2KD2HFT.js → chunk-7YB3HRRN.js} +83 -196
  22. package/dist/bundle/chunks/{chunk-DCXHRP6C.js → chunk-A2UZYK23.js} +13 -13
  23. package/dist/bundle/chunks/chunk-A5ZMBTTM.js +12 -0
  24. package/dist/bundle/chunks/{chunk-JKX5EGOT.js → chunk-AER66CNP.js} +13 -13
  25. package/dist/bundle/chunks/chunk-B3FT6L6S.js +131 -0
  26. package/dist/bundle/chunks/{chunk-VSXVZVBE.js → chunk-BDNX23GT.js} +433 -412
  27. package/dist/bundle/chunks/chunk-BIC5BSNX.js +13 -0
  28. package/dist/bundle/chunks/{chunk-JSHKS7VH.js → chunk-BNZZJ4LO.js} +1 -1
  29. package/dist/bundle/chunks/{chunk-4MKATHT2.js → chunk-CG43CMFH.js} +1 -1
  30. package/dist/bundle/chunks/{chunk-VFLVWPLZ.js → chunk-CKFLQGJN.js} +20 -16
  31. package/dist/bundle/chunks/{chunk-7LSTTCSC.js → chunk-COZTJAOY.js} +348 -177
  32. package/dist/bundle/chunks/chunk-D4UCXXDP.js +115 -0
  33. package/dist/bundle/chunks/{chunk-HQMUDHC3.js → chunk-D6ZWWDW5.js} +6 -5
  34. package/dist/bundle/chunks/{chunk-MUN4ZZZP.js → chunk-EWPEY4F4.js} +1341 -1366
  35. package/dist/bundle/chunks/{chunk-FJIISX5W.js → chunk-F74XLJPC.js} +195 -192
  36. package/dist/bundle/chunks/chunk-FDRBTGFJ.js +4 -0
  37. package/dist/bundle/chunks/chunk-FHP5BULR.js +5 -0
  38. package/dist/bundle/chunks/{chunk-E4VUW4RI.js → chunk-FLWO3H5J.js} +12 -12
  39. package/dist/bundle/chunks/{chunk-KLSRGGOH.js → chunk-G2PFPQX7.js} +2 -2
  40. package/dist/bundle/chunks/chunk-GMPJWLZS.js +57 -0
  41. package/dist/bundle/chunks/{chunk-M5TVWJ5T.js → chunk-H35P7ROY.js} +462 -441
  42. package/dist/bundle/chunks/chunk-HCHCYBNK.js +2 -0
  43. package/dist/bundle/chunks/{chunk-7WE77IE3.js → chunk-HRNYDRL7.js} +1 -1
  44. package/dist/bundle/chunks/chunk-HWFAAGYK.js +23 -0
  45. package/dist/bundle/chunks/{chunk-PVNXN2TC.js → chunk-II5C7G67.js} +1 -1
  46. package/dist/bundle/chunks/{chunk-F2H47FRF.js → chunk-IMRZP5SC.js} +182 -137
  47. package/dist/bundle/chunks/chunk-J64VNQ6D.js +13 -0
  48. package/dist/bundle/chunks/{chunk-65FLSKDA.js → chunk-K5EFEIFP.js} +5 -4
  49. package/dist/bundle/chunks/{chunk-KI7CHPWC.js → chunk-KJ3QRSSY.js} +46 -43
  50. package/dist/bundle/chunks/{cli-6DJO467D.js → chunk-KSEO2LRK.js} +12 -10
  51. package/dist/bundle/chunks/{chunk-HHWVVNGG.js → chunk-MA2WCMSN.js} +2 -2
  52. package/dist/bundle/chunks/{chunk-L4J7SMJB.js → chunk-MAEKQSFU.js} +1 -1
  53. package/dist/bundle/chunks/chunk-MHQNLTZR.js +8 -0
  54. package/dist/bundle/chunks/chunk-MLOUZAVZ.js +122 -0
  55. package/dist/bundle/chunks/chunk-MQYR4Q6X.js +5 -0
  56. package/dist/bundle/chunks/chunk-MXF3KYLZ.js +4 -0
  57. package/dist/bundle/chunks/{chunk-GY663MNP.js → chunk-MZRTVX7F.js} +1 -1
  58. package/dist/bundle/chunks/chunk-MZYHSWHX.js +59 -0
  59. package/dist/bundle/chunks/chunk-N3W4ALAM.js +1151 -0
  60. package/dist/bundle/chunks/{chunk-6HTHDVJC.js → chunk-NPVRWPGX.js} +1 -1
  61. package/dist/bundle/chunks/{chunk-BRSLXHED.js → chunk-O44A4E4K.js} +1 -1
  62. package/dist/bundle/chunks/{chunk-T2ZGMEMV.js → chunk-OADQOW67.js} +175 -260
  63. package/dist/bundle/chunks/{chunk-J4GII2EE.js → chunk-P7SLTLSZ.js} +51 -46
  64. package/dist/bundle/chunks/{chunk-7OZNMWAJ.js → chunk-PPGSQZZF.js} +1 -1
  65. package/dist/bundle/chunks/chunk-PYX6ZCC7.js +29 -0
  66. package/dist/bundle/chunks/chunk-PZ7NYBHJ.js +8 -0
  67. package/dist/bundle/chunks/{chunk-VCMXBP5S.js → chunk-QESIDBMW.js} +1 -7
  68. package/dist/bundle/chunks/chunk-QUWVILLB.js +3 -0
  69. package/dist/bundle/chunks/chunk-QZWUXGY7.js +99 -0
  70. package/dist/bundle/chunks/{chunk-MIAXMK5F.js → chunk-QZXLTW7V.js} +8 -7
  71. package/dist/bundle/chunks/chunk-RP6MWUAP.js +4 -0
  72. package/dist/bundle/chunks/chunk-SASR4VNV.js +17 -0
  73. package/dist/bundle/chunks/{chunk-JSZBTGI6.js → chunk-SZZ5PNP6.js} +2 -2
  74. package/dist/bundle/chunks/chunk-T5WECB2D.js +7 -0
  75. package/dist/bundle/chunks/{chunk-2NVGOSBN.js → chunk-T7F2TEIS.js} +37 -13
  76. package/dist/bundle/chunks/{chunk-ZSWU5KKA.js → chunk-UOSJTMCL.js} +7 -3
  77. package/dist/bundle/chunks/{chunk-6P6MMQUH.js → chunk-UTRUALFN.js} +3 -3
  78. package/dist/bundle/chunks/{chunk-PWFM6AQQ.js → chunk-V2HTCZRF.js} +70 -67
  79. package/dist/bundle/chunks/{chunk-4GB7A76U.js → chunk-VWUEKLRH.js} +225 -348
  80. package/dist/bundle/chunks/{chunk-JX6YIPNK.js → chunk-WCKS2DPT.js} +1 -1
  81. package/dist/bundle/chunks/chunk-XGOJCV6Z.js +2 -0
  82. package/dist/bundle/chunks/{chunk-7WETECIB.js → chunk-Z7BWHPJ2.js} +1 -1
  83. package/dist/bundle/chunks/chunk-ZFFDBTG3.js +17 -0
  84. package/dist/bundle/chunks/cli-NJLV3XDZ.js +3 -0
  85. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JEZVYITT.js → cloudflare-workers-ai-system-one-ZAZW4M4B.js} +1 -1
  86. package/dist/bundle/chunks/{compat-4ILE5BEC.js → compat-2RC4CJNV.js} +12 -12
  87. package/dist/bundle/chunks/{curator-server-QB4GITGS.js → curator-server-MW645JI3.js} +2 -2
  88. package/dist/bundle/chunks/{dist-NXHRL2KY.js → dist-3DAGUOYC.js} +2 -2
  89. package/dist/bundle/chunks/{dist-I6CI3CG5.js → dist-K4QIXV5O.js} +9 -9
  90. package/dist/bundle/chunks/{dist-35STTNYA.js → dist-NI2PTSLH.js} +1 -1
  91. package/dist/bundle/chunks/{dist-CBODG4CA.js → dist-VXQT3DQY.js} +6 -6
  92. package/dist/bundle/chunks/{dist-cjs-EROMDUKS.js → dist-cjs-4JQA6W3S.js} +31 -31
  93. package/dist/bundle/chunks/doctor-EH7X36SK.js +83 -0
  94. package/dist/bundle/chunks/{easter-egg-3d-VZC5WOYV.js → easter-egg-3d-Z24JLXD4.js} +1 -1
  95. package/dist/bundle/chunks/entry-3EL6GOWK.js +2 -0
  96. package/dist/bundle/chunks/{entry-6XDR2IDE.js → entry-4IMREZBD.js} +80 -79
  97. package/dist/bundle/chunks/{execute-6MEJJF2T.js → execute-C4BZQRPQ.js} +23 -22
  98. package/dist/bundle/chunks/{extract-L373D6O7.js → extract-XVQCIS7D.js} +5 -5
  99. package/dist/bundle/chunks/{flow-implementer-XOP4MG5X.js → flow-implementer-J6QTLBTH.js} +5 -5
  100. package/dist/bundle/chunks/github-copilot.js +57 -56
  101. package/dist/bundle/chunks/google-generative-ai-P2P45MYP.js +22 -0
  102. package/dist/bundle/chunks/google-vertex-SHY4IS5F.js +26 -0
  103. package/dist/bundle/chunks/{host-WOLZCWQQ.js → host-YESS2VAB.js} +1 -1
  104. package/dist/bundle/chunks/{index.bundle-HONF3PUD.js → index.bundle-TZT64KLH.js} +102 -89
  105. package/dist/bundle/chunks/{inprocess-MBKFGDM2.js → inprocess-OHNEKTFB.js} +6 -6
  106. package/dist/bundle/chunks/interactive-mode-ZREVRX7W.js +5 -0
  107. package/dist/bundle/chunks/{llama-cpp-classify-KYZT532X.js → llama-cpp-classify-RSRH4KV2.js} +5 -5
  108. package/dist/bundle/chunks/mistral-conversations-YTMJKHHI.js +42 -0
  109. package/dist/bundle/chunks/{node-N7TPBUJB.js → node-FF6QQQLH.js} +1 -1
  110. package/dist/bundle/chunks/openai-codex-responses-NUCJOJSZ.js +97 -0
  111. package/dist/bundle/chunks/openai-completions-E5NRJUHA.js +91 -0
  112. package/dist/bundle/chunks/{openai-decisions-JMSDGR7K.js → openai-decisions-342J5ZYG.js} +1 -1
  113. package/dist/bundle/chunks/openai-responses-BN5Z4HFI.js +26 -0
  114. package/dist/bundle/chunks/openrouter-images-7RNG3JVF.js +12 -0
  115. package/dist/bundle/chunks/{pdfjs-FE3L72A6.js → pdfjs-LSTLRXQW.js} +1415 -1416
  116. package/dist/bundle/chunks/pi-messages-2L7FV5OK.js +22 -0
  117. package/dist/bundle/chunks/questionnaire-session-XEVAK7JS.js +123 -0
  118. package/dist/bundle/chunks/runtime-2FSZRUG5.js +2 -0
  119. package/dist/bundle/chunks/session-picker-666KJIVM.js +4 -0
  120. package/dist/bundle/chunks/startup-ui-INEVSNGK.js +3 -0
  121. package/dist/bundle/chunks/{trace-command-VM7FBWPE.js → trace-command-BCVMZ5ZD.js} +4 -4
  122. package/dist/bundle/chunks/typesafe-system-one-UJUNSZG4.js +3 -0
  123. package/dist/bundle/chunks/{undici-WVNE45GY.js → undici-7IGAYA4S.js} +1 -1
  124. package/dist/bundle/chunks/virtual-modules-6FVRJTM3.js +29 -0
  125. package/dist/bundle/cli-runtime.js +5 -5
  126. package/dist/bundle/flow/package.json +3 -3
  127. package/dist/bundle/index.js +13 -13
  128. package/dist/bundle/orchestrate/package.json +1 -1
  129. package/dist/bundle/rpc-entry.js +5 -4
  130. package/dist/cli/agent-dir-arg.d.ts +12 -0
  131. package/dist/cli/agent-dir-arg.d.ts.map +1 -0
  132. package/dist/cli/agent-dir-arg.js +15 -0
  133. package/dist/cli/agent-dir-arg.js.map +1 -0
  134. package/dist/cli/args.d.ts +9 -0
  135. package/dist/cli/args.d.ts.map +1 -1
  136. package/dist/cli/args.js +19 -5
  137. package/dist/cli/args.js.map +1 -1
  138. package/dist/cli/auth-check.d.ts +1 -1
  139. package/dist/cli/auth-check.d.ts.map +1 -1
  140. package/dist/cli/auth-check.js +4 -2
  141. package/dist/cli/auth-check.js.map +1 -1
  142. package/dist/cli/doctor-config.d.ts +14 -0
  143. package/dist/cli/doctor-config.d.ts.map +1 -0
  144. package/dist/cli/doctor-config.js +92 -0
  145. package/dist/cli/doctor-config.js.map +1 -0
  146. package/dist/cli/doctor-system.d.ts +12 -0
  147. package/dist/cli/doctor-system.d.ts.map +1 -0
  148. package/dist/cli/doctor-system.js +109 -0
  149. package/dist/cli/doctor-system.js.map +1 -0
  150. package/dist/cli/doctor.d.ts +11 -0
  151. package/dist/cli/doctor.d.ts.map +1 -0
  152. package/dist/cli/doctor.js +323 -0
  153. package/dist/cli/doctor.js.map +1 -0
  154. package/dist/cli/doctor.lazy.d.ts +3 -0
  155. package/dist/cli/doctor.lazy.d.ts.map +1 -0
  156. package/dist/cli/doctor.lazy.js +3 -0
  157. package/dist/cli/doctor.lazy.js.map +1 -0
  158. package/dist/cli/list-models.d.ts.map +1 -1
  159. package/dist/cli/list-models.js +0 -4
  160. package/dist/cli/list-models.js.map +1 -1
  161. package/dist/cli/project-trust.d.ts.map +1 -1
  162. package/dist/cli/project-trust.js +6 -6
  163. package/dist/cli/project-trust.js.map +1 -1
  164. package/dist/cli/startup-ui.d.ts +3 -2
  165. package/dist/cli/startup-ui.d.ts.map +1 -1
  166. package/dist/cli/startup-ui.js +23 -10
  167. package/dist/cli/startup-ui.js.map +1 -1
  168. package/dist/config.d.ts +5 -1
  169. package/dist/config.d.ts.map +1 -1
  170. package/dist/config.js +13 -3
  171. package/dist/config.js.map +1 -1
  172. package/dist/coordination/broker/broker.d.ts +3 -3
  173. package/dist/coordination/broker/broker.d.ts.map +1 -1
  174. package/dist/coordination/broker/broker.js +15 -7
  175. package/dist/coordination/broker/broker.js.map +1 -1
  176. package/dist/core/acceptance-command.d.ts +6 -3
  177. package/dist/core/acceptance-command.d.ts.map +1 -1
  178. package/dist/core/acceptance-command.js +43 -12
  179. package/dist/core/acceptance-command.js.map +1 -1
  180. package/dist/core/acceptance-ledger.d.ts +2 -0
  181. package/dist/core/acceptance-ledger.d.ts.map +1 -1
  182. package/dist/core/acceptance-ledger.js +14 -3
  183. package/dist/core/acceptance-ledger.js.map +1 -1
  184. package/dist/core/agent-session-runtime.d.ts +11 -4
  185. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  186. package/dist/core/agent-session-runtime.js +13 -4
  187. package/dist/core/agent-session-runtime.js.map +1 -1
  188. package/dist/core/agent-session-services.d.ts.map +1 -1
  189. package/dist/core/agent-session-services.js +6 -0
  190. package/dist/core/agent-session-services.js.map +1 -1
  191. package/dist/core/agent-session.d.ts +19 -1
  192. package/dist/core/agent-session.d.ts.map +1 -1
  193. package/dist/core/agent-session.js +131 -36
  194. package/dist/core/agent-session.js.map +1 -1
  195. package/dist/core/auth-storage.d.ts.map +1 -1
  196. package/dist/core/auth-storage.js +7 -1
  197. package/dist/core/auth-storage.js.map +1 -1
  198. package/dist/core/bash-executor.d.ts +3 -1
  199. package/dist/core/bash-executor.d.ts.map +1 -1
  200. package/dist/core/bash-executor.js +18 -8
  201. package/dist/core/bash-executor.js.map +1 -1
  202. package/dist/core/bug-report.d.ts +24 -1
  203. package/dist/core/bug-report.d.ts.map +1 -1
  204. package/dist/core/bug-report.js +216 -19
  205. package/dist/core/bug-report.js.map +1 -1
  206. package/dist/core/compaction/branch-summarization.d.ts +2 -2
  207. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  208. package/dist/core/compaction/branch-summarization.js +9 -15
  209. package/dist/core/compaction/branch-summarization.js.map +1 -1
  210. package/dist/core/compaction/compaction.d.ts.map +1 -1
  211. package/dist/core/compaction/compaction.js +3 -0
  212. package/dist/core/compaction/compaction.js.map +1 -1
  213. package/dist/core/export-html/index.d.ts.map +1 -1
  214. package/dist/core/export-html/index.js +12 -10
  215. package/dist/core/export-html/index.js.map +1 -1
  216. package/dist/core/export-html/template.js +23 -1
  217. package/dist/core/extensions/containment.d.ts +26 -0
  218. package/dist/core/extensions/containment.d.ts.map +1 -0
  219. package/dist/core/extensions/containment.js +66 -0
  220. package/dist/core/extensions/containment.js.map +1 -0
  221. package/dist/core/extensions/loader.d.ts.map +1 -1
  222. package/dist/core/extensions/loader.js +65 -7
  223. package/dist/core/extensions/loader.js.map +1 -1
  224. package/dist/core/extensions/runner.d.ts +2 -1
  225. package/dist/core/extensions/runner.d.ts.map +1 -1
  226. package/dist/core/extensions/runner.js +68 -12
  227. package/dist/core/extensions/runner.js.map +1 -1
  228. package/dist/core/extensions/types.d.ts +14 -3
  229. package/dist/core/extensions/types.d.ts.map +1 -1
  230. package/dist/core/extensions/types.js.map +1 -1
  231. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  232. package/dist/core/extensions/wrapper.js +4 -1
  233. package/dist/core/extensions/wrapper.js.map +1 -1
  234. package/dist/core/footer-data-provider.d.ts.map +1 -1
  235. package/dist/core/footer-data-provider.js +2 -4
  236. package/dist/core/footer-data-provider.js.map +1 -1
  237. package/dist/core/http-dispatcher.d.ts +5 -2
  238. package/dist/core/http-dispatcher.d.ts.map +1 -1
  239. package/dist/core/http-dispatcher.js +6 -3
  240. package/dist/core/http-dispatcher.js.map +1 -1
  241. package/dist/core/keybindings.d.ts +20 -0
  242. package/dist/core/keybindings.d.ts.map +1 -1
  243. package/dist/core/keybindings.js +4 -1
  244. package/dist/core/keybindings.js.map +1 -1
  245. package/dist/core/mcp-servers.d.ts +29 -0
  246. package/dist/core/mcp-servers.d.ts.map +1 -1
  247. package/dist/core/mcp-servers.js +63 -17
  248. package/dist/core/mcp-servers.js.map +1 -1
  249. package/dist/core/messages.d.ts +4 -0
  250. package/dist/core/messages.d.ts.map +1 -1
  251. package/dist/core/messages.js +10 -2
  252. package/dist/core/messages.js.map +1 -1
  253. package/dist/core/model-config.d.ts +36 -0
  254. package/dist/core/model-config.d.ts.map +1 -1
  255. package/dist/core/model-resolver.js +1 -1
  256. package/dist/core/model-resolver.js.map +1 -1
  257. package/dist/core/model-runtime.d.ts.map +1 -1
  258. package/dist/core/model-runtime.js +6 -2
  259. package/dist/core/model-runtime.js.map +1 -1
  260. package/dist/core/nested-tool-calls.d.ts +6 -5
  261. package/dist/core/nested-tool-calls.d.ts.map +1 -1
  262. package/dist/core/nested-tool-calls.js +1 -3
  263. package/dist/core/nested-tool-calls.js.map +1 -1
  264. package/dist/core/os-secret-store.js +1 -1
  265. package/dist/core/os-secret-store.js.map +1 -1
  266. package/dist/core/package-manager.d.ts +3 -1
  267. package/dist/core/package-manager.d.ts.map +1 -1
  268. package/dist/core/package-manager.js +25 -4
  269. package/dist/core/package-manager.js.map +1 -1
  270. package/dist/core/pi-ai-schemas.d.ts +4 -0
  271. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  272. package/dist/core/project-trust.d.ts.map +1 -1
  273. package/dist/core/project-trust.js +1 -1
  274. package/dist/core/project-trust.js.map +1 -1
  275. package/dist/core/provider-composer.d.ts +1 -0
  276. package/dist/core/provider-composer.d.ts.map +1 -1
  277. package/dist/core/provider-composer.js +1 -0
  278. package/dist/core/provider-composer.js.map +1 -1
  279. package/dist/core/resolve-config-value.d.ts +4 -0
  280. package/dist/core/resolve-config-value.d.ts.map +1 -1
  281. package/dist/core/resolve-config-value.js +14 -3
  282. package/dist/core/resolve-config-value.js.map +1 -1
  283. package/dist/core/resource-loader.d.ts.map +1 -1
  284. package/dist/core/resource-loader.js +40 -2
  285. package/dist/core/resource-loader.js.map +1 -1
  286. package/dist/core/runtime-credentials.d.ts.map +1 -1
  287. package/dist/core/runtime-credentials.js +11 -7
  288. package/dist/core/runtime-credentials.js.map +1 -1
  289. package/dist/core/sdk.d.ts.map +1 -1
  290. package/dist/core/sdk.js +8 -4
  291. package/dist/core/sdk.js.map +1 -1
  292. package/dist/core/session-manager.d.ts +22 -1
  293. package/dist/core/session-manager.d.ts.map +1 -1
  294. package/dist/core/session-manager.js +227 -37
  295. package/dist/core/session-manager.js.map +1 -1
  296. package/dist/core/settings-defaults.d.ts +10 -1
  297. package/dist/core/settings-defaults.d.ts.map +1 -1
  298. package/dist/core/settings-defaults.js +7 -1
  299. package/dist/core/settings-defaults.js.map +1 -1
  300. package/dist/core/settings-manager.d.ts +14 -4
  301. package/dist/core/settings-manager.d.ts.map +1 -1
  302. package/dist/core/settings-manager.js +48 -15
  303. package/dist/core/settings-manager.js.map +1 -1
  304. package/dist/core/settings-schema.d.ts +20 -2
  305. package/dist/core/settings-schema.d.ts.map +1 -1
  306. package/dist/core/settings-schema.js +27 -4
  307. package/dist/core/settings-schema.js.map +1 -1
  308. package/dist/core/slash-commands.d.ts.map +1 -1
  309. package/dist/core/slash-commands.js +2 -0
  310. package/dist/core/slash-commands.js.map +1 -1
  311. package/dist/core/tools/bash-jobs.js +2 -2
  312. package/dist/core/tools/bash-jobs.js.map +1 -1
  313. package/dist/core/tools/bash.d.ts +3 -0
  314. package/dist/core/tools/bash.d.ts.map +1 -1
  315. package/dist/core/tools/bash.js +78 -46
  316. package/dist/core/tools/bash.js.map +1 -1
  317. package/dist/core/tools/edit-diff.d.ts +7 -1
  318. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  319. package/dist/core/tools/edit-diff.js +139 -75
  320. package/dist/core/tools/edit-diff.js.map +1 -1
  321. package/dist/core/tools/edit.d.ts.map +1 -1
  322. package/dist/core/tools/edit.js +4 -1
  323. package/dist/core/tools/edit.js.map +1 -1
  324. package/dist/core/tools/output-accumulator.d.ts +21 -6
  325. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  326. package/dist/core/tools/output-accumulator.js +90 -76
  327. package/dist/core/tools/output-accumulator.js.map +1 -1
  328. package/dist/core/tools/render-utils.d.ts +7 -2
  329. package/dist/core/tools/render-utils.d.ts.map +1 -1
  330. package/dist/core/tools/render-utils.js +14 -1
  331. package/dist/core/tools/render-utils.js.map +1 -1
  332. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  333. package/dist/core/tools/renderers/bash.js +9 -3
  334. package/dist/core/tools/renderers/bash.js.map +1 -1
  335. package/dist/core/tools/truncate.d.ts +1 -1
  336. package/dist/core/tools/truncate.d.ts.map +1 -1
  337. package/dist/core/tools/truncate.js +16 -7
  338. package/dist/core/tools/truncate.js.map +1 -1
  339. package/dist/core/tools/write.d.ts.map +1 -1
  340. package/dist/core/tools/write.js +2 -0
  341. package/dist/core/tools/write.js.map +1 -1
  342. package/dist/core/trust-manager.d.ts +2 -0
  343. package/dist/core/trust-manager.d.ts.map +1 -1
  344. package/dist/core/trust-manager.js +5 -4
  345. package/dist/core/trust-manager.js.map +1 -1
  346. package/dist/core/usage-totals.d.ts.map +1 -1
  347. package/dist/core/usage-totals.js +3 -0
  348. package/dist/core/usage-totals.js.map +1 -1
  349. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  350. package/dist/extensions/codemode/execute.js +64 -20
  351. package/dist/extensions/codemode/execute.js.map +1 -1
  352. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  353. package/dist/extensions/codemode/renderer.js +8 -3
  354. package/dist/extensions/codemode/renderer.js.map +1 -1
  355. package/dist/extensions/codemode/tool.d.ts +5 -0
  356. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  357. package/dist/extensions/codemode/tool.js.map +1 -1
  358. package/dist/extensions/llama/client.d.ts.map +1 -1
  359. package/dist/extensions/llama/client.js +3 -13
  360. package/dist/extensions/llama/client.js.map +1 -1
  361. package/dist/extensions/llama/ui.d.ts.map +1 -1
  362. package/dist/extensions/llama/ui.js +2 -1
  363. package/dist/extensions/llama/ui.js.map +1 -1
  364. package/dist/extensions/mcp/cli.d.ts +7 -0
  365. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  366. package/dist/extensions/mcp/cli.js +35 -8
  367. package/dist/extensions/mcp/cli.js.map +1 -1
  368. package/dist/extensions/mcp/config.d.ts +33 -0
  369. package/dist/extensions/mcp/config.d.ts.map +1 -1
  370. package/dist/extensions/mcp/config.js +11 -2
  371. package/dist/extensions/mcp/config.js.map +1 -1
  372. package/dist/extensions/mcp/index.d.ts +8 -0
  373. package/dist/extensions/mcp/index.d.ts.map +1 -1
  374. package/dist/extensions/mcp/index.js +16 -0
  375. package/dist/extensions/mcp/index.js.map +1 -1
  376. package/dist/extensions/mcp/resources.d.ts +1 -1
  377. package/dist/extensions/mcp/resources.d.ts.map +1 -1
  378. package/dist/extensions/mcp/resources.js +4 -3
  379. package/dist/extensions/mcp/resources.js.map +1 -1
  380. package/dist/extensions/mcp/runtime.d.ts +1 -1
  381. package/dist/extensions/mcp/runtime.d.ts.map +1 -1
  382. package/dist/extensions/mcp/runtime.js +15 -14
  383. package/dist/extensions/mcp/runtime.js.map +1 -1
  384. package/dist/extensions/mcp/tools.d.ts +1 -24
  385. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  386. package/dist/extensions/mcp/tools.js +10 -163
  387. package/dist/extensions/mcp/tools.js.map +1 -1
  388. package/dist/humain/ask-user-question/index.d.ts +4 -0
  389. package/dist/humain/ask-user-question/index.d.ts.map +1 -0
  390. package/dist/humain/ask-user-question/index.js +18 -0
  391. package/dist/humain/ask-user-question/index.js.map +1 -0
  392. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts +38 -0
  393. package/dist/humain/ask-user-question/vendor/ask/answer-channel.d.ts.map +1 -0
  394. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js +97 -0
  395. package/dist/humain/ask-user-question/vendor/ask/answer-channel.js.map +1 -0
  396. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts +41 -0
  397. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.d.ts.map +1 -0
  398. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js +441 -0
  399. package/dist/humain/ask-user-question/vendor/ask/ask-user-question.js.map +1 -0
  400. package/dist/humain/ask-user-question/vendor/ask/config.d.ts +39 -0
  401. package/dist/humain/ask-user-question/vendor/ask/config.d.ts.map +1 -0
  402. package/dist/humain/ask-user-question/vendor/ask/config.js +95 -0
  403. package/dist/humain/ask-user-question/vendor/ask/config.js.map +1 -0
  404. package/dist/humain/ask-user-question/vendor/ask/events.d.ts +132 -0
  405. package/dist/humain/ask-user-question/vendor/ask/events.d.ts.map +1 -0
  406. package/dist/humain/ask-user-question/vendor/ask/events.js +50 -0
  407. package/dist/humain/ask-user-question/vendor/ask/events.js.map +1 -0
  408. package/dist/humain/ask-user-question/vendor/ask/index.d.ts +5 -0
  409. package/dist/humain/ask-user-question/vendor/ask/index.d.ts.map +1 -0
  410. package/dist/humain/ask-user-question/vendor/ask/index.js +15 -0
  411. package/dist/humain/ask-user-question/vendor/ask/index.js.map +1 -0
  412. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts +81 -0
  413. package/dist/humain/ask-user-question/vendor/ask/presentation.d.ts.map +1 -0
  414. package/dist/humain/ask-user-question/vendor/ask/presentation.js +105 -0
  415. package/dist/humain/ask-user-question/vendor/ask/presentation.js.map +1 -0
  416. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts +28 -0
  417. package/dist/humain/ask-user-question/vendor/ask/reconcile.d.ts.map +1 -0
  418. package/dist/humain/ask-user-question/vendor/ask/reconcile.js +45 -0
  419. package/dist/humain/ask-user-question/vendor/ask/reconcile.js.map +1 -0
  420. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts +41 -0
  421. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.d.ts.map +1 -0
  422. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js +166 -0
  423. package/dist/humain/ask-user-question/vendor/ask/rpc-fallback.js.map +1 -0
  424. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts +46 -0
  425. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.d.ts.map +1 -0
  426. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js +247 -0
  427. package/dist/humain/ask-user-question/vendor/ask/state/build-questionnaire.js.map +1 -0
  428. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts +11 -0
  429. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.d.ts.map +1 -0
  430. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js +56 -0
  431. package/dist/humain/ask-user-question/vendor/ask/state/external-editor.js.map +1 -0
  432. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts +6 -0
  433. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.d.ts.map +1 -0
  434. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js +10 -0
  435. package/dist/humain/ask-user-question/vendor/ask/state/i18n-bridge.js.map +1 -0
  436. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts +57 -0
  437. package/dist/humain/ask-user-question/vendor/ask/state/key-router.d.ts.map +1 -0
  438. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js +357 -0
  439. package/dist/humain/ask-user-question/vendor/ask/state/key-router.js.map +1 -0
  440. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts +112 -0
  441. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.d.ts.map +1 -0
  442. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js +240 -0
  443. package/dist/humain/ask-user-question/vendor/ask/state/questionnaire-session.js.map +1 -0
  444. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts +87 -0
  445. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.d.ts.map +1 -0
  446. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js +79 -0
  447. package/dist/humain/ask-user-question/vendor/ask/state/row-intent.js.map +1 -0
  448. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts +22 -0
  449. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.d.ts.map +1 -0
  450. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js +2 -0
  451. package/dist/humain/ask-user-question/vendor/ask/state/selectors/contract.js.map +1 -0
  452. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts +27 -0
  453. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.d.ts.map +1 -0
  454. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js +48 -0
  455. package/dist/humain/ask-user-question/vendor/ask/state/selectors/derivations.js.map +1 -0
  456. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts +13 -0
  457. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.d.ts.map +1 -0
  458. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js +15 -0
  459. package/dist/humain/ask-user-question/vendor/ask/state/selectors/focus.js.map +1 -0
  460. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts +14 -0
  461. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.d.ts.map +1 -0
  462. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js +96 -0
  463. package/dist/humain/ask-user-question/vendor/ask/state/selectors/projections.js.map +1 -0
  464. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts +58 -0
  465. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.d.ts.map +1 -0
  466. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js +310 -0
  467. package/dist/humain/ask-user-question/vendor/ask/state/state-reducer.js.map +1 -0
  468. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts +68 -0
  469. package/dist/humain/ask-user-question/vendor/ask/state/state.d.ts.map +1 -0
  470. package/dist/humain/ask-user-question/vendor/ask/state/state.js +2 -0
  471. package/dist/humain/ask-user-question/vendor/ask/state/state.js.map +1 -0
  472. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts +24 -0
  473. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.d.ts.map +1 -0
  474. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js +114 -0
  475. package/dist/humain/ask-user-question/vendor/ask/tool/external-answer.js.map +1 -0
  476. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts +18 -0
  477. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.d.ts.map +1 -0
  478. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js +29 -0
  479. package/dist/humain/ask-user-question/vendor/ask/tool/format-answer.js.map +1 -0
  480. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts +41 -0
  481. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.d.ts.map +1 -0
  482. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js +99 -0
  483. package/dist/humain/ask-user-question/vendor/ask/tool/normalize-params.js.map +1 -0
  484. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts +37 -0
  485. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.d.ts.map +1 -0
  486. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js +70 -0
  487. package/dist/humain/ask-user-question/vendor/ask/tool/response-envelope.js.map +1 -0
  488. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts +129 -0
  489. package/dist/humain/ask-user-question/vendor/ask/tool/types.d.ts.map +1 -0
  490. package/dist/humain/ask-user-question/vendor/ask/tool/types.js +76 -0
  491. package/dist/humain/ask-user-question/vendor/ask/tool/types.js.map +1 -0
  492. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts +21 -0
  493. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.d.ts.map +1 -0
  494. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js +49 -0
  495. package/dist/humain/ask-user-question/vendor/ask/tool/validate-questionnaire.js.map +1 -0
  496. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts +23 -0
  497. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.d.ts.map +1 -0
  498. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js +16 -0
  499. package/dist/humain/ask-user-question/vendor/ask/view/component-binding.js.map +1 -0
  500. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts +21 -0
  501. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.d.ts.map +1 -0
  502. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js +49 -0
  503. package/dist/humain/ask-user-question/vendor/ask/view/components/inline-input.js.map +1 -0
  504. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts +43 -0
  505. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.d.ts.map +1 -0
  506. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js +130 -0
  507. package/dist/humain/ask-user-question/vendor/ask/view/components/multi-select-view.js.map +1 -0
  508. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts +45 -0
  509. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.d.ts.map +1 -0
  510. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js +39 -0
  511. package/dist/humain/ask-user-question/vendor/ask/view/components/option-list-view.js.map +1 -0
  512. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts +36 -0
  513. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.d.ts.map +1 -0
  514. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js +72 -0
  515. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/markdown-content-cache.js.map +1 -0
  516. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts +61 -0
  517. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.d.ts.map +1 -0
  518. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js +108 -0
  519. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-block-renderer.js.map +1 -0
  520. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts +39 -0
  521. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.d.ts.map +1 -0
  522. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js +76 -0
  523. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-box-renderer.js.map +1 -0
  524. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts +123 -0
  525. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.d.ts.map +1 -0
  526. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js +180 -0
  527. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-layout-decider.js.map +1 -0
  528. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts +108 -0
  529. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.d.ts.map +1 -0
  530. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js +235 -0
  531. package/dist/humain/ask-user-question/vendor/ask/view/components/preview/preview-pane.js.map +1 -0
  532. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts +37 -0
  533. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.d.ts.map +1 -0
  534. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js +47 -0
  535. package/dist/humain/ask-user-question/vendor/ask/view/components/submit-picker.js.map +1 -0
  536. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts +31 -0
  537. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.d.ts.map +1 -0
  538. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js +35 -0
  539. package/dist/humain/ask-user-question/vendor/ask/view/components/tab-bar.js.map +1 -0
  540. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts +124 -0
  541. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.d.ts.map +1 -0
  542. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js +205 -0
  543. package/dist/humain/ask-user-question/vendor/ask/view/components/wrapping-select.js.map +1 -0
  544. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts +83 -0
  545. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.d.ts.map +1 -0
  546. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js +186 -0
  547. package/dist/humain/ask-user-question/vendor/ask/view/dialog-builder.js.map +1 -0
  548. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts +47 -0
  549. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.d.ts.map +1 -0
  550. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js +48 -0
  551. package/dist/humain/ask-user-question/vendor/ask/view/dialog-copy.js.map +1 -0
  552. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts +58 -0
  553. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.d.ts.map +1 -0
  554. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js +84 -0
  555. package/dist/humain/ask-user-question/vendor/ask/view/props-adapter.js.map +1 -0
  556. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts +20 -0
  557. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.d.ts.map +1 -0
  558. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js +55 -0
  559. package/dist/humain/ask-user-question/vendor/ask/view/scroll-window.js.map +1 -0
  560. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts +23 -0
  561. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.d.ts.map +1 -0
  562. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js +2 -0
  563. package/dist/humain/ask-user-question/vendor/ask/view/stateful-view.js.map +1 -0
  564. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts +15 -0
  565. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.d.ts.map +1 -0
  566. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js +2 -0
  567. package/dist/humain/ask-user-question/vendor/ask/view/tab-components.js.map +1 -0
  568. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts +98 -0
  569. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.d.ts.map +1 -0
  570. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js +248 -0
  571. package/dist/humain/ask-user-question/vendor/ask/view/tab-content-strategy.js.map +1 -0
  572. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts +23 -0
  573. package/dist/humain/ask-user-question/vendor/ask/view/transcript.d.ts.map +1 -0
  574. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js +131 -0
  575. package/dist/humain/ask-user-question/vendor/ask/view/transcript.js.map +1 -0
  576. package/dist/humain/ask-user-question/vendor/config/config.d.ts +132 -0
  577. package/dist/humain/ask-user-question/vendor/config/config.d.ts.map +1 -0
  578. package/dist/humain/ask-user-question/vendor/config/config.js +286 -0
  579. package/dist/humain/ask-user-question/vendor/config/config.js.map +1 -0
  580. package/dist/humain/ask-user-question/vendor/config/index.d.ts +2 -0
  581. package/dist/humain/ask-user-question/vendor/config/index.d.ts.map +1 -0
  582. package/dist/humain/ask-user-question/vendor/config/index.js +2 -0
  583. package/dist/humain/ask-user-question/vendor/config/index.js.map +1 -0
  584. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts +64 -0
  585. package/dist/humain/ask-user-question/vendor/i18n/i18n.d.ts.map +1 -0
  586. package/dist/humain/ask-user-question/vendor/i18n/i18n.js +185 -0
  587. package/dist/humain/ask-user-question/vendor/i18n/i18n.js.map +1 -0
  588. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts +44 -0
  589. package/dist/humain/ask-user-question/vendor/i18n/loader.d.ts.map +1 -0
  590. package/dist/humain/ask-user-question/vendor/i18n/loader.js +55 -0
  591. package/dist/humain/ask-user-question/vendor/i18n/loader.js.map +1 -0
  592. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +26 -16
  593. package/dist/humain/brand-logo.d.ts +2 -0
  594. package/dist/humain/brand-logo.d.ts.map +1 -1
  595. package/dist/humain/brand-logo.js +4 -0
  596. package/dist/humain/brand-logo.js.map +1 -1
  597. package/dist/humain/bundled-extension-names.d.ts +1 -0
  598. package/dist/humain/bundled-extension-names.d.ts.map +1 -1
  599. package/dist/humain/bundled-extension-names.js +1 -0
  600. package/dist/humain/bundled-extension-names.js.map +1 -1
  601. package/dist/humain/checklist/footer-progress.d.ts +7 -0
  602. package/dist/humain/checklist/footer-progress.d.ts.map +1 -0
  603. package/dist/humain/checklist/footer-progress.js +15 -0
  604. package/dist/humain/checklist/footer-progress.js.map +1 -0
  605. package/dist/humain/checklist/glyphs.d.ts +7 -0
  606. package/dist/humain/checklist/glyphs.d.ts.map +1 -0
  607. package/dist/humain/checklist/glyphs.js +8 -0
  608. package/dist/humain/checklist/glyphs.js.map +1 -0
  609. package/dist/humain/checklist/index.d.ts +6 -0
  610. package/dist/humain/checklist/index.d.ts.map +1 -0
  611. package/dist/humain/checklist/index.js +37 -0
  612. package/dist/humain/checklist/index.js.map +1 -0
  613. package/dist/humain/checklist/progress.d.ts +37 -0
  614. package/dist/humain/checklist/progress.d.ts.map +1 -0
  615. package/dist/humain/checklist/progress.js +234 -0
  616. package/dist/humain/checklist/progress.js.map +1 -0
  617. package/dist/humain/checklist/projector.d.ts +53 -0
  618. package/dist/humain/checklist/projector.d.ts.map +1 -0
  619. package/dist/humain/checklist/projector.js +198 -0
  620. package/dist/humain/checklist/projector.js.map +1 -0
  621. package/dist/humain/checklist/sidebar.d.ts +18 -0
  622. package/dist/humain/checklist/sidebar.d.ts.map +1 -0
  623. package/dist/humain/checklist/sidebar.js +38 -0
  624. package/dist/humain/checklist/sidebar.js.map +1 -0
  625. package/dist/humain/checklist/status-segment.d.ts +19 -0
  626. package/dist/humain/checklist/status-segment.d.ts.map +1 -0
  627. package/dist/humain/checklist/status-segment.js +59 -0
  628. package/dist/humain/checklist/status-segment.js.map +1 -0
  629. package/dist/humain/checklist/vendor/add-task-dialog.d.ts +54 -0
  630. package/dist/humain/checklist/vendor/add-task-dialog.d.ts.map +1 -0
  631. package/dist/humain/checklist/vendor/add-task-dialog.js +238 -0
  632. package/dist/humain/checklist/vendor/add-task-dialog.js.map +1 -0
  633. package/dist/humain/checklist/vendor/commands.d.ts +38 -0
  634. package/dist/humain/checklist/vendor/commands.d.ts.map +1 -0
  635. package/dist/humain/checklist/vendor/commands.js +205 -0
  636. package/dist/humain/checklist/vendor/commands.js.map +1 -0
  637. package/dist/humain/checklist/vendor/index.d.ts +3 -0
  638. package/dist/humain/checklist/vendor/index.d.ts.map +1 -0
  639. package/dist/humain/checklist/vendor/index.js +276 -0
  640. package/dist/humain/checklist/vendor/index.js.map +1 -0
  641. package/dist/humain/checklist/vendor/render.d.ts +97 -0
  642. package/dist/humain/checklist/vendor/render.d.ts.map +1 -0
  643. package/dist/humain/checklist/vendor/render.js +354 -0
  644. package/dist/humain/checklist/vendor/render.js.map +1 -0
  645. package/dist/humain/checklist/vendor/settings.d.ts +11 -0
  646. package/dist/humain/checklist/vendor/settings.d.ts.map +1 -0
  647. package/dist/humain/checklist/vendor/settings.js +8 -0
  648. package/dist/humain/checklist/vendor/settings.js.map +1 -0
  649. package/dist/humain/checklist/vendor/store.d.ts +120 -0
  650. package/dist/humain/checklist/vendor/store.d.ts.map +1 -0
  651. package/dist/humain/checklist/vendor/store.js +990 -0
  652. package/dist/humain/checklist/vendor/store.js.map +1 -0
  653. package/dist/humain/checklist/vendor/tools.d.ts +21 -0
  654. package/dist/humain/checklist/vendor/tools.d.ts.map +1 -0
  655. package/dist/humain/checklist/vendor/tools.js +162 -0
  656. package/dist/humain/checklist/vendor/tools.js.map +1 -0
  657. package/dist/humain/checklist/vendor/types.d.ts +188 -0
  658. package/dist/humain/checklist/vendor/types.d.ts.map +1 -0
  659. package/dist/humain/checklist/vendor/types.js +32 -0
  660. package/dist/humain/checklist/vendor/types.js.map +1 -0
  661. package/dist/humain/flow-loader.d.ts.map +1 -1
  662. package/dist/humain/flow-loader.js +31 -5
  663. package/dist/humain/flow-loader.js.map +1 -1
  664. package/dist/humain/gateway/catalog.d.ts +1 -0
  665. package/dist/humain/gateway/catalog.d.ts.map +1 -1
  666. package/dist/humain/gateway/catalog.js +1 -0
  667. package/dist/humain/gateway/catalog.js.map +1 -1
  668. package/dist/humain/gateway/client.d.ts +1 -0
  669. package/dist/humain/gateway/client.d.ts.map +1 -1
  670. package/dist/humain/gateway/client.js +8 -1
  671. package/dist/humain/gateway/client.js.map +1 -1
  672. package/dist/humain/gateway/http.d.ts.map +1 -1
  673. package/dist/humain/gateway/http.js +11 -3
  674. package/dist/humain/gateway/http.js.map +1 -1
  675. package/dist/humain/gateway/images.d.ts +3 -0
  676. package/dist/humain/gateway/images.d.ts.map +1 -0
  677. package/dist/humain/gateway/images.js +73 -0
  678. package/dist/humain/gateway/images.js.map +1 -0
  679. package/dist/humain/gateway/provider.js +1 -1
  680. package/dist/humain/gateway/provider.js.map +1 -1
  681. package/dist/humain/hcode/account-store.d.ts.map +1 -1
  682. package/dist/humain/hcode/account-store.js +3 -1
  683. package/dist/humain/hcode/account-store.js.map +1 -1
  684. package/dist/humain/hcode/account.d.ts.map +1 -1
  685. package/dist/humain/hcode/account.js +23 -13
  686. package/dist/humain/hcode/account.js.map +1 -1
  687. package/dist/humain/hcode/images.d.ts.map +1 -1
  688. package/dist/humain/hcode/images.js +19 -13
  689. package/dist/humain/hcode/images.js.map +1 -1
  690. package/dist/humain/hcode/login-failure.d.ts +1 -0
  691. package/dist/humain/hcode/login-failure.d.ts.map +1 -1
  692. package/dist/humain/hcode/login-failure.js +1 -0
  693. package/dist/humain/hcode/login-failure.js.map +1 -1
  694. package/dist/humain/hcode/provider.d.ts.map +1 -1
  695. package/dist/humain/hcode/provider.js +2 -1
  696. package/dist/humain/hcode/provider.js.map +1 -1
  697. package/dist/humain/hcode/run-credential.d.ts +1 -0
  698. package/dist/humain/hcode/run-credential.d.ts.map +1 -1
  699. package/dist/humain/hcode/run-credential.js +12 -4
  700. package/dist/humain/hcode/run-credential.js.map +1 -1
  701. package/dist/humain/index.d.ts.map +1 -1
  702. package/dist/humain/index.js +4 -0
  703. package/dist/humain/index.js.map +1 -1
  704. package/dist/humain/node-provider.d.ts.map +1 -1
  705. package/dist/humain/node-provider.js +37 -8
  706. package/dist/humain/node-provider.js.map +1 -1
  707. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  708. package/dist/humain/web-access/vendor/index.js +11 -1
  709. package/dist/humain/web-access/vendor/index.js.map +1 -1
  710. package/dist/main.d.ts +1 -1
  711. package/dist/main.d.ts.map +1 -1
  712. package/dist/main.js +36 -26
  713. package/dist/main.js.map +1 -1
  714. package/dist/modes/interactive/bug-report.d.ts.map +1 -1
  715. package/dist/modes/interactive/bug-report.js +48 -12
  716. package/dist/modes/interactive/bug-report.js.map +1 -1
  717. package/dist/modes/interactive/chat-viewport.js +1 -1
  718. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  719. package/dist/modes/interactive/components/bash-execution.d.ts +2 -1
  720. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  721. package/dist/modes/interactive/components/bash-execution.js +7 -4
  722. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  723. package/dist/modes/interactive/components/config-selector.js +1 -1
  724. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  725. package/dist/modes/interactive/components/custom-editor.d.ts +2 -0
  726. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  727. package/dist/modes/interactive/components/custom-editor.js +20 -1
  728. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  729. package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
  730. package/dist/modes/interactive/components/extension-editor.js +2 -2
  731. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  732. package/dist/modes/interactive/components/footer.d.ts +7 -0
  733. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  734. package/dist/modes/interactive/components/footer.js +74 -1
  735. package/dist/modes/interactive/components/footer.js.map +1 -1
  736. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  737. package/dist/modes/interactive/components/mermaid.js +11 -4
  738. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  739. package/dist/modes/interactive/components/model-selector.d.ts +2 -0
  740. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  741. package/dist/modes/interactive/components/model-selector.js +56 -8
  742. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  743. package/dist/modes/interactive/components/oauth-selector.d.ts +13 -1
  744. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  745. package/dist/modes/interactive/components/oauth-selector.js +10 -9
  746. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  747. package/dist/modes/interactive/components/session-selector.js +3 -3
  748. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  749. package/dist/modes/interactive/components/settings-selector.d.ts +4 -3
  750. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  751. package/dist/modes/interactive/components/settings-selector.js +83 -37
  752. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  753. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  754. package/dist/modes/interactive/components/settings-submenu.js +3 -3
  755. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  756. package/dist/modes/interactive/components/status-indicator.d.ts +18 -7
  757. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  758. package/dist/modes/interactive/components/status-indicator.js +70 -24
  759. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  760. package/dist/modes/interactive/components/status-line.d.ts +16 -0
  761. package/dist/modes/interactive/components/status-line.d.ts.map +1 -0
  762. package/dist/modes/interactive/components/status-line.js +51 -0
  763. package/dist/modes/interactive/components/status-line.js.map +1 -0
  764. package/dist/modes/interactive/components/tool-execution.d.ts +5 -0
  765. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  766. package/dist/modes/interactive/components/tool-execution.js +8 -1
  767. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  768. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  769. package/dist/modes/interactive/components/visual-truncate.js +11 -3
  770. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  771. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  772. package/dist/modes/interactive/external-editor.js +13 -3
  773. package/dist/modes/interactive/external-editor.js.map +1 -1
  774. package/dist/modes/interactive/interactive-mode.d.ts +20 -4
  775. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  776. package/dist/modes/interactive/interactive-mode.js +260 -154
  777. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  778. package/dist/modes/interactive/program-status-reporter.d.ts +2 -0
  779. package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
  780. package/dist/modes/interactive/program-status-reporter.js +4 -0
  781. package/dist/modes/interactive/program-status-reporter.js.map +1 -1
  782. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  783. package/dist/modes/interactive/session-share.js +9 -1
  784. package/dist/modes/interactive/session-share.js.map +1 -1
  785. package/dist/modes/print-mode.d.ts.map +1 -1
  786. package/dist/modes/print-mode.js +34 -7
  787. package/dist/modes/print-mode.js.map +1 -1
  788. package/dist/modes/rpc/jsonl.js +6 -5
  789. package/dist/modes/rpc/jsonl.js.map +1 -1
  790. package/dist/modes/rpc/rpc-client.d.ts +2 -0
  791. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  792. package/dist/modes/rpc/rpc-client.js +9 -2
  793. package/dist/modes/rpc/rpc-client.js.map +1 -1
  794. package/dist/modes/rpc/rpc-mode.d.ts +2 -1
  795. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  796. package/dist/modes/rpc/rpc-mode.js +113 -13
  797. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  798. package/dist/modes/rpc/rpc-types.d.ts +22 -1
  799. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  800. package/dist/modes/rpc/rpc-types.js.map +1 -1
  801. package/dist/modes/uncaught-errors.d.ts +20 -0
  802. package/dist/modes/uncaught-errors.d.ts.map +1 -0
  803. package/dist/modes/uncaught-errors.js +56 -0
  804. package/dist/modes/uncaught-errors.js.map +1 -0
  805. package/dist/package-manager-cli.d.ts.map +1 -1
  806. package/dist/package-manager-cli.js +10 -1
  807. package/dist/package-manager-cli.js.map +1 -1
  808. package/dist/utils/clipboard-image.js +1 -1
  809. package/dist/utils/clipboard-image.js.map +1 -1
  810. package/dist/utils/clipboard.js +2 -2
  811. package/dist/utils/clipboard.js.map +1 -1
  812. package/dist/utils/image-process.d.ts +5 -0
  813. package/dist/utils/image-process.d.ts.map +1 -1
  814. package/dist/utils/image-process.js +22 -4
  815. package/dist/utils/image-process.js.map +1 -1
  816. package/dist/utils/output-files.d.ts +44 -7
  817. package/dist/utils/output-files.d.ts.map +1 -1
  818. package/dist/utils/output-files.js +206 -12
  819. package/dist/utils/output-files.js.map +1 -1
  820. package/dist/utils/piped-stdin.d.ts +21 -0
  821. package/dist/utils/piped-stdin.d.ts.map +1 -0
  822. package/dist/utils/piped-stdin.js +60 -0
  823. package/dist/utils/piped-stdin.js.map +1 -0
  824. package/dist/utils/shell.d.ts +5 -2
  825. package/dist/utils/shell.d.ts.map +1 -1
  826. package/dist/utils/shell.js +77 -8
  827. package/dist/utils/shell.js.map +1 -1
  828. package/dist/utils/syntax-highlight.d.ts +33 -2
  829. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  830. package/dist/utils/syntax-highlight.js +77 -10
  831. package/dist/utils/syntax-highlight.js.map +1 -1
  832. package/dist/utils/tools-manager.d.ts +1 -0
  833. package/dist/utils/tools-manager.d.ts.map +1 -1
  834. package/dist/utils/tools-manager.js +9 -8
  835. package/dist/utils/tools-manager.js.map +1 -1
  836. package/dist/utils/wsl.d.ts +8 -2
  837. package/dist/utils/wsl.d.ts.map +1 -1
  838. package/dist/utils/wsl.js +12 -3
  839. package/dist/utils/wsl.js.map +1 -1
  840. package/docs/cli.md +39 -3
  841. package/docs/codemode.md +7 -3
  842. package/docs/compaction.md +1 -1
  843. package/docs/development.md +6 -0
  844. package/docs/environment-variables.md +3 -2
  845. package/docs/extensions.md +21 -5
  846. package/docs/flow.md +2 -0
  847. package/docs/humain-code.md +1 -1
  848. package/docs/keybindings.md +2 -0
  849. package/docs/llama-cpp.md +2 -2
  850. package/docs/message-types.md +1 -0
  851. package/docs/models-configuration.md +14 -3
  852. package/docs/models.md +29 -7
  853. package/docs/providers.md +20 -2
  854. package/docs/rpc-commands.md +25 -2
  855. package/docs/rpc.md +20 -0
  856. package/docs/run-preflight.md +2 -2
  857. package/docs/session-format.md +9 -0
  858. package/docs/settings.md +35 -5
  859. package/docs/shell-aliases.md +1 -1
  860. package/docs/slash-commands.md +3 -1
  861. package/docs/terminal-setup.md +25 -0
  862. package/docs/windows.md +2 -1
  863. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  864. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  865. package/examples/rpc-extension-ui.ts +8 -7
  866. package/npm-shrinkwrap.json +209 -180
  867. package/package.json +26 -20
  868. package/schemas/keybindings.schema.json +12 -0
  869. package/schemas/models.schema.json +20 -7
  870. package/schemas/settings.schema.json +43 -5
  871. package/src/coordination/UPSTREAM.md +27 -1
  872. package/src/coordination/upstream.json +3 -3
  873. package/src/humain/ask-user-question/UPSTREAM.md +31 -0
  874. package/src/humain/ask-user-question/upstream.json +258 -0
  875. package/src/humain/ask-user-question/vendor/ask/LICENSE +21 -0
  876. package/src/humain/ask-user-question/vendor/ask/locales/de.json +38 -0
  877. package/src/humain/ask-user-question/vendor/ask/locales/en.json +41 -0
  878. package/src/humain/ask-user-question/vendor/ask/locales/es.json +38 -0
  879. package/src/humain/ask-user-question/vendor/ask/locales/fr.json +38 -0
  880. package/src/humain/ask-user-question/vendor/ask/locales/pt-BR.json +38 -0
  881. package/src/humain/ask-user-question/vendor/ask/locales/pt.json +38 -0
  882. package/src/humain/ask-user-question/vendor/ask/locales/ru.json +38 -0
  883. package/src/humain/ask-user-question/vendor/ask/locales/uk.json +38 -0
  884. package/src/humain/ask-user-question/vendor/ask/locales/zh.json +40 -0
  885. package/src/humain/ask-user-question/vendor/config/LICENSE +21 -0
  886. package/src/humain/ask-user-question/vendor/i18n/LICENSE +21 -0
  887. package/src/humain/caveman/UPSTREAM.md +44 -11
  888. package/src/humain/caveman/upstream.json +3 -3
  889. package/src/humain/caveman/vendor/NOTICE +4 -0
  890. package/src/humain/web-access/UPSTREAM.md +8 -0
  891. package/dist/bundle/chunks/anthropic-messages-XFCDMGD6.js +0 -77
  892. package/dist/bundle/chunks/azure-openai-responses-F4KQM3NK.js +0 -15
  893. package/dist/bundle/chunks/bowser-DXKSTXFQ.js +0 -89
  894. package/dist/bundle/chunks/chunk-3E37CJCE.js +0 -34
  895. package/dist/bundle/chunks/chunk-3HVHETMU.js +0 -18
  896. package/dist/bundle/chunks/chunk-6JTCRCNF.js +0 -74
  897. package/dist/bundle/chunks/chunk-B3ZLWVDA.js +0 -80
  898. package/dist/bundle/chunks/chunk-F77J5EQZ.js +0 -3
  899. package/dist/bundle/chunks/chunk-GPLWWO5Q.js +0 -121
  900. package/dist/bundle/chunks/chunk-GV5OVRKK.js +0 -4
  901. package/dist/bundle/chunks/chunk-JBSWWCT5.js +0 -12
  902. package/dist/bundle/chunks/chunk-JWOPWHVH.js +0 -51
  903. package/dist/bundle/chunks/chunk-KRBELWQH.js +0 -7
  904. package/dist/bundle/chunks/chunk-PFBAIRCY.js +0 -56
  905. package/dist/bundle/chunks/chunk-Q5RKNQ2T.js +0 -73
  906. package/dist/bundle/chunks/chunk-QFDZEUFU.js +0 -12
  907. package/dist/bundle/chunks/chunk-SKCJ25SX.js +0 -24
  908. package/dist/bundle/chunks/chunk-UZOIHLNU.js +0 -23
  909. package/dist/bundle/chunks/chunk-YSWDFV2L.js +0 -11
  910. package/dist/bundle/chunks/chunk-YZMQXAJM.js +0 -8
  911. package/dist/bundle/chunks/chunk-ZAHVC5V2.js +0 -3591
  912. package/dist/bundle/chunks/entry-2GZ3PTWQ.js +0 -2
  913. package/dist/bundle/chunks/google-generative-ai-WIASMWS3.js +0 -22
  914. package/dist/bundle/chunks/google-vertex-WSPHRZIZ.js +0 -25
  915. package/dist/bundle/chunks/interactive-mode-3322RQEH.js +0 -5
  916. package/dist/bundle/chunks/mistral-conversations-7JYDDRUT.js +0 -43
  917. package/dist/bundle/chunks/openai-codex-responses-7PAML4NF.js +0 -102
  918. package/dist/bundle/chunks/openai-completions-UJDAIGTK.js +0 -87
  919. package/dist/bundle/chunks/openai-responses-2WNCE6AY.js +0 -26
  920. package/dist/bundle/chunks/openrouter-images-V3UCCO6X.js +0 -8
  921. package/dist/bundle/chunks/pi-messages-TQ7LJUNQ.js +0 -28
  922. package/dist/bundle/chunks/runtime-H7LYNKCZ.js +0 -2
  923. package/dist/bundle/chunks/session-picker-EYKCMFQR.js +0 -4
  924. package/dist/bundle/chunks/startup-ui-7ODOR34R.js +0 -3
  925. package/dist/bundle/chunks/typesafe-system-one-YP7GGN4C.js +0 -3
  926. package/dist/bundle/chunks/virtual-modules-47MGUPYN.js +0 -28
@@ -0,0 +1,188 @@
1
+ /** Shared types for pi-checklist. Pure — no pi imports. */
2
+ export type TaskStatus = "planned" | "ongoing" | "done" | "cancelled";
3
+ /** A single meta value. `null` is never stored: in an update patch it means
4
+ * "delete this key". */
5
+ export type MetaValue = string | number | boolean;
6
+ /** Preview-gated free-form key/value facts on a task or subtask. */
7
+ export type TaskMeta = Record<string, MetaValue>;
8
+ /** Meta as accepted by create (values only). */
9
+ export type MetaInput = Record<string, MetaValue | null>;
10
+ export interface Task {
11
+ /** Exactly 3 chars, [a-z0-9], assigned at create, frozen. */
12
+ id: string;
13
+ /** Short required title. */
14
+ title: string;
15
+ /** Optional extra context for the agent. */
16
+ notes?: string;
17
+ status: TaskStatus;
18
+ /** 3-char task ids that must be `done` before this may become `ongoing`. */
19
+ dependsOn: string[];
20
+ /** Preview-gated subtasks (see MAX_SUBTASKS_PER_TASK). Absent = none. */
21
+ subtasks?: Subtask[];
22
+ /** Preview-gated key/value meta (see TaskMeta). Absent = none. */
23
+ meta?: TaskMeta;
24
+ createdAt: number;
25
+ updatedAt: number;
26
+ }
27
+ /** A subtask nested inside one parent task (preview feature).
28
+ *
29
+ * Same lifecycle as a task, but scoped: `dependsOn` may reference only
30
+ * sibling subtasks of the same parent, and the subtask inherits the
31
+ * parent's blocked state (see the S1–S6 primitives in store.ts). Ids share
32
+ * the checklist-wide 3-char space so every tool reference is unambiguous. */
33
+ export interface Subtask {
34
+ /** Exactly 3 chars, [a-z0-9], unique across tasks AND subtasks, frozen. */
35
+ id: string;
36
+ /** Short required title. */
37
+ title: string;
38
+ /** Optional extra context for the agent. */
39
+ notes?: string;
40
+ status: TaskStatus;
41
+ /** 3-char sibling subtask ids (same parent) that must be `done` first. */
42
+ dependsOn: string[];
43
+ /** Preview-gated key/value meta (see TaskMeta). Absent = none. */
44
+ meta?: TaskMeta;
45
+ createdAt: number;
46
+ updatedAt: number;
47
+ }
48
+ export interface Checklist {
49
+ /** Optional session/goal name, shown in the widget header. */
50
+ title?: string;
51
+ tasks: Task[];
52
+ updatedAt: number;
53
+ }
54
+ /** How the checklist renders in the TUI.
55
+ *
56
+ * - "statusbar": persistent widget below the input box + compact footer summary.
57
+ * - "status-minimal": compact progress summary in the footer only, no widget.
58
+ * - "end-of-turn": widget above the input box, shown when a turn settles
59
+ * (cleared when a turn starts, re-shown on turn_end / agent_settled).
60
+ * - "hidden": no widget or footer; use /checklist (overlay) or
61
+ * /checklist show (back to statusbar) to see it.
62
+ */
63
+ export type DisplayMode = "statusbar" | "widget-only" | "status-minimal" | "end-of-turn" | "hidden";
64
+ export declare const DISPLAY_MODES: readonly DisplayMode[];
65
+ export declare function isDisplayMode(value: unknown): value is DisplayMode;
66
+ /** How per-task progress status is shown in the widget / overlay / transcript.
67
+ *
68
+ * - "color": rows are only color-coded, no status word.
69
+ * - "pill": the status word is rendered as a pill — text on a colored
70
+ * background (theme.bg), e.g. ` ongoing `.
71
+ * - "icon": status is conveyed by a leading progress icon only, no status
72
+ * word. The artwork is the fixed native glyph set.
73
+ */
74
+ export type StatusStyle = "color" | "pill" | "icon";
75
+ export declare const STATUS_STYLES: readonly StatusStyle[];
76
+ export declare function isStatusStyle(value: unknown): value is StatusStyle;
77
+ /** How strongly the injected system prompt steers the agent toward using
78
+ * the checklist.
79
+ *
80
+ * - "moderate": use the checklist for long-running / multi-step work
81
+ * (refactors, audits, multi-part features); skip it for quick one-shot
82
+ * questions. Default — matches the original always-on hint.
83
+ * - "aggressive": use the checklist for almost every task, even small
84
+ * ones; only trivial single-step questions go untracked.
85
+ *
86
+ * This changes the *system prompt*, so it is captured once when the
87
+ * extension loads; changing it mid-session only takes effect after a
88
+ * reload (/reload) or a new pi session.
89
+ */
90
+ export type UsageMode = "moderate" | "aggressive";
91
+ export declare const USAGE_MODES: readonly UsageMode[];
92
+ export declare function isUsageMode(value: unknown): value is UsageMode;
93
+ /** Versioned snapshot persisted in the session JSONL. */
94
+ export interface ChecklistSnapshot {
95
+ v: 1;
96
+ /** null = cleared */
97
+ checklist: Checklist | null;
98
+ /** Legacy persist for /checklist hide (pre-displayMode). Prefer displayMode. */
99
+ widgetVisible?: boolean;
100
+ /** Preferred persist for render mode. Absent = migrate from widgetVisible. */
101
+ displayMode?: DisplayMode;
102
+ /** Preferred persist for status style. Absent = default ("pill"). */
103
+ statusStyle?: StatusStyle;
104
+ /** Usage-guidance strength for the injected system prompt.
105
+ * Absent = default ("moderate"). Applied only on extension reload. */
106
+ usage?: UsageMode;
107
+ /** Preview-gated subtasks. Absent = default (`false`). Persisted in the
108
+ * session snapshot and mirrored to the global prefs file like the other
109
+ * settings (precedence: global file > snapshot > default). */
110
+ subtasksEnabled?: boolean;
111
+ /** Preview-gated task/subtask `meta`. Absent = default (`false`). Same
112
+ * persistence/precedence as `subtasksEnabled`. */
113
+ metaEnabled?: boolean;
114
+ }
115
+ /** Tool names that can carry a ChecklistSnapshot in result details. */
116
+ export declare const CHECKLIST_TOOLS: ReadonlySet<string>;
117
+ export declare function isChecklistSnapshot(value: unknown): value is ChecklistSnapshot;
118
+ /** Computed per-subtask view (never stored). `blockedBy` is the effective
119
+ * block: sibling deps not done, plus the parent's own `blockedBy` when the
120
+ * parent is blocked (inherited block, primitive S3). */
121
+ export interface SubtaskView extends Subtask {
122
+ /** status === "planned", sibling deps done, and parent not blocked */
123
+ ready: boolean;
124
+ /** sibling dep ids not done (+ inherited parent blocks) */
125
+ blockedBy: string[];
126
+ /** blockedBy.length > 0 */
127
+ blocked: boolean;
128
+ }
129
+ /** Computed per-task view (never stored). */
130
+ export interface TaskView extends Task {
131
+ /** status === "planned" and every dep is done */
132
+ ready: boolean;
133
+ /** dep ids that are not done (missing deps are validated away, but listed defensively) */
134
+ blockedBy: string[];
135
+ /** blockedBy.length > 0 */
136
+ blocked: boolean;
137
+ /** Subtask views (empty when the task has no subtasks). */
138
+ subtaskViews: SubtaskView[];
139
+ }
140
+ export interface CreateTaskInput {
141
+ id?: string;
142
+ title: string;
143
+ notes?: string;
144
+ dependsOn?: string | string[];
145
+ subtasks?: CreateSubtaskInput[];
146
+ meta?: MetaInput;
147
+ }
148
+ /** Subtask payload at create time. Subtasks are born `planned` (`status` is
149
+ * not accepted — start them via checklist_update). */
150
+ export interface CreateSubtaskInput {
151
+ id?: string;
152
+ title: string;
153
+ notes?: string;
154
+ dependsOn?: string | string[];
155
+ meta?: MetaInput;
156
+ }
157
+ export interface CreateInput {
158
+ title?: string;
159
+ mode?: "replace" | "append";
160
+ tasks: CreateTaskInput[];
161
+ }
162
+ export interface UpdateTaskInput {
163
+ id: string;
164
+ status?: TaskStatus;
165
+ title?: string;
166
+ notes?: string;
167
+ dependsOn?: string | string[];
168
+ subtasks?: UpdateSubtaskInput[];
169
+ /** Merged into the existing meta; `key: null` deletes that key. */
170
+ meta?: MetaInput;
171
+ }
172
+ /** Subtask patch inside a parent's update entry. An entry WITH `id` patches
173
+ * the existing subtask; WITHOUT `id` it adds a new one (`title` required,
174
+ * born `planned` — `status` is rejected on adds). */
175
+ export interface UpdateSubtaskInput {
176
+ id?: string;
177
+ title?: string;
178
+ notes?: string;
179
+ status?: TaskStatus;
180
+ dependsOn?: string | string[];
181
+ /** Merged into the existing meta; `key: null` deletes that key. */
182
+ meta?: MetaInput;
183
+ }
184
+ export interface ReadInput {
185
+ status?: TaskStatus;
186
+ includeDone?: boolean;
187
+ }
188
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/humain/checklist/vendor/types.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAEtE;wBACwB;AACxB,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,oEAAoE;AACpE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEjD,gDAAgD;AAChD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;AAEzD,MAAM,WAAW,IAAI;IACpB,6DAA6D;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,4EAA4E;IAC5E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,kEAAkE;IAClE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;6EAK6E;AAC7E,MAAM,WAAW,OAAO;IACvB,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IAC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E,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,KAAK,EAAE,eAAe,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAChC,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;CACjB;AAED;;qDAEqD;AACrD,MAAM,WAAW,kBAAkB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACzB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,32 @@
1
+ /** Shared types for pi-checklist. Pure — no pi imports. */
2
+ export const DISPLAY_MODES = [
3
+ "statusbar",
4
+ "widget-only",
5
+ "status-minimal",
6
+ "end-of-turn",
7
+ "hidden",
8
+ ];
9
+ export function isDisplayMode(value) {
10
+ return (value === "statusbar" ||
11
+ value === "widget-only" ||
12
+ value === "status-minimal" ||
13
+ value === "end-of-turn" ||
14
+ value === "hidden");
15
+ }
16
+ export const STATUS_STYLES = ["color", "pill", "icon"];
17
+ export function isStatusStyle(value) {
18
+ return value === "color" || value === "pill" || value === "icon";
19
+ }
20
+ export const USAGE_MODES = ["moderate", "aggressive"];
21
+ export function isUsageMode(value) {
22
+ return value === "moderate" || value === "aggressive";
23
+ }
24
+ /** Tool names that can carry a ChecklistSnapshot in result details. */
25
+ export const CHECKLIST_TOOLS = new Set(["checklist_create", "checklist_read", "checklist_update"]);
26
+ export function isChecklistSnapshot(value) {
27
+ if (typeof value !== "object" || value === null)
28
+ return false;
29
+ const v = value;
30
+ return v.v === 1 && "checklist" in v;
31
+ }
32
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/humain/checklist/vendor/types.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAwE3D,MAAM,CAAC,MAAM,aAAa,GAA2B;IACpD,WAAW;IACX,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,QAAQ;CACR,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,KAAc;IAC3C,OAAO,CACN,KAAK,KAAK,WAAW;QACrB,KAAK,KAAK,aAAa;QACvB,KAAK,KAAK,gBAAgB;QAC1B,KAAK,KAAK,aAAa;QACvB,KAAK,KAAK,QAAQ,CAClB,CAAC;AACH,CAAC;AAYD,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/E,MAAM,UAAU,aAAa,CAAC,KAAc;IAC3C,OAAO,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,MAAM,CAAC;AAClE,CAAC;AAiBD,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAE5E,MAAM,UAAU,WAAW,CAAC,KAAc;IACzC,OAAO,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,YAAY,CAAC;AACvD,CAAC;AAyBD,uEAAuE;AACvE,MAAM,CAAC,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,CAAC,CAAC;AAExH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW,IAAI,CAAC,CAAC;AACtC,CAAC","sourcesContent":["/** Shared types for pi-checklist. Pure — no pi imports. */\n\nexport type TaskStatus = \"planned\" | \"ongoing\" | \"done\" | \"cancelled\";\n\n/** A single meta value. `null` is never stored: in an update patch it means\n * \"delete this key\". */\nexport type MetaValue = string | number | boolean;\n\n/** Preview-gated free-form key/value facts on a task or subtask. */\nexport type TaskMeta = Record<string, MetaValue>;\n\n/** Meta as accepted by create (values only). */\nexport type MetaInput = Record<string, MetaValue | null>;\n\nexport interface Task {\n\t/** Exactly 3 chars, [a-z0-9], assigned at create, frozen. */\n\tid: string;\n\t/** Short required title. */\n\ttitle: string;\n\t/** Optional extra context for the agent. */\n\tnotes?: string;\n\tstatus: TaskStatus;\n\t/** 3-char task ids that must be `done` before this may become `ongoing`. */\n\tdependsOn: string[];\n\t/** Preview-gated subtasks (see MAX_SUBTASKS_PER_TASK). Absent = none. */\n\tsubtasks?: Subtask[];\n\t/** Preview-gated key/value meta (see TaskMeta). Absent = none. */\n\tmeta?: TaskMeta;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n/** A subtask nested inside one parent task (preview feature).\n *\n * Same lifecycle as a task, but scoped: `dependsOn` may reference only\n * sibling subtasks of the same parent, and the subtask inherits the\n * parent's blocked state (see the S1–S6 primitives in store.ts). Ids share\n * the checklist-wide 3-char space so every tool reference is unambiguous. */\nexport interface Subtask {\n\t/** Exactly 3 chars, [a-z0-9], unique across tasks AND subtasks, frozen. */\n\tid: string;\n\t/** Short required title. */\n\ttitle: string;\n\t/** Optional extra context for the agent. */\n\tnotes?: string;\n\tstatus: TaskStatus;\n\t/** 3-char sibling subtask ids (same parent) that must be `done` first. */\n\tdependsOn: string[];\n\t/** Preview-gated key/value meta (see TaskMeta). Absent = none. */\n\tmeta?: TaskMeta;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Checklist {\n\t/** Optional session/goal name, shown in the widget header. */\n\ttitle?: string;\n\ttasks: Task[];\n\tupdatedAt: number;\n}\n\n/** How the checklist renders in the TUI.\n *\n * - \"statusbar\": persistent widget below the input box + compact footer summary.\n * - \"status-minimal\": compact progress summary in the footer only, no widget.\n * - \"end-of-turn\": widget above the input box, shown when a turn settles\n * (cleared when a turn starts, re-shown on turn_end / agent_settled).\n * - \"hidden\": no widget or footer; use /checklist (overlay) or\n * /checklist show (back to statusbar) to see it.\n */\nexport type DisplayMode = \"statusbar\" | \"widget-only\" | \"status-minimal\" | \"end-of-turn\" | \"hidden\";\n\nexport const DISPLAY_MODES: readonly DisplayMode[] = [\n\t\"statusbar\",\n\t\"widget-only\",\n\t\"status-minimal\",\n\t\"end-of-turn\",\n\t\"hidden\",\n];\n\nexport function isDisplayMode(value: unknown): value is DisplayMode {\n\treturn (\n\t\tvalue === \"statusbar\" ||\n\t\tvalue === \"widget-only\" ||\n\t\tvalue === \"status-minimal\" ||\n\t\tvalue === \"end-of-turn\" ||\n\t\tvalue === \"hidden\"\n\t);\n}\n\n/** How per-task progress status is shown in the widget / overlay / transcript.\n *\n * - \"color\": rows are only color-coded, no status word.\n * - \"pill\": the status word is rendered as a pill — text on a colored\n * background (theme.bg), e.g. ` ongoing `.\n * - \"icon\": status is conveyed by a leading progress icon only, no status\n * word. The artwork is the fixed native glyph set.\n */\nexport type StatusStyle = \"color\" | \"pill\" | \"icon\";\n\nexport const STATUS_STYLES: readonly StatusStyle[] = [\"color\", \"pill\", \"icon\"];\n\nexport function isStatusStyle(value: unknown): value is StatusStyle {\n\treturn value === \"color\" || value === \"pill\" || value === \"icon\";\n}\n\n/** How strongly the injected system prompt steers the agent toward using\n * the checklist.\n *\n * - \"moderate\": use the checklist for long-running / multi-step work\n * (refactors, audits, multi-part features); skip it for quick one-shot\n * questions. Default — matches the original always-on hint.\n * - \"aggressive\": use the checklist for almost every task, even small\n * ones; only trivial single-step questions go untracked.\n *\n * This changes the *system prompt*, so it is captured once when the\n * extension loads; changing it mid-session only takes effect after a\n * reload (/reload) or a new pi session.\n */\nexport type UsageMode = \"moderate\" | \"aggressive\";\n\nexport const USAGE_MODES: readonly UsageMode[] = [\"moderate\", \"aggressive\"];\n\nexport function isUsageMode(value: unknown): value is UsageMode {\n\treturn value === \"moderate\" || value === \"aggressive\";\n}\n\n/** Versioned snapshot persisted in the session JSONL. */\nexport interface ChecklistSnapshot {\n\tv: 1;\n\t/** null = cleared */\n\tchecklist: Checklist | null;\n\t/** Legacy persist for /checklist hide (pre-displayMode). Prefer displayMode. */\n\twidgetVisible?: boolean;\n\t/** Preferred persist for render mode. Absent = migrate from widgetVisible. */\n\tdisplayMode?: DisplayMode;\n\t/** Preferred persist for status style. Absent = default (\"pill\"). */\n\tstatusStyle?: StatusStyle;\n\t/** Usage-guidance strength for the injected system prompt.\n\t * Absent = default (\"moderate\"). Applied only on extension reload. */\n\tusage?: UsageMode;\n\t/** Preview-gated subtasks. Absent = default (`false`). Persisted in the\n\t * session snapshot and mirrored to the global prefs file like the other\n\t * settings (precedence: global file > snapshot > default). */\n\tsubtasksEnabled?: boolean;\n\t/** Preview-gated task/subtask `meta`. Absent = default (`false`). Same\n\t * persistence/precedence as `subtasksEnabled`. */\n\tmetaEnabled?: boolean;\n}\n\n/** Tool names that can carry a ChecklistSnapshot in result details. */\nexport const CHECKLIST_TOOLS: ReadonlySet<string> = new Set([\"checklist_create\", \"checklist_read\", \"checklist_update\"]);\n\nexport function isChecklistSnapshot(value: unknown): value is ChecklistSnapshot {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst v = value as Record<string, unknown>;\n\treturn v.v === 1 && \"checklist\" in v;\n}\n\n/** Computed per-subtask view (never stored). `blockedBy` is the effective\n * block: sibling deps not done, plus the parent's own `blockedBy` when the\n * parent is blocked (inherited block, primitive S3). */\nexport interface SubtaskView extends Subtask {\n\t/** status === \"planned\", sibling deps done, and parent not blocked */\n\tready: boolean;\n\t/** sibling dep ids not done (+ inherited parent blocks) */\n\tblockedBy: string[];\n\t/** blockedBy.length > 0 */\n\tblocked: boolean;\n}\n\n/** Computed per-task view (never stored). */\nexport interface TaskView extends Task {\n\t/** status === \"planned\" and every dep is done */\n\tready: boolean;\n\t/** dep ids that are not done (missing deps are validated away, but listed defensively) */\n\tblockedBy: string[];\n\t/** blockedBy.length > 0 */\n\tblocked: boolean;\n\t/** Subtask views (empty when the task has no subtasks). */\n\tsubtaskViews: SubtaskView[];\n}\n\nexport interface CreateTaskInput {\n\tid?: string;\n\ttitle: string;\n\tnotes?: string;\n\tdependsOn?: string | string[];\n\tsubtasks?: CreateSubtaskInput[];\n\tmeta?: MetaInput;\n}\n\n/** Subtask payload at create time. Subtasks are born `planned` (`status` is\n * not accepted — start them via checklist_update). */\nexport interface CreateSubtaskInput {\n\tid?: string;\n\ttitle: string;\n\tnotes?: string;\n\tdependsOn?: string | string[];\n\tmeta?: MetaInput;\n}\n\nexport interface CreateInput {\n\ttitle?: string;\n\tmode?: \"replace\" | \"append\";\n\ttasks: CreateTaskInput[];\n}\n\nexport interface UpdateTaskInput {\n\tid: string;\n\tstatus?: TaskStatus;\n\ttitle?: string;\n\tnotes?: string;\n\tdependsOn?: string | string[];\n\tsubtasks?: UpdateSubtaskInput[];\n\t/** Merged into the existing meta; `key: null` deletes that key. */\n\tmeta?: MetaInput;\n}\n\n/** Subtask patch inside a parent's update entry. An entry WITH `id` patches\n * the existing subtask; WITHOUT `id` it adds a new one (`title` required,\n * born `planned` — `status` is rejected on adds). */\nexport interface UpdateSubtaskInput {\n\tid?: string;\n\ttitle?: string;\n\tnotes?: string;\n\tstatus?: TaskStatus;\n\tdependsOn?: string | string[];\n\t/** Merged into the existing meta; `key: null` deletes that key. */\n\tmeta?: MetaInput;\n}\n\nexport interface ReadInput {\n\tstatus?: TaskStatus;\n\tincludeDone?: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"flow-loader.d.ts","sourceRoot":"","sources":["../../src/humain/flow-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAGhH,OAAO,KAAK,EACX,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAEhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAa/E;;;;;;;;GAQG;AAEH,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AACxE,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAE9E,8FAA8F;AAC9F,MAAM,WAAW,cAAc;IAC9B,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,aAAa,CAAC;QAAC,MAAM,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC,CAAC;IACnF,WAAW,IAAI,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,UAAU;IAC1B,aAAa,CACZ,EAAE,EAAE,YAAY,EAChB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI,EAC5D,YAAY,CAAC,EAAE;QAAE,uBAAuB,EAAE,OAAO,2BAA2B,CAAA;KAAE,GAC5E,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,kHAAkH;IAClH,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C;IAC5B,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,qGAAqG;AACrG,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAE9D;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAI9E;AAED,sHAAsH;AACtH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAE9G;AAED,mHAAmH;AACnH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAE7F;AA0QD,wBAAgB,sCAAsC,CAAC,OAAO,GAAE,uBAA4B,GAAG,gBAAgB,CAgO9G"}
@@ -214,7 +214,7 @@ function disabledReason(pi, env) {
214
214
  * Commit is not transactional for non-handler members: if one throws midway, committed handlers are unsubscribed, and
215
215
  * tools/commands/flags/shortcuts/renderers (keyed maps in the extension loader) are simply overwritten on retry.
216
216
  */
217
- async function runFlowExtension(pi, flowExtension, lastSessionStart, capturedCommand = "flow") {
217
+ async function runFlowExtension(pi, flowExtension, lastSessionStart, signal, capturedCommand = "flow") {
218
218
  const captured = new Map();
219
219
  const staged = [];
220
220
  // After a successful commit the proxy forwards live, so registrations made later (from handlers) reach the real pi.
@@ -242,12 +242,16 @@ async function runFlowExtension(pi, flowExtension, lastSessionStart, capturedCom
242
242
  },
243
243
  });
244
244
  await flowExtension(proxy);
245
+ if (signal.aborted)
246
+ return new Map();
245
247
  let replayed;
246
248
  for (let start = lastSessionStart(); start && start !== replayed; start = lastSessionStart()) {
247
249
  replayed = start;
248
250
  for (const call of staged) {
249
251
  if (call.member === "on" && call.args[0] === "session_start" && !call.cancelled) {
250
252
  await call.args[1](...start);
253
+ if (signal.aborted)
254
+ return new Map();
251
255
  }
252
256
  }
253
257
  }
@@ -307,7 +311,13 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
307
311
  let flowModule;
308
312
  return (pi) => {
309
313
  disabledProbe = () => disabledReason(pi, env) !== undefined;
314
+ // Lazy imports and staged startup replays must not revive a replaced session.
315
+ const lifetime = new AbortController();
310
316
  let lastStart;
317
+ pi.on("session_shutdown", () => {
318
+ lifetime.abort();
319
+ lastStart = undefined;
320
+ });
311
321
  let loaded;
312
322
  let hierarchy;
313
323
  let orchestrateLoaded;
@@ -347,19 +357,23 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
347
357
  catch {
348
358
  return undefined;
349
359
  }
350
- return rpcControl;
360
+ return lifetime.signal.aborted ? undefined : rpcControl;
351
361
  };
352
362
  const load = () => {
353
363
  if (!loaded) {
354
364
  const attempt = (async () => {
355
365
  const module = await loadModule();
366
+ if (lifetime.signal.aborted)
367
+ return new Map();
356
368
  let published;
357
369
  const commands = await runFlowExtension(pi, (api) => module.flowExtension(api, (value) => {
358
370
  published = value;
359
371
  }, {
360
372
  // Sanctioned opt-in runtime boundary: never load SDK session code for ordinary Flow children.
361
373
  startImplementerSession: async (input) => (await import("../core/flow-implementer.js")).startFlowImplementerSession(input),
362
- }), () => lastStart);
374
+ }), () => lastStart, lifetime.signal);
375
+ if (lifetime.signal.aborted)
376
+ return commands;
363
377
  // Publish only after staging and session replay succeed; failed attempts cannot leak their command.
364
378
  hierarchy = published;
365
379
  hierarchy?.hierarchyExecutor.setLoader(async () => {
@@ -382,10 +396,12 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
382
396
  if (!orchestrateLoaded) {
383
397
  const attempt = (async () => {
384
398
  await load();
385
- if (!hierarchy)
399
+ if (lifetime.signal.aborted || !hierarchy)
386
400
  return new Map();
387
401
  const module = await importOrchestrate();
388
- return runFlowExtension(pi, module.createOrchestrateExtension(hierarchy), () => lastStart, "orchestrate");
402
+ if (lifetime.signal.aborted)
403
+ return new Map();
404
+ return runFlowExtension(pi, module.createOrchestrateExtension(hierarchy), () => lastStart, lifetime.signal, "orchestrate");
389
405
  })();
390
406
  orchestrateLoaded = attempt;
391
407
  attempt.catch(() => {
@@ -399,6 +415,8 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
399
415
  description: FLOW_DESCRIPTION,
400
416
  getArgumentCompletions: completeFlowArguments,
401
417
  handler: async (args, rawCtx) => {
418
+ if (lifetime.signal.aborted)
419
+ return;
402
420
  const ctx = withHeadlessNotices(rawCtx);
403
421
  const refuse = (message, level) => {
404
422
  if (ctx.mode === "print" || ctx.mode === "json")
@@ -439,6 +457,8 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
439
457
  if (command === "profile") {
440
458
  try {
441
459
  const module = await loadModule();
460
+ if (lifetime.signal.aborted)
461
+ return;
442
462
  if (!module.runFlowProfileCommand || !module.createProfileStore) {
443
463
  ctx.ui.notify(flowBuildUnavailable(command), "error");
444
464
  return;
@@ -450,6 +470,8 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
450
470
  await module.runFlowProfileCommand(payload, ctx, { store });
451
471
  }
452
472
  catch (error) {
473
+ if (lifetime.signal.aborted)
474
+ return;
453
475
  ctx.ui.notify(`/flow profile failed: ${error instanceof Error ? error.message : String(error)}`, "error");
454
476
  }
455
477
  return;
@@ -461,8 +483,12 @@ export function createHumainFlowLoaderExtensionFactory(options = {}) {
461
483
  let commands;
462
484
  try {
463
485
  commands = await (command === "orchestrate" ? loadOrchestrate() : load());
486
+ if (lifetime.signal.aborted)
487
+ return;
464
488
  }
465
489
  catch (error) {
490
+ if (lifetime.signal.aborted)
491
+ return;
466
492
  try {
467
493
  ctx.ui.notify(`Failed to load Flow: ${error instanceof Error ? error.message : String(error)}`, "error");
468
494
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flow-loader.js","sourceRoot":"","sources":["../../src/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J,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { createHash, randomBytes } from \"node:crypto\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport type { FlowHierarchyCommands } from \"@humain/flow\";\nimport { FLOW_ID_PATTERN, type FlowFailureClass } from \"@humain/humain-code-contracts/flow-common\";\nimport type { FlowEventFrameV1, FlowReceiptV1, FlowStatusV1 } from \"@humain/humain-code-contracts/flow-control\";\nimport { getAgentDir, getBundledFlowPackageDir, getBundledFlowProfilesDir, PACKAGE_NAME, VERSION } from \"../config.ts\";\nimport { readJsonFile } from \"../coordination/broker/atomic-file.ts\";\nimport type {\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionFactory,\n\tRegisteredCommand,\n} from \"../core/extensions/types.ts\";\nimport type { startFlowImplementerSession } from \"../core/flow-implementer.ts\";\nimport { createTraceRedactor } from \"../core/trace/redaction.ts\";\nimport { sanitizeForTerminal } from \"../core/trace-client/sanitize.ts\";\nimport {\n\tcompleteFlowArguments,\n\tFLOW_SETUP_TERMINAL_ONLY,\n\tFLOW_SUBCOMMANDS,\n\ttype FlowSubcommand,\n\tflowBuildUnavailable,\n\tparseFlowCommand,\n\trenderFlowHelp,\n} from \"./flow-command.ts\";\n\n/**\n * Lazy loader for the private @humain/flow and @humain/orchestrate packages.\n *\n * The CLI entry graph must not statically reach Flow: this module registers one cheap `/flow` stub (plus `/orchestrate`,\n * which forwards to it) and two flags, and\n * loads Flow the first time a subcommand needs it. Hierarchy commands additionally load Orchestrate through a second\n * memoized dynamic import, using the initialized Flow instance. Help, completion, unknown commands and not-yet-available\n * commands are answered statically and never import either package. Both packages are bundled as lazy chunks.\n */\n\nexport const HUMAIN_FLOW_DISABLED_ENV = \"HUMAIN_TERMINAL_FLOW_DISABLED\";\nexport const HUMAIN_FLOW_PACKAGE_DIR_ENV = \"HUMAIN_TERMINAL_FLOW_PACKAGE_DIR\";\n\n/** Run-control surface Flow exposes to rpc mode (flow_status/pause/resume/cancel/message). */\nexport interface FlowRpcControl {\n\thandle(input: unknown): Promise<{ receipt: FlowReceiptV1; status?: FlowStatusV1 }>;\n\tactiveRunId(): string | undefined;\n}\n\nexport interface FlowModule {\n\tflowExtension(\n\t\tpi: ExtensionAPI,\n\t\tpublishHierarchy?: (commands: FlowHierarchyCommands) => void,\n\t\thostServices?: { startImplementerSession: typeof startFlowImplementerSession },\n\t): void | Promise<void>;\n\t/** Documented rpc hook: called once when Flow loads; `writeFrame` carries `flow_event` frames to the rpc host. */\n\tcreateFlowRpcControl?(options: {\n\t\twriteFrame?: (frame: FlowEventFrameV1) => void | Promise<void>;\n\t\tisDisabled?: () => boolean;\n\t\t/** Queues text on the host session as a follow-up (flow_message with no active run). */\n\t\tsendFollowUp?: (text: string) => Promise<void>;\n\t}): FlowRpcControl;\n\t/** B1 profile command; optional so test fakes need not provide it. Methods stay bivariant for the real signatures. */\n\trunFlowProfileCommand?(args: string, ctx: ExtensionCommandContext, deps: { store: unknown }): Promise<unknown>;\n\tcreateProfileStore?(options: { flowDir: string; builtInDir?: string }): unknown;\n}\n\nexport interface OrchestrateModule {\n\tcreateOrchestrateExtension(commands: FlowHierarchyCommands): ExtensionFactory;\n}\n\nexport interface HumainFlowLoaderOptions {\n\t/** Test seam. Defaults to the single sanctioned dynamic import of @humain/flow. */\n\timportFlow?: () => Promise<FlowModule>;\n\t/** Test seam for the separate sanctioned lazy import of @humain/orchestrate. */\n\timportOrchestrate?: () => Promise<OrchestrateModule>;\n\tenv?: NodeJS.ProcessEnv;\n\t/** Directory holding Flow's agents/assets/package.json. Defaults to the bundled layout's flow/ dir. */\n\tflowPackageDir?: string;\n\t/** Built-in Flow profiles dir. Defaults to the bundled layout's assets/profiles; undefined lets Flow find its own. */\n\tbuiltInProfilesDir?: string;\n\t/** Flow profile store directory. Defaults to `<agentDir>/flow`. */\n\tflowDir?: string;\n}\n\nlet rpcControl: FlowRpcControl | undefined;\nlet disabledProbe: (() => boolean) | undefined;\nlet rpcOutput: ((frame: FlowEventFrameV1) => void | Promise<void>) | undefined;\nlet rpcLoader: (() => Promise<FlowRpcControl | undefined>) | undefined;\nlet rpcFollowUp: ((text: string) => Promise<void>) | undefined;\n\n/** The documented rpc hook: rpc mode reads Flow's run control here and never imports Flow itself. */\nexport function getFlowRpcControl(): FlowRpcControl | undefined {\n\treturn rpcControl;\n}\n\n/**\n * The documented rpc hook: loads Flow through the same lazy-load path the stub commands use and returns its run control.\n * Undefined when Flow is disabled (never loaded then), not wired, or fails to load.\n */\nexport async function loadFlowRpcControl(): Promise<FlowRpcControl | undefined> {\n\tif (rpcControl) return rpcControl;\n\tif (isFlowDisabled()) return undefined;\n\treturn rpcLoader?.();\n}\n\n/** True while Flow is switched off (flow.enabled=false or the env kill switch); rpc mode refuses flow_resume then. */\nexport function isFlowDisabled(): boolean {\n\treturn disabledProbe?.() ?? false;\n}\n\n/** The documented rpc hook: rpc mode registers where Flow's `flow_event` frames are written. */\nexport function setFlowRpcOutput(writer: ((frame: FlowEventFrameV1) => void | Promise<void>) | undefined): void {\n\trpcOutput = writer;\n}\n\n/** The documented rpc hook: rpc mode registers how direct-mode flow_message text is queued as a host follow-up. */\nexport function setFlowRpcFollowUp(queue: ((text: string) => Promise<void>) | undefined): void {\n\trpcFollowUp = queue;\n}\n\ntype CommandOptions = Omit<RegisteredCommand, \"name\" | \"sourceInfo\">;\ntype EventHandler = (...args: unknown[]) => unknown;\n\n/**\n * ExtensionAPI members that only record registrations (see core/extensions/loader.ts). They are staged while Flow's\n * factory runs and applied to the real pi only after the factory and the session_start replay succeed. Reads and\n * actions (getFlag, getSettings, exec, sendMessage, ...) and `events` stay live: they have no registration to undo\n * or are needed by the factory itself. Flow uses none of the live ones that subscribe (`events.on`).\n */\nconst STAGED_MEMBERS = new Set([\n\t\"on\",\n\t\"registerTool\",\n\t\"registerCommand\",\n\t\"registerShortcut\",\n\t\"registerFlag\",\n\t\"registerMessageRenderer\",\n\t\"registerMarkdownTransformer\",\n\t\"registerEntryRenderer\",\n\t\"registerProvider\",\n\t\"unregisterProvider\",\n\t\"registerMcpServer\",\n\t\"unregisterMcpServer\",\n\t\"registerVirtualModel\",\n\t\"unregisterVirtualModel\",\n]);\n\ninterface StagedCall {\n\tmember: string;\n\targs: unknown[];\n\tcancelled: boolean;\n\tunsubscribe?: () => void;\n}\n\nconst FLOW_DESCRIPTION =\n\t\"Plan, run, and verify work with agents. Subcommands: \" +\n\t`${FLOW_SUBCOMMANDS.filter((name) => name !== \"help\").join(\", \")}. Use /flow help for usage.`;\n\n/**\n * Act on an already loaded run only; with Flow not loaded there is no run, so Flow is never imported for them. They\n * stay reachable when Flow is disabled so a live run can still be stopped. Every other subcommand is refused when\n * disabled.\n */\nconst LOADED_RUN_COMMANDS: ReadonlySet<FlowSubcommand> = new Set([\n\t\"cancel\",\n\t\"status\",\n\t\"pause\",\n\t\"resume\",\n\t\"hide\",\n\t\"show\",\n]);\n/** Kill switch: resume would restart dispatch, so it is refused while Flow is disabled (the others are not). */\nconst AVAILABLE_WHEN_DISABLED: ReadonlySet<FlowSubcommand> = new Set([\"cancel\", \"status\", \"pause\", \"hide\", \"show\"]);\n/** Copy when a loaded-run command finds no Flow loaded, so there is nothing to act on. */\nconst NO_LOADED_RUN_COPY: Partial<Record<FlowSubcommand, string>> = {\n\tcancel: \"No active Flow run to stop.\",\n\tstatus: \"No active Flow run. Start one with /flow run <goal>.\",\n\tpause: \"No active Flow run to pause.\",\n\tresume: \"No paused Flow run to resume.\",\n\thide: \"No current Flow widget to hide.\",\n\tshow: \"No current Flow widget to show.\",\n};\n/** Only these start (or recover) work, so only their refusals settle an rpc run. */\nconst START_COMMANDS: ReadonlySet<FlowSubcommand> = new Set([\"run\", \"orchestrate\", \"continue\", \"fix\"]);\nconst FLOW_ID = new RegExp(FLOW_ID_PATTERN);\n// Match Flow's admission size limit without loading Flow on this refusal path.\nconst MAX_ADMISSION_FILE_BYTES = 1024 * 1024;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\n/**\n * Print/json mode has no UI: core makes ctx.ui.notify a no-op, so headless notices go to stderr as bare text.\n * Notice text can echo user args or env values, so it is redacted, stripped of terminal escapes, then redacted again\n * with the same redactor: the first pass catches secrets that stripping could otherwise mangle, the second catches\n * secrets that were split by escapes and are rejoined by stripping. Fails closed to a fixed line on any failure.\n * Replacing `ui` snapshots ui (descriptors preserve other ctx getters, so lazy getters on ctx stay live; same approach\n * as the runner's createCommandContext).\n */\nconst NOTICE_WITHHELD = \"[notice withheld: redaction unavailable]\";\n\nfunction safeNotice(message: string): string {\n\ttry {\n\t\tconst redactor = createTraceRedactor({ env: process.env });\n\t\treturn redactor.redactText(sanitizeForTerminal(redactor.redactText(message).text)).text;\n\t} catch {\n\t\treturn NOTICE_WITHHELD;\n\t}\n}\n\nfunction withHeadlessNotices(ctx: ExtensionCommandContext): ExtensionCommandContext {\n\tif (ctx.mode !== \"print\" && ctx.mode !== \"json\") return ctx;\n\tconst ui = Object.defineProperties({}, Object.getOwnPropertyDescriptors(ctx.ui)) as ExtensionCommandContext[\"ui\"];\n\tui.notify = (message: string) => {\n\t\tprocess.stderr.write(`${safeNotice(message)}\\n`);\n\t};\n\tconst wrapped = Object.defineProperties({}, Object.getOwnPropertyDescriptors(ctx)) as ExtensionCommandContext;\n\tObject.defineProperty(wrapped, \"ui\", { value: ui, enumerable: true, configurable: true });\n\treturn wrapped;\n}\n\nfunction readRefusalRunId(pi: ExtensionAPI, cwd: string): string | undefined {\n\ttry {\n\t\tconst file = pi.getFlag(\"flow-admission\");\n\t\tif (typeof file !== \"string\" || !file) return undefined;\n\t\tconst admission = readJsonFile(resolve(cwd, file), MAX_ADMISSION_FILE_BYTES);\n\t\t// As in Flow's refusal path, validate just the identity needed for correlation, not the entire admission.\n\t\tconst runId = isRecord(admission) ? admission.runId : undefined;\n\t\treturn typeof runId === \"string\" && !/[\\r\\n]/.test(runId) && FLOW_ID.test(runId) ? runId : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Mirrors packages/flow emitRefusalSettled: an rpc `/flow run` or `/flow continue` that dispatches nothing still emits one terminal\n * `run_settled` frame so the host stops waiting. Built here because the entry graph must not reach @humain/flow.\n * Print/json refusals exit non-zero (mirrors flow's markHeadlessFailure). Never throws; no-op otherwise.\n */\nasync function settleRefusal(\n\tpi: ExtensionAPI,\n\tcommand: FlowSubcommand,\n\tctx: ExtensionCommandContext,\n\tfailureClass: FlowFailureClass,\n): Promise<void> {\n\tif (!START_COMMANDS.has(command)) return;\n\tif (ctx.mode === \"print\" || ctx.mode === \"json\") process.exitCode = 1;\n\tif (ctx.mode !== \"rpc\" || !rpcOutput) return;\n\ttry {\n\t\tconst runId = readRefusalRunId(pi, ctx.cwd) ?? `flow-refused-${randomBytes(8).toString(\"hex\")}`;\n\t\tconst frame: FlowEventFrameV1 = {\n\t\t\ttype: \"flow_event\",\n\t\t\tevent: {\n\t\t\t\tschema: \"humain-flow-event\",\n\t\t\t\tschemaVersion: 1,\n\t\t\t\teventId: `${runId.slice(0, 120)}.refused`,\n\t\t\t\trunId,\n\t\t\t\tseq: 1,\n\t\t\t\tts: new Date().toISOString(),\n\t\t\t\tprofile: {\n\t\t\t\t\tid: \"unknown\",\n\t\t\t\t\tversion: 1,\n\t\t\t\t\tdigest: createHash(\"sha256\").update(\"unknown\", \"utf8\").digest(\"hex\"),\n\t\t\t\t},\n\t\t\t\tcauses: [],\n\t\t\t\tkind: \"run_settled\",\n\t\t\t\tpayload: { outcome: \"failed\", failureClass, settledCleanly: true, retryOffer: [\"direct\"], totals: {} },\n\t\t\t},\n\t\t};\n\t\tawait rpcOutput(frame);\n\t} catch {\n\t\t// Refusal must still notify; a dead transport is not the command's problem.\n\t}\n}\n\nfunction disabledReason(pi: ExtensionAPI, env: NodeJS.ProcessEnv): string | undefined {\n\tconst raw = env[HUMAIN_FLOW_DISABLED_ENV]?.trim().toLowerCase();\n\tif (raw === \"1\" || raw === \"true\") return `${HUMAIN_FLOW_DISABLED_ENV}=${raw}`;\n\ttry {\n\t\t// `flow` is not a typed Settings key: settings.json keeps unknown keys, so read it raw.\n\t\tconst flow = (pi.getSettings() as Record<string, unknown>).flow;\n\t\tif (isRecord(flow) && flow.enabled === false) return \"setting flow.enabled=false\";\n\t} catch {\n\t\t// Runtime not bound yet: treat as enabled.\n\t}\n\treturn undefined;\n}\n\n/**\n * Run an executor extension against a staging proxy. The selected command is captured (so names never double-register); every other\n * registration is recorded and applied to the real pi only after the factory and the session_start replay succeed, so\n * a failed attempt leaves nothing behind and a retry starts from scratch. Late registration is supported by the\n * extension loader (handlers, tools, commands and flags are written to the live extension object), but\n * `session_start` has already fired by the time Flow loads, so the last session_start event is replayed to Flow's\n * staged session_start handlers.\n *\n * Commit is not transactional for non-handler members: if one throws midway, committed handlers are unsubscribed, and\n * tools/commands/flags/shortcuts/renderers (keyed maps in the extension loader) are simply overwritten on retry.\n */\nasync function runFlowExtension(\n\tpi: ExtensionAPI,\n\tflowExtension: ExtensionFactory,\n\tlastSessionStart: () => unknown[] | undefined,\n\tcapturedCommand = \"flow\",\n): Promise<Map<string, CommandOptions>> {\n\tconst captured = new Map<string, CommandOptions>();\n\tconst staged: StagedCall[] = [];\n\t// After a successful commit the proxy forwards live, so registrations made later (from handlers) reach the real pi.\n\tlet live = false;\n\tconst proxy = new Proxy(pi, {\n\t\tget(target, prop) {\n\t\t\tif (!live && typeof prop === \"string\" && STAGED_MEMBERS.has(prop)) {\n\t\t\t\treturn (...args: unknown[]) => {\n\t\t\t\t\tif (prop === \"registerCommand\" && args[0] === capturedCommand) {\n\t\t\t\t\t\tcaptured.set(args[0], args[1] as CommandOptions);\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tconst call: StagedCall = { member: prop, args, cancelled: false };\n\t\t\t\t\tstaged.push(call);\n\t\t\t\t\tif (prop !== \"on\") return undefined;\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tcall.cancelled = true;\n\t\t\t\t\t\tcall.unsubscribe?.();\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst value: unknown = Reflect.get(target, prop, target);\n\t\t\treturn typeof value === \"function\" ? value.bind(target) : value;\n\t\t},\n\t});\n\tawait flowExtension(proxy);\n\n\tlet replayed: unknown[] | undefined;\n\tfor (let start = lastSessionStart(); start && start !== replayed; start = lastSessionStart()) {\n\t\treplayed = start;\n\t\tfor (const call of staged) {\n\t\t\tif (call.member === \"on\" && call.args[0] === \"session_start\" && !call.cancelled) {\n\t\t\t\tawait (call.args[1] as EventHandler)(...start);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Synchronous from the last replay check: no session_start can slip between replay and commit.\n\tconst committed: Array<() => void> = [];\n\ttry {\n\t\tfor (const call of staged) {\n\t\t\tif (call.cancelled) continue;\n\t\t\tconst result = (Reflect.get(pi, call.member) as (...args: unknown[]) => unknown).apply(pi, call.args);\n\t\t\tif (call.member === \"on\") {\n\t\t\t\tcall.unsubscribe = result as () => void;\n\t\t\t\tcommitted.push(call.unsubscribe);\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tfor (const unsubscribe of committed) unsubscribe();\n\t\tthrow error;\n\t}\n\tlive = true;\n\treturn captured;\n}\n\nfunction isSameCliReleaseFlowDir(dir: string): boolean {\n\tif (!isAbsolute(dir) || VERSION === \"0.0.0\") return false;\n\ttry {\n\t\tconst manifest: unknown = JSON.parse(readFileSync(join(dir, \"package.json\"), \"utf8\"));\n\t\tif (!isRecord(manifest) || manifest.name !== \"@humain/flow\") return false;\n\t} catch {\n\t\treturn false;\n\t}\n\t// Bun ships flow/ beside package.json; bundled Node ships dist/bundle/flow/.\n\tfor (const root of [dirname(dir), resolve(dir, \"../../..\")]) {\n\t\ttry {\n\t\t\tconst manifest: unknown = JSON.parse(readFileSync(join(root, \"package.json\"), \"utf8\"));\n\t\t\tif (isRecord(manifest) && manifest.name === PACKAGE_NAME) return manifest.version === VERSION;\n\t\t} catch {\n\t\t\t// Missing or unreadable release metadata cannot validate an override.\n\t\t}\n\t}\n\treturn false;\n}\n\nexport function createHumainFlowLoaderExtensionFactory(options: HumainFlowLoaderOptions = {}): ExtensionFactory {\n\tconst env = options.env ?? process.env;\n\t// This is the single sanctioned lazy-load boundary for @humain/flow (see AGENTS.md \"No inline imports\" exception).\n\tconst importFlow = options.importFlow ?? (() => import(\"@humain/flow\"));\n\t// Separate sanctioned lazy boundary: lean Flow commands must never import the hierarchy package.\n\tconst importOrchestrate = options.importOrchestrate ?? (() => import(\"@humain/orchestrate\"));\n\tconst flowPackageDir = options.flowPackageDir ?? getBundledFlowPackageDir();\n\tconst builtInProfilesDir = options.builtInProfilesDir ?? getBundledFlowProfilesDir();\n\tlet flowModule: Promise<FlowModule> | undefined;\n\n\treturn (pi) => {\n\t\tdisabledProbe = () => disabledReason(pi, env) !== undefined;\n\t\tlet lastStart: unknown[] | undefined;\n\t\tlet loaded: Promise<Map<string, CommandOptions>> | undefined;\n\t\tlet hierarchy: FlowHierarchyCommands | undefined;\n\t\tlet orchestrateLoaded: Promise<Map<string, CommandOptions>> | undefined;\n\n\t\tpi.on(\"session_start\", (event, ctx) => {\n\t\t\tlastStart = [event, ctx];\n\t\t});\n\t\tpi.registerFlag(\"profile\", { description: \"Flow profile id\", type: \"string\" });\n\t\tpi.registerFlag(\"flow-admission\", { description: \"Flow run admission file (JSON)\", type: \"string\" });\n\n\t\tconst loadModule = async (): Promise<FlowModule> => {\n\t\t\tconst override = env[HUMAIN_FLOW_PACKAGE_DIR_ENV];\n\t\t\tif (override && !isSameCliReleaseFlowDir(override)) delete env[HUMAIN_FLOW_PACKAGE_DIR_ENV];\n\t\t\tif (flowPackageDir && !env[HUMAIN_FLOW_PACKAGE_DIR_ENV]) env[HUMAIN_FLOW_PACKAGE_DIR_ENV] = flowPackageDir;\n\t\t\tif (flowPackageDir) env.HUMAIN_TERMINAL_ORCHESTRATE_PACKAGE_DIR = join(dirname(flowPackageDir), \"orchestrate\");\n\t\t\tflowModule ??= importFlow().then((module) => {\n\t\t\t\trpcControl = module.createFlowRpcControl?.({\n\t\t\t\t\twriteFrame: (frame) => rpcOutput?.(frame),\n\t\t\t\t\tisDisabled: isFlowDisabled,\n\t\t\t\t\tsendFollowUp: (text) =>\n\t\t\t\t\t\trpcFollowUp ? rpcFollowUp(text) : Promise.reject(new Error(\"host unavailable\")),\n\t\t\t\t});\n\t\t\t\treturn module;\n\t\t\t});\n\t\t\ttry {\n\t\t\t\treturn await flowModule;\n\t\t\t} catch (error) {\n\t\t\t\tflowModule = undefined;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\n\t\trpcLoader = async () => {\n\t\t\ttry {\n\t\t\t\tawait loadModule();\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn rpcControl;\n\t\t};\n\n\t\tconst load = (): Promise<Map<string, CommandOptions>> => {\n\t\t\tif (!loaded) {\n\t\t\t\tconst attempt = (async () => {\n\t\t\t\t\tconst module = await loadModule();\n\t\t\t\t\tlet published: FlowHierarchyCommands | undefined;\n\t\t\t\t\tconst commands = await runFlowExtension(\n\t\t\t\t\t\tpi,\n\t\t\t\t\t\t(api) =>\n\t\t\t\t\t\t\tmodule.flowExtension(\n\t\t\t\t\t\t\t\tapi,\n\t\t\t\t\t\t\t\t(value) => {\n\t\t\t\t\t\t\t\t\tpublished = value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Sanctioned opt-in runtime boundary: never load SDK session code for ordinary Flow children.\n\t\t\t\t\t\t\t\t\tstartImplementerSession: async (input) =>\n\t\t\t\t\t\t\t\t\t\t(await import(\"../core/flow-implementer.ts\")).startFlowImplementerSession(input),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t() => lastStart,\n\t\t\t\t\t);\n\t\t\t\t\t// Publish only after staging and session replay succeed; failed attempts cannot leak their command.\n\t\t\t\t\thierarchy = published;\n\t\t\t\t\thierarchy?.hierarchyExecutor.setLoader(async () => {\n\t\t\t\t\t\tif (disabledReason(pi, env)) return;\n\t\t\t\t\t\tawait loadOrchestrate();\n\t\t\t\t\t});\n\t\t\t\t\treturn commands;\n\t\t\t\t})();\n\t\t\t\tloaded = attempt;\n\t\t\t\t// A failed load must be retryable on the next invocation.\n\t\t\t\tattempt.catch(() => {\n\t\t\t\t\tif (loaded === attempt) loaded = undefined;\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn loaded;\n\t\t};\n\n\t\tconst loadOrchestrate = (): Promise<Map<string, CommandOptions>> => {\n\t\t\tif (!orchestrateLoaded) {\n\t\t\t\tconst attempt = (async () => {\n\t\t\t\t\tawait load();\n\t\t\t\t\tif (!hierarchy) return new Map<string, CommandOptions>();\n\t\t\t\t\tconst module = await importOrchestrate();\n\t\t\t\t\treturn runFlowExtension(\n\t\t\t\t\t\tpi,\n\t\t\t\t\t\tmodule.createOrchestrateExtension(hierarchy),\n\t\t\t\t\t\t() => lastStart,\n\t\t\t\t\t\t\"orchestrate\",\n\t\t\t\t\t);\n\t\t\t\t})();\n\t\t\t\torchestrateLoaded = attempt;\n\t\t\t\tattempt.catch(() => {\n\t\t\t\t\tif (orchestrateLoaded === attempt) orchestrateLoaded = undefined;\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn orchestrateLoaded;\n\t\t};\n\n\t\tconst flow: CommandOptions = {\n\t\t\tdescription: FLOW_DESCRIPTION,\n\t\t\tgetArgumentCompletions: completeFlowArguments,\n\t\t\thandler: async (args: string, rawCtx: ExtensionCommandContext) => {\n\t\t\t\tconst ctx = withHeadlessNotices(rawCtx);\n\t\t\t\tconst refuse = (message: string, level: \"warning\" | \"error\") => {\n\t\t\t\t\tif (ctx.mode === \"print\" || ctx.mode === \"json\") process.exitCode = 1;\n\t\t\t\t\tctx.ui.notify(message, level);\n\t\t\t\t};\n\t\t\t\tconst parsed = parseFlowCommand(args);\n\t\t\t\tif (\"error\" in parsed) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\trefuse(parsed.error, \"error\");\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (parsed.command) await settleRefusal(pi, parsed.command, ctx, \"config_invalid\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst { command, payload } = parsed;\n\t\t\t\tif (command === \"help\") {\n\t\t\t\t\tctx.ui.notify(renderFlowHelp(payload.trim() || undefined), \"info\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Secure account dialogs exist only in the terminal UI: refuse elsewhere before loading Flow.\n\t\t\t\tif (command === \"setup\" && ctx.mode !== \"tui\") {\n\t\t\t\t\trefuse(FLOW_SETUP_TERMINAL_ONLY, \"error\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst reason = AVAILABLE_WHEN_DISABLED.has(command) ? undefined : disabledReason(pi, env);\n\t\t\t\tif (reason) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx.ui.notify(`Flow disabled (${reason}). /flow ${command} is unavailable.`, \"warning\");\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait settleRefusal(pi, command, ctx, \"config_invalid\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (command === \"profile\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst module = await loadModule();\n\t\t\t\t\t\tif (!module.runFlowProfileCommand || !module.createProfileStore) {\n\t\t\t\t\t\t\tctx.ui.notify(flowBuildUnavailable(command), \"error\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst store = module.createProfileStore({\n\t\t\t\t\t\t\tflowDir: options.flowDir ?? join(getAgentDir(), \"flow\"),\n\t\t\t\t\t\t\t...(builtInProfilesDir !== undefined ? { builtInDir: builtInProfilesDir } : {}),\n\t\t\t\t\t\t});\n\t\t\t\t\t\tawait module.runFlowProfileCommand(payload, ctx, { store });\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tctx.ui.notify(\n\t\t\t\t\t\t\t`/flow profile failed: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (LOADED_RUN_COMMANDS.has(command) && !loaded) {\n\t\t\t\t\tctx.ui.notify(NO_LOADED_RUN_COPY[command] ?? \"No active Flow run.\", \"info\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet commands: Map<string, CommandOptions>;\n\t\t\t\ttry {\n\t\t\t\t\tcommands = await (command === \"orchestrate\" ? loadOrchestrate() : load());\n\t\t\t\t} catch (error) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx.ui.notify(\n\t\t\t\t\t\t\t`Failed to load Flow: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait settleRefusal(pi, command, ctx, \"internal\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst real = commands.get(command === \"orchestrate\" ? \"orchestrate\" : \"flow\");\n\t\t\t\tif (!real) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx.ui.notify(flowBuildUnavailable(command), \"error\");\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait settleRefusal(pi, command, ctx, \"internal\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Flow re-parses its original arguments; Orchestrate receives the same byte-preserved payload directly.\n\t\t\t\tawait real.handler(command === \"orchestrate\" ? payload : args, ctx);\n\t\t\t},\n\t\t};\n\t\tpi.registerCommand(\"flow\", flow);\n\t\t// Same load, gating and refusal path as `/flow orchestrate <goal>`.\n\t\tpi.registerCommand(\"orchestrate\", {\n\t\t\tdescription: \"Plan and run a multi-agent Flow topology. Args: <goal> [flags]\",\n\t\t\thandler: (args, ctx) => flow.handler(`orchestrate ${args}`, ctx),\n\t\t});\n\t};\n}\n"]}
1
+ {"version":3,"file":"flow-loader.js","sourceRoot":"","sources":["../../src/humain/flow-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAyB,MAAM,2CAA2C,CAAC;AAEnG,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvH,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAQrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAEhB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AACxE,MAAM,CAAC,MAAM,2BAA2B,GAAG,kCAAkC,CAAC;AA4C9E,IAAI,UAAsC,CAAC;AAC3C,IAAI,aAA0C,CAAC;AAC/C,IAAI,SAA0E,CAAC;AAC/E,IAAI,SAAkE,CAAC;AACvE,IAAI,WAA0D,CAAC;AAE/D,qGAAqG;AACrG,MAAM,UAAU,iBAAiB;IAChC,OAAO,UAAU,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACvC,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAClC,IAAI,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from \"node:crypto\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, resolve } from \"node:path\";\nimport type { FlowHierarchyCommands } from \"@humain/flow\";\nimport { FLOW_ID_PATTERN, type FlowFailureClass } from \"@humain/humain-code-contracts/flow-common\";\nimport type { FlowEventFrameV1, FlowReceiptV1, FlowStatusV1 } from \"@humain/humain-code-contracts/flow-control\";\nimport { getAgentDir, getBundledFlowPackageDir, getBundledFlowProfilesDir, PACKAGE_NAME, VERSION } from \"../config.ts\";\nimport { readJsonFile } from \"../coordination/broker/atomic-file.ts\";\nimport type {\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionFactory,\n\tRegisteredCommand,\n} from \"../core/extensions/types.ts\";\nimport type { startFlowImplementerSession } from \"../core/flow-implementer.ts\";\nimport { createTraceRedactor } from \"../core/trace/redaction.ts\";\nimport { sanitizeForTerminal } from \"../core/trace-client/sanitize.ts\";\nimport {\n\tcompleteFlowArguments,\n\tFLOW_SETUP_TERMINAL_ONLY,\n\tFLOW_SUBCOMMANDS,\n\ttype FlowSubcommand,\n\tflowBuildUnavailable,\n\tparseFlowCommand,\n\trenderFlowHelp,\n} from \"./flow-command.ts\";\n\n/**\n * Lazy loader for the private @humain/flow and @humain/orchestrate packages.\n *\n * The CLI entry graph must not statically reach Flow: this module registers one cheap `/flow` stub (plus `/orchestrate`,\n * which forwards to it) and two flags, and\n * loads Flow the first time a subcommand needs it. Hierarchy commands additionally load Orchestrate through a second\n * memoized dynamic import, using the initialized Flow instance. Help, completion, unknown commands and not-yet-available\n * commands are answered statically and never import either package. Both packages are bundled as lazy chunks.\n */\n\nexport const HUMAIN_FLOW_DISABLED_ENV = \"HUMAIN_TERMINAL_FLOW_DISABLED\";\nexport const HUMAIN_FLOW_PACKAGE_DIR_ENV = \"HUMAIN_TERMINAL_FLOW_PACKAGE_DIR\";\n\n/** Run-control surface Flow exposes to rpc mode (flow_status/pause/resume/cancel/message). */\nexport interface FlowRpcControl {\n\thandle(input: unknown): Promise<{ receipt: FlowReceiptV1; status?: FlowStatusV1 }>;\n\tactiveRunId(): string | undefined;\n}\n\nexport interface FlowModule {\n\tflowExtension(\n\t\tpi: ExtensionAPI,\n\t\tpublishHierarchy?: (commands: FlowHierarchyCommands) => void,\n\t\thostServices?: { startImplementerSession: typeof startFlowImplementerSession },\n\t): void | Promise<void>;\n\t/** Documented rpc hook: called once when Flow loads; `writeFrame` carries `flow_event` frames to the rpc host. */\n\tcreateFlowRpcControl?(options: {\n\t\twriteFrame?: (frame: FlowEventFrameV1) => void | Promise<void>;\n\t\tisDisabled?: () => boolean;\n\t\t/** Queues text on the host session as a follow-up (flow_message with no active run). */\n\t\tsendFollowUp?: (text: string) => Promise<void>;\n\t}): FlowRpcControl;\n\t/** B1 profile command; optional so test fakes need not provide it. Methods stay bivariant for the real signatures. */\n\trunFlowProfileCommand?(args: string, ctx: ExtensionCommandContext, deps: { store: unknown }): Promise<unknown>;\n\tcreateProfileStore?(options: { flowDir: string; builtInDir?: string }): unknown;\n}\n\nexport interface OrchestrateModule {\n\tcreateOrchestrateExtension(commands: FlowHierarchyCommands): ExtensionFactory;\n}\n\nexport interface HumainFlowLoaderOptions {\n\t/** Test seam. Defaults to the single sanctioned dynamic import of @humain/flow. */\n\timportFlow?: () => Promise<FlowModule>;\n\t/** Test seam for the separate sanctioned lazy import of @humain/orchestrate. */\n\timportOrchestrate?: () => Promise<OrchestrateModule>;\n\tenv?: NodeJS.ProcessEnv;\n\t/** Directory holding Flow's agents/assets/package.json. Defaults to the bundled layout's flow/ dir. */\n\tflowPackageDir?: string;\n\t/** Built-in Flow profiles dir. Defaults to the bundled layout's assets/profiles; undefined lets Flow find its own. */\n\tbuiltInProfilesDir?: string;\n\t/** Flow profile store directory. Defaults to `<agentDir>/flow`. */\n\tflowDir?: string;\n}\n\nlet rpcControl: FlowRpcControl | undefined;\nlet disabledProbe: (() => boolean) | undefined;\nlet rpcOutput: ((frame: FlowEventFrameV1) => void | Promise<void>) | undefined;\nlet rpcLoader: (() => Promise<FlowRpcControl | undefined>) | undefined;\nlet rpcFollowUp: ((text: string) => Promise<void>) | undefined;\n\n/** The documented rpc hook: rpc mode reads Flow's run control here and never imports Flow itself. */\nexport function getFlowRpcControl(): FlowRpcControl | undefined {\n\treturn rpcControl;\n}\n\n/**\n * The documented rpc hook: loads Flow through the same lazy-load path the stub commands use and returns its run control.\n * Undefined when Flow is disabled (never loaded then), not wired, or fails to load.\n */\nexport async function loadFlowRpcControl(): Promise<FlowRpcControl | undefined> {\n\tif (rpcControl) return rpcControl;\n\tif (isFlowDisabled()) return undefined;\n\treturn rpcLoader?.();\n}\n\n/** True while Flow is switched off (flow.enabled=false or the env kill switch); rpc mode refuses flow_resume then. */\nexport function isFlowDisabled(): boolean {\n\treturn disabledProbe?.() ?? false;\n}\n\n/** The documented rpc hook: rpc mode registers where Flow's `flow_event` frames are written. */\nexport function setFlowRpcOutput(writer: ((frame: FlowEventFrameV1) => void | Promise<void>) | undefined): void {\n\trpcOutput = writer;\n}\n\n/** The documented rpc hook: rpc mode registers how direct-mode flow_message text is queued as a host follow-up. */\nexport function setFlowRpcFollowUp(queue: ((text: string) => Promise<void>) | undefined): void {\n\trpcFollowUp = queue;\n}\n\ntype CommandOptions = Omit<RegisteredCommand, \"name\" | \"sourceInfo\">;\ntype EventHandler = (...args: unknown[]) => unknown;\n\n/**\n * ExtensionAPI members that only record registrations (see core/extensions/loader.ts). They are staged while Flow's\n * factory runs and applied to the real pi only after the factory and the session_start replay succeed. Reads and\n * actions (getFlag, getSettings, exec, sendMessage, ...) and `events` stay live: they have no registration to undo\n * or are needed by the factory itself. Flow uses none of the live ones that subscribe (`events.on`).\n */\nconst STAGED_MEMBERS = new Set([\n\t\"on\",\n\t\"registerTool\",\n\t\"registerCommand\",\n\t\"registerShortcut\",\n\t\"registerFlag\",\n\t\"registerMessageRenderer\",\n\t\"registerMarkdownTransformer\",\n\t\"registerEntryRenderer\",\n\t\"registerProvider\",\n\t\"unregisterProvider\",\n\t\"registerMcpServer\",\n\t\"unregisterMcpServer\",\n\t\"registerVirtualModel\",\n\t\"unregisterVirtualModel\",\n]);\n\ninterface StagedCall {\n\tmember: string;\n\targs: unknown[];\n\tcancelled: boolean;\n\tunsubscribe?: () => void;\n}\n\nconst FLOW_DESCRIPTION =\n\t\"Plan, run, and verify work with agents. Subcommands: \" +\n\t`${FLOW_SUBCOMMANDS.filter((name) => name !== \"help\").join(\", \")}. Use /flow help for usage.`;\n\n/**\n * Act on an already loaded run only; with Flow not loaded there is no run, so Flow is never imported for them. They\n * stay reachable when Flow is disabled so a live run can still be stopped. Every other subcommand is refused when\n * disabled.\n */\nconst LOADED_RUN_COMMANDS: ReadonlySet<FlowSubcommand> = new Set([\n\t\"cancel\",\n\t\"status\",\n\t\"pause\",\n\t\"resume\",\n\t\"hide\",\n\t\"show\",\n]);\n/** Kill switch: resume would restart dispatch, so it is refused while Flow is disabled (the others are not). */\nconst AVAILABLE_WHEN_DISABLED: ReadonlySet<FlowSubcommand> = new Set([\"cancel\", \"status\", \"pause\", \"hide\", \"show\"]);\n/** Copy when a loaded-run command finds no Flow loaded, so there is nothing to act on. */\nconst NO_LOADED_RUN_COPY: Partial<Record<FlowSubcommand, string>> = {\n\tcancel: \"No active Flow run to stop.\",\n\tstatus: \"No active Flow run. Start one with /flow run <goal>.\",\n\tpause: \"No active Flow run to pause.\",\n\tresume: \"No paused Flow run to resume.\",\n\thide: \"No current Flow widget to hide.\",\n\tshow: \"No current Flow widget to show.\",\n};\n/** Only these start (or recover) work, so only their refusals settle an rpc run. */\nconst START_COMMANDS: ReadonlySet<FlowSubcommand> = new Set([\"run\", \"orchestrate\", \"continue\", \"fix\"]);\nconst FLOW_ID = new RegExp(FLOW_ID_PATTERN);\n// Match Flow's admission size limit without loading Flow on this refusal path.\nconst MAX_ADMISSION_FILE_BYTES = 1024 * 1024;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\n/**\n * Print/json mode has no UI: core makes ctx.ui.notify a no-op, so headless notices go to stderr as bare text.\n * Notice text can echo user args or env values, so it is redacted, stripped of terminal escapes, then redacted again\n * with the same redactor: the first pass catches secrets that stripping could otherwise mangle, the second catches\n * secrets that were split by escapes and are rejoined by stripping. Fails closed to a fixed line on any failure.\n * Replacing `ui` snapshots ui (descriptors preserve other ctx getters, so lazy getters on ctx stay live; same approach\n * as the runner's createCommandContext).\n */\nconst NOTICE_WITHHELD = \"[notice withheld: redaction unavailable]\";\n\nfunction safeNotice(message: string): string {\n\ttry {\n\t\tconst redactor = createTraceRedactor({ env: process.env });\n\t\treturn redactor.redactText(sanitizeForTerminal(redactor.redactText(message).text)).text;\n\t} catch {\n\t\treturn NOTICE_WITHHELD;\n\t}\n}\n\nfunction withHeadlessNotices(ctx: ExtensionCommandContext): ExtensionCommandContext {\n\tif (ctx.mode !== \"print\" && ctx.mode !== \"json\") return ctx;\n\tconst ui = Object.defineProperties({}, Object.getOwnPropertyDescriptors(ctx.ui)) as ExtensionCommandContext[\"ui\"];\n\tui.notify = (message: string) => {\n\t\tprocess.stderr.write(`${safeNotice(message)}\\n`);\n\t};\n\tconst wrapped = Object.defineProperties({}, Object.getOwnPropertyDescriptors(ctx)) as ExtensionCommandContext;\n\tObject.defineProperty(wrapped, \"ui\", { value: ui, enumerable: true, configurable: true });\n\treturn wrapped;\n}\n\nfunction readRefusalRunId(pi: ExtensionAPI, cwd: string): string | undefined {\n\ttry {\n\t\tconst file = pi.getFlag(\"flow-admission\");\n\t\tif (typeof file !== \"string\" || !file) return undefined;\n\t\tconst admission = readJsonFile(resolve(cwd, file), MAX_ADMISSION_FILE_BYTES);\n\t\t// As in Flow's refusal path, validate just the identity needed for correlation, not the entire admission.\n\t\tconst runId = isRecord(admission) ? admission.runId : undefined;\n\t\treturn typeof runId === \"string\" && !/[\\r\\n]/.test(runId) && FLOW_ID.test(runId) ? runId : undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Mirrors packages/flow emitRefusalSettled: an rpc `/flow run` or `/flow continue` that dispatches nothing still emits one terminal\n * `run_settled` frame so the host stops waiting. Built here because the entry graph must not reach @humain/flow.\n * Print/json refusals exit non-zero (mirrors flow's markHeadlessFailure). Never throws; no-op otherwise.\n */\nasync function settleRefusal(\n\tpi: ExtensionAPI,\n\tcommand: FlowSubcommand,\n\tctx: ExtensionCommandContext,\n\tfailureClass: FlowFailureClass,\n): Promise<void> {\n\tif (!START_COMMANDS.has(command)) return;\n\tif (ctx.mode === \"print\" || ctx.mode === \"json\") process.exitCode = 1;\n\tif (ctx.mode !== \"rpc\" || !rpcOutput) return;\n\ttry {\n\t\tconst runId = readRefusalRunId(pi, ctx.cwd) ?? `flow-refused-${randomBytes(8).toString(\"hex\")}`;\n\t\tconst frame: FlowEventFrameV1 = {\n\t\t\ttype: \"flow_event\",\n\t\t\tevent: {\n\t\t\t\tschema: \"humain-flow-event\",\n\t\t\t\tschemaVersion: 1,\n\t\t\t\teventId: `${runId.slice(0, 120)}.refused`,\n\t\t\t\trunId,\n\t\t\t\tseq: 1,\n\t\t\t\tts: new Date().toISOString(),\n\t\t\t\tprofile: {\n\t\t\t\t\tid: \"unknown\",\n\t\t\t\t\tversion: 1,\n\t\t\t\t\tdigest: createHash(\"sha256\").update(\"unknown\", \"utf8\").digest(\"hex\"),\n\t\t\t\t},\n\t\t\t\tcauses: [],\n\t\t\t\tkind: \"run_settled\",\n\t\t\t\tpayload: { outcome: \"failed\", failureClass, settledCleanly: true, retryOffer: [\"direct\"], totals: {} },\n\t\t\t},\n\t\t};\n\t\tawait rpcOutput(frame);\n\t} catch {\n\t\t// Refusal must still notify; a dead transport is not the command's problem.\n\t}\n}\n\nfunction disabledReason(pi: ExtensionAPI, env: NodeJS.ProcessEnv): string | undefined {\n\tconst raw = env[HUMAIN_FLOW_DISABLED_ENV]?.trim().toLowerCase();\n\tif (raw === \"1\" || raw === \"true\") return `${HUMAIN_FLOW_DISABLED_ENV}=${raw}`;\n\ttry {\n\t\t// `flow` is not a typed Settings key: settings.json keeps unknown keys, so read it raw.\n\t\tconst flow = (pi.getSettings() as Record<string, unknown>).flow;\n\t\tif (isRecord(flow) && flow.enabled === false) return \"setting flow.enabled=false\";\n\t} catch {\n\t\t// Runtime not bound yet: treat as enabled.\n\t}\n\treturn undefined;\n}\n\n/**\n * Run an executor extension against a staging proxy. The selected command is captured (so names never double-register); every other\n * registration is recorded and applied to the real pi only after the factory and the session_start replay succeed, so\n * a failed attempt leaves nothing behind and a retry starts from scratch. Late registration is supported by the\n * extension loader (handlers, tools, commands and flags are written to the live extension object), but\n * `session_start` has already fired by the time Flow loads, so the last session_start event is replayed to Flow's\n * staged session_start handlers.\n *\n * Commit is not transactional for non-handler members: if one throws midway, committed handlers are unsubscribed, and\n * tools/commands/flags/shortcuts/renderers (keyed maps in the extension loader) are simply overwritten on retry.\n */\nasync function runFlowExtension(\n\tpi: ExtensionAPI,\n\tflowExtension: ExtensionFactory,\n\tlastSessionStart: () => unknown[] | undefined,\n\tsignal: AbortSignal,\n\tcapturedCommand = \"flow\",\n): Promise<Map<string, CommandOptions>> {\n\tconst captured = new Map<string, CommandOptions>();\n\tconst staged: StagedCall[] = [];\n\t// After a successful commit the proxy forwards live, so registrations made later (from handlers) reach the real pi.\n\tlet live = false;\n\tconst proxy = new Proxy(pi, {\n\t\tget(target, prop) {\n\t\t\tif (!live && typeof prop === \"string\" && STAGED_MEMBERS.has(prop)) {\n\t\t\t\treturn (...args: unknown[]) => {\n\t\t\t\t\tif (prop === \"registerCommand\" && args[0] === capturedCommand) {\n\t\t\t\t\t\tcaptured.set(args[0], args[1] as CommandOptions);\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t\tconst call: StagedCall = { member: prop, args, cancelled: false };\n\t\t\t\t\tstaged.push(call);\n\t\t\t\t\tif (prop !== \"on\") return undefined;\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tcall.cancelled = true;\n\t\t\t\t\t\tcall.unsubscribe?.();\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst value: unknown = Reflect.get(target, prop, target);\n\t\t\treturn typeof value === \"function\" ? value.bind(target) : value;\n\t\t},\n\t});\n\tawait flowExtension(proxy);\n\tif (signal.aborted) return new Map();\n\n\tlet replayed: unknown[] | undefined;\n\tfor (let start = lastSessionStart(); start && start !== replayed; start = lastSessionStart()) {\n\t\treplayed = start;\n\t\tfor (const call of staged) {\n\t\t\tif (call.member === \"on\" && call.args[0] === \"session_start\" && !call.cancelled) {\n\t\t\t\tawait (call.args[1] as EventHandler)(...start);\n\t\t\t\tif (signal.aborted) return new Map();\n\t\t\t}\n\t\t}\n\t}\n\n\t// Synchronous from the last replay check: no session_start can slip between replay and commit.\n\tconst committed: Array<() => void> = [];\n\ttry {\n\t\tfor (const call of staged) {\n\t\t\tif (call.cancelled) continue;\n\t\t\tconst result = (Reflect.get(pi, call.member) as (...args: unknown[]) => unknown).apply(pi, call.args);\n\t\t\tif (call.member === \"on\") {\n\t\t\t\tcall.unsubscribe = result as () => void;\n\t\t\t\tcommitted.push(call.unsubscribe);\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tfor (const unsubscribe of committed) unsubscribe();\n\t\tthrow error;\n\t}\n\tlive = true;\n\treturn captured;\n}\n\nfunction isSameCliReleaseFlowDir(dir: string): boolean {\n\tif (!isAbsolute(dir) || VERSION === \"0.0.0\") return false;\n\ttry {\n\t\tconst manifest: unknown = JSON.parse(readFileSync(join(dir, \"package.json\"), \"utf8\"));\n\t\tif (!isRecord(manifest) || manifest.name !== \"@humain/flow\") return false;\n\t} catch {\n\t\treturn false;\n\t}\n\t// Bun ships flow/ beside package.json; bundled Node ships dist/bundle/flow/.\n\tfor (const root of [dirname(dir), resolve(dir, \"../../..\")]) {\n\t\ttry {\n\t\t\tconst manifest: unknown = JSON.parse(readFileSync(join(root, \"package.json\"), \"utf8\"));\n\t\t\tif (isRecord(manifest) && manifest.name === PACKAGE_NAME) return manifest.version === VERSION;\n\t\t} catch {\n\t\t\t// Missing or unreadable release metadata cannot validate an override.\n\t\t}\n\t}\n\treturn false;\n}\n\nexport function createHumainFlowLoaderExtensionFactory(options: HumainFlowLoaderOptions = {}): ExtensionFactory {\n\tconst env = options.env ?? process.env;\n\t// This is the single sanctioned lazy-load boundary for @humain/flow (see AGENTS.md \"No inline imports\" exception).\n\tconst importFlow = options.importFlow ?? (() => import(\"@humain/flow\"));\n\t// Separate sanctioned lazy boundary: lean Flow commands must never import the hierarchy package.\n\tconst importOrchestrate = options.importOrchestrate ?? (() => import(\"@humain/orchestrate\"));\n\tconst flowPackageDir = options.flowPackageDir ?? getBundledFlowPackageDir();\n\tconst builtInProfilesDir = options.builtInProfilesDir ?? getBundledFlowProfilesDir();\n\tlet flowModule: Promise<FlowModule> | undefined;\n\n\treturn (pi) => {\n\t\tdisabledProbe = () => disabledReason(pi, env) !== undefined;\n\t\t// Lazy imports and staged startup replays must not revive a replaced session.\n\t\tconst lifetime = new AbortController();\n\t\tlet lastStart: unknown[] | undefined;\n\t\tpi.on(\"session_shutdown\", () => {\n\t\t\tlifetime.abort();\n\t\t\tlastStart = undefined;\n\t\t});\n\t\tlet loaded: Promise<Map<string, CommandOptions>> | undefined;\n\t\tlet hierarchy: FlowHierarchyCommands | undefined;\n\t\tlet orchestrateLoaded: Promise<Map<string, CommandOptions>> | undefined;\n\n\t\tpi.on(\"session_start\", (event, ctx) => {\n\t\t\tlastStart = [event, ctx];\n\t\t});\n\t\tpi.registerFlag(\"profile\", { description: \"Flow profile id\", type: \"string\" });\n\t\tpi.registerFlag(\"flow-admission\", { description: \"Flow run admission file (JSON)\", type: \"string\" });\n\n\t\tconst loadModule = async (): Promise<FlowModule> => {\n\t\t\tconst override = env[HUMAIN_FLOW_PACKAGE_DIR_ENV];\n\t\t\tif (override && !isSameCliReleaseFlowDir(override)) delete env[HUMAIN_FLOW_PACKAGE_DIR_ENV];\n\t\t\tif (flowPackageDir && !env[HUMAIN_FLOW_PACKAGE_DIR_ENV]) env[HUMAIN_FLOW_PACKAGE_DIR_ENV] = flowPackageDir;\n\t\t\tif (flowPackageDir) env.HUMAIN_TERMINAL_ORCHESTRATE_PACKAGE_DIR = join(dirname(flowPackageDir), \"orchestrate\");\n\t\t\tflowModule ??= importFlow().then((module) => {\n\t\t\t\trpcControl = module.createFlowRpcControl?.({\n\t\t\t\t\twriteFrame: (frame) => rpcOutput?.(frame),\n\t\t\t\t\tisDisabled: isFlowDisabled,\n\t\t\t\t\tsendFollowUp: (text) =>\n\t\t\t\t\t\trpcFollowUp ? rpcFollowUp(text) : Promise.reject(new Error(\"host unavailable\")),\n\t\t\t\t});\n\t\t\t\treturn module;\n\t\t\t});\n\t\t\ttry {\n\t\t\t\treturn await flowModule;\n\t\t\t} catch (error) {\n\t\t\t\tflowModule = undefined;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\n\t\trpcLoader = async () => {\n\t\t\ttry {\n\t\t\t\tawait loadModule();\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn lifetime.signal.aborted ? undefined : rpcControl;\n\t\t};\n\n\t\tconst load = (): Promise<Map<string, CommandOptions>> => {\n\t\t\tif (!loaded) {\n\t\t\t\tconst attempt = (async () => {\n\t\t\t\t\tconst module = await loadModule();\n\t\t\t\t\tif (lifetime.signal.aborted) return new Map<string, CommandOptions>();\n\t\t\t\t\tlet published: FlowHierarchyCommands | undefined;\n\t\t\t\t\tconst commands = await runFlowExtension(\n\t\t\t\t\t\tpi,\n\t\t\t\t\t\t(api) =>\n\t\t\t\t\t\t\tmodule.flowExtension(\n\t\t\t\t\t\t\t\tapi,\n\t\t\t\t\t\t\t\t(value) => {\n\t\t\t\t\t\t\t\t\tpublished = value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Sanctioned opt-in runtime boundary: never load SDK session code for ordinary Flow children.\n\t\t\t\t\t\t\t\t\tstartImplementerSession: async (input) =>\n\t\t\t\t\t\t\t\t\t\t(await import(\"../core/flow-implementer.ts\")).startFlowImplementerSession(input),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t() => lastStart,\n\t\t\t\t\t\tlifetime.signal,\n\t\t\t\t\t);\n\t\t\t\t\tif (lifetime.signal.aborted) return commands;\n\t\t\t\t\t// Publish only after staging and session replay succeed; failed attempts cannot leak their command.\n\t\t\t\t\thierarchy = published;\n\t\t\t\t\thierarchy?.hierarchyExecutor.setLoader(async () => {\n\t\t\t\t\t\tif (disabledReason(pi, env)) return;\n\t\t\t\t\t\tawait loadOrchestrate();\n\t\t\t\t\t});\n\t\t\t\t\treturn commands;\n\t\t\t\t})();\n\t\t\t\tloaded = attempt;\n\t\t\t\t// A failed load must be retryable on the next invocation.\n\t\t\t\tattempt.catch(() => {\n\t\t\t\t\tif (loaded === attempt) loaded = undefined;\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn loaded;\n\t\t};\n\n\t\tconst loadOrchestrate = (): Promise<Map<string, CommandOptions>> => {\n\t\t\tif (!orchestrateLoaded) {\n\t\t\t\tconst attempt = (async () => {\n\t\t\t\t\tawait load();\n\t\t\t\t\tif (lifetime.signal.aborted || !hierarchy) return new Map<string, CommandOptions>();\n\t\t\t\t\tconst module = await importOrchestrate();\n\t\t\t\t\tif (lifetime.signal.aborted) return new Map<string, CommandOptions>();\n\t\t\t\t\treturn runFlowExtension(\n\t\t\t\t\t\tpi,\n\t\t\t\t\t\tmodule.createOrchestrateExtension(hierarchy),\n\t\t\t\t\t\t() => lastStart,\n\t\t\t\t\t\tlifetime.signal,\n\t\t\t\t\t\t\"orchestrate\",\n\t\t\t\t\t);\n\t\t\t\t})();\n\t\t\t\torchestrateLoaded = attempt;\n\t\t\t\tattempt.catch(() => {\n\t\t\t\t\tif (orchestrateLoaded === attempt) orchestrateLoaded = undefined;\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn orchestrateLoaded;\n\t\t};\n\n\t\tconst flow: CommandOptions = {\n\t\t\tdescription: FLOW_DESCRIPTION,\n\t\t\tgetArgumentCompletions: completeFlowArguments,\n\t\t\thandler: async (args: string, rawCtx: ExtensionCommandContext) => {\n\t\t\t\tif (lifetime.signal.aborted) return;\n\t\t\t\tconst ctx = withHeadlessNotices(rawCtx);\n\t\t\t\tconst refuse = (message: string, level: \"warning\" | \"error\") => {\n\t\t\t\t\tif (ctx.mode === \"print\" || ctx.mode === \"json\") process.exitCode = 1;\n\t\t\t\t\tctx.ui.notify(message, level);\n\t\t\t\t};\n\t\t\t\tconst parsed = parseFlowCommand(args);\n\t\t\t\tif (\"error\" in parsed) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\trefuse(parsed.error, \"error\");\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (parsed.command) await settleRefusal(pi, parsed.command, ctx, \"config_invalid\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst { command, payload } = parsed;\n\t\t\t\tif (command === \"help\") {\n\t\t\t\t\tctx.ui.notify(renderFlowHelp(payload.trim() || undefined), \"info\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Secure account dialogs exist only in the terminal UI: refuse elsewhere before loading Flow.\n\t\t\t\tif (command === \"setup\" && ctx.mode !== \"tui\") {\n\t\t\t\t\trefuse(FLOW_SETUP_TERMINAL_ONLY, \"error\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst reason = AVAILABLE_WHEN_DISABLED.has(command) ? undefined : disabledReason(pi, env);\n\t\t\t\tif (reason) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx.ui.notify(`Flow disabled (${reason}). /flow ${command} is unavailable.`, \"warning\");\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait settleRefusal(pi, command, ctx, \"config_invalid\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (command === \"profile\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst module = await loadModule();\n\t\t\t\t\t\tif (lifetime.signal.aborted) return;\n\t\t\t\t\t\tif (!module.runFlowProfileCommand || !module.createProfileStore) {\n\t\t\t\t\t\t\tctx.ui.notify(flowBuildUnavailable(command), \"error\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst store = module.createProfileStore({\n\t\t\t\t\t\t\tflowDir: options.flowDir ?? join(getAgentDir(), \"flow\"),\n\t\t\t\t\t\t\t...(builtInProfilesDir !== undefined ? { builtInDir: builtInProfilesDir } : {}),\n\t\t\t\t\t\t});\n\t\t\t\t\t\tawait module.runFlowProfileCommand(payload, ctx, { store });\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (lifetime.signal.aborted) return;\n\t\t\t\t\t\tctx.ui.notify(\n\t\t\t\t\t\t\t`/flow profile failed: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (LOADED_RUN_COMMANDS.has(command) && !loaded) {\n\t\t\t\t\tctx.ui.notify(NO_LOADED_RUN_COPY[command] ?? \"No active Flow run.\", \"info\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlet commands: Map<string, CommandOptions>;\n\t\t\t\ttry {\n\t\t\t\t\tcommands = await (command === \"orchestrate\" ? loadOrchestrate() : load());\n\t\t\t\t\tif (lifetime.signal.aborted) return;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (lifetime.signal.aborted) return;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx.ui.notify(\n\t\t\t\t\t\t\t`Failed to load Flow: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t\t\t\t\"error\",\n\t\t\t\t\t\t);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait settleRefusal(pi, command, ctx, \"internal\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst real = commands.get(command === \"orchestrate\" ? \"orchestrate\" : \"flow\");\n\t\t\t\tif (!real) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx.ui.notify(flowBuildUnavailable(command), \"error\");\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait settleRefusal(pi, command, ctx, \"internal\");\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Flow re-parses its original arguments; Orchestrate receives the same byte-preserved payload directly.\n\t\t\t\tawait real.handler(command === \"orchestrate\" ? payload : args, ctx);\n\t\t\t},\n\t\t};\n\t\tpi.registerCommand(\"flow\", flow);\n\t\t// Same load, gating and refusal path as `/flow orchestrate <goal>`.\n\t\tpi.registerCommand(\"orchestrate\", {\n\t\t\tdescription: \"Plan and run a multi-agent Flow topology. Args: <goal> [flags]\",\n\t\t\thandler: (args, ctx) => flow.handler(`orchestrate ${args}`, ctx),\n\t\t});\n\t};\n}\n"]}
@@ -4,6 +4,7 @@ export declare const GATEWAY_SETUP_WARNING = "Your HUMAIN Gateway access is bein
4
4
  export declare const DEFAULT_BLOCK_REASON = "Blocked for HUMAIN Code by HUMAIN Gateway.";
5
5
  type GatewayCatalogEntry = {
6
6
  id: string;
7
+ input: ("text" | "image")[];
7
8
  contextWindow: number;
8
9
  maxTokens: number;
9
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/humain/gateway/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAUpE,eAAO,MAAM,qBAAqB,mEAAmE,CAAC;AACtG,eAAO,MAAM,oBAAoB,+CAA+C,CAAC;AAEjF,KAAK,mBAAmB,GAAG;IAAE,EAAE,EAAE,MAAM,CA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,KAAK,EAAE,CAAC,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjH,UAAU,mBAAmB;IAC5B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,MAAM,EAAE,aAAa,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,UAAU,cAAc;IACvB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB;AAMD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,cAAc,CAuC/E;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,GAAG,SAAS,CAG7F;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACzC,MAAM,EAAE,SAAS,KAAK,CAAC,GAAG,CAAC,EAAE,EAC7B,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAczC"}
@@ -41,6 +41,7 @@ export function deriveGatewayCatalog(input) {
41
41
  const known = Object.hasOwn(GATEWAY_KNOWN_LIMITS, model.id) ? GATEWAY_KNOWN_LIMITS[model.id] : undefined;
42
42
  eligible.push({
43
43
  id: model.id,
44
+ input: model.input ?? ["text"],
44
45
  contextWindow: model.maxInputTokens ?? known?.input ?? GATEWAY_DEFAULT_LIMITS.input,
45
46
  maxTokens: model.maxOutputTokens ?? known?.output ?? GATEWAY_DEFAULT_LIMITS.output,
46
47
  });