@humain/terminal 0.0.6 → 0.0.8

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 (493) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +17 -10
  3. package/dist/bundle/chunks/anthropic-messages-GDMGYAZB.js +6 -0
  4. package/dist/bundle/chunks/anthropic.js +75 -0
  5. package/dist/bundle/chunks/azure-openai-responses-ZN52D6YC.js +2 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +77 -0
  7. package/dist/bundle/chunks/chunk-3VI4HD7D.js +31 -0
  8. package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
  9. package/dist/bundle/chunks/chunk-72KO4OMP.js +2 -0
  10. package/dist/bundle/chunks/chunk-74NVHVNZ.js +16 -0
  11. package/dist/bundle/chunks/chunk-7DDKXS2Q.js +2 -0
  12. package/dist/bundle/chunks/chunk-ARF4OE6X.js +105 -0
  13. package/dist/bundle/chunks/chunk-BOW22LW6.js +42 -0
  14. package/dist/bundle/chunks/chunk-BZQ53VGE.js +70 -0
  15. package/dist/bundle/chunks/chunk-CBHC6EL7.js +133 -0
  16. package/dist/bundle/chunks/chunk-D7XAASZM.js +4 -0
  17. package/dist/bundle/chunks/chunk-ECWELYBH.js +17 -0
  18. package/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
  19. package/dist/bundle/chunks/chunk-H2O6VOXT.js +11 -0
  20. package/dist/bundle/chunks/chunk-JUUC5AZY.js +2 -0
  21. package/dist/bundle/chunks/chunk-JXWJOIH4.js +2 -0
  22. package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
  23. package/dist/bundle/chunks/chunk-LVVZS2NO.js +12 -0
  24. package/dist/bundle/chunks/chunk-MA4UUCYX.js +18 -0
  25. package/dist/bundle/chunks/chunk-MMFBCF6F.js +5986 -0
  26. package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
  27. package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
  28. package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
  29. package/dist/bundle/chunks/chunk-PSKDLDLZ.js +44 -0
  30. package/dist/bundle/chunks/chunk-SGTGQNNP.js +4 -0
  31. package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
  32. package/dist/bundle/chunks/chunk-TXBQIIIO.js +2 -0
  33. package/dist/bundle/chunks/chunk-WJZ4KLGL.js +2 -0
  34. package/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
  35. package/dist/bundle/chunks/dist-BXEVYJIO.js +7 -0
  36. package/dist/bundle/chunks/es-P2KNSZYR.js +9 -0
  37. package/dist/bundle/chunks/es5-FGTJ7ZFW.js +2 -0
  38. package/dist/bundle/chunks/event-streams-JOSQQSII.js +2 -0
  39. package/dist/bundle/chunks/extract-2L7ZVN7F.js +106 -0
  40. package/dist/bundle/chunks/github-copilot.js +2 -0
  41. package/dist/bundle/chunks/google-generative-ai-FF7M7XHT.js +2 -0
  42. package/dist/bundle/chunks/google-vertex-YMUBFRBA.js +2 -0
  43. package/dist/bundle/chunks/https-proxy-agent-562J2I52.js +2 -0
  44. package/dist/bundle/chunks/image-resize-worker.js +2 -0
  45. package/dist/bundle/chunks/kimi-coding.js +2 -0
  46. package/dist/bundle/chunks/mistral-conversations-O4M7IQML.js +5 -0
  47. package/dist/bundle/chunks/multipart-parser-FMGQ7342.js +3 -0
  48. package/dist/bundle/chunks/node-XY3CBY3C.js +294 -0
  49. package/dist/bundle/chunks/node-ZHY4LHC7.js +15 -0
  50. package/dist/bundle/chunks/openai-codex-responses-HRVCDY54.js +8 -0
  51. package/dist/bundle/chunks/openai-codex.js +75 -0
  52. package/dist/bundle/chunks/openai-completions-L4AHDQ5D.js +7 -0
  53. package/dist/bundle/chunks/openai-responses-4MWLJHIK.js +2 -0
  54. package/dist/bundle/chunks/openrouter-images-Y2PCWAQH.js +2 -0
  55. package/dist/bundle/chunks/openrouter.js +75 -0
  56. package/dist/bundle/chunks/pdfjs-UKQT3OWY.js +107 -0
  57. package/dist/bundle/chunks/pi-messages-57K43J6J.js +8 -0
  58. package/dist/bundle/chunks/promise-J5TGSM32.js +2 -0
  59. package/dist/bundle/chunks/radius.js +75 -0
  60. package/dist/bundle/chunks/src-QKGKDFSU.js +4 -0
  61. package/dist/bundle/chunks/undici-D6ABF53Q.js +2 -0
  62. package/dist/bundle/chunks/webapi-AFS5FDJJ.js +5 -0
  63. package/dist/bundle/chunks/xai.js +2 -0
  64. package/dist/bundle/cli.js +3 -0
  65. package/dist/bundle/client.js +2 -0
  66. package/dist/bundle/index.js +2 -0
  67. package/dist/bundle/rpc-entry.js +3 -0
  68. package/dist/cli/args.d.ts +1 -0
  69. package/dist/cli/args.d.ts.map +1 -1
  70. package/dist/cli/args.js +29 -9
  71. package/dist/cli/args.js.map +1 -1
  72. package/dist/cli/file-processor.d.ts.map +1 -1
  73. package/dist/cli/file-processor.js +2 -1
  74. package/dist/cli/file-processor.js.map +1 -1
  75. package/dist/cli/startup-ui.d.ts.map +1 -1
  76. package/dist/cli/startup-ui.js +2 -1
  77. package/dist/cli/startup-ui.js.map +1 -1
  78. package/dist/config.d.ts +1 -0
  79. package/dist/config.d.ts.map +1 -1
  80. package/dist/config.js +19 -11
  81. package/dist/config.js.map +1 -1
  82. package/dist/core/agent-session.d.ts +62 -15
  83. package/dist/core/agent-session.d.ts.map +1 -1
  84. package/dist/core/agent-session.js +240 -104
  85. package/dist/core/agent-session.js.map +1 -1
  86. package/dist/core/auth-storage.d.ts.map +1 -1
  87. package/dist/core/auth-storage.js +6 -7
  88. package/dist/core/auth-storage.js.map +1 -1
  89. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  90. package/dist/core/compaction/branch-summarization.js +7 -3
  91. package/dist/core/compaction/branch-summarization.js.map +1 -1
  92. package/dist/core/compaction/compaction.d.ts +9 -3
  93. package/dist/core/compaction/compaction.d.ts.map +1 -1
  94. package/dist/core/compaction/compaction.js +59 -36
  95. package/dist/core/compaction/compaction.js.map +1 -1
  96. package/dist/core/defaults.d.ts +1 -0
  97. package/dist/core/defaults.d.ts.map +1 -1
  98. package/dist/core/defaults.js +9 -0
  99. package/dist/core/defaults.js.map +1 -1
  100. package/dist/core/extensions/index.d.ts +2 -2
  101. package/dist/core/extensions/index.d.ts.map +1 -1
  102. package/dist/core/extensions/index.js +1 -1
  103. package/dist/core/extensions/index.js.map +1 -1
  104. package/dist/core/extensions/loader.d.ts.map +1 -1
  105. package/dist/core/extensions/loader.js +115 -48
  106. package/dist/core/extensions/loader.js.map +1 -1
  107. package/dist/core/extensions/runner.d.ts +5 -0
  108. package/dist/core/extensions/runner.d.ts.map +1 -1
  109. package/dist/core/extensions/runner.js +44 -1
  110. package/dist/core/extensions/runner.js.map +1 -1
  111. package/dist/core/extensions/types.d.ts +56 -10
  112. package/dist/core/extensions/types.d.ts.map +1 -1
  113. package/dist/core/extensions/types.js +3 -0
  114. package/dist/core/extensions/types.js.map +1 -1
  115. package/dist/core/footer-data-provider.d.ts +1 -1
  116. package/dist/core/footer-data-provider.js +1 -1
  117. package/dist/core/footer-data-provider.js.map +1 -1
  118. package/dist/core/keybindings.d.ts +20 -19
  119. package/dist/core/keybindings.d.ts.map +1 -1
  120. package/dist/core/keybindings.js +26 -5
  121. package/dist/core/keybindings.js.map +1 -1
  122. package/dist/core/model-config.d.ts +5 -0
  123. package/dist/core/model-config.d.ts.map +1 -1
  124. package/dist/core/model-config.js +3 -1
  125. package/dist/core/model-config.js.map +1 -1
  126. package/dist/core/model-resolver.d.ts +1 -0
  127. package/dist/core/model-resolver.d.ts.map +1 -1
  128. package/dist/core/model-resolver.js +14 -8
  129. package/dist/core/model-resolver.js.map +1 -1
  130. package/dist/core/models-store.d.ts.map +1 -1
  131. package/dist/core/models-store.js +2 -1
  132. package/dist/core/models-store.js.map +1 -1
  133. package/dist/core/package-manager.d.ts.map +1 -1
  134. package/dist/core/package-manager.js +22 -14
  135. package/dist/core/package-manager.js.map +1 -1
  136. package/dist/core/pi-manifest.d.ts.map +1 -1
  137. package/dist/core/pi-manifest.js +2 -1
  138. package/dist/core/pi-manifest.js.map +1 -1
  139. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  140. package/dist/core/remote-catalog-provider.js +2 -1
  141. package/dist/core/remote-catalog-provider.js.map +1 -1
  142. package/dist/core/resource-loader.d.ts.map +1 -1
  143. package/dist/core/resource-loader.js +3 -2
  144. package/dist/core/resource-loader.js.map +1 -1
  145. package/dist/core/sdk.d.ts +2 -2
  146. package/dist/core/sdk.d.ts.map +1 -1
  147. package/dist/core/sdk.js +10 -3
  148. package/dist/core/sdk.js.map +1 -1
  149. package/dist/core/session-export.d.ts +4 -0
  150. package/dist/core/session-export.d.ts.map +1 -0
  151. package/dist/core/session-export.js +32 -0
  152. package/dist/core/session-export.js.map +1 -0
  153. package/dist/core/session-manager.d.ts.map +1 -1
  154. package/dist/core/session-manager.js +6 -3
  155. package/dist/core/session-manager.js.map +1 -1
  156. package/dist/core/settings-diagnostics.d.ts +9 -0
  157. package/dist/core/settings-diagnostics.d.ts.map +1 -0
  158. package/dist/core/settings-diagnostics.js +21 -0
  159. package/dist/core/settings-diagnostics.js.map +1 -0
  160. package/dist/core/settings-manager.d.ts +17 -1
  161. package/dist/core/settings-manager.d.ts.map +1 -1
  162. package/dist/core/settings-manager.js +68 -10
  163. package/dist/core/settings-manager.js.map +1 -1
  164. package/dist/core/skills.d.ts.map +1 -1
  165. package/dist/core/skills.js +51 -33
  166. package/dist/core/skills.js.map +1 -1
  167. package/dist/core/slash-commands.d.ts.map +1 -1
  168. package/dist/core/slash-commands.js +2 -1
  169. package/dist/core/slash-commands.js.map +1 -1
  170. package/dist/core/system-prompt.d.ts.map +1 -1
  171. package/dist/core/system-prompt.js +11 -2
  172. package/dist/core/system-prompt.js.map +1 -1
  173. package/dist/core/tools/bash.d.ts +16 -3
  174. package/dist/core/tools/bash.d.ts.map +1 -1
  175. package/dist/core/tools/bash.js +62 -29
  176. package/dist/core/tools/bash.js.map +1 -1
  177. package/dist/core/tools/edit-diff.d.ts +0 -5
  178. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  179. package/dist/core/tools/edit-diff.js +2 -5
  180. package/dist/core/tools/edit-diff.js.map +1 -1
  181. package/dist/core/tools/edit.d.ts.map +1 -1
  182. package/dist/core/tools/edit.js +20 -4
  183. package/dist/core/tools/edit.js.map +1 -1
  184. package/dist/core/tools/index.d.ts +4 -1
  185. package/dist/core/tools/index.d.ts.map +1 -1
  186. package/dist/core/tools/index.js +19 -1
  187. package/dist/core/tools/index.js.map +1 -1
  188. package/dist/core/tools/powershell.d.ts +16 -0
  189. package/dist/core/tools/powershell.d.ts.map +1 -0
  190. package/dist/core/tools/powershell.js +39 -0
  191. package/dist/core/tools/powershell.js.map +1 -0
  192. package/dist/core/tools/subagent.d.ts.map +1 -1
  193. package/dist/core/tools/subagent.js +4 -1
  194. package/dist/core/tools/subagent.js.map +1 -1
  195. package/dist/core/trust-manager.d.ts.map +1 -1
  196. package/dist/core/trust-manager.js +2 -1
  197. package/dist/core/trust-manager.js.map +1 -1
  198. package/dist/extensions/llama/client.d.ts +6 -0
  199. package/dist/extensions/llama/client.d.ts.map +1 -1
  200. package/dist/extensions/llama/client.js +7 -0
  201. package/dist/extensions/llama/client.js.map +1 -1
  202. package/dist/extensions/llama/index.d.ts.map +1 -1
  203. package/dist/extensions/llama/index.js +2 -0
  204. package/dist/extensions/llama/index.js.map +1 -1
  205. package/dist/extensions/llama/provider.d.ts +3 -1
  206. package/dist/extensions/llama/provider.d.ts.map +1 -1
  207. package/dist/extensions/llama/provider.js +29 -4
  208. package/dist/extensions/llama/provider.js.map +1 -1
  209. package/dist/humain/agent-execution-protocol.d.ts +1 -217
  210. package/dist/humain/agent-execution-protocol.d.ts.map +1 -1
  211. package/dist/humain/agent-execution-protocol.js +1 -203
  212. package/dist/humain/agent-execution-protocol.js.map +1 -1
  213. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +107 -16
  214. package/dist/humain/mcp-adapter/vendor/CHANGELOG.md +82 -0
  215. package/dist/humain/mcp-adapter/vendor/README.md +47 -15
  216. package/dist/humain/mcp-adapter/vendor/cli.js +4 -4
  217. package/dist/humain/mcp-adapter/vendor/commands.ts +5 -3
  218. package/dist/humain/mcp-adapter/vendor/config.ts +46 -5
  219. package/dist/humain/mcp-adapter/vendor/direct-tools.ts +103 -92
  220. package/dist/humain/mcp-adapter/vendor/dist/agent-dir.d.ts +10 -0
  221. package/dist/humain/mcp-adapter/vendor/dist/agent-dir.js +63 -0
  222. package/dist/humain/mcp-adapter/vendor/dist/agent-dir.js.map +1 -0
  223. package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.d.ts +8 -0
  224. package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.js +356 -0
  225. package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.js.map +1 -0
  226. package/dist/humain/mcp-adapter/vendor/dist/config.d.ts +123 -0
  227. package/dist/humain/mcp-adapter/vendor/dist/config.js +1088 -0
  228. package/dist/humain/mcp-adapter/vendor/dist/config.js.map +1 -0
  229. package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.d.ts +24 -0
  230. package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.js +336 -0
  231. package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.js.map +1 -0
  232. package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.d.ts +19 -0
  233. package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.js +319 -0
  234. package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.js.map +1 -0
  235. package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.d.ts +2 -0
  236. package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.js +156 -0
  237. package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.js.map +1 -0
  238. package/dist/humain/mcp-adapter/vendor/dist/resource-tools.d.ts +1 -0
  239. package/dist/humain/mcp-adapter/vendor/dist/resource-tools.js +15 -0
  240. package/dist/humain/mcp-adapter/vendor/dist/resource-tools.js.map +1 -0
  241. package/dist/humain/mcp-adapter/vendor/dist/types.d.ts +566 -0
  242. package/dist/humain/mcp-adapter/vendor/dist/types.js +287 -0
  243. package/dist/humain/mcp-adapter/vendor/dist/types.js.map +1 -0
  244. package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.d.ts +6 -0
  245. package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.js +37 -0
  246. package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.js.map +1 -0
  247. package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.d.ts +104 -0
  248. package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.js +59 -0
  249. package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.js.map +1 -0
  250. package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.d.ts +4 -0
  251. package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.js +27 -0
  252. package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.js.map +1 -0
  253. package/dist/humain/mcp-adapter/vendor/dist/utils.d.ts +32 -0
  254. package/dist/humain/mcp-adapter/vendor/dist/utils.js +338 -0
  255. package/dist/humain/mcp-adapter/vendor/dist/utils.js.map +1 -0
  256. package/dist/humain/mcp-adapter/vendor/failure-backoff.ts +23 -0
  257. package/dist/humain/mcp-adapter/vendor/index.bundle.mjs +4870 -3878
  258. package/dist/humain/mcp-adapter/vendor/index.ts +294 -88
  259. package/dist/humain/mcp-adapter/vendor/init.ts +41 -30
  260. package/dist/humain/mcp-adapter/vendor/lifecycle.ts +16 -8
  261. package/dist/humain/mcp-adapter/vendor/mcp-auth-flow.ts +124 -32
  262. package/dist/humain/mcp-adapter/vendor/mcp-bearer-store.ts +0 -2
  263. package/dist/humain/mcp-adapter/vendor/mcp-code.ts +2 -0
  264. package/dist/humain/mcp-adapter/vendor/mcp-oauth-provider.ts +155 -16
  265. package/dist/humain/mcp-adapter/vendor/mcp-output-guard.ts +95 -7
  266. package/dist/humain/mcp-adapter/vendor/mcp-probe.ts +18 -4
  267. package/dist/humain/mcp-adapter/vendor/mcp-references.ts +376 -0
  268. package/dist/humain/mcp-adapter/vendor/mcp-status.ts +8 -19
  269. package/dist/humain/mcp-adapter/vendor/metadata-cache.ts +20 -12
  270. package/dist/humain/mcp-adapter/vendor/namespace-tools.ts +276 -0
  271. package/dist/humain/mcp-adapter/vendor/package.json +26 -8
  272. package/dist/humain/mcp-adapter/vendor/proxy-modes.ts +128 -32
  273. package/dist/humain/mcp-adapter/vendor/request-headers-command.ts +1 -1
  274. package/dist/humain/mcp-adapter/vendor/search-ranking.ts +2 -0
  275. package/dist/humain/mcp-adapter/vendor/server-manager.ts +69 -12
  276. package/dist/humain/mcp-adapter/vendor/state.ts +1 -3
  277. package/dist/humain/mcp-adapter/vendor/tool-result-renderer.ts +16 -2
  278. package/dist/humain/mcp-adapter/vendor/types.ts +51 -2
  279. package/dist/humain/mcp-adapter/vendor/ui-server.ts +3 -19
  280. package/dist/humain/mcp-adapter/vendor/ui-session.ts +2 -1
  281. package/dist/humain/mcp-adapter/vendor/utils.ts +21 -19
  282. package/dist/humain/mcp-adapter.d.ts.map +1 -1
  283. package/dist/humain/mcp-adapter.js +4 -0
  284. package/dist/humain/mcp-adapter.js.map +1 -1
  285. package/dist/humain/web-access/vendor/chrome-cookies.d.ts +14 -0
  286. package/dist/humain/web-access/vendor/chrome-cookies.d.ts.map +1 -1
  287. package/dist/humain/web-access/vendor/chrome-cookies.js +85 -33
  288. package/dist/humain/web-access/vendor/chrome-cookies.js.map +1 -1
  289. package/dist/humain/web-access/vendor/credential-source.d.ts +1 -1
  290. package/dist/humain/web-access/vendor/credential-source.d.ts.map +1 -1
  291. package/dist/humain/web-access/vendor/credential-source.js +3 -1
  292. package/dist/humain/web-access/vendor/credential-source.js.map +1 -1
  293. package/dist/humain/web-access/vendor/curator-page.d.ts +2 -29
  294. package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
  295. package/dist/humain/web-access/vendor/curator-page.js +10 -1
  296. package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
  297. package/dist/humain/web-access/vendor/curator-server.d.ts +2 -29
  298. package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
  299. package/dist/humain/web-access/vendor/curator-server.js +4 -0
  300. package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
  301. package/dist/humain/web-access/vendor/extract.d.ts +11 -0
  302. package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
  303. package/dist/humain/web-access/vendor/extract.js +163 -20
  304. package/dist/humain/web-access/vendor/extract.js.map +1 -1
  305. package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -0
  306. package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
  307. package/dist/humain/web-access/vendor/fetch-params.js +11 -0
  308. package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
  309. package/dist/humain/web-access/vendor/gemini-adc.d.ts +10 -0
  310. package/dist/humain/web-access/vendor/gemini-adc.d.ts.map +1 -0
  311. package/dist/humain/web-access/vendor/gemini-adc.js +268 -0
  312. package/dist/humain/web-access/vendor/gemini-adc.js.map +1 -0
  313. package/dist/humain/web-access/vendor/gemini-api.d.ts +7 -1
  314. package/dist/humain/web-access/vendor/gemini-api.d.ts.map +1 -1
  315. package/dist/humain/web-access/vendor/gemini-api.js +51 -15
  316. package/dist/humain/web-access/vendor/gemini-api.js.map +1 -1
  317. package/dist/humain/web-access/vendor/gemini-search.d.ts +9 -4
  318. package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
  319. package/dist/humain/web-access/vendor/gemini-search.js +63 -21
  320. package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
  321. package/dist/humain/web-access/vendor/gemini-url-context.d.ts.map +1 -1
  322. package/dist/humain/web-access/vendor/gemini-url-context.js +3 -2
  323. package/dist/humain/web-access/vendor/gemini-url-context.js.map +1 -1
  324. package/dist/humain/web-access/vendor/gemini-web-config.d.ts +8 -1
  325. package/dist/humain/web-access/vendor/gemini-web-config.d.ts.map +1 -1
  326. package/dist/humain/web-access/vendor/gemini-web-config.js +49 -4
  327. package/dist/humain/web-access/vendor/gemini-web-config.js.map +1 -1
  328. package/dist/humain/web-access/vendor/gemini-web.d.ts +2 -1
  329. package/dist/humain/web-access/vendor/gemini-web.d.ts.map +1 -1
  330. package/dist/humain/web-access/vendor/gemini-web.js +8 -3
  331. package/dist/humain/web-access/vendor/gemini-web.js.map +1 -1
  332. package/dist/humain/web-access/vendor/github-api.d.ts +1 -1
  333. package/dist/humain/web-access/vendor/github-api.d.ts.map +1 -1
  334. package/dist/humain/web-access/vendor/github-api.js +6 -4
  335. package/dist/humain/web-access/vendor/github-api.js.map +1 -1
  336. package/dist/humain/web-access/vendor/github-extract.d.ts.map +1 -1
  337. package/dist/humain/web-access/vendor/github-extract.js +50 -3
  338. package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
  339. package/dist/humain/web-access/vendor/github-issue-pr.d.ts +27 -0
  340. package/dist/humain/web-access/vendor/github-issue-pr.d.ts.map +1 -0
  341. package/dist/humain/web-access/vendor/github-issue-pr.js +701 -0
  342. package/dist/humain/web-access/vendor/github-issue-pr.js.map +1 -0
  343. package/dist/humain/web-access/vendor/index.d.ts +3 -31
  344. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  345. package/dist/humain/web-access/vendor/index.js +643 -530
  346. package/dist/humain/web-access/vendor/index.js.map +1 -1
  347. package/dist/humain/web-access/vendor/kimi-search.d.ts +5 -0
  348. package/dist/humain/web-access/vendor/kimi-search.d.ts.map +1 -0
  349. package/dist/humain/web-access/vendor/kimi-search.js +228 -0
  350. package/dist/humain/web-access/vendor/kimi-search.js.map +1 -0
  351. package/dist/humain/web-access/vendor/openai-search.d.ts +3 -0
  352. package/dist/humain/web-access/vendor/openai-search.d.ts.map +1 -1
  353. package/dist/humain/web-access/vendor/openai-search.js +89 -16
  354. package/dist/humain/web-access/vendor/openai-search.js.map +1 -1
  355. package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
  356. package/dist/humain/web-access/vendor/page-query.js +56 -8
  357. package/dist/humain/web-access/vendor/page-query.js.map +1 -1
  358. package/dist/humain/web-access/vendor/ssrf-protection.js +6 -1
  359. package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
  360. package/dist/humain/web-access/vendor/utils.d.ts +12 -0
  361. package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
  362. package/dist/humain/web-access/vendor/utils.js +343 -1
  363. package/dist/humain/web-access/vendor/utils.js.map +1 -1
  364. package/dist/humain/web-access/vendor/xcrawl.d.ts +4 -0
  365. package/dist/humain/web-access/vendor/xcrawl.d.ts.map +1 -0
  366. package/dist/humain/web-access/vendor/xcrawl.js +251 -0
  367. package/dist/humain/web-access/vendor/xcrawl.js.map +1 -0
  368. package/dist/humain/web-access/vendor/youtube-extract.js +2 -2
  369. package/dist/humain/web-access/vendor/youtube-extract.js.map +1 -1
  370. package/dist/index.d.ts +6 -5
  371. package/dist/index.d.ts.map +1 -1
  372. package/dist/index.js +5 -4
  373. package/dist/index.js.map +1 -1
  374. package/dist/main.d.ts +3 -0
  375. package/dist/main.d.ts.map +1 -1
  376. package/dist/main.js +19 -14
  377. package/dist/main.js.map +1 -1
  378. package/dist/migrations.d.ts.map +1 -1
  379. package/dist/migrations.js +4 -3
  380. package/dist/migrations.js.map +1 -1
  381. package/dist/modes/interactive/components/model-selector.d.ts +9 -3
  382. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  383. package/dist/modes/interactive/components/model-selector.js +53 -10
  384. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  385. package/dist/modes/interactive/components/settings-selector.d.ts +9 -2
  386. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  387. package/dist/modes/interactive/components/settings-selector.js +128 -55
  388. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  389. package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
  390. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
  391. package/dist/modes/interactive/components/settings-submenu.js +151 -0
  392. package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
  393. package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
  394. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  395. package/dist/modes/interactive/components/thinking-selector.js +68 -17
  396. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  397. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  398. package/dist/modes/interactive/external-editor.js +2 -1
  399. package/dist/modes/interactive/external-editor.js.map +1 -1
  400. package/dist/modes/interactive/interactive-mode.d.ts +15 -0
  401. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  402. package/dist/modes/interactive/interactive-mode.js +224 -130
  403. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  404. package/dist/modes/interactive/session-share.d.ts +16 -0
  405. package/dist/modes/interactive/session-share.d.ts.map +1 -0
  406. package/dist/modes/interactive/session-share.js +188 -0
  407. package/dist/modes/interactive/session-share.js.map +1 -0
  408. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  409. package/dist/modes/interactive/theme/theme.js +6 -5
  410. package/dist/modes/interactive/theme/theme.js.map +1 -1
  411. package/dist/modes/json-event.d.ts +16 -13
  412. package/dist/modes/json-event.d.ts.map +1 -1
  413. package/dist/modes/json-event.js +20 -6
  414. package/dist/modes/json-event.js.map +1 -1
  415. package/dist/modes/rpc/rpc-client.d.ts +7 -0
  416. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  417. package/dist/modes/rpc/rpc-client.js +10 -2
  418. package/dist/modes/rpc/rpc-client.js.map +1 -1
  419. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  420. package/dist/modes/rpc/rpc-mode.js +3 -0
  421. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  422. package/dist/modes/rpc/rpc-types.d.ts +14 -7
  423. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  424. package/dist/modes/rpc/rpc-types.js.map +1 -1
  425. package/dist/package-manager-cli.d.ts +1 -0
  426. package/dist/package-manager-cli.d.ts.map +1 -1
  427. package/dist/package-manager-cli.js +189 -3
  428. package/dist/package-manager-cli.js.map +1 -1
  429. package/dist/utils/changelog.d.ts +1 -1
  430. package/dist/utils/changelog.d.ts.map +1 -1
  431. package/dist/utils/changelog.js +12 -2
  432. package/dist/utils/changelog.js.map +1 -1
  433. package/dist/utils/frontmatter.d.ts.map +1 -1
  434. package/dist/utils/frontmatter.js +2 -1
  435. package/dist/utils/frontmatter.js.map +1 -1
  436. package/dist/utils/management-http.d.ts +5 -3
  437. package/dist/utils/management-http.d.ts.map +1 -1
  438. package/dist/utils/management-http.js +14 -10
  439. package/dist/utils/management-http.js.map +1 -1
  440. package/dist/utils/shell.d.ts +3 -0
  441. package/dist/utils/shell.d.ts.map +1 -1
  442. package/dist/utils/shell.js +23 -9
  443. package/dist/utils/shell.js.map +1 -1
  444. package/dist/utils/syntax-highlight.d.ts +1 -0
  445. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  446. package/dist/utils/syntax-highlight.js +64 -1
  447. package/dist/utils/syntax-highlight.js.map +1 -1
  448. package/dist/utils/text.d.ts +8 -0
  449. package/dist/utils/text.d.ts.map +1 -0
  450. package/dist/utils/text.js +9 -0
  451. package/dist/utils/text.js.map +1 -0
  452. package/dist/utils/version-check.js +4 -4
  453. package/dist/utils/version-check.js.map +1 -1
  454. package/docs/compaction.md +17 -0
  455. package/docs/custom-provider.md +12 -9
  456. package/docs/environment-variables.md +11 -8
  457. package/docs/extensions.md +35 -7
  458. package/docs/json.md +7 -2
  459. package/docs/keybindings.md +9 -9
  460. package/docs/llama-cpp.md +2 -0
  461. package/docs/models.md +8 -2
  462. package/docs/packages.md +2 -2
  463. package/docs/quickstart.md +1 -1
  464. package/docs/rpc.md +32 -3
  465. package/docs/sdk.md +7 -2
  466. package/docs/settings.md +23 -7
  467. package/docs/skills.md +3 -2
  468. package/docs/terminal-setup.md +20 -0
  469. package/docs/usage.md +14 -10
  470. package/docs/windows.md +15 -1
  471. package/examples/extensions/border-status-editor.ts +1 -1
  472. package/examples/extensions/custom-provider-anthropic/package-lock.json +70 -8
  473. package/examples/extensions/custom-provider-anthropic/package.json +2 -2
  474. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  475. package/examples/extensions/git-checkpoint.ts +2 -2
  476. package/examples/extensions/gondolin/package-lock.json +2 -2
  477. package/examples/extensions/gondolin/package.json +1 -1
  478. package/examples/extensions/notify.ts +3 -1
  479. package/examples/extensions/sandbox/package-lock.json +14 -40
  480. package/examples/extensions/sandbox/package.json +2 -2
  481. package/examples/extensions/titlebar-spinner.ts +1 -1
  482. package/examples/extensions/with-deps/package-lock.json +4 -4
  483. package/examples/extensions/with-deps/package.json +1 -1
  484. package/examples/rpc-extension-ui.ts +1 -1
  485. package/examples/sdk/06-extensions.ts +1 -1
  486. package/examples/sdk/README.md +1 -1
  487. package/npm-shrinkwrap.json +293 -221
  488. package/package.json +21 -18
  489. package/src/humain/mcp-adapter/UPSTREAM.md +15 -5
  490. package/src/humain/mcp-adapter/upstream.json +4 -3
  491. package/src/humain/mcp-adapter/vendor/CHANGELOG.md +82 -0
  492. package/src/humain/web-access/UPSTREAM.md +1 -1
  493. package/src/humain/web-access/upstream.json +6 -4
