@humain/humain-code 0.5.4 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (694) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/dist/bundle/agent-monitor.js +1 -1
  3. package/dist/bundle/chunks/anthropic-messages-FGFIMZUF.js +66 -0
  4. package/dist/bundle/chunks/azure-openai-responses-6JNTC7KO.js +15 -0
  5. package/dist/bundle/chunks/bedrock-converse-stream.js +261 -237
  6. package/dist/bundle/chunks/chunk-2H3LUS62.js +1966 -0
  7. package/dist/bundle/chunks/{chunk-GEISZXXH.js → chunk-4ZBGTJJM.js} +1 -1
  8. package/dist/bundle/chunks/{chunk-QWXPGBAG.js → chunk-5JSLXC2A.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-L2VKM23Q.js → chunk-6DE7LJKV.js} +21 -21
  10. package/dist/bundle/chunks/{chunk-V62QBESW.js → chunk-6E6RHNOU.js} +11 -10
  11. package/dist/bundle/chunks/chunk-7RZ5BS7U.js +2 -0
  12. package/dist/bundle/chunks/chunk-AHSNQWZU.js +24 -0
  13. package/dist/bundle/chunks/{chunk-UJLCKIMZ.js → chunk-AOH2O5CP.js} +3469 -3133
  14. package/dist/bundle/chunks/{chunk-ODJUBJK2.js → chunk-B7NJMF7B.js} +11 -11
  15. package/dist/bundle/chunks/chunk-BQ3TMEWD.js +7 -0
  16. package/dist/bundle/chunks/{chunk-KKCMWB63.js → chunk-C6VERWRZ.js} +1 -1
  17. package/dist/bundle/chunks/{chunk-CN3Q5UNB.js → chunk-CFHOPLW5.js} +658 -574
  18. package/dist/bundle/chunks/chunk-CVC2GV26.js +1986 -0
  19. package/dist/bundle/chunks/{chunk-DU6POZ7E.js → chunk-DHW3REC5.js} +1 -1
  20. package/dist/bundle/chunks/{chunk-UTNHGOFS.js → chunk-EDONIPUJ.js} +38 -38
  21. package/dist/bundle/chunks/{chunk-FO2NYB6O.js → chunk-FDGW5ZTG.js} +1147 -1110
  22. package/dist/bundle/chunks/{chunk-XQX7S3GM.js → chunk-GICL5V54.js} +1 -1
  23. package/dist/bundle/chunks/chunk-H7Y4QY7K.js +11 -0
  24. package/dist/bundle/chunks/chunk-HW6HMUXS.js +188 -0
  25. package/dist/bundle/chunks/chunk-I6AQOITY.js +53 -0
  26. package/dist/bundle/chunks/{chunk-ZI7TK7HM.js → chunk-IADQJFNH.js} +21 -17
  27. package/dist/bundle/chunks/chunk-J7AP2BUJ.js +3 -0
  28. package/dist/bundle/chunks/chunk-JFE52VSN.js +120 -0
  29. package/dist/bundle/chunks/{chunk-MIJHJNNQ.js → chunk-LDGCU6PD.js} +127 -3
  30. package/dist/bundle/chunks/{chunk-PS7DGA7B.js → chunk-M4CHQBAI.js} +1 -1
  31. package/dist/bundle/chunks/{chunk-YDBNMIA3.js → chunk-NN53K2QQ.js} +19 -1
  32. package/dist/bundle/chunks/{chunk-RTXDU3AA.js → chunk-ONR6Q3II.js} +255 -195
  33. package/dist/bundle/chunks/{chunk-Y3OPKKDR.js → chunk-P4P7OZ7R.js} +34 -32
  34. package/dist/bundle/chunks/{chunk-OZNC2W4B.js → chunk-PCTLFSQG.js} +444 -411
  35. package/dist/bundle/chunks/{chunk-YFBDR4IW.js → chunk-PNGNZXOI.js} +3 -3
  36. package/dist/bundle/chunks/{chunk-UDB6NI4G.js → chunk-RGUZULEE.js} +593 -481
  37. package/dist/bundle/chunks/chunk-RO5YPAJH.js +23 -0
  38. package/dist/bundle/chunks/{chunk-A6B2QMA7.js → chunk-RU7ADKA7.js} +176 -162
  39. package/dist/bundle/chunks/{chunk-JCXXRCP6.js → chunk-T3KDZFM4.js} +16 -16
  40. package/dist/bundle/chunks/{chunk-HT5YN3LX.js → chunk-TEOMXMW6.js} +3 -3
  41. package/dist/bundle/chunks/{chunk-HIZWUSPN.js → chunk-VEGJT52D.js} +77 -77
  42. package/dist/bundle/chunks/{chunk-IDU5BNNI.js → chunk-XMZGB3H4.js} +12 -3
  43. package/dist/bundle/chunks/chunk-YEPHPMQC.js +647 -0
  44. package/dist/bundle/chunks/{chunk-XA7CJAYH.js → chunk-YRUIJ5AH.js} +48 -42
  45. package/dist/bundle/chunks/{cli-ENEFJH2B.js → cli-BNCWK54K.js} +21 -17
  46. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-T7TPP7SQ.js → cloudflare-workers-ai-system-one-KI6W3USX.js} +1 -1
  47. package/dist/bundle/chunks/codemode-worker.js +81 -75
  48. package/dist/bundle/chunks/compat-I5VPOXFT.js +13 -0
  49. package/dist/bundle/chunks/dist-J5IUPLMH.js +37 -0
  50. package/dist/bundle/chunks/{dist-RKNCFFGM.js → dist-SKBR3C7C.js} +720 -696
  51. package/dist/bundle/chunks/dist-TVRQXUY6.js +8 -0
  52. package/dist/bundle/chunks/{dist-cjs-HTASUQXQ.js → dist-cjs-2SKN226B.js} +77 -77
  53. package/dist/bundle/chunks/{easter-egg-3d-YOPLCOVW.js → easter-egg-3d-673VRP6Y.js} +1 -1
  54. package/dist/bundle/chunks/{esm-R6HJ4QEG.js → esm-WPALMLUO.js} +3 -3
  55. package/dist/bundle/chunks/{event-streams-BR2IL6C5.js → event-streams-7YGFEPBZ.js} +1 -1
  56. package/dist/bundle/chunks/{execute-2JXEKQ2X.js → execute-PIUR5MUV.js} +23 -23
  57. package/dist/bundle/chunks/{extract-OTCGZGTL.js → extract-4O5Z5725.js} +74 -71
  58. package/dist/bundle/chunks/github-copilot.js +50 -51
  59. package/dist/bundle/chunks/google-generative-ai-635YZEHN.js +22 -0
  60. package/dist/bundle/chunks/google-vertex-I3ZJ3SB2.js +26 -0
  61. package/dist/bundle/chunks/host-OQOEIWHK.js +2 -0
  62. package/dist/bundle/chunks/image-resize-worker.js +3 -2
  63. package/dist/bundle/chunks/kimi-coding.js +13 -14
  64. package/dist/bundle/chunks/{llama-cpp-classify-B3G57LVR.js → llama-cpp-classify-PP63BYDF.js} +1 -1
  65. package/dist/bundle/chunks/meta.js +10 -10
  66. package/dist/bundle/chunks/mistral-conversations-OKG5GKXR.js +42 -0
  67. package/dist/bundle/chunks/{node-VSA4ZN7D.js → node-UGQUSQE6.js} +1 -1
  68. package/dist/bundle/chunks/{node-SJPZTR4K.js → node-UNHECG4X.js} +168 -157
  69. package/dist/bundle/chunks/openai-codex-responses-6JYZIFT4.js +100 -0
  70. package/dist/bundle/chunks/openai-completions-YBNI6CAP.js +82 -0
  71. package/dist/bundle/chunks/{openai-decisions-WOWUC65P.js → openai-decisions-5G5YBFRQ.js} +1 -1
  72. package/dist/bundle/chunks/openai-responses-C3APJ6MK.js +27 -0
  73. package/dist/bundle/chunks/{openrouter-images-5K47HDAT.js → openrouter-images-FCJT7C7I.js} +2 -2
  74. package/dist/bundle/chunks/{pdfjs-EK6K7CXX.js → pdfjs-AKD6EBKN.js} +196 -175
  75. package/dist/bundle/chunks/pdfjs-decoders-OFXX4HDZ.js +2 -0
  76. package/dist/bundle/chunks/pdfjs-jbig2-TXR26KRI.js +278 -0
  77. package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-FH3KJM4H.js +326 -0
  78. package/dist/bundle/chunks/pdfjs-openjpeg-SKR7C34X.js +671 -0
  79. package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-VUBL7UEE.js +974 -0
  80. package/dist/bundle/chunks/pi-messages-UHYZYEOC.js +25 -0
  81. package/dist/bundle/chunks/radius.js +8 -8
  82. package/dist/bundle/chunks/{runtime-K3F2QDQP.js → runtime-KE3HDSRT.js} +1 -1
  83. package/dist/bundle/chunks/{turndown.cjs-U7XOXH4O.js → turndown.cjs-WKGZX7NZ.js} +1 -1
  84. package/dist/bundle/chunks/{typesafe-system-one-43OCHGKP.js → typesafe-system-one-VYVAMWQV.js} +1 -1
  85. package/dist/bundle/chunks/{undici-EK3EUI2E.js → undici-C6S56CGI.js} +1 -1
  86. package/dist/bundle/chunks/virtual-modules-KDUZIB3W.js +23 -0
  87. package/dist/bundle/cli-runtime.js +3 -3
  88. package/dist/bundle/flow/package.json +5 -5
  89. package/dist/bundle/index.js +10 -10
  90. package/dist/bundle/rpc-entry.js +3 -3
  91. package/dist/cli/args.d.ts.map +1 -1
  92. package/dist/cli/args.js +9 -8
  93. package/dist/cli/args.js.map +1 -1
  94. package/dist/config.d.ts +12 -0
  95. package/dist/config.d.ts.map +1 -1
  96. package/dist/config.js +29 -5
  97. package/dist/config.js.map +1 -1
  98. package/dist/coordination/adapter/tool.d.ts +8 -5
  99. package/dist/coordination/adapter/tool.d.ts.map +1 -1
  100. package/dist/coordination/adapter/tool.js +32 -6
  101. package/dist/coordination/adapter/tool.js.map +1 -1
  102. package/dist/coordination/client/client.d.ts.map +1 -1
  103. package/dist/coordination/client/client.js +19 -1
  104. package/dist/coordination/client/client.js.map +1 -1
  105. package/dist/core/agent-session-runtime.js +3 -3
  106. package/dist/core/agent-session-runtime.js.map +1 -1
  107. package/dist/core/agent-session.d.ts +23 -3
  108. package/dist/core/agent-session.d.ts.map +1 -1
  109. package/dist/core/agent-session.js +142 -39
  110. package/dist/core/agent-session.js.map +1 -1
  111. package/dist/core/anthropic-subscription-usage.d.ts +4 -0
  112. package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
  113. package/dist/core/anthropic-subscription-usage.js +71 -1
  114. package/dist/core/anthropic-subscription-usage.js.map +1 -1
  115. package/dist/core/bug-report.d.ts +4 -4
  116. package/dist/core/codex-reset.d.ts +45 -0
  117. package/dist/core/codex-reset.d.ts.map +1 -0
  118. package/dist/core/codex-reset.js +190 -0
  119. package/dist/core/codex-reset.js.map +1 -0
  120. package/dist/core/codex-usage.d.ts +4 -2
  121. package/dist/core/codex-usage.d.ts.map +1 -1
  122. package/dist/core/codex-usage.js +9 -4
  123. package/dist/core/codex-usage.js.map +1 -1
  124. package/dist/core/compaction/branch-summarization.d.ts +3 -1
  125. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  126. package/dist/core/compaction/branch-summarization.js +25 -10
  127. package/dist/core/compaction/branch-summarization.js.map +1 -1
  128. package/dist/core/compaction/compaction.d.ts +37 -3
  129. package/dist/core/compaction/compaction.d.ts.map +1 -1
  130. package/dist/core/compaction/compaction.js +274 -65
  131. package/dist/core/compaction/compaction.js.map +1 -1
  132. package/dist/core/compaction/utils.d.ts +19 -6
  133. package/dist/core/compaction/utils.d.ts.map +1 -1
  134. package/dist/core/compaction/utils.js +49 -11
  135. package/dist/core/compaction/utils.js.map +1 -1
  136. package/dist/core/exec.d.ts +9 -1
  137. package/dist/core/exec.d.ts.map +1 -1
  138. package/dist/core/exec.js +105 -61
  139. package/dist/core/exec.js.map +1 -1
  140. package/dist/core/export-html/template.css +9 -0
  141. package/dist/core/export-html/template.html +2 -0
  142. package/dist/core/export-html/template.js +200 -62
  143. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  144. package/dist/core/export-html/tool-renderer.js +3 -0
  145. package/dist/core/export-html/tool-renderer.js.map +1 -1
  146. package/dist/core/extensions/index.d.ts +1 -1
  147. package/dist/core/extensions/index.d.ts.map +1 -1
  148. package/dist/core/extensions/index.js.map +1 -1
  149. package/dist/core/extensions/loader.d.ts.map +1 -1
  150. package/dist/core/extensions/loader.js +7 -6
  151. package/dist/core/extensions/loader.js.map +1 -1
  152. package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
  153. package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
  154. package/dist/core/extensions/pi-ai-extension-view.js +22 -0
  155. package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
  156. package/dist/core/extensions/types.d.ts +27 -4
  157. package/dist/core/extensions/types.d.ts.map +1 -1
  158. package/dist/core/extensions/types.js.map +1 -1
  159. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  160. package/dist/core/extensions/virtual-modules.js +8 -7
  161. package/dist/core/extensions/virtual-modules.js.map +1 -1
  162. package/dist/core/http-dispatcher.d.ts +7 -0
  163. package/dist/core/http-dispatcher.d.ts.map +1 -1
  164. package/dist/core/http-dispatcher.js +107 -0
  165. package/dist/core/http-dispatcher.js.map +1 -1
  166. package/dist/core/keybindings.d.ts +56 -0
  167. package/dist/core/keybindings.d.ts.map +1 -1
  168. package/dist/core/keybindings.js +14 -2
  169. package/dist/core/keybindings.js.map +1 -1
  170. package/dist/core/mcp-servers.d.ts +9 -4
  171. package/dist/core/mcp-servers.d.ts.map +1 -1
  172. package/dist/core/mcp-servers.js +15 -5
  173. package/dist/core/mcp-servers.js.map +1 -1
  174. package/dist/core/model-config.d.ts +1691 -2042
  175. package/dist/core/model-config.d.ts.map +1 -1
  176. package/dist/core/model-config.js +2 -3
  177. package/dist/core/model-config.js.map +1 -1
  178. package/dist/core/model-registry.d.ts +35 -4
  179. package/dist/core/model-registry.d.ts.map +1 -1
  180. package/dist/core/model-registry.js +70 -8
  181. package/dist/core/model-registry.js.map +1 -1
  182. package/dist/core/model-resolver.d.ts.map +1 -1
  183. package/dist/core/model-resolver.js +16 -10
  184. package/dist/core/model-resolver.js.map +1 -1
  185. package/dist/core/model-runtime.d.ts.map +1 -1
  186. package/dist/core/model-runtime.js +21 -17
  187. package/dist/core/model-runtime.js.map +1 -1
  188. package/dist/core/package-manager.d.ts +29 -0
  189. package/dist/core/package-manager.d.ts.map +1 -1
  190. package/dist/core/package-manager.js +311 -60
  191. package/dist/core/package-manager.js.map +1 -1
  192. package/dist/core/pi-ai-schemas.d.ts +164 -0
  193. package/dist/core/pi-ai-schemas.d.ts.map +1 -0
  194. package/dist/core/pi-ai-schemas.js +21 -0
  195. package/dist/core/pi-ai-schemas.js.map +1 -0
  196. package/dist/core/pi-manifest.d.ts +1 -0
  197. package/dist/core/pi-manifest.d.ts.map +1 -1
  198. package/dist/core/pi-manifest.js +4 -0
  199. package/dist/core/pi-manifest.js.map +1 -1
  200. package/dist/core/project-trust.js +1 -1
  201. package/dist/core/project-trust.js.map +1 -1
  202. package/dist/core/resource-loader.d.ts +4 -1
  203. package/dist/core/resource-loader.d.ts.map +1 -1
  204. package/dist/core/resource-loader.js +38 -23
  205. package/dist/core/resource-loader.js.map +1 -1
  206. package/dist/core/sdk.d.ts.map +1 -1
  207. package/dist/core/sdk.js +4 -1
  208. package/dist/core/sdk.js.map +1 -1
  209. package/dist/core/session-manager.d.ts +7 -0
  210. package/dist/core/session-manager.d.ts.map +1 -1
  211. package/dist/core/session-manager.js +66 -26
  212. package/dist/core/session-manager.js.map +1 -1
  213. package/dist/core/settings-defaults.d.ts +2 -0
  214. package/dist/core/settings-defaults.d.ts.map +1 -1
  215. package/dist/core/settings-defaults.js +2 -0
  216. package/dist/core/settings-defaults.js.map +1 -1
  217. package/dist/core/settings-manager.d.ts +19 -8
  218. package/dist/core/settings-manager.d.ts.map +1 -1
  219. package/dist/core/settings-manager.js +70 -16
  220. package/dist/core/settings-manager.js.map +1 -1
  221. package/dist/core/settings-schema.d.ts +15 -2
  222. package/dist/core/settings-schema.d.ts.map +1 -1
  223. package/dist/core/settings-schema.js +37 -3
  224. package/dist/core/settings-schema.js.map +1 -1
  225. package/dist/core/skills.d.ts.map +1 -1
  226. package/dist/core/skills.js +6 -14
  227. package/dist/core/skills.js.map +1 -1
  228. package/dist/core/slash-commands.js +2 -2
  229. package/dist/core/slash-commands.js.map +1 -1
  230. package/dist/core/source-info.d.ts +9 -0
  231. package/dist/core/source-info.d.ts.map +1 -1
  232. package/dist/core/source-info.js +13 -0
  233. package/dist/core/source-info.js.map +1 -1
  234. package/dist/core/subscription-credits.d.ts +14 -0
  235. package/dist/core/subscription-credits.d.ts.map +1 -0
  236. package/dist/core/subscription-credits.js +10 -0
  237. package/dist/core/subscription-credits.js.map +1 -0
  238. package/dist/core/subscription-reset-status.d.ts +10 -0
  239. package/dist/core/subscription-reset-status.d.ts.map +1 -0
  240. package/dist/core/subscription-reset-status.js +2 -0
  241. package/dist/core/subscription-reset-status.js.map +1 -0
  242. package/dist/core/system-prompt.d.ts.map +1 -1
  243. package/dist/core/system-prompt.js +5 -6
  244. package/dist/core/system-prompt.js.map +1 -1
  245. package/dist/core/tools/bash.d.ts +2 -2
  246. package/dist/core/tools/bash.d.ts.map +1 -1
  247. package/dist/core/tools/bash.js.map +1 -1
  248. package/dist/core/tools/edit.d.ts +3 -3
  249. package/dist/core/tools/edit.d.ts.map +1 -1
  250. package/dist/core/tools/edit.js +2 -4
  251. package/dist/core/tools/edit.js.map +1 -1
  252. package/dist/core/tools/find.d.ts +2 -2
  253. package/dist/core/tools/find.d.ts.map +1 -1
  254. package/dist/core/tools/find.js.map +1 -1
  255. package/dist/core/tools/grep.d.ts +2 -2
  256. package/dist/core/tools/grep.d.ts.map +1 -1
  257. package/dist/core/tools/grep.js +7 -3
  258. package/dist/core/tools/grep.js.map +1 -1
  259. package/dist/core/tools/ls.d.ts +2 -2
  260. package/dist/core/tools/ls.d.ts.map +1 -1
  261. package/dist/core/tools/ls.js.map +1 -1
  262. package/dist/core/tools/read.d.ts +2 -2
  263. package/dist/core/tools/read.d.ts.map +1 -1
  264. package/dist/core/tools/read.js.map +1 -1
  265. package/dist/core/tools/render-utils.d.ts +4 -0
  266. package/dist/core/tools/render-utils.d.ts.map +1 -1
  267. package/dist/core/tools/render-utils.js +42 -12
  268. package/dist/core/tools/render-utils.js.map +1 -1
  269. package/dist/core/tools/renderers/edit.d.ts.map +1 -1
  270. package/dist/core/tools/renderers/edit.js +3 -3
  271. package/dist/core/tools/renderers/edit.js.map +1 -1
  272. package/dist/core/tools/renderers/write.d.ts.map +1 -1
  273. package/dist/core/tools/renderers/write.js +37 -29
  274. package/dist/core/tools/renderers/write.js.map +1 -1
  275. package/dist/core/tools/subagent.d.ts +9 -8
  276. package/dist/core/tools/subagent.d.ts.map +1 -1
  277. package/dist/core/tools/subagent.js +8 -5
  278. package/dist/core/tools/subagent.js.map +1 -1
  279. package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
  280. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  281. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  282. package/dist/core/tools/write.d.ts +2 -2
  283. package/dist/core/tools/write.d.ts.map +1 -1
  284. package/dist/core/tools/write.js.map +1 -1
  285. package/dist/core/trust-manager.d.ts.map +1 -1
  286. package/dist/core/trust-manager.js +14 -8
  287. package/dist/core/trust-manager.js.map +1 -1
  288. package/dist/core/usage-totals.d.ts.map +1 -1
  289. package/dist/core/usage-totals.js +2 -0
  290. package/dist/core/usage-totals.js.map +1 -1
  291. package/dist/extensions/codemode/renderer.d.ts.map +1 -1
  292. package/dist/extensions/codemode/renderer.js +17 -9
  293. package/dist/extensions/codemode/renderer.js.map +1 -1
  294. package/dist/extensions/codemode/tool.d.ts +2 -1
  295. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  296. package/dist/extensions/codemode/tool.js +33 -8
  297. package/dist/extensions/codemode/tool.js.map +1 -1
  298. package/dist/extensions/llama/ui.d.ts.map +1 -1
  299. package/dist/extensions/llama/ui.js +16 -4
  300. package/dist/extensions/llama/ui.js.map +1 -1
  301. package/dist/extensions/mcp/cli.d.ts.map +1 -1
  302. package/dist/extensions/mcp/cli.js +34 -8
  303. package/dist/extensions/mcp/cli.js.map +1 -1
  304. package/dist/extensions/mcp/index.js +4 -3
  305. package/dist/extensions/mcp/index.js.map +1 -1
  306. package/dist/extensions/mcp/oauth.d.ts +1 -1
  307. package/dist/extensions/mcp/oauth.d.ts.map +1 -1
  308. package/dist/extensions/mcp/oauth.js +7 -3
  309. package/dist/extensions/mcp/oauth.js.map +1 -1
  310. package/dist/extensions/mcp/ui.d.ts +1 -0
  311. package/dist/extensions/mcp/ui.d.ts.map +1 -1
  312. package/dist/extensions/mcp/ui.js +56 -28
  313. package/dist/extensions/mcp/ui.js.map +1 -1
  314. package/dist/extensions/tool-search/tool.d.ts +21 -6
  315. package/dist/extensions/tool-search/tool.d.ts.map +1 -1
  316. package/dist/extensions/tool-search/tool.js +104 -36
  317. package/dist/extensions/tool-search/tool.js.map +1 -1
  318. package/dist/extensions/usage/confirmation.d.ts +40 -0
  319. package/dist/extensions/usage/confirmation.d.ts.map +1 -0
  320. package/dist/extensions/usage/confirmation.js +198 -0
  321. package/dist/extensions/usage/confirmation.js.map +1 -0
  322. package/dist/extensions/usage/index.d.ts +4 -4
  323. package/dist/extensions/usage/index.d.ts.map +1 -1
  324. package/dist/extensions/usage/index.js +352 -33
  325. package/dist/extensions/usage/index.js.map +1 -1
  326. package/dist/extensions/usage/overview.d.ts +8 -1
  327. package/dist/extensions/usage/overview.d.ts.map +1 -1
  328. package/dist/extensions/usage/overview.js +54 -11
  329. package/dist/extensions/usage/overview.js.map +1 -1
  330. package/dist/extensions/usage/popup.d.ts +37 -6
  331. package/dist/extensions/usage/popup.d.ts.map +1 -1
  332. package/dist/extensions/usage/popup.js +396 -45
  333. package/dist/extensions/usage/popup.js.map +1 -1
  334. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +564 -130
  335. package/dist/humain/node-provider.d.ts.map +1 -1
  336. package/dist/humain/node-provider.js +1 -0
  337. package/dist/humain/node-provider.js.map +1 -1
  338. package/dist/humain/web-access/host.d.ts +2 -1
  339. package/dist/humain/web-access/host.d.ts.map +1 -1
  340. package/dist/humain/web-access/host.js +1 -1
  341. package/dist/humain/web-access/host.js.map +1 -1
  342. package/dist/humain/web-access/vendor/brave-rate-limit.d.ts +2 -0
  343. package/dist/humain/web-access/vendor/brave-rate-limit.d.ts.map +1 -1
  344. package/dist/humain/web-access/vendor/brave-rate-limit.js +2 -2
  345. package/dist/humain/web-access/vendor/brave-rate-limit.js.map +1 -1
  346. package/dist/humain/web-access/vendor/cloudflare-search.d.ts +5 -0
  347. package/dist/humain/web-access/vendor/cloudflare-search.d.ts.map +1 -0
  348. package/dist/humain/web-access/vendor/cloudflare-search.js +230 -0
  349. package/dist/humain/web-access/vendor/cloudflare-search.js.map +1 -0
  350. package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
  351. package/dist/humain/web-access/vendor/curator-page.js +18 -1
  352. package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
  353. package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
  354. package/dist/humain/web-access/vendor/curator-server.js +12 -0
  355. package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
  356. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts +33 -0
  357. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts.map +1 -0
  358. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js +84 -0
  359. package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js.map +1 -0
  360. package/dist/humain/web-access/vendor/duckduckgo.d.ts +3 -0
  361. package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
  362. package/dist/humain/web-access/vendor/duckduckgo.js +54 -49
  363. package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
  364. package/dist/humain/web-access/vendor/exa.d.ts +8 -3
  365. package/dist/humain/web-access/vendor/exa.d.ts.map +1 -1
  366. package/dist/humain/web-access/vendor/exa.js +129 -14
  367. package/dist/humain/web-access/vendor/exa.js.map +1 -1
  368. package/dist/humain/web-access/vendor/extract.d.ts +1 -1
  369. package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
  370. package/dist/humain/web-access/vendor/extract.js +68 -10
  371. package/dist/humain/web-access/vendor/extract.js.map +1 -1
  372. package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -1
  373. package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
  374. package/dist/humain/web-access/vendor/fetch-params.js +2 -2
  375. package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
  376. package/dist/humain/web-access/vendor/field-extract.d.ts +38 -0
  377. package/dist/humain/web-access/vendor/field-extract.d.ts.map +1 -0
  378. package/dist/humain/web-access/vendor/field-extract.js +350 -0
  379. package/dist/humain/web-access/vendor/field-extract.js.map +1 -0
  380. package/dist/humain/web-access/vendor/gemini-search.d.ts +15 -4
  381. package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
  382. package/dist/humain/web-access/vendor/gemini-search.js +198 -16
  383. package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
  384. package/dist/humain/web-access/vendor/github-api.js +1 -1
  385. package/dist/humain/web-access/vendor/github-api.js.map +1 -1
  386. package/dist/humain/web-access/vendor/github-extract.d.ts.map +1 -1
  387. package/dist/humain/web-access/vendor/github-extract.js +3 -2
  388. package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
  389. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  390. package/dist/humain/web-access/vendor/index.js +137 -118
  391. package/dist/humain/web-access/vendor/index.js.map +1 -1
  392. package/dist/humain/web-access/vendor/mistral-search.js +1 -1
  393. package/dist/humain/web-access/vendor/mistral-search.js.map +1 -1
  394. package/dist/humain/web-access/vendor/ninerouter.d.ts +4 -0
  395. package/dist/humain/web-access/vendor/ninerouter.d.ts.map +1 -0
  396. package/dist/humain/web-access/vendor/ninerouter.js +110 -0
  397. package/dist/humain/web-access/vendor/ninerouter.js.map +1 -0
  398. package/dist/humain/web-access/vendor/offtopic-judge.d.ts +27 -0
  399. package/dist/humain/web-access/vendor/offtopic-judge.d.ts.map +1 -0
  400. package/dist/humain/web-access/vendor/offtopic-judge.js +61 -0
  401. package/dist/humain/web-access/vendor/offtopic-judge.js.map +1 -0
  402. package/dist/humain/web-access/vendor/openai-search.d.ts +1 -1
  403. package/dist/humain/web-access/vendor/openai-search.d.ts.map +1 -1
  404. package/dist/humain/web-access/vendor/openai-search.js +39 -13
  405. package/dist/humain/web-access/vendor/openai-search.js.map +1 -1
  406. package/dist/humain/web-access/vendor/outcrawl.d.ts +4 -0
  407. package/dist/humain/web-access/vendor/outcrawl.d.ts.map +1 -0
  408. package/dist/humain/web-access/vendor/outcrawl.js +196 -0
  409. package/dist/humain/web-access/vendor/outcrawl.js.map +1 -0
  410. package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
  411. package/dist/humain/web-access/vendor/page-query.js +13 -3
  412. package/dist/humain/web-access/vendor/page-query.js.map +1 -1
  413. package/dist/humain/web-access/vendor/pdf-extract.d.ts +1 -3
  414. package/dist/humain/web-access/vendor/pdf-extract.d.ts.map +1 -1
  415. package/dist/humain/web-access/vendor/pdf-extract.js +0 -2
  416. package/dist/humain/web-access/vendor/pdf-extract.js.map +1 -1
  417. package/dist/humain/web-access/vendor/perplexity.d.ts +3 -0
  418. package/dist/humain/web-access/vendor/perplexity.d.ts.map +1 -1
  419. package/dist/humain/web-access/vendor/perplexity.js.map +1 -1
  420. package/dist/humain/web-access/vendor/query-rewrite.d.ts +2 -2
  421. package/dist/humain/web-access/vendor/query-rewrite.d.ts.map +1 -1
  422. package/dist/humain/web-access/vendor/query-rewrite.js +39 -13
  423. package/dist/humain/web-access/vendor/query-rewrite.js.map +1 -1
  424. package/dist/humain/web-access/vendor/searchapi.d.ts +4 -0
  425. package/dist/humain/web-access/vendor/searchapi.d.ts.map +1 -0
  426. package/dist/humain/web-access/vendor/searchapi.js +195 -0
  427. package/dist/humain/web-access/vendor/searchapi.js.map +1 -0
  428. package/dist/humain/web-access/vendor/sofya.d.ts +4 -0
  429. package/dist/humain/web-access/vendor/sofya.d.ts.map +1 -0
  430. package/dist/humain/web-access/vendor/sofya.js +193 -0
  431. package/dist/humain/web-access/vendor/sofya.js.map +1 -0
  432. package/dist/humain/web-access/vendor/source-check.d.ts +5 -1
  433. package/dist/humain/web-access/vendor/source-check.d.ts.map +1 -1
  434. package/dist/humain/web-access/vendor/source-check.js +34 -16
  435. package/dist/humain/web-access/vendor/source-check.js.map +1 -1
  436. package/dist/humain/web-access/vendor/ssrf-protection.d.ts +7 -0
  437. package/dist/humain/web-access/vendor/ssrf-protection.d.ts.map +1 -1
  438. package/dist/humain/web-access/vendor/ssrf-protection.js +24 -1
  439. package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
  440. package/dist/humain/web-access/vendor/summary-model-scope.d.ts +8 -3
  441. package/dist/humain/web-access/vendor/summary-model-scope.d.ts.map +1 -1
  442. package/dist/humain/web-access/vendor/summary-model-scope.js +15 -1
  443. package/dist/humain/web-access/vendor/summary-model-scope.js.map +1 -1
  444. package/dist/humain/web-access/vendor/summary-review.d.ts +7 -2
  445. package/dist/humain/web-access/vendor/summary-review.d.ts.map +1 -1
  446. package/dist/humain/web-access/vendor/summary-review.js +32 -28
  447. package/dist/humain/web-access/vendor/summary-review.js.map +1 -1
  448. package/dist/humain/web-access/vendor/tabstack.d.ts +6 -0
  449. package/dist/humain/web-access/vendor/tabstack.d.ts.map +1 -0
  450. package/dist/humain/web-access/vendor/tabstack.js +236 -0
  451. package/dist/humain/web-access/vendor/tabstack.js.map +1 -0
  452. package/dist/humain/web-access/vendor/tool-arguments.js +1 -1
  453. package/dist/humain/web-access/vendor/tool-arguments.js.map +1 -1
  454. package/dist/humain/web-access/vendor/upgrade-notice.d.ts +8 -0
  455. package/dist/humain/web-access/vendor/upgrade-notice.d.ts.map +1 -0
  456. package/dist/humain/web-access/vendor/upgrade-notice.js +46 -0
  457. package/dist/humain/web-access/vendor/upgrade-notice.js.map +1 -0
  458. package/dist/humain/web-access/vendor/utils.d.ts +9 -0
  459. package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
  460. package/dist/humain/web-access/vendor/utils.js +113 -27
  461. package/dist/humain/web-access/vendor/utils.js.map +1 -1
  462. package/dist/humain/web-access/vendor/web-tool-contract.d.ts +4 -0
  463. package/dist/humain/web-access/vendor/web-tool-contract.d.ts.map +1 -1
  464. package/dist/humain/web-access/vendor/web-tool-contract.js.map +1 -1
  465. package/dist/humain/web-access/vendor/web-tool-core.d.ts +17 -1
  466. package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
  467. package/dist/humain/web-access/vendor/web-tool-core.js +99 -22
  468. package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
  469. package/dist/humain/web-access/vendor/xai-search.d.ts +1 -1
  470. package/dist/humain/web-access/vendor/xai-search.d.ts.map +1 -1
  471. package/dist/humain/web-access/vendor/xai-search.js +6 -5
  472. package/dist/humain/web-access/vendor/xai-search.js.map +1 -1
  473. package/dist/index.d.ts +3 -3
  474. package/dist/index.d.ts.map +1 -1
  475. package/dist/index.js.map +1 -1
  476. package/dist/main.d.ts.map +1 -1
  477. package/dist/main.js +20 -9
  478. package/dist/main.js.map +1 -1
  479. package/dist/modes/interactive/components/assistant-code-block.d.ts +34 -0
  480. package/dist/modes/interactive/components/assistant-code-block.d.ts.map +1 -0
  481. package/dist/modes/interactive/components/assistant-code-block.js +160 -0
  482. package/dist/modes/interactive/components/assistant-code-block.js.map +1 -0
  483. package/dist/modes/interactive/components/assistant-message.d.ts +31 -10
  484. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  485. package/dist/modes/interactive/components/assistant-message.js +276 -73
  486. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  487. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  488. package/dist/modes/interactive/components/compaction-summary-message.js +2 -1
  489. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  490. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  491. package/dist/modes/interactive/components/config-selector.js +4 -17
  492. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  493. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  494. package/dist/modes/interactive/components/custom-editor.js +7 -0
  495. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  496. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  497. package/dist/modes/interactive/components/custom-entry.js +2 -1
  498. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  499. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  500. package/dist/modes/interactive/components/custom-message.js +2 -1
  501. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  502. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  503. package/dist/modes/interactive/components/diff.js +3 -1
  504. package/dist/modes/interactive/components/diff.js.map +1 -1
  505. package/dist/modes/interactive/components/extension-editor.d.ts +2 -0
  506. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  507. package/dist/modes/interactive/components/extension-editor.js +4 -0
  508. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  509. package/dist/modes/interactive/components/footer.d.ts +4 -1
  510. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  511. package/dist/modes/interactive/components/footer.js +6 -5
  512. package/dist/modes/interactive/components/footer.js.map +1 -1
  513. package/dist/modes/interactive/components/login-dialog.d.ts +5 -0
  514. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  515. package/dist/modes/interactive/components/login-dialog.js +107 -11
  516. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  517. package/dist/modes/interactive/components/markdown-transform.d.ts +2 -1
  518. package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
  519. package/dist/modes/interactive/components/markdown-transform.js +3 -2
  520. package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
  521. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  522. package/dist/modes/interactive/components/mermaid.js +18 -6
  523. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  524. package/dist/modes/interactive/components/model-selector.d.ts +1 -0
  525. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/model-selector.js +17 -6
  527. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  528. package/dist/modes/interactive/components/oauth-selector.d.ts +1 -0
  529. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  530. package/dist/modes/interactive/components/oauth-selector.js +13 -4
  531. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  532. package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -0
  533. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/scoped-models-selector.js +14 -3
  535. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  536. package/dist/modes/interactive/components/session-selector-search.d.ts +4 -0
  537. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  538. package/dist/modes/interactive/components/session-selector-search.js +86 -22
  539. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  540. package/dist/modes/interactive/components/session-selector.d.ts +2 -1
  541. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  542. package/dist/modes/interactive/components/session-selector.js +16 -24
  543. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  544. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  545. package/dist/modes/interactive/components/settings-submenu.js +2 -0
  546. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  547. package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
  548. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  549. package/dist/modes/interactive/components/tool-execution.js +15 -5
  550. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  551. package/dist/modes/interactive/components/tree-selector.d.ts +1 -0
  552. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  553. package/dist/modes/interactive/components/tree-selector.js +5 -6
  554. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  555. package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
  556. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  557. package/dist/modes/interactive/components/user-message-selector.js +9 -1
  558. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  559. package/dist/modes/interactive/components/user-message.d.ts +4 -3
  560. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  561. package/dist/modes/interactive/components/user-message.js +20 -18
  562. package/dist/modes/interactive/components/user-message.js.map +1 -1
  563. package/dist/modes/interactive/external-editor.d.ts +1 -0
  564. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  565. package/dist/modes/interactive/external-editor.js +16 -4
  566. package/dist/modes/interactive/external-editor.js.map +1 -1
  567. package/dist/modes/interactive/interactive-mode.d.ts +6 -0
  568. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  569. package/dist/modes/interactive/interactive-mode.js +259 -83
  570. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  571. package/dist/modes/interactive/model-search.d.ts +10 -0
  572. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  573. package/dist/modes/interactive/model-search.js +21 -0
  574. package/dist/modes/interactive/model-search.js.map +1 -1
  575. package/dist/modes/interactive/oauth-account-format.d.ts +10 -1
  576. package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
  577. package/dist/modes/interactive/oauth-account-format.js +42 -0
  578. package/dist/modes/interactive/oauth-account-format.js.map +1 -1
  579. package/dist/modes/interactive/theme/theme.d.ts +10 -0
  580. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  581. package/dist/modes/interactive/theme/theme.js +28 -24
  582. package/dist/modes/interactive/theme/theme.js.map +1 -1
  583. package/dist/modes/print-mode.d.ts.map +1 -1
  584. package/dist/modes/print-mode.js +3 -2
  585. package/dist/modes/print-mode.js.map +1 -1
  586. package/dist/package-manager-cli.d.ts.map +1 -1
  587. package/dist/package-manager-cli.js +55 -4
  588. package/dist/package-manager-cli.js.map +1 -1
  589. package/dist/utils/ansi.d.ts.map +1 -1
  590. package/dist/utils/ansi.js +5 -2
  591. package/dist/utils/ansi.js.map +1 -1
  592. package/dist/utils/clipboard-command.d.ts.map +1 -1
  593. package/dist/utils/clipboard-command.js +4 -0
  594. package/dist/utils/clipboard-command.js.map +1 -1
  595. package/dist/utils/clipboard-image.d.ts +8 -0
  596. package/dist/utils/clipboard-image.d.ts.map +1 -1
  597. package/dist/utils/clipboard-image.js +31 -1
  598. package/dist/utils/clipboard-image.js.map +1 -1
  599. package/dist/utils/git.d.ts +1 -1
  600. package/dist/utils/git.d.ts.map +1 -1
  601. package/dist/utils/git.js.map +1 -1
  602. package/dist/utils/image-resize-core.d.ts.map +1 -1
  603. package/dist/utils/image-resize-core.js +5 -3
  604. package/dist/utils/image-resize-core.js.map +1 -1
  605. package/dist/utils/open-browser.d.ts.map +1 -1
  606. package/dist/utils/open-browser.js +96 -6
  607. package/dist/utils/open-browser.js.map +1 -1
  608. package/dist/utils/paths.d.ts +17 -0
  609. package/dist/utils/paths.d.ts.map +1 -1
  610. package/dist/utils/paths.js +42 -1
  611. package/dist/utils/paths.js.map +1 -1
  612. package/dist/utils/shell.d.ts +2 -1
  613. package/dist/utils/shell.d.ts.map +1 -1
  614. package/dist/utils/shell.js +12 -2
  615. package/dist/utils/shell.js.map +1 -1
  616. package/dist/utils/syntax-highlight.d.ts +5 -0
  617. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  618. package/dist/utils/syntax-highlight.js +156 -11
  619. package/dist/utils/syntax-highlight.js.map +1 -1
  620. package/dist/utils/tools-manager.d.ts.map +1 -1
  621. package/dist/utils/tools-manager.js +30 -35
  622. package/dist/utils/tools-manager.js.map +1 -1
  623. package/docs/cli.md +22 -12
  624. package/docs/compaction.md +32 -8
  625. package/docs/coordination.md +2 -0
  626. package/docs/custom-provider.md +4 -2
  627. package/docs/environment-variables.md +2 -0
  628. package/docs/extensions.md +3169 -229
  629. package/docs/flow.md +2 -0
  630. package/docs/keybindings.md +24 -2
  631. package/docs/llama-cpp.md +30 -19
  632. package/docs/mcp.md +4 -2
  633. package/docs/message-types.md +7 -7
  634. package/docs/packages.md +27 -1
  635. package/docs/sessions.md +11 -3
  636. package/docs/settings.md +21 -9
  637. package/docs/slash-commands.md +51 -11
  638. package/docs/terminal-setup.md +3 -1
  639. package/docs/tmux.md +6 -0
  640. package/docs/tui.md +3 -1
  641. package/docs/windows.md +27 -0
  642. package/examples/extensions/README.md +2 -1
  643. package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
  644. package/examples/extensions/custom-provider-anthropic/package-lock.json +7 -7
  645. package/examples/extensions/custom-provider-anthropic/package.json +2 -2
  646. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  647. package/examples/extensions/debug-provider.ts +2 -2
  648. package/examples/extensions/gondolin/package-lock.json +14 -24
  649. package/examples/extensions/gondolin/package.json +2 -2
  650. package/examples/extensions/preset.ts +2 -0
  651. package/examples/extensions/reload-runtime.ts +17 -5
  652. package/examples/extensions/todo.ts +7 -0
  653. package/examples/extensions/tools.ts +2 -0
  654. package/examples/extensions/with-deps/package-lock.json +2 -2
  655. package/examples/extensions/with-deps/package.json +1 -1
  656. package/examples/tsconfig.json +252 -0
  657. package/npm-shrinkwrap.json +289 -277
  658. package/package.json +29 -29
  659. package/schemas/keybindings.schema.json +28 -0
  660. package/schemas/models.schema.json +36 -36
  661. package/schemas/settings.schema.json +49 -0
  662. package/src/humain/ponytail/UPSTREAM.md +16 -2
  663. package/src/humain/ponytail/upstream.json +4 -4
  664. package/src/humain/web-access/UPSTREAM.md +48 -1
  665. package/src/humain/web-access/upstream.json +9 -6
  666. package/src/humain/web-access/vendor/CHANGELOG.md +1223 -0
  667. package/dist/bundle/chunks/anthropic-messages-ZP5KUK52.js +0 -67
  668. package/dist/bundle/chunks/azure-openai-responses-QJFYQ3DF.js +0 -15
  669. package/dist/bundle/chunks/chunk-2GCMACT4.js +0 -1956
  670. package/dist/bundle/chunks/chunk-AO6FF5JL.js +0 -21
  671. package/dist/bundle/chunks/chunk-EY3LZOUP.js +0 -1963
  672. package/dist/bundle/chunks/chunk-M74U5X4S.js +0 -119
  673. package/dist/bundle/chunks/chunk-N7CQ3UV3.js +0 -80
  674. package/dist/bundle/chunks/chunk-OR25QDSS.js +0 -365
  675. package/dist/bundle/chunks/chunk-PH7UP57J.js +0 -6
  676. package/dist/bundle/chunks/chunk-QW6PTCAB.js +0 -10
  677. package/dist/bundle/chunks/chunk-ROZV2IYD.js +0 -125
  678. package/dist/bundle/chunks/chunk-YFOLLX5D.js +0 -23
  679. package/dist/bundle/chunks/chunk-ZR4GF4WU.js +0 -54
  680. package/dist/bundle/chunks/compat-CJBWWYHE.js +0 -13
  681. package/dist/bundle/chunks/dist-IBUWEKEE.js +0 -24
  682. package/dist/bundle/chunks/dist-YFMJEHPH.js +0 -8
  683. package/dist/bundle/chunks/google-generative-ai-HVPCGIZ6.js +0 -21
  684. package/dist/bundle/chunks/google-vertex-UM5MAALA.js +0 -25
  685. package/dist/bundle/chunks/host-ZHEL5XQW.js +0 -2
  686. package/dist/bundle/chunks/mistral-conversations-AH72RLXK.js +0 -44
  687. package/dist/bundle/chunks/openai-codex-responses-L366637C.js +0 -98
  688. package/dist/bundle/chunks/openai-completions-ZP62QXJX.js +0 -83
  689. package/dist/bundle/chunks/openai-responses-DXUGSUTN.js +0 -26
  690. package/dist/bundle/chunks/pi-messages-MOQQDZBK.js +0 -23
  691. package/dist/bundle/chunks/virtual-modules-5D6QIJPN.js +0 -5
  692. package/examples/extensions/sandbox/index.ts +0 -321
  693. package/examples/extensions/sandbox/package-lock.json +0 -66
  694. package/examples/extensions/sandbox/package.json +0 -19
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{APIError,Stream}from"./chunk-OZNC2W4B.js";import{createSseDecoder,decodeSseText}from"./chunk-YZMQXAJM.js";function isAbortError(error){return typeof error=="object"&&error!==null&&("name"in error&&error.name==="AbortError"||"message"in error&&String(error.message).includes("FetchRequestCanceledException"))}var LOG_LEVELS={off:0,error:200,warn:300,info:400,debug:500};function logError(client,message){if(!client){console.error(message);return}let level=LOG_LEVELS[client.logLevel??"off"];client.logger&&level!==void 0&&level>=LOG_LEVELS.error&&client.logger.error(message)}async function*iterateOpenAISseMessages(body,signal){
2
+ import{APIError,Stream}from"./chunk-PCTLFSQG.js";import{createSseDecoder,decodeSseText}from"./chunk-YZMQXAJM.js";function isAbortError(error){return typeof error=="object"&&error!==null&&("name"in error&&error.name==="AbortError"||"message"in error&&String(error.message).includes("FetchRequestCanceledException"))}var LOG_LEVELS={off:0,error:200,warn:300,info:400,debug:500};function logError(client,message){if(!client){console.error(message);return}let level=LOG_LEVELS[client.logLevel??"off"];client.logger&&level!==void 0&&level>=LOG_LEVELS.error&&client.logger.error(message)}async function*iterateOpenAISseMessages(body,signal){
3
3
  let reader=body.getReader(),decoder=new TextDecoder("utf-8",{ignoreBOM:!0}),state=createSseDecoder({stripLineBom:!0}),closed=!1,failed=!1,cancellation,cancel=()=>(closed||cancellation||(cancellation=reader.cancel(),cancellation.catch(()=>{})),cancellation),onAbort=()=>queueMicrotask(()=>{cancel()});signal.addEventListener("abort",onAbort,{once:!0}),signal.aborted&&onAbort();try{for(;;){if(signal.aborted)return;let result;try{result=await reader.read()}catch(error){if(signal.aborted&&(isAbortError(
4
4
  error)||error===signal.reason))return;throw error}if(signal.aborted)return;if(result.done){closed=!0;break}for(let event of decodeSseText(state,decoder.decode(result.value,{stream:!0}),!1)){if(signal.aborted)return;yield event}}for(let event of decodeSseText(state,decoder.decode(),!0)){if(signal.aborted)return;yield event}}catch(error){if(failed=!0,!signal.aborted||!isAbortError(error)&&error!==signal.reason)throw error}finally{if(signal.removeEventListener("abort",onAbort),!closed){let pending=cancel();
5
5
  pending&&!failed&&!signal.aborted&&await pending}reader.releaseLock()}}function parseEventData(data,client){try{return JSON.parse(data)}catch{throw logError(client,"Could not parse message into JSON:"),logError(client,"From chunk:"),new SyntaxError("Error reading response: malformed server-sent event JSON.")}}async function*iterateOpenAIStream(stream,response,client){if(!(stream instanceof Stream)||!response.body){yield*stream;return}let controller=stream.controller,done=!1,receivedCompletionSentinel=!1,
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{uuidv7}from"./chunk-IDU5BNNI.js";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 noop=async()=>{};function createRequestObserver(options,info){let onRequest=options?.onRequest;if(!onRequest)return noop;let requestId=uuidv7(),submissionNumber=0;return async(body,overrides)=>{submissionNumber++;let value=Object.freeze({requestId,submissionId:uuidv7(),submissionNumber,api:info.api,provider:info.provider,model:info.model,operation:overrides?.operation??info.operation,transport:overrides?.transport??"http",representation:overrides?.representation??"json-body",body});try{await onRequest(
2
+ import{uuidv7}from"./chunk-XMZGB3H4.js";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 noop=async()=>{};function createRequestObserver(options,info){let onRequest=options?.onRequest;if(!onRequest)return noop;let requestId=uuidv7(),submissionNumber=0;return async(body,overrides)=>{submissionNumber++;let value=Object.freeze({requestId,submissionId:uuidv7(),submissionNumber,api:info.api,provider:info.provider,model:info.model,operation:overrides?.operation??info.operation,transport:overrides?.transport??"http",representation:overrides?.representation??"json-body",body});try{await onRequest(
3
3
  value)}catch{}}}function observeFetch(baseFetch,observe){return observe===noop?baseFetch:async(input,init)=>(typeof init?.body=="string"&&await observe(init.body),(baseFetch??globalThis.fetch)(input,init))}export{headersToRecord,providerHeadersToRecord,createRequestObserver,observeFetch};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
- import{getShellConfig}from"./chunk-YFOLLX5D.js";import{getAgentDir,getFileRevision,normalizePath,require_cross_spawn,require_readShebang,require_resolveCommand,stripBom}from"./chunk-ZI7TK7HM.js";import{__commonJS,__require,__toESM}from"./chunk-JXWJOIH4.js";var require_polyfills=__commonJS({"node_modules/graceful-fs/polyfills.js"(exports,module){var constants=__require("constants"),origCwd=process.cwd,cwd=null,platform=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cwd||(cwd=origCwd.call(process)),cwd};try{process.cwd()}catch{}typeof process.chdir=="function"&&(chdir=process.chdir,process.chdir=function(d){cwd=null,chdir.call(process,d)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,chdir));var chdir;module.
2
+ import{getShellConfig}from"./chunk-RO5YPAJH.js";import{getAgentDir,getFileRevision,normalizePath,require_cross_spawn,require_readShebang,require_resolveCommand,stripBom}from"./chunk-IADQJFNH.js";import{__commonJS,__require,__toESM}from"./chunk-JXWJOIH4.js";var require_polyfills=__commonJS({"node_modules/graceful-fs/polyfills.js"(exports,module){var constants=__require("constants"),origCwd=process.cwd,cwd=null,platform=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cwd||(cwd=origCwd.call(process)),cwd};try{process.cwd()}catch{}typeof process.chdir=="function"&&(chdir=process.chdir,process.chdir=function(d){cwd=null,chdir.call(process,d)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,chdir));var chdir;module.
3
3
  exports=patch;function patch(fs){constants.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&patchLchmod(fs),fs.lutimes||patchLutimes(fs),fs.chown=chownFix(fs.chown),fs.fchown=chownFix(fs.fchown),fs.lchown=chownFix(fs.lchown),fs.chmod=chmodFix(fs.chmod),fs.fchmod=chmodFix(fs.fchmod),fs.lchmod=chmodFix(fs.lchmod),fs.chownSync=chownFixSync(fs.chownSync),fs.fchownSync=chownFixSync(fs.fchownSync),fs.lchownSync=chownFixSync(fs.lchownSync),fs.chmodSync=chmodFixSync(fs.chmodSync),
4
4
  fs.fchmodSync=chmodFixSync(fs.fchmodSync),fs.lchmodSync=chmodFixSync(fs.lchmodSync),fs.stat=statFix(fs.stat),fs.fstat=statFix(fs.fstat),fs.lstat=statFix(fs.lstat),fs.statSync=statFixSync(fs.statSync),fs.fstatSync=statFixSync(fs.fstatSync),fs.lstatSync=statFixSync(fs.lstatSync),fs.chmod&&!fs.lchmod&&(fs.lchmod=function(path,mode,cb){cb&&process.nextTick(cb)},fs.lchmodSync=function(){}),fs.chown&&!fs.lchown&&(fs.lchown=function(path,uid,gid,cb){cb&&process.nextTick(cb)},fs.lchownSync=function(){}),
5
5
  platform==="win32"&&(fs.rename=typeof fs.rename!="function"?fs.rename:(function(fs$rename){function rename(from,to,cb){var start=Date.now(),backoff=0;fs$rename(from,to,function CB(er){if(er&&(er.code==="EACCES"||er.code==="EPERM"||er.code==="EBUSY")&&Date.now()-start<6e4){setTimeout(function(){fs.stat(to,function(stater,st){stater&&stater.code==="ENOENT"?fs$rename(from,to,CB):cb(er)})},backoff),backoff<100&&(backoff+=10);return}cb&&cb(er)})}return Object.setPrototypeOf&&Object.setPrototypeOf(rename,
@@ -92,19 +92,19 @@ options):rawStore.read(providerId,options));return!ifCurrent||ifCurrent(current)
92
92
  "$","$$$$").replace(/^!/,"$!")}:next},options).then(poolable),delete:(providerId,options)=>rawStore.delete(providerId,ifCurrent||options?.ifCurrent?{...options,ifCurrent:current=>(!ifCurrent||ifCurrent(current))&&(!options?.ifCurrent||options.ifCurrent(poolable(current)))}:options)};return accountCredentialStores.set(view,rawStore),view}function readStoredCredential(providerId,authPath=join(getAgentDir(),"auth.json")){try{return JSON.parse(stripBom(readFileSync(normalizePath(authPath),"utf-8")))[providerId]}catch{
93
93
  return}}function toolPatternRegExp(pattern){let source=pattern.split("*").map(part=>part.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join(".*");return new RegExp(`^${source}$`)}function createToolNameMatcher(entries){let names=new Set(entries.filter(entry=>!entry.includes("*"))),patterns=entries.filter(entry=>entry.includes("*")).map(toolPatternRegExp);return name=>names.has(name)||patterns.some(pattern=>pattern.test(name))}var LIST_MCP_RESOURCES_TOOL="list_mcp_resources",LIST_MCP_RESOURCE_TEMPLATES_TOOL="lis\
94
94
  t_mcp_resource_templates",READ_MCP_RESOURCE_TOOL="read_mcp_resource",MCP_RESOURCE_TOOLS=new Set([LIST_MCP_RESOURCES_TOOL,LIST_MCP_RESOURCE_TEMPLATES_TOOL,READ_MCP_RESOURCE_TOOL]);function isMcpToolName(name){return name.startsWith("mcp__")||MCP_RESOURCE_TOOLS.has(name)}var MCP_EXPOSURES=["codemode","deferred","direct","hidden"],MCP_EXPOSURE_ALIASES={"codemode-deferred":"codemode"},LOOPBACK_HOSTS=["localhost","127.0.0.1","[::1]"];function isLoopbackRedirectUri(value){if(!URL.canParse(value))return!1;
95
- let url=new URL(value);return url.protocol==="http:"&&LOOPBACK_HOSTS.includes(url.hostname)&&url.search===""&&url.hash===""}var SERVER_NAME=/^[A-Za-z0-9_-]+$/;function mcpNamespace(server){return`mcp__${server.replace(/-/g,"_")}`}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isStringRecord(value){return isRecord(value)&&Object.values(value).every(entry=>typeof entry=="string")}function validateOAuth(value){if(value===void 0)return;if(!isRecord(
96
- value))return"oauth must be an object";if(value.clientId!==void 0&&typeof value.clientId!="string")return"oauth.clientId must be a string";if(value.clientSecret!==void 0&&typeof value.clientSecret!="string")return"oauth.clientSecret must be a string";let port=value.callbackPort;if(port!==void 0&&(typeof port!="number"||!Number.isInteger(port)||port<1||port>65535))return"oauth.callbackPort must be a port number";if(value.callbackUrl!==void 0){if(typeof value.callbackUrl!="string"||!isLoopbackRedirectUri(
97
- value.callbackUrl))return"oauth.callbackUrl must be an http URI on localhost, 127.0.0.1, or [::1] without query or fragment";let urlPort=new URL(value.callbackUrl).port;if(urlPort&&port!==void 0&&Number(urlPort)!==port)return"oauth.callbackUrl and oauth.callbackPort name different ports"}if(value.scope!==void 0&&typeof value.scope!="string")return"oauth.scope must be a string";if(value.clientName!==void 0&&(typeof value.clientName!="string"||!value.clientName.trim()))return"oauth.clientName must\
98
- be a non-empty string";if(value.clientRegistration!==void 0&&value.clientRegistration!=="dcr"){if(value.clientRegistration!=="cimd")return'oauth.clientRegistration must be "dcr" or "cimd"';if(value.clientId!==void 0||value.clientName!==void 0)return'oauth.clientRegistration "cimd" cannot be combined with oauth.clientId or oauth.clientName';let callback=typeof value.callbackUrl=="string"?new URL(value.callbackUrl):void 0;if(callback&&(callback.hostname==="[::1]"||callback.pathname!=="/callback"))
99
- return'oauth.clientRegistration "cimd" requires oauth.callbackUrl on localhost or 127.0.0.1 with path /callback'}let metadataUrl=value.authServerMetadataUrl;if(metadataUrl!==void 0){let url=typeof metadataUrl=="string"&&URL.canParse(metadataUrl)?new URL(metadataUrl):void 0;if(!url||!(url.protocol==="https:"||url.protocol==="http:"&&LOOPBACK_HOSTS.includes(url.hostname)))return"oauth.authServerMetadataUrl must be an https URL, or http on localhost, 127.0.0.1, or [::1]"}}function isExposure(value){
100
- return typeof value=="string"&&MCP_EXPOSURES.includes(value)}function resolveExposureAlias(value){return typeof value=="string"?MCP_EXPOSURE_ALIASES[value]??value:value}function resolveExposureAliases(value){let{exposure,toolExposure}=value,resolved={...value};return exposure!==void 0&&(resolved.exposure=resolveExposureAlias(exposure)),isRecord(toolExposure)&&(resolved.toolExposure=Object.fromEntries(Object.entries(toolExposure).map(([tool,entry])=>[tool,resolveExposureAlias(entry)]))),resolved}
101
- function getMcpToolExposure(config,toolName){let overrides=config.toolExposure??{},exact=overrides[toolName];if(exact!==void 0)return exact;for(let[pattern,exposure]of Object.entries(overrides))if(pattern.includes("*")&&toolPatternRegExp(pattern).test(toolName))return exposure;return config.exposure??"codemode"}function validateMcpServerConfig(name,raw){if(!SERVER_NAME.test(name))return`invalid server name "${name}" (use letters, digits, "_" and "-")`;if(!isRecord(raw))return`server "${name}" mu\
102
- st be an object`;let value=resolveExposureAliases(raw),{type,exposure,enabled,timeout,toolExposure,description}=value,exposures=MCP_EXPOSURES.map(value2=>`"${value2}"`).join(", ");if(exposure!==void 0&&!isExposure(exposure))return`server "${name}": exposure must be one of ${exposures}`;if(toolExposure!==void 0){if(!isRecord(toolExposure))return`server "${name}": toolExposure must map tool names to exposures`;for(let[tool,value2]of Object.entries(toolExposure))if(!isExposure(value2))return`server\
103
- "${name}": toolExposure "${tool}" must be one of ${exposures}`}if(enabled!==void 0&&typeof enabled!="boolean")return`server "${name}": enabled must be a boolean`;if(description!==void 0&&typeof description!="string")return`server "${name}": description must be a string`;if(timeout!==void 0&&(typeof timeout!="number"||!(timeout>0)))return`server "${name}": timeout must be a positive number of seconds`;if(type==="sse")return`server "${name}": legacy SSE transport is not supported; use the streama\
104
- ble HTTP URL`;if(typeof value.url=="string"&&(type===void 0||type==="http"||type==="streamable-http")){if(!URL.canParse(value.url)||!/^https?:$/.test(new URL(value.url).protocol))return`server "${name}": url must be an http or https URL`;if(value.headers!==void 0&&!isStringRecord(value.headers))return`server "${name}": headers must map names to strings`;let oauthError=validateOAuth(value.oauth);if(oauthError)return`server "${name}": ${oauthError}`;if(value.auth!==void 0){if(!isRecord(value.auth)||
105
- typeof value.auth.provider!="string"||!value.auth.provider)return`server "${name}": auth.provider must be a provider name`;let url=new URL(value.url);if(url.protocol!=="https:"&&!LOOPBACK_HOSTS.includes(url.hostname))return`server "${name}": auth requires an https URL, or http on localhost, 127.0.0.1, or [::1]`}return value}return typeof value.command=="string"&&(type===void 0||type==="stdio")?value.args!==void 0&&!(Array.isArray(value.args)&&value.args.every(arg=>typeof arg=="string"))?`server \
106
- "${name}": args must be an array of strings`:value.env!==void 0&&!isStringRecord(value.env)?`server "${name}": env must map names to strings`:value.cwd!==void 0&&typeof value.cwd!="string"?`server "${name}": cwd must be a string`:value:`server "${name}" needs either "command" (stdio) or "url" (streamable HTTP)`}var McpServerRegistry=class{servers=new Map;changeListener;register(server){this.servers.set(server.name,server),this.changeListener?.()}unregister(name,extensionPath){this.servers.get(name)?.
107
- extensionPath===extensionPath&&(this.servers.delete(name),this.changeListener?.())}get(name){return this.servers.get(name)}list(){return[...this.servers.values()].map(server=>({...server,config:structuredClone(server.config)}))}setChangeListener(listener){this.changeListener=listener}};var JSON_RPC_ERROR_CODES={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603},McpError=class extends Error{code;data;constructor(code,message,data){super(message),this.name="McpError",this.code=code,this.data=data}},McpConnectionClosedError=class extends Error{constructor(message="MCP connection closed"){super(message),this.name="McpConnectionClosedError"}},McpTimeoutError=class extends Error{timeoutMs;constructor(timeoutMs){super(`MCP request\
95
+ let url=new URL(value);return url.protocol==="http:"&&LOOPBACK_HOSTS.includes(url.hostname)&&url.search===""&&url.hash===""}function isClientMetadataDocumentCallback(callbackUrl){if(callbackUrl===void 0)return!0;let url=new URL(callbackUrl);return url.hostname!=="[::1]"&&url.pathname==="/callback"}var SERVER_NAME=/^[A-Za-z0-9_-]+$/;function mcpNamespace(server){return`mcp__${server.replace(/-/g,"_")}`}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isStringRecord(value){
96
+ return isRecord(value)&&Object.values(value).every(entry=>typeof entry=="string")}function validateOAuth(value){if(value===void 0)return;if(!isRecord(value))return"oauth must be an object";if(value.clientId!==void 0&&typeof value.clientId!="string")return"oauth.clientId must be a string";if(value.clientSecret!==void 0&&typeof value.clientSecret!="string")return"oauth.clientSecret must be a string";let port=value.callbackPort;if(port!==void 0&&(typeof port!="number"||!Number.isInteger(port)||port<
97
+ 1||port>65535))return"oauth.callbackPort must be a port number";if(value.callbackUrl!==void 0){if(typeof value.callbackUrl!="string"||!isLoopbackRedirectUri(value.callbackUrl))return"oauth.callbackUrl must be an http URI on localhost, 127.0.0.1, or [::1] without query or fragment";let urlPort=new URL(value.callbackUrl).port;if(urlPort&&port!==void 0&&Number(urlPort)!==port)return"oauth.callbackUrl and oauth.callbackPort name different ports"}if(value.scope!==void 0&&typeof value.scope!="string")
98
+ return"oauth.scope must be a string";if(value.clientName!==void 0&&(typeof value.clientName!="string"||!value.clientName.trim()))return"oauth.clientName must be a non-empty string";let registration=value.clientRegistration;if(registration!==void 0&&registration!=="auto"&&registration!=="dcr"){if(registration!=="cimd")return'oauth.clientRegistration must be "auto", "dcr", or "cimd"';if(value.clientId!==void 0||value.clientName!==void 0)return'oauth.clientRegistration "cimd" cannot be combined wit\
99
+ h oauth.clientId or oauth.clientName';if(!isClientMetadataDocumentCallback(typeof value.callbackUrl=="string"?value.callbackUrl:void 0))return'oauth.clientRegistration "cimd" requires oauth.callbackUrl on localhost or 127.0.0.1 with path /callback'}let metadataUrl=value.authServerMetadataUrl;if(metadataUrl!==void 0){let url=typeof metadataUrl=="string"&&URL.canParse(metadataUrl)?new URL(metadataUrl):void 0;if(!url||!(url.protocol==="https:"||url.protocol==="http:"&&LOOPBACK_HOSTS.includes(url.hostname)))
100
+ return"oauth.authServerMetadataUrl must be an https URL, or http on localhost, 127.0.0.1, or [::1]"}}function isExposure(value){return typeof value=="string"&&MCP_EXPOSURES.includes(value)}function resolveExposureAlias(value){return typeof value=="string"?MCP_EXPOSURE_ALIASES[value]??value:value}function resolveExposureAliases(value){let{exposure,toolExposure}=value,resolved={...value};return exposure!==void 0&&(resolved.exposure=resolveExposureAlias(exposure)),isRecord(toolExposure)&&(resolved.
101
+ toolExposure=Object.fromEntries(Object.entries(toolExposure).map(([tool,entry])=>[tool,resolveExposureAlias(entry)]))),resolved}function getMcpToolExposure(config,toolName){let overrides=config.toolExposure??{},exact=overrides[toolName];if(exact!==void 0)return exact;for(let[pattern,exposure]of Object.entries(overrides))if(pattern.includes("*")&&toolPatternRegExp(pattern).test(toolName))return exposure;return config.exposure??"codemode"}function validateMcpServerConfig(name,raw){if(!SERVER_NAME.
102
+ test(name))return`invalid server name "${name}" (use letters, digits, "_" and "-")`;if(!isRecord(raw))return`server "${name}" must be an object`;let value=resolveExposureAliases(raw),{type,exposure,enabled,timeout,toolExposure,description}=value,exposures=MCP_EXPOSURES.map(value2=>`"${value2}"`).join(", ");if(exposure!==void 0&&!isExposure(exposure))return`server "${name}": exposure must be one of ${exposures}`;if(toolExposure!==void 0){if(!isRecord(toolExposure))return`server "${name}": toolExp\
103
+ osure must map tool names to exposures`;for(let[tool,value2]of Object.entries(toolExposure))if(!isExposure(value2))return`server "${name}": toolExposure "${tool}" must be one of ${exposures}`}if(enabled!==void 0&&typeof enabled!="boolean")return`server "${name}": enabled must be a boolean`;if(description!==void 0&&typeof description!="string")return`server "${name}": description must be a string`;if(timeout!==void 0&&(typeof timeout!="number"||!(timeout>0)))return`server "${name}": timeout must \
104
+ be a positive number of seconds`;if(type==="sse")return`server "${name}": legacy SSE transport is not supported; use the streamable HTTP URL`;if(typeof value.url=="string"&&(type===void 0||type==="http"||type==="streamable-http")){if(!URL.canParse(value.url)||!/^https?:$/.test(new URL(value.url).protocol))return`server "${name}": url must be an http or https URL`;if(value.headers!==void 0&&!isStringRecord(value.headers))return`server "${name}": headers must map names to strings`;let oauthError=validateOAuth(
105
+ value.oauth);if(oauthError)return`server "${name}": ${oauthError}`;if(value.auth!==void 0){if(!isRecord(value.auth)||typeof value.auth.provider!="string"||!value.auth.provider)return`server "${name}": auth.provider must be a provider name`;let url=new URL(value.url);if(url.protocol!=="https:"&&!LOOPBACK_HOSTS.includes(url.hostname))return`server "${name}": auth requires an https URL, or http on localhost, 127.0.0.1, or [::1]`}return value}return typeof value.command=="string"&&(type===void 0||type===
106
+ "stdio")?value.args!==void 0&&!(Array.isArray(value.args)&&value.args.every(arg=>typeof arg=="string"))?`server "${name}": args must be an array of strings`:value.env!==void 0&&!isStringRecord(value.env)?`server "${name}": env must map names to strings`:value.cwd!==void 0&&typeof value.cwd!="string"?`server "${name}": cwd must be a string`:value:`server "${name}" needs either "command" (stdio) or "url" (streamable HTTP)`}var McpServerRegistry=class{servers=new Map;changeListener;register(server){
107
+ this.servers.set(server.name,server),this.changeListener?.()}unregister(name,extensionPath){this.servers.get(name)?.extensionPath===extensionPath&&(this.servers.delete(name),this.changeListener?.())}get(name){return this.servers.get(name)}list(){return[...this.servers.values()].map(server=>({...server,config:structuredClone(server.config)}))}setChangeListener(listener){this.changeListener=listener}};var JSON_RPC_ERROR_CODES={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603},McpError=class extends Error{code;data;constructor(code,message,data){super(message),this.name="McpError",this.code=code,this.data=data}},McpConnectionClosedError=class extends Error{constructor(message="MCP connection closed"){super(message),this.name="McpConnectionClosedError"}},McpTimeoutError=class extends Error{timeoutMs;constructor(timeoutMs){super(`MCP request\
108
108
  timed out after ${timeoutMs}ms`),this.name="McpTimeoutError",this.timeoutMs=timeoutMs}},McpAbortError=class extends Error{constructor(message="MCP request aborted"){super(message),this.name="AbortError"}};function isObject(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function toError(value){return value instanceof Error?value:new Error(String(value))}function isJsonRpcId(value){return typeof value=="string"||typeof value=="number"&&Number.isFinite(value)}function isJsonRpcRequest(message){
109
109
  return isObject(message)&&message.jsonrpc==="2.0"&&isJsonRpcId(message.id)&&typeof message.method=="string"}function isJsonRpcNotification(message){return isObject(message)&&message.jsonrpc==="2.0"&&!("id"in message)&&typeof message.method=="string"}function isJsonRpcResponse(message){return!isObject(message)||message.jsonrpc!=="2.0"||!isJsonRpcId(message.id)?!1:"result"in message?!("error"in message):!("error"in message)||!isObject(message.error)?!1:typeof message.error.code=="number"&&typeof message.
110
110
  error.message=="string"}function parseJsonRpcMessage(value){if(isJsonRpcRequest(value)||isJsonRpcNotification(value)||isJsonRpcResponse(value))return value;throw new McpError(JSON_RPC_ERROR_CODES.invalidRequest,"Invalid JSON-RPC message")}var LATEST_PROTOCOL_VERSION="2025-11-25",SUPPORTED_PROTOCOL_VERSIONS=[LATEST_PROTOCOL_VERSION,"2025-06-18","2025-03-26","2024-11-05"];var DEFAULT_REQUEST_TIMEOUT_MS=3e4,MAX_LIST_PAGES=1e3;function validateInitializeResult(value){if(!isObject(value)||typeof value.protocolVersion!="string"||!isObject(value.capabilities)||!isObject(value.serverInfo)||typeof value.serverInfo.name!="string"||typeof value.serverInfo.version!="string"||value.instructions!==void 0&&typeof value.instructions!="string")throw new McpError(JSON_RPC_ERROR_CODES.invalidRequest,"Invalid MCP initialize result");return value}function invalid(message){return new McpError(
@@ -157,13 +157,13 @@ throw new McpHttpError(response.status,`MCP server accepted request ${message.me
157
157
  type: ${type??"missing"}`)}async close(){if(!this.closed){if(this.closed=!0,this.controller.abort(),this.started&&this.sessionIdValue)try{let response=await this.fetch(this.url,{method:"DELETE",headers:this.buildHeaders({},this.lastToken),signal:AbortSignal.timeout(1e3)});await discard(response)}catch{}this.emitClose()}}async authorizedFetch(method,init,signal){let onUnauthorized=this.options.authProvider?.onUnauthorized?.bind(this.options.authProvider);for(let attempt=0;;attempt++){let{headers,
158
158
  token}=await this.headers(init.headers);if(signal?.aborted)throw new McpAbortError;let response=await this.fetch(this.url,{method,headers,body:init.body,signal:this.controller.signal});if(attempt>0||!onUnauthorized||!needsAuthorization(response))return response;try{await onUnauthorized({response,serverUrl:this.url,fetch:this.fetch,token})}finally{await discard(response)}}}async headers(extra={}){let token=await this.options.authProvider?.token();return this.lastToken=token,{headers:this.buildHeaders(
159
159
  extra,token),...token?{token}:{}}}buildHeaders(extra,token){let headers=new Headers(this.options.headers);for(let[name,value]of Object.entries(extra))headers.set(name,value);return this.sessionIdValue&&headers.set("Mcp-Session-Id",this.sessionIdValue),this.protocolVersion&&headers.set("MCP-Protocol-Version",this.protocolVersion),token&&headers.set("Authorization",`Bearer ${token}`),headers}captureSession(response){let sessionId=response.headers.get("mcp-session-id");sessionId&&(this.sessionIdValue=
160
- sessionId)}async checkResponse(response){if(response.ok)return;let body=(await response.text().catch(()=>"")).slice(0,MAX_ERROR_BODY_BYTES);throw response.status===401?new McpAuthRequiredError(response,body):response.status===404&&this.sessionIdValue?new McpSessionExpiredError(body):new McpHttpError(response.status,describeHttpFailure(response.status,body),body)}async consumeSse(stream,cursor,onMessage){await consumeSseStream(stream,{maxEventBytes:this.options.maxMessageBytes??DEFAULT_MAX_MESSAGE_BYTES,
161
- onId:id=>{cursor.lastEventId=id},onRetry:delayMs=>{cursor.retryMs=delayMs},onEvent:event=>{if(cursor.received=!0,!event.data.trim()||event.event!==void 0&&event.event!=="message")return;let message;try{message=parseJsonRpcMessage(JSON.parse(event.data))}catch(error){this.emitError(error);return}onMessage?.(message),this.emitMessage(message)}})}async consumeResponseStream(body,requestId){let cursor={lastEventId:void 0,retryMs:void 0,received:!1},answered=!1,onMessage=message=>{isJsonRpcResponse(message)&&
162
- message.id===requestId&&(answered=!0)},stream=body,failure;for(let attempt=0;;){if(stream)try{await this.consumeSse(stream,cursor,onMessage),failure=void 0}catch(error){failure=error}if(answered||this.closed)return;if(failure!==void 0&&!this.isRetryable(failure)||cursor.lastEventId===void 0||attempt>=this.maxRetries())break;if(cursor.received&&(attempt=0),cursor.received=!1,!await this.sleep(this.reconnectDelay(attempt++,cursor.retryMs)))return;try{stream=await this.openSseStream(cursor.lastEventId)}catch(error){
163
- if(failure=error,!this.isRetryable(error))break;stream=void 0}}if(this.closed)return;let reason=failure===void 0?"stream ended without a response":toError(failure).message;this.emitMessage({jsonrpc:"2.0",id:requestId,error:{code:JSON_RPC_ERROR_CODES.internalError,message:`MCP response stream failed: ${reason}`}})}startGetStream(){this.options.openGetStream===!1||this.getStreamStarted||this.closed||(this.getStreamStarted=!0,this.runGetStream())}async runGetStream(){let cursor={lastEventId:void 0,
164
- retryMs:void 0,received:!1};for(let attempt=0;!this.closed;){try{let stream=await this.openSseStream(cursor.lastEventId);if(!stream)return;let openedAt=Date.now();await this.consumeSse(stream,cursor),(cursor.received||Date.now()-openedAt>this.maxDelay())&&(attempt=0)}catch(error){if(this.closed)return;if(!this.isRetryable(error)){this.emitError(error);return}}if(cursor.received=!1,attempt>=this.maxRetries()){this.emitError(new Error("MCP server-to-client stream dropped and could not be reopened"));
165
- return}if(!await this.sleep(this.reconnectDelay(attempt++,cursor.retryMs)))return}}async openSseStream(lastEventId){let response=await this.authorizedFetch("GET",{headers:{accept:"text/event-stream",...lastEventId===void 0?{}:{"last-event-id":lastEventId}}});if(response.status===405){await discard(response);return}await this.checkResponse(response),this.captureSession(response);let type=contentType(response);if(type!=="text/event-stream"||!response.body)throw await discard(response),new McpHttpError(
166
- response.status,`Unsupported MCP GET response content type: ${type??"missing"}`);return response.body}isRetryable(error){if(error instanceof McpHttpError)return isTransientStatus(error.status);if(error instanceof TypeError)return!0;let code=error?.code;return typeof code=="string"&&(code.startsWith("E")||code.startsWith("UND_ERR"))}reconnectDelay(attempt,serverDelayMs){if(serverDelayMs!==void 0)return serverDelayMs;let initial=this.options.reconnect?.initialDelayMs??DEFAULT_RECONNECT_INITIAL_DELAY_MS;
160
+ sessionId)}async checkResponse(response){if(response.ok)return;let body=`${(await response.text().catch(()=>"")).slice(0,MAX_ERROR_BODY_BYTES)} `.slice(0,-1);throw response.status===401?new McpAuthRequiredError(response,body):response.status===404&&this.sessionIdValue?new McpSessionExpiredError(body):new McpHttpError(response.status,describeHttpFailure(response.status,body),body)}async consumeSse(stream,cursor,onMessage){await consumeSseStream(stream,{maxEventBytes:this.options.maxMessageBytes??
161
+ DEFAULT_MAX_MESSAGE_BYTES,onId:id=>{cursor.lastEventId=id},onRetry:delayMs=>{cursor.retryMs=delayMs},onEvent:event=>{if(cursor.received=!0,!event.data.trim()||event.event!==void 0&&event.event!=="message")return;let message;try{message=parseJsonRpcMessage(JSON.parse(event.data))}catch(error){this.emitError(error);return}onMessage?.(message),this.emitMessage(message)}})}async consumeResponseStream(body,requestId){let cursor={lastEventId:void 0,retryMs:void 0,received:!1},answered=!1,onMessage=message=>{
162
+ isJsonRpcResponse(message)&&message.id===requestId&&(answered=!0)},stream=body,failure;for(let attempt=0;;){if(stream)try{await this.consumeSse(stream,cursor,onMessage),failure=void 0}catch(error){failure=error}if(answered||this.closed)return;if(failure!==void 0&&!this.isRetryable(failure)||cursor.lastEventId===void 0||attempt>=this.maxRetries())break;if(cursor.received&&(attempt=0),cursor.received=!1,!await this.sleep(this.reconnectDelay(attempt++,cursor.retryMs)))return;try{stream=await this.openSseStream(
163
+ cursor.lastEventId)}catch(error){if(failure=error,!this.isRetryable(error))break;stream=void 0}}if(this.closed)return;let reason=failure===void 0?"stream ended without a response":toError(failure).message;this.emitMessage({jsonrpc:"2.0",id:requestId,error:{code:JSON_RPC_ERROR_CODES.internalError,message:`MCP response stream failed: ${reason}`}})}startGetStream(){this.options.openGetStream===!1||this.getStreamStarted||this.closed||(this.getStreamStarted=!0,this.runGetStream())}async runGetStream(){
164
+ let cursor={lastEventId:void 0,retryMs:void 0,received:!1};for(let attempt=0;!this.closed;){try{let stream=await this.openSseStream(cursor.lastEventId);if(!stream)return;let openedAt=Date.now();await this.consumeSse(stream,cursor),(cursor.received||Date.now()-openedAt>this.maxDelay())&&(attempt=0)}catch(error){if(this.closed)return;if(!this.isRetryable(error)){this.emitError(error);return}}if(cursor.received=!1,attempt>=this.maxRetries()){this.emitError(new Error("MCP server-to-client stream dro\
165
+ pped and could not be reopened"));return}if(!await this.sleep(this.reconnectDelay(attempt++,cursor.retryMs)))return}}async openSseStream(lastEventId){let response=await this.authorizedFetch("GET",{headers:{accept:"text/event-stream",...lastEventId===void 0?{}:{"last-event-id":lastEventId}}});if(response.status===405){await discard(response);return}await this.checkResponse(response),this.captureSession(response);let type=contentType(response);if(type!=="text/event-stream"||!response.body)throw await discard(
166
+ response),new McpHttpError(response.status,`Unsupported MCP GET response content type: ${type??"missing"}`);return response.body}isRetryable(error){if(error instanceof McpHttpError)return isTransientStatus(error.status);if(error instanceof TypeError)return!0;let code=error?.code;return typeof code=="string"&&(code.startsWith("E")||code.startsWith("UND_ERR"))}reconnectDelay(attempt,serverDelayMs){if(serverDelayMs!==void 0)return serverDelayMs;let initial=this.options.reconnect?.initialDelayMs??DEFAULT_RECONNECT_INITIAL_DELAY_MS;
167
167
  return Math.min(initial*2**attempt,this.maxDelay())}maxDelay(){return this.options.reconnect?.maxDelayMs??DEFAULT_RECONNECT_MAX_DELAY_MS}maxRetries(){return this.options.reconnect?.maxRetries??DEFAULT_RECONNECT_MAX_RETRIES}sleep(ms){let signal=this.controller.signal;return signal.aborted?Promise.resolve(!1):new Promise(resolve2=>{let onAbort=()=>{clearTimeout(timer),resolve2(!1)},timer=setTimeout(()=>{signal.removeEventListener("abort",onAbort),resolve2(!0)},ms);timer.unref?.(),signal.addEventListener(
168
168
  "abort",onAbort,{once:!0})})}};function blockToLlmContent(block){switch(block.type){case"text":return{type:"text",text:block.text};case"image":return{type:"image",data:block.data,mimeType:block.mimeType};case"audio":return{type:"text",text:`[audio ${block.mimeType} omitted]`};case"resource_link":return{type:"text",text:`${block.name}: ${block.uri}`};case"resource":{let resource=block.resource;return"text"in resource?{type:"text",text:resource.text}:resource.mimeType?.startsWith("image/")?{type:"image",data:resource.blob,mimeType:resource.
169
169
  mimeType}:{type:"text",text:`[binary resource ${resource.uri} (${resource.mimeType??"unknown type"}) omitted]`}}default:return{type:"text",text:`[unsupported MCP content ${block.type}]`}}}function toLlmContent(result){let content=(result.content??[]).map(blockToLlmContent);return content.length===0&&result.structuredContent!==void 0&&content.push({type:"text",text:JSON.stringify(result.structuredContent,null,2)}),content}var LOGO_SVG='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 14" role="img" aria-label="HUMAIN Code"><path fill="#f5f7f7" d="M0 0h6v2H2v10h4v2H0Zm9 0h6v14H9v-2h4V2H9Z"/><path fill="#00b89c" d="M3 4h9v2H3Zm0 4h9v2H3Z"/></svg>';function escapeHtml(value){return value.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function renderPage(options){let title=escapeHtml(options.title),heading=escapeHtml(options.heading),message=escapeHtml(
@@ -54,11 +54,12 @@ return maxDelayMs;let delay=minDelayMs*2**(attempt-1),capped=Math.min(delay,maxD
54
54
  abortSignal.removeEventListener("abort",onAbort)},aborted:promise}},createWaiter=async(options,input,acceptorChecks)=>{let params={...waiterServiceDefaults,...options};validateWaiterOptions(params);let exitConditions=[runPolling(params,input,acceptorChecks)],finalize=[];if(options.abortSignal){let{aborted,clearListener}=abortTimeout(options.abortSignal);finalize.push(clearListener),exitConditions.push(aborted)}if(options.abortController?.signal){let{aborted,clearListener}=abortTimeout(options.abortController.
55
55
  signal);finalize.push(clearListener),exitConditions.push(aborted)}return Promise.race(exitConditions).then(result=>{for(let fn of finalize)fn();return result})}}});var Client,init_client=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client.js"(){init_MiddlewareStack();Client=class{config;middlewareStack=constructStack();initConfig;handlers;constructor(config){this.config=config;let{protocol,protocolSettings}=config;protocolSettings&&typeof protocol=="function"&&(config.protocol=new protocol(protocolSettings))}send(command,optionsOrCb,cb){let options=typeof optionsOrCb!="function"?optionsOrCb:void 0,callback=typeof optionsOrCb=="\
56
56
  function"?optionsOrCb:cb,useHandlerCache=options===void 0&&this.config.cacheMiddleware===!0,handler;if(useHandlerCache){this.handlers||(this.handlers=new WeakMap);let handlers=this.handlers;handlers.has(command.constructor)?handler=handlers.get(command.constructor):(handler=command.resolveMiddleware(this.middlewareStack,this.config,options),handlers.set(command.constructor,handler))}else delete this.handlers,handler=command.resolveMiddleware(this.middlewareStack,this.config,options);if(callback)
57
- handler(command).then(result=>callback(null,result.output),err=>callback(err)).catch(()=>{});else return handler(command).then(result=>result.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}}});function schemaLogFilter(schema,data){if(data==null)return data;let ns=NormalizedSchema.of(schema);if(ns.getMergedTraits().sensitive)return SENSITIVE_STRING;if(ns.isListSchema()){if(!!ns.getValueSchema().getMergedTraits().sensitive)return SENSITIVE_STRING}else if(ns.isMapSchema()){if(!!ns.getKeySchema().getMergedTraits().sensitive||!!ns.getValueSchema().getMergedTraits().sensitive)return SENSITIVE_STRING}else if(ns.isStructSchema()&&typeof data=="object"){let object=data,newObject={};for(let[member2,
58
- memberNs]of ns.structIterator())object[member2]!=null&&(newObject[member2]=schemaLogFilter(memberNs,object[member2]));return newObject}return data}var SENSITIVE_STRING,init_schemaLogFilter=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js"(){init_schema();SENSITIVE_STRING="***SensitiveInformation***"}});var import_types2,operationEventStreamMarker,Command,ClassBuilder,init_command=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js"(){import_types2=__toESM(require_dist_cjs());init_MiddlewareStack();init_schemaLogFilter();init_schema();operationEventStreamMarker=Symbol.for("@smithy/op-event-stream"),Command=class{middlewareStack=constructStack();schema;static classBuilder(){return new ClassBuilder}resolveMiddlewareWithContext(clientStack,configuration,options,{middlewareFn,
57
+ handler(command).then(result=>callback(null,result.output),err=>callback(err)).catch(()=>{});else return handler(command).then(result=>result.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}}});function schemaLogFilter(schema,data){if(data==null)return data;let ns=NormalizedSchema.of(schema);if(ns.getMergedTraits().sensitive)return SENSITIVE_STRING;if(ns.isListSchema()){let valueSchema=ns.getValueSchema();if(valueSchema.getMergedTraits().sensitive)return SENSITIVE_STRING;if(Array.isArray(data))return data.map(value=>schemaLogFilter(valueSchema,value))}else if(ns.isMapSchema()){let valueSchema=ns.getValueSchema();if(ns.getKeySchema().getMergedTraits().sensitive||valueSchema.getMergedTraits().
58
+ sensitive)return SENSITIVE_STRING;if(typeof data=="object")return Object.fromEntries(Object.entries(data).map(([key,value])=>[key,schemaLogFilter(valueSchema,value)]))}else if(ns.isStructSchema()&&typeof data=="object"){let object=data,newObject={};for(let[member2,memberNs]of ns.structIterator())object[member2]!=null&&(newObject[member2]=schemaLogFilter(memberNs,object[member2]));return newObject}return data}var SENSITIVE_STRING,init_schemaLogFilter=__esm({"node_modules/@smithy/core/dist-es/subm\
59
+ odules/client/smithy-client/schemaLogFilter.js"(){init_schema();SENSITIVE_STRING="***SensitiveInformation***"}});var import_types2,operationEventStreamMarker,Command,ClassBuilder,init_command=__esm({"node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js"(){import_types2=__toESM(require_dist_cjs());init_MiddlewareStack();init_schemaLogFilter();init_schema();operationEventStreamMarker=Symbol.for("@smithy/op-event-stream"),Command=class{middlewareStack=constructStack();schema;static classBuilder(){return new ClassBuilder}resolveMiddlewareWithContext(clientStack,configuration,options,{middlewareFn,
59
60
  clientName,commandName,inputFilterSensitiveLog,outputFilterSensitiveLog,smithyContext,additionalContext,CommandCtor}){for(let mw of middlewareFn.bind(this)(CommandCtor,clientStack,configuration,options))this.middlewareStack.use(mw);let stack=clientStack.concat(this.middlewareStack),{logger:logger2}=configuration,additionalSmithyContext=additionalContext[import_types2.SMITHY_CONTEXT_KEY],handlerExecutionContext={logger:logger2,clientName,commandName,inputFilterSensitiveLog,outputFilterSensitiveLog,
60
- ...additionalContext,[import_types2.SMITHY_CONTEXT_KEY]:{...additionalSmithyContext,commandInstance:this,...smithyContext,...options?.metricsRecorder===void 0?{}:{metricsRecorder:options.metricsRecorder}}},{requestHandler}=configuration,requestOptions=options??{};requestOptions.metricsRecorder&&(requestOptions={...requestOptions},delete requestOptions.metricsRecorder);let isEventStream,schema=this.schema,marker=schema?.[operationEventStreamMarker];if(marker!==void 0)isEventStream=marker;else if(schema&&
61
- Array.isArray(schema)&&schema[0]===9){let[,,,,input$,output$]=schema;isEventStream=schema[operationEventStreamMarker]=!!(NormalizedSchema.of(input$).getEventStreamMember()||NormalizedSchema.of(output$).getEventStreamMember())}return isEventStream&&(requestOptions={isEventStream,...requestOptions}),stack.resolve(request=>requestHandler.handle(request.request,requestOptions),handlerExecutionContext)}},ClassBuilder=class{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(cb){
61
+ ...additionalContext,[import_types2.SMITHY_CONTEXT_KEY]:{...additionalSmithyContext,commandInstance:this,...smithyContext,...options?.metricsRecorder===void 0?{}:{metricsRecorder:options.metricsRecorder},...options?.abortSignal===void 0?{}:{abortSignal:options.abortSignal}}},{requestHandler}=configuration,requestOptions=options??{};requestOptions.metricsRecorder&&(requestOptions={...requestOptions},delete requestOptions.metricsRecorder);let isEventStream,schema=this.schema,marker=schema?.[operationEventStreamMarker];
62
+ if(marker!==void 0)isEventStream=marker;else if(schema&&Array.isArray(schema)&&schema[0]===9){let[,,,,input$,output$]=schema;isEventStream=schema[operationEventStreamMarker]=!!(NormalizedSchema.of(input$).getEventStreamMember()||NormalizedSchema.of(output$).getEventStreamMember())}return isEventStream&&(requestOptions={isEventStream,...requestOptions}),stack.resolve(request=>requestHandler.handle(request.request,requestOptions),handlerExecutionContext)}},ClassBuilder=class{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(cb){
62
63
  this._init=cb}ep(endpointParameterInstructions){return this._ep=endpointParameterInstructions,this}m(middlewareSupplier){return this._middlewareFn=middlewareSupplier,this}s(service,operation2,smithyContext={}){return this._smithyContext={service,operation:operation2,...smithyContext},this}c(additionalContext={}){return this._additionalContext=additionalContext,this}n(clientName,commandName){return this._clientName=clientName,this._commandName=commandName,this}f(inputFilter=_=>_,outputFilter=_=>_){
63
64
  return this._inputFilterSensitiveLog=inputFilter,this._outputFilterSensitiveLog=outputFilter,this}ser(serializer){return this._serializer=serializer,this}de(deserializer){return this._deserializer=deserializer,this}sc(operation2){return this._operationSchema=operation2,this._smithyContext.operationSchema=operation2,this}build(){let closure=this,CommandRef;return CommandRef=class extends Command{input;static getEndpointParameterInstructions(){return closure._ep}constructor(...[input]){super(),this.
64
65
  input=input??{},closure._init(this),this.schema=closure._operationSchema}resolveMiddleware(stack,configuration,options){let op2=closure._operationSchema,input=op2?.[4]??op2?.input,output=op2?.[5]??op2?.output;return this.resolveMiddlewareWithContext(stack,configuration,options,{CommandCtor:CommandRef,middlewareFn:closure._middlewareFn,clientName:closure._clientName,commandName:closure._commandName,inputFilterSensitiveLog:closure._inputFilterSensitiveLog??(op2?schemaLogFilter.bind(null,input):_=>_),
@@ -234,14 +235,14 @@ If you are using React Native, this API is not yet supported, see: https://react
234
235
  encoding).decode(buf);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(transformed)throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);if(transformed=!0,isBlobInstance(stream))return blobToWebStream(stream);if(isReadableStream(stream))return stream;throw new Error(`Cannot transform payload to web stream, got ${stream}`)}})},isBlobInstance=stream=>typeof Blob=="function"&&stream instanceof Blob}});import{Writable as Writable2}from"node:stream";var streamCollector2,Collector2,init_stream_collector=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js"(){init_concatBytes();init_stream_collector_browser();init_stream_type_check();streamCollector2=stream=>isBlob(stream)?collectBlob(stream):isReadableStream(stream)?collectReadableStream(stream):new Promise((resolve,reject)=>{let collector=new Collector2,nodeStream=stream;nodeStream.pipe(collector),nodeStream.
235
236
  on("error",err=>{collector.end(),reject(err)}),collector.on("error",reject),collector.on("finish",function(){let bytes=concatBytes(this.bufferedBytes);resolve(bytes)})}),Collector2=class extends Writable2{bufferedBytes=[];_write(chunk,encoding,callback){this.bufferedBytes.push(chunk),callback()}}}});import{Readable as Readable4}from"node:stream";var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2,sdkStreamMixin2,init_sdk_stream_mixin=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.js"(){init_buffer_from();init_sdk_stream_mixin_browser();init_stream_collector();ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2="The stream has already been transformed.",sdkStreamMixin2=stream=>{if(!(stream instanceof Readable4))try{return sdkStreamMixin(stream)}catch{let name=stream?.__proto__?.
236
237
  constructor?.name||stream;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`)}let transformed=!1,transformToByteArray=async()=>{if(transformed)throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);return transformed=!0,await streamCollector2(stream)};return Object.assign(stream,{transformToByteArray,transformToString:async encoding=>{let buf=await transformToByteArray();return encoding===void 0||Buffer.isEncoding(encoding)?fromArrayBuffer(buf.buffer,
237
- buf.byteOffset,buf.byteLength).toString(encoding):new TextDecoder(encoding).decode(buf)},transformToWebStream:()=>{if(transformed)throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);if(stream.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Readable4.toWeb!="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return transformed=!0,Readable4.toWeb(stream)}})}}});async function splitStream(stream){return typeof stream.stream=="function"&&(stream=stream.stream()),stream.tee()}var init_splitStream_browser=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/util-stream/splitStream.browser.js"(){}});import{PassThrough}from"node:stream";async function splitStream2(stream){if(isReadableStream(stream)||isBlob(stream))return splitStream(stream);let stream1=new PassThrough,stream2=new PassThrough;return stream.pipe(stream1),stream.pipe(stream2),[stream1,stream2]}var init_splitStream=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/util-stream/splitStream.js"(){init_splitStream_browser();init_stream_type_check()}});var serde_exports={};__export(serde_exports,{ChecksumStream:()=>ChecksumStream,Hash:()=>Hash,LazyJsonString:()=>LazyJsonString,NumericValue:()=>NumericValue,Uint8ArrayBlobAdapter:()=>Uint8ArrayBlobAdapter,_parseEpochTimestamp:()=>_parseEpochTimestamp,_parseRfc3339DateTimeWithOffset:()=>_parseRfc3339DateTimeWithOffset,_parseRfc7231DateTime:()=>_parseRfc7231DateTime,calculateBodyLength:()=>calculateBodyLength,concatBytes:()=>concatBytes,copyDocumentWithTransform:()=>copyDocumentWithTransform,createBufferedReadable:()=>createBufferedReadable,
238
+ buf.byteOffset,buf.byteLength).toString(encoding):new TextDecoder(encoding).decode(buf)},transformToWebStream:()=>{if(transformed)throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2);if(stream.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Readable4.toWeb!="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return transformed=!0,Readable4.toWeb(stream)}})}}});async function splitStream(stream){return typeof stream.stream=="function"&&(stream=stream.stream()),stream.tee()}var init_splitStream_browser=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/util-stream/splitStream.browser.js"(){}});import{PassThrough}from"node:stream";async function splitStream2(stream){if(isReadableStream(stream)||isBlob(stream))return splitStream(stream);let stream1=new PassThrough,stream2=new PassThrough;return stream.pipe(stream1),stream.pipe(stream2),[stream1,stream2]}var init_splitStream=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/util-stream/splitStream.js"(){init_splitStream_browser();init_stream_type_check()}});function writeKey(obj){Object.defineProperty(obj,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}var init_writeKey=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/writeKey.js"(){}});var serde_exports={};__export(serde_exports,{ChecksumStream:()=>ChecksumStream,Hash:()=>Hash,LazyJsonString:()=>LazyJsonString,NumericValue:()=>NumericValue,Uint8ArrayBlobAdapter:()=>Uint8ArrayBlobAdapter,_parseEpochTimestamp:()=>_parseEpochTimestamp,_parseRfc3339DateTimeWithOffset:()=>_parseRfc3339DateTimeWithOffset,_parseRfc7231DateTime:()=>_parseRfc7231DateTime,calculateBodyLength:()=>calculateBodyLength,concatBytes:()=>concatBytes,copyDocumentWithTransform:()=>copyDocumentWithTransform,createBufferedReadable:()=>createBufferedReadable,
238
239
  createChecksumStream:()=>createChecksumStream2,dateToUtcString:()=>dateToUtcString,deserializerMiddleware:()=>deserializerMiddleware,deserializerMiddlewareOption:()=>deserializerMiddlewareOption2,expectBoolean:()=>expectBoolean,expectByte:()=>expectByte,expectFloat32:()=>expectFloat32,expectInt:()=>expectInt,expectInt32:()=>expectInt32,expectLong:()=>expectLong,expectNonNull:()=>expectNonNull,expectNumber:()=>expectNumber,expectObject:()=>expectObject,expectShort:()=>expectShort,expectString:()=>expectString,
239
240
  expectUnion:()=>expectUnion,fromArrayBuffer:()=>fromArrayBuffer,fromBase64:()=>fromBase64,fromHex:()=>fromHex,fromString:()=>fromString,fromUtf8:()=>fromUtf8,generateIdempotencyToken:()=>generateIdempotencyToken,getAwsChunkedEncodingStream:()=>getAwsChunkedEncodingStream2,getSerdePlugin:()=>getSerdePlugin,handleFloat:()=>handleFloat,hasOwn:()=>hasOwn,headStream:()=>headStream2,isArrayBuffer:()=>isArrayBuffer,isBlob:()=>isBlob,isReadableStream:()=>isReadableStream,limitedParseDouble:()=>limitedParseDouble,
240
241
  limitedParseFloat:()=>limitedParseFloat,limitedParseFloat32:()=>limitedParseFloat32,logger:()=>logger,nv:()=>nv,parseBoolean:()=>parseBoolean,parseEpochTimestamp:()=>parseEpochTimestamp,parseRfc3339DateTime:()=>parseRfc3339DateTime,parseRfc3339DateTimeWithOffset:()=>parseRfc3339DateTimeWithOffset,parseRfc7231DateTime:()=>parseRfc7231DateTime,quoteHeader:()=>quoteHeader,sdkStreamMixin:()=>sdkStreamMixin2,serializerMiddleware:()=>serializerMiddleware,serializerMiddlewareOption:()=>serializerMiddlewareOption3,
241
242
  splitEvery:()=>splitEvery,splitHeader:()=>splitHeader,splitStream:()=>splitStream2,streamCollector:()=>streamCollector2,strictParseByte:()=>strictParseByte,strictParseDouble:()=>strictParseDouble,strictParseFloat:()=>strictParseFloat,strictParseFloat32:()=>strictParseFloat32,strictParseInt:()=>strictParseInt,strictParseInt32:()=>strictParseInt32,strictParseLong:()=>strictParseLong,strictParseShort:()=>strictParseShort,toBase64:()=>toBase64,toHex:()=>toHex,toUint8Array:()=>toUint8Array,toUtf8:()=>toUtf8,
242
- v4:()=>v4});import{getRandomValues}from"node:crypto";var Uint8ArrayBlobAdapter,_getRandomValues,v4,generateIdempotencyToken,init_serde=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/index.js"(){init_fromBase64();init_toBase64();init_Uint8ArrayBlobAdapter();init_fromUtf8();init_toUtf8();init_v4();init_copyDocumentWithTransform();init_date_utils();init_lazy_json();init_parse_utils();init_quote_header();init_schema_date_utils();init_split_every();init_split_header();init_NumericValue();
243
- init_hex_encoding();init_calculateBodyLength();init_toUint8Array();init_concatBytes();init_buffer_from();init_is_array_buffer();init_deserializerMiddleware();init_serdePlugin();init_serializerMiddleware();init_hash_node();init_ChecksumStream();init_createChecksumStream();init_createBufferedReadable();init_getAwsChunkedEncodingStream();init_headStream();init_sdk_stream_mixin();init_splitStream();init_stream_type_check();init_stream_collector();init_transport();Uint8ArrayBlobAdapter=class extends bindUint8ArrayBlobAdapter(
244
- toUtf8,fromUtf8,toBase64,fromBase64){},_getRandomValues=getRandomValues,v4=bindV4(_getRandomValues),generateIdempotencyToken=v4}});async function blobReader(blob,onChunk,chunkSize=1024*1024){let size=blob.size,totalBytesRead=0;for(;totalBytesRead<size;){let slice=blob.slice(totalBytesRead,Math.min(size,totalBytesRead+chunkSize));onChunk(new Uint8Array(await slice.arrayBuffer())),totalBytesRead+=slice.size}}var init_chunked_blob_reader=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/chunked-blob-reader/chunked-blob-reader.js"(){}});var blobHasher,init_blobHasher=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/hash-blob-browser/blobHasher.js"(){init_chunked_blob_reader();blobHasher=async function(hashCtor,blob){let hash=new hashCtor;return await blobReader(blob,chunk=>{hash.update(chunk)}),hash.digest()}}});import{Writable as Writable3}from"node:stream";var HashCalculator,init_HashCalculator=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/hash-stream-node/HashCalculator.js"(){init_serde();HashCalculator=class extends Writable3{hash;constructor(hash,options){super(options),this.hash=hash}_write(chunk,encoding,callback){try{this.hash.update(toUint8Array(chunk))}catch(err){return callback(err)}callback()}}}});import{createReadStream}from"node:fs";var fileStreamHasher,isReadStream,init_fileStreamHasher=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/hash-stream-node/fileStreamHasher.js"(){init_HashCalculator();fileStreamHasher=(hashCtor,fileStream)=>new Promise((resolve,reject)=>{if(!isReadStream(fileStream)){reject(new Error("Unable to calculate hash for non-file streams."));return}let fileStreamTee=createReadStream(fileStream.path,{start:fileStream.start,end:fileStream.end}),hash=new hashCtor,
243
+ v4:()=>v4,writeKey:()=>writeKey});import{getRandomValues}from"node:crypto";var Uint8ArrayBlobAdapter,_getRandomValues,v4,generateIdempotencyToken,init_serde=__esm({"node_modules/@smithy/core/dist-es/submodules/serde/index.js"(){init_fromBase64();init_toBase64();init_Uint8ArrayBlobAdapter();init_fromUtf8();init_toUtf8();init_v4();init_copyDocumentWithTransform();init_date_utils();init_lazy_json();init_parse_utils();init_quote_header();init_schema_date_utils();init_split_every();init_split_header();
244
+ init_NumericValue();init_hex_encoding();init_calculateBodyLength();init_toUint8Array();init_concatBytes();init_buffer_from();init_is_array_buffer();init_deserializerMiddleware();init_serdePlugin();init_serializerMiddleware();init_hash_node();init_ChecksumStream();init_createChecksumStream();init_createBufferedReadable();init_getAwsChunkedEncodingStream();init_headStream();init_sdk_stream_mixin();init_splitStream();init_stream_type_check();init_stream_collector();init_transport();init_writeKey();
245
+ Uint8ArrayBlobAdapter=class extends bindUint8ArrayBlobAdapter(toUtf8,fromUtf8,toBase64,fromBase64){},_getRandomValues=getRandomValues,v4=bindV4(_getRandomValues),generateIdempotencyToken=v4}});async function blobReader(blob,onChunk,chunkSize=1024*1024){let size=blob.size,totalBytesRead=0;for(;totalBytesRead<size;){let slice=blob.slice(totalBytesRead,Math.min(size,totalBytesRead+chunkSize));onChunk(new Uint8Array(await slice.arrayBuffer())),totalBytesRead+=slice.size}}var init_chunked_blob_reader=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/chunked-blob-reader/chunked-blob-reader.js"(){}});var blobHasher,init_blobHasher=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/hash-blob-browser/blobHasher.js"(){init_chunked_blob_reader();blobHasher=async function(hashCtor,blob){let hash=new hashCtor;return await blobReader(blob,chunk=>{hash.update(chunk)}),hash.digest()}}});import{Writable as Writable3}from"node:stream";var HashCalculator,init_HashCalculator=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/hash-stream-node/HashCalculator.js"(){init_serde();HashCalculator=class extends Writable3{hash;constructor(hash,options){super(options),this.hash=hash}_write(chunk,encoding,callback){try{this.hash.update(toUint8Array(chunk))}catch(err){return callback(err)}callback()}}}});import{createReadStream}from"node:fs";var fileStreamHasher,isReadStream,init_fileStreamHasher=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/hash-stream-node/fileStreamHasher.js"(){init_HashCalculator();fileStreamHasher=(hashCtor,fileStream)=>new Promise((resolve,reject)=>{if(!isReadStream(fileStream)){reject(new Error("Unable to calculate hash for non-file streams."));return}let fileStreamTee=createReadStream(fileStream.path,{start:fileStream.start,end:fileStream.end}),hash=new hashCtor,
245
246
  hashCalculator=new HashCalculator(hash);fileStreamTee.pipe(hashCalculator),fileStreamTee.on("error",err=>{hashCalculator.end(),reject(err)}),hashCalculator.on("error",reject),hashCalculator.on("finish",function(){hash.digest().then(resolve).catch(reject)})}),isReadStream=stream=>typeof stream.path=="string"}});var readableStreamHasher,init_readableStreamHasher=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/hash-stream-node/readableStreamHasher.js"(){init_HashCalculator();readableStreamHasher=(hashCtor,readableStream)=>{if(readableStream.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");let hash=new hashCtor,hashCalculator=new HashCalculator(hash);return readableStream.pipe(hashCalculator),new Promise((resolve,reject)=>{readableStream.on("erro\
246
247
  r",err=>{hashCalculator.end(),reject(err)}),hashCalculator.on("error",reject),hashCalculator.on("finish",()=>{hash.digest().then(resolve).catch(reject)})})}}});function compress(state,block){let a=state[0],b=state[1],c=state[2],d=state[3];for(let i=0;i<64;++i){let f,g;i<16?(f=b&c|~b&d,g=i):i<32?(f=d&b|c&~d,g=(5*i+1)%16):i<48?(f=b^c^d,g=(3*i+5)%16):(f=c^(b|~d),g=7*i%16);let x=block.getUint32(g*4,!0),tmp=d;d=c,c=b;let s=S[(i>>4)*4+(i&3)],sum=(a+f&M)+(x+T[i]&M)&M;b=b+((sum<<s|sum>>>32-s)>>>0)&M,a=tmp}state[0]=state[0]+a&M,state[1]=state[1]+b&M,state[2]=state[2]+c&M,state[3]=state[3]+d&M}var Md5Js,INIT,M,S,T,init_Md5Js=__esm({"node_modules/@smithy/core/dis\
247
248
  t-es/submodules/checksum/md5/Md5Js.js"(){init_serde();Md5Js=class{digestLength=16;state=Uint32Array.from(INIT);writeBuffer=new DataView(new ArrayBuffer(64));bufferLength=0;bytesHashed=0;update(sourceData){let data=toUint8Array(sourceData),pos=0,len=data.byteLength;for(this.bytesHashed+=len;len>0;)this.writeBuffer.setUint8(this.bufferLength++,data[pos++]),--len,this.bufferLength===64&&(compress(this.state,this.writeBuffer),this.bufferLength=0)}async digest(){let state=Uint32Array.from(this.state),
@@ -265,5 +266,5 @@ pending);if(subtle){if(this.secret){this.finished=!0;let key=await subtle.import
265
266
  for(let chunk of this.pending)sha256Js.update(chunk);this.fallback=sha256Js,this.pending=[],this.pendingBytes=0}}}});var checksum_exports={};__export(checksum_exports,{Crc32:()=>Crc32Node,Crc32Js:()=>Crc32Js,Crc32Node:()=>Crc32Node,Md5:()=>Md5Node,Md5Js:()=>Md5Js,Md5Node:()=>Md5Node,Sha256:()=>Sha256Node,Sha256Js:()=>Sha256Js,Sha256Node:()=>Sha256Node,Sha256WebCrypto:()=>Sha256WebCrypto,blobHasher:()=>blobHasher,blobReader:()=>blobReader,fileStreamHasher:()=>fileStreamHasher,readableStreamHasher:()=>readableStreamHasher});var init_checksum2=__esm({"node_modules/@smithy/core/dist-es/submodules/checksum/index.js"(){
266
267
  init_blobHasher();init_fileStreamHasher();init_readableStreamHasher();init_Md5Js();init_Md5Node();init_Crc32Js();init_Crc32Node();init_Sha256Js();init_Sha256Node();init_Sha256WebCrypto();init_chunked_blob_reader()}});export{require_dist_cjs,getSmithyContext,hasOwn,HttpRequest,HttpResponse,isValidHostLabel,isValidHostname,normalizeProvider,parseQueryString,parseUrl,init_transport,Client,deref,getSchemaSerdePlugin,translateTraits,NormalizedSchema,TypeRegistry,schema_exports,init_schema,Command,createAggregatedClient,ServiceException,decorateServiceException,loadConfigsForDefaultMode,emitWarningIfUnsupportedVersion,getDefaultExtensionConfiguration,resolveDefaultRuntimeConfig,getValueFromTextNode,NoOpLogger,makeBuilder,
267
268
  client_exports,init_client2 as init_client,fromBase64,fromUtf8,toBase64,toUtf8,expectUnion,dateToUtcString,parseRfc3339DateTimeWithOffset,parseRfc7231DateTime,parseEpochTimestamp,LazyJsonString,quoteHeader,_parseEpochTimestamp,_parseRfc3339DateTimeWithOffset,_parseRfc7231DateTime,splitEvery,splitHeader,NumericValue,nv,fromHex,toHex,calculateBodyLength,ProviderError,booleanSelector,SelectorType,loadConfig,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,REGION_ENV_NAME,
268
- REGION_INI_NAME,NODE_REGION_CONFIG_OPTIONS,NODE_REGION_CONFIG_FILE_OPTIONS,resolveRegionConfig,resolveDefaultsModeConfig,config_exports,init_config2 as init_config,resolveParams,BinaryDecisionDiagram,EndpointCache,EndpointError,customEndpointFunctions,isIpAddress,decideEndpoint,resolveEndpoint,resolveEndpointConfig,getEndpointPlugin,endpoints_exports,init_endpoints,sdkStreamMixin2 as sdkStreamMixin,Uint8ArrayBlobAdapter,v4,generateIdempotencyToken,serde_exports,init_serde,Crc32Node,Sha256Node,checksum_exports,
269
- init_checksum2 as init_checksum};
269
+ REGION_INI_NAME,NODE_REGION_CONFIG_OPTIONS,NODE_REGION_CONFIG_FILE_OPTIONS,resolveRegionConfig,resolveDefaultsModeConfig,config_exports,init_config2 as init_config,resolveParams,BinaryDecisionDiagram,EndpointCache,EndpointError,customEndpointFunctions,isIpAddress,decideEndpoint,resolveEndpoint,resolveEndpointConfig,getEndpointPlugin,endpoints_exports,init_endpoints,sdkStreamMixin2 as sdkStreamMixin,writeKey,Uint8ArrayBlobAdapter,v4,generateIdempotencyToken,serde_exports,init_serde,Crc32Node,Sha256Node,
270
+ checksum_exports,init_checksum2 as init_checksum};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
+ var e=(()=>{for(var e2=new Uint8Array(128),t=0;t<64;t++)e2[t<26?t+65:t<52?t+71:t<62?t-4:t*4-205]=t;return t2=>{for(var n=t2.length,r=new Uint8Array((n-(t2[n-1]=="=")-(t2[n-2]=="="))*3/4|0),i=0,a=0;i<n;){var o=e2[t2.charCodeAt(i++)],s=e2[t2.charCodeAt(i++)],c=e2[t2.charCodeAt(i++)],l=e2[t2.charCodeAt(i++)];r[a++]=o<<2|s>>4,r[a++]=s<<4|c>>2,r[a++]=c<<6|l}return r}})();export{e};
@@ -0,0 +1,24 @@
1
+ import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
2
+ import{mcpNamespace,require_proper_lockfile,validateMcpServerConfig}from"./chunk-6DE7LJKV.js";import{CONFIG_DIR_NAME,canonicalizePath,pathsEqual,resolvePath,stripBom}from"./chunk-IADQJFNH.js";import{__toESM}from"./chunk-JXWJOIH4.js";import{spawn}from"node:child_process";import{dirname,extname,isAbsolute,join}from"node:path";import{fileURLToPath}from"node:url";var WINDOWS_VIEWABLE=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".txt",".md",".log",".csv",".json",".pdf"]);function windowsLaunch(target){let systemRoot=process.env.SystemRoot??"C:\\Windows",rundll32=join(systemRoot,"System32","rundll32.exe"),path,url=URL.canParse(target)?new URL(target):void 0;if(!url||/^[a-z]:$/i.test(url.protocol))path=target;else{if(url.
3
+ protocol==="http:"||url.protocol==="https:"||url.protocol==="mailto:")return{file:rundll32,args:["url.dll,FileProtocolHandler",target]};if(url.protocol==="file:"&&!url.hostname)path=fileURLToPath(url);else return}if(!(!isAbsolute(path)||path.startsWith("\\\\")||path.startsWith("//")||path.includes('"')))return WINDOWS_VIEWABLE.has(extname(path).toLowerCase())?{file:rundll32,args:["url.dll,FileProtocolHandler",path]}:{file:join(systemRoot,"explorer.exe"),args:[`/select,"${path}"`],verbatim:!0}}function unixLaunch(target){
4
+ let darwin=process.platform==="darwin",url=URL.canParse(target)?new URL(target):void 0,path;if(!url)path=target;else{if(url.protocol==="http:"||url.protocol==="https:"||url.protocol==="mailto:")return{file:darwin?"open":"xdg-open",args:[url.href]};if(url.protocol==="file:"&&!url.hostname&&!/%2f/i.test(url.pathname))path=fileURLToPath(url);else return}if(!(!isAbsolute(path)||path.includes("\0")))return darwin?{file:"open",args:["-R",path]}:{file:"xdg-open",args:[dirname(path)]}}function openBrowser(target){
5
+ let launch;try{launch=process.platform==="win32"?windowsLaunch(target):unixLaunch(target)}catch{return}!launch||launch.args.some(argument=>argument.includes("\0"))||spawn(launch.file,launch.args,{stdio:"ignore",detached:!0,cwd:"/",...launch.verbatim&&{windowsVerbatimArguments:!0}}).on("error",()=>{}).unref()}var import_proper_lockfile=__toESM(require_proper_lockfile(),1);import{existsSync,mkdirSync,readFileSync,writeFileSync}from"node:fs";import{homedir}from"node:os";import{dirname as dirname2,join as join2}from"node:path";var TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES=["settings.json","mcp.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];function normalizeCwd(cwd){return canonicalizePath(resolvePath(cwd))}function findTrustFileKeys(data,path){return Object.keys(data).filter(key=>pathsEqual(key,path))}function findNearestTrustEntry(data,cwd){let currentDir=normalizeCwd(cwd);for(;;){for(let key of findTrustFileKeys(data,currentDir)){let value=data[key];if(value===!0||value===!1)return{path:key,
6
+ decision:value}}let parentDir=dirname2(currentDir);if(parentDir===currentDir)return null;currentDir=parentDir}}function getProjectTrustParentPath(cwd){let trustPath=normalizeCwd(cwd),parentDir=dirname2(trustPath);return parentDir===trustPath?void 0:parentDir}function getProjectTrustOptions(cwd,options){let trustPath=normalizeCwd(cwd),trustOptions=[{label:"Trust",trusted:!0,updates:[{path:trustPath,decision:!0}],savedPath:trustPath}],parentPath=getProjectTrustParentPath(cwd);return parentPath!==void 0&&
7
+ trustOptions.push({label:`Trust parent folder (${parentPath})`,trusted:!0,updates:[{path:parentPath,decision:!0},{path:trustPath,decision:null}],savedPath:parentPath}),options?.includeSessionOnly&&trustOptions.push({label:"Trust (this session only)",trusted:!0,updates:[]}),trustOptions.push({label:"Do not trust",trusted:!1,updates:[{path:trustPath,decision:!1}],savedPath:trustPath}),options?.includeSessionOnly&&trustOptions.push({label:"Do not trust (this session only)",trusted:!1,updates:[]}),trustOptions}
8
+ function readTrustFile(path){if(!existsSync(path))return{};let parsed;try{parsed=JSON.parse(stripBom(readFileSync(path,"utf-8")))}catch(error){let message=error instanceof Error?error.message:String(error);throw new Error(`Failed to read trust store ${path}: ${message}`)}if(typeof parsed!="object"||parsed===null||Array.isArray(parsed))throw new Error(`Invalid trust store ${path}: expected an object`);let data={};for(let[key,value]of Object.entries(parsed)){if(value!==!0&&value!==!1&&value!==null)
9
+ throw new Error(`Invalid trust store ${path}: value for ${JSON.stringify(key)} must be true, false, or null`);data[key]=value}return data}function writeTrustFile(path,data){let sorted={};for(let key of Object.keys(data).sort()){let value=data[key];(value===!0||value===!1||value===null)&&(sorted[key]=value)}mkdirSync(dirname2(path),{recursive:!0}),writeFileSync(path,`${JSON.stringify(sorted,null,2)}
10
+ `,"utf-8")}function acquireTrustLockSync(path){let trustDir=dirname2(path);mkdirSync(trustDir,{recursive:!0});let maxAttempts=10,delayMs=20,lastError;for(let attempt=1;attempt<=maxAttempts;attempt++)try{return import_proper_lockfile.default.lockSync(trustDir,{realpath:!1,lockfilePath:`${path}.lock`})}catch(error){if((typeof error=="object"&&error!==null&&"code"in error?String(error.code):void 0)!=="ELOCKED"||attempt===maxAttempts)throw error;lastError=error;let start=Date.now();for(;Date.now()-start<
11
+ delayMs;);}throw lastError instanceof Error?lastError:new Error("Failed to acquire trust store lock")}function withTrustFileLock(path,fn){let release=acquireTrustLockSync(path);try{return fn()}finally{release()}}function hasTrustRequiringProjectResources(cwd){let homeDir=canonicalizePath(resolvePath(process.env.HOME||homedir())),userAgentsSkillsDir=join2(homeDir,".agents","skills"),currentDir=canonicalizePath(resolvePath(cwd)),configDir=join2(currentDir,CONFIG_DIR_NAME);if(TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES.
12
+ some(entry=>existsSync(join2(configDir,entry))))return!0;for(;;){let agentsSkillsDir=join2(currentDir,".agents","skills");if(!pathsEqual(agentsSkillsDir,userAgentsSkillsDir)&&existsSync(agentsSkillsDir))return!0;let parentDir=dirname2(currentDir);if(parentDir===currentDir)return!1;currentDir=parentDir}}var ProjectTrustStore=class{trustPath;constructor(agentDir){this.trustPath=join2(resolvePath(agentDir),"trust.json")}get(cwd){return this.getEntry(cwd)?.decision??null}getEntry(cwd){return withTrustFileLock(
13
+ this.trustPath,()=>{let data=readTrustFile(this.trustPath);return findNearestTrustEntry(data,cwd)})}set(cwd,decision){this.setMany([{path:cwd,decision}])}setMany(decisions){withTrustFileLock(this.trustPath,()=>{let data=readTrustFile(this.trustPath);for(let{path,decision}of decisions){let key=normalizeCwd(path);for(let existingKey of findTrustFileKeys(data,key))delete data[existingKey];decision!==null&&(data[key]=decision)}writeTrustFile(this.trustPath,data)})}};var import_proper_lockfile2=__toESM(require_proper_lockfile(),1);import{randomUUID}from"node:crypto";import{chmodSync,existsSync as existsSync2,lstatSync,mkdirSync as mkdirSync2,readFileSync as readFileSync2,realpathSync,renameSync,rmSync,statSync,writeFileSync as writeFileSync2}from"node:fs";import{basename,dirname as dirname3,join as join3}from"node:path";var OVERRIDE_KEYS=["enabled","exposure","toolExposure"];function isOverride(value){return value.command===void 0&&value.url===void 0&&value.type===void 0}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function readConfigFile(path,scope,state){let{servers,errors}=state;if(!existsSync2(path))return;let parsed;try{parsed=JSON.parse(stripBom(readFileSync2(path,"utf8")))}catch(error){errors.push(`${path}: ${error instanceof Error?error.message:String(error)}`);
14
+ return}if(!isRecord(parsed)||parsed.mcpServers!==void 0&&!isRecord(parsed.mcpServers)){errors.push(`${path}: expected an object with an "mcpServers" object`);return}typeof parsed.autoEnableCodemode=="boolean"?state.autoEnableCodemode=parsed.autoEnableCodemode:parsed.autoEnableCodemode!==void 0&&errors.push(`${path}: autoEnableCodemode must be a boolean`);for(let[name,value]of Object.entries(parsed.mcpServers??{})){if(scope==="project"&&isRecord(value)&&isOverride(value)){let base=servers.get(name),
15
+ extra=Object.keys(value).filter(key=>!OVERRIDE_KEYS.includes(key));if(!base)errors.push(`${path}: server "${name}" needs "command" or "url", or a global server to override`);else if(extra.length>0)errors.push(`${path}: server "${name}": an override can only set ${OVERRIDE_KEYS.join(", ")}`);else{let config2=validateMcpServerConfig(name,{...base.config,...value});typeof config2=="string"?errors.push(`${path}: ${config2}`):servers.set(name,{...base,config:config2,override:path})}continue}let config=validateMcpServerConfig(
16
+ name,value);if(typeof config=="string"){errors.push(`${path}: ${config}`);continue}let clash=[...servers.keys()].find(other=>other!==name&&mcpNamespace(other)===mcpNamespace(name));if(clash){errors.push(`${path}: server "${name}" conflicts with "${clash}"`);continue}if(scope==="project"&&"url"in config&&config.auth){errors.push(`${path}: server "${name}": auth is only allowed in the global mcp.json`);continue}servers.set(name,{name,config,source:path,scope})}}function loadMcpConfig(options){let state={
17
+ servers:new Map,errors:[]};readConfigFile(join3(options.agentDir,"mcp.json"),"global",state);let projectConfig=options.projectTrusted?join3(options.cwd,CONFIG_DIR_NAME,"mcp.json"):void 0;return projectConfig&&readConfigFile(projectConfig,"project",state),{servers:[...state.servers.values()],...state.autoEnableCodemode===void 0?{}:{autoEnableCodemode:state.autoEnableCodemode},errors:state.errors,...projectConfig?{projectConfig}:{}}}function updateMcpServerConfig(path,name,patch,options={}){editMcpServers(
18
+ path,(servers,parsed)=>{let server=servers?.[name];if(server===void 0&&options.override&&(server={},parsed.mcpServers={...servers,[name]:server}),!isRecord(server))throw new Error(`${path} does not define MCP server "${name}"`);let keepDefaults=isOverride(server);return patch.enabled!==void 0&&(patch.enabled&&!keepDefaults?delete server.enabled:server.enabled=patch.enabled),patch.exposure!==void 0&&(patch.exposure==="codemode"&&!keepDefaults?delete server.exposure:server.exposure=patch.exposure),
19
+ !0})}function addMcpServerConfig(path,name,config){return updateMcpConfigLocked(path,servers=>{let replaced=servers[name]!==void 0;return servers[name]=config,replaced})}function updateMcpConfigLocked(path,mutate){let result;return editMcpServers(path,(servers,parsed)=>{let target=servers??{},before=JSON.stringify(target);return result=mutate(target),JSON.stringify(target)===before?!1:(parsed.mcpServers=target,!0)}),result}function removeMcpServerConfig(path,name){if(!existsSync2(path))return!1;let removed=!1;return editMcpServers(path,servers=>!servers||servers[name]===void 0?!1:(delete servers[name],removed=!0,!0)),removed}function parseMcpFile(path,text){let parsed=text===void 0?{}:JSON.parse(stripBom(text));if(!isRecord(parsed)||parsed.mcpServers!==void 0&&!isRecord(parsed.mcpServers))throw new Error(`${path}: expected an object with an "mcpServers" object`);return{parsed,servers:isRecord(parsed.mcpServers)?parsed.
20
+ mcpServers:void 0}}function canonicalMcpPath(path){mkdirSync2(dirname3(path),{recursive:!0});let isSymlink=!1;try{isSymlink=lstatSync(path).isSymbolicLink()}catch(error){if(error.code!=="ENOENT")throw error;return join3(realpathSync(dirname3(path)),basename(path))}try{return realpathSync(path)}catch(error){throw isSymlink&&error.code==="ENOENT"?new Error(`Refusing to modify ${path}: it is a dangling symlink. Create its target or remove the link.`):error}}function acquireMcpLockSync(path){let dir=dirname3(
21
+ path),maxAttempts=50,delayMs=20;for(let attempt=1;;attempt++)try{return import_proper_lockfile2.default.lockSync(dir,{realpath:!1,lockfilePath:`${path}.lock`})}catch(error){if((typeof error=="object"&&error!==null&&"code"in error?String(error.code):void 0)!=="ELOCKED"||attempt===maxAttempts)throw error;let start=Date.now();for(;Date.now()-start<delayMs;);}}function editMcpServers(path,edit){let canonical=canonicalMcpPath(path),release=acquireMcpLockSync(canonical);try{if(canonicalMcpPath(path)!==
22
+ canonical)throw new Error(`Refusing to modify ${path}: it changed while waiting for the lock. Retry.`);let text=existsSync2(canonical)?readFileSync2(canonical,"utf8"):void 0,{parsed,servers}=parseMcpFile(path,text);if(!edit(servers,parsed))return;let indent=text&&/^([ \t]+)\S/m.exec(text)?.[1]||" ",targetPath=canonical,tempPath=join3(dirname3(targetPath),`${randomUUID()}.tmp`),mode=text!==void 0?statSync(targetPath).mode&511:384;try{writeFileSync2(tempPath,`${JSON.stringify(parsed,null,indent)}\
23
+
24
+ `,{flag:"wx",mode}),chmodSync(tempPath,mode),renameSync(tempPath,targetPath)}catch(error){throw rmSync(tempPath,{force:!0}),error}}finally{release()}}export{openBrowser,getProjectTrustOptions,hasTrustRequiringProjectResources,ProjectTrustStore,loadMcpConfig,updateMcpServerConfig,addMcpServerConfig,updateMcpConfigLocked,removeMcpServerConfig};