@humain/terminal 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +17 -10
  3. package/dist/bundle/chunks/anthropic-messages-GDMGYAZB.js +6 -0
  4. package/dist/bundle/chunks/anthropic.js +75 -0
  5. package/dist/bundle/chunks/azure-openai-responses-ZN52D6YC.js +2 -0
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +77 -0
  7. package/dist/bundle/chunks/chunk-3VI4HD7D.js +31 -0
  8. package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
  9. package/dist/bundle/chunks/chunk-72KO4OMP.js +2 -0
  10. package/dist/bundle/chunks/chunk-74NVHVNZ.js +16 -0
  11. package/dist/bundle/chunks/chunk-7DDKXS2Q.js +2 -0
  12. package/dist/bundle/chunks/chunk-ARF4OE6X.js +105 -0
  13. package/dist/bundle/chunks/chunk-BOW22LW6.js +42 -0
  14. package/dist/bundle/chunks/chunk-BZQ53VGE.js +70 -0
  15. package/dist/bundle/chunks/chunk-CBHC6EL7.js +133 -0
  16. package/dist/bundle/chunks/chunk-D7XAASZM.js +4 -0
  17. package/dist/bundle/chunks/chunk-ECWELYBH.js +17 -0
  18. package/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
  19. package/dist/bundle/chunks/chunk-H2O6VOXT.js +11 -0
  20. package/dist/bundle/chunks/chunk-JUUC5AZY.js +2 -0
  21. package/dist/bundle/chunks/chunk-JXWJOIH4.js +2 -0
  22. package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
  23. package/dist/bundle/chunks/chunk-LVVZS2NO.js +12 -0
  24. package/dist/bundle/chunks/chunk-MA4UUCYX.js +18 -0
  25. package/dist/bundle/chunks/chunk-MMFBCF6F.js +5986 -0
  26. package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
  27. package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
  28. package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
  29. package/dist/bundle/chunks/chunk-PSKDLDLZ.js +44 -0
  30. package/dist/bundle/chunks/chunk-SGTGQNNP.js +4 -0
  31. package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
  32. package/dist/bundle/chunks/chunk-TXBQIIIO.js +2 -0
  33. package/dist/bundle/chunks/chunk-WJZ4KLGL.js +2 -0
  34. package/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
  35. package/dist/bundle/chunks/dist-BXEVYJIO.js +7 -0
  36. package/dist/bundle/chunks/es-P2KNSZYR.js +9 -0
  37. package/dist/bundle/chunks/es5-FGTJ7ZFW.js +2 -0
  38. package/dist/bundle/chunks/event-streams-JOSQQSII.js +2 -0
  39. package/dist/bundle/chunks/extract-2L7ZVN7F.js +106 -0
  40. package/dist/bundle/chunks/github-copilot.js +2 -0
  41. package/dist/bundle/chunks/google-generative-ai-FF7M7XHT.js +2 -0
  42. package/dist/bundle/chunks/google-vertex-YMUBFRBA.js +2 -0
  43. package/dist/bundle/chunks/https-proxy-agent-562J2I52.js +2 -0
  44. package/dist/bundle/chunks/image-resize-worker.js +2 -0
  45. package/dist/bundle/chunks/kimi-coding.js +2 -0
  46. package/dist/bundle/chunks/mistral-conversations-O4M7IQML.js +5 -0
  47. package/dist/bundle/chunks/multipart-parser-FMGQ7342.js +3 -0
  48. package/dist/bundle/chunks/node-XY3CBY3C.js +294 -0
  49. package/dist/bundle/chunks/node-ZHY4LHC7.js +15 -0
  50. package/dist/bundle/chunks/openai-codex-responses-HRVCDY54.js +8 -0
  51. package/dist/bundle/chunks/openai-codex.js +75 -0
  52. package/dist/bundle/chunks/openai-completions-L4AHDQ5D.js +7 -0
  53. package/dist/bundle/chunks/openai-responses-4MWLJHIK.js +2 -0
  54. package/dist/bundle/chunks/openrouter-images-Y2PCWAQH.js +2 -0
  55. package/dist/bundle/chunks/openrouter.js +75 -0
  56. package/dist/bundle/chunks/pdfjs-UKQT3OWY.js +107 -0
  57. package/dist/bundle/chunks/pi-messages-57K43J6J.js +8 -0
  58. package/dist/bundle/chunks/promise-J5TGSM32.js +2 -0
  59. package/dist/bundle/chunks/radius.js +75 -0
  60. package/dist/bundle/chunks/src-QKGKDFSU.js +4 -0
  61. package/dist/bundle/chunks/undici-D6ABF53Q.js +2 -0
  62. package/dist/bundle/chunks/webapi-AFS5FDJJ.js +5 -0
  63. package/dist/bundle/chunks/xai.js +2 -0
  64. package/dist/bundle/cli.js +3 -0
  65. package/dist/bundle/client.js +2 -0
  66. package/dist/bundle/index.js +2 -0
  67. package/dist/bundle/rpc-entry.js +3 -0
  68. package/dist/cli/args.d.ts +1 -0
  69. package/dist/cli/args.d.ts.map +1 -1
  70. package/dist/cli/args.js +29 -9
  71. package/dist/cli/args.js.map +1 -1
  72. package/dist/cli/file-processor.d.ts.map +1 -1
  73. package/dist/cli/file-processor.js +2 -1
  74. package/dist/cli/file-processor.js.map +1 -1
  75. package/dist/cli/startup-ui.d.ts.map +1 -1
  76. package/dist/cli/startup-ui.js +2 -1
  77. package/dist/cli/startup-ui.js.map +1 -1
  78. package/dist/config.d.ts +1 -0
  79. package/dist/config.d.ts.map +1 -1
  80. package/dist/config.js +19 -11
  81. package/dist/config.js.map +1 -1
  82. package/dist/core/agent-session.d.ts +62 -15
  83. package/dist/core/agent-session.d.ts.map +1 -1
  84. package/dist/core/agent-session.js +240 -104
  85. package/dist/core/agent-session.js.map +1 -1
  86. package/dist/core/auth-storage.d.ts.map +1 -1
  87. package/dist/core/auth-storage.js +6 -7
  88. package/dist/core/auth-storage.js.map +1 -1
  89. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  90. package/dist/core/compaction/branch-summarization.js +7 -3
  91. package/dist/core/compaction/branch-summarization.js.map +1 -1
  92. package/dist/core/compaction/compaction.d.ts +9 -3
  93. package/dist/core/compaction/compaction.d.ts.map +1 -1
  94. package/dist/core/compaction/compaction.js +59 -36
  95. package/dist/core/compaction/compaction.js.map +1 -1
  96. package/dist/core/defaults.d.ts +1 -0
  97. package/dist/core/defaults.d.ts.map +1 -1
  98. package/dist/core/defaults.js +9 -0
  99. package/dist/core/defaults.js.map +1 -1
  100. package/dist/core/extensions/index.d.ts +2 -2
  101. package/dist/core/extensions/index.d.ts.map +1 -1
  102. package/dist/core/extensions/index.js +1 -1
  103. package/dist/core/extensions/index.js.map +1 -1
  104. package/dist/core/extensions/loader.d.ts.map +1 -1
  105. package/dist/core/extensions/loader.js +115 -48
  106. package/dist/core/extensions/loader.js.map +1 -1
  107. package/dist/core/extensions/runner.d.ts +5 -0
  108. package/dist/core/extensions/runner.d.ts.map +1 -1
  109. package/dist/core/extensions/runner.js +44 -1
  110. package/dist/core/extensions/runner.js.map +1 -1
  111. package/dist/core/extensions/types.d.ts +56 -10
  112. package/dist/core/extensions/types.d.ts.map +1 -1
  113. package/dist/core/extensions/types.js +3 -0
  114. package/dist/core/extensions/types.js.map +1 -1
  115. package/dist/core/footer-data-provider.d.ts +1 -1
  116. package/dist/core/footer-data-provider.js +1 -1
  117. package/dist/core/footer-data-provider.js.map +1 -1
  118. package/dist/core/keybindings.d.ts +20 -19
  119. package/dist/core/keybindings.d.ts.map +1 -1
  120. package/dist/core/keybindings.js +26 -5
  121. package/dist/core/keybindings.js.map +1 -1
  122. package/dist/core/model-config.d.ts +5 -0
  123. package/dist/core/model-config.d.ts.map +1 -1
  124. package/dist/core/model-config.js +3 -1
  125. package/dist/core/model-config.js.map +1 -1
  126. package/dist/core/model-resolver.d.ts +1 -0
  127. package/dist/core/model-resolver.d.ts.map +1 -1
  128. package/dist/core/model-resolver.js +14 -8
  129. package/dist/core/model-resolver.js.map +1 -1
  130. package/dist/core/models-store.d.ts.map +1 -1
  131. package/dist/core/models-store.js +2 -1
  132. package/dist/core/models-store.js.map +1 -1
  133. package/dist/core/package-manager.d.ts.map +1 -1
  134. package/dist/core/package-manager.js +22 -14
  135. package/dist/core/package-manager.js.map +1 -1
  136. package/dist/core/pi-manifest.d.ts.map +1 -1
  137. package/dist/core/pi-manifest.js +2 -1
  138. package/dist/core/pi-manifest.js.map +1 -1
  139. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  140. package/dist/core/remote-catalog-provider.js +2 -1
  141. package/dist/core/remote-catalog-provider.js.map +1 -1
  142. package/dist/core/resource-loader.d.ts.map +1 -1
  143. package/dist/core/resource-loader.js +3 -2
  144. package/dist/core/resource-loader.js.map +1 -1
  145. package/dist/core/sdk.d.ts +2 -2
  146. package/dist/core/sdk.d.ts.map +1 -1
  147. package/dist/core/sdk.js +10 -3
  148. package/dist/core/sdk.js.map +1 -1
  149. package/dist/core/session-export.d.ts +4 -0
  150. package/dist/core/session-export.d.ts.map +1 -0
  151. package/dist/core/session-export.js +32 -0
  152. package/dist/core/session-export.js.map +1 -0
  153. package/dist/core/session-manager.d.ts.map +1 -1
  154. package/dist/core/session-manager.js +6 -3
  155. package/dist/core/session-manager.js.map +1 -1
  156. package/dist/core/settings-diagnostics.d.ts +9 -0
  157. package/dist/core/settings-diagnostics.d.ts.map +1 -0
  158. package/dist/core/settings-diagnostics.js +21 -0
  159. package/dist/core/settings-diagnostics.js.map +1 -0
  160. package/dist/core/settings-manager.d.ts +17 -1
  161. package/dist/core/settings-manager.d.ts.map +1 -1
  162. package/dist/core/settings-manager.js +68 -10
  163. package/dist/core/settings-manager.js.map +1 -1
  164. package/dist/core/skills.d.ts.map +1 -1
  165. package/dist/core/skills.js +51 -33
  166. package/dist/core/skills.js.map +1 -1
  167. package/dist/core/slash-commands.d.ts.map +1 -1
  168. package/dist/core/slash-commands.js +2 -1
  169. package/dist/core/slash-commands.js.map +1 -1
  170. package/dist/core/system-prompt.d.ts.map +1 -1
  171. package/dist/core/system-prompt.js +11 -2
  172. package/dist/core/system-prompt.js.map +1 -1
  173. package/dist/core/tools/bash.d.ts +16 -3
  174. package/dist/core/tools/bash.d.ts.map +1 -1
  175. package/dist/core/tools/bash.js +62 -29
  176. package/dist/core/tools/bash.js.map +1 -1
  177. package/dist/core/tools/edit-diff.d.ts +0 -5
  178. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  179. package/dist/core/tools/edit-diff.js +2 -5
  180. package/dist/core/tools/edit-diff.js.map +1 -1
  181. package/dist/core/tools/edit.d.ts.map +1 -1
  182. package/dist/core/tools/edit.js +20 -4
  183. package/dist/core/tools/edit.js.map +1 -1
  184. package/dist/core/tools/index.d.ts +4 -1
  185. package/dist/core/tools/index.d.ts.map +1 -1
  186. package/dist/core/tools/index.js +19 -1
  187. package/dist/core/tools/index.js.map +1 -1
  188. package/dist/core/tools/powershell.d.ts +16 -0
  189. package/dist/core/tools/powershell.d.ts.map +1 -0
  190. package/dist/core/tools/powershell.js +39 -0
  191. package/dist/core/tools/powershell.js.map +1 -0
  192. package/dist/core/tools/subagent.d.ts.map +1 -1
  193. package/dist/core/tools/subagent.js +4 -1
  194. package/dist/core/tools/subagent.js.map +1 -1
  195. package/dist/core/trust-manager.d.ts.map +1 -1
  196. package/dist/core/trust-manager.js +2 -1
  197. package/dist/core/trust-manager.js.map +1 -1
  198. package/dist/extensions/llama/client.d.ts +6 -0
  199. package/dist/extensions/llama/client.d.ts.map +1 -1
  200. package/dist/extensions/llama/client.js +7 -0
  201. package/dist/extensions/llama/client.js.map +1 -1
  202. package/dist/extensions/llama/index.d.ts.map +1 -1
  203. package/dist/extensions/llama/index.js +2 -0
  204. package/dist/extensions/llama/index.js.map +1 -1
  205. package/dist/extensions/llama/provider.d.ts +3 -1
  206. package/dist/extensions/llama/provider.d.ts.map +1 -1
  207. package/dist/extensions/llama/provider.js +29 -4
  208. package/dist/extensions/llama/provider.js.map +1 -1
  209. package/dist/humain/agent-execution-protocol.d.ts +1 -217
  210. package/dist/humain/agent-execution-protocol.d.ts.map +1 -1
  211. package/dist/humain/agent-execution-protocol.js +1 -203
  212. package/dist/humain/agent-execution-protocol.js.map +1 -1
  213. package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +107 -16
  214. package/dist/humain/mcp-adapter/vendor/CHANGELOG.md +82 -0
  215. package/dist/humain/mcp-adapter/vendor/README.md +47 -15
  216. package/dist/humain/mcp-adapter/vendor/cli.js +4 -4
  217. package/dist/humain/mcp-adapter/vendor/commands.ts +5 -3
  218. package/dist/humain/mcp-adapter/vendor/config.ts +46 -5
  219. package/dist/humain/mcp-adapter/vendor/direct-tools.ts +103 -92
  220. package/dist/humain/mcp-adapter/vendor/dist/agent-dir.d.ts +10 -0
  221. package/dist/humain/mcp-adapter/vendor/dist/agent-dir.js +63 -0
  222. package/dist/humain/mcp-adapter/vendor/dist/agent-dir.js.map +1 -0
  223. package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.d.ts +8 -0
  224. package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.js +356 -0
  225. package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.js.map +1 -0
  226. package/dist/humain/mcp-adapter/vendor/dist/config.d.ts +123 -0
  227. package/dist/humain/mcp-adapter/vendor/dist/config.js +1088 -0
  228. package/dist/humain/mcp-adapter/vendor/dist/config.js.map +1 -0
  229. package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.d.ts +24 -0
  230. package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.js +336 -0
  231. package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.js.map +1 -0
  232. package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.d.ts +19 -0
  233. package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.js +319 -0
  234. package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.js.map +1 -0
  235. package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.d.ts +2 -0
  236. package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.js +156 -0
  237. package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.js.map +1 -0
  238. package/dist/humain/mcp-adapter/vendor/dist/resource-tools.d.ts +1 -0
  239. package/dist/humain/mcp-adapter/vendor/dist/resource-tools.js +15 -0
  240. package/dist/humain/mcp-adapter/vendor/dist/resource-tools.js.map +1 -0
  241. package/dist/humain/mcp-adapter/vendor/dist/types.d.ts +566 -0
  242. package/dist/humain/mcp-adapter/vendor/dist/types.js +287 -0
  243. package/dist/humain/mcp-adapter/vendor/dist/types.js.map +1 -0
  244. package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.d.ts +6 -0
  245. package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.js +37 -0
  246. package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.js.map +1 -0
  247. package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.d.ts +104 -0
  248. package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.js +59 -0
  249. package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.js.map +1 -0
  250. package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.d.ts +4 -0
  251. package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.js +27 -0
  252. package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.js.map +1 -0
  253. package/dist/humain/mcp-adapter/vendor/dist/utils.d.ts +32 -0
  254. package/dist/humain/mcp-adapter/vendor/dist/utils.js +338 -0
  255. package/dist/humain/mcp-adapter/vendor/dist/utils.js.map +1 -0
  256. package/dist/humain/mcp-adapter/vendor/failure-backoff.ts +23 -0
  257. package/dist/humain/mcp-adapter/vendor/index.bundle.mjs +4870 -3878
  258. package/dist/humain/mcp-adapter/vendor/index.ts +294 -88
  259. package/dist/humain/mcp-adapter/vendor/init.ts +41 -30
  260. package/dist/humain/mcp-adapter/vendor/lifecycle.ts +16 -8
  261. package/dist/humain/mcp-adapter/vendor/mcp-auth-flow.ts +124 -32
  262. package/dist/humain/mcp-adapter/vendor/mcp-bearer-store.ts +0 -2
  263. package/dist/humain/mcp-adapter/vendor/mcp-code.ts +2 -0
  264. package/dist/humain/mcp-adapter/vendor/mcp-oauth-provider.ts +155 -16
  265. package/dist/humain/mcp-adapter/vendor/mcp-output-guard.ts +95 -7
  266. package/dist/humain/mcp-adapter/vendor/mcp-probe.ts +18 -4
  267. package/dist/humain/mcp-adapter/vendor/mcp-references.ts +376 -0
  268. package/dist/humain/mcp-adapter/vendor/mcp-status.ts +8 -19
  269. package/dist/humain/mcp-adapter/vendor/metadata-cache.ts +20 -12
  270. package/dist/humain/mcp-adapter/vendor/namespace-tools.ts +276 -0
  271. package/dist/humain/mcp-adapter/vendor/package.json +26 -8
  272. package/dist/humain/mcp-adapter/vendor/proxy-modes.ts +128 -32
  273. package/dist/humain/mcp-adapter/vendor/request-headers-command.ts +1 -1
  274. package/dist/humain/mcp-adapter/vendor/search-ranking.ts +2 -0
  275. package/dist/humain/mcp-adapter/vendor/server-manager.ts +69 -12
  276. package/dist/humain/mcp-adapter/vendor/state.ts +1 -3
  277. package/dist/humain/mcp-adapter/vendor/tool-result-renderer.ts +16 -2
  278. package/dist/humain/mcp-adapter/vendor/types.ts +51 -2
  279. package/dist/humain/mcp-adapter/vendor/ui-server.ts +3 -19
  280. package/dist/humain/mcp-adapter/vendor/ui-session.ts +2 -1
  281. package/dist/humain/mcp-adapter/vendor/utils.ts +21 -19
  282. package/dist/humain/mcp-adapter.d.ts.map +1 -1
  283. package/dist/humain/mcp-adapter.js +4 -0
  284. package/dist/humain/mcp-adapter.js.map +1 -1
  285. package/dist/humain/web-access/vendor/chrome-cookies.d.ts +14 -0
  286. package/dist/humain/web-access/vendor/chrome-cookies.d.ts.map +1 -1
  287. package/dist/humain/web-access/vendor/chrome-cookies.js +85 -33
  288. package/dist/humain/web-access/vendor/chrome-cookies.js.map +1 -1
  289. package/dist/humain/web-access/vendor/credential-source.d.ts +1 -1
  290. package/dist/humain/web-access/vendor/credential-source.d.ts.map +1 -1
  291. package/dist/humain/web-access/vendor/credential-source.js +3 -1
  292. package/dist/humain/web-access/vendor/credential-source.js.map +1 -1
  293. package/dist/humain/web-access/vendor/curator-page.d.ts +2 -29
  294. package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
  295. package/dist/humain/web-access/vendor/curator-page.js +10 -1
  296. package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
  297. package/dist/humain/web-access/vendor/curator-server.d.ts +2 -29
  298. package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
  299. package/dist/humain/web-access/vendor/curator-server.js +4 -0
  300. package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
  301. package/dist/humain/web-access/vendor/extract.d.ts +11 -0
  302. package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
  303. package/dist/humain/web-access/vendor/extract.js +163 -20
  304. package/dist/humain/web-access/vendor/extract.js.map +1 -1
  305. package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -0
  306. package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
  307. package/dist/humain/web-access/vendor/fetch-params.js +11 -0
  308. package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
  309. package/dist/humain/web-access/vendor/gemini-adc.d.ts +10 -0
  310. package/dist/humain/web-access/vendor/gemini-adc.d.ts.map +1 -0
  311. package/dist/humain/web-access/vendor/gemini-adc.js +268 -0
  312. package/dist/humain/web-access/vendor/gemini-adc.js.map +1 -0
  313. package/dist/humain/web-access/vendor/gemini-api.d.ts +7 -1
  314. package/dist/humain/web-access/vendor/gemini-api.d.ts.map +1 -1
  315. package/dist/humain/web-access/vendor/gemini-api.js +51 -15
  316. package/dist/humain/web-access/vendor/gemini-api.js.map +1 -1
  317. package/dist/humain/web-access/vendor/gemini-search.d.ts +9 -4
  318. package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
  319. package/dist/humain/web-access/vendor/gemini-search.js +63 -21
  320. package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
  321. package/dist/humain/web-access/vendor/gemini-url-context.d.ts.map +1 -1
  322. package/dist/humain/web-access/vendor/gemini-url-context.js +3 -2
  323. package/dist/humain/web-access/vendor/gemini-url-context.js.map +1 -1
  324. package/dist/humain/web-access/vendor/gemini-web-config.d.ts +8 -1
  325. package/dist/humain/web-access/vendor/gemini-web-config.d.ts.map +1 -1
  326. package/dist/humain/web-access/vendor/gemini-web-config.js +49 -4
  327. package/dist/humain/web-access/vendor/gemini-web-config.js.map +1 -1
  328. package/dist/humain/web-access/vendor/gemini-web.d.ts +2 -1
  329. package/dist/humain/web-access/vendor/gemini-web.d.ts.map +1 -1
  330. package/dist/humain/web-access/vendor/gemini-web.js +8 -3
  331. package/dist/humain/web-access/vendor/gemini-web.js.map +1 -1
  332. package/dist/humain/web-access/vendor/github-api.d.ts +1 -1
  333. package/dist/humain/web-access/vendor/github-api.d.ts.map +1 -1
  334. package/dist/humain/web-access/vendor/github-api.js +6 -4
  335. package/dist/humain/web-access/vendor/github-api.js.map +1 -1
  336. package/dist/humain/web-access/vendor/github-extract.d.ts.map +1 -1
  337. package/dist/humain/web-access/vendor/github-extract.js +50 -3
  338. package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
  339. package/dist/humain/web-access/vendor/github-issue-pr.d.ts +27 -0
  340. package/dist/humain/web-access/vendor/github-issue-pr.d.ts.map +1 -0
  341. package/dist/humain/web-access/vendor/github-issue-pr.js +701 -0
  342. package/dist/humain/web-access/vendor/github-issue-pr.js.map +1 -0
  343. package/dist/humain/web-access/vendor/index.d.ts +3 -31
  344. package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
  345. package/dist/humain/web-access/vendor/index.js +643 -530
  346. package/dist/humain/web-access/vendor/index.js.map +1 -1
  347. package/dist/humain/web-access/vendor/kimi-search.d.ts +5 -0
  348. package/dist/humain/web-access/vendor/kimi-search.d.ts.map +1 -0
  349. package/dist/humain/web-access/vendor/kimi-search.js +228 -0
  350. package/dist/humain/web-access/vendor/kimi-search.js.map +1 -0
  351. package/dist/humain/web-access/vendor/openai-search.d.ts +3 -0
  352. package/dist/humain/web-access/vendor/openai-search.d.ts.map +1 -1
  353. package/dist/humain/web-access/vendor/openai-search.js +89 -16
  354. package/dist/humain/web-access/vendor/openai-search.js.map +1 -1
  355. package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
  356. package/dist/humain/web-access/vendor/page-query.js +56 -8
  357. package/dist/humain/web-access/vendor/page-query.js.map +1 -1
  358. package/dist/humain/web-access/vendor/ssrf-protection.js +6 -1
  359. package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
  360. package/dist/humain/web-access/vendor/utils.d.ts +12 -0
  361. package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
  362. package/dist/humain/web-access/vendor/utils.js +343 -1
  363. package/dist/humain/web-access/vendor/utils.js.map +1 -1
  364. package/dist/humain/web-access/vendor/xcrawl.d.ts +4 -0
  365. package/dist/humain/web-access/vendor/xcrawl.d.ts.map +1 -0
  366. package/dist/humain/web-access/vendor/xcrawl.js +251 -0
  367. package/dist/humain/web-access/vendor/xcrawl.js.map +1 -0
  368. package/dist/humain/web-access/vendor/youtube-extract.js +2 -2
  369. package/dist/humain/web-access/vendor/youtube-extract.js.map +1 -1
  370. package/dist/index.d.ts +6 -5
  371. package/dist/index.d.ts.map +1 -1
  372. package/dist/index.js +5 -4
  373. package/dist/index.js.map +1 -1
  374. package/dist/main.d.ts +3 -0
  375. package/dist/main.d.ts.map +1 -1
  376. package/dist/main.js +19 -14
  377. package/dist/main.js.map +1 -1
  378. package/dist/migrations.d.ts.map +1 -1
  379. package/dist/migrations.js +4 -3
  380. package/dist/migrations.js.map +1 -1
  381. package/dist/modes/interactive/components/model-selector.d.ts +9 -3
  382. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  383. package/dist/modes/interactive/components/model-selector.js +53 -10
  384. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  385. package/dist/modes/interactive/components/settings-selector.d.ts +9 -2
  386. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  387. package/dist/modes/interactive/components/settings-selector.js +128 -55
  388. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  389. package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
  390. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
  391. package/dist/modes/interactive/components/settings-submenu.js +151 -0
  392. package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
  393. package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
  394. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  395. package/dist/modes/interactive/components/thinking-selector.js +68 -17
  396. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  397. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  398. package/dist/modes/interactive/external-editor.js +2 -1
  399. package/dist/modes/interactive/external-editor.js.map +1 -1
  400. package/dist/modes/interactive/interactive-mode.d.ts +15 -0
  401. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  402. package/dist/modes/interactive/interactive-mode.js +224 -130
  403. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  404. package/dist/modes/interactive/session-share.d.ts +16 -0
  405. package/dist/modes/interactive/session-share.d.ts.map +1 -0
  406. package/dist/modes/interactive/session-share.js +188 -0
  407. package/dist/modes/interactive/session-share.js.map +1 -0
  408. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  409. package/dist/modes/interactive/theme/theme.js +6 -5
  410. package/dist/modes/interactive/theme/theme.js.map +1 -1
  411. package/dist/modes/json-event.d.ts +16 -13
  412. package/dist/modes/json-event.d.ts.map +1 -1
  413. package/dist/modes/json-event.js +20 -6
  414. package/dist/modes/json-event.js.map +1 -1
  415. package/dist/modes/rpc/rpc-client.d.ts +7 -0
  416. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  417. package/dist/modes/rpc/rpc-client.js +10 -2
  418. package/dist/modes/rpc/rpc-client.js.map +1 -1
  419. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  420. package/dist/modes/rpc/rpc-mode.js +3 -0
  421. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  422. package/dist/modes/rpc/rpc-types.d.ts +14 -7
  423. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  424. package/dist/modes/rpc/rpc-types.js.map +1 -1
  425. package/dist/package-manager-cli.d.ts +1 -0
  426. package/dist/package-manager-cli.d.ts.map +1 -1
  427. package/dist/package-manager-cli.js +189 -3
  428. package/dist/package-manager-cli.js.map +1 -1
  429. package/dist/utils/changelog.d.ts +1 -1
  430. package/dist/utils/changelog.d.ts.map +1 -1
  431. package/dist/utils/changelog.js +12 -2
  432. package/dist/utils/changelog.js.map +1 -1
  433. package/dist/utils/frontmatter.d.ts.map +1 -1
  434. package/dist/utils/frontmatter.js +2 -1
  435. package/dist/utils/frontmatter.js.map +1 -1
  436. package/dist/utils/management-http.d.ts +5 -3
  437. package/dist/utils/management-http.d.ts.map +1 -1
  438. package/dist/utils/management-http.js +14 -10
  439. package/dist/utils/management-http.js.map +1 -1
  440. package/dist/utils/shell.d.ts +3 -0
  441. package/dist/utils/shell.d.ts.map +1 -1
  442. package/dist/utils/shell.js +23 -9
  443. package/dist/utils/shell.js.map +1 -1
  444. package/dist/utils/syntax-highlight.d.ts +1 -0
  445. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  446. package/dist/utils/syntax-highlight.js +64 -1
  447. package/dist/utils/syntax-highlight.js.map +1 -1
  448. package/dist/utils/text.d.ts +8 -0
  449. package/dist/utils/text.d.ts.map +1 -0
  450. package/dist/utils/text.js +9 -0
  451. package/dist/utils/text.js.map +1 -0
  452. package/dist/utils/version-check.js +4 -4
  453. package/dist/utils/version-check.js.map +1 -1
  454. package/docs/compaction.md +17 -0
  455. package/docs/custom-provider.md +12 -9
  456. package/docs/environment-variables.md +11 -8
  457. package/docs/extensions.md +35 -7
  458. package/docs/json.md +7 -2
  459. package/docs/keybindings.md +9 -9
  460. package/docs/llama-cpp.md +2 -0
  461. package/docs/models.md +8 -2
  462. package/docs/packages.md +2 -2
  463. package/docs/quickstart.md +1 -1
  464. package/docs/rpc.md +32 -3
  465. package/docs/sdk.md +7 -2
  466. package/docs/settings.md +23 -7
  467. package/docs/skills.md +3 -2
  468. package/docs/terminal-setup.md +20 -0
  469. package/docs/usage.md +14 -10
  470. package/docs/windows.md +15 -1
  471. package/examples/extensions/border-status-editor.ts +1 -1
  472. package/examples/extensions/custom-provider-anthropic/package-lock.json +70 -8
  473. package/examples/extensions/custom-provider-anthropic/package.json +2 -2
  474. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  475. package/examples/extensions/git-checkpoint.ts +2 -2
  476. package/examples/extensions/gondolin/package-lock.json +2 -2
  477. package/examples/extensions/gondolin/package.json +1 -1
  478. package/examples/extensions/notify.ts +3 -1
  479. package/examples/extensions/sandbox/package-lock.json +14 -40
  480. package/examples/extensions/sandbox/package.json +2 -2
  481. package/examples/extensions/titlebar-spinner.ts +1 -1
  482. package/examples/extensions/with-deps/package-lock.json +4 -4
  483. package/examples/extensions/with-deps/package.json +1 -1
  484. package/examples/rpc-extension-ui.ts +1 -1
  485. package/examples/sdk/06-extensions.ts +1 -1
  486. package/examples/sdk/README.md +1 -1
  487. package/npm-shrinkwrap.json +293 -221
  488. package/package.json +21 -18
  489. package/src/humain/mcp-adapter/UPSTREAM.md +15 -5
  490. package/src/humain/mcp-adapter/upstream.json +4 -3
  491. package/src/humain/mcp-adapter/vendor/CHANGELOG.md +82 -0
  492. package/src/humain/web-access/UPSTREAM.md +1 -1
  493. package/src/humain/web-access/upstream.json +6 -4
