@humain/humain-code 0.7.0 → 0.8.0

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 (650) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/README.md +2 -2
  3. package/dist/bundle/agent-monitor.js +1 -1
  4. package/dist/bundle/chunks/anthropic-messages-UZB5HJE3.js +77 -0
  5. package/dist/bundle/chunks/anthropic.js +25 -24
  6. package/dist/bundle/chunks/azure-openai-responses-J3LCMWPQ.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-HTA325LJ.js → chunk-2NVGOSBN.js} +1 -1
  10. package/dist/bundle/chunks/{chunk-5B25YXF7.js → chunk-3CGMVKHA.js} +13 -3
  11. package/dist/bundle/chunks/{chunk-SCINMV4X.js → chunk-46C6D7UC.js} +22 -21
  12. package/dist/bundle/chunks/{chunk-RS6PZK35.js → chunk-4EV7CK26.js} +249 -216
  13. package/dist/bundle/chunks/{chunk-T7BXP46S.js → chunk-4SFWYKL5.js} +1848 -1662
  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-6HTHDVJC.js +4 -0
  17. package/dist/bundle/chunks/{chunk-2G7YVAVF.js → chunk-7EONJCBE.js} +1 -1
  18. package/dist/bundle/chunks/chunk-7H2WNBX7.js +11 -0
  19. package/dist/bundle/chunks/{chunk-2FYYW6FY.js → chunk-7OZNMWAJ.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-R6YQR7TZ.js → chunk-7WE77IE3.js} +1 -1
  21. package/dist/bundle/chunks/{chunk-Z5YLKK3S.js → chunk-7WETECIB.js} +1 -1
  22. package/dist/bundle/chunks/{chunk-EIC7CQX3.js → chunk-AI7EHDAX.js} +1 -1
  23. package/dist/bundle/chunks/{chunk-KRCX3ZBA.js → chunk-APNPBT7Y.js} +1 -1
  24. package/dist/bundle/chunks/{chunk-4HTVBBJD.js → chunk-ATFZAFMS.js} +2 -2
  25. package/dist/bundle/chunks/{chunk-R5OOX7RW.js → chunk-B47PNNLL.js} +9 -2
  26. package/dist/bundle/chunks/{chunk-AZXVJN6E.js → chunk-C4DHVDYT.js} +1 -1
  27. package/dist/bundle/chunks/{chunk-4PRNKB6V.js → chunk-CET2MXXN.js} +7 -7
  28. package/dist/bundle/chunks/{chunk-66FZJO75.js → chunk-CU6KU7JK.js} +472 -3924
  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-G4QPSFBF.js → chunk-EMBIUIQ2.js} +216 -223
  33. package/dist/bundle/chunks/{chunk-Q7VXYXY3.js → chunk-ENBDASDN.js} +2 -2
  34. package/dist/bundle/chunks/{chunk-2H3LUS62.js → chunk-FJIISX5W.js} +241 -229
  35. package/dist/bundle/chunks/{chunk-WQOOJP7U.js → chunk-GV5OVRKK.js} +1 -1
  36. package/dist/bundle/chunks/{chunk-KTSJYIYC.js → chunk-HHWVVNGG.js} +1 -1
  37. package/dist/bundle/chunks/{chunk-4JRER4XK.js → chunk-HQMUDHC3.js} +19 -19
  38. package/dist/bundle/chunks/{chunk-WQ7EJQIT.js → chunk-IOLLZXQN.js} +225 -239
  39. package/dist/bundle/chunks/chunk-IXQYPQRQ.js +2079 -0
  40. package/dist/bundle/chunks/{chunk-RU7ADKA7.js → chunk-J4GII2EE.js} +112 -96
  41. package/dist/bundle/chunks/chunk-J5TSAJGC.js +22 -0
  42. package/dist/bundle/chunks/{chunk-QT6ZHDMP.js → chunk-JBSWWCT5.js} +1 -1
  43. package/dist/bundle/chunks/{chunk-P6AXBESH.js → chunk-JV7VHOAY.js} +1119 -1098
  44. package/dist/bundle/chunks/{chunk-PWUDFU5V.js → chunk-JWOPWHVH.js} +4 -4
  45. package/dist/bundle/chunks/{chunk-4V5VL2BO.js → chunk-KLSRGGOH.js} +131 -154
  46. package/dist/bundle/chunks/{chunk-JF7FYXAI.js → chunk-KONLZKPL.js} +7 -6
  47. package/dist/bundle/chunks/{chunk-32QLLD2P.js → chunk-KQXXBQ57.js} +360 -332
  48. package/dist/bundle/chunks/{chunk-UZNIPOGS.js → chunk-L4J7SMJB.js} +1 -1
  49. package/dist/bundle/chunks/chunk-MPRAQ6ZI.js +41 -0
  50. package/dist/bundle/chunks/{chunk-GUHNFZ2Q.js → chunk-NNWNIBLG.js} +20 -19
  51. package/dist/bundle/chunks/{chunk-TWAHPPXN.js → chunk-OVDMYBIT.js} +1307 -1194
  52. package/dist/bundle/chunks/{chunk-WAPZN4KP.js → chunk-P2Y2H7SD.js} +2 -2
  53. package/dist/bundle/chunks/{chunk-PPBDDQHP.js → chunk-PGVDL4KB.js} +7 -6
  54. package/dist/bundle/chunks/{chunk-XHDVDJM7.js → chunk-PVNXN2TC.js} +7 -7
  55. package/dist/bundle/chunks/{chunk-RNBZBCH2.js → chunk-QJB5YI3I.js} +1 -1
  56. package/dist/bundle/chunks/{chunk-I5E7RQ5V.js → chunk-QRYDGY5I.js} +5 -5
  57. package/dist/bundle/chunks/{chunk-4QAXV5T6.js → chunk-R3VDXQW2.js} +9 -9
  58. package/dist/bundle/chunks/chunk-SKCJ25SX.js +24 -0
  59. package/dist/bundle/chunks/chunk-SQ7NTRLJ.js +77 -0
  60. package/dist/bundle/chunks/{chunk-SSRCVJZK.js → chunk-TYN46EVI.js} +5 -5
  61. package/dist/bundle/chunks/{chunk-6E6RHNOU.js → chunk-UXM4WFLH.js} +12 -11
  62. package/dist/bundle/chunks/{chunk-LB4CIS4F.js → chunk-VCMXBP5S.js} +17 -17
  63. package/dist/bundle/chunks/{chunk-N2SNMUD3.js → chunk-VKQNYZUA.js} +1 -1
  64. package/dist/bundle/chunks/{chunk-JYWUOKOI.js → chunk-WBSGWISD.js} +367 -353
  65. package/dist/bundle/chunks/{chunk-3EDMWQ35.js → chunk-WGXMYMPE.js} +17 -15
  66. package/dist/bundle/chunks/chunk-WRYGY5XG.js +24 -0
  67. package/dist/bundle/chunks/{chunk-GRJUKEE3.js → chunk-XVIQYONJ.js} +4 -4
  68. package/dist/bundle/chunks/chunk-YSWDFV2L.js +11 -0
  69. package/dist/bundle/chunks/{chunk-AEWYICBL.js → chunk-Z5UFSRO4.js} +2 -2
  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-ETKC6B2S.js} +1 -1
  74. package/dist/bundle/chunks/codemode-worker.js +68 -68
  75. package/dist/bundle/chunks/compat-HS4ARZK3.js +15 -0
  76. package/dist/bundle/chunks/curator-server-TC7RVVN2.js +3600 -0
  77. package/dist/bundle/chunks/dist-35STTNYA.js +37 -0
  78. package/dist/bundle/chunks/{dist-FMWWM4H7.js → dist-5AQPJ2TI.js} +2 -2
  79. package/dist/bundle/chunks/{dist-NHQTBDHT.js → dist-DYB3AR7C.js} +91 -257
  80. package/dist/bundle/chunks/dist-NMEXYUP3.js +11 -0
  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-QHZTEVJP.js} +68 -65
  88. package/dist/bundle/chunks/{flow-implementer-APJFY4YI.js → flow-implementer-QMN3HKE2.js} +8 -9
  89. package/dist/bundle/chunks/github-copilot.js +55 -45
  90. package/dist/bundle/chunks/google-generative-ai-ZND73WDQ.js +22 -0
  91. package/dist/bundle/chunks/google-vertex-YAH62YRM.js +25 -0
  92. package/dist/bundle/chunks/host-Q565BCXB.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-453SLFL5.js} +6 -6
  96. package/dist/bundle/chunks/interactive-mode-MVZOJ5OU.js +5 -0
  97. package/dist/bundle/chunks/{llama-cpp-classify-GJAXULWL.js → llama-cpp-classify-Z4GZY4GC.js} +1 -1
  98. package/dist/bundle/chunks/mistral-conversations-7I5JURDP.js +43 -0
  99. package/dist/bundle/chunks/{node-ZFIIS5IM.js → node-IMSYVRPL.js} +53 -30
  100. package/dist/bundle/chunks/{node-UNHECG4X.js → node-MHHE76P4.js} +475 -440
  101. package/dist/bundle/chunks/{openai-codex-responses-S7CMCAOY.js → openai-codex-responses-LTHOMN37.js} +30 -29
  102. package/dist/bundle/chunks/openai-codex.js +9 -8
  103. package/dist/bundle/chunks/{openai-completions-2Z57N7PC.js → openai-completions-W2X635EE.js} +22 -22
  104. package/dist/bundle/chunks/{openai-decisions-JIOJDB4C.js → openai-decisions-TN2GNOYI.js} +1 -1
  105. package/dist/bundle/chunks/{openai-responses-5VBZSTHL.js → openai-responses-DVY4QXOG.js} +4 -5
  106. package/dist/bundle/chunks/{openrouter-images-S6O7DBEJ.js → openrouter-images-SE2JMS44.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-WAS6Z5L5.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-XNVLSJ22.js +4 -0
  117. package/dist/bundle/chunks/startup-ui-3TCT465D.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-AAZH6S3I.js} +1 -1
  120. package/dist/bundle/chunks/{undici-C6S56CGI.js → undici-WVNE45GY.js} +1 -1
  121. package/dist/bundle/chunks/virtual-modules-CIVXCEAN.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/session-picker.d.ts.map +1 -1
  134. package/dist/cli/session-picker.js +9 -6
  135. package/dist/cli/session-picker.js.map +1 -1
  136. package/dist/cli/startup-ui.d.ts.map +1 -1
  137. package/dist/cli/startup-ui.js +8 -4
  138. package/dist/cli/startup-ui.js.map +1 -1
  139. package/dist/cli.js.map +1 -1
  140. package/dist/core/agent-session-runtime.d.ts +11 -0
  141. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  142. package/dist/core/agent-session-runtime.js +19 -0
  143. package/dist/core/agent-session-runtime.js.map +1 -1
  144. package/dist/core/agent-session-services.d.ts +0 -2
  145. package/dist/core/agent-session-services.d.ts.map +1 -1
  146. package/dist/core/agent-session-services.js +0 -2
  147. package/dist/core/agent-session-services.js.map +1 -1
  148. package/dist/core/agent-session.d.ts +31 -39
  149. package/dist/core/agent-session.d.ts.map +1 -1
  150. package/dist/core/agent-session.js +231 -535
  151. package/dist/core/agent-session.js.map +1 -1
  152. package/dist/core/anthropic-subscription-usage.d.ts +4 -2
  153. package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
  154. package/dist/core/anthropic-subscription-usage.js +32 -16
  155. package/dist/core/anthropic-subscription-usage.js.map +1 -1
  156. package/dist/core/auto-session-namer.js +1 -1
  157. package/dist/core/auto-session-namer.js.map +1 -1
  158. package/dist/core/cache-warmer.d.ts.map +1 -1
  159. package/dist/core/cache-warmer.js +2 -0
  160. package/dist/core/cache-warmer.js.map +1 -1
  161. package/dist/core/exec.d.ts +1 -0
  162. package/dist/core/exec.d.ts.map +1 -1
  163. package/dist/core/exec.js +4 -1
  164. package/dist/core/exec.js.map +1 -1
  165. package/dist/core/export-html/ansi-to-html.d.ts +6 -1
  166. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  167. package/dist/core/export-html/ansi-to-html.js +57 -20
  168. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  169. package/dist/core/export-html/template.js +1 -1
  170. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  171. package/dist/core/export-html/tool-renderer.js +2 -3
  172. package/dist/core/export-html/tool-renderer.js.map +1 -1
  173. package/dist/core/extensions/loader.d.ts.map +1 -1
  174. package/dist/core/extensions/loader.js +18 -1
  175. package/dist/core/extensions/loader.js.map +1 -1
  176. package/dist/core/extensions/runner.d.ts.map +1 -1
  177. package/dist/core/extensions/runner.js +5 -0
  178. package/dist/core/extensions/runner.js.map +1 -1
  179. package/dist/core/extensions/types.d.ts +5 -0
  180. package/dist/core/extensions/types.d.ts.map +1 -1
  181. package/dist/core/extensions/types.js.map +1 -1
  182. package/dist/core/flow-implementer.d.ts.map +1 -1
  183. package/dist/core/flow-implementer.js +3 -9
  184. package/dist/core/flow-implementer.js.map +1 -1
  185. package/dist/core/keybindings.d.ts +40 -0
  186. package/dist/core/keybindings.d.ts.map +1 -1
  187. package/dist/core/keybindings.js +5 -0
  188. package/dist/core/keybindings.js.map +1 -1
  189. package/dist/core/model-config.d.ts +13 -0
  190. package/dist/core/model-config.d.ts.map +1 -1
  191. package/dist/core/model-registry.d.ts +3 -0
  192. package/dist/core/model-registry.d.ts.map +1 -1
  193. package/dist/core/model-registry.js +32 -8
  194. package/dist/core/model-registry.js.map +1 -1
  195. package/dist/core/model-resolver.d.ts +0 -1
  196. package/dist/core/model-resolver.d.ts.map +1 -1
  197. package/dist/core/model-resolver.js +3 -10
  198. package/dist/core/model-resolver.js.map +1 -1
  199. package/dist/core/model-runtime.d.ts +18 -7
  200. package/dist/core/model-runtime.d.ts.map +1 -1
  201. package/dist/core/model-runtime.js +41 -8
  202. package/dist/core/model-runtime.js.map +1 -1
  203. package/dist/core/oauth-account-pool.d.ts +5 -0
  204. package/dist/core/oauth-account-pool.d.ts.map +1 -1
  205. package/dist/core/oauth-account-pool.js +34 -3
  206. package/dist/core/oauth-account-pool.js.map +1 -1
  207. package/dist/core/package-manager.d.ts +16 -0
  208. package/dist/core/package-manager.d.ts.map +1 -1
  209. package/dist/core/package-manager.js +46 -3
  210. package/dist/core/package-manager.js.map +1 -1
  211. package/dist/core/pi-ai-schemas.d.ts +1 -0
  212. package/dist/core/pi-ai-schemas.d.ts.map +1 -1
  213. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  214. package/dist/core/remote-catalog-provider.js +7 -0
  215. package/dist/core/remote-catalog-provider.js.map +1 -1
  216. package/dist/core/resource-loader.d.ts +5 -1
  217. package/dist/core/resource-loader.d.ts.map +1 -1
  218. package/dist/core/resource-loader.js +2 -0
  219. package/dist/core/resource-loader.js.map +1 -1
  220. package/dist/core/run-outcome.d.ts +6 -3
  221. package/dist/core/run-outcome.d.ts.map +1 -1
  222. package/dist/core/run-outcome.js +36 -9
  223. package/dist/core/run-outcome.js.map +1 -1
  224. package/dist/core/run-preflight.d.ts +1 -1
  225. package/dist/core/run-preflight.d.ts.map +1 -1
  226. package/dist/core/run-preflight.js +19 -11
  227. package/dist/core/run-preflight.js.map +1 -1
  228. package/dist/core/sdk.d.ts +0 -6
  229. package/dist/core/sdk.d.ts.map +1 -1
  230. package/dist/core/sdk.js +7 -16
  231. package/dist/core/sdk.js.map +1 -1
  232. package/dist/core/settings-manager.d.ts +0 -5
  233. package/dist/core/settings-manager.d.ts.map +1 -1
  234. package/dist/core/settings-manager.js +0 -9
  235. package/dist/core/settings-manager.js.map +1 -1
  236. package/dist/core/settings-schema.d.ts +0 -4
  237. package/dist/core/settings-schema.d.ts.map +1 -1
  238. package/dist/core/settings-schema.js +0 -1
  239. package/dist/core/settings-schema.js.map +1 -1
  240. package/dist/core/tools/bash-jobs.d.ts.map +1 -1
  241. package/dist/core/tools/bash-jobs.js +2 -9
  242. package/dist/core/tools/bash-jobs.js.map +1 -1
  243. package/dist/core/tools/find.d.ts.map +1 -1
  244. package/dist/core/tools/find.js +28 -16
  245. package/dist/core/tools/find.js.map +1 -1
  246. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  247. package/dist/core/tools/output-accumulator.js +4 -1
  248. package/dist/core/tools/output-accumulator.js.map +1 -1
  249. package/dist/core/tools/read.d.ts +8 -4
  250. package/dist/core/tools/read.d.ts.map +1 -1
  251. package/dist/core/tools/read.js +10 -15
  252. package/dist/core/tools/read.js.map +1 -1
  253. package/dist/core/tools/renderers/read.d.ts.map +1 -1
  254. package/dist/core/tools/renderers/read.js +6 -2
  255. package/dist/core/tools/renderers/read.js.map +1 -1
  256. package/dist/core/tools/subagent-worktree.d.ts.map +1 -1
  257. package/dist/core/tools/subagent-worktree.js +2 -10
  258. package/dist/core/tools/subagent-worktree.js.map +1 -1
  259. package/dist/core/trace-client/credential-store.d.ts.map +1 -1
  260. package/dist/core/trace-client/credential-store.js +9 -5
  261. package/dist/core/trace-client/credential-store.js.map +1 -1
  262. package/dist/extensions/codemode/execute.js +2 -2
  263. package/dist/extensions/codemode/execute.js.map +1 -1
  264. package/dist/extensions/llama/provider.d.ts +1 -1
  265. package/dist/extensions/llama/provider.d.ts.map +1 -1
  266. package/dist/extensions/llama/provider.js +6 -4
  267. package/dist/extensions/llama/provider.js.map +1 -1
  268. package/dist/extensions/usage/account-reconnect.d.ts +5 -0
  269. package/dist/extensions/usage/account-reconnect.d.ts.map +1 -0
  270. package/dist/extensions/usage/account-reconnect.js +12 -0
  271. package/dist/extensions/usage/account-reconnect.js.map +1 -0
  272. package/dist/extensions/usage/hcode-overview.d.ts +6 -19
  273. package/dist/extensions/usage/hcode-overview.d.ts.map +1 -1
  274. package/dist/extensions/usage/hcode-overview.js +86 -100
  275. package/dist/extensions/usage/hcode-overview.js.map +1 -1
  276. package/dist/extensions/usage/index.d.ts.map +1 -1
  277. package/dist/extensions/usage/index.js +74 -98
  278. package/dist/extensions/usage/index.js.map +1 -1
  279. package/dist/extensions/usage/overview.d.ts +22 -17
  280. package/dist/extensions/usage/overview.d.ts.map +1 -1
  281. package/dist/extensions/usage/overview.js +98 -13
  282. package/dist/extensions/usage/overview.js.map +1 -1
  283. package/dist/extensions/usage/popup.d.ts +9 -14
  284. package/dist/extensions/usage/popup.d.ts.map +1 -1
  285. package/dist/extensions/usage/popup.js +78 -165
  286. package/dist/extensions/usage/popup.js.map +1 -1
  287. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +4 -1
  288. package/dist/humain/flow-command.js +1 -1
  289. package/dist/humain/flow-command.js.map +1 -1
  290. package/dist/humain/flow-loader.d.ts +9 -4
  291. package/dist/humain/flow-loader.d.ts.map +1 -1
  292. package/dist/humain/flow-loader.js +30 -21
  293. package/dist/humain/flow-loader.js.map +1 -1
  294. package/dist/humain/gateway/client.d.ts +3 -1
  295. package/dist/humain/gateway/client.d.ts.map +1 -1
  296. package/dist/humain/gateway/client.js +10 -5
  297. package/dist/humain/gateway/client.js.map +1 -1
  298. package/dist/humain/gateway/login.d.ts.map +1 -1
  299. package/dist/humain/gateway/login.js +160 -53
  300. package/dist/humain/gateway/login.js.map +1 -1
  301. package/dist/humain/hcode/account-store.d.ts +29 -5
  302. package/dist/humain/hcode/account-store.d.ts.map +1 -1
  303. package/dist/humain/hcode/account-store.js +224 -124
  304. package/dist/humain/hcode/account-store.js.map +1 -1
  305. package/dist/humain/hcode/account.d.ts +6 -0
  306. package/dist/humain/hcode/account.d.ts.map +1 -1
  307. package/dist/humain/hcode/account.js +348 -129
  308. package/dist/humain/hcode/account.js.map +1 -1
  309. package/dist/humain/hcode/catalog-watch.d.ts +21 -0
  310. package/dist/humain/hcode/catalog-watch.d.ts.map +1 -0
  311. package/dist/humain/hcode/catalog-watch.js +46 -0
  312. package/dist/humain/hcode/catalog-watch.js.map +1 -0
  313. package/dist/humain/hcode/contracts.d.ts +16 -1
  314. package/dist/humain/hcode/contracts.d.ts.map +1 -1
  315. package/dist/humain/hcode/contracts.js +122 -128
  316. package/dist/humain/hcode/contracts.js.map +1 -1
  317. package/dist/humain/hcode/environment.d.ts +3 -1
  318. package/dist/humain/hcode/environment.d.ts.map +1 -1
  319. package/dist/humain/hcode/environment.js +12 -2
  320. package/dist/humain/hcode/environment.js.map +1 -1
  321. package/dist/humain/hcode/facade.d.ts +26 -6
  322. package/dist/humain/hcode/facade.d.ts.map +1 -1
  323. package/dist/humain/hcode/facade.js +148 -38
  324. package/dist/humain/hcode/facade.js.map +1 -1
  325. package/dist/humain/hcode/http.d.ts +3 -1
  326. package/dist/humain/hcode/http.d.ts.map +1 -1
  327. package/dist/humain/hcode/http.js +44 -23
  328. package/dist/humain/hcode/http.js.map +1 -1
  329. package/dist/humain/hcode/images.d.ts +67 -0
  330. package/dist/humain/hcode/images.d.ts.map +1 -0
  331. package/dist/humain/hcode/images.js +463 -0
  332. package/dist/humain/hcode/images.js.map +1 -0
  333. package/dist/humain/hcode/login-copy.d.ts +28 -0
  334. package/dist/humain/hcode/login-copy.d.ts.map +1 -0
  335. package/dist/humain/hcode/login-copy.js +74 -0
  336. package/dist/humain/hcode/login-copy.js.map +1 -0
  337. package/dist/humain/hcode/login-failure.d.ts +26 -0
  338. package/dist/humain/hcode/login-failure.d.ts.map +1 -0
  339. package/dist/humain/hcode/login-failure.js +50 -0
  340. package/dist/humain/hcode/login-failure.js.map +1 -0
  341. package/dist/humain/hcode/notices.d.ts +24 -1
  342. package/dist/humain/hcode/notices.d.ts.map +1 -1
  343. package/dist/humain/hcode/notices.js +93 -7
  344. package/dist/humain/hcode/notices.js.map +1 -1
  345. package/dist/humain/hcode/provider.d.ts +7 -3
  346. package/dist/humain/hcode/provider.d.ts.map +1 -1
  347. package/dist/humain/hcode/provider.js +123 -19
  348. package/dist/humain/hcode/provider.js.map +1 -1
  349. package/dist/humain/hcode/selection.d.ts +2 -0
  350. package/dist/humain/hcode/selection.d.ts.map +1 -1
  351. package/dist/humain/hcode/selection.js +8 -1
  352. package/dist/humain/hcode/selection.js.map +1 -1
  353. package/dist/humain/hcode/transport.d.ts +13 -10
  354. package/dist/humain/hcode/transport.d.ts.map +1 -1
  355. package/dist/humain/hcode/transport.js +103 -148
  356. package/dist/humain/hcode/transport.js.map +1 -1
  357. package/dist/humain/hcode/wire.d.ts +3 -0
  358. package/dist/humain/hcode/wire.d.ts.map +1 -1
  359. package/dist/humain/hcode/wire.js +11 -0
  360. package/dist/humain/hcode/wire.js.map +1 -1
  361. package/dist/humain/metadata/contracts.d.ts +1 -0
  362. package/dist/humain/metadata/contracts.d.ts.map +1 -1
  363. package/dist/humain/metadata/contracts.js +2 -1
  364. package/dist/humain/metadata/contracts.js.map +1 -1
  365. package/dist/humain/web-access/vendor/anysearch.d.ts.map +1 -1
  366. package/dist/humain/web-access/vendor/anysearch.js +7 -3
  367. package/dist/humain/web-access/vendor/anysearch.js.map +1 -1
  368. package/dist/humain/web-access/vendor/autom.d.ts +4 -0
  369. package/dist/humain/web-access/vendor/autom.d.ts.map +1 -0
  370. package/dist/humain/web-access/vendor/autom.js +191 -0
  371. package/dist/humain/web-access/vendor/autom.js.map +1 -0
  372. package/dist/humain/web-access/vendor/cloro.d.ts +4 -0
  373. package/dist/humain/web-access/vendor/cloro.d.ts.map +1 -0
  374. package/dist/humain/web-access/vendor/cloro.js +236 -0
  375. package/dist/humain/web-access/vendor/cloro.js.map +1 -0
  376. package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
  377. package/dist/humain/web-access/vendor/curator-page.js +7 -1
  378. package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
  379. package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
  380. package/dist/humain/web-access/vendor/curator-server.js +6 -0
  381. package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
  382. package/dist/humain/web-access/vendor/domain-filter-normalization.d.ts +8 -0
  383. package/dist/humain/web-access/vendor/domain-filter-normalization.d.ts.map +1 -1
  384. package/dist/humain/web-access/vendor/domain-filter-normalization.js +37 -0
  385. package/dist/humain/web-access/vendor/domain-filter-normalization.js.map +1 -1
  386. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts +28 -8
  387. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts.map +1 -1
  388. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js +135 -34
  389. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js.map +1 -1
  390. package/dist/humain/web-access/vendor/duckduckgo.d.ts +1 -1
  391. package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
  392. package/dist/humain/web-access/vendor/duckduckgo.js +10 -3
  393. package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
  394. package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
  395. package/dist/humain/web-access/vendor/extract.js +61 -5
  396. package/dist/humain/web-access/vendor/extract.js.map +1 -1
  397. package/dist/humain/web-access/vendor/gemini-search.d.ts +3 -3
  398. package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
  399. package/dist/humain/web-access/vendor/gemini-search.js +35 -5
  400. package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
  401. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  402. package/dist/humain/web-access/vendor/index.js +8 -1
  403. package/dist/humain/web-access/vendor/index.js.map +1 -1
  404. package/dist/humain/web-access/vendor/page-query.d.ts +5 -0
  405. package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
  406. package/dist/humain/web-access/vendor/page-query.js +12 -2
  407. package/dist/humain/web-access/vendor/page-query.js.map +1 -1
  408. package/dist/humain/web-access/vendor/specstream.d.ts +6 -0
  409. package/dist/humain/web-access/vendor/specstream.d.ts.map +1 -0
  410. package/dist/humain/web-access/vendor/specstream.js +253 -0
  411. package/dist/humain/web-access/vendor/specstream.js.map +1 -0
  412. package/dist/humain/web-access/vendor/tool-activation.d.ts.map +1 -1
  413. package/dist/humain/web-access/vendor/tool-activation.js +21 -5
  414. package/dist/humain/web-access/vendor/tool-activation.js.map +1 -1
  415. package/dist/humain/web-access/vendor/upgrade-notice.d.ts +1 -1
  416. package/dist/humain/web-access/vendor/upgrade-notice.js +1 -1
  417. package/dist/humain/web-access/vendor/upgrade-notice.js.map +1 -1
  418. package/dist/humain/web-access/vendor/utils.d.ts +1 -0
  419. package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
  420. package/dist/humain/web-access/vendor/utils.js +3 -0
  421. package/dist/humain/web-access/vendor/utils.js.map +1 -1
  422. package/dist/humain/web-access/vendor/video-extract.js +2 -2
  423. package/dist/humain/web-access/vendor/video-extract.js.map +1 -1
  424. package/dist/humain/web-access/vendor/web-tool-core.d.ts +13 -0
  425. package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
  426. package/dist/humain/web-access/vendor/web-tool-core.js +16 -5
  427. package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
  428. package/dist/humain/web-access/vendor/youtube-extract.js +2 -2
  429. package/dist/humain/web-access/vendor/youtube-extract.js.map +1 -1
  430. package/dist/index.d.ts +0 -2
  431. package/dist/index.d.ts.map +1 -1
  432. package/dist/index.js.map +1 -1
  433. package/dist/main.d.ts.map +1 -1
  434. package/dist/main.js +96 -28
  435. package/dist/main.js.map +1 -1
  436. package/dist/modes/diagnostics-stderr.d.ts +4 -0
  437. package/dist/modes/diagnostics-stderr.d.ts.map +1 -0
  438. package/dist/modes/diagnostics-stderr.js +11 -0
  439. package/dist/modes/diagnostics-stderr.js.map +1 -0
  440. package/dist/modes/interactive/components/assistant-message.d.ts +1 -1
  441. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  442. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  443. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  444. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  445. package/dist/modes/interactive/components/config-selector.js +5 -2
  446. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  447. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  448. package/dist/modes/interactive/components/extension-selector.js +14 -5
  449. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  450. package/dist/modes/interactive/components/first-time-setup.d.ts +1 -1
  451. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  452. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  453. package/dist/modes/interactive/components/keybinding-hints.d.ts +2 -0
  454. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  455. package/dist/modes/interactive/components/keybinding-hints.js +6 -0
  456. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  457. package/dist/modes/interactive/components/model-selector.d.ts +10 -0
  458. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  459. package/dist/modes/interactive/components/model-selector.js +101 -23
  460. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  461. package/dist/modes/interactive/components/oauth-selector.d.ts +5 -0
  462. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  463. package/dist/modes/interactive/components/oauth-selector.js +17 -6
  464. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  465. package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
  466. package/dist/modes/interactive/components/radius-login-selector.js +2 -1
  467. package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
  468. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  469. package/dist/modes/interactive/components/scoped-models-selector.js +13 -6
  470. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  471. package/dist/modes/interactive/components/session-selector.d.ts +8 -1
  472. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  473. package/dist/modes/interactive/components/session-selector.js +41 -9
  474. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  475. package/dist/modes/interactive/components/settings-submenu.d.ts +1 -1
  476. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  477. package/dist/modes/interactive/components/settings-submenu.js +5 -1
  478. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  479. package/dist/modes/interactive/components/status-indicator.d.ts +0 -17
  480. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  481. package/dist/modes/interactive/components/status-indicator.js +1 -78
  482. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  483. package/dist/modes/interactive/components/themed-text.d.ts +1 -1
  484. package/dist/modes/interactive/components/themed-text.d.ts.map +1 -1
  485. package/dist/modes/interactive/components/themed-text.js.map +1 -1
  486. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  487. package/dist/modes/interactive/components/thinking-selector.js +5 -1
  488. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  489. package/dist/modes/interactive/components/tool-execution.d.ts +1 -1
  490. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  491. package/dist/modes/interactive/components/tool-execution.js +3 -1
  492. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  493. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  494. package/dist/modes/interactive/components/trust-selector.js +14 -5
  495. package/dist/modes/interactive/components/trust-selector.js.map +1 -1
  496. package/dist/modes/interactive/components/user-message.d.ts +1 -1
  497. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  498. package/dist/modes/interactive/components/user-message.js.map +1 -1
  499. package/dist/modes/interactive/components/visual-truncate.d.ts +2 -2
  500. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  501. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  502. package/dist/modes/interactive/interactive-mode.d.ts +20 -2
  503. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  504. package/dist/modes/interactive/interactive-mode.js +605 -223
  505. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  506. package/dist/modes/interactive/model-catalog-refresh.d.ts +4 -0
  507. package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
  508. package/dist/modes/interactive/model-catalog-refresh.js +40 -1
  509. package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
  510. package/dist/modes/interactive/oauth-account-format.d.ts +6 -2
  511. package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
  512. package/dist/modes/interactive/oauth-account-format.js +12 -3
  513. package/dist/modes/interactive/oauth-account-format.js.map +1 -1
  514. package/dist/modes/interactive/session-share.js +2 -0
  515. package/dist/modes/interactive/session-share.js.map +1 -1
  516. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  517. package/dist/modes/interactive/theme/theme.js +1 -0
  518. package/dist/modes/interactive/theme/theme.js.map +1 -1
  519. package/dist/modes/print-mode.d.ts.map +1 -1
  520. package/dist/modes/print-mode.js +30 -32
  521. package/dist/modes/print-mode.js.map +1 -1
  522. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  523. package/dist/modes/rpc/rpc-mode.js +26 -39
  524. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  525. package/dist/modes/rpc/rpc-types.d.ts +1 -0
  526. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  527. package/dist/modes/rpc/rpc-types.js.map +1 -1
  528. package/dist/package-manager-cli.d.ts.map +1 -1
  529. package/dist/package-manager-cli.js +14 -1
  530. package/dist/package-manager-cli.js.map +1 -1
  531. package/dist/utils/abort.d.ts +5 -0
  532. package/dist/utils/abort.d.ts.map +1 -1
  533. package/dist/utils/abort.js +9 -0
  534. package/dist/utils/abort.js.map +1 -1
  535. package/dist/utils/changelog.d.ts.map +1 -1
  536. package/dist/utils/changelog.js +3 -2
  537. package/dist/utils/changelog.js.map +1 -1
  538. package/dist/utils/flush-stdout.d.ts +8 -0
  539. package/dist/utils/flush-stdout.d.ts.map +1 -0
  540. package/dist/utils/flush-stdout.js +23 -0
  541. package/dist/utils/flush-stdout.js.map +1 -0
  542. package/dist/utils/image-process.d.ts +2 -0
  543. package/dist/utils/image-process.d.ts.map +1 -1
  544. package/dist/utils/image-process.js +3 -3
  545. package/dist/utils/image-process.js.map +1 -1
  546. package/dist/utils/image-resize-core.js +2 -2
  547. package/dist/utils/image-resize-core.js.map +1 -1
  548. package/dist/utils/shell.d.ts +2 -0
  549. package/dist/utils/shell.d.ts.map +1 -1
  550. package/dist/utils/shell.js +19 -0
  551. package/dist/utils/shell.js.map +1 -1
  552. package/docs/cli.md +1 -1
  553. package/docs/development.md +0 -13
  554. package/docs/extensions.md +6 -4
  555. package/docs/flow.md +4 -62
  556. package/docs/humain-code-forge-architecture.md +1 -47
  557. package/docs/humain-code-forge-flow-walkthrough.md +1 -1
  558. package/docs/humain-code.md +1 -1
  559. package/docs/keybindings.md +2 -0
  560. package/docs/llama-cpp.md +5 -5
  561. package/docs/models-configuration.md +4 -2
  562. package/docs/nvidia-rtx-llama-cpp.md +5 -5
  563. package/docs/providers.md +14 -9
  564. package/docs/rpc-commands.md +1 -1
  565. package/docs/run-preflight.md +1 -1
  566. package/docs/slash-commands.md +1 -1
  567. package/docs/tui.md +2 -0
  568. package/examples/README.md +0 -3
  569. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  570. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  571. package/examples/extensions/gondolin/index.ts +4 -7
  572. package/examples/tsconfig.json +96 -76
  573. package/npm-shrinkwrap.json +285 -764
  574. package/package.json +24 -37
  575. package/schemas/keybindings.schema.json +20 -0
  576. package/schemas/models.schema.json +5 -1
  577. package/schemas/settings.schema.json +0 -13
  578. package/src/humain/web-access/UPSTREAM.md +52 -1
  579. package/src/humain/web-access/upstream.json +5 -5
  580. package/src/humain/web-access/vendor/CHANGELOG.md +29 -0
  581. package/dist/bundle/chunks/adaptive-peer-worker-X2ZNZE3S.js +0 -8
  582. package/dist/bundle/chunks/adaptive-session-host-7KDSQV5I.js +0 -162
  583. package/dist/bundle/chunks/anthropic-messages-TQK3FUV3.js +0 -68
  584. package/dist/bundle/chunks/azure-openai-responses-JY7OSLH2.js +0 -15
  585. package/dist/bundle/chunks/chunk-5L4PBYC7.js +0 -11
  586. package/dist/bundle/chunks/chunk-6PNQYO6A.js +0 -10
  587. package/dist/bundle/chunks/chunk-CRN54O4D.js +0 -24
  588. package/dist/bundle/chunks/chunk-CTU2ECLD.js +0 -7
  589. package/dist/bundle/chunks/chunk-DBL35X7L.js +0 -3
  590. package/dist/bundle/chunks/chunk-GME4AWDG.js +0 -23
  591. package/dist/bundle/chunks/chunk-GTILMMUF.js +0 -12
  592. package/dist/bundle/chunks/chunk-J57HOSWD.js +0 -21
  593. package/dist/bundle/chunks/chunk-KQM7ZGL6.js +0 -11
  594. package/dist/bundle/chunks/chunk-MX4Q4W6H.js +0 -214
  595. package/dist/bundle/chunks/chunk-NXA6NEHE.js +0 -54
  596. package/dist/bundle/chunks/chunk-PJACZCIR.js +0 -2
  597. package/dist/bundle/chunks/chunk-T5A6T24H.js +0 -93
  598. package/dist/bundle/chunks/chunk-WCFHG6NO.js +0 -16
  599. package/dist/bundle/chunks/chunk-ZJUU6WOV.js +0 -2052
  600. package/dist/bundle/chunks/compat-ZK2DIW3P.js +0 -15
  601. package/dist/bundle/chunks/dist-EY7YKQHB.js +0 -11
  602. package/dist/bundle/chunks/dist-J5IUPLMH.js +0 -37
  603. package/dist/bundle/chunks/dist-cjs-2SKN226B.js +0 -184
  604. package/dist/bundle/chunks/entry-AL54ZGYO.js +0 -2
  605. package/dist/bundle/chunks/es5-GYTRHFKS.js +0 -77
  606. package/dist/bundle/chunks/google-generative-ai-UL7YEQ6J.js +0 -21
  607. package/dist/bundle/chunks/google-vertex-OTMSPUYH.js +0 -26
  608. package/dist/bundle/chunks/host-75YAHLDR.js +0 -3
  609. package/dist/bundle/chunks/interactive-mode-IW4PIVAQ.js +0 -5
  610. package/dist/bundle/chunks/mistral-conversations-E72Y6OC3.js +0 -43
  611. package/dist/bundle/chunks/pdfjs-AKD6EBKN.js +0 -3614
  612. package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-FH3KJM4H.js +0 -326
  613. package/dist/bundle/chunks/pdfjs-openjpeg-SKR7C34X.js +0 -671
  614. package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-VUBL7UEE.js +0 -974
  615. package/dist/bundle/chunks/session-picker-DM6S37IF.js +0 -4
  616. package/dist/bundle/chunks/startup-ui-4GGLWNSU.js +0 -3
  617. package/dist/bundle/chunks/virtual-modules-TI3W24YL.js +0 -28
  618. package/dist/core/internal-process.d.ts +0 -23
  619. package/dist/core/internal-process.d.ts.map +0 -1
  620. package/dist/core/internal-process.js +0 -88
  621. package/dist/core/internal-process.js.map +0 -1
  622. package/dist/humain/adaptive-execution.d.ts +0 -51
  623. package/dist/humain/adaptive-execution.d.ts.map +0 -1
  624. package/dist/humain/adaptive-execution.js +0 -100
  625. package/dist/humain/adaptive-execution.js.map +0 -1
  626. package/dist/humain/adaptive-peer-process.d.ts +0 -44
  627. package/dist/humain/adaptive-peer-process.d.ts.map +0 -1
  628. package/dist/humain/adaptive-peer-process.js +0 -159
  629. package/dist/humain/adaptive-peer-process.js.map +0 -1
  630. package/dist/humain/adaptive-peer-worker.d.ts +0 -3
  631. package/dist/humain/adaptive-peer-worker.d.ts.map +0 -1
  632. package/dist/humain/adaptive-peer-worker.js +0 -122
  633. package/dist/humain/adaptive-peer-worker.js.map +0 -1
  634. package/dist/humain/adaptive-runtime-types.d.ts +0 -621
  635. package/dist/humain/adaptive-runtime-types.d.ts.map +0 -1
  636. package/dist/humain/adaptive-runtime-types.js +0 -3
  637. package/dist/humain/adaptive-runtime-types.js.map +0 -1
  638. package/dist/humain/adaptive-session-host.d.ts +0 -113
  639. package/dist/humain/adaptive-session-host.d.ts.map +0 -1
  640. package/dist/humain/adaptive-session-host.js +0 -1838
  641. package/dist/humain/adaptive-session-host.js.map +0 -1
  642. package/dist/utils/deprecation.d.ts +0 -4
  643. package/dist/utils/deprecation.d.ts.map +0 -1
  644. package/dist/utils/deprecation.js +0 -13
  645. package/dist/utils/deprecation.js.map +0 -1
  646. package/examples/plugins/pi-example-plugin/README.md +0 -38
  647. package/examples/plugins/pi-example-plugin/package.json +0 -10
  648. package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
  649. package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
  650. package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{toSubagentPresentationText}from"./chunk-HTA325LJ.js";import{COORDINATION_DIR_MODE,assertSafeAncestors,getCanonicalTmpDir}from"./chunk-R5OOX7RW.js";import{createHash}from"node:crypto";import{mkdirSync,realpathSync}from"node:fs";import{join}from"node:path";var AGENT_MONITOR_PROTOCOL={name:"humain-agent-monitor",version:1},AGENT_MONITOR_COMMAND="__humain-agent-monitor",AGENT_MONITOR_ROLE="agent-monitor",MAX_REPORT_FRAME_BYTES=64*1024,MAX_SNAPSHOT_FRAME_BYTES=256*1024,MAX_AGENTS=512,MAX_CHILDREN=32,MAX_TEXT=160,MAX_PATH_TEXT=1024,MAX_ID=256,MAX_SOCKET_PATH_BYTES=100;function resolveAgentMonitorPaths(agentDir,uid=process.getuid?.()){mkdirSync(agentDir,{recursive:!0,mode:COORDINATION_DIR_MODE});let runtimeDir=join(realpathSync(agentDir),"agent-monitor",
2
+ import{toSubagentPresentationText}from"./chunk-2NVGOSBN.js";import{COORDINATION_DIR_MODE,assertSafeAncestors,getCanonicalTmpDir}from"./chunk-B47PNNLL.js";import{createHash}from"node:crypto";import{mkdirSync,realpathSync}from"node:fs";import{join}from"node:path";var AGENT_MONITOR_PROTOCOL={name:"humain-agent-monitor",version:1},AGENT_MONITOR_COMMAND="__humain-agent-monitor",AGENT_MONITOR_ROLE="agent-monitor",MAX_REPORT_FRAME_BYTES=64*1024,MAX_SNAPSHOT_FRAME_BYTES=256*1024,MAX_AGENTS=512,MAX_CHILDREN=32,MAX_TEXT=160,MAX_PATH_TEXT=1024,MAX_ID=256,MAX_SOCKET_PATH_BYTES=100;function resolveAgentMonitorPaths(agentDir,uid=process.getuid?.()){mkdirSync(agentDir,{recursive:!0,mode:COORDINATION_DIR_MODE});let runtimeDir=join(realpathSync(agentDir),"agent-monitor",
3
3
  "run");assertSafeAncestors(join(runtimeDir,".."),uid);let defaultSocket=join(runtimeDir,"monitor.sock"),hash=createHash("sha256").update(runtimeDir).digest("hex").slice(0,16),socketPath=Buffer.byteLength(defaultSocket,"utf8")<=MAX_SOCKET_PATH_BYTES?defaultSocket:join(getCanonicalTmpDir(),`humain-agent-monitor-${uid??0}`,`${hash}.sock`);return{runtimeDir,socketPath,pidPath:join(runtimeDir,"monitor.pid"),spawnLockPath:join(runtimeDir,"monitor.spawn.lock")}}function cleanText(value,max=MAX_TEXT){return toSubagentPresentationText(
4
4
  value,max)??void 0}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isTime(value){return typeof value=="number"&&Number.isSafeInteger(value)&&value>=0}function isId(value){return typeof value=="string"&&value.length>0&&value.length<=MAX_ID}function isPid(value){return typeof value=="number"&&Number.isSafeInteger(value)&&value>0}var MODES=["tui","print","json","rpc"],TOOLS=["humain","claude","codex"],STATUSES=["attention","working","idle","unkno\
5
5
  wn"];function parseHello(value){if(!(!isRecord(value)||value.type!=="hello")&&!(typeof value.protocol!="string"||typeof value.version!="number"||!isPid(value.pid)))return{type:"hello",protocol:value.protocol,version:value.version,pid:value.pid}}function parseReport(value){if(!isRecord(value)||value.type!=="report"||!isRecord(value.session)||!Array.isArray(value.children)||value.children.length>MAX_CHILDREN||value.truncated!==void 0&&typeof value.truncated!="boolean")return;let session=value.session,
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{Crc32Node,TypeRegistry,fromHex,fromUtf8,hasOwn,init_checksum,init_schema,init_serde,init_transport,toHex,toUtf8}from"./chunk-6E6RHNOU.js";import{__esm,__export}from"./chunk-JXWJOIH4.js";function negate(bytes){for(let i=0;i<8;i++)bytes[i]^=255;for(let i=7;i>-1&&(bytes[i]++,bytes[i]===0);i--);}var Int64,init_Int64=__esm({"node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js"(){init_serde();Int64=class _Int64{bytes;constructor(bytes){if(this.bytes=bytes,bytes.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(number){if(number>9223372036854776e3||number<-9223372036854776e3)throw new Error(`${number} is too lar\
2
+ import{Crc32Node,TypeRegistry,fromHex,fromUtf8,hasOwn,init_checksum,init_schema,init_serde,init_transport,toHex,toUtf8}from"./chunk-UXM4WFLH.js";import{__esm,__export}from"./chunk-JXWJOIH4.js";function negate(bytes){for(let i=0;i<8;i++)bytes[i]^=255;for(let i=7;i>-1&&(bytes[i]++,bytes[i]===0);i--);}var Int64,init_Int64=__esm({"node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js"(){init_serde();Int64=class _Int64{bytes;constructor(bytes){if(this.bytes=bytes,bytes.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(number){if(number>9223372036854776e3||number<-9223372036854776e3)throw new Error(`${number} is too lar\
3
3
  ge (or, if negative, too small) to represent as an Int64`);let bytes=new Uint8Array(8);for(let i=7,remaining=Math.abs(Math.round(number));i>-1&&remaining>0;i--,remaining/=256)bytes[i]=remaining;return number<0&&negate(bytes),new _Int64(bytes)}valueOf(){let bytes=this.bytes.slice(0),negative=bytes[0]&128;return negative&&negate(bytes),parseInt(toHex(bytes),16)*(negative?-1:1)}toString(){return String(this.valueOf())}}}});var HeaderMarshaller,HEADER_VALUE_TYPE,BOOLEAN_TAG,BYTE_TAG,SHORT_TAG,INT_TAG,LONG_TAG,BINARY_TAG,STRING_TAG,TIMESTAMP_TAG,UUID_TAG,UUID_PATTERN,MAX_HEADER_VALUE_BYTES,init_HeaderMarshaller=__esm({"node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js"(){init_transport();init_serde();init_Int64();HeaderMarshaller=class{toUtf8;fromUtf8;constructor(toUtf82,fromUtf82){this.toUtf8=toUtf82,this.fromUtf8=fromUtf82}format(headers){let chunks=[];for(let headerName in headers){
4
4
  if(!hasOwn(headers,headerName))continue;let bytes=this.fromUtf8(headerName);if(bytes.byteLength>255)throw new Error(`@smithy/core/event-streams - header name exceeds 255 bytes: ${bytes.byteLength}`);chunks.push(Uint8Array.from([bytes.byteLength]),bytes,this.formatHeaderValue(headers[headerName]))}let out=new Uint8Array(chunks.reduce((carry,bytes)=>carry+bytes.byteLength,0)),position=0;for(let chunk of chunks)out.set(chunk,position),position+=chunk.byteLength;return out}formatHeaderValue(header){
5
5
  switch(header.type){case"boolean":return Uint8Array.from([header.value?0:1]);case"byte":return Uint8Array.from([2,header.value]);case"short":let shortView=new DataView(new ArrayBuffer(3));return shortView.setUint8(0,3),shortView.setInt16(1,header.value,!1),new Uint8Array(shortView.buffer);case"integer":let intView=new DataView(new ArrayBuffer(5));return intView.setUint8(0,4),intView.setInt32(1,header.value,!1),new Uint8Array(intView.buffer);case"long":let longBytes=new Uint8Array(9);return longBytes[0]=
@@ -0,0 +1,4 @@
1
+ import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
+ import{ENV_PREFIX,getPackageDir,isBunBinary,isBunRuntime,isBundledNode}from"./chunk-VFLVWPLZ.js";import{join}from"node:path";import{fileURLToPath}from"node:url";var COORDINATION_BROKER_COMMAND="__humain-coordination-broker",COORDINATION_ROLE_ENV=`${ENV_PREFIX}_INTERNAL_ROLE`,COORDINATION_ROLE="coordination-broker",REPOSITORY_KEY=/^[a-f0-9]{16}$/;function detectLaunchRuntime(){return isBunBinary?"bun-binary":isBundledNode?"bundled-node":isBunRuntime?"bun-source":"node-source"}function getInternalCommandLaunchSpec(runtime,tail,execPath=process.execPath){let cliSource=fileURLToPath(new URL("../../cli.ts",import.meta.url));switch(runtime){case"bun-binary":return{
3
+ command:execPath,args:tail};case"bundled-node":return{command:execPath,args:[join(getPackageDir(),"dist","bundle","cli.js"),...tail]};case"bun-source":return{command:execPath,args:[cliSource,...tail]};case"node-source":return{command:execPath,args:["--import",new URL("../../experimental/source-resolver.ts",import.meta.url).href,cliSource,...tail]}}}function getBrokerLaunchSpec(runtime,repositoryKey,execPath=process.execPath){if(!REPOSITORY_KEY.test(repositoryKey))throw new Error(`Invalid reposit\
4
+ ory key: ${repositoryKey}`);return getInternalCommandLaunchSpec(runtime,[COORDINATION_BROKER_COMMAND,repositoryKey],execPath)}export{COORDINATION_BROKER_COMMAND,COORDINATION_ROLE_ENV,COORDINATION_ROLE,detectLaunchRuntime,getInternalCommandLaunchSpec,getBrokerLaunchSpec};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{isRecord,parseClassifierUsage,postClassifierRequest,requiredNumber}from"./chunk-N2SNMUD3.js";import{formatProviderError,normalizeProviderError}from"./chunk-GME4AWDG.js";var IMAGE_OPT_IN_HEADERS={"TypeSafe-Danger-Zone-Images":"true"};function probabilities(label,value,id){if(!isRecord(value))throw new Error(`${label} returned invalid probabilities for ${id}`);return Object.fromEntries(Object.entries(value).map(([key,probability])=>[key,requiredNumber(label,probability,`probability for ${id}.${key}`)]))}function parseAnswers(label,value,context){if(!isRecord(value))throw new Error(`${label} returned an unexpected response`);let answers=[];for(let[id,question]of Object.
2
+ import{isRecord,parseClassifierUsage,postClassifierRequest,requiredNumber}from"./chunk-VKQNYZUA.js";import{formatProviderError,normalizeProviderError}from"./chunk-WRYGY5XG.js";var IMAGE_OPT_IN_HEADERS={"TypeSafe-Danger-Zone-Images":"true"};function probabilities(label,value,id){if(!isRecord(value))throw new Error(`${label} returned invalid probabilities for ${id}`);return Object.fromEntries(Object.entries(value).map(([key,probability])=>[key,requiredNumber(label,probability,`probability for ${id}.${key}`)]))}function parseAnswers(label,value,context){if(!isRecord(value))throw new Error(`${label} returned an unexpected response`);let answers=[];for(let[id,question]of Object.
3
3
  entries(context.questions)){let answer=value[id];if(!isRecord(answer))throw new Error(`${label} did not return an answer for ${id}`);if(question.type==="choice"){if(answer.type!=="choice"||typeof answer.choice!="string")throw new Error(`${label} did not return a choice answer for ${id}`);answers.push([id,{type:"choice",choice:answer.choice,probabilities:probabilities(label,answer.probabilities,id),confidence:requiredNumber(label,answer.confidence,`confidence for ${id}`)}])}else if(question.type===
4
4
  "score"){if(answer.type!=="score")throw new Error(`${label} did not return a score answer for ${id}`);answers.push([id,{type:"score",score:requiredNumber(label,answer.score,`score for ${id}`),confidence:requiredNumber(label,answer.confidence,`confidence for ${id}`)}])}else{if(answer.type!=="noul")throw new Error(`${label} did not return a bool answer for ${id}`);answers.push([id,{type:"bool",probability:requiredNumber(label,answer.noul,`probability for ${id}`)}])}}return Object.fromEntries(answers)}
5
5
  var ASSET_FORMATS={"image/png":"png","image/jpeg":"jpeg"},DATA_URL_TYPES=new Set(["image/png","image/jpeg","image/webp"]),MAX_DATA_URL_IMAGES=4;function addImages(label,model,input,images,request){if(input==="images"){if(images.length>MAX_DATA_URL_IMAGES)throw new Error(`${label} accepts at most ${MAX_DATA_URL_IMAGES} images per request, got ${images.length}`);request.images=images.map(image=>{if(!DATA_URL_TYPES.has(image.mimeType))throw new Error(`${label} accepts PNG, JPEG, and WebP images for\
@@ -0,0 +1,11 @@
1
+ import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
+ import{getProviderEnvValue}from"./chunk-FACBDLFU.js";var __rewriteRelativeImportExtension=function(path,preserveJsx){return typeof path=="string"&&/^\.\.?\//.test(path)?path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(m,tsx,d,ext,cm){return tsx?preserveJsx?".jsx":".js":d&&(!ext||!cm)?m:d+ext+"."+cm.toLowerCase()+"js"}):path},_existsSync=null,_homedir=null,_join=null,dynamicImport=specifier=>import(__rewriteRelativeImportExtension(specifier)),NODE_FS_SPECIFIER="node:fs",NODE_OS_SPECIFIER="node:os",NODE_PATH_SPECIFIER="node:p\
3
+ ath";typeof process<"u"&&(process.versions?.node||process.versions?.bun)&&(dynamicImport(NODE_FS_SPECIFIER).then(m=>{_existsSync=m.existsSync}),dynamicImport(NODE_OS_SPECIFIER).then(m=>{_homedir=m.homedir}),dynamicImport(NODE_PATH_SPECIFIER).then(m=>{_join=m.join}));var ANTHROPIC_AUTH_TOKEN_ENV="ANTHROPIC_AUTH_TOKEN",ANTHROPIC_OAUTH_TOKEN_ENV="ANTHROPIC_OAUTH_TOKEN",ANTHROPIC_API_KEY_ENV="ANTHROPIC_API_KEY",ANTHROPIC_FEDERATION_RULE_ID_ENV="ANTHROPIC_FEDERATION_RULE_ID",ANTHROPIC_ORGANIZATION_ID_ENV="\
4
+ ANTHROPIC_ORGANIZATION_ID",ANTHROPIC_SERVICE_ACCOUNT_ID_ENV="ANTHROPIC_SERVICE_ACCOUNT_ID",ANTHROPIC_IDENTITY_TOKEN_FILE_ENV="ANTHROPIC_IDENTITY_TOKEN_FILE",ANTHROPIC_WORKSPACE_ID_ENV="ANTHROPIC_WORKSPACE_ID",cachedVertexAdcCredentialsExists=null;function hasVertexAdcCredentials(env){let explicitCredentialsPath=env?.GOOGLE_APPLICATION_CREDENTIALS;if(explicitCredentialsPath)return _existsSync?_existsSync(explicitCredentialsPath):!1;if(cachedVertexAdcCredentialsExists===null){if(!_existsSync||!_homedir||
5
+ !_join)return typeof process<"u"&&(process.versions?.node||process.versions?.bun)||(cachedVertexAdcCredentialsExists=!1),!1;let gacPath=getProviderEnvValue("GOOGLE_APPLICATION_CREDENTIALS",env);gacPath?cachedVertexAdcCredentialsExists=_existsSync(gacPath):cachedVertexAdcCredentialsExists=_existsSync(_join(_homedir(),".config","gcloud","application_default_credentials.json"))}return cachedVertexAdcCredentialsExists}function getApiKeyEnvVars(provider){if(provider==="github-copilot")return["COPILOT\
6
+ _GITHUB_TOKEN"];if(provider==="anthropic")return[ANTHROPIC_AUTH_TOKEN_ENV,ANTHROPIC_OAUTH_TOKEN_ENV,ANTHROPIC_API_KEY_ENV];let envVars={"ant-ling":"ANT_LING_API_KEY","qwen-token-plan":["QWEN_TOKEN_PLAN_TEAM_API_KEY","QWEN_TOKEN_PLAN_API_KEY"],"qwen-token-plan-cn":["QWEN_TOKEN_PLAN_TEAM_CN_API_KEY","QWEN_TOKEN_PLAN_CN_API_KEY"],"qwen-token-plan-individual":["QWEN_TOKEN_PLAN_INDIVIDUAL_API_KEY","QWEN_TOKEN_PLAN_API_KEY"],openai:"OPENAI_API_KEY",azure:"AZURE_OPENAI_API_KEY",nvidia:"NVIDIA_API_KEY",
7
+ deepseek:"DEEPSEEK_API_KEY",google:"GEMINI_API_KEY","google-vertex":"GOOGLE_CLOUD_API_KEY",groq:"GROQ_API_KEY",cerebras:"CEREBRAS_API_KEY",xai:"XAI_API_KEY",typesafe:"TYPESAFE_API_KEY",radius:"RADIUS_API_KEY",openrouter:"OPENROUTER_API_KEY","vercel-ai-gateway":"AI_GATEWAY_API_KEY",zai:"ZAI_API_KEY","zai-coding-cn":"ZAI_CODING_CN_API_KEY",mistral:"MISTRAL_API_KEY",minimax:"MINIMAX_API_KEY","minimax-cn":"MINIMAX_CN_API_KEY",moonshotai:"MOONSHOT_API_KEY","moonshotai-cn":"MOONSHOT_API_KEY",huggingface:"\
8
+ HF_TOKEN",fireworks:"FIREWORKS_API_KEY",together:"TOGETHER_API_KEY",baseten:"BASETEN_API_KEY",opencode:"OPENCODE_API_KEY","opencode-go":"OPENCODE_API_KEY","kimi-coding":"KIMI_API_KEY",meta:"META_API_KEY","humain-node":"HUMAIN_NODE_API_KEY","cloudflare-workers-ai":"CLOUDFLARE_API_KEY","cloudflare-ai-gateway":"CLOUDFLARE_API_KEY",xiaomi:"XIAOMI_API_KEY","xiaomi-token-plan-cn":"XIAOMI_TOKEN_PLAN_CN_API_KEY","xiaomi-token-plan-ams":"XIAOMI_TOKEN_PLAN_AMS_API_KEY","xiaomi-token-plan-sgp":"XIAOMI_TOKE\
9
+ N_PLAN_SGP_API_KEY"}[provider];return typeof envVars=="string"?[envVars]:envVars}function findEnvKeys(provider,env){let envVars=getApiKeyEnvVars(provider);if(!envVars)return;let found=envVars.filter(envVar=>!!getProviderEnvValue(envVar,env));return found.length>0?found:void 0}function getEnvApiKey(provider,env){let envKeys=findEnvKeys(provider,env);if(envKeys?.[0]){let apiKeyEnv=provider==="anthropic"?envKeys.find(key=>key!==ANTHROPIC_AUTH_TOKEN_ENV):envKeys[0];if(apiKeyEnv)return getProviderEnvValue(
10
+ apiKeyEnv,env)}if(provider==="google-vertex"){let hasCredentials=hasVertexAdcCredentials(env),hasProject=!!(getProviderEnvValue("GOOGLE_CLOUD_PROJECT",env)||getProviderEnvValue("GCLOUD_PROJECT",env)),hasLocation=!!getProviderEnvValue("GOOGLE_CLOUD_LOCATION",env);if(hasCredentials&&hasProject&&hasLocation)return"<authenticated>"}if(provider==="amazon-bedrock"&&(getProviderEnvValue("AWS_PROFILE",env)||getProviderEnvValue("AWS_ACCESS_KEY_ID",env)&&getProviderEnvValue("AWS_SECRET_ACCESS_KEY",env)||getProviderEnvValue(
11
+ "AWS_BEARER_TOKEN_BEDROCK",env)||getProviderEnvValue("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",env)||getProviderEnvValue("AWS_CONTAINER_CREDENTIALS_FULL_URI",env)||getProviderEnvValue("AWS_WEB_IDENTITY_TOKEN_FILE",env)))return"<authenticated>"}export{ANTHROPIC_AUTH_TOKEN_ENV,ANTHROPIC_OAUTH_TOKEN_ENV,ANTHROPIC_API_KEY_ENV,ANTHROPIC_FEDERATION_RULE_ID_ENV,ANTHROPIC_ORGANIZATION_ID_ENV,ANTHROPIC_SERVICE_ACCOUNT_ID_ENV,ANTHROPIC_IDENTITY_TOKEN_FILE_ENV,ANTHROPIC_WORKSPACE_ID_ENV,findEnvKeys,getEnvApiKey};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{Compile}from"./chunk-LB4CIS4F.js";function lazyValidator(schema){let validator;return()=>validator??=Compile(schema)}export{lazyValidator};
2
+ import{Compile}from"./chunk-VCMXBP5S.js";function lazyValidator(schema){let validator;return()=>validator??=Compile(schema)}export{lazyValidator};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{AGENT_MONITOR_PROTOCOL,AGENT_MONITOR_ROLE,MAX_AGENTS,MAX_REPORT_FRAME_BYTES,MAX_SNAPSHOT_FRAME_BYTES,parseHello,parseReport,resolveAgentMonitorPaths}from"./chunk-TGDPZCSW.js";import{COORDINATION_ROLE_ENV,MAX_RUNTIME_TEXT_FILE_BYTES,writeTextAtomic}from"./chunk-6PNQYO6A.js";import{createMessageReader,ensureCoordinationRuntimeDir,restrictRuntimeFile,writeMessage}from"./chunk-R5OOX7RW.js";import{getAgentDir}from"./chunk-VFLVWPLZ.js";import{lstatSync,unlinkSync}from"node:fs";import net from"node:net";import{execFile}from"node:child_process";import{readlink}from"node:fs/promises";import{basename}from"node:path";import{promisify}from"node:util";var execFileAsync=promisify(execFile),PS_TIMEOUT_MS=2e3,PS_MAX_BYTES=8*1024*1024,CWD_TIMEOUT_MS=2e3,UNAVAILABLE_NOTE="Claude Code and Codex discovery is unavailable.",TOOL_NAMES={claude:"Claude Code",codex:"Codex"},NO_TTY=new Set(["?","??","-"]),LINE=/^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\S+)\s+([A-Z][a-z]{2}\s+[A-Z][a-z]{2}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+\d{4})\s+(.*)$/;
2
+ import{AGENT_MONITOR_PROTOCOL,AGENT_MONITOR_ROLE,MAX_AGENTS,MAX_REPORT_FRAME_BYTES,MAX_SNAPSHOT_FRAME_BYTES,parseHello,parseReport,resolveAgentMonitorPaths}from"./chunk-4TDNOR36.js";import{COORDINATION_ROLE_ENV}from"./chunk-6HTHDVJC.js";import{MAX_RUNTIME_TEXT_FILE_BYTES,createMessageReader,ensureCoordinationRuntimeDir,restrictRuntimeFile,writeMessage,writeTextAtomic}from"./chunk-B47PNNLL.js";import{getAgentDir}from"./chunk-VFLVWPLZ.js";import{lstatSync,unlinkSync}from"node:fs";import net from"node:net";import{execFile}from"node:child_process";import{readlink}from"node:fs/promises";import{basename}from"node:path";import{promisify}from"node:util";var execFileAsync=promisify(execFile),PS_TIMEOUT_MS=2e3,PS_MAX_BYTES=8*1024*1024,CWD_TIMEOUT_MS=2e3,UNAVAILABLE_NOTE="Claude Code and Codex discovery is unavailable.",TOOL_NAMES={claude:"Claude Code",codex:"Codex"},NO_TTY=new Set(["?","??","-"]),LINE=/^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\S+)\s+([A-Z][a-z]{2}\s+[A-Z][a-z]{2}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+\d{4})\s+(.*)$/;
3
3
  function parsePsOutput(stdout){let entries=[];for(let line of stdout.split(`
4
4
  `)){let match=LINE.exec(line);if(!match)continue;let tool=classifyProcess(match[6]??"");entries.push({uid:Number(match[1]),pid:Number(match[2]),ppid:Number(match[3]),tty:match[4]??"",started:match[5]??"",...tool?{tool}:{}})}return entries}function classifyProcess(args){let[first="",second=""]=args.trim().split(/\s+/,2),executable=basename(first);if(executable==="claude")return"claude";if(executable==="codex")return"codex";if(!(executable!=="node"&&executable!=="bun")){if(/[\\/]@anthropic-ai[\\/]claude-code[\\/]cli\.js$/.
5
5
  test(second))return"claude";if(/[\\/]@openai[\\/]codex[\\/]bin[\\/]codex\.js$/.test(second))return"codex"}}function findExternalAgents(entries,uid){let candidates=new Map;for(let entry of entries){if(entry.uid!==uid||NO_TTY.has(entry.tty))continue;let{tool}=entry;tool&&candidates.set(entry.pid,{tool,pid:entry.pid,ppid:entry.ppid,started:entry.started})}return[...candidates.values()].filter(candidate=>candidates.get(candidate.ppid)?.tool!==candidate.tool)}async function defaultListProcesses(){let{
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{METHOD,extractCiRefs,formatDuration,getFlowAgentsDir,isCredentialName,isWaitCommand,redactCredentials,sanitizeControlChars}from"./chunk-4JRER4XK.js";var DEFAULT_DISPATCH_TIMEOUT_MS=1800*1e3,DEFAULT_LEAD_INACTIVITY_TIMEOUT_MS=1800*1e3,LOOP_WINDOW_SIZE=12,TOOL_CALL_RECORD_LIMIT=256,NESTED_WORKER_LIMIT=32,EVICTED_WORKER_ID_LIMIT=256,ORCHESTRATING_CAPABILITIES=new Set(["architect","technical_lead",...Object.values(METHOD.rules.lead_sizing.sizes)]);function configuredTimeout(env,name,fallback,notes){let raw=env[name];if(raw===void 0)return fallback;let parsed=Number(raw),value=Math.trunc(parsed);return!Number.isFinite(parsed)||parsed<=0||value<=0?
2
+ import{METHOD,extractCiRefs,formatDuration,getFlowAgentsDir,isCredentialName,isWaitCommand,redactCredentials,sanitizeControlChars}from"./chunk-HQMUDHC3.js";var DEFAULT_DISPATCH_TIMEOUT_MS=1800*1e3,DEFAULT_LEAD_INACTIVITY_TIMEOUT_MS=1800*1e3,LOOP_WINDOW_SIZE=12,TOOL_CALL_RECORD_LIMIT=256,NESTED_WORKER_LIMIT=32,EVICTED_WORKER_ID_LIMIT=256,ORCHESTRATING_CAPABILITIES=new Set(["architect","technical_lead",...Object.values(METHOD.rules.lead_sizing.sizes)]);function configuredTimeout(env,name,fallback,notes){let raw=env[name];if(raw===void 0)return fallback;let parsed=Number(raw),value=Math.trunc(parsed);return!Number.isFinite(parsed)||parsed<=0||value<=0?
3
3
  (notes.push(`${name}=${JSON.stringify(raw)} is invalid; using the default ${fallback}ms.`),fallback):value}function resolveDispatchTimeoutPolicy(capability,env){let notes=[];return!capability||!ORCHESTRATING_CAPABILITIES.has(capability)?{mode:"leaf",inactivityMs:configuredTimeout(env,"HUMAIN_ORCHESTRATOR_DISPATCH_TIMEOUT_MS",DEFAULT_DISPATCH_TIMEOUT_MS,notes),notes}:{mode:"lead",inactivityMs:configuredTimeout(env,"HUMAIN_ORCHESTRATOR_LEAD_INACTIVITY_TIMEOUT_MS",DEFAULT_LEAD_INACTIVITY_TIMEOUT_MS,
4
4
  notes),notes}}function stableValue(value){if(Array.isArray(value))return value.map(stableValue);if(value&&typeof value=="object"){let record=value;return Object.fromEntries(Object.keys(record).sort().map(key=>[key,stableValue(record[key])]))}return value}function stableJson(value){try{return JSON.stringify(stableValue(value))??"undefined"}catch{return"[unserializable]"}}function fingerprint(toolName,args){return`${toolName}:${stableJson(args)}`.slice(0,2e3)}function textHash(text){let hash=2166136261;
5
5
  for(let index=0;index<text.length;index++)hash^=text.charCodeAt(index),hash=Math.imul(hash,16777619);return(hash>>>0).toString(16)}function finiteNumber(value,fallback){return typeof value=="number"&&Number.isFinite(value)?value:fallback}function assistantContent(message){let content=message.content;return typeof content=="string"?content:Array.isArray(content)?content.map(part=>{if(!part||typeof part!="object")return"";let item=part;return item.type==="text"&&typeof item.text=="string"?item.text:
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{formatProviderError,normalizeProviderError}from"./chunk-GME4AWDG.js";import{findSubmissionAdmissionError,getStreamProgress}from"./chunk-4HTVBBJD.js";var DEFAULT_MAX_RETRY_DELAY_MS=6e4;function isProviderError(error){return!(error instanceof Error)||!("status"in error)||!("headers"in error)?!1:(error.status===void 0||typeof error.status=="number")&&(error.headers===void 0||error.headers instanceof Headers)}function isRetryableProviderError(error){let shouldRetry=error.headers?.get("x-should-retry");return shouldRetry==="true"?!0:shouldRetry==="false"?!1:error.status===void 0?!0:error.status===408||error.status===409||error.status===429||typeof error.
2
+ import{formatProviderError,normalizeProviderError}from"./chunk-WRYGY5XG.js";import{findSubmissionAdmissionError,getStreamProgress}from"./chunk-ATFZAFMS.js";var DEFAULT_MAX_RETRY_DELAY_MS=6e4;function isProviderError(error){return!(error instanceof Error)||!("status"in error)||!("headers"in error)?!1:(error.status===void 0||typeof error.status=="number")&&(error.headers===void 0||error.headers instanceof Headers)}function isRetryableProviderError(error){let shouldRetry=error.headers?.get("x-should-retry");return shouldRetry==="true"?!0:shouldRetry==="false"?!1:error.status===void 0?!0:error.status===408||error.status===409||error.status===429||typeof error.
3
3
  status=="number"&&error.status>=500}function validateServerRetryDelayMs(delayMs,maxRetryDelayMs,providerError,signal){let maxDelayMs=maxRetryDelayMs??DEFAULT_MAX_RETRY_DELAY_MS;if(maxDelayMs>0&&delayMs>maxDelayMs)throw new Error(`Server requested ${Math.ceil(delayMs/1e3)}s retry delay (max: ${Math.ceil(maxDelayMs/1e3)}s). ${formatProviderError(normalizeProviderError(providerError),"Provider error")}`);let progress=getStreamProgress(signal);return progress&&Number.isFinite(delayMs)&&delayMs>0&&(progress.
4
4
  retryAt=Math.min(Number.MAX_SAFE_INTEGER,Date.now()+Math.ceil(delayMs))),delayMs}function parseRetryAfterMs(headers){let retryAfterMs=headers?.get("retry-after-ms");if(retryAfterMs){let value=Number.parseFloat(retryAfterMs);if(Number.isFinite(value))return value}let retryAfter=headers?.get("retry-after");if(retryAfter){let seconds=Number.parseFloat(retryAfter),delayMs=Number.isNaN(seconds)?Date.parse(retryAfter)-Date.now():seconds*1e3;if(Number.isFinite(delayMs))return delayMs}}function getServerRetryDelayMs(error){
5
5
  return isProviderError(error)?parseRetryAfterMs(error.headers):void 0}function getRetryDelayMs(error,retryIndex,maxRetryDelayMs,signal){let serverDelayMs=parseRetryAfterMs(error.headers);return serverDelayMs!==void 0?validateServerRetryDelayMs(serverDelayMs,maxRetryDelayMs,error,signal):Math.min(.5*2**retryIndex,8)*1e3*(1-Math.random()*.25)}function createAbortError(){let error=new Error("Request aborted");return error.name="AbortError",error}function abortableSleep(ms,signal){return new Promise(
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{theme}from"./chunk-JF7FYXAI.js";var ARMIN_WIDTH=31,ARMIN_HEIGHT=36,WIDTH=ARMIN_WIDTH,HEIGHT=ARMIN_HEIGHT,BITS=[255,255,255,127,255,240,255,127,255,237,255,127,255,219,255,127,255,183,255,127,255,119,254,127,63,248,254,127,223,255,254,127,223,63,252,127,159,195,251,127,111,252,244,127,247,15,247,127,247,255,247,127,247,255,227,127,247,7,232,127,239,248,103,112,15,255,187,111,241,0,208,91,253,63,236,83,193,255,239,87,159,253,238,95,159,252,174,95,31,120,172,95,63,0,80,108,127,0,220,119,255,192,63,120,255,1,248,127,255,3,156,120,
2
+ import{theme}from"./chunk-KONLZKPL.js";var ARMIN_WIDTH=31,ARMIN_HEIGHT=36,WIDTH=ARMIN_WIDTH,HEIGHT=ARMIN_HEIGHT,BITS=[255,255,255,127,255,240,255,127,255,237,255,127,255,219,255,127,255,183,255,127,255,119,254,127,63,248,254,127,223,255,254,127,223,63,252,127,159,195,251,127,111,252,244,127,247,15,247,127,247,255,247,127,247,255,227,127,247,7,232,127,239,248,103,112,15,255,187,111,241,0,208,91,253,63,236,83,193,255,239,87,159,253,238,95,159,252,174,95,31,120,172,95,63,0,80,108,127,0,220,119,255,192,63,120,255,1,248,127,255,3,156,120,
3
3
  255,7,140,124,255,15,206,120,255,255,207,127,255,255,207,120,255,255,223,120,255,255,223,125,255,255,63,126,255,255,255,127],BYTES_PER_ROW=Math.ceil(WIDTH/8),DISPLAY_HEIGHT=Math.ceil(HEIGHT/2),EFFECTS=["typewriter","scanline","rain","fade","crt","glitch","dissolve"];function isArminPixel(x,y){if(y>=HEIGHT)return!1;let byteIndex=y*BYTES_PER_ROW+Math.floor(x/8),bitIndex=x%8;return(BITS[byteIndex]>>bitIndex&1)===0}function getChar(x,row){let upper=isArminPixel(x,row*2),lower=isArminPixel(x,row*2+1);
4
4
  return upper&&lower?"\u2588":upper?"\u2580":lower?"\u2584":" "}function buildFinalGrid(){let grid=[];for(let row=0;row<DISPLAY_HEIGHT;row++){let line=[];for(let x=0;x<WIDTH;x++)line.push(getChar(x,row));grid.push(line)}return grid}var ArminComponent=class{ui;interval=null;effect;finalGrid;currentGrid;effectState={};cachedLines=[];cachedWidth=0;gridVersion=0;cachedVersion=-1;constructor(ui){this.ui=ui,this.effect=EFFECTS[Math.floor(Math.random()*EFFECTS.length)],this.finalGrid=buildFinalGrid(),this.
5
5
  currentGrid=this.createEmptyGrid(),this.initEffect(),this.startAnimation()}invalidate(){this.cachedWidth=0}render(width){if(width===this.cachedWidth&&this.cachedVersion===this.gridVersion)return this.cachedLines;let padding=1,availableWidth=width-padding;this.cachedLines=this.currentGrid.map(row=>{let clipped=row.slice(0,availableWidth).join(""),padRight=Math.max(0,width-padding-clipped.length);return` ${theme.fg("accent",clipped)}${" ".repeat(padRight)}`});let message="ARMIN SAYS HI",msgPadRight=Math.
@@ -10,8 +10,8 @@ stack,code:typeof code=="string"||typeof code=="number"?code:void 0}}function cr
10
10
 
11
11
  ${value}`);return parts.join(`
12
12
 
13
- `)}function ownedSlice(text,start,end=text.length){return`${text.slice(start,end)} `.slice(0,-1)}var PROVIDER_CLIENT_VERSIONS={claudeCode:"2.1.326",codex:"0.169.0",copilotChat:"0.48.1",vscode:"1.146.0"},COPILOT_HEADERS={"User-Agent":`GitHubCopilotChat/${PROVIDER_CLIENT_VERSIONS.copilotChat}`,"Editor-Version":`vscode/${PROVIDER_CLIENT_VERSIONS.vscode}`,"Editor-Plugin-Version":`copilot-chat/${PROVIDER_CLIENT_VERSIONS.copilotChat}`,"Copilot-Integration-Id":"vscode-chat"};function getModelHeaders(model){return model.provider==="github-copilot"?mergeHeaders(model.headers,COPILOT_HEADERS):model.headers}function mergeHeaders(...headerSources){if(headerSources.every(source=>source===void 0))return;let merged={};for(let source of headerSources)for(let[name,value]of Object.entries(source??{})){let lowerName=name.toLowerCase();for(let existingName of Object.keys(merged))existingName.toLowerCase()===lowerName&&delete merged[existingName];merged[name]=value}return merged}
14
- function headersToRecord(headers){let result={};for(let[key,value]of headers.entries())result[key]=value;return result}function providerHeadersToRecord(...headerSources){let merged=new Map;for(let source of headerSources)for(let[name,value]of Object.entries(source??{})){let normalizedName=name.toLowerCase();merged.delete(normalizedName),value!==null&&merged.set(normalizedName,[name,value])}return merged.size>0?Object.fromEntries(merged.values()):void 0}var PI_AI_VERSION="1.5.2";var PI_ATTRIBUTION={name:"pi",url:"https://pi.dev",categories:["cli-agent"]},NVIDIA_NIM_HOST="integrate.api.nvidia.com",OPENCODE_HOST="opencode.ai",CLOUDFLARE_API_HOST="api.cloudflare.com",CLOUDFLARE_AI_GATEWAY_HOST="gateway.ai.cloudflare.com",VERCEL_GATEWAY_HOST="ai-gateway.vercel.sh";function mergeClientIdentity(...sources){let merged;for(let source of sources)source&&(merged={...merged},source.userAgent!==void 0&&(merged.userAgent=source.userAgent),source.attribution!==void 0&&(merged.attribution=
13
+ `)}function ownedSlice(text,start,end=text.length){return`${text.slice(start,end)} `.slice(0,-1)}var PROVIDER_CLIENT_VERSIONS={claudeCode:"2.1.330",codex:"0.171.0",copilotChat:"0.48.1",vscode:"1.147.0"},COPILOT_HEADERS={"User-Agent":`GitHubCopilotChat/${PROVIDER_CLIENT_VERSIONS.copilotChat}`,"Editor-Version":`vscode/${PROVIDER_CLIENT_VERSIONS.vscode}`,"Editor-Plugin-Version":`copilot-chat/${PROVIDER_CLIENT_VERSIONS.copilotChat}`,"Copilot-Integration-Id":"vscode-chat"};function getModelHeaders(model){return model.provider==="github-copilot"?mergeHeaders(model.headers,COPILOT_HEADERS):model.headers}function mergeHeaders(...headerSources){if(headerSources.every(source=>source===void 0))return;let merged={};for(let source of headerSources)for(let[name,value]of Object.entries(source??{})){let lowerName=name.toLowerCase();for(let existingName of Object.keys(merged))existingName.toLowerCase()===lowerName&&delete merged[existingName];merged[name]=value}return merged}
14
+ function headersToRecord(headers){let result={};for(let[key,value]of headers.entries())result[key]=value;return result}function providerHeadersToRecord(...headerSources){let merged=new Map;for(let source of headerSources)for(let[name,value]of Object.entries(source??{})){let normalizedName=name.toLowerCase();merged.delete(normalizedName),value!==null&&merged.set(normalizedName,[name,value])}return merged.size>0?Object.fromEntries(merged.values()):void 0}var PI_AI_VERSION="1.6.0";var PI_ATTRIBUTION={name:"pi",url:"https://pi.dev",categories:["cli-agent"]},NVIDIA_NIM_HOST="integrate.api.nvidia.com",OPENCODE_HOST="opencode.ai",CLOUDFLARE_API_HOST="api.cloudflare.com",CLOUDFLARE_AI_GATEWAY_HOST="gateway.ai.cloudflare.com",VERCEL_GATEWAY_HOST="ai-gateway.vercel.sh";function mergeClientIdentity(...sources){let merged;for(let source of sources)source&&(merged={...merged},source.userAgent!==void 0&&(merged.userAgent=source.userAgent),source.attribution!==void 0&&(merged.attribution=
15
15
  source.attribution),source.version!==void 0&&(merged.version=source.version),source.product!==void 0&&(merged.product=source.product));return merged}function getClientVersion(identity){return identity?.version??PI_AI_VERSION}function getClientProduct(identity){return identity?.product??"pi"}function runtimeDescription(){if(typeof process>"u")return;let versions=process.versions;if(versions?.bun)return`bun/${versions.bun}`;if(versions?.node)return`node/${process.version}`}function formatUserAgent(identity){
16
16
  let mode=identity?.userAgent??"detailed";if(typeof mode=="object")return mode.custom;if(mode==="short")return getClientProduct(identity);let product=`${getClientProduct(identity)}/${getClientVersion(identity)}`,runtime=runtimeDescription();return runtime?`${product} (${process.platform}; ${runtime}; ${process.arch})`:`${product} (browser)`}function matchesHost(baseUrl,expectedHost){try{return new URL(baseUrl).hostname===expectedHost}catch{return!1}}function isOpenRouter(target){return target.provider===
17
17
  "openrouter"||target.baseUrl.includes("openrouter.ai")}function isNvidiaNim(target){return target.provider==="nvidia"||matchesHost(target.baseUrl,NVIDIA_NIM_HOST)}function isOpenCode(target){return target.provider==="opencode"||target.provider==="opencode-go"||matchesHost(target.baseUrl,OPENCODE_HOST)}function isCloudflare(target){return target.provider==="cloudflare-workers-ai"||target.provider==="cloudflare-ai-gateway"||matchesHost(target.baseUrl,CLOUDFLARE_API_HOST)||matchesHost(target.baseUrl,
@@ -9,8 +9,15 @@ if(resolve(runtimeDir)!==runtimeDir)throw new Error(`Refusing to use ${runtimeDi
9
9
  not canonical (it resolves through a symbolic link or is not absolute, to ${canonical}); derive paths with resolveCoordinationRuntimePaths`)}function ensureRuntimeDir(dir,uid=currentUid()){mkdirSync(dir,{recursive:!0,mode:COORDINATION_DIR_MODE}),assertSafeAncestors(dir,uid);let checked=lstatSync(dir);assertRealDirectory(dir,checked,uid);let fd=openSync(dir,constants.O_RDONLY|constants.O_DIRECTORY|constants.O_NOFOLLOW);try{let opened=fstatSync(fd);if(opened.dev!==checked.dev||opened.ino!==checked.
10
10
  ino)throw new Error(`Refusing to use ${dir}: it changed while being verified`);if(fchmodSync(fd,COORDINATION_DIR_MODE),(fstatSync(fd).mode&63)!==0)throw new Error(`Refusing to use ${dir}: its permissions could not be restricted to owner-only`)}finally{closeSync(fd)}}function ensureCoordinationRuntimeDir(paths,uid=currentUid()){ensureRuntimeDir(dirname(paths.runtimeDir),uid),ensureRuntimeDir(paths.runtimeDir,uid);let socketDir=dirname(paths.socketPath);socketDir!==paths.runtimeDir&&ensureRuntimeDir(
11
11
  socketDir,uid)}function assertPrivateSocket(socketPath,uid=currentUid()){let parent=dirname(socketPath),parentStats=lstatSync(parent);if(assertRealDirectory(parent,parentStats,uid),(parentStats.mode&63)!==0)throw new Error(`Refusing to connect to ${socketPath}: directory ${parent} is accessible to other users`);let socketStats=lstatSync(socketPath);if(!socketStats.isSocket())throw new Error(`Refusing to connect to ${socketPath}: it is not a socket`);assertOwnedByUser(socketPath,socketStats,uid)}
12
- function restrictRuntimeFile(filePath){chmodSync(filePath,COORDINATION_FILE_MODE)}function framePayloadBytes(msg){return Buffer.byteLength(JSON.stringify(msg),"utf-8")}var MAX_SOCKET_WRITE_BACKLOG_BYTES=8*1024*1024;function writeMessage(socket,msg){let json=JSON.stringify(msg),payloadLength=Buffer.byteLength(json,"utf-8"),frame=Buffer.allocUnsafeSlow(4+payloadLength);frame.writeUInt32BE(payloadLength,0),frame.write(json,4,payloadLength,"utf-8"),socket.write(frame),socket.writableLength>MAX_SOCKET_WRITE_BACKLOG_BYTES&&socket.destroy()}function createMessageReader(onMessage,onError,maxFrameBytes=1048576){
12
+ function restrictRuntimeFile(filePath){chmodSync(filePath,COORDINATION_FILE_MODE)}import{randomBytes}from"node:crypto";import{closeSync as closeSync2,constants as constants2,fchmodSync as fchmodSync2,fstatSync as fstatSync2,fsyncSync,linkSync,openSync as openSync2,readSync,renameSync,unlinkSync,writeSync}from"node:fs";import{dirname as dirname2}from"node:path";var MAX_RUNTIME_TEXT_FILE_BYTES=4096;function fsyncDirectory(dir){let fd;try{fd=openSync2(dir,constants2.O_RDONLY),fsyncSync(fd)}catch{}finally{if(fd!==void 0)try{closeSync2(fd)}catch{}}}function removeQuietly(path){try{unlinkSync(path)}catch{}}function errorCode(error){if(!(typeof error!="object"||error===null||!("code"in error)))return typeof error.code=="string"?error.code:void 0}function writeAll(fd,body){let offset=0;for(;offset<body.length;)offset+=writeSync(fd,body,offset)}function temporaryPathFor(path){
13
+ return`${path}.${randomBytes(6).toString("hex")}.tmp`}function writeBytesAtomic(path,body){let tempPath=temporaryPathFor(path),fd=openSync2(tempPath,constants2.O_WRONLY|constants2.O_CREAT|constants2.O_EXCL,COORDINATION_FILE_MODE),fdOpen=!0,renamed=!1;try{writeAll(fd,body),fchmodSync2(fd,COORDINATION_FILE_MODE),fsyncSync(fd),fdOpen=!1,closeSync2(fd),renameSync(tempPath,path),renamed=!0}finally{if(fdOpen)try{closeSync2(fd)}catch{}renamed||removeQuietly(tempPath)}fsyncDirectory(dirname2(path))}function writeJsonAtomic(path,value,maxBytes){
14
+ writeTextAtomic(path,`${JSON.stringify(value)}
15
+ `,maxBytes)}function writeTextAtomic(path,text,maxBytes){let body=Buffer.from(text,"utf8");if(body.length>maxBytes)throw new Error(`Snapshot exceeds ${maxBytes} bytes`);writeBytesAtomic(path,body)}function createFileExclusive(path,content){let body=Buffer.from(content,"utf8"),tempPath=temporaryPathFor(path),fd=openSync2(tempPath,constants2.O_WRONLY|constants2.O_CREAT|constants2.O_EXCL,COORDINATION_FILE_MODE);try{try{writeAll(fd,body),fchmodSync2(fd,COORDINATION_FILE_MODE)}finally{closeSync2(fd)}
16
+ return linkSync(tempPath,path),!0}catch(error){if(errorCode(error)==="EEXIST")return!1;throw error}finally{removeQuietly(tempPath)}}function readBoundedTextFile(path,maxBytes){let fd;try{fd=openSync2(path,constants2.O_RDONLY|constants2.O_NOFOLLOW|constants2.O_NONBLOCK)}catch(error){if(errorCode(error)==="ENOENT")return;throw error}try{let stats=fstatSync2(fd);if(!stats.isFile())throw new Error(`${path} is not a regular file`);if(stats.size>maxBytes)throw new Error(`${path} exceeds ${maxBytes} by\
17
+ tes`);let limit=Math.min(stats.size,maxBytes)+1,buffer=Buffer.allocUnsafe(limit),length=0;for(;length<limit;){let read=readSync(fd,buffer,length,limit-length,null);if(read===0)break;length+=read}if(length>stats.size)throw new Error(`${path} changed while being read`);return{text:buffer.toString("utf8",0,length),dev:stats.dev,ino:stats.ino,mtimeMs:stats.mtimeMs}}finally{closeSync2(fd)}}function readTextFile(path,maxBytes){return readBoundedTextFile(path,maxBytes)?.text}function readJsonFile(path,maxBytes){
18
+ let file=readBoundedTextFile(path,maxBytes);return file===void 0?void 0:JSON.parse(file.text)}function framePayloadBytes(msg){return Buffer.byteLength(JSON.stringify(msg),"utf-8")}var MAX_SOCKET_WRITE_BACKLOG_BYTES=8*1024*1024;function writeMessage(socket,msg){let json=JSON.stringify(msg),payloadLength=Buffer.byteLength(json,"utf-8"),frame=Buffer.allocUnsafeSlow(4+payloadLength);frame.writeUInt32BE(payloadLength,0),frame.write(json,4,payloadLength,"utf-8"),socket.write(frame),socket.writableLength>MAX_SOCKET_WRITE_BACKLOG_BYTES&&socket.destroy()}function createMessageReader(onMessage,onError,maxFrameBytes=1048576){
13
19
  let header=Buffer.allocUnsafe(4),headerBytes=0,payload=null,payloadBytes=0,payloadLength=0;function reportMessage(framePayload){let msg;try{msg=JSON.parse(framePayload.toString("utf-8"))}catch(error){let message=error instanceof Error?error.message:String(error);return onError(new Error(`Failed to parse intercom message: ${message}`,{cause:error})),!1}try{return onMessage(msg),!0}catch(error){let message=error instanceof Error?error.message:String(error);return onError(new Error(`Failed to handl\
14
20
  e intercom message: ${message}`,{cause:error})),!1}}return data=>{let offset=0;for(;offset<data.length;){if(headerBytes<4){let bytes2=Math.min(4-headerBytes,data.length-offset);if(data.copy(header,headerBytes,offset,offset+bytes2),headerBytes+=bytes2,offset+=bytes2,headerBytes<4)return;if(payloadLength=header.readUInt32BE(0),payloadLength>maxFrameBytes){headerBytes=0,onError(new Error(`Intercom frame length ${payloadLength} exceeds maximum ${maxFrameBytes} bytes`));return}}if(payloadBytes===0&&data.
15
21
  length-offset>=payloadLength){let framePayload2=data.subarray(offset,offset+payloadLength);if(offset+=payloadLength,headerBytes=0,payload=null,payloadLength=0,!reportMessage(framePayload2))return;continue}(payload===null||payload.length!==payloadLength)&&(payload=Buffer.allocUnsafe(payloadLength));let bytes=Math.min(payloadLength-payloadBytes,data.length-offset);if(data.copy(payload,payloadBytes,offset,offset+bytes),payloadBytes+=bytes,offset+=bytes,payloadBytes<payloadLength)return;let framePayload=payload;
16
- if(headerBytes=0,payload=null,payloadBytes=0,payloadLength=0,!reportMessage(framePayload))return}}}export{COORDINATION_DIR_MODE,COORDINATION_FILE_MODE,COORDINATION_PROTOCOL_NAME,COORDINATION_PROTOCOL_VERSION,MAX_MESSAGE_TEXT_BYTES,getCanonicalTmpDir,getCoordinationRuntimePaths,resolveCoordinationRuntimePaths,assertSafeAncestors,assertCanonicalRuntimeDir,ensureRuntimeDir,ensureCoordinationRuntimeDir,assertPrivateSocket,restrictRuntimeFile,framePayloadBytes,writeMessage,createMessageReader};
22
+ if(headerBytes=0,payload=null,payloadBytes=0,payloadLength=0,!reportMessage(framePayload))return}}}export{COORDINATION_DIR_MODE,COORDINATION_FILE_MODE,COORDINATION_PROTOCOL_NAME,COORDINATION_PROTOCOL_VERSION,MAX_MESSAGE_TEXT_BYTES,getCanonicalTmpDir,getCoordinationRuntimePaths,resolveCoordinationRuntimePaths,assertSafeAncestors,assertCanonicalRuntimeDir,ensureRuntimeDir,ensureCoordinationRuntimeDir,assertPrivateSocket,restrictRuntimeFile,MAX_RUNTIME_TEXT_FILE_BYTES,fsyncDirectory,writeJsonAtomic,writeTextAtomic,createFileExclusive,readBoundedTextFile,readTextFile,readJsonFile,framePayloadBytes,
23
+ writeMessage,createMessageReader};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{HUMAIN_CODE_LOGO_LINES}from"./chunk-I5E7RQ5V.js";import{DynamicBorder}from"./chunk-J57HOSWD.js";import{resolveHcodeEnvironment}from"./chunk-G4QPSFBF.js";import{getTerminalTheme,keyHint,theme}from"./chunk-JF7FYXAI.js";import{Container,ScrollView,Spacer,Text,getKeybindings}from"./chunk-JYWUOKOI.js";import{APP_TITLE}from"./chunk-VFLVWPLZ.js";var THEME_OPTIONS=[{value:"humain-dark",label:"HUMAIN Dark",detectedTheme:"dark"},{value:"humain-light",label:"HUMAIN Light",detectedTheme:"light"}];function getDefaultThemeIndex(terminalTheme=getTerminalTheme()){return Math.max(0,THEME_OPTIONS.findIndex(option=>option.detectedTheme===terminalTheme))}function getDefaultThemeName(terminalTheme=getTerminalTheme()){return THEME_OPTIONS[getDefaultThemeIndex(terminalTheme)].value}var FirstTimeSetupComponent=class extends Container{step;themeIndex;disclosureDisplayed=!1;disclosureText=new Text(
2
+ import{HUMAIN_CODE_LOGO_LINES}from"./chunk-QRYDGY5I.js";import{DynamicBorder}from"./chunk-J5TSAJGC.js";import{resolveHcodeEnvironment}from"./chunk-EMBIUIQ2.js";import{getTerminalTheme,keyHint,theme}from"./chunk-KONLZKPL.js";import{Container,ScrollView,Spacer,Text,getKeybindings}from"./chunk-WBSGWISD.js";import{APP_TITLE}from"./chunk-VFLVWPLZ.js";var THEME_OPTIONS=[{value:"humain-dark",label:"HUMAIN Dark",detectedTheme:"dark"},{value:"humain-light",label:"HUMAIN Light",detectedTheme:"light"}];function getDefaultThemeIndex(terminalTheme=getTerminalTheme()){return Math.max(0,THEME_OPTIONS.findIndex(option=>option.detectedTheme===terminalTheme))}function getDefaultThemeName(terminalTheme=getTerminalTheme()){return THEME_OPTIONS[getDefaultThemeIndex(terminalTheme)].value}var FirstTimeSetupComponent=class extends Container{step;themeIndex;disclosureDisplayed=!1;disclosureText=new Text(
3
3
  "",1,0);disclosure=new ScrollView(this.disclosureText);options;constructor(options){super(),this.options=options,this.step=options.initialStep??"theme",this.themeIndex=getDefaultThemeIndex(),this.update()}invalidate(){this.update(),super.invalidate()}render(width){if(this.step==="theme")return super.render(width);let parts=this.children.map(child=>child.render(width)),index=this.children.indexOf(this.disclosure),content=parts[index],chromeHeight=parts.reduce((height2,lines,i)=>height2+(i===index?
4
4
  0:lines.length),0),height=this.options.tui?Math.max(1,this.options.tui.terminal.rows-chromeHeight):content.length;return this.disclosure.updateLayout(content.length,height,()=>this.options.tui?.requestRender()),parts[index]=content.slice(this.disclosure.scrollTop,this.disclosure.scrollTop+height),this.disclosureDisplayed=!0,parts.flat()}update(){this.clear(),this.addChild(new DynamicBorder),this.addChild(new Spacer(1)),this.step==="theme"?(this.addChild(new Text(theme.fg("accent",HUMAIN_CODE_LOGO_LINES.
5
5
  join(`
@@ -1,12 +1,12 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{clampThinkingLevel}from"./chunk-AEWYICBL.js";import{getSystemMessageText}from"./chunk-4HTVBBJD.js";var UnsupportedStrictJsonSchemaError=class extends Error{},UNSUPPORTED_STRICT_SCHEMA_KEYS=["$ref","$defs","definitions","allOf","oneOf","patternProperties","dependentSchemas","dependencies","unevaluatedProperties","propertyNames","contains","prefixItems","not","if","then","else"];function isJsonSchemaObject(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isStructuredSchema(schema){if(!isJsonSchemaObject(schema))return!1;let types=typeof schema.type=="string"?[schema.
2
+ import{clampThinkingLevel}from"./chunk-Z5UFSRO4.js";import{getSystemMessageText}from"./chunk-ATFZAFMS.js";var UnsupportedStrictJsonSchemaError=class extends Error{},UNSUPPORTED_STRICT_SCHEMA_KEYS=["$ref","$defs","definitions","allOf","oneOf","patternProperties","dependentSchemas","dependencies","unevaluatedProperties","propertyNames","contains","prefixItems","not","if","then","else"];function isJsonSchemaObject(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isStructuredSchema(schema){if(!isJsonSchemaObject(schema))return!1;let types=typeof schema.type=="string"?[schema.
3
3
  type]:Array.isArray(schema.type)?schema.type:[];return types.includes("object")||types.includes("array")||schema.properties!==void 0||schema.items!==void 0}function schemaAllowsNull(schema){return isJsonSchemaObject(schema)?schema.type==="null"||Array.isArray(schema.type)&&schema.type.includes("null")||schema.const===null||Array.isArray(schema.enum)&&schema.enum.includes(null)?!0:Array.isArray(schema.anyOf)&&schema.anyOf.some(variant=>schemaAllowsNull(variant)):!1}function makeJsonSchemaNodeStrict(schema,isUnsupportedKeyword){
4
- if(!isJsonSchemaObject(schema))throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported");for(let key of UNSUPPORTED_STRICT_SCHEMA_KEYS)if(schema[key]!==void 0)throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`);if(isUnsupportedKeyword){for(let[key,value]of Object.entries(schema))if(isUnsupportedKeyword(key,value))throw new UnsupportedStrictJsonSchemaError(`${key}: ${JSON.stringify(value)} is unsupported`)}if(schema.anyOf!==void 0){if(!Array.isArray(schema.
5
- anyOf)||schema.anyOf.length===0)throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema");for(let variant of schema.anyOf){if(isStructuredSchema(variant))throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported");makeJsonSchemaNodeStrict(variant,isUnsupportedKeyword)}}if(schema.items!==void 0){if(Array.isArray(schema.items))throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported");makeJsonSchemaNodeStrict(schema.items,isUnsupportedKeyword)}
6
- let isObjectSchema=schema.type==="object";if(schema.properties!==void 0&&!isObjectSchema)throw new UnsupportedStrictJsonSchemaError("properties require type object");if(!isObjectSchema)return;if(schema.additionalProperties!==void 0&&schema.additionalProperties!==!1)throw new UnsupportedStrictJsonSchemaError("schema-valued or true additionalProperties is unsupported");if(schema.properties!==void 0&&!isJsonSchemaObject(schema.properties))throw new UnsupportedStrictJsonSchemaError("object propertie\
7
- s must be a schema map");if(schema.required!==void 0&&(!Array.isArray(schema.required)||schema.required.some(key=>typeof key!="string")))throw new UnsupportedStrictJsonSchemaError("object required must be a string array");let properties=schema.properties??{},propertyNames=Object.keys(properties),required=new Set(Array.isArray(schema.required)?schema.required:[]);if([...required].some(key=>!propertyNames.includes(key)))throw new UnsupportedStrictJsonSchemaError("required contains an unknown prope\
8
- rty");for(let[key,property]of Object.entries(properties))makeJsonSchemaNodeStrict(property,isUnsupportedKeyword),!required.has(key)&&!schemaAllowsNull(property)&&(properties[key]={anyOf:[property,{type:"null"}]});schema.required=propertyNames,schema.additionalProperties=!1}function makeStrictJsonSchema(schema,isUnsupportedKeyword){let cloned=structuredClone(schema);if(!isJsonSchemaObject(cloned))throw new UnsupportedStrictJsonSchemaError("root schema must have type object");if(makeJsonSchemaNodeStrict(
9
- cloned,isUnsupportedKeyword),cloned.type!=="object")throw new UnsupportedStrictJsonSchemaError("root schema must have type object");return cloned}function prefersJsonSchemaStrictSampling(tool){let config=tool.constrainedSampling;return!!config&&config.type==="json_schema"&&config.strict==="prefer"}function getJsonSchemaToolParameters(tool,strict){return strict===!0?makeStrictJsonSchema(tool.parameters):tool.parameters}function getGrammarToolInput(toolName,arguments_,inputProperty){let input=arguments_[inputProperty];if(typeof input!="string")throw new Error(`Grammar tool call "${toolName}" requires argument "${inputProperty}" to be a string.`);return input}function appendGrammarToolInputJsonDelta(buffer,inputProperty,inputDelta){if(buffer.closed)throw new Error(`grammar tool input for pro\
4
+ if(!isJsonSchemaObject(schema))throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported");for(let key of UNSUPPORTED_STRICT_SCHEMA_KEYS)if(schema[key]!==void 0)throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`);if(isUnsupportedKeyword){for(let[key,value]of Object.entries(schema))if(isUnsupportedKeyword(key,value))throw new UnsupportedStrictJsonSchemaError(`${key}: ${JSON.stringify(value)} is unsupported`)}if(schema.type===void 0&&schema.anyOf===void 0&&
5
+ schema.enum===void 0)throw new UnsupportedStrictJsonSchemaError("schemas without a type are unsupported");if(schema.anyOf!==void 0){if(!Array.isArray(schema.anyOf)||schema.anyOf.length===0)throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema");for(let variant of schema.anyOf){if(isStructuredSchema(variant))throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported");makeJsonSchemaNodeStrict(variant,isUnsupportedKeyword)}}if(schema.items!==void 0){
6
+ if(Array.isArray(schema.items))throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported");makeJsonSchemaNodeStrict(schema.items,isUnsupportedKeyword)}let isObjectSchema=schema.type==="object";if(schema.properties!==void 0&&!isObjectSchema)throw new UnsupportedStrictJsonSchemaError("properties require type object");if(!isObjectSchema)return;if(schema.additionalProperties!==void 0&&schema.additionalProperties!==!1)throw new UnsupportedStrictJsonSchemaError("schema-valued or true a\
7
+ dditionalProperties is unsupported");if(schema.properties!==void 0&&!isJsonSchemaObject(schema.properties))throw new UnsupportedStrictJsonSchemaError("object properties must be a schema map");if(schema.required!==void 0&&(!Array.isArray(schema.required)||schema.required.some(key=>typeof key!="string")))throw new UnsupportedStrictJsonSchemaError("object required must be a string array");let properties=schema.properties??{},propertyNames=Object.keys(properties),required=new Set(Array.isArray(schema.
8
+ required)?schema.required:[]);if([...required].some(key=>!propertyNames.includes(key)))throw new UnsupportedStrictJsonSchemaError("required contains an unknown property");for(let[key,property]of Object.entries(properties))makeJsonSchemaNodeStrict(property,isUnsupportedKeyword),!required.has(key)&&!schemaAllowsNull(property)&&(properties[key]={anyOf:[property,{type:"null"}]});schema.required=propertyNames,schema.additionalProperties=!1}function makeStrictJsonSchema(schema,isUnsupportedKeyword){let cloned=structuredClone(
9
+ schema);if(!isJsonSchemaObject(cloned))throw new UnsupportedStrictJsonSchemaError("root schema must have type object");if(makeJsonSchemaNodeStrict(cloned,isUnsupportedKeyword),cloned.type!=="object")throw new UnsupportedStrictJsonSchemaError("root schema must have type object");return cloned}function prefersJsonSchemaStrictSampling(tool){let config=tool.constrainedSampling;return!!config&&config.type==="json_schema"&&config.strict==="prefer"}function getJsonSchemaToolParameters(tool,strict){return strict===!0?makeStrictJsonSchema(tool.parameters):tool.parameters}function getGrammarToolInput(toolName,arguments_,inputProperty){let input=arguments_[inputProperty];if(typeof input!="string")throw new Error(`Grammar tool call "${toolName}" requires argument "${inputProperty}" to be a string.`);return input}function appendGrammarToolInputJsonDelta(buffer,inputProperty,inputDelta){if(buffer.closed)throw new Error(`grammar tool input for pro\
10
10
  perty "${inputProperty}" changed after it was closed`);if(inputDelta.length!==0)return buffer.input+=inputDelta,grammarToolInputJsonStart(buffer,inputProperty)+JSON.stringify(inputDelta).slice(1,-1)}function closeGrammarToolInputJson(buffer,inputProperty,finalInput){if(buffer.closed){if(finalInput===void 0||finalInput===buffer.input)return;throw new Error(`grammar tool input for property "${inputProperty}" changed after it was closed`)}if(finalInput!==void 0&&!finalInput.startsWith(buffer.input))
11
11
  throw new Error(`grammar tool input for property "${inputProperty}" changed non-monotonically`);let rest=finalInput===void 0?"":finalInput.slice(buffer.input.length);return finalInput!==void 0&&(buffer.input=finalInput),buffer.closed=!0,`${grammarToolInputJsonStart(buffer,inputProperty)}${JSON.stringify(rest).slice(1,-1)}"}`}function grammarToolInputJsonStart(buffer,inputProperty){return buffer.started?"":(buffer.started=!0,`{${JSON.stringify(inputProperty)}:"`)}function inferGrammarInputProperty(tool){
12
12
  let schema=tool.parameters;if(schema.type!=="object")throw new Error("grammar constrained sampling requires an object parameter schema");if(!Array.isArray(schema.required)||schema.required.length!==1||typeof schema.required[0]!="string")throw new Error("grammar constrained sampling requires exactly one required string property");let inputProperty=schema.required[0];if(!schema.properties?.[inputProperty])throw new Error(`grammar constrained sampling requires a properties entry for ${inputProperty}`);