@humain/humain-code 0.7.0 → 0.8.1

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 (735) hide show
  1. package/CHANGELOG.md +160 -0
  2. package/README.md +2 -2
  3. package/dist/bundle/agent-monitor.js +1 -1
  4. package/dist/bundle/chunks/anthropic-messages-XFCDMGD6.js +77 -0
  5. package/dist/bundle/chunks/anthropic.js +25 -24
  6. package/dist/bundle/chunks/azure-openai-responses-F4KQM3NK.js +15 -0
  7. package/dist/bundle/chunks/bedrock-converse-stream.js +460 -431
  8. package/dist/bundle/chunks/bowser-DXKSTXFQ.js +89 -0
  9. package/dist/bundle/chunks/{chunk-2G7YVAVF.js → chunk-2JNJJ6SZ.js} +1 -1
  10. package/dist/bundle/chunks/{chunk-HTA325LJ.js → chunk-2NVGOSBN.js} +1 -1
  11. package/dist/bundle/chunks/{chunk-5B25YXF7.js → chunk-3CGMVKHA.js} +13 -3
  12. package/dist/bundle/chunks/{chunk-SCINMV4X.js → chunk-46C6D7UC.js} +22 -21
  13. package/dist/bundle/chunks/chunk-4MKATHT2.js +24 -0
  14. package/dist/bundle/chunks/{chunk-TGDPZCSW.js → chunk-4TDNOR36.js} +1 -1
  15. package/dist/bundle/chunks/{chunk-C6VERWRZ.js → chunk-4XF5JX7X.js} +1 -1
  16. package/dist/bundle/chunks/{chunk-4HTVBBJD.js → chunk-65FLSKDA.js} +2 -2
  17. package/dist/bundle/chunks/chunk-6HTHDVJC.js +4 -0
  18. package/dist/bundle/chunks/{chunk-4PRNKB6V.js → chunk-6P6MMQUH.js} +7 -7
  19. package/dist/bundle/chunks/{chunk-66FZJO75.js → chunk-6TTMNQXI.js} +472 -3924
  20. package/dist/bundle/chunks/{chunk-32QLLD2P.js → chunk-6YVORXTX.js} +410 -352
  21. package/dist/bundle/chunks/chunk-7H2WNBX7.js +11 -0
  22. package/dist/bundle/chunks/{chunk-2FYYW6FY.js → chunk-7OZNMWAJ.js} +1 -1
  23. package/dist/bundle/chunks/{chunk-R6YQR7TZ.js → chunk-7WE77IE3.js} +1 -1
  24. package/dist/bundle/chunks/{chunk-Z5YLKK3S.js → chunk-7WETECIB.js} +1 -1
  25. package/dist/bundle/chunks/chunk-7X6DNT45.js +78 -0
  26. package/dist/bundle/chunks/{chunk-KRCX3ZBA.js → chunk-APNPBT7Y.js} +1 -1
  27. package/dist/bundle/chunks/{chunk-R5OOX7RW.js → chunk-B47PNNLL.js} +9 -2
  28. package/dist/bundle/chunks/{chunk-PPBDDQHP.js → chunk-CQ2CE3RB.js} +7 -6
  29. package/dist/bundle/chunks/{chunk-MD7K7RPN.js → chunk-D3KYOSQY.js} +1 -1
  30. package/dist/bundle/chunks/{chunk-I3NDOUHE.js → chunk-DCXHRP6C.js} +1 -1
  31. package/dist/bundle/chunks/{chunk-OB332KMV.js → chunk-DD5UT56Y.js} +46 -32
  32. package/dist/bundle/chunks/{chunk-I5E7RQ5V.js → chunk-DJG2WUNM.js} +5 -5
  33. package/dist/bundle/chunks/{chunk-4QAXV5T6.js → chunk-E7OBH44W.js} +9 -9
  34. package/dist/bundle/chunks/{chunk-Q7VXYXY3.js → chunk-ENBDASDN.js} +2 -2
  35. package/dist/bundle/chunks/{chunk-RS6PZK35.js → chunk-F2H47FRF.js} +249 -216
  36. package/dist/bundle/chunks/{chunk-2H3LUS62.js → chunk-FJIISX5W.js} +241 -229
  37. package/dist/bundle/chunks/chunk-FQ4KS5S4.js +23 -0
  38. package/dist/bundle/chunks/{chunk-SSRCVJZK.js → chunk-GPLWWO5Q.js} +5 -5
  39. package/dist/bundle/chunks/{chunk-WQOOJP7U.js → chunk-GV5OVRKK.js} +1 -1
  40. package/dist/bundle/chunks/{chunk-KTSJYIYC.js → chunk-HHWVVNGG.js} +1 -1
  41. package/dist/bundle/chunks/{chunk-4JRER4XK.js → chunk-HQMUDHC3.js} +19 -19
  42. package/dist/bundle/chunks/{chunk-G4QPSFBF.js → chunk-IMUFBWEK.js} +216 -223
  43. package/dist/bundle/chunks/{chunk-RU7ADKA7.js → chunk-J4GII2EE.js} +112 -96
  44. package/dist/bundle/chunks/{chunk-QT6ZHDMP.js → chunk-JBSWWCT5.js} +1 -1
  45. package/dist/bundle/chunks/{chunk-PWUDFU5V.js → chunk-JWOPWHVH.js} +4 -4
  46. package/dist/bundle/chunks/{chunk-AEWYICBL.js → chunk-KI7CHPWC.js} +2 -2
  47. package/dist/bundle/chunks/{chunk-4V5VL2BO.js → chunk-KLSRGGOH.js} +131 -154
  48. package/dist/bundle/chunks/{chunk-JF7FYXAI.js → chunk-KONLZKPL.js} +7 -6
  49. package/dist/bundle/chunks/{chunk-N2SNMUD3.js → chunk-KRBELWQH.js} +1 -1
  50. package/dist/bundle/chunks/{chunk-UZNIPOGS.js → chunk-L4J7SMJB.js} +1 -1
  51. package/dist/bundle/chunks/{chunk-EIC7CQX3.js → chunk-LSRXA7OS.js} +1 -1
  52. package/dist/bundle/chunks/{chunk-GRJUKEE3.js → chunk-MIAXMK5F.js} +4 -4
  53. package/dist/bundle/chunks/chunk-MPRAQ6ZI.js +41 -0
  54. package/dist/bundle/chunks/{chunk-GUHNFZ2Q.js → chunk-NICPFMOP.js} +20 -19
  55. package/dist/bundle/chunks/{chunk-WAPZN4KP.js → chunk-P2Y2H7SD.js} +2 -2
  56. package/dist/bundle/chunks/{chunk-T7BXP46S.js → chunk-P42E6YY6.js} +1892 -1680
  57. package/dist/bundle/chunks/{chunk-3EDMWQ35.js → chunk-PFBAIRCY.js} +17 -15
  58. package/dist/bundle/chunks/{chunk-XHDVDJM7.js → chunk-PVNXN2TC.js} +7 -7
  59. package/dist/bundle/chunks/{chunk-TWAHPPXN.js → chunk-PWFM6AQQ.js} +1307 -1194
  60. package/dist/bundle/chunks/{chunk-RNBZBCH2.js → chunk-QJB5YI3I.js} +1 -1
  61. package/dist/bundle/chunks/{chunk-P6AXBESH.js → chunk-QRRVZYTG.js} +1119 -1098
  62. package/dist/bundle/chunks/{chunk-WQ7EJQIT.js → chunk-ROFZVEFN.js} +247 -250
  63. package/dist/bundle/chunks/chunk-SKCJ25SX.js +24 -0
  64. package/dist/bundle/chunks/{chunk-AZXVJN6E.js → chunk-SXOIQWNX.js} +1 -1
  65. package/dist/bundle/chunks/{chunk-6E6RHNOU.js → chunk-UXM4WFLH.js} +12 -11
  66. package/dist/bundle/chunks/{chunk-LB4CIS4F.js → chunk-VCMXBP5S.js} +17 -17
  67. package/dist/bundle/chunks/{chunk-JYWUOKOI.js → chunk-WBSGWISD.js} +367 -353
  68. package/dist/bundle/chunks/chunk-XZ7FTBXS.js +2102 -0
  69. package/dist/bundle/chunks/chunk-YSWDFV2L.js +11 -0
  70. package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
  71. package/dist/bundle/chunks/chunk-ZTG5OKI7.js +3 -0
  72. package/dist/bundle/chunks/{cli-H4LJNE2V.js → cli-6DJO467D.js} +2 -2
  73. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-T5R2RVFQ.js → cloudflare-workers-ai-system-one-JEZVYITT.js} +1 -1
  74. package/dist/bundle/chunks/codemode-worker.js +68 -68
  75. package/dist/bundle/chunks/compat-SRCNS6OQ.js +15 -0
  76. package/dist/bundle/chunks/curator-server-QB4GITGS.js +3600 -0
  77. package/dist/bundle/chunks/dist-35STTNYA.js +37 -0
  78. package/dist/bundle/chunks/{dist-FMWWM4H7.js → dist-4OMLHRJE.js} +2 -2
  79. package/dist/bundle/chunks/dist-CBODG4CA.js +11 -0
  80. package/dist/bundle/chunks/{dist-NHQTBDHT.js → dist-TRAK7EXI.js} +91 -257
  81. package/dist/bundle/chunks/dist-cjs-EROMDUKS.js +193 -0
  82. package/dist/bundle/chunks/{easter-egg-3d-BUEOC3NO.js → easter-egg-3d-VVUF3C3X.js} +1 -1
  83. package/dist/bundle/chunks/entry-2GZ3PTWQ.js +2 -0
  84. package/dist/bundle/chunks/{entry-A2CSLKHC.js → entry-SRYLSS5P.js} +3 -3
  85. package/dist/bundle/chunks/{event-streams-7YGFEPBZ.js → event-streams-F67JLS6B.js} +1 -1
  86. package/dist/bundle/chunks/{execute-MY5JSEPV.js → execute-I3WGGPWL.js} +2 -2
  87. package/dist/bundle/chunks/{extract-PTGACPGP.js → extract-L373D6O7.js} +68 -65
  88. package/dist/bundle/chunks/{flow-implementer-APJFY4YI.js → flow-implementer-4KO3Q4B5.js} +8 -9
  89. package/dist/bundle/chunks/github-copilot.js +53 -46
  90. package/dist/bundle/chunks/google-generative-ai-WIASMWS3.js +22 -0
  91. package/dist/bundle/chunks/google-vertex-WSPHRZIZ.js +25 -0
  92. package/dist/bundle/chunks/host-WOLZCWQQ.js +3 -0
  93. package/dist/bundle/chunks/image-resize-worker.js +3 -3
  94. package/dist/bundle/chunks/{index.bundle-THL4EUSU.js → index.bundle-HONF3PUD.js} +177 -176
  95. package/dist/bundle/chunks/{inprocess-5NP5VJHZ.js → inprocess-TOBRVK4C.js} +6 -6
  96. package/dist/bundle/chunks/interactive-mode-BJJKPBXD.js +5 -0
  97. package/dist/bundle/chunks/{llama-cpp-classify-GJAXULWL.js → llama-cpp-classify-KYZT532X.js} +1 -1
  98. package/dist/bundle/chunks/mistral-conversations-7JYDDRUT.js +43 -0
  99. package/dist/bundle/chunks/{node-UNHECG4X.js → node-MHHE76P4.js} +475 -440
  100. package/dist/bundle/chunks/{node-ZFIIS5IM.js → node-N7TPBUJB.js} +53 -30
  101. package/dist/bundle/chunks/{openai-codex-responses-S7CMCAOY.js → openai-codex-responses-7PAML4NF.js} +30 -29
  102. package/dist/bundle/chunks/openai-codex.js +9 -8
  103. package/dist/bundle/chunks/{openai-completions-2Z57N7PC.js → openai-completions-UJDAIGTK.js} +22 -22
  104. package/dist/bundle/chunks/{openai-decisions-JIOJDB4C.js → openai-decisions-JMSDGR7K.js} +1 -1
  105. package/dist/bundle/chunks/{openai-responses-5VBZSTHL.js → openai-responses-2WNCE6AY.js} +4 -5
  106. package/dist/bundle/chunks/{openrouter-images-S6O7DBEJ.js → openrouter-images-V3UCCO6X.js} +1 -1
  107. package/dist/bundle/chunks/openrouter.js +9 -8
  108. package/dist/bundle/chunks/pdfjs-FE3L72A6.js +3662 -0
  109. package/dist/bundle/chunks/{pdfjs-decoders-OFXX4HDZ.js → pdfjs-decoders-VCMCTQJ2.js} +1 -1
  110. package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-I4K6AIV4.js +295 -0
  111. package/dist/bundle/chunks/pdfjs-openjpeg-PYQCV6CM.js +590 -0
  112. package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-G363SGDI.js +775 -0
  113. package/dist/bundle/chunks/{pi-messages-SMLN5J2W.js → pi-messages-TQ7LJUNQ.js} +11 -11
  114. package/dist/bundle/chunks/radius.js +8 -7
  115. package/dist/bundle/chunks/{runtime-OYTWXIUM.js → runtime-H7LYNKCZ.js} +1 -1
  116. package/dist/bundle/chunks/session-picker-4JQEGLDD.js +4 -0
  117. package/dist/bundle/chunks/startup-ui-AKTA4NDP.js +3 -0
  118. package/dist/bundle/chunks/{trace-command-YLDYCL55.js → trace-command-7ORDQ3JS.js} +4 -4
  119. package/dist/bundle/chunks/{typesafe-system-one-7BEL3H5N.js → typesafe-system-one-YP7GGN4C.js} +1 -1
  120. package/dist/bundle/chunks/{undici-C6S56CGI.js → undici-WVNE45GY.js} +1 -1
  121. package/dist/bundle/chunks/virtual-modules-3CT5BMBA.js +28 -0
  122. package/dist/bundle/cli-runtime.js +5 -5
  123. package/dist/bundle/flow/package.json +5 -5
  124. package/dist/bundle/index.js +13 -13
  125. package/dist/bundle/orchestrate/package.json +22 -6
  126. package/dist/bundle/rpc-entry.js +4 -5
  127. package/dist/cli/args.d.ts.map +1 -1
  128. package/dist/cli/args.js +4 -3
  129. package/dist/cli/args.js.map +1 -1
  130. package/dist/cli/config-selector.d.ts.map +1 -1
  131. package/dist/cli/config-selector.js +9 -6
  132. package/dist/cli/config-selector.js.map +1 -1
  133. package/dist/cli/list-models.d.ts.map +1 -1
  134. package/dist/cli/list-models.js +16 -1
  135. package/dist/cli/list-models.js.map +1 -1
  136. package/dist/cli/session-picker.d.ts.map +1 -1
  137. package/dist/cli/session-picker.js +9 -6
  138. package/dist/cli/session-picker.js.map +1 -1
  139. package/dist/cli/setup.d.ts +1 -1
  140. package/dist/cli/setup.d.ts.map +1 -1
  141. package/dist/cli/setup.js +3 -2
  142. package/dist/cli/setup.js.map +1 -1
  143. package/dist/cli/startup-ui.d.ts.map +1 -1
  144. package/dist/cli/startup-ui.js +8 -4
  145. package/dist/cli/startup-ui.js.map +1 -1
  146. package/dist/cli.js.map +1 -1
  147. package/dist/core/agent-session-runtime.d.ts +14 -0
  148. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  149. package/dist/core/agent-session-runtime.js +30 -2
  150. package/dist/core/agent-session-runtime.js.map +1 -1
  151. package/dist/core/agent-session-services.d.ts +0 -2
  152. package/dist/core/agent-session-services.d.ts.map +1 -1
  153. package/dist/core/agent-session-services.js +0 -2
  154. package/dist/core/agent-session-services.js.map +1 -1
  155. package/dist/core/agent-session.d.ts +31 -39
  156. package/dist/core/agent-session.d.ts.map +1 -1
  157. package/dist/core/agent-session.js +231 -535
  158. package/dist/core/agent-session.js.map +1 -1
  159. package/dist/core/anthropic-subscription-usage.d.ts +4 -2
  160. package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
  161. package/dist/core/anthropic-subscription-usage.js +32 -16
  162. package/dist/core/anthropic-subscription-usage.js.map +1 -1
  163. package/dist/core/auto-session-namer.js +1 -1
  164. package/dist/core/auto-session-namer.js.map +1 -1
  165. package/dist/core/cache-warmer.d.ts.map +1 -1
  166. package/dist/core/cache-warmer.js +2 -0
  167. package/dist/core/cache-warmer.js.map +1 -1
  168. package/dist/core/exec.d.ts +1 -0
  169. package/dist/core/exec.d.ts.map +1 -1
  170. package/dist/core/exec.js +4 -1
  171. package/dist/core/exec.js.map +1 -1
  172. package/dist/core/export-html/ansi-to-html.d.ts +6 -1
  173. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  174. package/dist/core/export-html/ansi-to-html.js +57 -20
  175. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  176. package/dist/core/export-html/template.js +1 -1
  177. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  178. package/dist/core/export-html/tool-renderer.js +2 -3
  179. package/dist/core/export-html/tool-renderer.js.map +1 -1
  180. package/dist/core/extensions/loader.d.ts.map +1 -1
  181. package/dist/core/extensions/loader.js +18 -1
  182. package/dist/core/extensions/loader.js.map +1 -1
  183. package/dist/core/extensions/runner.d.ts.map +1 -1
  184. package/dist/core/extensions/runner.js +5 -0
  185. package/dist/core/extensions/runner.js.map +1 -1
  186. package/dist/core/extensions/types.d.ts +5 -0
  187. package/dist/core/extensions/types.d.ts.map +1 -1
  188. package/dist/core/extensions/types.js.map +1 -1
  189. package/dist/core/flow-implementer.d.ts.map +1 -1
  190. package/dist/core/flow-implementer.js +3 -9
  191. package/dist/core/flow-implementer.js.map +1 -1
  192. package/dist/core/keybindings.d.ts +64 -0
  193. package/dist/core/keybindings.d.ts.map +1 -1
  194. package/dist/core/keybindings.js +8 -0
  195. package/dist/core/keybindings.js.map +1 -1
  196. package/dist/core/model-config.d.ts +13 -0
  197. package/dist/core/model-config.d.ts.map +1 -1
  198. package/dist/core/model-registry.d.ts +3 -0
  199. package/dist/core/model-registry.d.ts.map +1 -1
  200. package/dist/core/model-registry.js +44 -9
  201. package/dist/core/model-registry.js.map +1 -1
  202. package/dist/core/model-resolver.d.ts +0 -1
  203. package/dist/core/model-resolver.d.ts.map +1 -1
  204. package/dist/core/model-resolver.js +14 -17
  205. package/dist/core/model-resolver.js.map +1 -1
  206. package/dist/core/model-runtime.d.ts +28 -8
  207. package/dist/core/model-runtime.d.ts.map +1 -1
  208. package/dist/core/model-runtime.js +64 -14
  209. package/dist/core/model-runtime.js.map +1 -1
  210. package/dist/core/oauth-account-pool.d.ts +9 -0
  211. package/dist/core/oauth-account-pool.d.ts.map +1 -1
  212. package/dist/core/oauth-account-pool.js +138 -23
  213. package/dist/core/oauth-account-pool.js.map +1 -1
  214. package/dist/core/package-manager.d.ts +16 -0
  215. package/dist/core/package-manager.d.ts.map +1 -1
  216. package/dist/core/package-manager.js +46 -3
  217. package/dist/core/package-manager.js.map +1 -1
  218. package/dist/core/pi-ai-schemas.d.ts +1 -0
  219. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  220. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  221. package/dist/core/remote-catalog-provider.js +7 -0
  222. package/dist/core/remote-catalog-provider.js.map +1 -1
  223. package/dist/core/resource-loader.d.ts +5 -1
  224. package/dist/core/resource-loader.d.ts.map +1 -1
  225. package/dist/core/resource-loader.js +2 -0
  226. package/dist/core/resource-loader.js.map +1 -1
  227. package/dist/core/run-outcome.d.ts +6 -3
  228. package/dist/core/run-outcome.d.ts.map +1 -1
  229. package/dist/core/run-outcome.js +36 -9
  230. package/dist/core/run-outcome.js.map +1 -1
  231. package/dist/core/run-preflight.d.ts +1 -1
  232. package/dist/core/run-preflight.d.ts.map +1 -1
  233. package/dist/core/run-preflight.js +19 -11
  234. package/dist/core/run-preflight.js.map +1 -1
  235. package/dist/core/sdk.d.ts +0 -6
  236. package/dist/core/sdk.d.ts.map +1 -1
  237. package/dist/core/sdk.js +9 -18
  238. package/dist/core/sdk.js.map +1 -1
  239. package/dist/core/settings-manager.d.ts +0 -5
  240. package/dist/core/settings-manager.d.ts.map +1 -1
  241. package/dist/core/settings-manager.js +0 -9
  242. package/dist/core/settings-manager.js.map +1 -1
  243. package/dist/core/settings-schema.d.ts +0 -4
  244. package/dist/core/settings-schema.d.ts.map +1 -1
  245. package/dist/core/settings-schema.js +0 -1
  246. package/dist/core/settings-schema.js.map +1 -1
  247. package/dist/core/slash-commands.d.ts.map +1 -1
  248. package/dist/core/slash-commands.js +1 -0
  249. package/dist/core/slash-commands.js.map +1 -1
  250. package/dist/core/tools/bash-jobs.d.ts.map +1 -1
  251. package/dist/core/tools/bash-jobs.js +2 -9
  252. package/dist/core/tools/bash-jobs.js.map +1 -1
  253. package/dist/core/tools/find.d.ts.map +1 -1
  254. package/dist/core/tools/find.js +28 -16
  255. package/dist/core/tools/find.js.map +1 -1
  256. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  257. package/dist/core/tools/output-accumulator.js +4 -1
  258. package/dist/core/tools/output-accumulator.js.map +1 -1
  259. package/dist/core/tools/read.d.ts +8 -4
  260. package/dist/core/tools/read.d.ts.map +1 -1
  261. package/dist/core/tools/read.js +10 -15
  262. package/dist/core/tools/read.js.map +1 -1
  263. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  264. package/dist/core/tools/renderers/read.js +6 -2
  265. package/dist/core/tools/renderers/read.js.map +1 -1
  266. package/dist/core/tools/subagent-worktree.d.ts.map +1 -1
  267. package/dist/core/tools/subagent-worktree.js +2 -10
  268. package/dist/core/tools/subagent-worktree.js.map +1 -1
  269. package/dist/core/trace-client/credential-store.d.ts.map +1 -1
  270. package/dist/core/trace-client/credential-store.js +9 -5
  271. package/dist/core/trace-client/credential-store.js.map +1 -1
  272. package/dist/extensions/codemode/execute.js +2 -2
  273. package/dist/extensions/codemode/execute.js.map +1 -1
  274. package/dist/extensions/llama/provider.d.ts +1 -1
  275. package/dist/extensions/llama/provider.d.ts.map +1 -1
  276. package/dist/extensions/llama/provider.js +6 -4
  277. package/dist/extensions/llama/provider.js.map +1 -1
  278. package/dist/extensions/usage/account-reconnect.d.ts +5 -0
  279. package/dist/extensions/usage/account-reconnect.d.ts.map +1 -0
  280. package/dist/extensions/usage/account-reconnect.js +12 -0
  281. package/dist/extensions/usage/account-reconnect.js.map +1 -0
  282. package/dist/extensions/usage/confirmation.d.ts.map +1 -1
  283. package/dist/extensions/usage/confirmation.js +1 -1
  284. package/dist/extensions/usage/confirmation.js.map +1 -1
  285. package/dist/extensions/usage/hcode-overview.d.ts +6 -19
  286. package/dist/extensions/usage/hcode-overview.d.ts.map +1 -1
  287. package/dist/extensions/usage/hcode-overview.js +86 -100
  288. package/dist/extensions/usage/hcode-overview.js.map +1 -1
  289. package/dist/extensions/usage/index.d.ts.map +1 -1
  290. package/dist/extensions/usage/index.js +75 -99
  291. package/dist/extensions/usage/index.js.map +1 -1
  292. package/dist/extensions/usage/overview.d.ts +22 -17
  293. package/dist/extensions/usage/overview.d.ts.map +1 -1
  294. package/dist/extensions/usage/overview.js +98 -13
  295. package/dist/extensions/usage/overview.js.map +1 -1
  296. package/dist/extensions/usage/panes.d.ts +5 -0
  297. package/dist/extensions/usage/panes.d.ts.map +1 -0
  298. package/dist/extensions/usage/panes.js +10 -0
  299. package/dist/extensions/usage/panes.js.map +1 -0
  300. package/dist/extensions/usage/popup.d.ts +9 -14
  301. package/dist/extensions/usage/popup.d.ts.map +1 -1
  302. package/dist/extensions/usage/popup.js +87 -183
  303. package/dist/extensions/usage/popup.js.map +1 -1
  304. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +4 -1
  305. package/dist/humain/flow-command.js +1 -1
  306. package/dist/humain/flow-command.js.map +1 -1
  307. package/dist/humain/flow-loader.d.ts +9 -4
  308. package/dist/humain/flow-loader.d.ts.map +1 -1
  309. package/dist/humain/flow-loader.js +30 -21
  310. package/dist/humain/flow-loader.js.map +1 -1
  311. package/dist/humain/gateway/client.d.ts +3 -1
  312. package/dist/humain/gateway/client.d.ts.map +1 -1
  313. package/dist/humain/gateway/client.js +10 -5
  314. package/dist/humain/gateway/client.js.map +1 -1
  315. package/dist/humain/gateway/login.d.ts.map +1 -1
  316. package/dist/humain/gateway/login.js +160 -53
  317. package/dist/humain/gateway/login.js.map +1 -1
  318. package/dist/humain/hcode/account-store.d.ts +29 -5
  319. package/dist/humain/hcode/account-store.d.ts.map +1 -1
  320. package/dist/humain/hcode/account-store.js +224 -124
  321. package/dist/humain/hcode/account-store.js.map +1 -1
  322. package/dist/humain/hcode/account.d.ts +6 -0
  323. package/dist/humain/hcode/account.d.ts.map +1 -1
  324. package/dist/humain/hcode/account.js +348 -129
  325. package/dist/humain/hcode/account.js.map +1 -1
  326. package/dist/humain/hcode/catalog-watch.d.ts +21 -0
  327. package/dist/humain/hcode/catalog-watch.d.ts.map +1 -0
  328. package/dist/humain/hcode/catalog-watch.js +46 -0
  329. package/dist/humain/hcode/catalog-watch.js.map +1 -0
  330. package/dist/humain/hcode/contracts.d.ts +31 -1
  331. package/dist/humain/hcode/contracts.d.ts.map +1 -1
  332. package/dist/humain/hcode/contracts.js +205 -136
  333. package/dist/humain/hcode/contracts.js.map +1 -1
  334. package/dist/humain/hcode/environment.d.ts +3 -1
  335. package/dist/humain/hcode/environment.d.ts.map +1 -1
  336. package/dist/humain/hcode/environment.js +14 -2
  337. package/dist/humain/hcode/environment.js.map +1 -1
  338. package/dist/humain/hcode/facade.d.ts +26 -6
  339. package/dist/humain/hcode/facade.d.ts.map +1 -1
  340. package/dist/humain/hcode/facade.js +148 -38
  341. package/dist/humain/hcode/facade.js.map +1 -1
  342. package/dist/humain/hcode/http.d.ts +3 -1
  343. package/dist/humain/hcode/http.d.ts.map +1 -1
  344. package/dist/humain/hcode/http.js +44 -23
  345. package/dist/humain/hcode/http.js.map +1 -1
  346. package/dist/humain/hcode/images.d.ts +67 -0
  347. package/dist/humain/hcode/images.d.ts.map +1 -0
  348. package/dist/humain/hcode/images.js +465 -0
  349. package/dist/humain/hcode/images.js.map +1 -0
  350. package/dist/humain/hcode/login-copy.d.ts +28 -0
  351. package/dist/humain/hcode/login-copy.d.ts.map +1 -0
  352. package/dist/humain/hcode/login-copy.js +74 -0
  353. package/dist/humain/hcode/login-copy.js.map +1 -0
  354. package/dist/humain/hcode/login-failure.d.ts +26 -0
  355. package/dist/humain/hcode/login-failure.d.ts.map +1 -0
  356. package/dist/humain/hcode/login-failure.js +50 -0
  357. package/dist/humain/hcode/login-failure.js.map +1 -0
  358. package/dist/humain/hcode/notices.d.ts +45 -1
  359. package/dist/humain/hcode/notices.d.ts.map +1 -1
  360. package/dist/humain/hcode/notices.js +124 -7
  361. package/dist/humain/hcode/notices.js.map +1 -1
  362. package/dist/humain/hcode/provider.d.ts +9 -3
  363. package/dist/humain/hcode/provider.d.ts.map +1 -1
  364. package/dist/humain/hcode/provider.js +204 -20
  365. package/dist/humain/hcode/provider.js.map +1 -1
  366. package/dist/humain/hcode/run-credential.d.ts +21 -0
  367. package/dist/humain/hcode/run-credential.d.ts.map +1 -0
  368. package/dist/humain/hcode/run-credential.js +140 -0
  369. package/dist/humain/hcode/run-credential.js.map +1 -0
  370. package/dist/humain/hcode/sandbox.d.ts +6 -0
  371. package/dist/humain/hcode/sandbox.d.ts.map +1 -0
  372. package/dist/humain/hcode/sandbox.js +139 -0
  373. package/dist/humain/hcode/sandbox.js.map +1 -0
  374. package/dist/humain/hcode/selection.d.ts +9 -2
  375. package/dist/humain/hcode/selection.d.ts.map +1 -1
  376. package/dist/humain/hcode/selection.js +37 -6
  377. package/dist/humain/hcode/selection.js.map +1 -1
  378. package/dist/humain/hcode/transport.d.ts +14 -10
  379. package/dist/humain/hcode/transport.d.ts.map +1 -1
  380. package/dist/humain/hcode/transport.js +119 -149
  381. package/dist/humain/hcode/transport.js.map +1 -1
  382. package/dist/humain/hcode/wire.d.ts +3 -0
  383. package/dist/humain/hcode/wire.d.ts.map +1 -1
  384. package/dist/humain/hcode/wire.js +11 -0
  385. package/dist/humain/hcode/wire.js.map +1 -1
  386. package/dist/humain/metadata/contracts.d.ts +1 -0
  387. package/dist/humain/metadata/contracts.d.ts.map +1 -1
  388. package/dist/humain/metadata/contracts.js +2 -1
  389. package/dist/humain/metadata/contracts.js.map +1 -1
  390. package/dist/humain/remote/broker.d.ts +84 -0
  391. package/dist/humain/remote/broker.d.ts.map +1 -0
  392. package/dist/humain/remote/broker.js +427 -0
  393. package/dist/humain/remote/broker.js.map +1 -0
  394. package/dist/humain/remote/deny-store.d.ts +12 -0
  395. package/dist/humain/remote/deny-store.d.ts.map +1 -0
  396. package/dist/humain/remote/deny-store.js +164 -0
  397. package/dist/humain/remote/deny-store.js.map +1 -0
  398. package/dist/humain/remote/enablement.d.ts +5 -0
  399. package/dist/humain/remote/enablement.d.ts.map +1 -0
  400. package/dist/humain/remote/enablement.js +8 -0
  401. package/dist/humain/remote/enablement.js.map +1 -0
  402. package/dist/humain/remote/environment.d.ts +11 -0
  403. package/dist/humain/remote/environment.d.ts.map +1 -0
  404. package/dist/humain/remote/environment.js +19 -0
  405. package/dist/humain/remote/environment.js.map +1 -0
  406. package/dist/humain/remote/host-watch.d.ts +21 -0
  407. package/dist/humain/remote/host-watch.d.ts.map +1 -0
  408. package/dist/humain/remote/host-watch.js +186 -0
  409. package/dist/humain/remote/host-watch.js.map +1 -0
  410. package/dist/humain/remote/ipc-posix.d.ts +5 -0
  411. package/dist/humain/remote/ipc-posix.d.ts.map +1 -0
  412. package/dist/humain/remote/ipc-posix.js +29 -0
  413. package/dist/humain/remote/ipc-posix.js.map +1 -0
  414. package/dist/humain/remote/ipc-windows.d.ts +3 -0
  415. package/dist/humain/remote/ipc-windows.d.ts.map +1 -0
  416. package/dist/humain/remote/ipc-windows.js +5 -0
  417. package/dist/humain/remote/ipc-windows.js.map +1 -0
  418. package/dist/humain/remote/ipc.d.ts +10 -0
  419. package/dist/humain/remote/ipc.d.ts.map +1 -0
  420. package/dist/humain/remote/ipc.js +19 -0
  421. package/dist/humain/remote/ipc.js.map +1 -0
  422. package/dist/humain/remote/protocol.d.ts +43 -0
  423. package/dist/humain/remote/protocol.d.ts.map +1 -0
  424. package/dist/humain/remote/protocol.js +76 -0
  425. package/dist/humain/remote/protocol.js.map +1 -0
  426. package/dist/humain/remote/relay-socket.d.ts +30 -0
  427. package/dist/humain/remote/relay-socket.d.ts.map +1 -0
  428. package/dist/humain/remote/relay-socket.js +137 -0
  429. package/dist/humain/remote/relay-socket.js.map +1 -0
  430. package/dist/humain/remote/secure-channel.d.ts +10 -0
  431. package/dist/humain/remote/secure-channel.d.ts.map +1 -0
  432. package/dist/humain/remote/secure-channel.js +5 -0
  433. package/dist/humain/remote/secure-channel.js.map +1 -0
  434. package/dist/humain/remote/terminal.d.ts +48 -0
  435. package/dist/humain/remote/terminal.d.ts.map +1 -0
  436. package/dist/humain/remote/terminal.js +119 -0
  437. package/dist/humain/remote/terminal.js.map +1 -0
  438. package/dist/humain/remote/tickets.d.ts +35 -0
  439. package/dist/humain/remote/tickets.d.ts.map +1 -0
  440. package/dist/humain/remote/tickets.js +132 -0
  441. package/dist/humain/remote/tickets.js.map +1 -0
  442. package/dist/humain/web-access/vendor/anysearch.d.ts.map +1 -1
  443. package/dist/humain/web-access/vendor/anysearch.js +7 -3
  444. package/dist/humain/web-access/vendor/anysearch.js.map +1 -1
  445. package/dist/humain/web-access/vendor/autom.d.ts +4 -0
  446. package/dist/humain/web-access/vendor/autom.d.ts.map +1 -0
  447. package/dist/humain/web-access/vendor/autom.js +191 -0
  448. package/dist/humain/web-access/vendor/autom.js.map +1 -0
  449. package/dist/humain/web-access/vendor/cloro.d.ts +4 -0
  450. package/dist/humain/web-access/vendor/cloro.d.ts.map +1 -0
  451. package/dist/humain/web-access/vendor/cloro.js +236 -0
  452. package/dist/humain/web-access/vendor/cloro.js.map +1 -0
  453. package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
  454. package/dist/humain/web-access/vendor/curator-page.js +7 -1
  455. package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
  456. package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
  457. package/dist/humain/web-access/vendor/curator-server.js +6 -0
  458. package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
  459. package/dist/humain/web-access/vendor/domain-filter-normalization.d.ts +8 -0
  460. package/dist/humain/web-access/vendor/domain-filter-normalization.d.ts.map +1 -1
  461. package/dist/humain/web-access/vendor/domain-filter-normalization.js +37 -0
  462. package/dist/humain/web-access/vendor/domain-filter-normalization.js.map +1 -1
  463. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts +28 -8
  464. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts.map +1 -1
  465. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js +135 -34
  466. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js.map +1 -1
  467. package/dist/humain/web-access/vendor/duckduckgo.d.ts +1 -1
  468. package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
  469. package/dist/humain/web-access/vendor/duckduckgo.js +10 -3
  470. package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
  471. package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
  472. package/dist/humain/web-access/vendor/extract.js +61 -5
  473. package/dist/humain/web-access/vendor/extract.js.map +1 -1
  474. package/dist/humain/web-access/vendor/gemini-search.d.ts +3 -3
  475. package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
  476. package/dist/humain/web-access/vendor/gemini-search.js +35 -5
  477. package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
  478. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  479. package/dist/humain/web-access/vendor/index.js +8 -1
  480. package/dist/humain/web-access/vendor/index.js.map +1 -1
  481. package/dist/humain/web-access/vendor/page-query.d.ts +5 -0
  482. package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
  483. package/dist/humain/web-access/vendor/page-query.js +12 -2
  484. package/dist/humain/web-access/vendor/page-query.js.map +1 -1
  485. package/dist/humain/web-access/vendor/specstream.d.ts +6 -0
  486. package/dist/humain/web-access/vendor/specstream.d.ts.map +1 -0
  487. package/dist/humain/web-access/vendor/specstream.js +253 -0
  488. package/dist/humain/web-access/vendor/specstream.js.map +1 -0
  489. package/dist/humain/web-access/vendor/tool-activation.d.ts.map +1 -1
  490. package/dist/humain/web-access/vendor/tool-activation.js +21 -5
  491. package/dist/humain/web-access/vendor/tool-activation.js.map +1 -1
  492. package/dist/humain/web-access/vendor/upgrade-notice.d.ts +1 -1
  493. package/dist/humain/web-access/vendor/upgrade-notice.js +1 -1
  494. package/dist/humain/web-access/vendor/upgrade-notice.js.map +1 -1
  495. package/dist/humain/web-access/vendor/utils.d.ts +1 -0
  496. package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
  497. package/dist/humain/web-access/vendor/utils.js +3 -0
  498. package/dist/humain/web-access/vendor/utils.js.map +1 -1
  499. package/dist/humain/web-access/vendor/video-extract.js +2 -2
  500. package/dist/humain/web-access/vendor/video-extract.js.map +1 -1
  501. package/dist/humain/web-access/vendor/web-tool-core.d.ts +13 -0
  502. package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
  503. package/dist/humain/web-access/vendor/web-tool-core.js +16 -5
  504. package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
  505. package/dist/humain/web-access/vendor/youtube-extract.js +2 -2
  506. package/dist/humain/web-access/vendor/youtube-extract.js.map +1 -1
  507. package/dist/index.d.ts +0 -2
  508. package/dist/index.d.ts.map +1 -1
  509. package/dist/index.js.map +1 -1
  510. package/dist/main.d.ts +1 -1
  511. package/dist/main.d.ts.map +1 -1
  512. package/dist/main.js +109 -29
  513. package/dist/main.js.map +1 -1
  514. package/dist/modes/diagnostics-stderr.d.ts +4 -0
  515. package/dist/modes/diagnostics-stderr.d.ts.map +1 -0
  516. package/dist/modes/diagnostics-stderr.js +11 -0
  517. package/dist/modes/diagnostics-stderr.js.map +1 -0
  518. package/dist/modes/interactive/components/account-picker.d.ts +31 -0
  519. package/dist/modes/interactive/components/account-picker.d.ts.map +1 -0
  520. package/dist/modes/interactive/components/account-picker.js +150 -0
  521. package/dist/modes/interactive/components/account-picker.js.map +1 -0
  522. package/dist/modes/interactive/components/assistant-message.d.ts +1 -1
  523. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  524. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  525. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  526. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  527. package/dist/modes/interactive/components/config-selector.js +5 -2
  528. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  529. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  530. package/dist/modes/interactive/components/extension-selector.js +14 -5
  531. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  532. package/dist/modes/interactive/components/first-time-setup.d.ts +1 -1
  533. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  535. package/dist/modes/interactive/components/keybinding-hints.d.ts +2 -0
  536. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  537. package/dist/modes/interactive/components/keybinding-hints.js +6 -0
  538. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  539. package/dist/modes/interactive/components/model-selector.d.ts +10 -0
  540. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  541. package/dist/modes/interactive/components/model-selector.js +101 -23
  542. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  543. package/dist/modes/interactive/components/oauth-selector.d.ts +5 -0
  544. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  545. package/dist/modes/interactive/components/oauth-selector.js +17 -6
  546. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  547. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
  548. package/dist/modes/interactive/components/radius-login-selector.js +2 -1
  549. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
  550. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  551. package/dist/modes/interactive/components/scoped-models-selector.js +13 -6
  552. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  553. package/dist/modes/interactive/components/session-selector.d.ts +8 -1
  554. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  555. package/dist/modes/interactive/components/session-selector.js +41 -9
  556. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  557. package/dist/modes/interactive/components/settings-submenu.d.ts +1 -1
  558. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  559. package/dist/modes/interactive/components/settings-submenu.js +5 -1
  560. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  561. package/dist/modes/interactive/components/status-indicator.d.ts +0 -17
  562. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  563. package/dist/modes/interactive/components/status-indicator.js +1 -78
  564. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  565. package/dist/modes/interactive/components/themed-text.d.ts +1 -1
  566. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -1
  567. package/dist/modes/interactive/components/themed-text.js.map +1 -1
  568. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  569. package/dist/modes/interactive/components/thinking-selector.js +5 -1
  570. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  571. package/dist/modes/interactive/components/tool-execution.d.ts +1 -1
  572. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  573. package/dist/modes/interactive/components/tool-execution.js +3 -1
  574. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  575. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  576. package/dist/modes/interactive/components/trust-selector.js +14 -5
  577. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  578. package/dist/modes/interactive/components/user-message.d.ts +1 -1
  579. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  580. package/dist/modes/interactive/components/user-message.js.map +1 -1
  581. package/dist/modes/interactive/components/visual-truncate.d.ts +2 -2
  582. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  583. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  584. package/dist/modes/interactive/interactive-mode.d.ts +35 -4
  585. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  586. package/dist/modes/interactive/interactive-mode.js +821 -250
  587. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  588. package/dist/modes/interactive/model-catalog-refresh.d.ts +4 -0
  589. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  590. package/dist/modes/interactive/model-catalog-refresh.js +40 -1
  591. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  592. package/dist/modes/interactive/oauth-account-format.d.ts +15 -2
  593. package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
  594. package/dist/modes/interactive/oauth-account-format.js +39 -21
  595. package/dist/modes/interactive/oauth-account-format.js.map +1 -1
  596. package/dist/modes/interactive/session-share.js +2 -0
  597. package/dist/modes/interactive/session-share.js.map +1 -1
  598. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  599. package/dist/modes/interactive/theme/theme.js +1 -0
  600. package/dist/modes/interactive/theme/theme.js.map +1 -1
  601. package/dist/modes/print-mode.d.ts.map +1 -1
  602. package/dist/modes/print-mode.js +30 -32
  603. package/dist/modes/print-mode.js.map +1 -1
  604. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  605. package/dist/modes/rpc/rpc-mode.js +26 -39
  606. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  607. package/dist/modes/rpc/rpc-types.d.ts +1 -0
  608. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  609. package/dist/modes/rpc/rpc-types.js.map +1 -1
  610. package/dist/package-manager-cli.d.ts.map +1 -1
  611. package/dist/package-manager-cli.js +14 -1
  612. package/dist/package-manager-cli.js.map +1 -1
  613. package/dist/utils/abort.d.ts +5 -0
  614. package/dist/utils/abort.d.ts.map +1 -1
  615. package/dist/utils/abort.js +9 -0
  616. package/dist/utils/abort.js.map +1 -1
  617. package/dist/utils/changelog.d.ts.map +1 -1
  618. package/dist/utils/changelog.js +3 -2
  619. package/dist/utils/changelog.js.map +1 -1
  620. package/dist/utils/flush-stdout.d.ts +8 -0
  621. package/dist/utils/flush-stdout.d.ts.map +1 -0
  622. package/dist/utils/flush-stdout.js +23 -0
  623. package/dist/utils/flush-stdout.js.map +1 -0
  624. package/dist/utils/image-process.d.ts +2 -0
  625. package/dist/utils/image-process.d.ts.map +1 -1
  626. package/dist/utils/image-process.js +3 -3
  627. package/dist/utils/image-process.js.map +1 -1
  628. package/dist/utils/image-resize-core.js +2 -2
  629. package/dist/utils/image-resize-core.js.map +1 -1
  630. package/dist/utils/shell.d.ts +2 -0
  631. package/dist/utils/shell.d.ts.map +1 -1
  632. package/dist/utils/shell.js +19 -0
  633. package/dist/utils/shell.js.map +1 -1
  634. package/docs/cli.md +1 -1
  635. package/docs/development.md +0 -13
  636. package/docs/extensions.md +6 -4
  637. package/docs/flow.md +4 -62
  638. package/docs/forge-run-bootstrap.md +46 -0
  639. package/docs/humain-code-forge-architecture.md +1 -47
  640. package/docs/humain-code-forge-flow-walkthrough.md +1 -1
  641. package/docs/humain-code.md +2 -2
  642. package/docs/index.md +2 -1
  643. package/docs/keybindings.md +12 -0
  644. package/docs/llama-cpp.md +5 -5
  645. package/docs/models-configuration.md +4 -2
  646. package/docs/nvidia-rtx-llama-cpp.md +5 -5
  647. package/docs/providers.md +14 -9
  648. package/docs/quickstart.md +16 -2
  649. package/docs/rpc-commands.md +1 -1
  650. package/docs/run-preflight.md +1 -1
  651. package/docs/slash-commands.md +5 -3
  652. package/docs/tui.md +2 -0
  653. package/examples/README.md +0 -3
  654. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  655. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  656. package/examples/extensions/gondolin/index.ts +4 -7
  657. package/examples/tsconfig.json +96 -76
  658. package/npm-shrinkwrap.json +285 -764
  659. package/package.json +24 -37
  660. package/schemas/keybindings.schema.json +32 -0
  661. package/schemas/models.schema.json +5 -1
  662. package/schemas/settings.schema.json +0 -13
  663. package/src/humain/web-access/UPSTREAM.md +52 -1
  664. package/src/humain/web-access/upstream.json +5 -5
  665. package/src/humain/web-access/vendor/CHANGELOG.md +29 -0
  666. package/dist/bundle/chunks/adaptive-peer-worker-X2ZNZE3S.js +0 -8
  667. package/dist/bundle/chunks/adaptive-session-host-7KDSQV5I.js +0 -162
  668. package/dist/bundle/chunks/anthropic-messages-TQK3FUV3.js +0 -68
  669. package/dist/bundle/chunks/azure-openai-responses-JY7OSLH2.js +0 -15
  670. package/dist/bundle/chunks/chunk-5L4PBYC7.js +0 -11
  671. package/dist/bundle/chunks/chunk-6PNQYO6A.js +0 -10
  672. package/dist/bundle/chunks/chunk-CRN54O4D.js +0 -24
  673. package/dist/bundle/chunks/chunk-CTU2ECLD.js +0 -7
  674. package/dist/bundle/chunks/chunk-DBL35X7L.js +0 -3
  675. package/dist/bundle/chunks/chunk-GME4AWDG.js +0 -23
  676. package/dist/bundle/chunks/chunk-GTILMMUF.js +0 -12
  677. package/dist/bundle/chunks/chunk-J57HOSWD.js +0 -21
  678. package/dist/bundle/chunks/chunk-KQM7ZGL6.js +0 -11
  679. package/dist/bundle/chunks/chunk-MX4Q4W6H.js +0 -214
  680. package/dist/bundle/chunks/chunk-NXA6NEHE.js +0 -54
  681. package/dist/bundle/chunks/chunk-PJACZCIR.js +0 -2
  682. package/dist/bundle/chunks/chunk-T5A6T24H.js +0 -93
  683. package/dist/bundle/chunks/chunk-WCFHG6NO.js +0 -16
  684. package/dist/bundle/chunks/chunk-ZJUU6WOV.js +0 -2052
  685. package/dist/bundle/chunks/compat-ZK2DIW3P.js +0 -15
  686. package/dist/bundle/chunks/dist-EY7YKQHB.js +0 -11
  687. package/dist/bundle/chunks/dist-J5IUPLMH.js +0 -37
  688. package/dist/bundle/chunks/dist-cjs-2SKN226B.js +0 -184
  689. package/dist/bundle/chunks/entry-AL54ZGYO.js +0 -2
  690. package/dist/bundle/chunks/es5-GYTRHFKS.js +0 -77
  691. package/dist/bundle/chunks/google-generative-ai-UL7YEQ6J.js +0 -21
  692. package/dist/bundle/chunks/google-vertex-OTMSPUYH.js +0 -26
  693. package/dist/bundle/chunks/host-75YAHLDR.js +0 -3
  694. package/dist/bundle/chunks/interactive-mode-IW4PIVAQ.js +0 -5
  695. package/dist/bundle/chunks/mistral-conversations-E72Y6OC3.js +0 -43
  696. package/dist/bundle/chunks/pdfjs-AKD6EBKN.js +0 -3614
  697. package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-FH3KJM4H.js +0 -326
  698. package/dist/bundle/chunks/pdfjs-openjpeg-SKR7C34X.js +0 -671
  699. package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-VUBL7UEE.js +0 -974
  700. package/dist/bundle/chunks/session-picker-DM6S37IF.js +0 -4
  701. package/dist/bundle/chunks/startup-ui-4GGLWNSU.js +0 -3
  702. package/dist/bundle/chunks/virtual-modules-TI3W24YL.js +0 -28
  703. package/dist/core/internal-process.d.ts +0 -23
  704. package/dist/core/internal-process.d.ts.map +0 -1
  705. package/dist/core/internal-process.js +0 -88
  706. package/dist/core/internal-process.js.map +0 -1
  707. package/dist/humain/adaptive-execution.d.ts +0 -51
  708. package/dist/humain/adaptive-execution.d.ts.map +0 -1
  709. package/dist/humain/adaptive-execution.js +0 -100
  710. package/dist/humain/adaptive-execution.js.map +0 -1
  711. package/dist/humain/adaptive-peer-process.d.ts +0 -44
  712. package/dist/humain/adaptive-peer-process.d.ts.map +0 -1
  713. package/dist/humain/adaptive-peer-process.js +0 -159
  714. package/dist/humain/adaptive-peer-process.js.map +0 -1
  715. package/dist/humain/adaptive-peer-worker.d.ts +0 -3
  716. package/dist/humain/adaptive-peer-worker.d.ts.map +0 -1
  717. package/dist/humain/adaptive-peer-worker.js +0 -122
  718. package/dist/humain/adaptive-peer-worker.js.map +0 -1
  719. package/dist/humain/adaptive-runtime-types.d.ts +0 -621
  720. package/dist/humain/adaptive-runtime-types.d.ts.map +0 -1
  721. package/dist/humain/adaptive-runtime-types.js +0 -3
  722. package/dist/humain/adaptive-runtime-types.js.map +0 -1
  723. package/dist/humain/adaptive-session-host.d.ts +0 -113
  724. package/dist/humain/adaptive-session-host.d.ts.map +0 -1
  725. package/dist/humain/adaptive-session-host.js +0 -1838
  726. package/dist/humain/adaptive-session-host.js.map +0 -1
  727. package/dist/utils/deprecation.d.ts +0 -4
  728. package/dist/utils/deprecation.d.ts.map +0 -1
  729. package/dist/utils/deprecation.js +0 -13
  730. package/dist/utils/deprecation.js.map +0 -1
  731. package/examples/plugins/pi-example-plugin/README.md +0 -38
  732. package/examples/plugins/pi-example-plugin/package.json +0 -10
  733. package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  734. package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
  735. package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