@@ -0,0 +1,356 @@
1
+ import { existsSync, readFileSync, statSync } from "node:fs";
2
+ import { isAbsolute, relative, resolve, sep } from "node:path";
3
+ import { getAgentPath } from "./agent-dir.js";
4
+ const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
5
+ const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
6
+ const PLUGIN_NAME_PATTERN = /^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/;
7
+ const PLUGIN_MANIFEST_FIELDS = new Set([
8
+ "$schema",
9
+ "name",
10
+ "version",
11
+ "description",
12
+ "author",
13
+ "homepage",
14
+ "repository",
15
+ "license",
16
+ "keywords",
17
+ "extensions",
18
+ ]);
19
+ const MCP_CONFIG_FIELDS = new Set(["$schema", "mcpServers"]);
20
+ const STDIO_FIELDS = new Set(["type", "command", "args", "env", "cwd"]);
21
+ const HTTP_FIELDS = new Set(["type", "url", "headers"]);
22
+ export function loadAgentPluginConfigs(paths, cwd = process.cwd()) {
23
+ const mcpServers = {};
24
+ for (const pluginPath of getPluginPaths(paths)) {
25
+ const loaded = loadAgentPluginMcpConfig(pluginPath, cwd);
26
+ if (!loaded)
27
+ continue;
28
+ for (const [serverName, server] of Object.entries(loaded.mcpServers)) {
29
+ if (mcpServers[serverName]) {
30
+ console.warn(`Agent Plugin at ${resolvePluginPath(pluginPath, cwd)} skips duplicate normalized MCP server ${serverName}`);
31
+ continue;
32
+ }
33
+ mcpServers[serverName] = server;
34
+ }
35
+ }
36
+ return { mcpServers };
37
+ }
38
+ export function getAgentPluginSummaries(paths, cwd = process.cwd()) {
39
+ return getPluginPaths(paths).map(path => {
40
+ const pluginRoot = resolvePluginPath(path, cwd);
41
+ const loaded = loadAgentPluginMcpConfig(path, cwd);
42
+ const manifest = loaded ? readPluginManifest(pluginRoot, false) : null;
43
+ return {
44
+ path: pluginRoot,
45
+ ...(manifest?.name ? { name: manifest.name } : {}),
46
+ serverCount: loaded ? Object.keys(loaded.mcpServers).length : 0,
47
+ };
48
+ });
49
+ }
50
+ function getPluginPaths(paths) {
51
+ return Array.isArray(paths) ? paths.filter((path) => typeof path === "string") : [];
52
+ }
53
+ function loadAgentPluginMcpConfig(path, cwd) {
54
+ const pluginRoot = resolvePluginPath(path, cwd);
55
+ const manifest = readPluginManifest(pluginRoot, true);
56
+ if (!manifest)
57
+ return null;
58
+ const mcpPath = resolve(pluginRoot, "mcp.json");
59
+ if (!existsSync(mcpPath))
60
+ return { mcpServers: {} };
61
+ if (!statSync(mcpPath).isFile()) {
62
+ console.warn(`Agent Plugin ${manifest.name} has invalid MCP config: mcp.json is not a regular file`);
63
+ return { mcpServers: {} };
64
+ }
65
+ let raw;
66
+ try {
67
+ raw = JSON.parse(readFileSync(mcpPath, "utf8"));
68
+ }
69
+ catch (error) {
70
+ console.warn(`Agent Plugin ${manifest.name} has invalid MCP config: failed to parse mcp.json`, error);
71
+ return { mcpServers: {} };
72
+ }
73
+ return translateAgentPluginMcpConfig(raw, manifest, pluginRoot);
74
+ }
75
+ function readPluginManifest(pluginRoot, report) {
76
+ const manifestPath = resolve(pluginRoot, "plugin.json");
77
+ if (!existsSync(manifestPath)) {
78
+ if (report)
79
+ console.warn(`Agent Plugin at ${pluginRoot} is invalid: missing plugin.json`);
80
+ return null;
81
+ }
82
+ if (!statSync(manifestPath).isFile()) {
83
+ if (report)
84
+ console.warn(`Agent Plugin at ${pluginRoot} is invalid: plugin.json is not a regular file`);
85
+ return null;
86
+ }
87
+ let raw;
88
+ try {
89
+ raw = JSON.parse(readFileSync(manifestPath, "utf8"));
90
+ }
91
+ catch (error) {
92
+ if (report)
93
+ console.warn(`Agent Plugin at ${pluginRoot} is invalid: failed to parse plugin.json`, error);
94
+ return null;
95
+ }
96
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
97
+ if (report)
98
+ console.warn(`Agent Plugin at ${pluginRoot} is invalid: plugin.json must be an object`);
99
+ return null;
100
+ }
101
+ const manifest = raw;
102
+ for (const key of Object.keys(manifest)) {
103
+ if (!PLUGIN_MANIFEST_FIELDS.has(key) && report) {
104
+ console.warn(`Agent Plugin at ${pluginRoot} ignores unknown plugin.json field: ${key}`);
105
+ }
106
+ }
107
+ if (manifest.$schema !== PLUGIN_SCHEMA) {
108
+ if (report)
109
+ console.warn(`Agent Plugin at ${pluginRoot} is invalid: unsupported plugin.json $schema`);
110
+ return null;
111
+ }
112
+ if (typeof manifest.name !== "string" || manifest.name.length < 1 || manifest.name.length > 64 || !PLUGIN_NAME_PATTERN.test(manifest.name)) {
113
+ if (report)
114
+ console.warn(`Agent Plugin at ${pluginRoot} is invalid: plugin.json name is invalid`);
115
+ return null;
116
+ }
117
+ if (manifest.extensions !== undefined && (!manifest.extensions || typeof manifest.extensions !== "object" || Array.isArray(manifest.extensions))) {
118
+ if (report)
119
+ console.warn(`Agent Plugin ${manifest.name} ignores non-object plugin.json extensions`);
120
+ }
121
+ return { name: manifest.name };
122
+ }
123
+ function translateAgentPluginMcpConfig(raw, manifest, pluginRoot) {
124
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
125
+ console.warn(`Agent Plugin ${manifest.name} has invalid MCP config: mcp.json must be an object`);
126
+ return { mcpServers: {} };
127
+ }
128
+ const mcpConfig = raw;
129
+ for (const key of Object.keys(mcpConfig)) {
130
+ if (!MCP_CONFIG_FIELDS.has(key)) {
131
+ console.warn(`Agent Plugin ${manifest.name} has invalid MCP config: unknown top-level field ${key}`);
132
+ return { mcpServers: {} };
133
+ }
134
+ }
135
+ if (mcpConfig.$schema !== MCP_SCHEMA) {
136
+ console.warn(`Agent Plugin ${manifest.name} has invalid MCP config: unsupported mcp.json $schema`);
137
+ return { mcpServers: {} };
138
+ }
139
+ if (!mcpConfig.mcpServers || typeof mcpConfig.mcpServers !== "object" || Array.isArray(mcpConfig.mcpServers)) {
140
+ console.warn(`Agent Plugin ${manifest.name} has invalid MCP config: mcpServers must be an object`);
141
+ return { mcpServers: {} };
142
+ }
143
+ const mcpServers = {};
144
+ for (const [serverName, entry] of Object.entries(mcpConfig.mcpServers)) {
145
+ const translated = translateAgentPluginServer(manifest, pluginRoot, serverName, entry);
146
+ if (!translated)
147
+ continue;
148
+ const normalizedName = formatAgentPluginServerName(manifest.name, serverName);
149
+ if (mcpServers[normalizedName]) {
150
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: normalized server name ${normalizedName} already exists`);
151
+ continue;
152
+ }
153
+ mcpServers[normalizedName] = translated;
154
+ }
155
+ return { mcpServers };
156
+ }
157
+ function translateAgentPluginServer(manifest, pluginRoot, serverName, entry) {
158
+ if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
159
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: entry must be an object`);
160
+ return null;
161
+ }
162
+ const raw = entry;
163
+ if (raw.type === "stdio")
164
+ return translateStdioServer(manifest, pluginRoot, serverName, raw);
165
+ if (raw.type === "streamable-http" || raw.type === "sse")
166
+ return translateHttpServer(manifest, serverName, raw, raw.type);
167
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: unsupported type`);
168
+ return null;
169
+ }
170
+ function translateStdioServer(manifest, pluginRoot, serverName, raw) {
171
+ for (const key of Object.keys(raw)) {
172
+ if (!STDIO_FIELDS.has(key))
173
+ return skipServer(manifest, serverName, `unknown field ${key}`);
174
+ }
175
+ if (typeof raw.command !== "string" || raw.command.length === 0)
176
+ return skipServer(manifest, serverName, "command must be a non-empty string");
177
+ if (!isBareCommand(raw.command) && !raw.command.startsWith("./"))
178
+ return skipServer(manifest, serverName, "command must be bare or plugin-relative");
179
+ const args = translateStringArray(raw.args, manifest, serverName, "args");
180
+ if (args === null)
181
+ return null;
182
+ const env = translateEnv(raw.env, manifest, serverName);
183
+ if (env === null)
184
+ return null;
185
+ const command = raw.command.startsWith("./") ? resolveContainedPath(pluginRoot, raw.command, pluginRoot) : raw.command;
186
+ if (command === null)
187
+ return skipServer(manifest, serverName, "command must stay inside the plugin directory");
188
+ const pluginDataDir = getAgentPath("agent-plugin-data", manifest.name);
189
+ const cwd = resolvePluginCwd(raw.cwd, pluginRoot, pluginDataDir);
190
+ if (cwd === null)
191
+ return skipServer(manifest, serverName, "cwd must be plugin-relative, PLUGIN_ROOT-rooted, or PLUGIN_DATA-rooted");
192
+ return {
193
+ command,
194
+ args: args.map(value => expandPluginPlaceholders(value, pluginRoot, pluginDataDir)),
195
+ env: {
196
+ ...Object.fromEntries(Object.entries(env).map(([key, value]) => [key, expandPluginPlaceholders(value, pluginRoot, pluginDataDir)])),
197
+ PLUGIN_ROOT: pluginRoot,
198
+ PLUGIN_DATA: pluginDataDir,
199
+ },
200
+ cwd,
201
+ pluginDataDir,
202
+ literalEnv: true,
203
+ };
204
+ }
205
+ function translateHttpServer(manifest, serverName, raw, type) {
206
+ for (const key of Object.keys(raw)) {
207
+ if (!HTTP_FIELDS.has(key))
208
+ return skipServer(manifest, serverName, `unknown field ${key}`);
209
+ }
210
+ if (typeof raw.url !== "string" || raw.url.length === 0)
211
+ return skipServer(manifest, serverName, "url must be a non-empty string");
212
+ if (!isValidAgentPluginUrl(raw.url))
213
+ return skipServer(manifest, serverName, "url must be an allowed absolute HTTP(S) URL");
214
+ const headers = translateHeaders(raw.headers, manifest, serverName);
215
+ if (headers === null)
216
+ return null;
217
+ return {
218
+ url: raw.url,
219
+ httpTransport: type,
220
+ ...(headers ? { headers } : {}),
221
+ };
222
+ }
223
+ function formatAgentPluginServerName(pluginName, serverName) {
224
+ const pluginPart = pluginName.replace(/[^A-Za-z0-9_-]+/g, "_").replace(/^[_-]+|[_-]+$/g, "") || "plugin";
225
+ const serverPart = serverName.replace(/[^A-Za-z0-9_-]+/g, "_").replace(/^[_-]+|[_-]+$/g, "") || "server";
226
+ return `${pluginPart}__${serverPart}`;
227
+ }
228
+ function skipServer(manifest, serverName, reason) {
229
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: ${reason}`);
230
+ return null;
231
+ }
232
+ function translateStringArray(value, manifest, serverName, field) {
233
+ if (value === undefined)
234
+ return [];
235
+ if (!Array.isArray(value) || value.some(item => typeof item !== "string")) {
236
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: ${field} must be an array of strings`);
237
+ return null;
238
+ }
239
+ return value;
240
+ }
241
+ function translateEnv(value, manifest, serverName) {
242
+ if (value === undefined)
243
+ return {};
244
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
245
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: env must be an object of strings`);
246
+ return null;
247
+ }
248
+ const env = {};
249
+ for (const [key, entry] of Object.entries(value)) {
250
+ if (key === "PLUGIN_ROOT" || key === "PLUGIN_DATA") {
251
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: env must not define ${key}`);
252
+ return null;
253
+ }
254
+ if (typeof entry !== "string") {
255
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: env values must be strings`);
256
+ return null;
257
+ }
258
+ env[key] = entry;
259
+ }
260
+ return env;
261
+ }
262
+ function translateHeaders(value, manifest, serverName) {
263
+ if (value === undefined)
264
+ return undefined;
265
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
266
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: headers must be an object of strings`);
267
+ return null;
268
+ }
269
+ const headers = {};
270
+ const seen = new Set();
271
+ for (const [key, entry] of Object.entries(value)) {
272
+ if (typeof entry !== "string") {
273
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: header values must be strings`);
274
+ return null;
275
+ }
276
+ const normalized = key.toLowerCase();
277
+ if (seen.has(normalized)) {
278
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: duplicate header ${key}`);
279
+ return null;
280
+ }
281
+ seen.add(normalized);
282
+ headers[key] = entry;
283
+ }
284
+ try {
285
+ new Headers(headers);
286
+ }
287
+ catch {
288
+ console.warn(`Agent Plugin ${manifest.name} skips invalid MCP server ${serverName}: headers are not valid HTTP fields`);
289
+ return null;
290
+ }
291
+ return Object.keys(headers).length > 0 ? headers : undefined;
292
+ }
293
+ function resolvePluginPath(path, cwd) {
294
+ if (path === "~")
295
+ return resolve(process.env.HOME ?? "", ".");
296
+ if (path.startsWith("~/"))
297
+ return resolve(process.env.HOME ?? "", path.slice(2));
298
+ return isAbsolute(path) ? resolve(path) : resolve(cwd, path);
299
+ }
300
+ function isBareCommand(command) {
301
+ return !command.includes("/") && !command.includes("\\") && !command.includes("${PLUGIN_ROOT}") && !command.includes("${PLUGIN_DATA}");
302
+ }
303
+ function resolvePluginCwd(value, pluginRoot, pluginDataDir) {
304
+ if (value === undefined)
305
+ return pluginRoot;
306
+ if (typeof value !== "string")
307
+ return null;
308
+ if (value.startsWith("./"))
309
+ return resolveContainedPath(pluginRoot, value, pluginRoot);
310
+ if (value === "${PLUGIN_ROOT}" || value.startsWith("${PLUGIN_ROOT}/")) {
311
+ return resolveContainedPath(pluginRoot, value.replace("${PLUGIN_ROOT}", "."), pluginRoot);
312
+ }
313
+ if (value === "${PLUGIN_DATA}" || value.startsWith("${PLUGIN_DATA}/")) {
314
+ return resolveContainedPath(pluginDataDir, value.replace("${PLUGIN_DATA}", "."), pluginDataDir);
315
+ }
316
+ return null;
317
+ }
318
+ function resolveContainedPath(root, value, containmentRoot) {
319
+ const resolved = resolve(root, value);
320
+ const rel = relative(containmentRoot, resolved);
321
+ if (rel === "" || (!rel.startsWith("..") && !rel.startsWith(sep) && !isAbsolute(rel)))
322
+ return resolved;
323
+ return null;
324
+ }
325
+ function expandPluginPlaceholders(value, pluginRoot, pluginDataDir) {
326
+ return value
327
+ .replaceAll("${PLUGIN_ROOT}", pluginRoot)
328
+ .replaceAll("${PLUGIN_DATA}", pluginDataDir);
329
+ }
330
+ function isValidAgentPluginUrl(value) {
331
+ if (value.includes("${") || value.includes("$env:") || value.includes("{env:"))
332
+ return false;
333
+ let url;
334
+ try {
335
+ url = new URL(value);
336
+ }
337
+ catch {
338
+ return false;
339
+ }
340
+ if (url.protocol !== "http:" && url.protocol !== "https:")
341
+ return false;
342
+ if (url.username || url.password || url.hash)
343
+ return false;
344
+ if (url.protocol === "https:")
345
+ return true;
346
+ return isLoopbackHost(url.hostname);
347
+ }
348
+ function isLoopbackHost(hostname) {
349
+ const host = hostname.toLowerCase();
350
+ if (host === "localhost" || host === "127.0.0.1" || host === "::1" || host === "[::1]")
351
+ return true;
352
+ if (/^127(?:\.\d{1,3}){3}$/.test(host))
353
+ return true;
354
+ return false;
355
+ }
356
+ //# sourceMappingURL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AAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACxE,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAC3D,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3C,OAAO,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACpC,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACpG,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACpD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,123 @@
1
+ import { type AgentPluginSummary } from "./agent-plugin-loader.ts";
2
+ import { type HostConfigDiscovery, type McpConfig, type ServerEntry, type ImportKind, type ServerProvenance } from "./types.ts";
3
+ export interface KnownServerPreset {
4
+ id: string;
5
+ name: string;
6
+ summary: string;
7
+ entry: ServerEntry;
8
+ }
9
+ export declare const KNOWN_SERVER_PRESETS: readonly KnownServerPreset[];
10
+ interface ConfigSourceSpec {
11
+ id: "shared-global" | "agents-global" | "agents-nested-global" | "pi-global" | "shared-project" | "pi-project";
12
+ label: string;
13
+ readPath: string;
14
+ writePath: string;
15
+ kind: "user" | "project" | "import";
16
+ importKind?: string;
17
+ shared: boolean;
18
+ scope: "global" | "project";
19
+ }
20
+ export interface ConfigDiscoveryPath {
21
+ label: string;
22
+ path: string;
23
+ exists: boolean;
24
+ }
25
+ export interface DiscoveredImportConfig {
26
+ kind: ImportKind;
27
+ path: string;
28
+ }
29
+ export interface ConfigDiscoverySource extends ConfigDiscoveryPath {
30
+ id: ConfigSourceSpec["id"];
31
+ scope: ConfigSourceSpec["scope"];
32
+ kind: "shared" | "pi";
33
+ serverCount: number;
34
+ }
35
+ export interface ImportConfigSummary extends DiscoveredImportConfig {
36
+ serverCount: number;
37
+ }
38
+ export interface HostConfigSummary extends ImportConfigSummary {
39
+ active: boolean;
40
+ }
41
+ export interface McpConfigConflict {
42
+ serverName: string;
43
+ sources: Array<{
44
+ kind: "shared" | "pi" | "host";
45
+ path: string;
46
+ }>;
47
+ winner: {
48
+ kind: "shared" | "pi" | "host";
49
+ path: string;
50
+ };
51
+ }
52
+ export interface RepoPromptDiscovery {
53
+ configured: boolean;
54
+ configuredPath?: string;
55
+ executablePath?: string;
56
+ targetPath?: string;
57
+ serverName?: string;
58
+ entry?: ServerEntry;
59
+ }
60
+ export interface McpDiscoverySummary {
61
+ sources: ConfigDiscoverySource[];
62
+ imports: ImportConfigSummary[];
63
+ hostConfigs: HostConfigSummary[];
64
+ hostConfigDiscovery: HostConfigDiscovery;
65
+ agentPlugins: AgentPluginSummary[];
66
+ conflicts: McpConfigConflict[];
67
+ hasAnyConfig: boolean;
68
+ hasAnyDetectedPaths: boolean;
69
+ hasSharedServers: boolean;
70
+ hasPiOwnedServers: boolean;
71
+ totalServerCount: number;
72
+ fingerprint: string;
73
+ repoPrompt: RepoPromptDiscovery;
74
+ }
75
+ export interface McpStandardConfigSummary {
76
+ sources: ConfigDiscoverySource[];
77
+ hasSharedServers: boolean;
78
+ fingerprint: string;
79
+ }
80
+ export interface ConfigWritePreview {
81
+ path: string;
82
+ existed: boolean;
83
+ changed: boolean;
84
+ beforeText: string;
85
+ afterText: string;
86
+ diffText: string;
87
+ }
88
+ export declare function getPiGlobalConfigPath(overridePath?: string): string;
89
+ export declare function getGenericGlobalConfigPath(): string;
90
+ export declare function getProjectConfigPath(cwd?: string): string;
91
+ export declare function getProjectPiConfigPath(cwd?: string): string;
92
+ export declare function getConfigDiscoveryPaths(overridePath?: string, cwd?: string): ConfigDiscoveryPath[];
93
+ export declare function findAvailableImportConfigs(cwd?: string): DiscoveredImportConfig[];
94
+ export declare function getMcpStandardConfigSummary(overridePath?: string, cwd?: string): McpStandardConfigSummary;
95
+ export declare function getMcpDiscoverySummary(overridePath?: string, cwd?: string, options?: {
96
+ includeHostConfigs?: boolean;
97
+ }): McpDiscoverySummary;
98
+ export declare function cloneMcpConfig(config: McpConfig): McpConfig;
99
+ export declare function loadMcpConfig(overridePath?: string, cwd?: string): McpConfig;
100
+ export interface ServerDisabledOverrideResult {
101
+ path: string;
102
+ changed: boolean;
103
+ }
104
+ /**
105
+ * Persist only the disabled field in the project Pi layer. Enabling writes an
106
+ * explicit false only when a lower-precedence source is itself disabled; this
107
+ * writer never copies a server definition or its credentials into the file.
108
+ */
109
+ export declare function writeProjectServerDisabledOverride(overridePath: string | undefined, cwd: string, serverName: string, disabled: boolean): ServerDisabledOverrideResult;
110
+ export declare function previewCompatibilityImports(importKinds: ImportKind[], overridePath?: string): ConfigWritePreview;
111
+ export declare function ensureCompatibilityImports(importKinds: ImportKind[], overridePath?: string): {
112
+ path: string;
113
+ added: ImportKind[];
114
+ };
115
+ export declare function buildStarterProjectConfig(): McpConfig;
116
+ export declare function previewStarterProjectConfig(cwd?: string): ConfigWritePreview;
117
+ export declare function writeStarterProjectConfig(cwd?: string): string;
118
+ export declare function previewSharedServerEntry(filePath: string, serverName: string, entry: ServerEntry): ConfigWritePreview;
119
+ export declare function writeSharedServerEntry(filePath: string, serverName: string, entry: ServerEntry): string;
120
+ export declare function getServerProvenance(overridePath?: string, cwd?: string): Map<string, ServerProvenance>;
121
+ export declare function writeDirectToolsConfig(changes: Map<string, true | string[] | false>, provenance: Map<string, ServerProvenance>, fullConfig: McpConfig): void;
122
+ export declare function resolveConfiguredOAuthDir(raw: unknown, cwd?: string): string | undefined;
123
+ export {};