@@ -1,218 +1,2 @@
1
- import { type Static, Type } from "typebox";
2
- export declare const HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION: 1;
3
- export declare const HumainAgentRouteRefSchema: Type.TUnion<[Type.TLiteral<"route:fast">, Type.TLiteral<"route:balanced">, Type.TLiteral<"route:thorough">]>;
4
- export type HumainAgentRouteRef = Static<typeof HumainAgentRouteRefSchema>;
5
- export declare const HumainAgentArtifactSchema: Type.TObject<{
6
- readonly id: Type.TString;
7
- readonly kind: Type.TUnion<[Type.TLiteral<"candidate-patch">, Type.TLiteral<"dependency-output">, Type.TLiteral<"source-observation">, Type.TLiteral<"validation-report">]>;
8
- readonly reference: Type.TString;
9
- readonly digest: Type.TString;
10
- }>;
11
- export type HumainAgentArtifact = Static<typeof HumainAgentArtifactSchema>;
12
- export declare const HumainAgentExecutionControlsSchema: Type.TObject<{
13
- readonly maxConcurrency: Type.TInteger;
14
- readonly maxDepth: Type.TInteger;
15
- readonly depth: Type.TInteger;
16
- readonly timeoutMs: Type.TInteger;
17
- }>;
18
- export type HumainAgentExecutionControls = Static<typeof HumainAgentExecutionControlsSchema>;
19
- export declare const HumainAgentExecutionClaimSchema: Type.TObject<{
20
- readonly workUnitId: Type.TString;
21
- readonly nodeId: Type.TString;
22
- readonly attemptNumber: Type.TInteger;
23
- readonly attemptFence: Type.TInteger;
24
- readonly segmentFence: Type.TInteger;
25
- readonly routeRef: Type.TUnion<[Type.TLiteral<"route:fast">, Type.TLiteral<"route:balanced">, Type.TLiteral<"route:thorough">]>;
26
- readonly task: Type.TString;
27
- readonly controls: Type.TObject<{
28
- readonly maxConcurrency: Type.TInteger;
29
- readonly maxDepth: Type.TInteger;
30
- readonly depth: Type.TInteger;
31
- readonly timeoutMs: Type.TInteger;
32
- }>;
33
- readonly input: Type.TObject<{
34
- readonly artifacts: Type.TArray<Type.TObject<{
35
- readonly id: Type.TString;
36
- readonly kind: Type.TUnion<[Type.TLiteral<"candidate-patch">, Type.TLiteral<"dependency-output">, Type.TLiteral<"source-observation">, Type.TLiteral<"validation-report">]>;
37
- readonly reference: Type.TString;
38
- readonly digest: Type.TString;
39
- }>>;
40
- }>;
41
- }>;
42
- export type HumainAgentExecutionClaim = Static<typeof HumainAgentExecutionClaimSchema>;
43
- export declare const HumainAgentExecutionRequestSchema: Type.TObject<{
44
- readonly schemaVersion: Type.TLiteral<1>;
45
- readonly kind: Type.TLiteral<"execute">;
46
- readonly mode: Type.TUnion<[Type.TLiteral<"node">, Type.TLiteral<"workflow">]>;
47
- readonly invocationId: Type.TString;
48
- readonly batchId: Type.TOptional<Type.TString>;
49
- readonly claims: Type.TArray<Type.TObject<{
50
- readonly workUnitId: Type.TString;
51
- readonly nodeId: Type.TString;
52
- readonly attemptNumber: Type.TInteger;
53
- readonly attemptFence: Type.TInteger;
54
- readonly segmentFence: Type.TInteger;
55
- readonly routeRef: Type.TUnion<[Type.TLiteral<"route:fast">, Type.TLiteral<"route:balanced">, Type.TLiteral<"route:thorough">]>;
56
- readonly task: Type.TString;
57
- readonly controls: Type.TObject<{
58
- readonly maxConcurrency: Type.TInteger;
59
- readonly maxDepth: Type.TInteger;
60
- readonly depth: Type.TInteger;
61
- readonly timeoutMs: Type.TInteger;
62
- }>;
63
- readonly input: Type.TObject<{
64
- readonly artifacts: Type.TArray<Type.TObject<{
65
- readonly id: Type.TString;
66
- readonly kind: Type.TUnion<[Type.TLiteral<"candidate-patch">, Type.TLiteral<"dependency-output">, Type.TLiteral<"source-observation">, Type.TLiteral<"validation-report">]>;
67
- readonly reference: Type.TString;
68
- readonly digest: Type.TString;
69
- }>>;
70
- }>;
71
- }>>;
72
- }>;
73
- export type HumainAgentExecutionRequest = Static<typeof HumainAgentExecutionRequestSchema>;
74
- export declare const HumainAgentUsageSchema: Type.TUnion<[Type.TObject<{
75
- readonly status: Type.TLiteral<"unknown">;
76
- }>, Type.TObject<{
77
- readonly status: Type.TLiteral<"measured">;
78
- readonly totalCalls: Type.TOptional<Type.TInteger>;
79
- readonly totalTurns: Type.TOptional<Type.TInteger>;
80
- readonly totalTokens: Type.TInteger;
81
- readonly costMicrocents: Type.TInteger;
82
- }>]>;
83
- export type HumainAgentUsage = Static<typeof HumainAgentUsageSchema>;
84
- export declare const HUMAIN_AGENT_EXECUTION_FAILURE_CODES: readonly ["adapter_execution_failed", "incompatible_adapter_capability", "invalid_adapter_result", "invalid_execution_request", "provider_timeout", "provider_unavailable", "reused_execution_context", "transport_interrupted"];
85
- export type HumainAgentExecutionFailureCode = (typeof HUMAIN_AGENT_EXECUTION_FAILURE_CODES)[number];
86
- export declare const HumainAgentExecutionOutcomeSchema: Type.TUnion<[Type.TObject<{
87
- readonly workUnitId: Type.TString;
88
- readonly nodeId: Type.TString;
89
- readonly attemptNumber: Type.TInteger;
90
- readonly attemptFence: Type.TInteger;
91
- readonly segmentFence: Type.TInteger;
92
- readonly kind: Type.TLiteral<"succeeded">;
93
- readonly output: Type.TObject<{
94
- readonly summary: Type.TString;
95
- readonly artifacts: Type.TArray<Type.TObject<{
96
- readonly id: Type.TString;
97
- readonly kind: Type.TUnion<[Type.TLiteral<"candidate-patch">, Type.TLiteral<"dependency-output">, Type.TLiteral<"source-observation">, Type.TLiteral<"validation-report">]>;
98
- readonly reference: Type.TString;
99
- readonly digest: Type.TString;
100
- }>>;
101
- }>;
102
- readonly usage: Type.TUnion<[Type.TObject<{
103
- readonly status: Type.TLiteral<"unknown">;
104
- }>, Type.TObject<{
105
- readonly status: Type.TLiteral<"measured">;
106
- readonly totalCalls: Type.TOptional<Type.TInteger>;
107
- readonly totalTurns: Type.TOptional<Type.TInteger>;
108
- readonly totalTokens: Type.TInteger;
109
- readonly costMicrocents: Type.TInteger;
110
- }>]>;
111
- }>, Type.TObject<{
112
- readonly workUnitId: Type.TString;
113
- readonly nodeId: Type.TString;
114
- readonly attemptNumber: Type.TInteger;
115
- readonly attemptFence: Type.TInteger;
116
- readonly segmentFence: Type.TInteger;
117
- readonly kind: Type.TLiteral<"failed">;
118
- readonly failureCode: Type.TUnion<[Type.TLiteral<"adapter_execution_failed">, Type.TLiteral<"incompatible_adapter_capability">, Type.TLiteral<"invalid_adapter_result">, Type.TLiteral<"invalid_execution_request">, Type.TLiteral<"provider_timeout">, Type.TLiteral<"provider_unavailable">, Type.TLiteral<"reused_execution_context">, Type.TLiteral<"transport_interrupted">]>;
119
- readonly usage: Type.TUnion<[Type.TObject<{
120
- readonly status: Type.TLiteral<"unknown">;
121
- }>, Type.TObject<{
122
- readonly status: Type.TLiteral<"measured">;
123
- readonly totalCalls: Type.TOptional<Type.TInteger>;
124
- readonly totalTurns: Type.TOptional<Type.TInteger>;
125
- readonly totalTokens: Type.TInteger;
126
- readonly costMicrocents: Type.TInteger;
127
- }>]>;
128
- }>, Type.TObject<{
129
- readonly workUnitId: Type.TString;
130
- readonly nodeId: Type.TString;
131
- readonly attemptNumber: Type.TInteger;
132
- readonly attemptFence: Type.TInteger;
133
- readonly segmentFence: Type.TInteger;
134
- readonly kind: Type.TLiteral<"cancelled">;
135
- readonly terminationConfirmed: Type.TBoolean;
136
- readonly usage: Type.TUnion<[Type.TObject<{
137
- readonly status: Type.TLiteral<"unknown">;
138
- }>, Type.TObject<{
139
- readonly status: Type.TLiteral<"measured">;
140
- readonly totalCalls: Type.TOptional<Type.TInteger>;
141
- readonly totalTurns: Type.TOptional<Type.TInteger>;
142
- readonly totalTokens: Type.TInteger;
143
- readonly costMicrocents: Type.TInteger;
144
- }>]>;
145
- }>]>;
146
- export type HumainAgentExecutionOutcome = Static<typeof HumainAgentExecutionOutcomeSchema>;
147
- export declare const HumainAgentExecutionResponseSchema: Type.TObject<{
148
- readonly schemaVersion: Type.TLiteral<1>;
149
- readonly kind: Type.TLiteral<"result">;
150
- readonly mode: Type.TUnion<[Type.TLiteral<"node">, Type.TLiteral<"workflow">]>;
151
- readonly invocationId: Type.TString;
152
- readonly batchId: Type.TOptional<Type.TString>;
153
- readonly termination: Type.TUnion<[Type.TLiteral<"not-requested">, Type.TLiteral<"confirmed">, Type.TLiteral<"unconfirmed">]>;
154
- readonly outcomes: Type.TArray<Type.TUnion<[Type.TObject<{
155
- readonly workUnitId: Type.TString;
156
- readonly nodeId: Type.TString;
157
- readonly attemptNumber: Type.TInteger;
158
- readonly attemptFence: Type.TInteger;
159
- readonly segmentFence: Type.TInteger;
160
- readonly kind: Type.TLiteral<"succeeded">;
161
- readonly output: Type.TObject<{
162
- readonly summary: Type.TString;
163
- readonly artifacts: Type.TArray<Type.TObject<{
164
- readonly id: Type.TString;
165
- readonly kind: Type.TUnion<[Type.TLiteral<"candidate-patch">, Type.TLiteral<"dependency-output">, Type.TLiteral<"source-observation">, Type.TLiteral<"validation-report">]>;
166
- readonly reference: Type.TString;
167
- readonly digest: Type.TString;
168
- }>>;
169
- }>;
170
- readonly usage: Type.TUnion<[Type.TObject<{
171
- readonly status: Type.TLiteral<"unknown">;
172
- }>, Type.TObject<{
173
- readonly status: Type.TLiteral<"measured">;
174
- readonly totalCalls: Type.TOptional<Type.TInteger>;
175
- readonly totalTurns: Type.TOptional<Type.TInteger>;
176
- readonly totalTokens: Type.TInteger;
177
- readonly costMicrocents: Type.TInteger;
178
- }>]>;
179
- }>, Type.TObject<{
180
- readonly workUnitId: Type.TString;
181
- readonly nodeId: Type.TString;
182
- readonly attemptNumber: Type.TInteger;
183
- readonly attemptFence: Type.TInteger;
184
- readonly segmentFence: Type.TInteger;
185
- readonly kind: Type.TLiteral<"failed">;
186
- readonly failureCode: Type.TUnion<[Type.TLiteral<"adapter_execution_failed">, Type.TLiteral<"incompatible_adapter_capability">, Type.TLiteral<"invalid_adapter_result">, Type.TLiteral<"invalid_execution_request">, Type.TLiteral<"provider_timeout">, Type.TLiteral<"provider_unavailable">, Type.TLiteral<"reused_execution_context">, Type.TLiteral<"transport_interrupted">]>;
187
- readonly usage: Type.TUnion<[Type.TObject<{
188
- readonly status: Type.TLiteral<"unknown">;
189
- }>, Type.TObject<{
190
- readonly status: Type.TLiteral<"measured">;
191
- readonly totalCalls: Type.TOptional<Type.TInteger>;
192
- readonly totalTurns: Type.TOptional<Type.TInteger>;
193
- readonly totalTokens: Type.TInteger;
194
- readonly costMicrocents: Type.TInteger;
195
- }>]>;
196
- }>, Type.TObject<{
197
- readonly workUnitId: Type.TString;
198
- readonly nodeId: Type.TString;
199
- readonly attemptNumber: Type.TInteger;
200
- readonly attemptFence: Type.TInteger;
201
- readonly segmentFence: Type.TInteger;
202
- readonly kind: Type.TLiteral<"cancelled">;
203
- readonly terminationConfirmed: Type.TBoolean;
204
- readonly usage: Type.TUnion<[Type.TObject<{
205
- readonly status: Type.TLiteral<"unknown">;
206
- }>, Type.TObject<{
207
- readonly status: Type.TLiteral<"measured">;
208
- readonly totalCalls: Type.TOptional<Type.TInteger>;
209
- readonly totalTurns: Type.TOptional<Type.TInteger>;
210
- readonly totalTokens: Type.TInteger;
211
- readonly costMicrocents: Type.TInteger;
212
- }>]>;
213
- }>]>>;
214
- }>;
215
- export type HumainAgentExecutionResponse = Static<typeof HumainAgentExecutionResponseSchema>;
216
- export declare function parseHumainAgentExecutionRequest(input: unknown): HumainAgentExecutionRequest;
217
- export declare function parseHumainAgentExecutionResponse(requestInput: unknown, responseInput: unknown): HumainAgentExecutionResponse;
1
+ export * from "@humain/terminal-contracts";
218
2
  //# sourceMappingURL=agent-execution-protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-execution-protocol.d.ts","sourceRoot":"","sources":["../../src/humain/agent-execution-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,qCAAqC,EAAG,CAAU,CAAC;AAchE,eAAO,MAAM,yBAAyB,8GAIpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE3E,eAAO,MAAM,yBAAyB;;;;;EAUpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE3E,eAAO,MAAM,kCAAkC;;;;;EAK7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE7F,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;EAY1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAEvF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE3F,eAAO,MAAM,sBAAsB;;;;;;;;IASjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAErE,eAAO,MAAM,oCAAoC,YAChD,0BAA0B,EAC1B,iCAAiC,EACjC,wBAAwB,EACxB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,CACd,CAAC;AACX,MAAM,MAAM,+BAA+B,GAAG,CAAC,OAAO,oCAAoC,CAAC,CAAC,MAAM,CAAC,CAAC;AAqBpG,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsB5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE3F,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAK7F,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,GAAG,2BAA2B,CAmB5F;AAED,wBAAgB,iCAAiC,CAChD,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,OAAO,GACpB,4BAA4B,CA2C9B"}