@@ -24,8 +24,8 @@ function source(value) {
24
24
  }
25
25
  /** Parse trusted-origin discovery data before the account owner qualifies the issuer. */
26
26
  export function parseHcodeCliConfig(value) {
27
- const v = wire.object(value, ["schemaVersion", "environmentId", "origin", "inferenceBaseUrl", "auth"]);
28
- const auth = wire.object(v.auth, [
27
+ const v = wire.fields(value, ["schemaVersion", "environmentId", "origin", "inferenceBaseUrl", "auth"]);
28
+ const auth = wire.fields(v.auth, [
29
29
  "kind",
30
30
  "issuer",
31
31
  "clientId",
@@ -79,7 +79,7 @@ export function parseHcodeCliConfig(value) {
79
79
  };
80
80
  }
81
81
  export function parseHcodeAccount(value) {
82
- const v = wire.object(value, [
82
+ const v = wire.fields(value, [
83
83
  "schemaVersion",
84
84
  "accountId",
85
85
  "environmentId",
@@ -88,7 +88,7 @@ export function parseHcodeAccount(value) {
88
88
  "role",
89
89
  "eligibility",
90
90
  ]);
91
- const eligibility = wire.object(v.eligibility, ["kind"]);
91
+ const eligibility = wire.fields(v.eligibility, ["kind"]);
92
92
  const email = wire.nullable(v.email, (entry) => wire.string(entry, 320));
93
93
  if (email !== null &&
94
94
  !/^(?:[A-Za-z0-9_'+-]+\.)*[A-Za-z0-9_'+-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9-]*\.)+[A-Za-z]{2,}$/.test(email))
@@ -104,46 +104,37 @@ export function parseHcodeAccount(value) {
104
104
  };
105
105
  }
106
106
  function parseValue(value) {
107
- const v = wire.object(value, ["kind", "value"]);
107
+ const v = wire.fields(value, ["kind", "value"]);
108
108
  if (v.kind === "known")
109
109
  return { kind: "known", value: wire.integer(v.value) };
110
- wire.object(value, ["kind"]);
111
110
  return { kind: wire.member(v.kind, ["unknown", "redacted", "unavailable"]) };
112
111
  }
112
+ const tokenKeys = ["input", "output", "cacheRead", "cacheWrite", "total"];
113
113
  function parseTokens(value, max = 2147483647) {
114
- const v = wire.object(value, ["input", "output", "cacheRead", "cacheWrite", "total"]);
114
+ // Statement and allowance totals are shown as sent.
115
+ return readTokenCounts(wire.fields(value, tokenKeys), max, parseValue);
116
+ }
117
+ function readTokenCounts(v, max, parse) {
115
118
  const result = {
116
- input: parseValue(v.input),
117
- output: parseValue(v.output),
118
- cacheRead: parseValue(v.cacheRead),
119
- cacheWrite: parseValue(v.cacheWrite),
120
- total: parseValue(v.total),
119
+ input: parse(v.input),
120
+ output: parse(v.output),
121
+ cacheRead: parse(v.cacheRead),
122
+ cacheWrite: parse(v.cacheWrite),
123
+ total: parse(v.total),
121
124
  };
122
125
  for (const token of Object.values(result))
123
126
  if (token.kind === "known")
124
127
  wire.integer(token.value, max);
125
- if (result.input.kind === "known") {
126
- if (result.output.kind === "known" &&
127
- result.total.kind === "known" &&
128
- (!Number.isSafeInteger(result.input.value + result.output.value) ||
129
- result.total.value !== result.input.value + result.output.value))
130
- return wire.invalid();
131
- if ((result.cacheRead.kind === "known" ? result.cacheRead.value : 0) +
132
- (result.cacheWrite.kind === "known" ? result.cacheWrite.value : 0) >
133
- result.input.value)
134
- return wire.invalid();
135
- }
136
128
  return result;
137
129
  }
138
130
  function parseAllowance(value) {
139
- const v = wire.object(value, ["kind", "limitMicrocents"]);
131
+ const v = wire.fields(value, ["kind", "limitMicrocents"]);
140
132
  if (v.kind === "limited")
141
133
  return { kind: "limited", limitMicrocents: wire.integer(v.limitMicrocents) };
142
- wire.object(value, ["kind"]);
143
134
  return { kind: wire.literal(v.kind, "unlimited") };
144
135
  }
145
136
  function parseUsageSource(value) {
146
- const v = wire.object(value, ["surface", "actual", "reserved", "tokens"]);
137
+ const v = wire.fields(value, ["surface", "actual", "reserved", "tokens"]);
147
138
  return {
148
139
  surface: source(v.surface),
149
140
  actual: parseValue(v.actual),
@@ -152,7 +143,7 @@ function parseUsageSource(value) {
152
143
  };
153
144
  }
154
145
  function parseUsageItem(value) {
155
- const v = wire.object(value, [
146
+ const v = wire.fields(value, [
156
147
  "id",
157
148
  "at",
158
149
  "surface",
@@ -186,7 +177,7 @@ function parseUsageItem(value) {
186
177
  };
187
178
  }
188
179
  export function parseHcodeUsage(value) {
189
- const v = wire.object(value, [
180
+ const v = wire.fields(value, [
190
181
  "schemaVersion",
191
182
  "accountId",
192
183
  "environmentId",
@@ -240,6 +231,56 @@ export function parseHcodeUsageQuery(value) {
240
231
  };
241
232
  }
242
233
  const efforts = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
234
+ /** Header naming why a successful catalog is empty; Forge keeps the body closed for released clients. */
235
+ export const HCODE_CATALOG_EMPTY_REASON_HEADER = "x-hcode-catalog-empty-reason";
236
+ const HCODE_CATALOG_EMPTY_REASONS = [
237
+ "no_cli_models_approved",
238
+ "provider_key_not_cli_enabled",
239
+ "cli_capacity_unconfigured",
240
+ "provider_key_not_dedicated",
241
+ "models_not_qualified",
242
+ ];
243
+ /** Accepts only a known reason code; unknown or missing values are dropped, never displayed. */
244
+ export function parseHcodeCatalogEmptyReason(value) {
245
+ return HCODE_CATALOG_EMPTY_REASONS.find((reason) => reason === value);
246
+ }
247
+ /** Header naming approved models Forge left out of this account's catalog and why (URL-encoded JSON array). */
248
+ export const HCODE_CATALOG_EXCLUSIONS_HEADER = "x-hcode-catalog-exclusions";
249
+ const HCODE_CATALOG_EXCLUSION_REASONS = [
250
+ "missing_trusted_metadata",
251
+ "credential_unavailable",
252
+ "provider_quota_isolation_unverified",
253
+ "quota_mapping_unavailable",
254
+ ];
255
+ // Forge caps the encoded header at 3072 characters; anything larger is not Forge's diagnostic.
256
+ const HCODE_CATALOG_EXCLUSIONS_MAX_CHARS = 3072;
257
+ /**
258
+ * Maps catalog model IDs (`provider/model`) to Forge's known exclusion reason. Malformed, oversized or
259
+ * unknown data yields an empty map so the generic refusal is kept; reasons are codes, never server text.
260
+ */
261
+ export function parseHcodeCatalogExclusions(value) {
262
+ const exclusions = new Map();
263
+ if (!value || value.length > HCODE_CATALOG_EXCLUSIONS_MAX_CHARS)
264
+ return exclusions;
265
+ try {
266
+ const rows = JSON.parse(decodeURIComponent(value));
267
+ if (!Array.isArray(rows))
268
+ return exclusions;
269
+ for (const row of rows) {
270
+ if (!row || typeof row !== "object" || Array.isArray(row) || Object.keys(row).length !== 3)
271
+ return new Map();
272
+ const { provider, model, reason: code } = row;
273
+ const reason = HCODE_CATALOG_EXCLUSION_REASONS.find((known) => known === code);
274
+ if (typeof provider !== "string" || typeof model !== "string" || !reason || !provider || !model)
275
+ return new Map();
276
+ exclusions.set(`${provider}/${model}`, reason);
277
+ }
278
+ }
279
+ catch {
280
+ return new Map();
281
+ }
282
+ return exclusions;
283
+ }
243
284
  const bytes = (value) => new TextEncoder().encode(value).length;
244
285
  function scalar(value, max = 1048576, min = 0) {
245
286
  const text = wire.string(value, max, min);
@@ -358,18 +399,17 @@ function jsonSchema(value) {
358
399
  refs(parsed, "schema");
359
400
  return parsed;
360
401
  }
361
- function rates(value, tier = false) {
362
- const v = wire.object(value, ["input", "output", "cacheRead", "cacheWrite", ...(tier ? ["inputTokensAbove"] : [])]);
402
+ function rates(value) {
403
+ const v = wire.fields(value, ["input", "output", "cacheRead", "cacheWrite"]);
363
404
  return {
364
405
  input: wire.number(v.input),
365
406
  output: wire.number(v.output),
366
407
  cacheRead: wire.number(v.cacheRead),
367
408
  cacheWrite: wire.number(v.cacheWrite),
368
- ...(tier ? { inputTokensAbove: wire.integer(v.inputTokensAbove) } : {}),
369
409
  };
370
410
  }
371
411
  function parseModel(value) {
372
- const v = wire.object(value, [
412
+ const v = wire.fields(value, [
373
413
  "id",
374
414
  "name",
375
415
  "api",
@@ -389,7 +429,7 @@ function parseModel(value) {
389
429
  const input = wire.array(v.input, (entry) => wire.member(entry, ["text", "image"]), 2, 1);
390
430
  if (input[0] !== "text" || (input.length === 2 && input[1] !== "image"))
391
431
  return wire.invalid();
392
- const map = wire.object(v.thinkingLevelMap, efforts);
432
+ const map = wire.fields(v.thinkingLevelMap, efforts);
393
433
  const thinkingLevelMap = {};
394
434
  for (const effort of efforts)
395
435
  thinkingLevelMap[effort] = map[effort] === null ? null : wire.literal(map[effort], effort);
@@ -399,32 +439,25 @@ function parseModel(value) {
399
439
  if (!efforts.some((e) => thinkingLevelMap[e] !== null) ||
400
440
  (reasoning && !efforts.some((e) => e !== "off" && thinkingLevelMap[e] !== null)))
401
441
  return wire.invalid();
402
- const costRecord = wire.object(v.cost, ["input", "output", "cacheRead", "cacheWrite", "tiers"]);
403
- const cost = {
404
- ...rates({
405
- input: costRecord.input,
406
- output: costRecord.output,
407
- cacheRead: costRecord.cacheRead,
408
- cacheWrite: costRecord.cacheWrite,
409
- }),
410
- };
442
+ const costRecord = wire.fields(v.cost, ["input", "output", "cacheRead", "cacheWrite", "tiers"]);
443
+ const cost = { ...rates(costRecord) };
411
444
  if (costRecord.tiers !== undefined) {
412
- const tiers = wire.array(costRecord.tiers, (entry) => {
413
- const r = rates(entry, true);
414
- return { ...r, inputTokensAbove: wire.integer(r.inputTokensAbove) };
415
- }, 1024);
445
+ const tiers = wire.array(costRecord.tiers, (entry) => ({
446
+ ...rates(entry),
447
+ inputTokensAbove: wire.integer(wire.fields(entry, ["inputTokensAbove"]).inputTokensAbove),
448
+ }), 1024);
416
449
  if (tiers.some((entry, i) => entry.inputTokensAbove <= (tiers[i - 1]?.inputTokensAbove ?? -1)))
417
450
  return wire.invalid();
418
451
  cost.tiers = tiers;
419
452
  }
420
- const limits = wire.object(v.inputLimits, ["maxRequestBytes", "images"]);
453
+ const limits = wire.fields(v.inputLimits, ["maxRequestBytes", "images"]);
421
454
  const inputLimits = {};
422
455
  if (limits.maxRequestBytes !== undefined)
423
456
  inputLimits.maxRequestBytes = wire.integer(limits.maxRequestBytes, 12582912, 1);
424
457
  if (limits.images !== undefined) {
425
458
  if (input.length !== 2)
426
459
  return wire.invalid();
427
- const image = wire.object(limits.images, ["resize", "maxPerMessage", "maxPerRequest"]), resize = wire.object(image.resize, ["maxWidth", "maxHeight", "maxBytes", "jpegQuality"]);
460
+ const image = wire.fields(limits.images, ["resize", "maxPerMessage", "maxPerRequest"]), resize = wire.fields(image.resize, ["maxWidth", "maxHeight", "maxBytes", "jpegQuality"]);
428
461
  inputLimits.images = {
429
462
  maxPerMessage: wire.integer(image.maxPerMessage, 4, 1),
430
463
  maxPerRequest: wire.integer(image.maxPerRequest, 4, 1),
@@ -459,8 +492,7 @@ function parseModel(value) {
459
492
  };
460
493
  }
461
494
  export function parseHcodeModelList(value) {
462
- boundedJson(value, 32, 131072);
463
- const v = wire.object(value, ["object", "data"]);
495
+ const v = wire.fields(value, ["object", "data"]);
464
496
  const data = wire.array(v.data, parseModel, 1024);
465
497
  if (new Set(data.map((model) => model.id)).size !== data.length)
466
498
  return wire.invalid();
@@ -502,8 +534,8 @@ function thinkingBlock(value) {
502
534
  return wire.invalid();
503
535
  return result;
504
536
  }
505
- function toolCall(value) {
506
- const v = wire.object(value, ["type", "id", "name", "arguments", "thoughtSignature", "namespace", "argumentsError"]);
537
+ function toolCall(value, read) {
538
+ const v = read(value, ["type", "id", "name", "arguments", "thoughtSignature", "namespace", "argumentsError"]);
507
539
  const result = {
508
540
  type: wire.literal(v.type, "toolCall"),
509
541
  id: ascii(v.id),
@@ -606,6 +638,20 @@ function history(v) {
606
638
  }
607
639
  }
608
640
  function parseMessage(value) {
641
+ const entry = value && typeof value === "object" && "role" in value ? value : undefined;
642
+ const role = entry?.role;
643
+ const deferred = entry &&
644
+ (("deferred" in entry && entry.deferred !== undefined) ||
645
+ ("stopReason" in entry && entry.stopReason === "deferred"));
646
+ const detail = role === "assistant" && deferred
647
+ ? "assistant.deferred"
648
+ : role === "assistant" || role === "system" || role === "user" || role === "toolResult"
649
+ ? `${role}.schema`
650
+ : "message.schema";
651
+ // Run the same strict checks; only annotate their failures with a closed element code.
652
+ return requestElement(detail, () => parseMessageFields(value));
653
+ }
654
+ function parseMessageFields(value) {
609
655
  const base = wire.object(value, [
610
656
  "role",
611
657
  "content",
@@ -709,7 +755,7 @@ function parseMessage(value) {
709
755
  return record.type === "thinking"
710
756
  ? thinkingBlock(entry)
711
757
  : record.type === "toolCall"
712
- ? toolCall(entry)
758
+ ? requestElement(record.argumentsError === undefined ? "toolCall.schema" : "toolCall.argumentsError", () => toolCall(entry, wire.object))
713
759
  : textBlock(entry);
714
760
  }, 2048),
715
761
  api: scalar(v.api, 256, 1),
@@ -797,16 +843,53 @@ function parseOptions(value) {
797
843
  }
798
844
  return result;
799
845
  }
846
+ export const HCODE_REQUEST_MAX_IMAGE_BYTES = 8 * 1024 * 1024;
847
+ export const HCODE_REQUEST_MAX_NON_IMAGE_BYTES = 1024 * 1024;
848
+ /** Base64 payload bytes are the only bytes excluded from the non-image envelope budget. */
849
+ export function hcodeImagePayloadBytes(messages) {
850
+ let bytes = 0;
851
+ for (const message of messages) {
852
+ if (typeof message.content === "string")
853
+ continue;
854
+ for (const block of message.content)
855
+ if (block.type === "image")
856
+ bytes += block.data.length;
857
+ }
858
+ return bytes;
859
+ }
860
+ /** Decoded size of an image payload already validated as canonical base64. */
861
+ export function hcodeDecodedImageBytes(data) {
862
+ const padding = data.endsWith("==") ? 2 : data.endsWith("=") ? 1 : 0;
863
+ return (data.length / 4) * 3 - padding;
864
+ }
865
+ /** A strict request failure tagged with a fixed element code, never rejected input. */
866
+ export class HcodeRequestSchemaError extends Error {
867
+ detail;
868
+ constructor(detail) {
869
+ super("Invalid HUMAIN Code wire value.");
870
+ this.detail = detail;
871
+ }
872
+ }
873
+ function requestElement(detail, parse) {
874
+ try {
875
+ return parse();
876
+ }
877
+ catch (error) {
878
+ if (error instanceof HcodeRequestSchemaError)
879
+ throw error;
880
+ throw new HcodeRequestSchemaError(detail);
881
+ }
882
+ }
800
883
  export function parseHcodeMessagesRequest(value) {
801
884
  const raw = boundedJson(value, 48, 1048576);
802
885
  if (wire.jsonBytes(raw) > 12582912)
803
886
  return wire.invalid();
804
887
  const v = wire.object(raw, ["model", "context", "options"]), context = wire.object(v.context, ["messages"]);
805
- const messages = wire.array(context.messages, parseMessage, 512, 1);
888
+ const messages = requestElement("message.schema", () => wire.array(context.messages, parseMessage, 512, 1));
806
889
  const result = {
807
890
  model: scalar(v.model, 256, 1),
808
891
  context: { messages },
809
- ...(v.options === undefined ? {} : { options: parseOptions(v.options) }),
892
+ ...(v.options === undefined ? {} : { options: requestElement("options.schema", () => parseOptions(v.options)) }),
810
893
  };
811
894
  let blocks = 0, images = 0, imageBytes = 0, schemaBytes = 0;
812
895
  const active = new Map(), seen = new Set(), pending = new Map();
@@ -829,19 +912,23 @@ export function parseHcodeMessagesRequest(value) {
829
912
  }
830
913
  else if (message.role === "toolResult") {
831
914
  if (pending.get(message.toolCallId) !== message.toolName)
832
- return wire.invalid();
915
+ throw new HcodeRequestSchemaError("toolResult.orphan");
833
916
  pending.delete(message.toolCallId);
834
917
  }
835
918
  else {
836
919
  if (pending.size)
837
- return wire.invalid();
920
+ throw new HcodeRequestSchemaError("toolCall.orphan");
838
921
  if (message.role === "assistant") {
839
922
  const calls = message.content.filter((block) => block.type === "toolCall");
840
923
  if (calls.length > 64)
841
924
  return wire.invalid();
842
925
  for (const call of calls) {
843
- if (seen.has(call.id) || !active.has(call.name) || call.argumentsError)
844
- return wire.invalid();
926
+ if (seen.has(call.id))
927
+ throw new HcodeRequestSchemaError("toolCall.duplicate");
928
+ if (!active.has(call.name))
929
+ throw new HcodeRequestSchemaError("toolCall.unknownTool");
930
+ if (call.argumentsError)
931
+ throw new HcodeRequestSchemaError("toolCall.argumentsError");
845
932
  seen.add(call.id);
846
933
  pending.set(call.id, call.name);
847
934
  }
@@ -856,8 +943,7 @@ export function parseHcodeMessagesRequest(value) {
856
943
  if (block.type === "image") {
857
944
  images++;
858
945
  perMessage++;
859
- const padding = block.data.endsWith("==") ? 2 : block.data.endsWith("=") ? 1 : 0;
860
- const decoded = (block.data.length / 4) * 3 - padding;
946
+ const decoded = hcodeDecodedImageBytes(block.data);
861
947
  if (decoded > 3145728)
862
948
  return wire.invalid();
863
949
  imageBytes += decoded;
@@ -866,23 +952,21 @@ export function parseHcodeMessagesRequest(value) {
866
952
  return wire.invalid();
867
953
  }
868
954
  }
869
- if (pending.size || blocks > 2048 || images > 4 || imageBytes > 8388608)
870
- return wire.invalid();
955
+ if (pending.size)
956
+ throw new HcodeRequestSchemaError("toolCall.orphan");
957
+ if (blocks > 2048 || images > 4 || imageBytes > HCODE_REQUEST_MAX_IMAGE_BYTES)
958
+ throw new HcodeRequestSchemaError("message.schema");
871
959
  const choice = result.options?.toolChoice;
872
960
  if (choice !== undefined && (!active.size || (typeof choice === "object" && !active.has(choice.function.name))))
873
- return wire.invalid();
961
+ throw new HcodeRequestSchemaError("toolChoice.unknownTool");
874
962
  // Count the raw envelope, including ignored bookkeeping, with only actual image payloads emptied.
875
- const nonImage = wire.jsonBytes(raw) -
876
- messages.reduce((sum, message) => sum +
877
- (typeof message.content === "string"
878
- ? 0
879
- : message.content.reduce((n, block) => n + (block.type === "image" ? block.data.length : 0), 0)), 0);
880
- if (nonImage > 1048576)
963
+ if (wire.jsonBytes(raw) - hcodeImagePayloadBytes(messages) > HCODE_REQUEST_MAX_NON_IMAGE_BYTES)
881
964
  return wire.invalid();
882
965
  return result;
883
966
  }
967
+ /** Open reader for streamed usage; request history closes its keys before calling this. */
884
968
  export function parseHcodePiUsage(value) {
885
- const v = wire.object(value, [
969
+ const v = wire.fields(value, [
886
970
  "input",
887
971
  "output",
888
972
  "cacheRead",
@@ -896,7 +980,7 @@ export function parseHcodePiUsage(value) {
896
980
  const input = wire.integer(v.input, 2147483647), output = wire.integer(v.output, 2147483647), cacheRead = wire.integer(v.cacheRead, 2147483647), cacheWrite = wire.integer(v.cacheWrite, 2147483647), totalTokens = wire.integer(v.totalTokens, 2147483647);
897
981
  if (totalTokens !== input + output + cacheRead + cacheWrite)
898
982
  return wire.invalid();
899
- const cost = wire.object(v.cost, ["input", "output", "cacheRead", "cacheWrite", "total", "totalFromProvider"]);
983
+ const cost = wire.fields(v.cost, ["input", "output", "cacheRead", "cacheWrite", "total", "totalFromProvider"]);
900
984
  const costResult = {
901
985
  input: wire.number(cost.input, 0, Number.MAX_SAFE_INTEGER),
902
986
  output: wire.number(cost.output, 0, Number.MAX_SAFE_INTEGER),
@@ -926,9 +1010,9 @@ const safeStreamErrors = [
926
1010
  "HUMAIN Code account unavailable.",
927
1011
  "Request aborted.",
928
1012
  ];
1013
+ /** Parse one streamed event; unknown keys are ignored, unknown event types are invalid. */
929
1014
  export function parseHcodePiEvent(value) {
930
- boundedJson(value, 40, 32768);
931
- const v = wire.object(value, [
1015
+ const v = wire.fields(value, [
932
1016
  "type",
933
1017
  "contentIndex",
934
1018
  "delta",
@@ -945,20 +1029,9 @@ export function parseHcodePiEvent(value) {
945
1029
  "responseModel",
946
1030
  "providerThinkingLevel",
947
1031
  ]);
948
- if (v.type === "start") {
949
- wire.object(value, ["type"]);
1032
+ if (v.type === "start")
950
1033
  return { type: "start" };
951
- }
952
1034
  if (v.type === "done" || v.type === "error") {
953
- wire.object(value, [
954
- "type",
955
- "reason",
956
- "usage",
957
- "responseId",
958
- "responseModel",
959
- "providerThinkingLevel",
960
- ...(v.type === "error" ? ["errorMessage"] : []),
961
- ]);
962
1035
  const terminal = {
963
1036
  usage: parseHcodePiUsage(v.usage),
964
1037
  ...(v.responseId === undefined ? {} : { responseId: ascii(v.responseId) }),
@@ -972,30 +1045,23 @@ export function parseHcodePiEvent(value) {
972
1045
  return wire.invalid();
973
1046
  return { type: "done", reason: wire.member(v.reason, ["stop", "length", "toolUse"]), ...terminal };
974
1047
  }
1048
+ if (Object.hasOwn(v, "errorMessage") && typeof v.errorMessage !== "string")
1049
+ return wire.invalid();
1050
+ // Unknown or reworded text is dropped, never reflected; the CLI then shows its own generic failure.
1051
+ const errorMessage = safeStreamErrors.find((entry) => entry === v.errorMessage);
975
1052
  return {
976
1053
  type: "error",
977
1054
  reason: wire.member(v.reason, ["aborted", "error"]),
978
1055
  ...terminal,
979
- ...(v.errorMessage === undefined ? {} : { errorMessage: wire.member(v.errorMessage, safeStreamErrors) }),
1056
+ ...(errorMessage === undefined ? {} : { errorMessage }),
980
1057
  };
981
1058
  }
982
1059
  const contentIndex = wire.integer(v.contentIndex, 2047);
983
- if (v.type === "text_start" || v.type === "thinking_start") {
984
- wire.object(value, ["type", "contentIndex"]);
1060
+ if (v.type === "text_start" || v.type === "thinking_start")
985
1061
  return { type: v.type, contentIndex };
986
- }
987
- if (v.type === "text_delta" || v.type === "thinking_delta" || v.type === "toolcall_delta") {
988
- wire.object(value, ["type", "contentIndex", "delta"]);
1062
+ if (v.type === "text_delta" || v.type === "thinking_delta" || v.type === "toolcall_delta")
989
1063
  return { type: v.type, contentIndex, delta: scalar(v.delta, v.type === "toolcall_delta" ? 65536 : 1048576) };
990
- }
991
1064
  if (v.type === "text_end" || v.type === "thinking_end") {
992
- wire.object(value, [
993
- "type",
994
- "contentIndex",
995
- "content",
996
- "contentSignature",
997
- ...(v.type === "thinking_end" ? ["redacted"] : []),
998
- ]);
999
1065
  const end = {
1000
1066
  contentIndex,
1001
1067
  content: scalar(v.content, 8388608),
@@ -1008,12 +1074,9 @@ export function parseHcodePiEvent(value) {
1008
1074
  return wire.invalid();
1009
1075
  return { type: "thinking_end", ...end, ...(redacted === undefined ? {} : { redacted }) };
1010
1076
  }
1011
- if (v.type === "toolcall_start") {
1012
- wire.object(value, ["type", "contentIndex", "id", "toolName"]);
1077
+ if (v.type === "toolcall_start")
1013
1078
  return { type: "toolcall_start", contentIndex, id: ascii(v.id), toolName: toolName(v.toolName) };
1014
- }
1015
- wire.object(value, ["type", "contentIndex", "toolCall"]);
1016
- return { type: wire.literal(v.type, "toolcall_end"), contentIndex, toolCall: toolCall(v.toolCall) };
1079
+ return { type: wire.literal(v.type, "toolcall_end"), contentIndex, toolCall: toolCall(v.toolCall, wire.fields) };
1017
1080
  }
1018
1081
  export function createHcodePiEventValidator() {
1019
1082
  let started = false, terminal = false, failed = false, retained = 0, malformed = false;
@@ -1106,29 +1169,13 @@ const snapshotFields = [
1106
1169
  "remaining",
1107
1170
  "costComplete",
1108
1171
  ];
1109
- function checkAllowanceConsistency(value) {
1110
- if ((value.allowance.kind === "unlimited") !== (value.remaining.kind === "unlimited"))
1111
- wire.invalid();
1112
- if (value.actual.kind === "known" &&
1113
- value.reserved.kind === "known" &&
1114
- value.committed.kind === "known" &&
1115
- (!Number.isSafeInteger(value.actual.value + value.reserved.value) ||
1116
- value.committed.value !== value.actual.value + value.reserved.value))
1117
- wire.invalid();
1118
- if (value.allowance.kind === "limited" &&
1119
- value.committed.kind === "known" &&
1120
- value.remaining.kind === "known" &&
1121
- value.remaining.value !== Math.max(0, value.allowance.limitMicrocents - value.committed.value))
1122
- wire.invalid();
1123
- }
1124
1172
  export function parseAllowanceSnapshot(value) {
1125
- const v = wire.object(value, snapshotFields), period = wire.object(v.period, ["start", "resetAt"]);
1173
+ const v = wire.fields(value, snapshotFields), period = wire.fields(v.period, ["start", "resetAt"]);
1126
1174
  const start = wire.time(period.start), resetAt = wire.time(period.resetAt);
1127
1175
  if (Date.parse(start) >= Date.parse(resetAt))
1128
1176
  return wire.invalid();
1129
- const r = wire.object(v.remaining, ["kind", "value"]);
1130
- const remaining = r.kind === "unlimited"
1131
- ? { kind: wire.literal(wire.object(v.remaining, ["kind"]).kind, "unlimited") }
1177
+ const remaining = wire.fields(v.remaining, ["kind"]).kind === "unlimited"
1178
+ ? { kind: "unlimited" }
1132
1179
  : parseValue(v.remaining);
1133
1180
  const result = {
1134
1181
  asOf: wire.time(v.asOf),
@@ -1142,7 +1189,9 @@ export function parseAllowanceSnapshot(value) {
1142
1189
  remaining,
1143
1190
  costComplete: wire.boolean(v.costComplete),
1144
1191
  };
1145
- checkAllowanceConsistency(result);
1192
+ // The server's arithmetic is shown as sent; only the allowance kind must agree with the remaining kind.
1193
+ if ((result.allowance.kind === "unlimited") !== (result.remaining.kind === "unlimited"))
1194
+ return wire.invalid();
1146
1195
  return result;
1147
1196
  }
1148
1197
  export function parseHcodeAdminResolutionEvidence(value) {
@@ -1168,6 +1217,20 @@ export function parseHcodeAdminResolutionEvidence(value) {
1168
1217
  const decision = wire.member(v.decision, ["charged", "not-charged"]), basis = wire.member(v.basis, ["provider-evidence", "no-charge-evidence", "administrative-waiver"]), costMicrocents = wire.integer(v.costMicrocents);
1169
1218
  if (decision === "charged" ? basis !== "provider-evidence" : costMicrocents !== 0 || basis === "provider-evidence")
1170
1219
  return wire.invalid();
1220
+ const tokens = readTokenCounts(wire.object(v.tokens, tokenKeys), 2147483647, (value) => {
1221
+ const count = wire.object(value, ["kind", "value"]);
1222
+ if (count.kind !== "known")
1223
+ wire.object(value, ["kind"]);
1224
+ return parseValue(count);
1225
+ });
1226
+ const { input, output, cacheRead, cacheWrite, total } = tokens;
1227
+ if (input.kind === "known") {
1228
+ if (output.kind === "known" && total.kind === "known" && total.value !== input.value + output.value)
1229
+ return wire.invalid();
1230
+ if ((cacheRead.kind === "known" ? cacheRead.value : 0) + (cacheWrite.kind === "known" ? cacheWrite.value : 0) >
1231
+ input.value)
1232
+ return wire.invalid();
1233
+ }
1171
1234
  return {
1172
1235
  kind: wire.literal(v.kind, "admin-resolution"),
1173
1236
  resolutionId: wire.string(v.resolutionId),
@@ -1182,7 +1245,7 @@ export function parseHcodeAdminResolutionEvidence(value) {
1182
1245
  basis,
1183
1246
  reason,
1184
1247
  evidenceReference,
1185
- tokens: parseTokens(v.tokens),
1248
+ tokens,
1186
1249
  };
1187
1250
  }
1188
1251
  const errorMessages = {
@@ -1203,41 +1266,47 @@ const errorMessages = {
1203
1266
  settlement_unavailable: "Settlement unavailable.",
1204
1267
  };
1205
1268
  export const HCODE_ALLOWANCE_ESTIMATE_MESSAGE = "Your remaining monthly allowance cannot cover this request.";
1269
+ /** Parse a refusal by its code; the server's wording and unknown keys are ignored, and the CLI shows its own text. */
1206
1270
  export function parseHcodeInferenceError(value) {
1207
- const outer = wire.object(value, ["error"]), v = wire.object(outer.error, ["code", "message", "details"]);
1271
+ const outer = wire.fields(value, ["error"]), v = wire.fields(outer.error, ["code", "message", "details"]);
1272
+ if (typeof v.message !== "string")
1273
+ return wire.invalid();
1274
+ // An unknown code stays invalid: the caller then shows the generic "do not resend" failure, never a refusal.
1208
1275
  const code = wire.member(v.code, Object.keys(errorMessages));
1209
1276
  if (code === "hcode_busy") {
1210
- const d = wire.object(v.details, ["dispatched", "automaticRetryAllowed", "retryAfterMs"]);
1277
+ const d = wire.fields(v.details, ["dispatched", "automaticRetryAllowed", "retryAfterMs"]);
1211
1278
  return {
1212
1279
  error: {
1213
1280
  code,
1214
- message: wire.literal(v.message, errorMessages[code]),
1281
+ message: errorMessages[code],
1215
1282
  details: {
1216
1283
  dispatched: wire.literal(d.dispatched, false),
1217
1284
  automaticRetryAllowed: wire.literal(d.automaticRetryAllowed, false),
1218
- retryAfterMs: wire.literal(d.retryAfterMs, 1000),
1285
+ retryAfterMs: wire.integer(d.retryAfterMs, Number.MAX_SAFE_INTEGER, 1),
1219
1286
  },
1220
1287
  },
1221
1288
  };
1222
1289
  }
1223
1290
  if (code === "quota_exceeded") {
1224
- const d = wire.object(v.details, ["dispatched", "automaticRetryAllowed", "usage"]);
1291
+ const d = wire.fields(v.details, ["dispatched", "automaticRetryAllowed", "usage"]);
1292
+ const usage = parseAllowanceSnapshot(d.usage);
1293
+ // Allowance left over means the request's estimate, not the allowance, was refused.
1294
+ const estimate = v.message === HCODE_ALLOWANCE_ESTIMATE_MESSAGE ||
1295
+ (usage.remaining.kind === "known" && usage.remaining.value > 0);
1225
1296
  return {
1226
1297
  error: {
1227
1298
  code,
1228
- message: wire.member(v.message, [errorMessages[code], HCODE_ALLOWANCE_ESTIMATE_MESSAGE]),
1299
+ message: estimate ? HCODE_ALLOWANCE_ESTIMATE_MESSAGE : errorMessages[code],
1229
1300
  details: {
1230
1301
  dispatched: wire.literal(d.dispatched, false),
1231
1302
  automaticRetryAllowed: wire.literal(d.automaticRetryAllowed, false),
1232
- usage: parseAllowanceSnapshot(d.usage),
1303
+ usage,
1233
1304
  },
1234
1305
  },
1235
1306
  };
1236
1307
  }
1237
1308
  if (v.details !== null)
1238
1309
  return wire.invalid();
1239
- return {
1240
- error: { code, message: wire.literal(v.message, errorMessages[code]), details: null },
1241
- };
1310
+ return { error: { code, message: errorMessages[code], details: null } };
1242
1311
  }
1243
1312
  //# sourceMappingURL=contracts.js.map