1
+ {"version":3,"file":"agent-execution-protocol.d.ts","sourceRoot":"","sources":["../../src/humain/agent-execution-protocol.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
@@ -1,204 +1,2 @@
1
- import { Type } from "typebox";
2
- import { Compile } from "typebox/compile";
3
- export const HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION = 1;
4
- const StrictObject = (properties) => Type.Object(properties, { additionalProperties: false });
5
- const StableIdentifier = Type.String({ minLength: 1, maxLength: 256 });
6
- const PositiveInteger = Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER });
7
- const NonnegativeInteger = Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });
8
- const Digest = Type.String({ pattern: "^[a-f0-9]{64}$" });
9
- const SafeArtifactReference = Type.String({
10
- minLength: 1,
11
- maxLength: 512,
12
- pattern: "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*$",
13
- });
14
- export const HumainAgentRouteRefSchema = Type.Union([
15
- Type.Literal("route:fast"),
16
- Type.Literal("route:balanced"),
17
- Type.Literal("route:thorough"),
18
- ]);
19
- export const HumainAgentArtifactSchema = StrictObject({
20
- id: StableIdentifier,
21
- kind: Type.Union([
22
- Type.Literal("candidate-patch"),
23
- Type.Literal("dependency-output"),
24
- Type.Literal("source-observation"),
25
- Type.Literal("validation-report"),
26
- ]),
27
- reference: SafeArtifactReference,
28
- digest: Digest,
29
- });
30
- export const HumainAgentExecutionControlsSchema = StrictObject({
31
- maxConcurrency: Type.Integer({ minimum: 1, maximum: 16 }),
32
- maxDepth: Type.Integer({ minimum: 1, maximum: 16 }),
33
- depth: Type.Integer({ minimum: 0, maximum: 16 }),
34
- timeoutMs: Type.Integer({ minimum: 1, maximum: 86_400_000 }),
35
- });
36
- export const HumainAgentExecutionClaimSchema = StrictObject({
37
- workUnitId: StableIdentifier,
38
- nodeId: StableIdentifier,
39
- attemptNumber: PositiveInteger,
40
- attemptFence: PositiveInteger,
41
- segmentFence: PositiveInteger,
42
- routeRef: HumainAgentRouteRefSchema,
43
- task: Type.String({ minLength: 1, maxLength: 100_000 }),
44
- controls: HumainAgentExecutionControlsSchema,
45
- input: StrictObject({
46
- artifacts: Type.Array(HumainAgentArtifactSchema, { maxItems: 16 }),
47
- }),
48
- });
49
- export const HumainAgentExecutionRequestSchema = StrictObject({
50
- schemaVersion: Type.Literal(HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION),
51
- kind: Type.Literal("execute"),
52
- mode: Type.Union([Type.Literal("node"), Type.Literal("workflow")]),
53
- invocationId: StableIdentifier,
54
- batchId: Type.Optional(StableIdentifier),
55
- claims: Type.Array(HumainAgentExecutionClaimSchema, { minItems: 1, maxItems: 8 }),
56
- });
57
- export const HumainAgentUsageSchema = Type.Union([
58
- StrictObject({ status: Type.Literal("unknown") }),
59
- StrictObject({
60
- status: Type.Literal("measured"),
61
- totalCalls: Type.Optional(NonnegativeInteger),
62
- totalTurns: Type.Optional(NonnegativeInteger),
63
- totalTokens: NonnegativeInteger,
64
- costMicrocents: NonnegativeInteger,
65
- }),
66
- ]);
67
- export const HUMAIN_AGENT_EXECUTION_FAILURE_CODES = [
68
- "adapter_execution_failed",
69
- "incompatible_adapter_capability",
70
- "invalid_adapter_result",
71
- "invalid_execution_request",
72
- "provider_timeout",
73
- "provider_unavailable",
74
- "reused_execution_context",
75
- "transport_interrupted",
76
- ];
77
- const HumainAgentExecutionFailureCodeSchema = Type.Union([
78
- Type.Literal("adapter_execution_failed"),
79
- Type.Literal("incompatible_adapter_capability"),
80
- Type.Literal("invalid_adapter_result"),
81
- Type.Literal("invalid_execution_request"),
82
- Type.Literal("provider_timeout"),
83
- Type.Literal("provider_unavailable"),
84
- Type.Literal("reused_execution_context"),
85
- Type.Literal("transport_interrupted"),
86
- ]);
87
- const OutcomeIdentity = {
88
- workUnitId: StableIdentifier,
89
- nodeId: StableIdentifier,
90
- attemptNumber: PositiveInteger,
91
- attemptFence: PositiveInteger,
92
- segmentFence: PositiveInteger,
93
- };
94
- export const HumainAgentExecutionOutcomeSchema = Type.Union([
95
- StrictObject({
96
- ...OutcomeIdentity,
97
- kind: Type.Literal("succeeded"),
98
- output: StrictObject({
99
- summary: Type.String({ minLength: 1, maxLength: 512 }),
100
- artifacts: Type.Array(HumainAgentArtifactSchema, { maxItems: 16 }),
101
- }),
102
- usage: HumainAgentUsageSchema,
103
- }),
104
- StrictObject({
105
- ...OutcomeIdentity,
106
- kind: Type.Literal("failed"),
107
- failureCode: HumainAgentExecutionFailureCodeSchema,
108
- usage: HumainAgentUsageSchema,
109
- }),
110
- StrictObject({
111
- ...OutcomeIdentity,
112
- kind: Type.Literal("cancelled"),
113
- terminationConfirmed: Type.Boolean(),
114
- usage: HumainAgentUsageSchema,
115
- }),
116
- ]);
117
- export const HumainAgentExecutionResponseSchema = StrictObject({
118
- schemaVersion: Type.Literal(HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION),
119
- kind: Type.Literal("result"),
120
- mode: Type.Union([Type.Literal("node"), Type.Literal("workflow")]),
121
- invocationId: StableIdentifier,
122
- batchId: Type.Optional(StableIdentifier),
123
- termination: Type.Union([Type.Literal("not-requested"), Type.Literal("confirmed"), Type.Literal("unconfirmed")]),
124
- outcomes: Type.Array(HumainAgentExecutionOutcomeSchema, { minItems: 1, maxItems: 8 }),
125
- });
126
- const RequestValidator = Compile(HumainAgentExecutionRequestSchema);
127
- const ResponseValidator = Compile(HumainAgentExecutionResponseSchema);
128
- export function parseHumainAgentExecutionRequest(input) {
129
- if (!RequestValidator.Check(input)) {
130
- throw new Error("Invalid HUMAIN agent execution request");
131
- }
132
- if (input.mode === "node" && (input.claims.length !== 1 || input.batchId !== undefined)) {
133
- throw new Error("Invalid HUMAIN agent execution request: node mode requires one claim and no batch identity");
134
- }
135
- if (input.mode === "workflow" && input.batchId === undefined) {
136
- throw new Error("Invalid HUMAIN agent execution request: workflow mode requires a batch identity");
137
- }
138
- const workUnitIds = new Set(input.claims.map(({ workUnitId }) => workUnitId));
139
- const nodeIds = new Set(input.claims.map(({ nodeId }) => nodeId));
140
- if (workUnitIds.size !== input.claims.length || nodeIds.size !== input.claims.length) {
141
- throw new Error("Invalid HUMAIN agent execution request: claim identities must be unique");
142
- }
143
- if (input.claims.some(({ controls }) => controls.depth >= controls.maxDepth)) {
144
- throw new Error("Invalid HUMAIN agent execution request: delegation depth limit is exhausted");
145
- }
146
- return deepFreeze(structuredClone(input));
147
- }
148
- export function parseHumainAgentExecutionResponse(requestInput, responseInput) {
149
- const request = parseHumainAgentExecutionRequest(requestInput);
150
- if (!ResponseValidator.Check(responseInput)) {
151
- throw new Error("Invalid HUMAIN agent execution response");
152
- }
153
- const response = responseInput;
154
- if (response.outcomes.some((outcome) => outcome.kind === "succeeded" && !isSafeSummary(outcome.output.summary))) {
155
- throw new Error("Invalid HUMAIN agent execution response");
156
- }
157
- if (response.mode !== request.mode ||
158
- response.invocationId !== request.invocationId ||
159
- response.batchId !== request.batchId) {
160
- throw new Error("HUMAIN agent result envelope mismatch");
161
- }
162
- if (response.outcomes.length !== request.claims.length) {
163
- throw new Error("HUMAIN agent result cardinality mismatch");
164
- }
165
- for (const [index, outcome] of response.outcomes.entries()) {
166
- const claim = request.claims[index];
167
- if (!claim ||
168
- outcome.workUnitId !== claim.workUnitId ||
169
- outcome.nodeId !== claim.nodeId ||
170
- outcome.attemptNumber !== claim.attemptNumber ||
171
- outcome.attemptFence !== claim.attemptFence ||
172
- outcome.segmentFence !== claim.segmentFence) {
173
- throw new Error("HUMAIN agent result identity mismatch");
174
- }
175
- }
176
- const cancelled = response.outcomes.filter((outcome) => outcome.kind === "cancelled");
177
- const expectedTermination = cancelled.length === 0
178
- ? "not-requested"
179
- : cancelled.every((outcome) => outcome.terminationConfirmed)
180
- ? "confirmed"
181
- : "unconfirmed";
182
- if (response.termination !== expectedTermination) {
183
- throw new Error("HUMAIN agent result termination evidence mismatch");
184
- }
185
- return deepFreeze(structuredClone(response));
186
- }
187
- function isSafeSummary(value) {
188
- return (value === value.trim() &&
189
- /^[\p{L}\p{N}][\p{L}\p{N} .,;:!?()&'-]*$/u.test(value) &&
190
- !/\b(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}(?::\d{1,5})?\b/u.test(value) &&
191
- !/\b(?:\d{1,3}\.){3}\d{1,3}(?::\d{1,5})?\b/u.test(value) &&
192
- !/^(?:rm|curl|wget|sh|bash|zsh|fish|pwsh|powershell|cmd|node|bun|deno|npx|npm|pnpm|yarn|python(?:3)?|perl|ruby|git|docker|kubectl|ssh|scp|sudo|cat|ls|cd|mkdir|touch|chmod|chown|env|export|set|eval|exec)\b/iu.test(value) &&
193
- !/\b(?:api[- ]?key|secret|token|credential|password)\s*:/iu.test(value) &&
194
- !/\b(?:claude|gpt|gemini|llama|mistral)[-_:][A-Za-z0-9._:-]+\b/iu.test(value));
195
- }
196
- function deepFreeze(value) {
197
- if (value === null || typeof value !== "object" || Object.isFrozen(value))
198
- return value;
199
- Object.freeze(value);
200
- for (const child of Object.values(value))
201
- deepFreeze(child);
202
- return value;
203
- }
1
+ export * from "@humain/terminal-contracts";
204
2
  //# sourceMappingURL=agent-execution-protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-execution-protocol.js","sourceRoot":"","sources":["../../src/humain/agent-execution-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAU,CAAC;AAEhE,MAAM,YAAY,GAAG,CAAoD,UAAa,EAAE,EAAE,CACzF,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1D,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;AACvE,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;AACvF,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC1F,MAAM,MAAM,GAAG,IAAI,C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,CAAC;QACxD,CAAC,8MAA8M,CAAC,IAAI,CACnN,KAAK,CACL;QACD,CAAC,0DAA0D,CAAC,IAAI,CAAC,KAAK,CAAC;QACvE,CAAC,gEAAgE,CAAC,IAAI,CAAC,KAAK,CAAC,CAC7E,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAI,KAAQ;IAC9B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACxF,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { type Static, Type } from \"typebox\";\nimport { Compile } from \"typebox/compile\";\n\nexport const HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION = 1 as const;\n\nconst StrictObject = <const T extends Parameters<typeof Type.Object>[0]>(properties: T) =>\n\tType.Object(properties, { additionalProperties: false });\nconst StableIdentifier = Type.String({ minLength: 1, maxLength: 256 });\nconst PositiveInteger = Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER });\nconst NonnegativeInteger = Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });\nconst Digest = Type.String({ pattern: \"^[a-f0-9]{64}$\" });\nconst SafeArtifactReference = Type.String({\n\tminLength: 1,\n\tmaxLength: 512,\n\tpattern: \"^(?!/)(?!.*(?:^|/)\\\\.\\\\.(?:/|$))[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*$\",\n});\n\nexport const HumainAgentRouteRefSchema = Type.Union([\n\tType.Literal(\"route:fast\"),\n\tType.Literal(\"route:balanced\"),\n\tType.Literal(\"route:thorough\"),\n]);\nexport type HumainAgentRouteRef = Static<typeof HumainAgentRouteRefSchema>;\n\nexport const HumainAgentArtifactSchema = StrictObject({\n\tid: StableIdentifier,\n\tkind: Type.Union([\n\t\tType.Literal(\"candidate-patch\"),\n\t\tType.Literal(\"dependency-output\"),\n\t\tType.Literal(\"source-observation\"),\n\t\tType.Literal(\"validation-report\"),\n\t]),\n\treference: SafeArtifactReference,\n\tdigest: Digest,\n});\nexport type HumainAgentArtifact = Static<typeof HumainAgentArtifactSchema>;\n\nexport const HumainAgentExecutionControlsSchema = StrictObject({\n\tmaxConcurrency: Type.Integer({ minimum: 1, maximum: 16 }),\n\tmaxDepth: Type.Integer({ minimum: 1, maximum: 16 }),\n\tdepth: Type.Integer({ minimum: 0, maximum: 16 }),\n\ttimeoutMs: Type.Integer({ minimum: 1, maximum: 86_400_000 }),\n});\nexport type HumainAgentExecutionControls = Static<typeof HumainAgentExecutionControlsSchema>;\n\nexport const HumainAgentExecutionClaimSchema = StrictObject({\n\tworkUnitId: StableIdentifier,\n\tnodeId: StableIdentifier,\n\tattemptNumber: PositiveInteger,\n\tattemptFence: PositiveInteger,\n\tsegmentFence: PositiveInteger,\n\trouteRef: HumainAgentRouteRefSchema,\n\ttask: Type.String({ minLength: 1, maxLength: 100_000 }),\n\tcontrols: HumainAgentExecutionControlsSchema,\n\tinput: StrictObject({\n\t\tartifacts: Type.Array(HumainAgentArtifactSchema, { maxItems: 16 }),\n\t}),\n});\nexport type HumainAgentExecutionClaim = Static<typeof HumainAgentExecutionClaimSchema>;\n\nexport const HumainAgentExecutionRequestSchema = StrictObject({\n\tschemaVersion: Type.Literal(HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION),\n\tkind: Type.Literal(\"execute\"),\n\tmode: Type.Union([Type.Literal(\"node\"), Type.Literal(\"workflow\")]),\n\tinvocationId: StableIdentifier,\n\tbatchId: Type.Optional(StableIdentifier),\n\tclaims: Type.Array(HumainAgentExecutionClaimSchema, { minItems: 1, maxItems: 8 }),\n});\nexport type HumainAgentExecutionRequest = Static<typeof HumainAgentExecutionRequestSchema>;\n\nexport const HumainAgentUsageSchema = Type.Union([\n\tStrictObject({ status: Type.Literal(\"unknown\") }),\n\tStrictObject({\n\t\tstatus: Type.Literal(\"measured\"),\n\t\ttotalCalls: Type.Optional(NonnegativeInteger),\n\t\ttotalTurns: Type.Optional(NonnegativeInteger),\n\t\ttotalTokens: NonnegativeInteger,\n\t\tcostMicrocents: NonnegativeInteger,\n\t}),\n]);\nexport type HumainAgentUsage = Static<typeof HumainAgentUsageSchema>;\n\nexport const HUMAIN_AGENT_EXECUTION_FAILURE_CODES = [\n\t\"adapter_execution_failed\",\n\t\"incompatible_adapter_capability\",\n\t\"invalid_adapter_result\",\n\t\"invalid_execution_request\",\n\t\"provider_timeout\",\n\t\"provider_unavailable\",\n\t\"reused_execution_context\",\n\t\"transport_interrupted\",\n] as const;\nexport type HumainAgentExecutionFailureCode = (typeof HUMAIN_AGENT_EXECUTION_FAILURE_CODES)[number];\n\nconst HumainAgentExecutionFailureCodeSchema = Type.Union([\n\tType.Literal(\"adapter_execution_failed\"),\n\tType.Literal(\"incompatible_adapter_capability\"),\n\tType.Literal(\"invalid_adapter_result\"),\n\tType.Literal(\"invalid_execution_request\"),\n\tType.Literal(\"provider_timeout\"),\n\tType.Literal(\"provider_unavailable\"),\n\tType.Literal(\"reused_execution_context\"),\n\tType.Literal(\"transport_interrupted\"),\n]);\n\nconst OutcomeIdentity = {\n\tworkUnitId: StableIdentifier,\n\tnodeId: StableIdentifier,\n\tattemptNumber: PositiveInteger,\n\tattemptFence: PositiveInteger,\n\tsegmentFence: PositiveInteger,\n};\n\nexport const HumainAgentExecutionOutcomeSchema = Type.Union([\n\tStrictObject({\n\t\t...OutcomeIdentity,\n\t\tkind: Type.Literal(\"succeeded\"),\n\t\toutput: StrictObject({\n\t\t\tsummary: Type.String({ minLength: 1, maxLength: 512 }),\n\t\t\tartifacts: Type.Array(HumainAgentArtifactSchema, { maxItems: 16 }),\n\t\t}),\n\t\tusage: HumainAgentUsageSchema,\n\t}),\n\tStrictObject({\n\t\t...OutcomeIdentity,\n\t\tkind: Type.Literal(\"failed\"),\n\t\tfailureCode: HumainAgentExecutionFailureCodeSchema,\n\t\tusage: HumainAgentUsageSchema,\n\t}),\n\tStrictObject({\n\t\t...OutcomeIdentity,\n\t\tkind: Type.Literal(\"cancelled\"),\n\t\tterminationConfirmed: Type.Boolean(),\n\t\tusage: HumainAgentUsageSchema,\n\t}),\n]);\nexport type HumainAgentExecutionOutcome = Static<typeof HumainAgentExecutionOutcomeSchema>;\n\nexport const HumainAgentExecutionResponseSchema = StrictObject({\n\tschemaVersion: Type.Literal(HUMAIN_AGENT_EXECUTION_SCHEMA_VERSION),\n\tkind: Type.Literal(\"result\"),\n\tmode: Type.Union([Type.Literal(\"node\"), Type.Literal(\"workflow\")]),\n\tinvocationId: StableIdentifier,\n\tbatchId: Type.Optional(StableIdentifier),\n\ttermination: Type.Union([Type.Literal(\"not-requested\"), Type.Literal(\"confirmed\"), Type.Literal(\"unconfirmed\")]),\n\toutcomes: Type.Array(HumainAgentExecutionOutcomeSchema, { minItems: 1, maxItems: 8 }),\n});\nexport type HumainAgentExecutionResponse = Static<typeof HumainAgentExecutionResponseSchema>;\n\nconst RequestValidator = Compile(HumainAgentExecutionRequestSchema);\nconst ResponseValidator = Compile(HumainAgentExecutionResponseSchema);\n\nexport function parseHumainAgentExecutionRequest(input: unknown): HumainAgentExecutionRequest {\n\tif (!RequestValidator.Check(input)) {\n\t\tthrow new Error(\"Invalid HUMAIN agent execution request\");\n\t}\n\tif (input.mode === \"node\" && (input.claims.length !== 1 || input.batchId !== undefined)) {\n\t\tthrow new Error(\"Invalid HUMAIN agent execution request: node mode requires one claim and no batch identity\");\n\t}\n\tif (input.mode === \"workflow\" && input.batchId === undefined) {\n\t\tthrow new Error(\"Invalid HUMAIN agent execution request: workflow mode requires a batch identity\");\n\t}\n\tconst workUnitIds = new Set(input.claims.map(({ workUnitId }) => workUnitId));\n\tconst nodeIds = new Set(input.claims.map(({ nodeId }) => nodeId));\n\tif (workUnitIds.size !== input.claims.length || nodeIds.size !== input.claims.length) {\n\t\tthrow new Error(\"Invalid HUMAIN agent execution request: claim identities must be unique\");\n\t}\n\tif (input.claims.some(({ controls }) => controls.depth >= controls.maxDepth)) {\n\t\tthrow new Error(\"Invalid HUMAIN agent execution request: delegation depth limit is exhausted\");\n\t}\n\treturn deepFreeze(structuredClone(input));\n}\n\nexport function parseHumainAgentExecutionResponse(\n\trequestInput: unknown,\n\tresponseInput: unknown,\n): HumainAgentExecutionResponse {\n\tconst request = parseHumainAgentExecutionRequest(requestInput);\n\tif (!ResponseValidator.Check(responseInput)) {\n\t\tthrow new Error(\"Invalid HUMAIN agent execution response\");\n\t}\n\tconst response = responseInput;\n\tif (response.outcomes.some((outcome) => outcome.kind === \"succeeded\" && !isSafeSummary(outcome.output.summary))) {\n\t\tthrow new Error(\"Invalid HUMAIN agent execution response\");\n\t}\n\tif (\n\t\tresponse.mode !== request.mode ||\n\t\tresponse.invocationId !== request.invocationId ||\n\t\tresponse.batchId !== request.batchId\n\t) {\n\t\tthrow new Error(\"HUMAIN agent result envelope mismatch\");\n\t}\n\tif (response.outcomes.length !== request.claims.length) {\n\t\tthrow new Error(\"HUMAIN agent result cardinality mismatch\");\n\t}\n\tfor (const [index, outcome] of response.outcomes.entries()) {\n\t\tconst claim = request.claims[index];\n\t\tif (\n\t\t\t!claim ||\n\t\t\toutcome.workUnitId !== claim.workUnitId ||\n\t\t\toutcome.nodeId !== claim.nodeId ||\n\t\t\toutcome.attemptNumber !== claim.attemptNumber ||\n\t\t\toutcome.attemptFence !== claim.attemptFence ||\n\t\t\toutcome.segmentFence !== claim.segmentFence\n\t\t) {\n\t\t\tthrow new Error(\"HUMAIN agent result identity mismatch\");\n\t\t}\n\t}\n\tconst cancelled = response.outcomes.filter((outcome) => outcome.kind === \"cancelled\");\n\tconst expectedTermination =\n\t\tcancelled.length === 0\n\t\t\t? \"not-requested\"\n\t\t\t: cancelled.every((outcome) => outcome.terminationConfirmed)\n\t\t\t\t? \"confirmed\"\n\t\t\t\t: \"unconfirmed\";\n\tif (response.termination !== expectedTermination) {\n\t\tthrow new Error(\"HUMAIN agent result termination evidence mismatch\");\n\t}\n\treturn deepFreeze(structuredClone(response));\n}\n\nfunction isSafeSummary(value: string): boolean {\n\treturn (\n\t\tvalue === value.trim() &&\n\t\t/^[\\p{L}\\p{N}][\\p{L}\\p{N} .,;:!?()&'-]*$/u.test(value) &&\n\t\t!/\\b(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}(?::\\d{1,5})?\\b/u.test(value) &&\n\t\t!/\\b(?:\\d{1,3}\\.){3}\\d{1,3}(?::\\d{1,5})?\\b/u.test(value) &&\n\t\t!/^(?:rm|curl|wget|sh|bash|zsh|fish|pwsh|powershell|cmd|node|bun|deno|npx|npm|pnpm|yarn|python(?:3)?|perl|ruby|git|docker|kubectl|ssh|scp|sudo|cat|ls|cd|mkdir|touch|chmod|chown|env|export|set|eval|exec)\\b/iu.test(\n\t\t\tvalue,\n\t\t) &&\n\t\t!/\\b(?:api[- ]?key|secret|token|credential|password)\\s*:/iu.test(value) &&\n\t\t!/\\b(?:claude|gpt|gemini|llama|mistral)[-_:][A-Za-z0-9._:-]+\\b/iu.test(value)\n\t);\n}\n\nfunction deepFreeze<T>(value: T): T {\n\tif (value === null || typeof value !== \"object\" || Object.isFrozen(value)) return value;\n\tObject.freeze(value);\n\tfor (const child of Object.values(value)) deepFreeze(child);\n\treturn value;\n}\n"]}
1
+ {"version":3,"file":"agent-execution-protocol.js","sourceRoot":"","sources":["../../src/humain/agent-execution-protocol.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from \"@humain/terminal-contracts\";\n"]}