calvyn-code 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1718) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +217 -0
  3. package/README.zh-CN.md +180 -0
  4. package/acp_adapter/__init__.py +1 -0
  5. package/acp_adapter/__main__.py +5 -0
  6. package/acp_adapter/auth.py +68 -0
  7. package/acp_adapter/bootstrap/__init__.py +0 -0
  8. package/acp_adapter/bootstrap/bootstrap_browser_tools.ps1 +288 -0
  9. package/acp_adapter/bootstrap/bootstrap_browser_tools.sh +399 -0
  10. package/acp_adapter/entry.py +292 -0
  11. package/acp_adapter/events.py +265 -0
  12. package/acp_adapter/permissions.py +148 -0
  13. package/acp_adapter/server.py +1713 -0
  14. package/acp_adapter/session.py +629 -0
  15. package/acp_adapter/tools.py +1180 -0
  16. package/agent/__init__.py +6 -0
  17. package/agent/__pycache__/__init__.cpython-312.pyc +0 -0
  18. package/agent/__pycache__/account_usage.cpython-312.pyc +0 -0
  19. package/agent/__pycache__/anthropic_adapter.cpython-312.pyc +0 -0
  20. package/agent/__pycache__/async_utils.cpython-312.pyc +0 -0
  21. package/agent/__pycache__/auxiliary_client.cpython-312.pyc +0 -0
  22. package/agent/__pycache__/codex_responses_adapter.cpython-312.pyc +0 -0
  23. package/agent/__pycache__/context_compressor.cpython-312.pyc +0 -0
  24. package/agent/__pycache__/context_engine.cpython-312.pyc +0 -0
  25. package/agent/__pycache__/context_references.cpython-312.pyc +0 -0
  26. package/agent/__pycache__/credential_pool.cpython-312.pyc +0 -0
  27. package/agent/__pycache__/curator.cpython-312.pyc +0 -0
  28. package/agent/__pycache__/display.cpython-312.pyc +0 -0
  29. package/agent/__pycache__/error_classifier.cpython-312.pyc +0 -0
  30. package/agent/__pycache__/file_safety.cpython-312.pyc +0 -0
  31. package/agent/__pycache__/google_code_assist.cpython-312.pyc +0 -0
  32. package/agent/__pycache__/google_oauth.cpython-312.pyc +0 -0
  33. package/agent/__pycache__/i18n.cpython-312.pyc +0 -0
  34. package/agent/__pycache__/image_gen_provider.cpython-312.pyc +0 -0
  35. package/agent/__pycache__/image_gen_registry.cpython-312.pyc +0 -0
  36. package/agent/__pycache__/insights.cpython-312.pyc +0 -0
  37. package/agent/__pycache__/lmstudio_reasoning.cpython-312.pyc +0 -0
  38. package/agent/__pycache__/manual_compression_feedback.cpython-312.pyc +0 -0
  39. package/agent/__pycache__/markdown_tables.cpython-312.pyc +0 -0
  40. package/agent/__pycache__/memory_manager.cpython-312.pyc +0 -0
  41. package/agent/__pycache__/memory_provider.cpython-312.pyc +0 -0
  42. package/agent/__pycache__/model_metadata.cpython-312.pyc +0 -0
  43. package/agent/__pycache__/models_dev.cpython-312.pyc +0 -0
  44. package/agent/__pycache__/moonshot_schema.cpython-312.pyc +0 -0
  45. package/agent/__pycache__/onboarding.cpython-312.pyc +0 -0
  46. package/agent/__pycache__/portal_tags.cpython-312.pyc +0 -0
  47. package/agent/__pycache__/prompt_builder.cpython-312.pyc +0 -0
  48. package/agent/__pycache__/prompt_caching.cpython-312.pyc +0 -0
  49. package/agent/__pycache__/redact.cpython-312.pyc +0 -0
  50. package/agent/__pycache__/retry_utils.cpython-312.pyc +0 -0
  51. package/agent/__pycache__/shell_hooks.cpython-312.pyc +0 -0
  52. package/agent/__pycache__/skill_commands.cpython-312.pyc +0 -0
  53. package/agent/__pycache__/skill_preprocessing.cpython-312.pyc +0 -0
  54. package/agent/__pycache__/skill_utils.cpython-312.pyc +0 -0
  55. package/agent/__pycache__/subdirectory_hints.cpython-312.pyc +0 -0
  56. package/agent/__pycache__/think_scrubber.cpython-312.pyc +0 -0
  57. package/agent/__pycache__/title_generator.cpython-312.pyc +0 -0
  58. package/agent/__pycache__/tool_guardrails.cpython-312.pyc +0 -0
  59. package/agent/__pycache__/tool_result_classification.cpython-312.pyc +0 -0
  60. package/agent/__pycache__/trajectory.cpython-312.pyc +0 -0
  61. package/agent/__pycache__/usage_pricing.cpython-312.pyc +0 -0
  62. package/agent/__pycache__/video_gen_provider.cpython-312.pyc +0 -0
  63. package/agent/__pycache__/video_gen_registry.cpython-312.pyc +0 -0
  64. package/agent/__pycache__/web_search_provider.cpython-312.pyc +0 -0
  65. package/agent/__pycache__/web_search_registry.cpython-312.pyc +0 -0
  66. package/agent/account_usage.py +326 -0
  67. package/agent/anthropic_adapter.py +2087 -0
  68. package/agent/async_utils.py +68 -0
  69. package/agent/auxiliary_client.py +4893 -0
  70. package/agent/bedrock_adapter.py +1276 -0
  71. package/agent/codex_responses_adapter.py +1084 -0
  72. package/agent/context_compressor.py +1583 -0
  73. package/agent/context_engine.py +211 -0
  74. package/agent/context_references.py +519 -0
  75. package/agent/copilot_acp_client.py +684 -0
  76. package/agent/credential_pool.py +1780 -0
  77. package/agent/credential_sources.py +449 -0
  78. package/agent/curator.py +1782 -0
  79. package/agent/curator_backup.py +694 -0
  80. package/agent/display.py +987 -0
  81. package/agent/error_classifier.py +1058 -0
  82. package/agent/file_safety.py +112 -0
  83. package/agent/gemini_cloudcode_adapter.py +909 -0
  84. package/agent/gemini_native_adapter.py +971 -0
  85. package/agent/gemini_schema.py +99 -0
  86. package/agent/google_code_assist.py +452 -0
  87. package/agent/google_oauth.py +1062 -0
  88. package/agent/i18n.py +258 -0
  89. package/agent/image_gen_provider.py +243 -0
  90. package/agent/image_gen_registry.py +145 -0
  91. package/agent/image_routing.py +301 -0
  92. package/agent/insights.py +931 -0
  93. package/agent/lmstudio_reasoning.py +48 -0
  94. package/agent/lsp/__init__.py +106 -0
  95. package/agent/lsp/__pycache__/__init__.cpython-312.pyc +0 -0
  96. package/agent/lsp/__pycache__/cli.cpython-312.pyc +0 -0
  97. package/agent/lsp/__pycache__/client.cpython-312.pyc +0 -0
  98. package/agent/lsp/__pycache__/eventlog.cpython-312.pyc +0 -0
  99. package/agent/lsp/__pycache__/manager.cpython-312.pyc +0 -0
  100. package/agent/lsp/__pycache__/protocol.cpython-312.pyc +0 -0
  101. package/agent/lsp/__pycache__/servers.cpython-312.pyc +0 -0
  102. package/agent/lsp/__pycache__/workspace.cpython-312.pyc +0 -0
  103. package/agent/lsp/cli.py +308 -0
  104. package/agent/lsp/client.py +930 -0
  105. package/agent/lsp/eventlog.py +213 -0
  106. package/agent/lsp/install.py +376 -0
  107. package/agent/lsp/manager.py +644 -0
  108. package/agent/lsp/protocol.py +196 -0
  109. package/agent/lsp/range_shift.py +149 -0
  110. package/agent/lsp/reporter.py +78 -0
  111. package/agent/lsp/servers.py +1040 -0
  112. package/agent/lsp/workspace.py +223 -0
  113. package/agent/manual_compression_feedback.py +49 -0
  114. package/agent/markdown_tables.py +309 -0
  115. package/agent/memory_manager.py +556 -0
  116. package/agent/memory_provider.py +279 -0
  117. package/agent/model_metadata.py +1827 -0
  118. package/agent/models_dev.py +724 -0
  119. package/agent/moonshot_schema.py +231 -0
  120. package/agent/nous_rate_guard.py +326 -0
  121. package/agent/onboarding.py +193 -0
  122. package/agent/plugin_llm.py +1046 -0
  123. package/agent/portal_tags.py +64 -0
  124. package/agent/prompt_builder.py +1457 -0
  125. package/agent/prompt_caching.py +79 -0
  126. package/agent/rate_limit_tracker.py +246 -0
  127. package/agent/redact.py +403 -0
  128. package/agent/retry_utils.py +57 -0
  129. package/agent/shell_hooks.py +837 -0
  130. package/agent/skill_commands.py +502 -0
  131. package/agent/skill_preprocessing.py +131 -0
  132. package/agent/skill_utils.py +512 -0
  133. package/agent/subdirectory_hints.py +224 -0
  134. package/agent/think_scrubber.py +386 -0
  135. package/agent/title_generator.py +171 -0
  136. package/agent/tool_guardrails.py +458 -0
  137. package/agent/tool_result_classification.py +26 -0
  138. package/agent/trajectory.py +56 -0
  139. package/agent/transports/__init__.py +68 -0
  140. package/agent/transports/__pycache__/__init__.cpython-312.pyc +0 -0
  141. package/agent/transports/__pycache__/anthropic.cpython-312.pyc +0 -0
  142. package/agent/transports/__pycache__/base.cpython-312.pyc +0 -0
  143. package/agent/transports/__pycache__/bedrock.cpython-312.pyc +0 -0
  144. package/agent/transports/__pycache__/chat_completions.cpython-312.pyc +0 -0
  145. package/agent/transports/__pycache__/codex.cpython-312.pyc +0 -0
  146. package/agent/transports/__pycache__/types.cpython-312.pyc +0 -0
  147. package/agent/transports/anthropic.py +179 -0
  148. package/agent/transports/base.py +89 -0
  149. package/agent/transports/bedrock.py +154 -0
  150. package/agent/transports/chat_completions.py +614 -0
  151. package/agent/transports/codex.py +283 -0
  152. package/agent/transports/codex_app_server.py +368 -0
  153. package/agent/transports/codex_app_server_session.py +810 -0
  154. package/agent/transports/codex_event_projector.py +312 -0
  155. package/agent/transports/hermes_tools_mcp_server.py +233 -0
  156. package/agent/transports/types.py +162 -0
  157. package/agent/usage_pricing.py +877 -0
  158. package/agent/video_gen_provider.py +300 -0
  159. package/agent/video_gen_registry.py +117 -0
  160. package/agent/web_search_provider.py +221 -0
  161. package/agent/web_search_registry.py +262 -0
  162. package/assets/banner.png +0 -0
  163. package/batch_runner.py +1303 -0
  164. package/bin/calvyn.js +67 -0
  165. package/calvyn_bootstrap.py +130 -0
  166. package/calvyn_constants.py +346 -0
  167. package/calvyn_logging.py +390 -0
  168. package/calvyn_state.py +2967 -0
  169. package/calvyn_time.py +105 -0
  170. package/cli.py +14160 -0
  171. package/cron/__init__.py +42 -0
  172. package/cron/__pycache__/__init__.cpython-312.pyc +0 -0
  173. package/cron/__pycache__/jobs.cpython-312.pyc +0 -0
  174. package/cron/__pycache__/scheduler.cpython-312.pyc +0 -0
  175. package/cron/jobs.py +1160 -0
  176. package/cron/scheduler.py +1832 -0
  177. package/gateway/__init__.py +35 -0
  178. package/gateway/__pycache__/__init__.cpython-312.pyc +0 -0
  179. package/gateway/__pycache__/channel_directory.cpython-312.pyc +0 -0
  180. package/gateway/__pycache__/config.cpython-312.pyc +0 -0
  181. package/gateway/__pycache__/delivery.cpython-312.pyc +0 -0
  182. package/gateway/__pycache__/display_config.cpython-312.pyc +0 -0
  183. package/gateway/__pycache__/hooks.cpython-312.pyc +0 -0
  184. package/gateway/__pycache__/pairing.cpython-312.pyc +0 -0
  185. package/gateway/__pycache__/platform_registry.cpython-312.pyc +0 -0
  186. package/gateway/__pycache__/restart.cpython-312.pyc +0 -0
  187. package/gateway/__pycache__/run.cpython-312.pyc +0 -0
  188. package/gateway/__pycache__/runtime_footer.cpython-312.pyc +0 -0
  189. package/gateway/__pycache__/session.cpython-312.pyc +0 -0
  190. package/gateway/__pycache__/session_context.cpython-312.pyc +0 -0
  191. package/gateway/__pycache__/shutdown_forensics.cpython-312.pyc +0 -0
  192. package/gateway/__pycache__/slash_access.cpython-312.pyc +0 -0
  193. package/gateway/__pycache__/status.cpython-312.pyc +0 -0
  194. package/gateway/__pycache__/stream_consumer.cpython-312.pyc +0 -0
  195. package/gateway/__pycache__/whatsapp_identity.cpython-312.pyc +0 -0
  196. package/gateway/assets/telegram-botfather-threads-settings.jpg +0 -0
  197. package/gateway/builtin_hooks/__init__.py +1 -0
  198. package/gateway/channel_directory.py +357 -0
  199. package/gateway/config.py +1873 -0
  200. package/gateway/delivery.py +258 -0
  201. package/gateway/display_config.py +206 -0
  202. package/gateway/hooks.py +210 -0
  203. package/gateway/mirror.py +179 -0
  204. package/gateway/pairing.py +322 -0
  205. package/gateway/platform_registry.py +260 -0
  206. package/gateway/platforms/ADDING_A_PLATFORM.md +374 -0
  207. package/gateway/platforms/__init__.py +45 -0
  208. package/gateway/platforms/__pycache__/__init__.cpython-312.pyc +0 -0
  209. package/gateway/platforms/__pycache__/base.cpython-312.pyc +0 -0
  210. package/gateway/platforms/__pycache__/helpers.cpython-312.pyc +0 -0
  211. package/gateway/platforms/__pycache__/telegram.cpython-312.pyc +0 -0
  212. package/gateway/platforms/__pycache__/telegram_network.cpython-312.pyc +0 -0
  213. package/gateway/platforms/__pycache__/yuanbao.cpython-312.pyc +0 -0
  214. package/gateway/platforms/__pycache__/yuanbao_media.cpython-312.pyc +0 -0
  215. package/gateway/platforms/__pycache__/yuanbao_proto.cpython-312.pyc +0 -0
  216. package/gateway/platforms/_http_client_limits.py +84 -0
  217. package/gateway/platforms/api_server.py +3488 -0
  218. package/gateway/platforms/base.py +3747 -0
  219. package/gateway/platforms/bluebubbles.py +937 -0
  220. package/gateway/platforms/dingtalk.py +1473 -0
  221. package/gateway/platforms/discord.py +5584 -0
  222. package/gateway/platforms/email.py +773 -0
  223. package/gateway/platforms/feishu.py +5059 -0
  224. package/gateway/platforms/feishu_comment.py +1382 -0
  225. package/gateway/platforms/feishu_comment_rules.py +430 -0
  226. package/gateway/platforms/helpers.py +279 -0
  227. package/gateway/platforms/homeassistant.py +449 -0
  228. package/gateway/platforms/matrix.py +2777 -0
  229. package/gateway/platforms/mattermost.py +852 -0
  230. package/gateway/platforms/msgraph_webhook.py +397 -0
  231. package/gateway/platforms/qqbot/__init__.py +91 -0
  232. package/gateway/platforms/qqbot/adapter.py +3072 -0
  233. package/gateway/platforms/qqbot/chunked_upload.py +602 -0
  234. package/gateway/platforms/qqbot/constants.py +74 -0
  235. package/gateway/platforms/qqbot/crypto.py +45 -0
  236. package/gateway/platforms/qqbot/keyboards.py +473 -0
  237. package/gateway/platforms/qqbot/onboard.py +220 -0
  238. package/gateway/platforms/qqbot/utils.py +71 -0
  239. package/gateway/platforms/signal.py +1518 -0
  240. package/gateway/platforms/signal_rate_limit.py +369 -0
  241. package/gateway/platforms/slack.py +3028 -0
  242. package/gateway/platforms/sms.py +377 -0
  243. package/gateway/platforms/telegram.py +4836 -0
  244. package/gateway/platforms/telegram_network.py +249 -0
  245. package/gateway/platforms/webhook.py +806 -0
  246. package/gateway/platforms/wecom.py +1610 -0
  247. package/gateway/platforms/wecom_callback.py +403 -0
  248. package/gateway/platforms/wecom_crypto.py +142 -0
  249. package/gateway/platforms/weixin.py +2170 -0
  250. package/gateway/platforms/whatsapp.py +1283 -0
  251. package/gateway/platforms/yuanbao.py +4873 -0
  252. package/gateway/platforms/yuanbao_media.py +645 -0
  253. package/gateway/platforms/yuanbao_proto.py +1209 -0
  254. package/gateway/platforms/yuanbao_sticker.py +558 -0
  255. package/gateway/restart.py +20 -0
  256. package/gateway/run.py +17074 -0
  257. package/gateway/runtime_footer.py +150 -0
  258. package/gateway/session.py +1399 -0
  259. package/gateway/session_context.py +156 -0
  260. package/gateway/shutdown_forensics.py +462 -0
  261. package/gateway/slash_access.py +229 -0
  262. package/gateway/status.py +972 -0
  263. package/gateway/sticker_cache.py +111 -0
  264. package/gateway/stream_consumer.py +1286 -0
  265. package/gateway/whatsapp_identity.py +156 -0
  266. package/hermes_cli/__init__.py +47 -0
  267. package/hermes_cli/__pycache__/__init__.cpython-312.pyc +0 -0
  268. package/hermes_cli/__pycache__/_parser.cpython-312.pyc +0 -0
  269. package/hermes_cli/__pycache__/auth.cpython-312.pyc +0 -0
  270. package/hermes_cli/__pycache__/banner.cpython-312.pyc +0 -0
  271. package/hermes_cli/__pycache__/browser_connect.cpython-312.pyc +0 -0
  272. package/hermes_cli/__pycache__/callbacks.cpython-312.pyc +0 -0
  273. package/hermes_cli/__pycache__/checkpoints.cpython-312.pyc +0 -0
  274. package/hermes_cli/__pycache__/cli_output.cpython-312.pyc +0 -0
  275. package/hermes_cli/__pycache__/codex_models.cpython-312.pyc +0 -0
  276. package/hermes_cli/__pycache__/codex_runtime_switch.cpython-312.pyc +0 -0
  277. package/hermes_cli/__pycache__/colors.cpython-312.pyc +0 -0
  278. package/hermes_cli/__pycache__/commands.cpython-312.pyc +0 -0
  279. package/hermes_cli/__pycache__/config.cpython-312.pyc +0 -0
  280. package/hermes_cli/__pycache__/copilot_auth.cpython-312.pyc +0 -0
  281. package/hermes_cli/__pycache__/curator.cpython-312.pyc +0 -0
  282. package/hermes_cli/__pycache__/curses_ui.cpython-312.pyc +0 -0
  283. package/hermes_cli/__pycache__/debug.cpython-312.pyc +0 -0
  284. package/hermes_cli/__pycache__/default_soul.cpython-312.pyc +0 -0
  285. package/hermes_cli/__pycache__/env_loader.cpython-312.pyc +0 -0
  286. package/hermes_cli/__pycache__/fallback_cmd.cpython-312.pyc +0 -0
  287. package/hermes_cli/__pycache__/gateway.cpython-312.pyc +0 -0
  288. package/hermes_cli/__pycache__/gateway_windows.cpython-312.pyc +0 -0
  289. package/hermes_cli/__pycache__/goals.cpython-312.pyc +0 -0
  290. package/hermes_cli/__pycache__/inventory.cpython-312.pyc +0 -0
  291. package/hermes_cli/__pycache__/kanban.cpython-312.pyc +0 -0
  292. package/hermes_cli/__pycache__/kanban_db.cpython-312.pyc +0 -0
  293. package/hermes_cli/__pycache__/main.cpython-312.pyc +0 -0
  294. package/hermes_cli/__pycache__/model_catalog.cpython-312.pyc +0 -0
  295. package/hermes_cli/__pycache__/model_normalize.cpython-312.pyc +0 -0
  296. package/hermes_cli/__pycache__/model_switch.cpython-312.pyc +0 -0
  297. package/hermes_cli/__pycache__/models.cpython-312.pyc +0 -0
  298. package/hermes_cli/__pycache__/nous_subscription.cpython-312.pyc +0 -0
  299. package/hermes_cli/__pycache__/pairing.cpython-312.pyc +0 -0
  300. package/hermes_cli/__pycache__/platforms.cpython-312.pyc +0 -0
  301. package/hermes_cli/__pycache__/plugins.cpython-312.pyc +0 -0
  302. package/hermes_cli/__pycache__/profiles.cpython-312.pyc +0 -0
  303. package/hermes_cli/__pycache__/providers.cpython-312.pyc +0 -0
  304. package/hermes_cli/__pycache__/pt_input_extras.cpython-312.pyc +0 -0
  305. package/hermes_cli/__pycache__/runtime_provider.cpython-312.pyc +0 -0
  306. package/hermes_cli/__pycache__/security_advisories.cpython-312.pyc +0 -0
  307. package/hermes_cli/__pycache__/setup.cpython-312.pyc +0 -0
  308. package/hermes_cli/__pycache__/skills_hub.cpython-312.pyc +0 -0
  309. package/hermes_cli/__pycache__/skin_engine.cpython-312.pyc +0 -0
  310. package/hermes_cli/__pycache__/stdio.cpython-312.pyc +0 -0
  311. package/hermes_cli/__pycache__/timeouts.cpython-312.pyc +0 -0
  312. package/hermes_cli/__pycache__/tips.cpython-312.pyc +0 -0
  313. package/hermes_cli/__pycache__/tools_config.cpython-312.pyc +0 -0
  314. package/hermes_cli/__pycache__/voice.cpython-312.pyc +0 -0
  315. package/hermes_cli/_parser.py +365 -0
  316. package/hermes_cli/_subprocess_compat.py +175 -0
  317. package/hermes_cli/auth.py +6299 -0
  318. package/hermes_cli/auth_commands.py +749 -0
  319. package/hermes_cli/azure_detect.py +300 -0
  320. package/hermes_cli/backup.py +938 -0
  321. package/hermes_cli/banner.py +703 -0
  322. package/hermes_cli/browser_connect.py +139 -0
  323. package/hermes_cli/callbacks.py +243 -0
  324. package/hermes_cli/checkpoints.py +244 -0
  325. package/hermes_cli/claw.py +810 -0
  326. package/hermes_cli/cli_output.py +78 -0
  327. package/hermes_cli/clipboard.py +495 -0
  328. package/hermes_cli/codex_models.py +198 -0
  329. package/hermes_cli/codex_runtime_plugin_migration.py +757 -0
  330. package/hermes_cli/codex_runtime_switch.py +266 -0
  331. package/hermes_cli/colors.py +38 -0
  332. package/hermes_cli/commands.py +1728 -0
  333. package/hermes_cli/completion.py +315 -0
  334. package/hermes_cli/config.py +5382 -0
  335. package/hermes_cli/copilot_auth.py +392 -0
  336. package/hermes_cli/cron.py +313 -0
  337. package/hermes_cli/curator.py +598 -0
  338. package/hermes_cli/curses_ui.py +472 -0
  339. package/hermes_cli/debug.py +747 -0
  340. package/hermes_cli/default_soul.py +11 -0
  341. package/hermes_cli/dep_ensure.py +107 -0
  342. package/hermes_cli/dingtalk_auth.py +293 -0
  343. package/hermes_cli/doctor.py +1863 -0
  344. package/hermes_cli/dump.py +326 -0
  345. package/hermes_cli/env_loader.py +175 -0
  346. package/hermes_cli/fallback_cmd.py +361 -0
  347. package/hermes_cli/gateway.py +5422 -0
  348. package/hermes_cli/gateway_windows.py +692 -0
  349. package/hermes_cli/goals.py +757 -0
  350. package/hermes_cli/hooks.py +385 -0
  351. package/hermes_cli/inventory.py +240 -0
  352. package/hermes_cli/kanban.py +2252 -0
  353. package/hermes_cli/kanban_db.py +4840 -0
  354. package/hermes_cli/kanban_diagnostics.py +776 -0
  355. package/hermes_cli/kanban_specify.py +266 -0
  356. package/hermes_cli/logs.py +391 -0
  357. package/hermes_cli/main.py +12396 -0
  358. package/hermes_cli/mcp_config.py +781 -0
  359. package/hermes_cli/memory_setup.py +465 -0
  360. package/hermes_cli/model_catalog.py +330 -0
  361. package/hermes_cli/model_normalize.py +473 -0
  362. package/hermes_cli/model_switch.py +1777 -0
  363. package/hermes_cli/models.py +3789 -0
  364. package/hermes_cli/nous_subscription.py +799 -0
  365. package/hermes_cli/oneshot.py +351 -0
  366. package/hermes_cli/pairing.py +115 -0
  367. package/hermes_cli/platforms.py +83 -0
  368. package/hermes_cli/plugins.py +1562 -0
  369. package/hermes_cli/plugins_cmd.py +1587 -0
  370. package/hermes_cli/profile_distribution.py +703 -0
  371. package/hermes_cli/profiles.py +1319 -0
  372. package/hermes_cli/providers.py +720 -0
  373. package/hermes_cli/proxy/__init__.py +20 -0
  374. package/hermes_cli/proxy/adapters/__init__.py +35 -0
  375. package/hermes_cli/proxy/adapters/base.py +94 -0
  376. package/hermes_cli/proxy/adapters/nous_portal.py +137 -0
  377. package/hermes_cli/proxy/cli.py +141 -0
  378. package/hermes_cli/proxy/server.py +265 -0
  379. package/hermes_cli/pt_input_extras.py +83 -0
  380. package/hermes_cli/pty_bridge.py +237 -0
  381. package/hermes_cli/relaunch.py +205 -0
  382. package/hermes_cli/runtime_provider.py +1428 -0
  383. package/hermes_cli/security_advisories.py +452 -0
  384. package/hermes_cli/setup.py +3559 -0
  385. package/hermes_cli/skills_config.py +177 -0
  386. package/hermes_cli/skills_hub.py +1595 -0
  387. package/hermes_cli/skin_engine.py +929 -0
  388. package/hermes_cli/slack_cli.py +160 -0
  389. package/hermes_cli/status.py +550 -0
  390. package/hermes_cli/stdio.py +252 -0
  391. package/hermes_cli/timeouts.py +82 -0
  392. package/hermes_cli/tips.py +487 -0
  393. package/hermes_cli/tools_config.py +3151 -0
  394. package/hermes_cli/uninstall.py +681 -0
  395. package/hermes_cli/vercel_auth.py +70 -0
  396. package/hermes_cli/voice.py +846 -0
  397. package/hermes_cli/web_server.py +4438 -0
  398. package/hermes_cli/webhook.py +275 -0
  399. package/locales/af.yaml +350 -0
  400. package/locales/de.yaml +350 -0
  401. package/locales/en.yaml +365 -0
  402. package/locales/es.yaml +350 -0
  403. package/locales/fr.yaml +350 -0
  404. package/locales/ga.yaml +354 -0
  405. package/locales/hu.yaml +350 -0
  406. package/locales/it.yaml +350 -0
  407. package/locales/ja.yaml +350 -0
  408. package/locales/ko.yaml +350 -0
  409. package/locales/pt.yaml +350 -0
  410. package/locales/ru.yaml +350 -0
  411. package/locales/tr.yaml +350 -0
  412. package/locales/uk.yaml +350 -0
  413. package/locales/zh-hant.yaml +350 -0
  414. package/locales/zh.yaml +350 -0
  415. package/mcp_serve.py +898 -0
  416. package/model_tools.py +899 -0
  417. package/optional-skills/DESCRIPTION.md +24 -0
  418. package/optional-skills/autonomous-ai-agents/DESCRIPTION.md +2 -0
  419. package/optional-skills/autonomous-ai-agents/blackbox/SKILL.md +144 -0
  420. package/optional-skills/autonomous-ai-agents/honcho/SKILL.md +431 -0
  421. package/optional-skills/blockchain/evm/SKILL.md +211 -0
  422. package/optional-skills/blockchain/evm/scripts/evm_client.py +1508 -0
  423. package/optional-skills/blockchain/hyperliquid/SKILL.md +211 -0
  424. package/optional-skills/blockchain/hyperliquid/scripts/hyperliquid_client.py +1660 -0
  425. package/optional-skills/blockchain/solana/SKILL.md +208 -0
  426. package/optional-skills/blockchain/solana/scripts/solana_client.py +698 -0
  427. package/optional-skills/communication/DESCRIPTION.md +1 -0
  428. package/optional-skills/communication/one-three-one-rule/SKILL.md +104 -0
  429. package/optional-skills/creative/blender-mcp/SKILL.md +117 -0
  430. package/optional-skills/creative/concept-diagrams/SKILL.md +362 -0
  431. package/optional-skills/creative/concept-diagrams/examples/apartment-floor-plan-conversion.md +244 -0
  432. package/optional-skills/creative/concept-diagrams/examples/automated-password-reset-flow.md +276 -0
  433. package/optional-skills/creative/concept-diagrams/examples/autonomous-llm-research-agent-flow.md +240 -0
  434. package/optional-skills/creative/concept-diagrams/examples/banana-journey-tree-to-smoothie.md +161 -0
  435. package/optional-skills/creative/concept-diagrams/examples/commercial-aircraft-structure.md +209 -0
  436. package/optional-skills/creative/concept-diagrams/examples/cpu-ooo-microarchitecture.md +236 -0
  437. package/optional-skills/creative/concept-diagrams/examples/electricity-grid-flow.md +182 -0
  438. package/optional-skills/creative/concept-diagrams/examples/feature-film-production-pipeline.md +172 -0
  439. package/optional-skills/creative/concept-diagrams/examples/hospital-emergency-department-flow.md +165 -0
  440. package/optional-skills/creative/concept-diagrams/examples/ml-benchmark-grouped-bar-chart.md +114 -0
  441. package/optional-skills/creative/concept-diagrams/examples/place-order-uml-sequence.md +325 -0
  442. package/optional-skills/creative/concept-diagrams/examples/smart-city-infrastructure.md +173 -0
  443. package/optional-skills/creative/concept-diagrams/examples/smartphone-layer-anatomy.md +154 -0
  444. package/optional-skills/creative/concept-diagrams/examples/sn2-reaction-mechanism.md +247 -0
  445. package/optional-skills/creative/concept-diagrams/examples/wind-turbine-structure.md +338 -0
  446. package/optional-skills/creative/concept-diagrams/references/dashboard-patterns.md +43 -0
  447. package/optional-skills/creative/concept-diagrams/references/infrastructure-patterns.md +144 -0
  448. package/optional-skills/creative/concept-diagrams/references/physical-shape-cookbook.md +42 -0
  449. package/optional-skills/creative/concept-diagrams/templates/template.html +174 -0
  450. package/optional-skills/creative/hyperframes/SKILL.md +191 -0
  451. package/optional-skills/creative/hyperframes/references/cli.md +185 -0
  452. package/optional-skills/creative/hyperframes/references/composition.md +129 -0
  453. package/optional-skills/creative/hyperframes/references/features.md +289 -0
  454. package/optional-skills/creative/hyperframes/references/gsap.md +136 -0
  455. package/optional-skills/creative/hyperframes/references/troubleshooting.md +137 -0
  456. package/optional-skills/creative/hyperframes/references/website-to-video.md +145 -0
  457. package/optional-skills/creative/hyperframes/scripts/setup.sh +135 -0
  458. package/optional-skills/creative/kanban-video-orchestrator/SKILL.md +207 -0
  459. package/optional-skills/creative/kanban-video-orchestrator/assets/brief.md.tmpl +79 -0
  460. package/optional-skills/creative/kanban-video-orchestrator/assets/setup.sh.tmpl +185 -0
  461. package/optional-skills/creative/kanban-video-orchestrator/assets/soul.md.tmpl +38 -0
  462. package/optional-skills/creative/kanban-video-orchestrator/references/examples.md +227 -0
  463. package/optional-skills/creative/kanban-video-orchestrator/references/intake.md +166 -0
  464. package/optional-skills/creative/kanban-video-orchestrator/references/kanban-setup.md +276 -0
  465. package/optional-skills/creative/kanban-video-orchestrator/references/monitoring.md +180 -0
  466. package/optional-skills/creative/kanban-video-orchestrator/references/role-archetypes.md +298 -0
  467. package/optional-skills/creative/kanban-video-orchestrator/references/tool-matrix.md +317 -0
  468. package/optional-skills/creative/kanban-video-orchestrator/scripts/bootstrap_pipeline.py +501 -0
  469. package/optional-skills/creative/kanban-video-orchestrator/scripts/monitor.py +195 -0
  470. package/optional-skills/creative/meme-generation/EXAMPLES.md +46 -0
  471. package/optional-skills/creative/meme-generation/SKILL.md +130 -0
  472. package/optional-skills/creative/meme-generation/scripts/generate_meme.py +471 -0
  473. package/optional-skills/creative/meme-generation/scripts/templates.json +97 -0
  474. package/optional-skills/devops/cli/SKILL.md +156 -0
  475. package/optional-skills/devops/cli/references/app-discovery.md +112 -0
  476. package/optional-skills/devops/cli/references/authentication.md +59 -0
  477. package/optional-skills/devops/cli/references/cli-reference.md +104 -0
  478. package/optional-skills/devops/cli/references/running-apps.md +171 -0
  479. package/optional-skills/devops/docker-management/SKILL.md +281 -0
  480. package/optional-skills/devops/pinggy-tunnel/SKILL.md +309 -0
  481. package/optional-skills/devops/watchers/SKILL.md +112 -0
  482. package/optional-skills/devops/watchers/scripts/_watermark.py +148 -0
  483. package/optional-skills/devops/watchers/scripts/watch_github.py +168 -0
  484. package/optional-skills/devops/watchers/scripts/watch_http_json.py +131 -0
  485. package/optional-skills/devops/watchers/scripts/watch_rss.py +121 -0
  486. package/optional-skills/dogfood/DESCRIPTION.md +3 -0
  487. package/optional-skills/dogfood/adversarial-ux-test/SKILL.md +191 -0
  488. package/optional-skills/email/agentmail/SKILL.md +126 -0
  489. package/optional-skills/finance/3-statement-model/SKILL.md +433 -0
  490. package/optional-skills/finance/3-statement-model/references/formatting.md +118 -0
  491. package/optional-skills/finance/3-statement-model/references/formulas.md +292 -0
  492. package/optional-skills/finance/3-statement-model/references/sec-filings.md +125 -0
  493. package/optional-skills/finance/comps-analysis/SKILL.md +662 -0
  494. package/optional-skills/finance/dcf-model/SKILL.md +1270 -0
  495. package/optional-skills/finance/dcf-model/TROUBLESHOOTING.md +40 -0
  496. package/optional-skills/finance/dcf-model/requirements.txt +7 -0
  497. package/optional-skills/finance/dcf-model/scripts/validate_dcf.py +292 -0
  498. package/optional-skills/finance/excel-author/SKILL.md +244 -0
  499. package/optional-skills/finance/excel-author/scripts/recalc.py +88 -0
  500. package/optional-skills/finance/lbo-model/SKILL.md +291 -0
  501. package/optional-skills/finance/merger-model/SKILL.md +144 -0
  502. package/optional-skills/finance/pptx-author/SKILL.md +173 -0
  503. package/optional-skills/finance/stocks/SKILL.md +95 -0
  504. package/optional-skills/finance/stocks/scripts/stocks_client.py +755 -0
  505. package/optional-skills/health/DESCRIPTION.md +1 -0
  506. package/optional-skills/health/fitness-nutrition/SKILL.md +256 -0
  507. package/optional-skills/health/fitness-nutrition/references/FORMULAS.md +100 -0
  508. package/optional-skills/health/fitness-nutrition/scripts/body_calc.py +210 -0
  509. package/optional-skills/health/fitness-nutrition/scripts/nutrition_search.py +86 -0
  510. package/optional-skills/health/neuroskill-bci/SKILL.md +459 -0
  511. package/optional-skills/health/neuroskill-bci/references/api.md +286 -0
  512. package/optional-skills/health/neuroskill-bci/references/metrics.md +220 -0
  513. package/optional-skills/health/neuroskill-bci/references/protocols.md +452 -0
  514. package/optional-skills/mcp/DESCRIPTION.md +3 -0
  515. package/optional-skills/mcp/fastmcp/SKILL.md +300 -0
  516. package/optional-skills/mcp/fastmcp/references/fastmcp-cli.md +110 -0
  517. package/optional-skills/mcp/fastmcp/scripts/scaffold_fastmcp.py +56 -0
  518. package/optional-skills/mcp/fastmcp/templates/api_wrapper.py +54 -0
  519. package/optional-skills/mcp/fastmcp/templates/database_server.py +77 -0
  520. package/optional-skills/mcp/fastmcp/templates/file_processor.py +55 -0
  521. package/optional-skills/mcp/mcporter/SKILL.md +123 -0
  522. package/optional-skills/migration/DESCRIPTION.md +2 -0
  523. package/optional-skills/migration/openclaw-migration/SKILL.md +298 -0
  524. package/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py +3136 -0
  525. package/optional-skills/mlops/accelerate/SKILL.md +336 -0
  526. package/optional-skills/mlops/accelerate/references/custom-plugins.md +453 -0
  527. package/optional-skills/mlops/accelerate/references/megatron-integration.md +489 -0
  528. package/optional-skills/mlops/accelerate/references/performance.md +525 -0
  529. package/optional-skills/mlops/chroma/SKILL.md +410 -0
  530. package/optional-skills/mlops/chroma/references/integration.md +38 -0
  531. package/optional-skills/mlops/clip/SKILL.md +257 -0
  532. package/optional-skills/mlops/clip/references/applications.md +207 -0
  533. package/optional-skills/mlops/faiss/SKILL.md +225 -0
  534. package/optional-skills/mlops/faiss/references/index_types.md +280 -0
  535. package/optional-skills/mlops/flash-attention/SKILL.md +367 -0
  536. package/optional-skills/mlops/flash-attention/references/benchmarks.md +215 -0
  537. package/optional-skills/mlops/flash-attention/references/transformers-integration.md +293 -0
  538. package/optional-skills/mlops/guidance/SKILL.md +576 -0
  539. package/optional-skills/mlops/guidance/references/backends.md +554 -0
  540. package/optional-skills/mlops/guidance/references/constraints.md +674 -0
  541. package/optional-skills/mlops/guidance/references/examples.md +767 -0
  542. package/optional-skills/mlops/huggingface-tokenizers/SKILL.md +520 -0
  543. package/optional-skills/mlops/huggingface-tokenizers/references/algorithms.md +653 -0
  544. package/optional-skills/mlops/huggingface-tokenizers/references/integration.md +637 -0
  545. package/optional-skills/mlops/huggingface-tokenizers/references/pipeline.md +723 -0
  546. package/optional-skills/mlops/huggingface-tokenizers/references/training.md +565 -0
  547. package/optional-skills/mlops/inference/outlines/SKILL.md +656 -0
  548. package/optional-skills/mlops/inference/outlines/references/backends.md +615 -0
  549. package/optional-skills/mlops/inference/outlines/references/examples.md +773 -0
  550. package/optional-skills/mlops/inference/outlines/references/json_generation.md +652 -0
  551. package/optional-skills/mlops/instructor/SKILL.md +744 -0
  552. package/optional-skills/mlops/instructor/references/examples.md +107 -0
  553. package/optional-skills/mlops/instructor/references/providers.md +70 -0
  554. package/optional-skills/mlops/instructor/references/validation.md +606 -0
  555. package/optional-skills/mlops/lambda-labs/SKILL.md +549 -0
  556. package/optional-skills/mlops/lambda-labs/references/advanced-usage.md +611 -0
  557. package/optional-skills/mlops/lambda-labs/references/troubleshooting.md +530 -0
  558. package/optional-skills/mlops/llava/SKILL.md +308 -0
  559. package/optional-skills/mlops/llava/references/training.md +197 -0
  560. package/optional-skills/mlops/modal/SKILL.md +345 -0
  561. package/optional-skills/mlops/modal/references/advanced-usage.md +503 -0
  562. package/optional-skills/mlops/modal/references/troubleshooting.md +494 -0
  563. package/optional-skills/mlops/nemo-curator/SKILL.md +387 -0
  564. package/optional-skills/mlops/nemo-curator/references/deduplication.md +87 -0
  565. package/optional-skills/mlops/nemo-curator/references/filtering.md +102 -0
  566. package/optional-skills/mlops/peft/SKILL.md +435 -0
  567. package/optional-skills/mlops/peft/references/advanced-usage.md +514 -0
  568. package/optional-skills/mlops/peft/references/troubleshooting.md +480 -0
  569. package/optional-skills/mlops/pinecone/SKILL.md +362 -0
  570. package/optional-skills/mlops/pinecone/references/deployment.md +181 -0
  571. package/optional-skills/mlops/pytorch-fsdp/SKILL.md +130 -0
  572. package/optional-skills/mlops/pytorch-fsdp/references/index.md +7 -0
  573. package/optional-skills/mlops/pytorch-fsdp/references/other.md +4261 -0
  574. package/optional-skills/mlops/pytorch-lightning/SKILL.md +350 -0
  575. package/optional-skills/mlops/pytorch-lightning/references/callbacks.md +436 -0
  576. package/optional-skills/mlops/pytorch-lightning/references/distributed.md +490 -0
  577. package/optional-skills/mlops/pytorch-lightning/references/hyperparameter-tuning.md +556 -0
  578. package/optional-skills/mlops/qdrant/SKILL.md +497 -0
  579. package/optional-skills/mlops/qdrant/references/advanced-usage.md +648 -0
  580. package/optional-skills/mlops/qdrant/references/troubleshooting.md +631 -0
  581. package/optional-skills/mlops/saelens/SKILL.md +390 -0
  582. package/optional-skills/mlops/saelens/references/README.md +69 -0
  583. package/optional-skills/mlops/saelens/references/api.md +333 -0
  584. package/optional-skills/mlops/saelens/references/tutorials.md +318 -0
  585. package/optional-skills/mlops/simpo/SKILL.md +223 -0
  586. package/optional-skills/mlops/simpo/references/datasets.md +478 -0
  587. package/optional-skills/mlops/simpo/references/hyperparameters.md +452 -0
  588. package/optional-skills/mlops/simpo/references/loss-functions.md +350 -0
  589. package/optional-skills/mlops/slime/SKILL.md +468 -0
  590. package/optional-skills/mlops/slime/references/api-reference.md +392 -0
  591. package/optional-skills/mlops/slime/references/troubleshooting.md +386 -0
  592. package/optional-skills/mlops/stable-diffusion/SKILL.md +523 -0
  593. package/optional-skills/mlops/stable-diffusion/references/advanced-usage.md +716 -0
  594. package/optional-skills/mlops/stable-diffusion/references/troubleshooting.md +555 -0
  595. package/optional-skills/mlops/tensorrt-llm/SKILL.md +191 -0
  596. package/optional-skills/mlops/tensorrt-llm/references/multi-gpu.md +298 -0
  597. package/optional-skills/mlops/tensorrt-llm/references/optimization.md +242 -0
  598. package/optional-skills/mlops/tensorrt-llm/references/serving.md +470 -0
  599. package/optional-skills/mlops/torchtitan/SKILL.md +362 -0
  600. package/optional-skills/mlops/torchtitan/references/checkpoint.md +181 -0
  601. package/optional-skills/mlops/torchtitan/references/custom-models.md +258 -0
  602. package/optional-skills/mlops/torchtitan/references/float8.md +133 -0
  603. package/optional-skills/mlops/torchtitan/references/fsdp.md +126 -0
  604. package/optional-skills/mlops/training/axolotl/SKILL.md +166 -0
  605. package/optional-skills/mlops/training/axolotl/references/api.md +5548 -0
  606. package/optional-skills/mlops/training/axolotl/references/dataset-formats.md +1029 -0
  607. package/optional-skills/mlops/training/axolotl/references/index.md +15 -0
  608. package/optional-skills/mlops/training/axolotl/references/other.md +3563 -0
  609. package/optional-skills/mlops/training/trl-fine-tuning/SKILL.md +463 -0
  610. package/optional-skills/mlops/training/trl-fine-tuning/references/dpo-variants.md +227 -0
  611. package/optional-skills/mlops/training/trl-fine-tuning/references/grpo-training.md +504 -0
  612. package/optional-skills/mlops/training/trl-fine-tuning/references/online-rl.md +82 -0
  613. package/optional-skills/mlops/training/trl-fine-tuning/references/reward-modeling.md +122 -0
  614. package/optional-skills/mlops/training/trl-fine-tuning/references/sft-training.md +168 -0
  615. package/optional-skills/mlops/training/trl-fine-tuning/templates/basic_grpo_training.py +228 -0
  616. package/optional-skills/mlops/training/unsloth/SKILL.md +84 -0
  617. package/optional-skills/mlops/training/unsloth/references/index.md +7 -0
  618. package/optional-skills/mlops/training/unsloth/references/llms-full.md +16799 -0
  619. package/optional-skills/mlops/training/unsloth/references/llms-txt.md +12044 -0
  620. package/optional-skills/mlops/training/unsloth/references/llms.md +82 -0
  621. package/optional-skills/mlops/whisper/SKILL.md +321 -0
  622. package/optional-skills/mlops/whisper/references/languages.md +189 -0
  623. package/optional-skills/productivity/canvas/SKILL.md +98 -0
  624. package/optional-skills/productivity/canvas/scripts/canvas_api.py +157 -0
  625. package/optional-skills/productivity/here-now/SKILL.md +217 -0
  626. package/optional-skills/productivity/here-now/scripts/drive.sh +406 -0
  627. package/optional-skills/productivity/here-now/scripts/publish.sh +445 -0
  628. package/optional-skills/productivity/memento-flashcards/SKILL.md +324 -0
  629. package/optional-skills/productivity/memento-flashcards/scripts/memento_cards.py +353 -0
  630. package/optional-skills/productivity/memento-flashcards/scripts/youtube_quiz.py +88 -0
  631. package/optional-skills/productivity/shop-app/SKILL.md +340 -0
  632. package/optional-skills/productivity/shopify/SKILL.md +373 -0
  633. package/optional-skills/productivity/siyuan/SKILL.md +298 -0
  634. package/optional-skills/productivity/telephony/SKILL.md +418 -0
  635. package/optional-skills/productivity/telephony/scripts/telephony.py +1343 -0
  636. package/optional-skills/research/bioinformatics/SKILL.md +235 -0
  637. package/optional-skills/research/darwinian-evolver/SKILL.md +199 -0
  638. package/optional-skills/research/darwinian-evolver/scripts/parrot_openrouter.py +218 -0
  639. package/optional-skills/research/darwinian-evolver/scripts/show_snapshot.py +69 -0
  640. package/optional-skills/research/darwinian-evolver/templates/custom_problem_template.py +240 -0
  641. package/optional-skills/research/domain-intel/SKILL.md +97 -0
  642. package/optional-skills/research/domain-intel/scripts/domain_intel.py +397 -0
  643. package/optional-skills/research/drug-discovery/SKILL.md +227 -0
  644. package/optional-skills/research/drug-discovery/references/ADMET_REFERENCE.md +66 -0
  645. package/optional-skills/research/drug-discovery/scripts/chembl_target.py +53 -0
  646. package/optional-skills/research/drug-discovery/scripts/ro5_screen.py +44 -0
  647. package/optional-skills/research/duckduckgo-search/SKILL.md +238 -0
  648. package/optional-skills/research/duckduckgo-search/scripts/duckduckgo.sh +28 -0
  649. package/optional-skills/research/gitnexus-explorer/SKILL.md +214 -0
  650. package/optional-skills/research/gitnexus-explorer/scripts/proxy.mjs +92 -0
  651. package/optional-skills/research/osint-investigation/SKILL.md +277 -0
  652. package/optional-skills/research/osint-investigation/references/sources/courtlistener.md +98 -0
  653. package/optional-skills/research/osint-investigation/references/sources/gdelt.md +104 -0
  654. package/optional-skills/research/osint-investigation/references/sources/icij-offshore.md +104 -0
  655. package/optional-skills/research/osint-investigation/references/sources/nyc-acris.md +90 -0
  656. package/optional-skills/research/osint-investigation/references/sources/ofac-sdn.md +92 -0
  657. package/optional-skills/research/osint-investigation/references/sources/opencorporates.md +103 -0
  658. package/optional-skills/research/osint-investigation/references/sources/sec-edgar.md +83 -0
  659. package/optional-skills/research/osint-investigation/references/sources/senate-ld.md +89 -0
  660. package/optional-skills/research/osint-investigation/references/sources/usaspending.md +97 -0
  661. package/optional-skills/research/osint-investigation/references/sources/wayback.md +93 -0
  662. package/optional-skills/research/osint-investigation/references/sources/wikipedia.md +107 -0
  663. package/optional-skills/research/osint-investigation/scripts/_http.py +82 -0
  664. package/optional-skills/research/osint-investigation/scripts/_normalize.py +67 -0
  665. package/optional-skills/research/osint-investigation/scripts/build_findings.py +221 -0
  666. package/optional-skills/research/osint-investigation/scripts/entity_resolution.py +228 -0
  667. package/optional-skills/research/osint-investigation/scripts/fetch_courtlistener.py +149 -0
  668. package/optional-skills/research/osint-investigation/scripts/fetch_gdelt.py +162 -0
  669. package/optional-skills/research/osint-investigation/scripts/fetch_icij_offshore.py +234 -0
  670. package/optional-skills/research/osint-investigation/scripts/fetch_nyc_acris.py +203 -0
  671. package/optional-skills/research/osint-investigation/scripts/fetch_ofac_sdn.py +175 -0
  672. package/optional-skills/research/osint-investigation/scripts/fetch_opencorporates.py +192 -0
  673. package/optional-skills/research/osint-investigation/scripts/fetch_sec_edgar.py +184 -0
  674. package/optional-skills/research/osint-investigation/scripts/fetch_senate_ld.py +146 -0
  675. package/optional-skills/research/osint-investigation/scripts/fetch_usaspending.py +170 -0
  676. package/optional-skills/research/osint-investigation/scripts/fetch_wayback.py +142 -0
  677. package/optional-skills/research/osint-investigation/scripts/fetch_wikipedia.py +267 -0
  678. package/optional-skills/research/osint-investigation/scripts/timing_analysis.py +253 -0
  679. package/optional-skills/research/osint-investigation/templates/source-template.md +59 -0
  680. package/optional-skills/research/parallel-cli/SKILL.md +391 -0
  681. package/optional-skills/research/qmd/SKILL.md +441 -0
  682. package/optional-skills/research/scrapling/SKILL.md +336 -0
  683. package/optional-skills/research/searxng-search/SKILL.md +212 -0
  684. package/optional-skills/research/searxng-search/scripts/searxng.sh +22 -0
  685. package/optional-skills/security/1password/SKILL.md +163 -0
  686. package/optional-skills/security/1password/references/cli-examples.md +31 -0
  687. package/optional-skills/security/1password/references/get-started.md +21 -0
  688. package/optional-skills/security/DESCRIPTION.md +3 -0
  689. package/optional-skills/security/oss-forensics/SKILL.md +423 -0
  690. package/optional-skills/security/oss-forensics/references/evidence-types.md +89 -0
  691. package/optional-skills/security/oss-forensics/references/github-archive-guide.md +184 -0
  692. package/optional-skills/security/oss-forensics/references/investigation-templates.md +131 -0
  693. package/optional-skills/security/oss-forensics/references/recovery-techniques.md +164 -0
  694. package/optional-skills/security/oss-forensics/scripts/evidence-store.py +313 -0
  695. package/optional-skills/security/oss-forensics/templates/forensic-report.md +151 -0
  696. package/optional-skills/security/oss-forensics/templates/malicious-package-report.md +43 -0
  697. package/optional-skills/security/sherlock/SKILL.md +193 -0
  698. package/optional-skills/software-development/rest-graphql-debug/SKILL.md +514 -0
  699. package/optional-skills/web-development/DESCRIPTION.md +5 -0
  700. package/optional-skills/web-development/page-agent/SKILL.md +190 -0
  701. package/package.json +78 -0
  702. package/plugins/__init__.py +1 -0
  703. package/plugins/__pycache__/__init__.cpython-312.pyc +0 -0
  704. package/plugins/context_engine/__init__.py +219 -0
  705. package/plugins/disk-cleanup/README.md +51 -0
  706. package/plugins/disk-cleanup/__init__.py +316 -0
  707. package/plugins/disk-cleanup/disk_cleanup.py +497 -0
  708. package/plugins/disk-cleanup/plugin.yaml +7 -0
  709. package/plugins/example-dashboard/dashboard/manifest.json +14 -0
  710. package/plugins/example-dashboard/dashboard/plugin_api.py +17 -0
  711. package/plugins/google_meet/README.md +131 -0
  712. package/plugins/google_meet/SKILL.md +148 -0
  713. package/plugins/google_meet/__init__.py +103 -0
  714. package/plugins/google_meet/audio_bridge.py +244 -0
  715. package/plugins/google_meet/cli.py +479 -0
  716. package/plugins/google_meet/meet_bot.py +852 -0
  717. package/plugins/google_meet/node/__init__.py +54 -0
  718. package/plugins/google_meet/node/cli.py +125 -0
  719. package/plugins/google_meet/node/client.py +107 -0
  720. package/plugins/google_meet/node/protocol.py +124 -0
  721. package/plugins/google_meet/node/registry.py +113 -0
  722. package/plugins/google_meet/node/server.py +201 -0
  723. package/plugins/google_meet/plugin.yaml +16 -0
  724. package/plugins/google_meet/process_manager.py +324 -0
  725. package/plugins/google_meet/realtime/__init__.py +10 -0
  726. package/plugins/google_meet/realtime/openai_client.py +332 -0
  727. package/plugins/google_meet/tools.py +348 -0
  728. package/plugins/hermes-achievements/LICENSE +21 -0
  729. package/plugins/hermes-achievements/README.md +150 -0
  730. package/plugins/hermes-achievements/dashboard/dist/index.js +732 -0
  731. package/plugins/hermes-achievements/dashboard/dist/style.css +146 -0
  732. package/plugins/hermes-achievements/dashboard/manifest.json +11 -0
  733. package/plugins/hermes-achievements/dashboard/plugin_api.py +1062 -0
  734. package/plugins/hermes-achievements/docs/achievements-performance-implementation-plan.md +157 -0
  735. package/plugins/hermes-achievements/docs/achievements-performance-implementation-spec.md +219 -0
  736. package/plugins/hermes-achievements/docs/achievements-performance-spec.md +174 -0
  737. package/plugins/hermes-achievements/docs/assets/achievements-dashboard-hd.png +0 -0
  738. package/plugins/hermes-achievements/docs/assets/achievements-tier-showcase-hd.png +0 -0
  739. package/plugins/hermes-achievements/tests/test_achievement_engine.py +156 -0
  740. package/plugins/image_gen/openai/__init__.py +303 -0
  741. package/plugins/image_gen/openai/__pycache__/__init__.cpython-312.pyc +0 -0
  742. package/plugins/image_gen/openai/plugin.yaml +7 -0
  743. package/plugins/image_gen/openai-codex/__init__.py +378 -0
  744. package/plugins/image_gen/openai-codex/__pycache__/__init__.cpython-312.pyc +0 -0
  745. package/plugins/image_gen/openai-codex/plugin.yaml +5 -0
  746. package/plugins/image_gen/xai/__init__.py +316 -0
  747. package/plugins/image_gen/xai/__pycache__/__init__.cpython-312.pyc +0 -0
  748. package/plugins/image_gen/xai/plugin.yaml +7 -0
  749. package/plugins/kanban/dashboard/dist/index.js +3143 -0
  750. package/plugins/kanban/dashboard/dist/style.css +1500 -0
  751. package/plugins/kanban/dashboard/manifest.json +14 -0
  752. package/plugins/kanban/dashboard/plugin_api.py +1612 -0
  753. package/plugins/kanban/systemd/hermes-kanban-dispatcher.service +32 -0
  754. package/plugins/memory/__init__.py +408 -0
  755. package/plugins/memory/byterover/README.md +41 -0
  756. package/plugins/memory/byterover/__init__.py +384 -0
  757. package/plugins/memory/byterover/plugin.yaml +9 -0
  758. package/plugins/memory/hindsight/README.md +138 -0
  759. package/plugins/memory/hindsight/__init__.py +1758 -0
  760. package/plugins/memory/hindsight/plugin.yaml +8 -0
  761. package/plugins/memory/holographic/README.md +36 -0
  762. package/plugins/memory/holographic/__init__.py +409 -0
  763. package/plugins/memory/holographic/holographic.py +203 -0
  764. package/plugins/memory/holographic/plugin.yaml +5 -0
  765. package/plugins/memory/holographic/retrieval.py +593 -0
  766. package/plugins/memory/holographic/store.py +579 -0
  767. package/plugins/memory/honcho/README.md +328 -0
  768. package/plugins/memory/honcho/__init__.py +1329 -0
  769. package/plugins/memory/honcho/cli.py +1452 -0
  770. package/plugins/memory/honcho/client.py +784 -0
  771. package/plugins/memory/honcho/plugin.yaml +7 -0
  772. package/plugins/memory/honcho/session.py +1255 -0
  773. package/plugins/memory/mem0/README.md +38 -0
  774. package/plugins/memory/mem0/__init__.py +374 -0
  775. package/plugins/memory/mem0/plugin.yaml +5 -0
  776. package/plugins/memory/openviking/README.md +40 -0
  777. package/plugins/memory/openviking/__init__.py +945 -0
  778. package/plugins/memory/openviking/plugin.yaml +9 -0
  779. package/plugins/memory/retaindb/README.md +40 -0
  780. package/plugins/memory/retaindb/__init__.py +767 -0
  781. package/plugins/memory/retaindb/plugin.yaml +7 -0
  782. package/plugins/memory/supermemory/README.md +99 -0
  783. package/plugins/memory/supermemory/__init__.py +792 -0
  784. package/plugins/memory/supermemory/plugin.yaml +5 -0
  785. package/plugins/model-providers/README.md +70 -0
  786. package/plugins/model-providers/ai-gateway/__init__.py +43 -0
  787. package/plugins/model-providers/ai-gateway/__pycache__/__init__.cpython-312.pyc +0 -0
  788. package/plugins/model-providers/ai-gateway/plugin.yaml +5 -0
  789. package/plugins/model-providers/alibaba/__init__.py +13 -0
  790. package/plugins/model-providers/alibaba/__pycache__/__init__.cpython-312.pyc +0 -0
  791. package/plugins/model-providers/alibaba/plugin.yaml +5 -0
  792. package/plugins/model-providers/alibaba-coding-plan/__init__.py +21 -0
  793. package/plugins/model-providers/alibaba-coding-plan/__pycache__/__init__.cpython-312.pyc +0 -0
  794. package/plugins/model-providers/alibaba-coding-plan/plugin.yaml +5 -0
  795. package/plugins/model-providers/anthropic/__init__.py +52 -0
  796. package/plugins/model-providers/anthropic/__pycache__/__init__.cpython-312.pyc +0 -0
  797. package/plugins/model-providers/anthropic/plugin.yaml +5 -0
  798. package/plugins/model-providers/arcee/__init__.py +13 -0
  799. package/plugins/model-providers/arcee/__pycache__/__init__.cpython-312.pyc +0 -0
  800. package/plugins/model-providers/arcee/plugin.yaml +5 -0
  801. package/plugins/model-providers/azure-foundry/__init__.py +21 -0
  802. package/plugins/model-providers/azure-foundry/__pycache__/__init__.cpython-312.pyc +0 -0
  803. package/plugins/model-providers/azure-foundry/plugin.yaml +5 -0
  804. package/plugins/model-providers/bedrock/__init__.py +29 -0
  805. package/plugins/model-providers/bedrock/__pycache__/__init__.cpython-312.pyc +0 -0
  806. package/plugins/model-providers/bedrock/plugin.yaml +5 -0
  807. package/plugins/model-providers/copilot/__init__.py +58 -0
  808. package/plugins/model-providers/copilot/__pycache__/__init__.cpython-312.pyc +0 -0
  809. package/plugins/model-providers/copilot/plugin.yaml +5 -0
  810. package/plugins/model-providers/copilot-acp/__init__.py +34 -0
  811. package/plugins/model-providers/copilot-acp/__pycache__/__init__.cpython-312.pyc +0 -0
  812. package/plugins/model-providers/copilot-acp/plugin.yaml +5 -0
  813. package/plugins/model-providers/custom/__init__.py +68 -0
  814. package/plugins/model-providers/custom/__pycache__/__init__.cpython-312.pyc +0 -0
  815. package/plugins/model-providers/custom/plugin.yaml +5 -0
  816. package/plugins/model-providers/deepseek/__init__.py +99 -0
  817. package/plugins/model-providers/deepseek/__pycache__/__init__.cpython-312.pyc +0 -0
  818. package/plugins/model-providers/deepseek/plugin.yaml +5 -0
  819. package/plugins/model-providers/gemini/__init__.py +72 -0
  820. package/plugins/model-providers/gemini/__pycache__/__init__.cpython-312.pyc +0 -0
  821. package/plugins/model-providers/gemini/plugin.yaml +5 -0
  822. package/plugins/model-providers/gmi/__init__.py +31 -0
  823. package/plugins/model-providers/gmi/__pycache__/__init__.cpython-312.pyc +0 -0
  824. package/plugins/model-providers/gmi/plugin.yaml +5 -0
  825. package/plugins/model-providers/huggingface/__init__.py +20 -0
  826. package/plugins/model-providers/huggingface/__pycache__/__init__.cpython-312.pyc +0 -0
  827. package/plugins/model-providers/huggingface/plugin.yaml +5 -0
  828. package/plugins/model-providers/kilocode/__init__.py +14 -0
  829. package/plugins/model-providers/kilocode/__pycache__/__init__.cpython-312.pyc +0 -0
  830. package/plugins/model-providers/kilocode/plugin.yaml +5 -0
  831. package/plugins/model-providers/kimi-coding/__init__.py +71 -0
  832. package/plugins/model-providers/kimi-coding/__pycache__/__init__.cpython-312.pyc +0 -0
  833. package/plugins/model-providers/kimi-coding/plugin.yaml +5 -0
  834. package/plugins/model-providers/minimax/__init__.py +45 -0
  835. package/plugins/model-providers/minimax/__pycache__/__init__.cpython-312.pyc +0 -0
  836. package/plugins/model-providers/minimax/plugin.yaml +5 -0
  837. package/plugins/model-providers/nous/__init__.py +54 -0
  838. package/plugins/model-providers/nous/__pycache__/__init__.cpython-312.pyc +0 -0
  839. package/plugins/model-providers/nous/plugin.yaml +5 -0
  840. package/plugins/model-providers/novita/__init__.py +27 -0
  841. package/plugins/model-providers/novita/__pycache__/__init__.cpython-312.pyc +0 -0
  842. package/plugins/model-providers/novita/plugin.yaml +5 -0
  843. package/plugins/model-providers/nvidia/__init__.py +21 -0
  844. package/plugins/model-providers/nvidia/__pycache__/__init__.cpython-312.pyc +0 -0
  845. package/plugins/model-providers/nvidia/plugin.yaml +5 -0
  846. package/plugins/model-providers/ollama-cloud/__init__.py +14 -0
  847. package/plugins/model-providers/ollama-cloud/__pycache__/__init__.cpython-312.pyc +0 -0
  848. package/plugins/model-providers/ollama-cloud/plugin.yaml +5 -0
  849. package/plugins/model-providers/openai-codex/__init__.py +15 -0
  850. package/plugins/model-providers/openai-codex/__pycache__/__init__.cpython-312.pyc +0 -0
  851. package/plugins/model-providers/openai-codex/plugin.yaml +5 -0
  852. package/plugins/model-providers/opencode-zen/__init__.py +30 -0
  853. package/plugins/model-providers/opencode-zen/__pycache__/__init__.cpython-312.pyc +0 -0
  854. package/plugins/model-providers/opencode-zen/plugin.yaml +5 -0
  855. package/plugins/model-providers/openrouter/__init__.py +115 -0
  856. package/plugins/model-providers/openrouter/__pycache__/__init__.cpython-312.pyc +0 -0
  857. package/plugins/model-providers/openrouter/plugin.yaml +5 -0
  858. package/plugins/model-providers/qwen-oauth/__init__.py +82 -0
  859. package/plugins/model-providers/qwen-oauth/__pycache__/__init__.cpython-312.pyc +0 -0
  860. package/plugins/model-providers/qwen-oauth/plugin.yaml +5 -0
  861. package/plugins/model-providers/stepfun/__init__.py +14 -0
  862. package/plugins/model-providers/stepfun/__pycache__/__init__.cpython-312.pyc +0 -0
  863. package/plugins/model-providers/stepfun/plugin.yaml +5 -0
  864. package/plugins/model-providers/xai/__init__.py +15 -0
  865. package/plugins/model-providers/xai/__pycache__/__init__.cpython-312.pyc +0 -0
  866. package/plugins/model-providers/xai/plugin.yaml +5 -0
  867. package/plugins/model-providers/xiaomi/__init__.py +14 -0
  868. package/plugins/model-providers/xiaomi/__pycache__/__init__.cpython-312.pyc +0 -0
  869. package/plugins/model-providers/xiaomi/plugin.yaml +5 -0
  870. package/plugins/model-providers/zai/__init__.py +21 -0
  871. package/plugins/model-providers/zai/__pycache__/__init__.cpython-312.pyc +0 -0
  872. package/plugins/model-providers/zai/plugin.yaml +5 -0
  873. package/plugins/observability/langfuse/README.md +53 -0
  874. package/plugins/observability/langfuse/__init__.py +1004 -0
  875. package/plugins/observability/langfuse/plugin.yaml +14 -0
  876. package/plugins/platforms/google_chat/__init__.py +3 -0
  877. package/plugins/platforms/google_chat/__pycache__/__init__.cpython-312.pyc +0 -0
  878. package/plugins/platforms/google_chat/__pycache__/adapter.cpython-312.pyc +0 -0
  879. package/plugins/platforms/google_chat/adapter.py +3343 -0
  880. package/plugins/platforms/google_chat/oauth.py +639 -0
  881. package/plugins/platforms/google_chat/plugin.yaml +39 -0
  882. package/plugins/platforms/irc/__init__.py +3 -0
  883. package/plugins/platforms/irc/__pycache__/__init__.cpython-312.pyc +0 -0
  884. package/plugins/platforms/irc/__pycache__/adapter.cpython-312.pyc +0 -0
  885. package/plugins/platforms/irc/adapter.py +969 -0
  886. package/plugins/platforms/irc/plugin.yaml +54 -0
  887. package/plugins/platforms/line/__init__.py +3 -0
  888. package/plugins/platforms/line/__pycache__/__init__.cpython-312.pyc +0 -0
  889. package/plugins/platforms/line/__pycache__/adapter.cpython-312.pyc +0 -0
  890. package/plugins/platforms/line/adapter.py +1639 -0
  891. package/plugins/platforms/line/plugin.yaml +65 -0
  892. package/plugins/platforms/simplex/__init__.py +3 -0
  893. package/plugins/platforms/simplex/__pycache__/__init__.cpython-312.pyc +0 -0
  894. package/plugins/platforms/simplex/__pycache__/adapter.cpython-312.pyc +0 -0
  895. package/plugins/platforms/simplex/adapter.py +746 -0
  896. package/plugins/platforms/simplex/plugin.yaml +37 -0
  897. package/plugins/platforms/teams/__init__.py +3 -0
  898. package/plugins/platforms/teams/__pycache__/__init__.cpython-312.pyc +0 -0
  899. package/plugins/platforms/teams/__pycache__/adapter.cpython-312.pyc +0 -0
  900. package/plugins/platforms/teams/adapter.py +1188 -0
  901. package/plugins/platforms/teams/plugin.yaml +48 -0
  902. package/plugins/spotify/__init__.py +66 -0
  903. package/plugins/spotify/__pycache__/__init__.cpython-312.pyc +0 -0
  904. package/plugins/spotify/__pycache__/client.cpython-312.pyc +0 -0
  905. package/plugins/spotify/__pycache__/tools.cpython-312.pyc +0 -0
  906. package/plugins/spotify/client.py +435 -0
  907. package/plugins/spotify/plugin.yaml +13 -0
  908. package/plugins/spotify/tools.py +454 -0
  909. package/plugins/teams_pipeline/__init__.py +23 -0
  910. package/plugins/teams_pipeline/cli.py +463 -0
  911. package/plugins/teams_pipeline/meetings.py +333 -0
  912. package/plugins/teams_pipeline/models.py +350 -0
  913. package/plugins/teams_pipeline/pipeline.py +692 -0
  914. package/plugins/teams_pipeline/plugin.yaml +9 -0
  915. package/plugins/teams_pipeline/runtime.py +135 -0
  916. package/plugins/teams_pipeline/store.py +194 -0
  917. package/plugins/teams_pipeline/subscriptions.py +249 -0
  918. package/plugins/video_gen/fal/__init__.py +523 -0
  919. package/plugins/video_gen/fal/__pycache__/__init__.cpython-312.pyc +0 -0
  920. package/plugins/video_gen/fal/plugin.yaml +7 -0
  921. package/plugins/video_gen/xai/__init__.py +441 -0
  922. package/plugins/video_gen/xai/__pycache__/__init__.cpython-312.pyc +0 -0
  923. package/plugins/video_gen/xai/plugin.yaml +7 -0
  924. package/plugins/web/__init__.py +7 -0
  925. package/plugins/web/__pycache__/__init__.cpython-312.pyc +0 -0
  926. package/plugins/web/brave_free/__init__.py +14 -0
  927. package/plugins/web/brave_free/__pycache__/__init__.cpython-312.pyc +0 -0
  928. package/plugins/web/brave_free/__pycache__/provider.cpython-312.pyc +0 -0
  929. package/plugins/web/brave_free/plugin.yaml +7 -0
  930. package/plugins/web/brave_free/provider.py +137 -0
  931. package/plugins/web/ddgs/__init__.py +15 -0
  932. package/plugins/web/ddgs/__pycache__/__init__.cpython-312.pyc +0 -0
  933. package/plugins/web/ddgs/__pycache__/provider.cpython-312.pyc +0 -0
  934. package/plugins/web/ddgs/plugin.yaml +7 -0
  935. package/plugins/web/ddgs/provider.py +104 -0
  936. package/plugins/web/exa/__init__.py +15 -0
  937. package/plugins/web/exa/__pycache__/__init__.cpython-312.pyc +0 -0
  938. package/plugins/web/exa/__pycache__/provider.cpython-312.pyc +0 -0
  939. package/plugins/web/exa/plugin.yaml +7 -0
  940. package/plugins/web/exa/provider.py +212 -0
  941. package/plugins/web/firecrawl/__init__.py +28 -0
  942. package/plugins/web/firecrawl/__pycache__/__init__.cpython-312.pyc +0 -0
  943. package/plugins/web/firecrawl/__pycache__/provider.cpython-312.pyc +0 -0
  944. package/plugins/web/firecrawl/plugin.yaml +7 -0
  945. package/plugins/web/firecrawl/provider.py +773 -0
  946. package/plugins/web/parallel/__init__.py +16 -0
  947. package/plugins/web/parallel/__pycache__/__init__.cpython-312.pyc +0 -0
  948. package/plugins/web/parallel/__pycache__/provider.cpython-312.pyc +0 -0
  949. package/plugins/web/parallel/plugin.yaml +7 -0
  950. package/plugins/web/parallel/provider.py +291 -0
  951. package/plugins/web/searxng/__init__.py +15 -0
  952. package/plugins/web/searxng/__pycache__/__init__.cpython-312.pyc +0 -0
  953. package/plugins/web/searxng/__pycache__/provider.cpython-312.pyc +0 -0
  954. package/plugins/web/searxng/plugin.yaml +7 -0
  955. package/plugins/web/searxng/provider.py +140 -0
  956. package/plugins/web/tavily/__init__.py +15 -0
  957. package/plugins/web/tavily/__pycache__/__init__.cpython-312.pyc +0 -0
  958. package/plugins/web/tavily/__pycache__/provider.cpython-312.pyc +0 -0
  959. package/plugins/web/tavily/plugin.yaml +7 -0
  960. package/plugins/web/tavily/provider.py +285 -0
  961. package/providers/README.md +78 -0
  962. package/providers/__init__.py +192 -0
  963. package/providers/__pycache__/__init__.cpython-312.pyc +0 -0
  964. package/providers/__pycache__/base.cpython-312.pyc +0 -0
  965. package/providers/base.py +184 -0
  966. package/pyproject.toml +255 -0
  967. package/run_agent.py +16409 -0
  968. package/scripts/benchmark_browser_eval.py +138 -0
  969. package/scripts/build_model_catalog.py +95 -0
  970. package/scripts/build_skills_index.py +325 -0
  971. package/scripts/check-windows-footguns.py +624 -0
  972. package/scripts/contributor_audit.py +473 -0
  973. package/scripts/discord-voice-doctor.py +396 -0
  974. package/scripts/hermes-gateway +416 -0
  975. package/scripts/install.cmd +28 -0
  976. package/scripts/install.ps1 +1611 -0
  977. package/scripts/install.sh +2007 -0
  978. package/scripts/install_psutil_android.py +117 -0
  979. package/scripts/keystroke_diagnostic.py +81 -0
  980. package/scripts/kill_modal.sh +34 -0
  981. package/scripts/lib/node-bootstrap.sh +238 -0
  982. package/scripts/lint_diff.py +207 -0
  983. package/scripts/postinstall.js +150 -0
  984. package/scripts/profile-tui.py +626 -0
  985. package/scripts/release.py +1680 -0
  986. package/scripts/run_tests.sh +129 -0
  987. package/scripts/sample_and_compress.py +409 -0
  988. package/scripts/setup_open_webui.sh +349 -0
  989. package/scripts/whatsapp-bridge/allowlist.js +88 -0
  990. package/scripts/whatsapp-bridge/allowlist.test.mjs +80 -0
  991. package/scripts/whatsapp-bridge/bridge.js +729 -0
  992. package/scripts/whatsapp-bridge/package-lock.json +2141 -0
  993. package/scripts/whatsapp-bridge/package.json +19 -0
  994. package/skills/apple/DESCRIPTION.md +2 -0
  995. package/skills/apple/apple-notes/SKILL.md +90 -0
  996. package/skills/apple/apple-reminders/SKILL.md +98 -0
  997. package/skills/apple/findmy/SKILL.md +131 -0
  998. package/skills/apple/imessage/SKILL.md +102 -0
  999. package/skills/apple/macos-computer-use/SKILL.md +201 -0
  1000. package/skills/autonomous-ai-agents/DESCRIPTION.md +3 -0
  1001. package/skills/autonomous-ai-agents/claude-code/SKILL.md +745 -0
  1002. package/skills/autonomous-ai-agents/codex/SKILL.md +130 -0
  1003. package/skills/autonomous-ai-agents/hermes-agent/SKILL.md +1014 -0
  1004. package/skills/autonomous-ai-agents/opencode/SKILL.md +219 -0
  1005. package/skills/creative/DESCRIPTION.md +3 -0
  1006. package/skills/creative/architecture-diagram/SKILL.md +148 -0
  1007. package/skills/creative/architecture-diagram/templates/template.html +319 -0
  1008. package/skills/creative/ascii-art/SKILL.md +322 -0
  1009. package/skills/creative/ascii-video/README.md +290 -0
  1010. package/skills/creative/ascii-video/SKILL.md +241 -0
  1011. package/skills/creative/ascii-video/references/architecture.md +802 -0
  1012. package/skills/creative/ascii-video/references/composition.md +892 -0
  1013. package/skills/creative/ascii-video/references/effects.md +1865 -0
  1014. package/skills/creative/ascii-video/references/inputs.md +685 -0
  1015. package/skills/creative/ascii-video/references/optimization.md +688 -0
  1016. package/skills/creative/ascii-video/references/scenes.md +1011 -0
  1017. package/skills/creative/ascii-video/references/shaders.md +1385 -0
  1018. package/skills/creative/ascii-video/references/troubleshooting.md +367 -0
  1019. package/skills/creative/baoyu-comic/PORT_NOTES.md +77 -0
  1020. package/skills/creative/baoyu-comic/SKILL.md +247 -0
  1021. package/skills/creative/baoyu-comic/references/analysis-framework.md +176 -0
  1022. package/skills/creative/baoyu-comic/references/art-styles/chalk.md +101 -0
  1023. package/skills/creative/baoyu-comic/references/art-styles/ink-brush.md +97 -0
  1024. package/skills/creative/baoyu-comic/references/art-styles/ligne-claire.md +75 -0
  1025. package/skills/creative/baoyu-comic/references/art-styles/manga.md +93 -0
  1026. package/skills/creative/baoyu-comic/references/art-styles/minimalist.md +84 -0
  1027. package/skills/creative/baoyu-comic/references/art-styles/realistic.md +89 -0
  1028. package/skills/creative/baoyu-comic/references/auto-selection.md +71 -0
  1029. package/skills/creative/baoyu-comic/references/base-prompt.md +98 -0
  1030. package/skills/creative/baoyu-comic/references/character-template.md +180 -0
  1031. package/skills/creative/baoyu-comic/references/layouts/cinematic.md +23 -0
  1032. package/skills/creative/baoyu-comic/references/layouts/dense.md +23 -0
  1033. package/skills/creative/baoyu-comic/references/layouts/four-panel.md +40 -0
  1034. package/skills/creative/baoyu-comic/references/layouts/mixed.md +23 -0
  1035. package/skills/creative/baoyu-comic/references/layouts/splash.md +23 -0
  1036. package/skills/creative/baoyu-comic/references/layouts/standard.md +23 -0
  1037. package/skills/creative/baoyu-comic/references/layouts/webtoon.md +30 -0
  1038. package/skills/creative/baoyu-comic/references/ohmsha-guide.md +85 -0
  1039. package/skills/creative/baoyu-comic/references/partial-workflows.md +106 -0
  1040. package/skills/creative/baoyu-comic/references/presets/concept-story.md +121 -0
  1041. package/skills/creative/baoyu-comic/references/presets/four-panel.md +107 -0
  1042. package/skills/creative/baoyu-comic/references/presets/ohmsha.md +114 -0
  1043. package/skills/creative/baoyu-comic/references/presets/shoujo.md +116 -0
  1044. package/skills/creative/baoyu-comic/references/presets/wuxia.md +110 -0
  1045. package/skills/creative/baoyu-comic/references/storyboard-template.md +143 -0
  1046. package/skills/creative/baoyu-comic/references/tones/action.md +110 -0
  1047. package/skills/creative/baoyu-comic/references/tones/dramatic.md +95 -0
  1048. package/skills/creative/baoyu-comic/references/tones/energetic.md +105 -0
  1049. package/skills/creative/baoyu-comic/references/tones/neutral.md +63 -0
  1050. package/skills/creative/baoyu-comic/references/tones/romantic.md +100 -0
  1051. package/skills/creative/baoyu-comic/references/tones/vintage.md +104 -0
  1052. package/skills/creative/baoyu-comic/references/tones/warm.md +94 -0
  1053. package/skills/creative/baoyu-comic/references/workflow.md +401 -0
  1054. package/skills/creative/baoyu-infographic/PORT_NOTES.md +43 -0
  1055. package/skills/creative/baoyu-infographic/SKILL.md +237 -0
  1056. package/skills/creative/baoyu-infographic/references/analysis-framework.md +182 -0
  1057. package/skills/creative/baoyu-infographic/references/base-prompt.md +43 -0
  1058. package/skills/creative/baoyu-infographic/references/layouts/bento-grid.md +41 -0
  1059. package/skills/creative/baoyu-infographic/references/layouts/binary-comparison.md +48 -0
  1060. package/skills/creative/baoyu-infographic/references/layouts/bridge.md +41 -0
  1061. package/skills/creative/baoyu-infographic/references/layouts/circular-flow.md +41 -0
  1062. package/skills/creative/baoyu-infographic/references/layouts/comic-strip.md +41 -0
  1063. package/skills/creative/baoyu-infographic/references/layouts/comparison-matrix.md +41 -0
  1064. package/skills/creative/baoyu-infographic/references/layouts/dashboard.md +41 -0
  1065. package/skills/creative/baoyu-infographic/references/layouts/dense-modules.md +72 -0
  1066. package/skills/creative/baoyu-infographic/references/layouts/funnel.md +41 -0
  1067. package/skills/creative/baoyu-infographic/references/layouts/hierarchical-layers.md +48 -0
  1068. package/skills/creative/baoyu-infographic/references/layouts/hub-spoke.md +41 -0
  1069. package/skills/creative/baoyu-infographic/references/layouts/iceberg.md +41 -0
  1070. package/skills/creative/baoyu-infographic/references/layouts/isometric-map.md +41 -0
  1071. package/skills/creative/baoyu-infographic/references/layouts/jigsaw.md +41 -0
  1072. package/skills/creative/baoyu-infographic/references/layouts/linear-progression.md +48 -0
  1073. package/skills/creative/baoyu-infographic/references/layouts/periodic-table.md +41 -0
  1074. package/skills/creative/baoyu-infographic/references/layouts/story-mountain.md +41 -0
  1075. package/skills/creative/baoyu-infographic/references/layouts/structural-breakdown.md +48 -0
  1076. package/skills/creative/baoyu-infographic/references/layouts/tree-branching.md +41 -0
  1077. package/skills/creative/baoyu-infographic/references/layouts/venn-diagram.md +41 -0
  1078. package/skills/creative/baoyu-infographic/references/layouts/winding-roadmap.md +41 -0
  1079. package/skills/creative/baoyu-infographic/references/structured-content-template.md +244 -0
  1080. package/skills/creative/baoyu-infographic/references/styles/aged-academia.md +36 -0
  1081. package/skills/creative/baoyu-infographic/references/styles/bold-graphic.md +36 -0
  1082. package/skills/creative/baoyu-infographic/references/styles/chalkboard.md +61 -0
  1083. package/skills/creative/baoyu-infographic/references/styles/claymation.md +29 -0
  1084. package/skills/creative/baoyu-infographic/references/styles/corporate-memphis.md +29 -0
  1085. package/skills/creative/baoyu-infographic/references/styles/craft-handmade.md +44 -0
  1086. package/skills/creative/baoyu-infographic/references/styles/cyberpunk-neon.md +29 -0
  1087. package/skills/creative/baoyu-infographic/references/styles/hand-drawn-edu.md +63 -0
  1088. package/skills/creative/baoyu-infographic/references/styles/ikea-manual.md +29 -0
  1089. package/skills/creative/baoyu-infographic/references/styles/kawaii.md +29 -0
  1090. package/skills/creative/baoyu-infographic/references/styles/knolling.md +29 -0
  1091. package/skills/creative/baoyu-infographic/references/styles/lego-brick.md +29 -0
  1092. package/skills/creative/baoyu-infographic/references/styles/morandi-journal.md +60 -0
  1093. package/skills/creative/baoyu-infographic/references/styles/origami.md +29 -0
  1094. package/skills/creative/baoyu-infographic/references/styles/pixel-art.md +29 -0
  1095. package/skills/creative/baoyu-infographic/references/styles/pop-laboratory.md +48 -0
  1096. package/skills/creative/baoyu-infographic/references/styles/retro-pop-grid.md +47 -0
  1097. package/skills/creative/baoyu-infographic/references/styles/storybook-watercolor.md +29 -0
  1098. package/skills/creative/baoyu-infographic/references/styles/subway-map.md +29 -0
  1099. package/skills/creative/baoyu-infographic/references/styles/technical-schematic.md +36 -0
  1100. package/skills/creative/baoyu-infographic/references/styles/ui-wireframe.md +29 -0
  1101. package/skills/creative/claude-design/SKILL.md +591 -0
  1102. package/skills/creative/comfyui/SKILL.md +612 -0
  1103. package/skills/creative/comfyui/references/official-cli.md +255 -0
  1104. package/skills/creative/comfyui/references/rest-api.md +312 -0
  1105. package/skills/creative/comfyui/references/template-integrity.md +243 -0
  1106. package/skills/creative/comfyui/references/workflow-format.md +226 -0
  1107. package/skills/creative/comfyui/scripts/_common.py +835 -0
  1108. package/skills/creative/comfyui/scripts/auto_fix_deps.py +225 -0
  1109. package/skills/creative/comfyui/scripts/check_deps.py +437 -0
  1110. package/skills/creative/comfyui/scripts/comfyui_setup.sh +286 -0
  1111. package/skills/creative/comfyui/scripts/extract_schema.py +315 -0
  1112. package/skills/creative/comfyui/scripts/fetch_logs.py +158 -0
  1113. package/skills/creative/comfyui/scripts/hardware_check.py +497 -0
  1114. package/skills/creative/comfyui/scripts/health_check.py +223 -0
  1115. package/skills/creative/comfyui/scripts/run_batch.py +243 -0
  1116. package/skills/creative/comfyui/scripts/run_workflow.py +796 -0
  1117. package/skills/creative/comfyui/scripts/ws_monitor.py +267 -0
  1118. package/skills/creative/comfyui/tests/README.md +50 -0
  1119. package/skills/creative/comfyui/tests/conftest.py +64 -0
  1120. package/skills/creative/comfyui/tests/pytest.ini +5 -0
  1121. package/skills/creative/comfyui/tests/test_check_deps.py +68 -0
  1122. package/skills/creative/comfyui/tests/test_cloud_integration.py +95 -0
  1123. package/skills/creative/comfyui/tests/test_common.py +447 -0
  1124. package/skills/creative/comfyui/tests/test_extract_schema.py +185 -0
  1125. package/skills/creative/comfyui/tests/test_run_workflow.py +213 -0
  1126. package/skills/creative/comfyui/workflows/README.md +86 -0
  1127. package/skills/creative/comfyui/workflows/animatediff_video.json +64 -0
  1128. package/skills/creative/comfyui/workflows/flux_dev_txt2img.json +78 -0
  1129. package/skills/creative/comfyui/workflows/sd15_txt2img.json +49 -0
  1130. package/skills/creative/comfyui/workflows/sdxl_img2img.json +54 -0
  1131. package/skills/creative/comfyui/workflows/sdxl_inpaint.json +59 -0
  1132. package/skills/creative/comfyui/workflows/sdxl_txt2img.json +49 -0
  1133. package/skills/creative/comfyui/workflows/upscale_4x.json +27 -0
  1134. package/skills/creative/comfyui/workflows/wan_video_t2v.json +69 -0
  1135. package/skills/creative/creative-ideation/SKILL.md +152 -0
  1136. package/skills/creative/creative-ideation/references/full-prompt-library.md +110 -0
  1137. package/skills/creative/design-md/SKILL.md +199 -0
  1138. package/skills/creative/design-md/templates/starter.md +99 -0
  1139. package/skills/creative/excalidraw/SKILL.md +199 -0
  1140. package/skills/creative/excalidraw/references/colors.md +44 -0
  1141. package/skills/creative/excalidraw/references/dark-mode.md +68 -0
  1142. package/skills/creative/excalidraw/references/examples.md +141 -0
  1143. package/skills/creative/excalidraw/scripts/upload.py +133 -0
  1144. package/skills/creative/humanizer/LICENSE +21 -0
  1145. package/skills/creative/humanizer/SKILL.md +578 -0
  1146. package/skills/creative/manim-video/README.md +23 -0
  1147. package/skills/creative/manim-video/SKILL.md +269 -0
  1148. package/skills/creative/manim-video/references/animation-design-thinking.md +161 -0
  1149. package/skills/creative/manim-video/references/animations.md +282 -0
  1150. package/skills/creative/manim-video/references/camera-and-3d.md +135 -0
  1151. package/skills/creative/manim-video/references/decorations.md +202 -0
  1152. package/skills/creative/manim-video/references/equations.md +216 -0
  1153. package/skills/creative/manim-video/references/graphs-and-data.md +163 -0
  1154. package/skills/creative/manim-video/references/mobjects.md +333 -0
  1155. package/skills/creative/manim-video/references/paper-explainer.md +255 -0
  1156. package/skills/creative/manim-video/references/production-quality.md +190 -0
  1157. package/skills/creative/manim-video/references/rendering.md +185 -0
  1158. package/skills/creative/manim-video/references/scene-planning.md +118 -0
  1159. package/skills/creative/manim-video/references/troubleshooting.md +135 -0
  1160. package/skills/creative/manim-video/references/updaters-and-trackers.md +260 -0
  1161. package/skills/creative/manim-video/references/visual-design.md +124 -0
  1162. package/skills/creative/manim-video/scripts/setup.sh +14 -0
  1163. package/skills/creative/p5js/README.md +64 -0
  1164. package/skills/creative/p5js/SKILL.md +556 -0
  1165. package/skills/creative/p5js/references/animation.md +439 -0
  1166. package/skills/creative/p5js/references/color-systems.md +352 -0
  1167. package/skills/creative/p5js/references/core-api.md +410 -0
  1168. package/skills/creative/p5js/references/export-pipeline.md +566 -0
  1169. package/skills/creative/p5js/references/interaction.md +398 -0
  1170. package/skills/creative/p5js/references/shapes-and-geometry.md +300 -0
  1171. package/skills/creative/p5js/references/troubleshooting.md +532 -0
  1172. package/skills/creative/p5js/references/typography.md +302 -0
  1173. package/skills/creative/p5js/references/visual-effects.md +895 -0
  1174. package/skills/creative/p5js/references/webgl-and-3d.md +423 -0
  1175. package/skills/creative/p5js/scripts/export-frames.js +179 -0
  1176. package/skills/creative/p5js/scripts/render.sh +108 -0
  1177. package/skills/creative/p5js/scripts/serve.sh +28 -0
  1178. package/skills/creative/p5js/scripts/setup.sh +87 -0
  1179. package/skills/creative/p5js/templates/viewer.html +395 -0
  1180. package/skills/creative/pixel-art/ATTRIBUTION.md +54 -0
  1181. package/skills/creative/pixel-art/SKILL.md +218 -0
  1182. package/skills/creative/pixel-art/references/palettes.md +49 -0
  1183. package/skills/creative/pixel-art/scripts/__init__.py +0 -0
  1184. package/skills/creative/pixel-art/scripts/palettes.py +167 -0
  1185. package/skills/creative/pixel-art/scripts/pixel_art.py +162 -0
  1186. package/skills/creative/pixel-art/scripts/pixel_art_video.py +345 -0
  1187. package/skills/creative/popular-web-designs/SKILL.md +214 -0
  1188. package/skills/creative/popular-web-designs/templates/airbnb.md +259 -0
  1189. package/skills/creative/popular-web-designs/templates/airtable.md +102 -0
  1190. package/skills/creative/popular-web-designs/templates/apple.md +326 -0
  1191. package/skills/creative/popular-web-designs/templates/bmw.md +193 -0
  1192. package/skills/creative/popular-web-designs/templates/cal.md +272 -0
  1193. package/skills/creative/popular-web-designs/templates/claude.md +325 -0
  1194. package/skills/creative/popular-web-designs/templates/clay.md +317 -0
  1195. package/skills/creative/popular-web-designs/templates/clickhouse.md +294 -0
  1196. package/skills/creative/popular-web-designs/templates/cohere.md +279 -0
  1197. package/skills/creative/popular-web-designs/templates/coinbase.md +142 -0
  1198. package/skills/creative/popular-web-designs/templates/composio.md +320 -0
  1199. package/skills/creative/popular-web-designs/templates/cursor.md +322 -0
  1200. package/skills/creative/popular-web-designs/templates/elevenlabs.md +278 -0
  1201. package/skills/creative/popular-web-designs/templates/expo.md +294 -0
  1202. package/skills/creative/popular-web-designs/templates/figma.md +233 -0
  1203. package/skills/creative/popular-web-designs/templates/framer.md +259 -0
  1204. package/skills/creative/popular-web-designs/templates/hashicorp.md +291 -0
  1205. package/skills/creative/popular-web-designs/templates/ibm.md +345 -0
  1206. package/skills/creative/popular-web-designs/templates/intercom.md +159 -0
  1207. package/skills/creative/popular-web-designs/templates/kraken.md +138 -0
  1208. package/skills/creative/popular-web-designs/templates/linear.app.md +380 -0
  1209. package/skills/creative/popular-web-designs/templates/lovable.md +311 -0
  1210. package/skills/creative/popular-web-designs/templates/minimax.md +270 -0
  1211. package/skills/creative/popular-web-designs/templates/mintlify.md +339 -0
  1212. package/skills/creative/popular-web-designs/templates/miro.md +121 -0
  1213. package/skills/creative/popular-web-designs/templates/mistral.ai.md +274 -0
  1214. package/skills/creative/popular-web-designs/templates/mongodb.md +279 -0
  1215. package/skills/creative/popular-web-designs/templates/notion.md +322 -0
  1216. package/skills/creative/popular-web-designs/templates/nvidia.md +306 -0
  1217. package/skills/creative/popular-web-designs/templates/ollama.md +280 -0
  1218. package/skills/creative/popular-web-designs/templates/opencode.ai.md +294 -0
  1219. package/skills/creative/popular-web-designs/templates/pinterest.md +243 -0
  1220. package/skills/creative/popular-web-designs/templates/posthog.md +269 -0
  1221. package/skills/creative/popular-web-designs/templates/raycast.md +281 -0
  1222. package/skills/creative/popular-web-designs/templates/replicate.md +274 -0
  1223. package/skills/creative/popular-web-designs/templates/resend.md +316 -0
  1224. package/skills/creative/popular-web-designs/templates/revolut.md +198 -0
  1225. package/skills/creative/popular-web-designs/templates/runwayml.md +257 -0
  1226. package/skills/creative/popular-web-designs/templates/sanity.md +370 -0
  1227. package/skills/creative/popular-web-designs/templates/sentry.md +275 -0
  1228. package/skills/creative/popular-web-designs/templates/spacex.md +207 -0
  1229. package/skills/creative/popular-web-designs/templates/spotify.md +259 -0
  1230. package/skills/creative/popular-web-designs/templates/stripe.md +335 -0
  1231. package/skills/creative/popular-web-designs/templates/supabase.md +268 -0
  1232. package/skills/creative/popular-web-designs/templates/superhuman.md +265 -0
  1233. package/skills/creative/popular-web-designs/templates/together.ai.md +276 -0
  1234. package/skills/creative/popular-web-designs/templates/uber.md +308 -0
  1235. package/skills/creative/popular-web-designs/templates/vercel.md +323 -0
  1236. package/skills/creative/popular-web-designs/templates/voltagent.md +336 -0
  1237. package/skills/creative/popular-web-designs/templates/warp.md +266 -0
  1238. package/skills/creative/popular-web-designs/templates/webflow.md +105 -0
  1239. package/skills/creative/popular-web-designs/templates/wise.md +186 -0
  1240. package/skills/creative/popular-web-designs/templates/x.ai.md +270 -0
  1241. package/skills/creative/popular-web-designs/templates/zapier.md +341 -0
  1242. package/skills/creative/pretext/SKILL.md +220 -0
  1243. package/skills/creative/pretext/references/patterns.md +258 -0
  1244. package/skills/creative/pretext/templates/donut-orbit.html +1468 -0
  1245. package/skills/creative/pretext/templates/hello-orb-flow.html +95 -0
  1246. package/skills/creative/sketch/SKILL.md +218 -0
  1247. package/skills/creative/songwriting-and-ai-music/SKILL.md +287 -0
  1248. package/skills/creative/touchdesigner-mcp/SKILL.md +356 -0
  1249. package/skills/creative/touchdesigner-mcp/references/3d-scene.md +275 -0
  1250. package/skills/creative/touchdesigner-mcp/references/animation.md +221 -0
  1251. package/skills/creative/touchdesigner-mcp/references/audio-reactive.md +175 -0
  1252. package/skills/creative/touchdesigner-mcp/references/dat-scripting.md +352 -0
  1253. package/skills/creative/touchdesigner-mcp/references/external-data.md +322 -0
  1254. package/skills/creative/touchdesigner-mcp/references/geometry-comp.md +121 -0
  1255. package/skills/creative/touchdesigner-mcp/references/glsl.md +151 -0
  1256. package/skills/creative/touchdesigner-mcp/references/layout-compositor.md +131 -0
  1257. package/skills/creative/touchdesigner-mcp/references/mcp-tools.md +382 -0
  1258. package/skills/creative/touchdesigner-mcp/references/midi-osc.md +211 -0
  1259. package/skills/creative/touchdesigner-mcp/references/network-patterns.md +966 -0
  1260. package/skills/creative/touchdesigner-mcp/references/operator-tips.md +106 -0
  1261. package/skills/creative/touchdesigner-mcp/references/operators.md +239 -0
  1262. package/skills/creative/touchdesigner-mcp/references/panel-ui.md +281 -0
  1263. package/skills/creative/touchdesigner-mcp/references/particles.md +245 -0
  1264. package/skills/creative/touchdesigner-mcp/references/pitfalls.md +704 -0
  1265. package/skills/creative/touchdesigner-mcp/references/postfx.md +183 -0
  1266. package/skills/creative/touchdesigner-mcp/references/projection-mapping.md +211 -0
  1267. package/skills/creative/touchdesigner-mcp/references/python-api.md +463 -0
  1268. package/skills/creative/touchdesigner-mcp/references/replicator.md +198 -0
  1269. package/skills/creative/touchdesigner-mcp/references/troubleshooting.md +244 -0
  1270. package/skills/creative/touchdesigner-mcp/scripts/setup.sh +115 -0
  1271. package/skills/data-science/DESCRIPTION.md +3 -0
  1272. package/skills/data-science/jupyter-live-kernel/SKILL.md +167 -0
  1273. package/skills/devops/kanban-orchestrator/SKILL.md +189 -0
  1274. package/skills/devops/kanban-worker/SKILL.md +184 -0
  1275. package/skills/devops/webhook-subscriptions/SKILL.md +204 -0
  1276. package/skills/diagramming/DESCRIPTION.md +3 -0
  1277. package/skills/dogfood/SKILL.md +162 -0
  1278. package/skills/dogfood/references/issue-taxonomy.md +109 -0
  1279. package/skills/dogfood/templates/dogfood-report-template.md +86 -0
  1280. package/skills/domain/DESCRIPTION.md +24 -0
  1281. package/skills/email/DESCRIPTION.md +3 -0
  1282. package/skills/email/himalaya/SKILL.md +299 -0
  1283. package/skills/email/himalaya/references/configuration.md +227 -0
  1284. package/skills/email/himalaya/references/message-composition.md +199 -0
  1285. package/skills/gaming/DESCRIPTION.md +3 -0
  1286. package/skills/gaming/minecraft-modpack-server/SKILL.md +187 -0
  1287. package/skills/gaming/pokemon-player/SKILL.md +216 -0
  1288. package/skills/gifs/DESCRIPTION.md +3 -0
  1289. package/skills/github/DESCRIPTION.md +3 -0
  1290. package/skills/github/codebase-inspection/SKILL.md +116 -0
  1291. package/skills/github/github-auth/SKILL.md +247 -0
  1292. package/skills/github/github-auth/scripts/gh-env.sh +66 -0
  1293. package/skills/github/github-code-review/SKILL.md +481 -0
  1294. package/skills/github/github-code-review/references/review-output-template.md +74 -0
  1295. package/skills/github/github-issues/SKILL.md +370 -0
  1296. package/skills/github/github-issues/templates/bug-report.md +35 -0
  1297. package/skills/github/github-issues/templates/feature-request.md +31 -0
  1298. package/skills/github/github-pr-workflow/SKILL.md +367 -0
  1299. package/skills/github/github-pr-workflow/references/ci-troubleshooting.md +183 -0
  1300. package/skills/github/github-pr-workflow/references/conventional-commits.md +71 -0
  1301. package/skills/github/github-pr-workflow/templates/pr-body-bugfix.md +35 -0
  1302. package/skills/github/github-pr-workflow/templates/pr-body-feature.md +33 -0
  1303. package/skills/github/github-repo-management/SKILL.md +516 -0
  1304. package/skills/github/github-repo-management/references/github-api-cheatsheet.md +161 -0
  1305. package/skills/index-cache/anthropics_skills_skills_.json +1 -0
  1306. package/skills/index-cache/claude_marketplace_anthropics_skills.json +1 -0
  1307. package/skills/index-cache/lobehub_index.json +1 -0
  1308. package/skills/index-cache/openai_skills_skills_.json +1 -0
  1309. package/skills/inference-sh/DESCRIPTION.md +19 -0
  1310. package/skills/mcp/DESCRIPTION.md +3 -0
  1311. package/skills/mcp/native-mcp/SKILL.md +357 -0
  1312. package/skills/media/DESCRIPTION.md +3 -0
  1313. package/skills/media/gif-search/SKILL.md +91 -0
  1314. package/skills/media/heartmula/SKILL.md +171 -0
  1315. package/skills/media/songsee/SKILL.md +83 -0
  1316. package/skills/media/spotify/SKILL.md +135 -0
  1317. package/skills/media/youtube-content/SKILL.md +73 -0
  1318. package/skills/media/youtube-content/references/output-formats.md +56 -0
  1319. package/skills/media/youtube-content/scripts/fetch_transcript.py +124 -0
  1320. package/skills/mlops/DESCRIPTION.md +3 -0
  1321. package/skills/mlops/evaluation/DESCRIPTION.md +3 -0
  1322. package/skills/mlops/evaluation/lm-evaluation-harness/SKILL.md +498 -0
  1323. package/skills/mlops/evaluation/lm-evaluation-harness/references/api-evaluation.md +490 -0
  1324. package/skills/mlops/evaluation/lm-evaluation-harness/references/benchmark-guide.md +488 -0
  1325. package/skills/mlops/evaluation/lm-evaluation-harness/references/custom-tasks.md +602 -0
  1326. package/skills/mlops/evaluation/lm-evaluation-harness/references/distributed-eval.md +519 -0
  1327. package/skills/mlops/evaluation/weights-and-biases/SKILL.md +594 -0
  1328. package/skills/mlops/evaluation/weights-and-biases/references/artifacts.md +584 -0
  1329. package/skills/mlops/evaluation/weights-and-biases/references/integrations.md +700 -0
  1330. package/skills/mlops/evaluation/weights-and-biases/references/sweeps.md +847 -0
  1331. package/skills/mlops/huggingface-hub/SKILL.md +81 -0
  1332. package/skills/mlops/inference/DESCRIPTION.md +3 -0
  1333. package/skills/mlops/inference/llama-cpp/SKILL.md +249 -0
  1334. package/skills/mlops/inference/llama-cpp/references/advanced-usage.md +504 -0
  1335. package/skills/mlops/inference/llama-cpp/references/hub-discovery.md +168 -0
  1336. package/skills/mlops/inference/llama-cpp/references/optimization.md +89 -0
  1337. package/skills/mlops/inference/llama-cpp/references/quantization.md +243 -0
  1338. package/skills/mlops/inference/llama-cpp/references/server.md +150 -0
  1339. package/skills/mlops/inference/llama-cpp/references/troubleshooting.md +442 -0
  1340. package/skills/mlops/inference/obliteratus/SKILL.md +342 -0
  1341. package/skills/mlops/inference/obliteratus/references/analysis-modules.md +166 -0
  1342. package/skills/mlops/inference/obliteratus/references/methods-guide.md +141 -0
  1343. package/skills/mlops/inference/obliteratus/templates/abliteration-config.yaml +33 -0
  1344. package/skills/mlops/inference/obliteratus/templates/analysis-study.yaml +40 -0
  1345. package/skills/mlops/inference/obliteratus/templates/batch-abliteration.yaml +41 -0
  1346. package/skills/mlops/inference/vllm/SKILL.md +372 -0
  1347. package/skills/mlops/inference/vllm/references/optimization.md +226 -0
  1348. package/skills/mlops/inference/vllm/references/quantization.md +284 -0
  1349. package/skills/mlops/inference/vllm/references/server-deployment.md +255 -0
  1350. package/skills/mlops/inference/vllm/references/troubleshooting.md +447 -0
  1351. package/skills/mlops/models/DESCRIPTION.md +3 -0
  1352. package/skills/mlops/models/audiocraft/SKILL.md +568 -0
  1353. package/skills/mlops/models/audiocraft/references/advanced-usage.md +666 -0
  1354. package/skills/mlops/models/audiocraft/references/troubleshooting.md +504 -0
  1355. package/skills/mlops/models/segment-anything/SKILL.md +506 -0
  1356. package/skills/mlops/models/segment-anything/references/advanced-usage.md +589 -0
  1357. package/skills/mlops/models/segment-anything/references/troubleshooting.md +484 -0
  1358. package/skills/mlops/research/DESCRIPTION.md +3 -0
  1359. package/skills/mlops/research/dspy/SKILL.md +594 -0
  1360. package/skills/mlops/research/dspy/references/examples.md +663 -0
  1361. package/skills/mlops/research/dspy/references/modules.md +475 -0
  1362. package/skills/mlops/research/dspy/references/optimizers.md +566 -0
  1363. package/skills/mlops/training/DESCRIPTION.md +3 -0
  1364. package/skills/mlops/vector-databases/DESCRIPTION.md +3 -0
  1365. package/skills/note-taking/DESCRIPTION.md +3 -0
  1366. package/skills/note-taking/obsidian/SKILL.md +61 -0
  1367. package/skills/productivity/DESCRIPTION.md +3 -0
  1368. package/skills/productivity/airtable/SKILL.md +229 -0
  1369. package/skills/productivity/google-workspace/SKILL.md +335 -0
  1370. package/skills/productivity/google-workspace/references/gmail-search-syntax.md +63 -0
  1371. package/skills/productivity/google-workspace/scripts/_hermes_home.py +43 -0
  1372. package/skills/productivity/google-workspace/scripts/google_api.py +1221 -0
  1373. package/skills/productivity/google-workspace/scripts/gws_bridge.py +108 -0
  1374. package/skills/productivity/google-workspace/scripts/setup.py +454 -0
  1375. package/skills/productivity/linear/SKILL.md +380 -0
  1376. package/skills/productivity/linear/scripts/linear_api.py +445 -0
  1377. package/skills/productivity/maps/SKILL.md +195 -0
  1378. package/skills/productivity/maps/scripts/maps_client.py +1298 -0
  1379. package/skills/productivity/nano-pdf/SKILL.md +52 -0
  1380. package/skills/productivity/notion/SKILL.md +448 -0
  1381. package/skills/productivity/notion/references/block-types.md +112 -0
  1382. package/skills/productivity/ocr-and-documents/DESCRIPTION.md +3 -0
  1383. package/skills/productivity/ocr-and-documents/SKILL.md +172 -0
  1384. package/skills/productivity/ocr-and-documents/scripts/extract_marker.py +87 -0
  1385. package/skills/productivity/ocr-and-documents/scripts/extract_pymupdf.py +98 -0
  1386. package/skills/productivity/powerpoint/LICENSE.txt +30 -0
  1387. package/skills/productivity/powerpoint/SKILL.md +237 -0
  1388. package/skills/productivity/powerpoint/editing.md +205 -0
  1389. package/skills/productivity/powerpoint/pptxgenjs.md +420 -0
  1390. package/skills/productivity/powerpoint/scripts/__init__.py +0 -0
  1391. package/skills/productivity/powerpoint/scripts/add_slide.py +195 -0
  1392. package/skills/productivity/powerpoint/scripts/clean.py +286 -0
  1393. package/skills/productivity/powerpoint/scripts/office/helpers/__init__.py +0 -0
  1394. package/skills/productivity/powerpoint/scripts/office/helpers/merge_runs.py +199 -0
  1395. package/skills/productivity/powerpoint/scripts/office/helpers/simplify_redlines.py +197 -0
  1396. package/skills/productivity/powerpoint/scripts/office/pack.py +159 -0
  1397. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  1398. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  1399. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  1400. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  1401. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  1402. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  1403. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  1404. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  1405. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  1406. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  1407. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  1408. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  1409. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  1410. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  1411. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  1412. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  1413. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  1414. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  1415. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  1416. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  1417. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  1418. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  1419. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  1420. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  1421. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  1422. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  1423. package/skills/productivity/powerpoint/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  1424. package/skills/productivity/powerpoint/scripts/office/schemas/ecma/fourth-edition/opc-contentTypes.xsd +42 -0
  1425. package/skills/productivity/powerpoint/scripts/office/schemas/ecma/fourth-edition/opc-coreProperties.xsd +50 -0
  1426. package/skills/productivity/powerpoint/scripts/office/schemas/ecma/fourth-edition/opc-digSig.xsd +49 -0
  1427. package/skills/productivity/powerpoint/scripts/office/schemas/ecma/fourth-edition/opc-relationships.xsd +33 -0
  1428. package/skills/productivity/powerpoint/scripts/office/schemas/mce/mc.xsd +75 -0
  1429. package/skills/productivity/powerpoint/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  1430. package/skills/productivity/powerpoint/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  1431. package/skills/productivity/powerpoint/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  1432. package/skills/productivity/powerpoint/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  1433. package/skills/productivity/powerpoint/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  1434. package/skills/productivity/powerpoint/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  1435. package/skills/productivity/powerpoint/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  1436. package/skills/productivity/teams-meeting-pipeline/SKILL.md +116 -0
  1437. package/skills/red-teaming/godmode/SKILL.md +404 -0
  1438. package/skills/red-teaming/godmode/references/jailbreak-templates.md +128 -0
  1439. package/skills/red-teaming/godmode/references/refusal-detection.md +142 -0
  1440. package/skills/red-teaming/godmode/scripts/auto_jailbreak.py +769 -0
  1441. package/skills/red-teaming/godmode/scripts/godmode_race.py +530 -0
  1442. package/skills/red-teaming/godmode/scripts/load_godmode.py +45 -0
  1443. package/skills/red-teaming/godmode/scripts/parseltongue.py +550 -0
  1444. package/skills/red-teaming/godmode/templates/prefill-subtle.json +10 -0
  1445. package/skills/red-teaming/godmode/templates/prefill.json +18 -0
  1446. package/skills/research/DESCRIPTION.md +3 -0
  1447. package/skills/research/arxiv/SKILL.md +282 -0
  1448. package/skills/research/arxiv/scripts/search_arxiv.py +114 -0
  1449. package/skills/research/blogwatcher/SKILL.md +137 -0
  1450. package/skills/research/llm-wiki/SKILL.md +507 -0
  1451. package/skills/research/polymarket/SKILL.md +77 -0
  1452. package/skills/research/polymarket/references/api-endpoints.md +220 -0
  1453. package/skills/research/polymarket/scripts/polymarket.py +284 -0
  1454. package/skills/research/research-paper-writing/SKILL.md +2377 -0
  1455. package/skills/research/research-paper-writing/references/autoreason-methodology.md +394 -0
  1456. package/skills/research/research-paper-writing/references/checklists.md +434 -0
  1457. package/skills/research/research-paper-writing/references/citation-workflow.md +564 -0
  1458. package/skills/research/research-paper-writing/references/experiment-patterns.md +728 -0
  1459. package/skills/research/research-paper-writing/references/human-evaluation.md +476 -0
  1460. package/skills/research/research-paper-writing/references/paper-types.md +481 -0
  1461. package/skills/research/research-paper-writing/references/reviewer-guidelines.md +433 -0
  1462. package/skills/research/research-paper-writing/references/sources.md +191 -0
  1463. package/skills/research/research-paper-writing/references/writing-guide.md +474 -0
  1464. package/skills/research/research-paper-writing/templates/README.md +251 -0
  1465. package/skills/research/research-paper-writing/templates/aaai2026/README.md +534 -0
  1466. package/skills/research/research-paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
  1467. package/skills/research/research-paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
  1468. package/skills/research/research-paper-writing/templates/aaai2026/aaai2026.bib +111 -0
  1469. package/skills/research/research-paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
  1470. package/skills/research/research-paper-writing/templates/aaai2026/aaai2026.sty +315 -0
  1471. package/skills/research/research-paper-writing/templates/acl/README.md +50 -0
  1472. package/skills/research/research-paper-writing/templates/acl/acl.sty +312 -0
  1473. package/skills/research/research-paper-writing/templates/acl/acl_latex.tex +377 -0
  1474. package/skills/research/research-paper-writing/templates/acl/acl_lualatex.tex +101 -0
  1475. package/skills/research/research-paper-writing/templates/acl/acl_natbib.bst +1940 -0
  1476. package/skills/research/research-paper-writing/templates/acl/anthology.bib.txt +26 -0
  1477. package/skills/research/research-paper-writing/templates/acl/custom.bib +70 -0
  1478. package/skills/research/research-paper-writing/templates/acl/formatting.md +326 -0
  1479. package/skills/research/research-paper-writing/templates/colm2025/README.md +3 -0
  1480. package/skills/research/research-paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
  1481. package/skills/research/research-paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
  1482. package/skills/research/research-paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
  1483. package/skills/research/research-paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
  1484. package/skills/research/research-paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
  1485. package/skills/research/research-paper-writing/templates/colm2025/fancyhdr.sty +485 -0
  1486. package/skills/research/research-paper-writing/templates/colm2025/math_commands.tex +508 -0
  1487. package/skills/research/research-paper-writing/templates/colm2025/natbib.sty +1246 -0
  1488. package/skills/research/research-paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
  1489. package/skills/research/research-paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
  1490. package/skills/research/research-paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
  1491. package/skills/research/research-paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
  1492. package/skills/research/research-paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
  1493. package/skills/research/research-paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
  1494. package/skills/research/research-paper-writing/templates/iclr2026/math_commands.tex +508 -0
  1495. package/skills/research/research-paper-writing/templates/iclr2026/natbib.sty +1246 -0
  1496. package/skills/research/research-paper-writing/templates/icml2026/algorithm.sty +79 -0
  1497. package/skills/research/research-paper-writing/templates/icml2026/algorithmic.sty +201 -0
  1498. package/skills/research/research-paper-writing/templates/icml2026/example_paper.bib +75 -0
  1499. package/skills/research/research-paper-writing/templates/icml2026/example_paper.pdf +0 -0
  1500. package/skills/research/research-paper-writing/templates/icml2026/example_paper.tex +662 -0
  1501. package/skills/research/research-paper-writing/templates/icml2026/fancyhdr.sty +864 -0
  1502. package/skills/research/research-paper-writing/templates/icml2026/icml2026.bst +1443 -0
  1503. package/skills/research/research-paper-writing/templates/icml2026/icml2026.sty +767 -0
  1504. package/skills/research/research-paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
  1505. package/skills/research/research-paper-writing/templates/neurips2025/Makefile +36 -0
  1506. package/skills/research/research-paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
  1507. package/skills/research/research-paper-writing/templates/neurips2025/main.tex +38 -0
  1508. package/skills/research/research-paper-writing/templates/neurips2025/neurips.sty +382 -0
  1509. package/skills/smart-home/DESCRIPTION.md +3 -0
  1510. package/skills/smart-home/openhue/SKILL.md +109 -0
  1511. package/skills/social-media/DESCRIPTION.md +3 -0
  1512. package/skills/social-media/xurl/SKILL.md +414 -0
  1513. package/skills/software-development/debugging-hermes-tui-commands/SKILL.md +152 -0
  1514. package/skills/software-development/hermes-agent-skill-authoring/SKILL.md +165 -0
  1515. package/skills/software-development/node-inspect-debugger/SKILL.md +319 -0
  1516. package/skills/software-development/plan/SKILL.md +58 -0
  1517. package/skills/software-development/python-debugpy/SKILL.md +375 -0
  1518. package/skills/software-development/requesting-code-review/SKILL.md +280 -0
  1519. package/skills/software-development/spike/SKILL.md +197 -0
  1520. package/skills/software-development/subagent-driven-development/SKILL.md +352 -0
  1521. package/skills/software-development/subagent-driven-development/references/context-budget-discipline.md +53 -0
  1522. package/skills/software-development/subagent-driven-development/references/gates-taxonomy.md +93 -0
  1523. package/skills/software-development/systematic-debugging/SKILL.md +367 -0
  1524. package/skills/software-development/test-driven-development/SKILL.md +343 -0
  1525. package/skills/software-development/writing-plans/SKILL.md +297 -0
  1526. package/skills/yuanbao/SKILL.md +108 -0
  1527. package/tools/__init__.py +25 -0
  1528. package/tools/__pycache__/__init__.cpython-312.pyc +0 -0
  1529. package/tools/__pycache__/approval.cpython-312.pyc +0 -0
  1530. package/tools/__pycache__/binary_extensions.cpython-312.pyc +0 -0
  1531. package/tools/__pycache__/browser_camofox.cpython-312.pyc +0 -0
  1532. package/tools/__pycache__/browser_camofox_state.cpython-312.pyc +0 -0
  1533. package/tools/__pycache__/browser_cdp_tool.cpython-312.pyc +0 -0
  1534. package/tools/__pycache__/browser_dialog_tool.cpython-312.pyc +0 -0
  1535. package/tools/__pycache__/browser_supervisor.cpython-312.pyc +0 -0
  1536. package/tools/__pycache__/browser_tool.cpython-312.pyc +0 -0
  1537. package/tools/__pycache__/budget_config.cpython-312.pyc +0 -0
  1538. package/tools/__pycache__/checkpoint_manager.cpython-312.pyc +0 -0
  1539. package/tools/__pycache__/clarify_gateway.cpython-312.pyc +0 -0
  1540. package/tools/__pycache__/clarify_tool.cpython-312.pyc +0 -0
  1541. package/tools/__pycache__/code_execution_tool.cpython-312.pyc +0 -0
  1542. package/tools/__pycache__/computer_use_tool.cpython-312.pyc +0 -0
  1543. package/tools/__pycache__/cronjob_tools.cpython-312.pyc +0 -0
  1544. package/tools/__pycache__/debug_helpers.cpython-312.pyc +0 -0
  1545. package/tools/__pycache__/delegate_tool.cpython-312.pyc +0 -0
  1546. package/tools/__pycache__/discord_tool.cpython-312.pyc +0 -0
  1547. package/tools/__pycache__/feishu_doc_tool.cpython-312.pyc +0 -0
  1548. package/tools/__pycache__/feishu_drive_tool.cpython-312.pyc +0 -0
  1549. package/tools/__pycache__/file_operations.cpython-312.pyc +0 -0
  1550. package/tools/__pycache__/file_state.cpython-312.pyc +0 -0
  1551. package/tools/__pycache__/file_tools.cpython-312.pyc +0 -0
  1552. package/tools/__pycache__/homeassistant_tool.cpython-312.pyc +0 -0
  1553. package/tools/__pycache__/image_generation_tool.cpython-312.pyc +0 -0
  1554. package/tools/__pycache__/interrupt.cpython-312.pyc +0 -0
  1555. package/tools/__pycache__/kanban_tools.cpython-312.pyc +0 -0
  1556. package/tools/__pycache__/lazy_deps.cpython-312.pyc +0 -0
  1557. package/tools/__pycache__/managed_tool_gateway.cpython-312.pyc +0 -0
  1558. package/tools/__pycache__/mcp_tool.cpython-312.pyc +0 -0
  1559. package/tools/__pycache__/memory_tool.cpython-312.pyc +0 -0
  1560. package/tools/__pycache__/mixture_of_agents_tool.cpython-312.pyc +0 -0
  1561. package/tools/__pycache__/openrouter_client.cpython-312.pyc +0 -0
  1562. package/tools/__pycache__/process_registry.cpython-312.pyc +0 -0
  1563. package/tools/__pycache__/registry.cpython-312.pyc +0 -0
  1564. package/tools/__pycache__/schema_sanitizer.cpython-312.pyc +0 -0
  1565. package/tools/__pycache__/send_message_tool.cpython-312.pyc +0 -0
  1566. package/tools/__pycache__/session_search_tool.cpython-312.pyc +0 -0
  1567. package/tools/__pycache__/skill_manager_tool.cpython-312.pyc +0 -0
  1568. package/tools/__pycache__/skill_provenance.cpython-312.pyc +0 -0
  1569. package/tools/__pycache__/skill_usage.cpython-312.pyc +0 -0
  1570. package/tools/__pycache__/skills_guard.cpython-312.pyc +0 -0
  1571. package/tools/__pycache__/skills_sync.cpython-312.pyc +0 -0
  1572. package/tools/__pycache__/skills_tool.cpython-312.pyc +0 -0
  1573. package/tools/__pycache__/slash_confirm.cpython-312.pyc +0 -0
  1574. package/tools/__pycache__/terminal_tool.cpython-312.pyc +0 -0
  1575. package/tools/__pycache__/tirith_security.cpython-312.pyc +0 -0
  1576. package/tools/__pycache__/todo_tool.cpython-312.pyc +0 -0
  1577. package/tools/__pycache__/tool_backend_helpers.cpython-312.pyc +0 -0
  1578. package/tools/__pycache__/tool_result_storage.cpython-312.pyc +0 -0
  1579. package/tools/__pycache__/tts_tool.cpython-312.pyc +0 -0
  1580. package/tools/__pycache__/url_safety.cpython-312.pyc +0 -0
  1581. package/tools/__pycache__/video_generation_tool.cpython-312.pyc +0 -0
  1582. package/tools/__pycache__/vision_tools.cpython-312.pyc +0 -0
  1583. package/tools/__pycache__/voice_mode.cpython-312.pyc +0 -0
  1584. package/tools/__pycache__/web_tools.cpython-312.pyc +0 -0
  1585. package/tools/__pycache__/website_policy.cpython-312.pyc +0 -0
  1586. package/tools/__pycache__/x_search_tool.cpython-312.pyc +0 -0
  1587. package/tools/__pycache__/xai_http.cpython-312.pyc +0 -0
  1588. package/tools/__pycache__/yuanbao_tools.cpython-312.pyc +0 -0
  1589. package/tools/ansi_strip.py +44 -0
  1590. package/tools/approval.py +1392 -0
  1591. package/tools/binary_extensions.py +42 -0
  1592. package/tools/browser_camofox.py +700 -0
  1593. package/tools/browser_camofox_state.py +48 -0
  1594. package/tools/browser_cdp_tool.py +569 -0
  1595. package/tools/browser_dialog_tool.py +148 -0
  1596. package/tools/browser_providers/__init__.py +10 -0
  1597. package/tools/browser_providers/__pycache__/__init__.cpython-312.pyc +0 -0
  1598. package/tools/browser_providers/__pycache__/base.cpython-312.pyc +0 -0
  1599. package/tools/browser_providers/__pycache__/browser_use.cpython-312.pyc +0 -0
  1600. package/tools/browser_providers/__pycache__/browserbase.cpython-312.pyc +0 -0
  1601. package/tools/browser_providers/__pycache__/firecrawl.cpython-312.pyc +0 -0
  1602. package/tools/browser_providers/base.py +59 -0
  1603. package/tools/browser_providers/browser_use.py +225 -0
  1604. package/tools/browser_providers/browserbase.py +222 -0
  1605. package/tools/browser_providers/firecrawl.py +112 -0
  1606. package/tools/browser_supervisor.py +1457 -0
  1607. package/tools/browser_tool.py +3676 -0
  1608. package/tools/budget_config.py +51 -0
  1609. package/tools/checkpoint_manager.py +1639 -0
  1610. package/tools/clarify_gateway.py +278 -0
  1611. package/tools/clarify_tool.py +141 -0
  1612. package/tools/code_execution_tool.py +1782 -0
  1613. package/tools/computer_use/__init__.py +43 -0
  1614. package/tools/computer_use/__pycache__/__init__.cpython-312.pyc +0 -0
  1615. package/tools/computer_use/__pycache__/backend.cpython-312.pyc +0 -0
  1616. package/tools/computer_use/__pycache__/schema.cpython-312.pyc +0 -0
  1617. package/tools/computer_use/__pycache__/tool.cpython-312.pyc +0 -0
  1618. package/tools/computer_use/backend.py +150 -0
  1619. package/tools/computer_use/cua_backend.py +682 -0
  1620. package/tools/computer_use/schema.py +191 -0
  1621. package/tools/computer_use/tool.py +521 -0
  1622. package/tools/computer_use_tool.py +39 -0
  1623. package/tools/credential_files.py +437 -0
  1624. package/tools/cronjob_tools.py +719 -0
  1625. package/tools/debug_helpers.py +106 -0
  1626. package/tools/delegate_tool.py +2797 -0
  1627. package/tools/discord_tool.py +959 -0
  1628. package/tools/env_passthrough.py +145 -0
  1629. package/tools/environments/__init__.py +14 -0
  1630. package/tools/environments/__pycache__/__init__.cpython-312.pyc +0 -0
  1631. package/tools/environments/__pycache__/base.cpython-312.pyc +0 -0
  1632. package/tools/environments/__pycache__/docker.cpython-312.pyc +0 -0
  1633. package/tools/environments/__pycache__/file_sync.cpython-312.pyc +0 -0
  1634. package/tools/environments/__pycache__/local.cpython-312.pyc +0 -0
  1635. package/tools/environments/__pycache__/managed_modal.cpython-312.pyc +0 -0
  1636. package/tools/environments/__pycache__/modal.cpython-312.pyc +0 -0
  1637. package/tools/environments/__pycache__/modal_utils.cpython-312.pyc +0 -0
  1638. package/tools/environments/__pycache__/singularity.cpython-312.pyc +0 -0
  1639. package/tools/environments/__pycache__/ssh.cpython-312.pyc +0 -0
  1640. package/tools/environments/base.py +844 -0
  1641. package/tools/environments/daytona.py +270 -0
  1642. package/tools/environments/docker.py +656 -0
  1643. package/tools/environments/file_sync.py +400 -0
  1644. package/tools/environments/local.py +658 -0
  1645. package/tools/environments/managed_modal.py +282 -0
  1646. package/tools/environments/modal.py +479 -0
  1647. package/tools/environments/modal_utils.py +199 -0
  1648. package/tools/environments/singularity.py +263 -0
  1649. package/tools/environments/ssh.py +295 -0
  1650. package/tools/environments/vercel_sandbox.py +655 -0
  1651. package/tools/feishu_doc_tool.py +138 -0
  1652. package/tools/feishu_drive_tool.py +431 -0
  1653. package/tools/file_operations.py +1825 -0
  1654. package/tools/file_state.py +332 -0
  1655. package/tools/file_tools.py +1172 -0
  1656. package/tools/fuzzy_match.py +703 -0
  1657. package/tools/homeassistant_tool.py +513 -0
  1658. package/tools/image_generation_tool.py +1098 -0
  1659. package/tools/interrupt.py +98 -0
  1660. package/tools/kanban_tools.py +1139 -0
  1661. package/tools/lazy_deps.py +608 -0
  1662. package/tools/managed_tool_gateway.py +168 -0
  1663. package/tools/mcp_oauth.py +633 -0
  1664. package/tools/mcp_oauth_manager.py +607 -0
  1665. package/tools/mcp_tool.py +3483 -0
  1666. package/tools/memory_tool.py +584 -0
  1667. package/tools/microsoft_graph_auth.py +245 -0
  1668. package/tools/microsoft_graph_client.py +408 -0
  1669. package/tools/mixture_of_agents_tool.py +542 -0
  1670. package/tools/neutts_samples/jo.txt +1 -0
  1671. package/tools/neutts_samples/jo.wav +0 -0
  1672. package/tools/neutts_synth.py +104 -0
  1673. package/tools/openrouter_client.py +33 -0
  1674. package/tools/osv_check.py +155 -0
  1675. package/tools/patch_parser.py +592 -0
  1676. package/tools/path_security.py +43 -0
  1677. package/tools/process_registry.py +1534 -0
  1678. package/tools/registry.py +589 -0
  1679. package/tools/schema_sanitizer.py +370 -0
  1680. package/tools/send_message_tool.py +1900 -0
  1681. package/tools/session_search_tool.py +613 -0
  1682. package/tools/skill_manager_tool.py +932 -0
  1683. package/tools/skill_provenance.py +78 -0
  1684. package/tools/skill_usage.py +610 -0
  1685. package/tools/skills_guard.py +932 -0
  1686. package/tools/skills_hub.py +3263 -0
  1687. package/tools/skills_sync.py +432 -0
  1688. package/tools/skills_tool.py +1569 -0
  1689. package/tools/slash_confirm.py +167 -0
  1690. package/tools/terminal_tool.py +2376 -0
  1691. package/tools/tirith_security.py +775 -0
  1692. package/tools/todo_tool.py +277 -0
  1693. package/tools/tool_backend_helpers.py +144 -0
  1694. package/tools/tool_output_limits.py +92 -0
  1695. package/tools/tool_result_storage.py +232 -0
  1696. package/tools/transcription_tools.py +936 -0
  1697. package/tools/tts_tool.py +2285 -0
  1698. package/tools/url_safety.py +330 -0
  1699. package/tools/video_generation_tool.py +561 -0
  1700. package/tools/vision_tools.py +1422 -0
  1701. package/tools/voice_mode.py +1019 -0
  1702. package/tools/web_tools.py +1551 -0
  1703. package/tools/website_policy.py +283 -0
  1704. package/tools/x_search_tool.py +424 -0
  1705. package/tools/xai_http.py +83 -0
  1706. package/tools/yuanbao_tools.py +736 -0
  1707. package/toolset_distributions.py +364 -0
  1708. package/toolsets.py +866 -0
  1709. package/trajectory_compressor.py +1509 -0
  1710. package/tui_gateway/__init__.py +0 -0
  1711. package/tui_gateway/entry.py +251 -0
  1712. package/tui_gateway/event_publisher.py +126 -0
  1713. package/tui_gateway/render.py +49 -0
  1714. package/tui_gateway/server.py +6623 -0
  1715. package/tui_gateway/slash_worker.py +76 -0
  1716. package/tui_gateway/transport.py +219 -0
  1717. package/tui_gateway/ws.py +178 -0
  1718. package/utils.py +361 -0
@@ -0,0 +1,3559 @@
1
+ """
2
+ Interactive setup wizard for Hermes Agent.
3
+
4
+ Modular wizard with independently-runnable sections:
5
+ 1. Model & Provider — choose your AI provider and model
6
+ 2. Terminal Backend — where your agent runs commands
7
+ 3. Agent Settings — iterations, compression, session reset
8
+ 4. Messaging Platforms — connect Telegram, Discord, etc.
9
+ 5. Tools — configure TTS, web search, image generation, etc.
10
+
11
+ Config files are stored in ~/.hermes/ for easy access.
12
+ """
13
+
14
+ import importlib.util
15
+ import json
16
+ import logging
17
+ import os
18
+ import re
19
+ import shutil
20
+ import sys
21
+ import copy
22
+ from pathlib import Path
23
+ from typing import Optional, Dict, Any
24
+
25
+ from hermes_cli.nous_subscription import get_nous_subscription_features
26
+ from tools.tool_backend_helpers import managed_nous_tools_enabled
27
+ from utils import base_url_hostname
28
+ from calvyn_constants import get_optional_skills_dir
29
+
30
+ logger = logging.getLogger(__name__)
31
+
32
+ PROJECT_ROOT = Path(__file__).parent.parent.resolve()
33
+
34
+ _DOCS_BASE = "https://hermes-agent.nousresearch.com/docs"
35
+
36
+
37
+ def _model_config_dict(config: Dict[str, Any]) -> Dict[str, Any]:
38
+ current_model = config.get("model")
39
+ if isinstance(current_model, dict):
40
+ return dict(current_model)
41
+ if isinstance(current_model, str) and current_model.strip():
42
+ return {"default": current_model.strip()}
43
+ return {}
44
+
45
+
46
+ def _get_credential_pool_strategies(config: Dict[str, Any]) -> Dict[str, str]:
47
+ strategies = config.get("credential_pool_strategies")
48
+ return dict(strategies) if isinstance(strategies, dict) else {}
49
+
50
+
51
+ def _set_credential_pool_strategy(config: Dict[str, Any], provider: str, strategy: str) -> None:
52
+ if not provider:
53
+ return
54
+ strategies = _get_credential_pool_strategies(config)
55
+ strategies[provider] = strategy
56
+ config["credential_pool_strategies"] = strategies
57
+
58
+
59
+ def _supports_same_provider_pool_setup(provider: str) -> bool:
60
+ if not provider or provider == "custom":
61
+ return False
62
+ if provider == "openrouter":
63
+ return True
64
+ from hermes_cli.auth import PROVIDER_REGISTRY
65
+
66
+ pconfig = PROVIDER_REGISTRY.get(provider)
67
+ if not pconfig:
68
+ return False
69
+ return pconfig.auth_type in {"api_key", "oauth_device_code"}
70
+
71
+
72
+ # Default model lists per provider — used as fallback when the live
73
+ # /models endpoint can't be reached.
74
+ _DEFAULT_PROVIDER_MODELS = {
75
+ "copilot-acp": [
76
+ "copilot-acp",
77
+ ],
78
+ "copilot": [
79
+ "gpt-5.4",
80
+ "gpt-5.4-mini",
81
+ "gpt-5-mini",
82
+ "gpt-5.3-codex",
83
+ "gpt-5.2-codex",
84
+ "gpt-4.1",
85
+ "gpt-4o",
86
+ "gpt-4o-mini",
87
+ "claude-opus-4.6",
88
+ "claude-sonnet-4.6",
89
+ "claude-sonnet-4.5",
90
+ "claude-haiku-4.5",
91
+ "gemini-2.5-pro",
92
+ ],
93
+ "gemini": [
94
+ "gemini-3.1-pro-preview", "gemini-3-pro-preview",
95
+ "gemini-3-flash-preview", "gemini-3.1-flash-lite-preview",
96
+ ],
97
+ "zai": ["glm-5.1", "glm-5", "glm-4.7", "glm-4.5", "glm-4.5-flash"],
98
+ "kimi-coding": ["kimi-k2.6", "kimi-k2.5", "kimi-k2-thinking", "kimi-k2-turbo-preview"],
99
+ "kimi-coding-cn": ["kimi-k2.6", "kimi-k2.5", "kimi-k2-thinking", "kimi-k2-turbo-preview"],
100
+ "stepfun": ["step-3.5-flash", "step-3.5-flash-2603"],
101
+ "arcee": ["trinity-large-thinking", "trinity-large-preview", "trinity-mini"],
102
+ "minimax": ["MiniMax-M2.7", "MiniMax-M2.5", "MiniMax-M2.1", "MiniMax-M2"],
103
+ "minimax-cn": ["MiniMax-M2.7", "MiniMax-M2.5", "MiniMax-M2.1", "MiniMax-M2"],
104
+ "ai-gateway": ["anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "openai/gpt-5", "google/gemini-3-flash"],
105
+ "kilocode": ["anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "openai/gpt-5.4", "google/gemini-3-pro-preview", "google/gemini-3-flash-preview"],
106
+ "opencode-zen": ["gpt-5.4", "gpt-5.3-codex", "claude-sonnet-4-6", "gemini-3-flash", "glm-5", "kimi-k2.5", "minimax-m2.7"],
107
+ "opencode-go": ["kimi-k2.6", "kimi-k2.5", "glm-5.1", "glm-5", "mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro", "mimo-v2-omni", "minimax-m2.7", "minimax-m2.5", "qwen3.6-plus", "qwen3.5-plus"],
108
+ "huggingface": [
109
+ "Qwen/Qwen3.5-397B-A17B", "Qwen/Qwen3-235B-A22B-Thinking-2507",
110
+ "Qwen/Qwen3-Coder-480B-A35B-Instruct", "deepseek-ai/DeepSeek-R1-0528",
111
+ "deepseek-ai/DeepSeek-V3.2", "moonshotai/Kimi-K2.5",
112
+ ],
113
+ }
114
+
115
+
116
+ def _current_reasoning_effort(config: Dict[str, Any]) -> str:
117
+ agent_cfg = config.get("agent")
118
+ if isinstance(agent_cfg, dict):
119
+ return str(agent_cfg.get("reasoning_effort") or "").strip().lower()
120
+ return ""
121
+
122
+
123
+ def _set_reasoning_effort(config: Dict[str, Any], effort: str) -> None:
124
+ agent_cfg = config.get("agent")
125
+ if not isinstance(agent_cfg, dict):
126
+ agent_cfg = {}
127
+ config["agent"] = agent_cfg
128
+ agent_cfg["reasoning_effort"] = effort
129
+
130
+
131
+
132
+
133
+ # Import config helpers
134
+ from hermes_cli.config import (
135
+ cfg_get,
136
+ DEFAULT_CONFIG,
137
+ get_hermes_home,
138
+ get_config_path,
139
+ get_env_path,
140
+ load_config,
141
+ save_config,
142
+ save_env_value,
143
+ remove_env_value,
144
+ get_env_value,
145
+ ensure_hermes_home,
146
+ )
147
+ # display_hermes_home imported lazily at call sites (stale-module safety during hermes update)
148
+
149
+ from hermes_cli.colors import Colors, color
150
+
151
+
152
+ def print_header(title: str):
153
+ """Print a section header."""
154
+ print()
155
+ print(color(f"◆ {title}", Colors.CYAN, Colors.BOLD))
156
+
157
+
158
+ from hermes_cli.cli_output import ( # noqa: E402
159
+ print_error,
160
+ print_info,
161
+ print_success,
162
+ print_warning,
163
+ )
164
+
165
+
166
+ def is_interactive_stdin() -> bool:
167
+ """Return True when stdin looks like a usable interactive TTY."""
168
+ stdin = getattr(sys, "stdin", None)
169
+ if stdin is None:
170
+ return False
171
+ try:
172
+ return bool(stdin.isatty())
173
+ except Exception:
174
+ return False
175
+
176
+
177
+ def print_noninteractive_setup_guidance(reason: str | None = None) -> None:
178
+ """Print guidance for headless/non-interactive setup flows."""
179
+ print()
180
+ print(color("✦ Calvyn Code Setup — Non-interactive mode", Colors.CYAN, Colors.BOLD))
181
+ print()
182
+ if reason:
183
+ print_info(reason)
184
+ print_info("The interactive wizard cannot be used here.")
185
+ print()
186
+ print_info("Configure Hermes using environment variables or config commands:")
187
+ print_info(" hermes config set model.provider custom")
188
+ print_info(" hermes config set model.base_url http://localhost:8080/v1")
189
+ print_info(" hermes config set model.default your-model-name")
190
+ print()
191
+ print_info("Or set OPENROUTER_API_KEY / OPENAI_API_KEY in your environment.")
192
+ print_info("Run 'hermes setup' in an interactive terminal to use the full wizard.")
193
+ print()
194
+
195
+
196
+ def prompt(question: str, default: str = None, password: bool = False) -> str:
197
+ """Prompt for input with optional default."""
198
+ if default:
199
+ display = f"{question} [{default}]: "
200
+ else:
201
+ display = f"{question}: "
202
+
203
+ try:
204
+ if password:
205
+ import getpass
206
+
207
+ value = getpass.getpass(color(display, Colors.YELLOW))
208
+ else:
209
+ value = input(color(display, Colors.YELLOW))
210
+
211
+ cleaned = _sanitize_pasted_input(value)
212
+ return cleaned.strip() or default or ""
213
+ except (KeyboardInterrupt, EOFError):
214
+ print()
215
+ sys.exit(1)
216
+
217
+
218
+ _BRACKETED_PASTE_PATTERN = re.compile(r"\x1b\[\s*200~|\x1b\[\s*201~")
219
+
220
+
221
+ def _sanitize_pasted_input(value: str) -> str:
222
+ """Strip terminal bracketed-paste control markers from pasted text."""
223
+ if not isinstance(value, str) or not value:
224
+ return value
225
+ return _BRACKETED_PASTE_PATTERN.sub("", value)
226
+
227
+
228
+ def _curses_prompt_choice(question: str, choices: list, default: int = 0, description: str | None = None) -> int:
229
+ """Single-select menu using curses. Delegates to curses_radiolist."""
230
+ from hermes_cli.curses_ui import curses_radiolist
231
+ return curses_radiolist(question, choices, selected=default, cancel_returns=-1, description=description)
232
+
233
+
234
+
235
+ def prompt_choice(question: str, choices: list, default: int = 0, description: str | None = None) -> int:
236
+ """Prompt for a choice from a list with arrow key navigation.
237
+
238
+ Escape keeps the current default (skips the question).
239
+ Ctrl+C exits the wizard.
240
+ """
241
+ idx = _curses_prompt_choice(question, choices, default, description=description)
242
+ if idx >= 0:
243
+ if idx == default:
244
+ print_info(" Skipped (keeping current)")
245
+ print()
246
+ return default
247
+ print()
248
+ return idx
249
+
250
+ print(color(question, Colors.YELLOW))
251
+ for i, choice in enumerate(choices):
252
+ marker = "●" if i == default else "○"
253
+ if i == default:
254
+ print(color(f" {marker} {choice}", Colors.GREEN))
255
+ else:
256
+ print(f" {marker} {choice}")
257
+
258
+ print_info(f" Enter for default ({default + 1}) Ctrl+C to exit")
259
+
260
+ while True:
261
+ try:
262
+ value = input(
263
+ color(f" Select [1-{len(choices)}] ({default + 1}): ", Colors.DIM)
264
+ )
265
+ if not value:
266
+ return default
267
+ idx = int(value) - 1
268
+ if 0 <= idx < len(choices):
269
+ return idx
270
+ print_error(f"Please enter a number between 1 and {len(choices)}")
271
+ except ValueError:
272
+ print_error("Please enter a number")
273
+ except (KeyboardInterrupt, EOFError):
274
+ print()
275
+ sys.exit(1)
276
+
277
+
278
+ def prompt_yes_no(question: str, default: bool = True) -> bool:
279
+ """Prompt for yes/no. Ctrl+C exits, empty input returns default."""
280
+ default_str = "Y/n" if default else "y/N"
281
+
282
+ while True:
283
+ try:
284
+ value = (
285
+ input(color(f"{question} [{default_str}]: ", Colors.YELLOW))
286
+ .strip()
287
+ .lower()
288
+ )
289
+ except (KeyboardInterrupt, EOFError):
290
+ print()
291
+ sys.exit(1)
292
+
293
+ if not value:
294
+ return default
295
+ if value in {"y", "yes"}:
296
+ return True
297
+ if value in {"n", "no"}:
298
+ return False
299
+ print_error("Please enter 'y' or 'n'")
300
+
301
+
302
+ def prompt_checklist(title: str, items: list, pre_selected: list = None) -> list:
303
+ """
304
+ Display a multi-select checklist and return the indices of selected items.
305
+
306
+ Each item in `items` is a display string. `pre_selected` is a list of
307
+ indices that should be checked by default. A "Continue →" option is
308
+ appended at the end — the user toggles items with Space and confirms
309
+ with Enter on "Continue →".
310
+
311
+ Falls back to a numbered toggle interface when simple_term_menu is
312
+ unavailable.
313
+
314
+ Returns:
315
+ List of selected indices (not including the Continue option).
316
+ """
317
+ if pre_selected is None:
318
+ pre_selected = []
319
+
320
+ from hermes_cli.curses_ui import curses_checklist
321
+
322
+ chosen = curses_checklist(
323
+ title,
324
+ items,
325
+ set(pre_selected),
326
+ cancel_returns=set(pre_selected),
327
+ )
328
+ return sorted(chosen)
329
+
330
+
331
+ def _prompt_api_key(var: dict):
332
+ """Display a nicely formatted API key input screen for a single env var."""
333
+ tools = var.get("tools", [])
334
+ tools_str = ", ".join(tools[:3])
335
+ if len(tools) > 3:
336
+ tools_str += f", +{len(tools) - 3} more"
337
+
338
+ print()
339
+ print(color(f" ─── {var.get('description', var['name'])} ───", Colors.CYAN))
340
+ print()
341
+ if tools_str:
342
+ print_info(f" Enables: {tools_str}")
343
+ if var.get("url"):
344
+ print_info(f" Get your key at: {var['url']}")
345
+ print()
346
+
347
+ if var.get("password"):
348
+ value = prompt(f" {var.get('prompt', var['name'])}", password=True)
349
+ else:
350
+ value = prompt(f" {var.get('prompt', var['name'])}")
351
+
352
+ if value:
353
+ save_env_value(var["name"], value)
354
+ print_success(" ✓ Saved")
355
+ else:
356
+ print_warning(" Skipped (configure later with 'hermes setup')")
357
+
358
+
359
+ def _print_setup_summary(config: dict, hermes_home):
360
+ """Print the setup completion summary."""
361
+ # Tool availability summary
362
+ print()
363
+ print_header("Tool Availability Summary")
364
+
365
+ tool_status = []
366
+ subscription_features = get_nous_subscription_features(config)
367
+
368
+ # Vision — use the same runtime resolver as the actual vision tools
369
+ try:
370
+ from agent.auxiliary_client import get_available_vision_backends
371
+
372
+ _vision_backends = get_available_vision_backends()
373
+ except Exception:
374
+ _vision_backends = []
375
+
376
+ if _vision_backends:
377
+ tool_status.append(("Vision (image analysis)", True, None))
378
+ else:
379
+ tool_status.append(("Vision (image analysis)", False, "run 'hermes setup' to configure"))
380
+
381
+ # Mixture of Agents — requires OpenRouter specifically (calls multiple models)
382
+ if get_env_value("OPENROUTER_API_KEY"):
383
+ tool_status.append(("Mixture of Agents", True, None))
384
+ else:
385
+ tool_status.append(("Mixture of Agents", False, "OPENROUTER_API_KEY"))
386
+
387
+ # Web tools (Exa, Parallel, Firecrawl, or Tavily)
388
+ if subscription_features.web.managed_by_nous:
389
+ tool_status.append(("Web Search & Extract (Nous subscription)", True, None))
390
+ elif subscription_features.web.available:
391
+ label = "Web Search & Extract"
392
+ if subscription_features.web.current_provider:
393
+ label = f"Web Search & Extract ({subscription_features.web.current_provider})"
394
+ tool_status.append((label, True, None))
395
+ else:
396
+ tool_status.append(("Web Search & Extract", False, "EXA_API_KEY, PARALLEL_API_KEY, FIRECRAWL_API_KEY/FIRECRAWL_API_URL, TAVILY_API_KEY, or SEARXNG_URL"))
397
+
398
+ # Browser tools (local Chromium, Camofox, Browserbase, Browser Use, or Firecrawl)
399
+ browser_provider = subscription_features.browser.current_provider
400
+ if subscription_features.browser.managed_by_nous:
401
+ tool_status.append(("Browser Automation (Nous Browser Use)", True, None))
402
+ elif subscription_features.browser.available:
403
+ label = "Browser Automation"
404
+ if browser_provider:
405
+ label = f"Browser Automation ({browser_provider})"
406
+ tool_status.append((label, True, None))
407
+ else:
408
+ missing_browser_hint = "npm install -g agent-browser, set CAMOFOX_URL, or configure Browser Use or Browserbase"
409
+ if browser_provider == "Browserbase":
410
+ missing_browser_hint = (
411
+ "npm install -g agent-browser and set "
412
+ "BROWSERBASE_API_KEY/BROWSERBASE_PROJECT_ID"
413
+ )
414
+ elif browser_provider == "Browser Use":
415
+ missing_browser_hint = (
416
+ "npm install -g agent-browser and set BROWSER_USE_API_KEY"
417
+ )
418
+ elif browser_provider == "Camofox":
419
+ missing_browser_hint = "CAMOFOX_URL"
420
+ elif browser_provider == "Local browser":
421
+ missing_browser_hint = "npm install -g agent-browser"
422
+ tool_status.append(
423
+ ("Browser Automation", False, missing_browser_hint)
424
+ )
425
+
426
+ # Image generation — FAL (direct or via Nous), or any plugin-registered
427
+ # provider (OpenAI, etc.)
428
+ if subscription_features.image_gen.managed_by_nous:
429
+ tool_status.append(("Image Generation (Nous subscription)", True, None))
430
+ elif subscription_features.image_gen.available:
431
+ tool_status.append(("Image Generation", True, None))
432
+ else:
433
+ # Fall back to probing plugin-registered providers so OpenAI-only
434
+ # setups don't show as "missing FAL_KEY".
435
+ _img_backend = None
436
+ try:
437
+ from agent.image_gen_registry import list_providers
438
+ from hermes_cli.plugins import _ensure_plugins_discovered
439
+
440
+ _ensure_plugins_discovered()
441
+ for _p in list_providers():
442
+ if _p.name == "fal":
443
+ continue
444
+ try:
445
+ if _p.is_available():
446
+ _img_backend = _p.display_name
447
+ break
448
+ except Exception:
449
+ continue
450
+ except Exception:
451
+ pass
452
+ if _img_backend:
453
+ tool_status.append((f"Image Generation ({_img_backend})", True, None))
454
+ else:
455
+ tool_status.append(("Image Generation", False, "FAL_KEY or OPENAI_API_KEY"))
456
+
457
+ # Video generation — opt-in via `hermes tools` → Video Generation.
458
+ # Only show the row when a plugin reports available so we don't badger
459
+ # users who don't care about video gen with a "missing" status line.
460
+ try:
461
+ from agent.video_gen_registry import list_providers as _list_video_providers
462
+ from hermes_cli.plugins import _ensure_plugins_discovered as _ensure_plugins
463
+ _ensure_plugins()
464
+ _video_backend = None
465
+ for _vp in _list_video_providers():
466
+ try:
467
+ if _vp.is_available():
468
+ _video_backend = _vp.display_name
469
+ break
470
+ except Exception:
471
+ continue
472
+ except Exception:
473
+ _video_backend = None
474
+ if _video_backend:
475
+ tool_status.append((f"Video Generation ({_video_backend})", True, None))
476
+
477
+ # TTS — show configured provider
478
+ tts_provider = cfg_get(config, "tts", "provider", default="edge")
479
+ if subscription_features.tts.managed_by_nous:
480
+ tool_status.append(("Text-to-Speech (OpenAI via Nous subscription)", True, None))
481
+ elif tts_provider == "elevenlabs" and get_env_value("ELEVENLABS_API_KEY"):
482
+ tool_status.append(("Text-to-Speech (ElevenLabs)", True, None))
483
+ elif tts_provider == "openai" and (
484
+ get_env_value("VOICE_TOOLS_OPENAI_KEY") or get_env_value("OPENAI_API_KEY")
485
+ ):
486
+ tool_status.append(("Text-to-Speech (OpenAI)", True, None))
487
+ elif tts_provider == "minimax" and get_env_value("MINIMAX_API_KEY"):
488
+ tool_status.append(("Text-to-Speech (MiniMax)", True, None))
489
+ elif tts_provider == "mistral" and get_env_value("MISTRAL_API_KEY"):
490
+ tool_status.append(("Text-to-Speech (Mistral Voxtral)", True, None))
491
+ elif tts_provider == "gemini" and (get_env_value("GEMINI_API_KEY") or get_env_value("GOOGLE_API_KEY")):
492
+ tool_status.append(("Text-to-Speech (Google Gemini)", True, None))
493
+ elif tts_provider == "neutts":
494
+ try:
495
+ neutts_ok = importlib.util.find_spec("neutts") is not None
496
+ except Exception:
497
+ neutts_ok = False
498
+ if neutts_ok:
499
+ tool_status.append(("Text-to-Speech (NeuTTS local)", True, None))
500
+ else:
501
+ tool_status.append(("Text-to-Speech (NeuTTS — not installed)", False, "run 'hermes setup tts'"))
502
+ elif tts_provider == "kittentts":
503
+ try:
504
+ import importlib.util
505
+ kittentts_ok = importlib.util.find_spec("kittentts") is not None
506
+ except Exception:
507
+ kittentts_ok = False
508
+ if kittentts_ok:
509
+ tool_status.append(("Text-to-Speech (KittenTTS local)", True, None))
510
+ else:
511
+ tool_status.append(("Text-to-Speech (KittenTTS — not installed)", False, "run 'hermes setup tts'"))
512
+ else:
513
+ tool_status.append(("Text-to-Speech (Edge TTS)", True, None))
514
+
515
+ if subscription_features.modal.managed_by_nous:
516
+ tool_status.append(("Modal Execution (Nous subscription)", True, None))
517
+ elif cfg_get(config, "terminal", "backend") == "modal":
518
+ if subscription_features.modal.direct_override:
519
+ tool_status.append(("Modal Execution (direct Modal)", True, None))
520
+ else:
521
+ tool_status.append(("Modal Execution", False, "run 'hermes setup terminal'"))
522
+ elif managed_nous_tools_enabled() and subscription_features.nous_auth_present:
523
+ tool_status.append(("Modal Execution (optional via Nous subscription)", True, None))
524
+
525
+ # Home Assistant
526
+ if get_env_value("HASS_TOKEN"):
527
+ tool_status.append(("Smart Home (Home Assistant)", True, None))
528
+
529
+ # Spotify (OAuth via hermes auth spotify — check auth.json, not env vars)
530
+ try:
531
+ from hermes_cli.auth import get_provider_auth_state
532
+ _spotify_state = get_provider_auth_state("spotify") or {}
533
+ if _spotify_state.get("access_token") or _spotify_state.get("refresh_token"):
534
+ tool_status.append(("Spotify (PKCE OAuth)", True, None))
535
+ except Exception:
536
+ pass
537
+
538
+ # Skills Hub
539
+ if get_env_value("GITHUB_TOKEN"):
540
+ tool_status.append(("Skills Hub (GitHub)", True, None))
541
+ else:
542
+ tool_status.append(("Skills Hub (GitHub)", False, "GITHUB_TOKEN"))
543
+
544
+ # Terminal (always available if system deps met)
545
+ tool_status.append(("Terminal/Commands", True, None))
546
+
547
+ # Task planning (always available, in-memory)
548
+ tool_status.append(("Task Planning (todo)", True, None))
549
+
550
+ # Skills (always available -- bundled skills + user-created skills)
551
+ tool_status.append(("Skills (view, create, edit)", True, None))
552
+
553
+ # Print status
554
+ available_count = sum(1 for _, avail, _ in tool_status if avail)
555
+ total_count = len(tool_status)
556
+
557
+ print_info(f"{available_count}/{total_count} tool categories available:")
558
+ print()
559
+
560
+ for name, available, missing_var in tool_status:
561
+ if available:
562
+ print(f" {color('✓', Colors.GREEN)} {name}")
563
+ else:
564
+ print(
565
+ f" {color('✗', Colors.RED)} {name} {color(f'(missing {missing_var})', Colors.DIM)}"
566
+ )
567
+
568
+ print()
569
+
570
+ disabled_tools = [(name, var) for name, avail, var in tool_status if not avail]
571
+ if disabled_tools:
572
+ print_warning(
573
+ "Some tools are disabled. Run 'hermes setup tools' to configure them,"
574
+ )
575
+ from calvyn_constants import display_hermes_home as _dhh
576
+ print_warning(f"or edit {_dhh()}/.env directly to add the missing API keys.")
577
+ print()
578
+
579
+ # Done banner
580
+ print()
581
+ print(
582
+ color(
583
+ "┌─────────────────────────────────────────────────────────┐", Colors.GREEN
584
+ )
585
+ )
586
+ print(
587
+ color(
588
+ "│ ✓ Setup Complete! │", Colors.GREEN
589
+ )
590
+ )
591
+ print(
592
+ color(
593
+ "└─────────────────────────────────────────────────────────┘", Colors.GREEN
594
+ )
595
+ )
596
+ print()
597
+
598
+ # Show file locations prominently
599
+ from calvyn_constants import display_hermes_home as _dhh
600
+ print(color(f"📁 All your files are in {_dhh()}/:", Colors.CYAN, Colors.BOLD))
601
+ print()
602
+ print(f" {color('Settings:', Colors.YELLOW)} {get_config_path()}")
603
+ print(f" {color('API Keys:', Colors.YELLOW)} {get_env_path()}")
604
+ print(
605
+ f" {color('Data:', Colors.YELLOW)} {hermes_home}/cron/, sessions/, logs/"
606
+ )
607
+ print()
608
+
609
+ print(color("─" * 60, Colors.DIM))
610
+ print()
611
+ print(color("📝 To edit your configuration:", Colors.CYAN, Colors.BOLD))
612
+ print()
613
+ print(f" {color('hermes setup', Colors.GREEN)} Re-run the full wizard")
614
+ print(f" {color('hermes setup model', Colors.GREEN)} Change model/provider")
615
+ print(f" {color('hermes setup terminal', Colors.GREEN)} Change terminal backend")
616
+ print(f" {color('hermes setup gateway', Colors.GREEN)} Configure messaging")
617
+ print(f" {color('hermes setup tools', Colors.GREEN)} Configure tool providers")
618
+ print()
619
+ print(f" {color('hermes config', Colors.GREEN)} View current settings")
620
+ print(
621
+ f" {color('hermes config edit', Colors.GREEN)} Open config in your editor"
622
+ )
623
+ print(f" {color('hermes config set <key> <value>', Colors.GREEN)}")
624
+ print(" Set a specific value")
625
+ print()
626
+ print(" Or edit the files directly:")
627
+ print(f" {color(f'nano {get_config_path()}', Colors.DIM)}")
628
+ print(f" {color(f'nano {get_env_path()}', Colors.DIM)}")
629
+ print()
630
+
631
+ print(color("─" * 60, Colors.DIM))
632
+ print()
633
+ print(color("🚀 Ready to go!", Colors.CYAN, Colors.BOLD))
634
+ print()
635
+ print(f" {color('hermes', Colors.GREEN)} Start chatting")
636
+ print(f" {color('hermes gateway', Colors.GREEN)} Start messaging gateway")
637
+ print(f" {color('hermes doctor', Colors.GREEN)} Check for issues")
638
+ print()
639
+
640
+
641
+ def _prompt_container_resources(config: dict):
642
+ """Prompt for container resource settings (Docker, Singularity, Modal, Daytona)."""
643
+ terminal = config.setdefault("terminal", {})
644
+
645
+ print()
646
+ print_info("Container Resource Settings:")
647
+
648
+ # Persistence
649
+ current_persist = terminal.get("container_persistent", True)
650
+ persist_label = "yes" if current_persist else "no"
651
+ print_info(" Persistent filesystem keeps files between sessions.")
652
+ print_info(" Set to 'no' for ephemeral sandboxes that reset each time.")
653
+ persist_str = prompt(
654
+ " Persist filesystem across sessions? (yes/no)", persist_label
655
+ )
656
+ terminal["container_persistent"] = persist_str.lower() in {"yes", "true", "y", "1"}
657
+
658
+ # CPU
659
+ current_cpu = terminal.get("container_cpu", 1)
660
+ cpu_str = prompt(" CPU cores", str(current_cpu))
661
+ try:
662
+ terminal["container_cpu"] = float(cpu_str)
663
+ except ValueError:
664
+ pass
665
+
666
+ # Memory
667
+ current_mem = terminal.get("container_memory", 5120)
668
+ mem_str = prompt(" Memory in MB (5120 = 5GB)", str(current_mem))
669
+ try:
670
+ terminal["container_memory"] = int(mem_str)
671
+ except ValueError:
672
+ pass
673
+
674
+ # Disk
675
+ current_disk = terminal.get("container_disk", 51200)
676
+ disk_str = prompt(" Disk in MB (51200 = 50GB)", str(current_disk))
677
+ try:
678
+ terminal["container_disk"] = int(disk_str)
679
+ except ValueError:
680
+ pass
681
+
682
+
683
+ def _prompt_vercel_sandbox_settings(config: dict):
684
+ """Prompt for Vercel Sandbox settings without exposing unsupported disk sizing."""
685
+ terminal = config.setdefault("terminal", {})
686
+
687
+ print()
688
+ print_info("Vercel Sandbox settings:")
689
+ print_info(" Filesystem persistence uses Vercel snapshots.")
690
+ print_info(" Snapshots restore files only; live processes do not continue after sandbox recreation.")
691
+
692
+ from tools.terminal_tool import _SUPPORTED_VERCEL_RUNTIMES
693
+
694
+ current_runtime = terminal.get("vercel_runtime") or "node24"
695
+ supported_label = ", ".join(_SUPPORTED_VERCEL_RUNTIMES)
696
+ runtime = prompt(f" Runtime ({supported_label})", current_runtime).strip() or current_runtime
697
+ if runtime not in _SUPPORTED_VERCEL_RUNTIMES:
698
+ print_warning(f"Unsupported Vercel runtime '{runtime}', keeping {current_runtime}.")
699
+ runtime = current_runtime if current_runtime in _SUPPORTED_VERCEL_RUNTIMES else "node24"
700
+ terminal["vercel_runtime"] = runtime
701
+ save_env_value("TERMINAL_VERCEL_RUNTIME", runtime)
702
+
703
+ current_persist = terminal.get("container_persistent", True)
704
+ persist_label = "yes" if current_persist else "no"
705
+ terminal["container_persistent"] = prompt(
706
+ " Persist filesystem with snapshots? (yes/no)", persist_label
707
+ ).lower() in {"yes", "true", "y", "1"}
708
+
709
+ current_cpu = terminal.get("container_cpu", 1)
710
+ cpu_str = prompt(" CPU cores", str(current_cpu))
711
+ try:
712
+ terminal["container_cpu"] = float(cpu_str)
713
+ except ValueError:
714
+ pass
715
+
716
+ current_mem = terminal.get("container_memory", 5120)
717
+ mem_str = prompt(" Memory in MB (5120 = 5GB)", str(current_mem))
718
+ try:
719
+ terminal["container_memory"] = int(mem_str)
720
+ except ValueError:
721
+ pass
722
+
723
+ if terminal.get("container_disk", 51200) not in {0, 51200}:
724
+ print_warning("Vercel Sandbox does not support custom disk sizing; resetting container_disk to 51200.")
725
+ terminal["container_disk"] = 51200
726
+
727
+ print()
728
+ print_info("Vercel authentication:")
729
+ print_info(" Use a long-lived Vercel access token plus project/team IDs.")
730
+ linked_project = _read_nearest_vercel_project()
731
+ if linked_project:
732
+ print_info(" Found defaults in nearest .vercel/project.json.")
733
+
734
+ remove_env_value("VERCEL_OIDC_TOKEN")
735
+ token = prompt(" Vercel access token", get_env_value("VERCEL_TOKEN") or "", password=True)
736
+ project = prompt(
737
+ " Vercel project ID",
738
+ get_env_value("VERCEL_PROJECT_ID") or linked_project.get("projectId", ""),
739
+ )
740
+ team = prompt(
741
+ " Vercel team ID",
742
+ get_env_value("VERCEL_TEAM_ID") or linked_project.get("orgId", ""),
743
+ )
744
+ if token:
745
+ save_env_value("VERCEL_TOKEN", token)
746
+ if project:
747
+ save_env_value("VERCEL_PROJECT_ID", project)
748
+ if team:
749
+ save_env_value("VERCEL_TEAM_ID", team)
750
+
751
+
752
+ def _read_nearest_vercel_project(start: Path | None = None) -> dict[str, str]:
753
+ """Read project/team defaults from the nearest Vercel link file."""
754
+ current = (start or Path.cwd()).resolve()
755
+ if current.is_file():
756
+ current = current.parent
757
+
758
+ for directory in (current, *current.parents):
759
+ project_file = directory / ".vercel" / "project.json"
760
+ if not project_file.exists():
761
+ continue
762
+ try:
763
+ data = json.loads(project_file.read_text(encoding="utf-8"))
764
+ except (OSError, json.JSONDecodeError):
765
+ return {}
766
+ if not isinstance(data, dict):
767
+ return {}
768
+ return {
769
+ key: value
770
+ for key, value in {
771
+ "projectId": data.get("projectId"),
772
+ "orgId": data.get("orgId"),
773
+ }.items()
774
+ if isinstance(value, str) and value.strip()
775
+ }
776
+ return {}
777
+
778
+
779
+ # Tool categories and provider config are now in tools_config.py (shared
780
+ # between `hermes tools` and `hermes setup tools`).
781
+
782
+
783
+ # =============================================================================
784
+ # Section 1: Model & Provider Configuration
785
+ # =============================================================================
786
+
787
+
788
+
789
+ def setup_model_provider(config: dict, *, quick: bool = False):
790
+ """Configure the inference provider and default model.
791
+
792
+ Delegates to ``cmd_model()`` (the same flow used by ``hermes model``)
793
+ for provider selection, credential prompting, and model picking.
794
+ This ensures a single code path for all provider setup — any new
795
+ provider added to ``hermes model`` is automatically available here.
796
+
797
+ When *quick* is True, skips credential rotation, vision, and TTS
798
+ configuration — used by the streamlined first-time quick setup.
799
+ """
800
+ from hermes_cli.config import load_config, save_config
801
+
802
+ print_header("Inference Provider")
803
+ print_info("Choose how to connect to your main chat model.")
804
+ print_info(f" Guide: {_DOCS_BASE}/integrations/providers")
805
+ print()
806
+
807
+ # Delegate to the shared hermes model flow — handles provider picker,
808
+ # credential prompting, model selection, and config persistence.
809
+ from hermes_cli.main import select_provider_and_model
810
+ try:
811
+ select_provider_and_model()
812
+ except (SystemExit, KeyboardInterrupt):
813
+ print()
814
+ print_info("Provider setup skipped.")
815
+ except Exception as exc:
816
+ logger.debug("select_provider_and_model error during setup: %s", exc)
817
+ print_warning(f"Provider setup encountered an error: {exc}")
818
+ print_info("You can try again later with: hermes model")
819
+
820
+ # Re-sync the wizard's config dict from what cmd_model saved to disk.
821
+ # This is critical: cmd_model writes to disk via its own load/save cycle,
822
+ # and the wizard's final save_config(config) must not overwrite those
823
+ # changes with stale values (#4172).
824
+ _refreshed = load_config()
825
+ config["model"] = _refreshed.get("model", config.get("model"))
826
+ if "custom_providers" in _refreshed:
827
+ config["custom_providers"] = _refreshed["custom_providers"]
828
+ else:
829
+ config.pop("custom_providers", None)
830
+
831
+ # Derive the selected provider for downstream steps (vision setup).
832
+ selected_provider = None
833
+ _m = config.get("model")
834
+ if isinstance(_m, dict):
835
+ selected_provider = _m.get("provider")
836
+
837
+ # ── Same-provider fallback & rotation setup (full setup only) ──
838
+ if not quick and _supports_same_provider_pool_setup(selected_provider):
839
+ try:
840
+ from types import SimpleNamespace
841
+ from agent.credential_pool import load_pool
842
+ from hermes_cli.auth_commands import auth_add_command
843
+
844
+ pool = load_pool(selected_provider)
845
+ entries = pool.entries()
846
+ entry_count = len(entries)
847
+ manual_count = sum(1 for entry in entries if str(getattr(entry, "source", "")).startswith("manual"))
848
+ auto_count = entry_count - manual_count
849
+ print()
850
+ print_header("Same-Provider Fallback & Rotation")
851
+ print_info(
852
+ "Hermes can keep multiple credentials for one provider and rotate between"
853
+ )
854
+ print_info(
855
+ "them when a credential is exhausted or rate-limited. This preserves"
856
+ )
857
+ print_info(
858
+ "your primary provider while reducing interruptions from quota issues."
859
+ )
860
+ print()
861
+ if auto_count > 0:
862
+ print_info(
863
+ f"Current pooled credentials for {selected_provider}: {entry_count} "
864
+ f"({manual_count} manual, {auto_count} auto-detected from env/shared auth)"
865
+ )
866
+ else:
867
+ print_info(f"Current pooled credentials for {selected_provider}: {entry_count}")
868
+
869
+ while prompt_yes_no("Add another credential for same-provider fallback?", False):
870
+ auth_add_command(
871
+ SimpleNamespace(
872
+ provider=selected_provider,
873
+ auth_type="",
874
+ label=None,
875
+ api_key=None,
876
+ portal_url=None,
877
+ inference_url=None,
878
+ client_id=None,
879
+ scope=None,
880
+ no_browser=False,
881
+ timeout=15.0,
882
+ insecure=False,
883
+ ca_bundle=None,
884
+ min_key_ttl_seconds=5 * 60,
885
+ )
886
+ )
887
+ pool = load_pool(selected_provider)
888
+ entry_count = len(pool.entries())
889
+ print_info(f"Provider pool now has {entry_count} credential(s).")
890
+
891
+ if entry_count > 1:
892
+ strategy_labels = [
893
+ "Fill-first / sticky — keep using the first healthy credential until it is exhausted",
894
+ "Round robin — rotate to the next healthy credential after each selection",
895
+ "Random — pick a random healthy credential each time",
896
+ ]
897
+ current_strategy = _get_credential_pool_strategies(config).get(selected_provider, "fill_first")
898
+ default_strategy_idx = {
899
+ "fill_first": 0,
900
+ "round_robin": 1,
901
+ "random": 2,
902
+ }.get(current_strategy, 0)
903
+ strategy_idx = prompt_choice(
904
+ "Select same-provider rotation strategy:",
905
+ strategy_labels,
906
+ default_strategy_idx,
907
+ )
908
+ strategy_value = ["fill_first", "round_robin", "random"][strategy_idx]
909
+ _set_credential_pool_strategy(config, selected_provider, strategy_value)
910
+ print_success(f"Saved {selected_provider} rotation strategy: {strategy_value}")
911
+ except Exception as exc:
912
+ logger.debug("Could not configure same-provider fallback in setup: %s", exc)
913
+
914
+ # ── Vision & Image Analysis Setup (full setup only) ──
915
+ if quick:
916
+ _vision_needs_setup = False
917
+ else:
918
+ try:
919
+ from agent.auxiliary_client import get_available_vision_backends
920
+ _vision_backends = set(get_available_vision_backends())
921
+ except Exception:
922
+ _vision_backends = set()
923
+
924
+ _vision_needs_setup = not bool(_vision_backends)
925
+
926
+ if selected_provider in _vision_backends:
927
+ _vision_needs_setup = False
928
+
929
+ if _vision_needs_setup:
930
+ _prov_names = {
931
+ "nous-api": "Nous Portal API key",
932
+ "copilot": "GitHub Copilot",
933
+ "copilot-acp": "GitHub Copilot ACP",
934
+ "zai": "Z.AI / GLM",
935
+ "kimi-coding": "Kimi / Moonshot",
936
+ "kimi-coding-cn": "Kimi / Moonshot (China)",
937
+ "stepfun": "StepFun Step Plan",
938
+ "minimax": "MiniMax",
939
+ "minimax-cn": "MiniMax CN",
940
+ "anthropic": "Anthropic",
941
+ "ai-gateway": "Vercel AI Gateway",
942
+ "custom": "your custom endpoint",
943
+ }
944
+ _prov_display = _prov_names.get(selected_provider, selected_provider or "your provider")
945
+
946
+ print()
947
+ print_header("Vision & Image Analysis (optional)")
948
+ print_info(f"Vision uses a separate multimodal backend. {_prov_display}")
949
+ print_info("doesn't currently provide one Hermes can auto-use for vision,")
950
+ print_info("so choose a backend now or skip and configure later.")
951
+ print()
952
+
953
+ _vision_choices = [
954
+ "OpenRouter — uses Gemini (free tier at openrouter.ai/keys)",
955
+ "OpenAI-compatible endpoint — base URL, API key, and vision model",
956
+ "Skip for now",
957
+ ]
958
+ _vision_idx = prompt_choice("Configure vision:", _vision_choices, 2)
959
+
960
+ if _vision_idx == 0: # OpenRouter
961
+ _or_key = prompt(" OpenRouter API key", password=True).strip()
962
+ if _or_key:
963
+ save_env_value("OPENROUTER_API_KEY", _or_key)
964
+ print_success("OpenRouter key saved — vision will use Gemini")
965
+ else:
966
+ print_info("Skipped — vision won't be available")
967
+ elif _vision_idx == 1: # OpenAI-compatible endpoint
968
+ _base_url = prompt(" Base URL (blank for OpenAI)").strip() or "https://api.openai.com/v1"
969
+ _api_key_label = " API key"
970
+ _is_native_openai = base_url_hostname(_base_url) == "api.openai.com"
971
+ if _is_native_openai:
972
+ _api_key_label = " OpenAI API key"
973
+ _oai_key = prompt(_api_key_label, password=True).strip()
974
+ if _oai_key:
975
+ save_env_value("OPENAI_API_KEY", _oai_key)
976
+ # Save vision base URL to config (not .env — only secrets go there)
977
+ _vaux = config.setdefault("auxiliary", {}).setdefault("vision", {})
978
+ _vaux["base_url"] = _base_url
979
+ if _is_native_openai:
980
+ _oai_vision_models = ["gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano"]
981
+ _vm_choices = _oai_vision_models + ["Use default (gpt-4o-mini)"]
982
+ _vm_idx = prompt_choice("Select vision model:", _vm_choices, 0)
983
+ _selected_vision_model = (
984
+ _oai_vision_models[_vm_idx]
985
+ if _vm_idx < len(_oai_vision_models)
986
+ else "gpt-4o-mini"
987
+ )
988
+ else:
989
+ _selected_vision_model = prompt(" Vision model (blank = use main/custom default)").strip()
990
+ if _selected_vision_model:
991
+ save_env_value("AUXILIARY_VISION_MODEL", _selected_vision_model)
992
+ print_success(
993
+ f"Vision configured with {_base_url}"
994
+ + (f" ({_selected_vision_model})" if _selected_vision_model else "")
995
+ )
996
+ else:
997
+ print_info("Skipped — vision won't be available")
998
+ else:
999
+ print_info("Skipped — add later with 'hermes setup' or configure AUXILIARY_VISION_* settings")
1000
+
1001
+
1002
+ # Tool Gateway prompt is already shown by _model_flow_nous() above.
1003
+ save_config(config)
1004
+
1005
+ if not quick and selected_provider != "nous":
1006
+ _setup_tts_provider(config)
1007
+
1008
+
1009
+ # =============================================================================
1010
+ # Section 1b: TTS Provider Configuration
1011
+ # =============================================================================
1012
+
1013
+
1014
+ def _check_espeak_ng() -> bool:
1015
+ """Check if espeak-ng is installed."""
1016
+ return shutil.which("espeak-ng") is not None or shutil.which("espeak") is not None
1017
+
1018
+
1019
+ def _install_neutts_deps() -> bool:
1020
+ """Install NeuTTS dependencies with user approval. Returns True on success."""
1021
+ import subprocess
1022
+ import sys
1023
+
1024
+ # Check espeak-ng
1025
+ if not _check_espeak_ng():
1026
+ print()
1027
+ print_warning("NeuTTS requires espeak-ng for phonemization.")
1028
+ if sys.platform == "darwin":
1029
+ print_info("Install with: brew install espeak-ng")
1030
+ elif sys.platform == "win32":
1031
+ print_info("Install with: choco install espeak-ng")
1032
+ else:
1033
+ print_info("Install with: sudo apt install espeak-ng")
1034
+ print()
1035
+ if prompt_yes_no("Install espeak-ng now?", True):
1036
+ try:
1037
+ if sys.platform == "darwin":
1038
+ subprocess.run(["brew", "install", "espeak-ng"], check=True)
1039
+ elif sys.platform == "win32":
1040
+ subprocess.run(["choco", "install", "espeak-ng", "-y"], check=True)
1041
+ else:
1042
+ subprocess.run(["sudo", "apt", "install", "-y", "espeak-ng"], check=True)
1043
+ print_success("espeak-ng installed")
1044
+ except (subprocess.CalledProcessError, FileNotFoundError) as e:
1045
+ print_warning(f"Could not install espeak-ng automatically: {e}")
1046
+ print_info("Please install it manually and re-run setup.")
1047
+ return False
1048
+ else:
1049
+ print_warning("espeak-ng is required for NeuTTS. Install it manually before using NeuTTS.")
1050
+
1051
+ # Install neutts Python package
1052
+ print()
1053
+ print_info("Installing neutts Python package...")
1054
+ print_info("This will also download the TTS model (~300MB) on first use.")
1055
+ print()
1056
+ try:
1057
+ subprocess.run(
1058
+ [sys.executable, "-m", "pip", "install", "-U", "neutts[all]", "--quiet"],
1059
+ check=True, timeout=300,
1060
+ )
1061
+ print_success("neutts installed successfully")
1062
+ return True
1063
+ except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:
1064
+ print_error(f"Failed to install neutts: {e}")
1065
+ print_info("Try manually: python -m pip install -U neutts[all]")
1066
+ return False
1067
+
1068
+
1069
+ def _install_kittentts_deps() -> bool:
1070
+ """Install KittenTTS dependencies with user approval. Returns True on success."""
1071
+ import subprocess
1072
+ import sys
1073
+
1074
+ wheel_url = (
1075
+ "https://github.com/KittenML/KittenTTS/releases/download/"
1076
+ "0.8.1/kittentts-0.8.1-py3-none-any.whl"
1077
+ )
1078
+ print()
1079
+ print_info("Installing kittentts Python package (~25-80MB model downloaded on first use)...")
1080
+ print()
1081
+ try:
1082
+ subprocess.run(
1083
+ [sys.executable, "-m", "pip", "install", "-U", wheel_url, "soundfile", "--quiet"],
1084
+ check=True, timeout=300,
1085
+ )
1086
+ print_success("kittentts installed successfully")
1087
+ return True
1088
+ except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:
1089
+ print_error(f"Failed to install kittentts: {e}")
1090
+ print_info(f"Try manually: python -m pip install -U '{wheel_url}' soundfile")
1091
+ return False
1092
+
1093
+
1094
+ def _xai_oauth_logged_in_for_setup() -> bool:
1095
+ """True iff xAI Grok OAuth credentials are already stored locally.
1096
+
1097
+ Lets TTS / STT setup skip the API-key prompt for users who logged in
1098
+ through ``hermes model`` -> xAI Grok OAuth (SuperGrok Subscription).
1099
+ """
1100
+ try:
1101
+ from hermes_cli.auth import get_xai_oauth_auth_status
1102
+
1103
+ return bool(get_xai_oauth_auth_status().get("logged_in"))
1104
+ except Exception:
1105
+ return False
1106
+
1107
+
1108
+ def _run_xai_oauth_login_from_setup() -> bool:
1109
+ """Run the xAI Grok OAuth loopback login from inside the setup wizard.
1110
+
1111
+ Returns True on success, False on any failure (the caller falls back
1112
+ to whatever the user picked next, e.g. Edge TTS).
1113
+ """
1114
+ try:
1115
+ from hermes_cli.auth import (
1116
+ DEFAULT_XAI_OAUTH_BASE_URL,
1117
+ _is_remote_session,
1118
+ _save_xai_oauth_tokens,
1119
+ _update_config_for_provider,
1120
+ _xai_oauth_loopback_login,
1121
+ )
1122
+ except Exception as exc:
1123
+ print_warning(f"xAI Grok OAuth helpers unavailable: {exc}")
1124
+ return False
1125
+
1126
+ open_browser = not _is_remote_session()
1127
+ print()
1128
+ print_info("Signing in to xAI Grok OAuth (SuperGrok Subscription)...")
1129
+ try:
1130
+ creds = _xai_oauth_loopback_login(open_browser=open_browser)
1131
+ _save_xai_oauth_tokens(
1132
+ creds["tokens"],
1133
+ discovery=creds.get("discovery"),
1134
+ redirect_uri=creds.get("redirect_uri", ""),
1135
+ last_refresh=creds.get("last_refresh"),
1136
+ )
1137
+ _update_config_for_provider(
1138
+ "xai-oauth", creds.get("base_url", DEFAULT_XAI_OAUTH_BASE_URL)
1139
+ )
1140
+ return True
1141
+ except Exception as exc:
1142
+ print_warning(f"xAI Grok OAuth login failed: {exc}")
1143
+ return False
1144
+
1145
+
1146
+ def _setup_tts_provider(config: dict):
1147
+ """Interactive TTS provider selection with install flow for NeuTTS."""
1148
+ tts_config = config.get("tts", {})
1149
+ current_provider = tts_config.get("provider", "edge")
1150
+ subscription_features = get_nous_subscription_features(config)
1151
+
1152
+ provider_labels = {
1153
+ "edge": "Edge TTS",
1154
+ "elevenlabs": "ElevenLabs",
1155
+ "openai": "OpenAI TTS",
1156
+ "xai": "xAI TTS",
1157
+ "minimax": "MiniMax TTS",
1158
+ "mistral": "Mistral Voxtral TTS",
1159
+ "gemini": "Google Gemini TTS",
1160
+ "neutts": "NeuTTS",
1161
+ "kittentts": "KittenTTS",
1162
+ }
1163
+ current_label = provider_labels.get(current_provider, current_provider)
1164
+
1165
+ print()
1166
+ print_header("Text-to-Speech Provider (optional)")
1167
+ print_info(f"Current: {current_label}")
1168
+ print()
1169
+
1170
+ choices = []
1171
+ providers = []
1172
+ if managed_nous_tools_enabled() and subscription_features.nous_auth_present:
1173
+ choices.append("Nous Subscription (managed OpenAI TTS, billed to your subscription)")
1174
+ providers.append("nous-openai")
1175
+ choices.extend(
1176
+ [
1177
+ "Edge TTS (free, cloud-based, no setup needed)",
1178
+ "ElevenLabs (premium quality, needs API key)",
1179
+ "OpenAI TTS (good quality, needs API key)",
1180
+ "xAI TTS (Grok voices — OAuth login or API key)",
1181
+ "MiniMax TTS (high quality with voice cloning, needs API key)",
1182
+ "Mistral Voxtral TTS (multilingual, native Opus, needs API key)",
1183
+ "Google Gemini TTS (30 prebuilt voices, prompt-controllable, needs API key)",
1184
+ "NeuTTS (local on-device, free, ~300MB model download)",
1185
+ "KittenTTS (local on-device, free, lightweight ~25-80MB ONNX)",
1186
+ ]
1187
+ )
1188
+ providers.extend(["edge", "elevenlabs", "openai", "xai", "minimax", "mistral", "gemini", "neutts", "kittentts"])
1189
+ choices.append(f"Keep current ({current_label})")
1190
+ keep_current_idx = len(choices) - 1
1191
+ idx = prompt_choice("Select TTS provider:", choices, keep_current_idx)
1192
+
1193
+ if idx == keep_current_idx:
1194
+ return
1195
+
1196
+ selected = providers[idx]
1197
+ selected_via_nous = selected == "nous-openai"
1198
+ if selected == "nous-openai":
1199
+ selected = "openai"
1200
+ print_info("OpenAI TTS will use the managed Nous gateway and bill to your subscription.")
1201
+ if get_env_value("VOICE_TOOLS_OPENAI_KEY") or get_env_value("OPENAI_API_KEY"):
1202
+ print_warning(
1203
+ "Direct OpenAI credentials are still configured and may take precedence until removed from ~/.hermes/.env."
1204
+ )
1205
+
1206
+ if selected == "neutts":
1207
+ # Check if already installed
1208
+ try:
1209
+ already_installed = importlib.util.find_spec("neutts") is not None
1210
+ except Exception:
1211
+ already_installed = False
1212
+
1213
+ if already_installed:
1214
+ print_success("NeuTTS is already installed")
1215
+ else:
1216
+ print()
1217
+ print_info("NeuTTS requires:")
1218
+ print_info(" • Python package: neutts (~50MB install + ~300MB model on first use)")
1219
+ print_info(" • System package: espeak-ng (phonemizer)")
1220
+ print()
1221
+ if prompt_yes_no("Install NeuTTS dependencies now?", True):
1222
+ if not _install_neutts_deps():
1223
+ print_warning("NeuTTS installation incomplete. Falling back to Edge TTS.")
1224
+ selected = "edge"
1225
+ else:
1226
+ print_info("Skipping install. Set tts.provider to 'neutts' after installing manually.")
1227
+ selected = "edge"
1228
+
1229
+ elif selected == "elevenlabs":
1230
+ existing = get_env_value("ELEVENLABS_API_KEY")
1231
+ if not existing:
1232
+ print()
1233
+ api_key = prompt("ElevenLabs API key", password=True)
1234
+ if api_key:
1235
+ save_env_value("ELEVENLABS_API_KEY", api_key)
1236
+ print_success("ElevenLabs API key saved")
1237
+ else:
1238
+ print_warning("No API key provided. Falling back to Edge TTS.")
1239
+ selected = "edge"
1240
+
1241
+ elif selected == "openai" and not selected_via_nous:
1242
+ existing = get_env_value("VOICE_TOOLS_OPENAI_KEY") or get_env_value("OPENAI_API_KEY")
1243
+ if not existing:
1244
+ print()
1245
+ api_key = prompt("OpenAI API key for TTS", password=True)
1246
+ if api_key:
1247
+ save_env_value("VOICE_TOOLS_OPENAI_KEY", api_key)
1248
+ print_success("OpenAI TTS API key saved")
1249
+ else:
1250
+ print_warning("No API key provided. Falling back to Edge TTS.")
1251
+ selected = "edge"
1252
+
1253
+ elif selected == "xai":
1254
+ # Resolution order: existing OAuth tokens (free for SuperGrok subscribers
1255
+ # via the Hermes auth store) > existing XAI_API_KEY > prompt the user.
1256
+ # When neither is configured, offer both options instead of forcing the
1257
+ # API-key path — xAI TTS works fine with OAuth bearer tokens too.
1258
+ oauth_logged_in = _xai_oauth_logged_in_for_setup()
1259
+ existing_api_key = get_env_value("XAI_API_KEY")
1260
+
1261
+ if oauth_logged_in:
1262
+ print_success(
1263
+ "xAI TTS will use your xAI Grok OAuth (SuperGrok Subscription) "
1264
+ "credentials"
1265
+ )
1266
+ elif existing_api_key:
1267
+ print_success("xAI TTS will use your existing XAI_API_KEY")
1268
+ else:
1269
+ print()
1270
+ choice_idx = prompt_choice(
1271
+ "How do you want xAI TTS to authenticate?",
1272
+ choices=[
1273
+ "Sign in with xAI Grok OAuth (SuperGrok Subscription) — browser login",
1274
+ "Paste an xAI API key (console.x.ai)",
1275
+ "Skip → fallback to Edge TTS",
1276
+ ],
1277
+ default=0,
1278
+ )
1279
+ if choice_idx == 0:
1280
+ if _run_xai_oauth_login_from_setup():
1281
+ print_success(
1282
+ "Logged in — xAI TTS will use these OAuth credentials"
1283
+ )
1284
+ else:
1285
+ print_warning(
1286
+ "xAI Grok OAuth login did not complete. "
1287
+ "Falling back to Edge TTS."
1288
+ )
1289
+ selected = "edge"
1290
+ elif choice_idx == 1:
1291
+ api_key = prompt("xAI API key for TTS", password=True)
1292
+ if api_key:
1293
+ save_env_value("XAI_API_KEY", api_key)
1294
+ print_success("xAI TTS API key saved")
1295
+ else:
1296
+ from calvyn_constants import display_hermes_home as _dhh
1297
+ print_warning(
1298
+ "No xAI API key provided for TTS. Configure XAI_API_KEY "
1299
+ f"via hermes setup model or {_dhh()}/.env to use xAI TTS. "
1300
+ "Falling back to Edge TTS."
1301
+ )
1302
+ selected = "edge"
1303
+ else:
1304
+ print_warning("xAI TTS skipped. Falling back to Edge TTS.")
1305
+ selected = "edge"
1306
+
1307
+ if selected == "xai":
1308
+ print()
1309
+ voice_id = prompt("xAI voice_id (Enter for 'eve', or paste a custom voice ID)")
1310
+ if voice_id and voice_id.strip():
1311
+ config.setdefault("tts", {}).setdefault("xai", {})["voice_id"] = voice_id.strip()
1312
+ print_success(f"xAI voice_id set to: {voice_id.strip()}")
1313
+
1314
+
1315
+ elif selected == "minimax":
1316
+ existing = get_env_value("MINIMAX_API_KEY")
1317
+ if not existing:
1318
+ print()
1319
+ api_key = prompt("MiniMax API key for TTS", password=True)
1320
+ if api_key:
1321
+ save_env_value("MINIMAX_API_KEY", api_key)
1322
+ print_success("MiniMax TTS API key saved")
1323
+ else:
1324
+ print_warning("No API key provided. Falling back to Edge TTS.")
1325
+ selected = "edge"
1326
+
1327
+ elif selected == "mistral":
1328
+ existing = get_env_value("MISTRAL_API_KEY")
1329
+ if not existing:
1330
+ print()
1331
+ api_key = prompt("Mistral API key for TTS", password=True)
1332
+ if api_key:
1333
+ save_env_value("MISTRAL_API_KEY", api_key)
1334
+ print_success("Mistral TTS API key saved")
1335
+ else:
1336
+ print_warning("No API key provided. Falling back to Edge TTS.")
1337
+ selected = "edge"
1338
+
1339
+ elif selected == "gemini":
1340
+ existing = get_env_value("GEMINI_API_KEY") or get_env_value("GOOGLE_API_KEY")
1341
+ if not existing:
1342
+ print()
1343
+ print_info("Get a free API key at https://aistudio.google.com/app/apikey")
1344
+ api_key = prompt("Gemini API key for TTS", password=True)
1345
+ if api_key:
1346
+ save_env_value("GEMINI_API_KEY", api_key)
1347
+ print_success("Gemini TTS API key saved")
1348
+ else:
1349
+ print_warning("No API key provided. Falling back to Edge TTS.")
1350
+ selected = "edge"
1351
+
1352
+ elif selected == "kittentts":
1353
+ # Check if already installed
1354
+ try:
1355
+ import importlib.util
1356
+ already_installed = importlib.util.find_spec("kittentts") is not None
1357
+ except Exception:
1358
+ already_installed = False
1359
+
1360
+ if already_installed:
1361
+ print_success("KittenTTS is already installed")
1362
+ else:
1363
+ print()
1364
+ print_info("KittenTTS is lightweight (~25-80MB, CPU-only, no API key required).")
1365
+ print_info("Voices: Jasper, Bella, Luna, Bruno, Rosie, Hugo, Kiki, Leo")
1366
+ print()
1367
+ if prompt_yes_no("Install KittenTTS now?", True):
1368
+ if not _install_kittentts_deps():
1369
+ print_warning("KittenTTS installation incomplete. Falling back to Edge TTS.")
1370
+ selected = "edge"
1371
+ else:
1372
+ print_info("Skipping install. Set tts.provider to 'kittentts' after installing manually.")
1373
+ selected = "edge"
1374
+
1375
+ # Save the selection
1376
+ if "tts" not in config:
1377
+ config["tts"] = {}
1378
+ config["tts"]["provider"] = selected
1379
+ save_config(config)
1380
+ print_success(f"TTS provider set to: {provider_labels.get(selected, selected)}")
1381
+
1382
+
1383
+ def setup_tts(config: dict):
1384
+ """Standalone TTS setup (for 'hermes setup tts')."""
1385
+ _setup_tts_provider(config)
1386
+
1387
+
1388
+ # =============================================================================
1389
+ # Section 2: Terminal Backend Configuration
1390
+ # =============================================================================
1391
+
1392
+
1393
+ def setup_terminal_backend(config: dict):
1394
+ """Configure the terminal execution backend."""
1395
+ import platform as _platform
1396
+ print_header("Terminal Backend")
1397
+ print_info("Choose where Hermes runs shell commands and code.")
1398
+ print_info("This affects tool execution, file access, and isolation.")
1399
+ print_info(f" Guide: {_DOCS_BASE}/developer-guide/environments")
1400
+ print()
1401
+
1402
+ current_backend = cfg_get(config, "terminal", "backend", default="local")
1403
+ is_linux = _platform.system() == "Linux"
1404
+
1405
+ # Build backend choices with descriptions
1406
+ terminal_choices = [
1407
+ "Local - run directly on this machine (default)",
1408
+ "Docker - isolated container with configurable resources",
1409
+ "Modal - serverless cloud sandbox",
1410
+ "SSH - run on a remote machine",
1411
+ "Daytona - persistent cloud development environment",
1412
+ "Vercel Sandbox - cloud microVM with snapshot filesystem persistence",
1413
+ ]
1414
+ idx_to_backend = {0: "local", 1: "docker", 2: "modal", 3: "ssh", 4: "daytona", 5: "vercel_sandbox"}
1415
+ backend_to_idx = {"local": 0, "docker": 1, "modal": 2, "ssh": 3, "daytona": 4, "vercel_sandbox": 5}
1416
+
1417
+ next_idx = 6
1418
+ if is_linux:
1419
+ terminal_choices.append("Singularity/Apptainer - HPC-friendly container")
1420
+ idx_to_backend[next_idx] = "singularity"
1421
+ backend_to_idx["singularity"] = next_idx
1422
+ next_idx += 1
1423
+
1424
+ # Add keep current option
1425
+ keep_current_idx = next_idx
1426
+ terminal_choices.append(f"Keep current ({current_backend})")
1427
+ idx_to_backend[keep_current_idx] = current_backend
1428
+
1429
+ terminal_idx = prompt_choice(
1430
+ "Select terminal backend:", terminal_choices, keep_current_idx
1431
+ )
1432
+
1433
+ selected_backend = idx_to_backend.get(terminal_idx)
1434
+
1435
+ if terminal_idx == keep_current_idx:
1436
+ print_info(f"Keeping current backend: {current_backend}")
1437
+ return
1438
+
1439
+ config.setdefault("terminal", {})["backend"] = selected_backend
1440
+
1441
+ if selected_backend == "local":
1442
+ print_success("Terminal backend: Local")
1443
+ print_info("Commands run directly on this machine.")
1444
+
1445
+ # Gateway/cron working directory
1446
+ print()
1447
+ print_info("Gateway working directory:")
1448
+ print_info(" Used by Telegram/Discord/cron sessions.")
1449
+ print_info(" CLI/TUI always uses your launch directory instead.")
1450
+ current_cwd = cfg_get(config, "terminal", "cwd", default="")
1451
+ cwd = prompt(" Gateway working directory", current_cwd or str(Path.home()))
1452
+ if cwd:
1453
+ config["terminal"]["cwd"] = cwd
1454
+
1455
+ # Sudo support
1456
+ print()
1457
+ existing_sudo = get_env_value("SUDO_PASSWORD")
1458
+ if existing_sudo:
1459
+ print_info("Sudo password: configured")
1460
+ elif prompt_yes_no(
1461
+ "Enable sudo support? (stores password for apt install, etc.)", False
1462
+ ):
1463
+ sudo_pass = prompt(" Sudo password", password=True)
1464
+ if sudo_pass:
1465
+ save_env_value("SUDO_PASSWORD", sudo_pass)
1466
+ print_success("Sudo password saved")
1467
+
1468
+ elif selected_backend == "docker":
1469
+ print_success("Terminal backend: Docker")
1470
+
1471
+ # Check if Docker is available
1472
+ docker_bin = shutil.which("docker")
1473
+ if not docker_bin:
1474
+ print_warning("Docker not found in PATH!")
1475
+ print_info("Install Docker: https://docs.docker.com/get-docker/")
1476
+ else:
1477
+ print_info(f"Docker found: {docker_bin}")
1478
+
1479
+ # Docker image
1480
+ current_image = cfg_get(config, "terminal", "docker_image", default="nikolaik/python-nodejs:python3.11-nodejs20")
1481
+ image = prompt(" Docker image", current_image)
1482
+ config["terminal"]["docker_image"] = image
1483
+ save_env_value("TERMINAL_DOCKER_IMAGE", image)
1484
+
1485
+ _prompt_container_resources(config)
1486
+
1487
+ elif selected_backend == "singularity":
1488
+ print_success("Terminal backend: Singularity/Apptainer")
1489
+
1490
+ # Check if singularity/apptainer is available
1491
+ sing_bin = shutil.which("apptainer") or shutil.which("singularity")
1492
+ if not sing_bin:
1493
+ print_warning("Singularity/Apptainer not found in PATH!")
1494
+ print_info(
1495
+ "Install: https://apptainer.org/docs/admin/main/installation.html"
1496
+ )
1497
+ else:
1498
+ print_info(f"Found: {sing_bin}")
1499
+
1500
+ current_image = cfg_get(config, "terminal", "singularity_image", default="docker://nikolaik/python-nodejs:python3.11-nodejs20")
1501
+ image = prompt(" Container image", current_image)
1502
+ config["terminal"]["singularity_image"] = image
1503
+ save_env_value("TERMINAL_SINGULARITY_IMAGE", image)
1504
+
1505
+ _prompt_container_resources(config)
1506
+
1507
+ elif selected_backend == "modal":
1508
+ print_success("Terminal backend: Modal")
1509
+ print_info("Serverless cloud sandboxes. Each session gets its own container.")
1510
+ from tools.managed_tool_gateway import is_managed_tool_gateway_ready
1511
+ from tools.tool_backend_helpers import normalize_modal_mode
1512
+
1513
+ managed_modal_available = bool(
1514
+ managed_nous_tools_enabled()
1515
+ and
1516
+ get_nous_subscription_features(config).nous_auth_present
1517
+ and is_managed_tool_gateway_ready("modal")
1518
+ )
1519
+ modal_mode = normalize_modal_mode(cfg_get(config, "terminal", "modal_mode"))
1520
+ use_managed_modal = False
1521
+ if managed_modal_available:
1522
+ modal_choices = [
1523
+ "Use my Nous subscription",
1524
+ "Use my own Modal account",
1525
+ ]
1526
+ if modal_mode == "managed":
1527
+ default_modal_idx = 0
1528
+ elif modal_mode == "direct":
1529
+ default_modal_idx = 1
1530
+ else:
1531
+ default_modal_idx = 1 if get_env_value("MODAL_TOKEN_ID") else 0
1532
+ modal_mode_idx = prompt_choice(
1533
+ "Select how Modal execution should be billed:",
1534
+ modal_choices,
1535
+ default_modal_idx,
1536
+ )
1537
+ use_managed_modal = modal_mode_idx == 0
1538
+
1539
+ if use_managed_modal:
1540
+ config["terminal"]["modal_mode"] = "managed"
1541
+ print_info("Modal execution will use the managed Nous gateway and bill to your subscription.")
1542
+ if get_env_value("MODAL_TOKEN_ID") or get_env_value("MODAL_TOKEN_SECRET"):
1543
+ print_info(
1544
+ "Direct Modal credentials are still configured, but this backend is pinned to managed mode."
1545
+ )
1546
+ else:
1547
+ config["terminal"]["modal_mode"] = "direct"
1548
+ print_info("Requires a Modal account: https://modal.com")
1549
+
1550
+ # Check if modal SDK is installed
1551
+ try:
1552
+ __import__("modal")
1553
+ except ImportError:
1554
+ print_info("Installing modal SDK...")
1555
+ import subprocess
1556
+
1557
+ uv_bin = shutil.which("uv")
1558
+ if uv_bin:
1559
+ result = subprocess.run(
1560
+ [
1561
+ uv_bin,
1562
+ "pip",
1563
+ "install",
1564
+ "--python",
1565
+ sys.executable,
1566
+ "modal",
1567
+ ],
1568
+ capture_output=True,
1569
+ text=True,
1570
+ )
1571
+ else:
1572
+ result = subprocess.run(
1573
+ [sys.executable, "-m", "pip", "install", "modal"],
1574
+ capture_output=True,
1575
+ text=True,
1576
+ )
1577
+ if result.returncode == 0:
1578
+ print_success("modal SDK installed")
1579
+ else:
1580
+ print_warning("Install failed — run manually: pip install modal")
1581
+
1582
+ # Modal token
1583
+ print()
1584
+ print_info("Modal authentication:")
1585
+ print_info(" Get your token at: https://modal.com/settings")
1586
+ existing_token = get_env_value("MODAL_TOKEN_ID")
1587
+ if existing_token:
1588
+ print_info(" Modal token: already configured")
1589
+ if prompt_yes_no(" Update Modal credentials?", False):
1590
+ token_id = prompt(" Modal Token ID", password=True)
1591
+ token_secret = prompt(" Modal Token Secret", password=True)
1592
+ if token_id:
1593
+ save_env_value("MODAL_TOKEN_ID", token_id)
1594
+ if token_secret:
1595
+ save_env_value("MODAL_TOKEN_SECRET", token_secret)
1596
+ else:
1597
+ token_id = prompt(" Modal Token ID", password=True)
1598
+ token_secret = prompt(" Modal Token Secret", password=True)
1599
+ if token_id:
1600
+ save_env_value("MODAL_TOKEN_ID", token_id)
1601
+ if token_secret:
1602
+ save_env_value("MODAL_TOKEN_SECRET", token_secret)
1603
+
1604
+ _prompt_container_resources(config)
1605
+
1606
+ elif selected_backend == "daytona":
1607
+ print_success("Terminal backend: Daytona")
1608
+ print_info("Persistent cloud development environments.")
1609
+ print_info("Each session gets a dedicated sandbox with filesystem persistence.")
1610
+ print_info("Sign up at: https://daytona.io")
1611
+
1612
+ # Check if daytona SDK is installed
1613
+ try:
1614
+ __import__("daytona")
1615
+ except ImportError:
1616
+ print_info("Installing daytona SDK...")
1617
+ import subprocess
1618
+
1619
+ uv_bin = shutil.which("uv")
1620
+ if uv_bin:
1621
+ result = subprocess.run(
1622
+ [uv_bin, "pip", "install", "--python", sys.executable, "daytona"],
1623
+ capture_output=True,
1624
+ text=True,
1625
+ )
1626
+ else:
1627
+ result = subprocess.run(
1628
+ [sys.executable, "-m", "pip", "install", "daytona"],
1629
+ capture_output=True,
1630
+ text=True,
1631
+ )
1632
+ if result.returncode == 0:
1633
+ print_success("daytona SDK installed")
1634
+ else:
1635
+ print_warning("Install failed — run manually: pip install daytona")
1636
+ if result.stderr:
1637
+ print_info(f" Error: {result.stderr.strip().splitlines()[-1]}")
1638
+
1639
+ # Daytona API key
1640
+ print()
1641
+ existing_key = get_env_value("DAYTONA_API_KEY")
1642
+ if existing_key:
1643
+ print_info(" Daytona API key: already configured")
1644
+ if prompt_yes_no(" Update API key?", False):
1645
+ api_key = prompt(" Daytona API key", password=True)
1646
+ if api_key:
1647
+ save_env_value("DAYTONA_API_KEY", api_key)
1648
+ print_success(" Updated")
1649
+ else:
1650
+ api_key = prompt(" Daytona API key", password=True)
1651
+ if api_key:
1652
+ save_env_value("DAYTONA_API_KEY", api_key)
1653
+ print_success(" Configured")
1654
+
1655
+ # Daytona image
1656
+ current_image = cfg_get(config, "terminal", "daytona_image", default="nikolaik/python-nodejs:python3.11-nodejs20")
1657
+ image = prompt(" Sandbox image", current_image)
1658
+ config["terminal"]["daytona_image"] = image
1659
+ save_env_value("TERMINAL_DAYTONA_IMAGE", image)
1660
+
1661
+ _prompt_container_resources(config)
1662
+
1663
+ elif selected_backend == "vercel_sandbox":
1664
+ print_success("Terminal backend: Vercel Sandbox")
1665
+ print_info("Cloud microVM sandboxes with snapshot-backed filesystem persistence.")
1666
+ print_info("Requires the optional SDK: pip install 'hermes-agent[vercel]'")
1667
+
1668
+ try:
1669
+ __import__("vercel")
1670
+ except ImportError:
1671
+ print_info("Installing vercel SDK...")
1672
+ import subprocess
1673
+
1674
+ uv_bin = shutil.which("uv")
1675
+ if uv_bin:
1676
+ result = subprocess.run(
1677
+ [uv_bin, "pip", "install", "--python", sys.executable, "vercel"],
1678
+ capture_output=True,
1679
+ text=True,
1680
+ )
1681
+ else:
1682
+ result = subprocess.run(
1683
+ [sys.executable, "-m", "pip", "install", "vercel"],
1684
+ capture_output=True,
1685
+ text=True,
1686
+ )
1687
+ if result.returncode == 0:
1688
+ print_success("vercel SDK installed")
1689
+ else:
1690
+ print_warning("Install failed — run manually: pip install 'hermes-agent[vercel]'")
1691
+ if result.stderr:
1692
+ print_info(f" Error: {result.stderr.strip().splitlines()[-1]}")
1693
+
1694
+ _prompt_vercel_sandbox_settings(config)
1695
+
1696
+ elif selected_backend == "ssh":
1697
+ print_success("Terminal backend: SSH")
1698
+ print_info("Run commands on a remote machine via SSH.")
1699
+
1700
+ # SSH host
1701
+ current_host = get_env_value("TERMINAL_SSH_HOST") or ""
1702
+ host = prompt(" SSH host (hostname or IP)", current_host)
1703
+ if host:
1704
+ save_env_value("TERMINAL_SSH_HOST", host)
1705
+
1706
+ # SSH user
1707
+ current_user = get_env_value("TERMINAL_SSH_USER") or ""
1708
+ user = prompt(" SSH user", current_user or os.getenv("USER", ""))
1709
+ if user:
1710
+ save_env_value("TERMINAL_SSH_USER", user)
1711
+
1712
+ # SSH port
1713
+ current_port = get_env_value("TERMINAL_SSH_PORT") or "22"
1714
+ port = prompt(" SSH port", current_port)
1715
+ if port and port != "22":
1716
+ save_env_value("TERMINAL_SSH_PORT", port)
1717
+
1718
+ # SSH key
1719
+ current_key = get_env_value("TERMINAL_SSH_KEY") or ""
1720
+ default_key = str(Path.home() / ".ssh" / "id_rsa")
1721
+ ssh_key = prompt(" SSH private key path", current_key or default_key)
1722
+ if ssh_key:
1723
+ save_env_value("TERMINAL_SSH_KEY", ssh_key)
1724
+
1725
+ # Test connection
1726
+ if host and prompt_yes_no(" Test SSH connection?", True):
1727
+ print_info(" Testing connection...")
1728
+ import subprocess
1729
+
1730
+ ssh_cmd = ["ssh", "-o", "BatchMode=yes", "-o", "ConnectTimeout=5"]
1731
+ if ssh_key:
1732
+ ssh_cmd.extend(["-i", ssh_key])
1733
+ if port and port != "22":
1734
+ ssh_cmd.extend(["-p", port])
1735
+ ssh_cmd.append(f"{user}@{host}" if user else host)
1736
+ ssh_cmd.append("echo ok")
1737
+ result = subprocess.run(ssh_cmd, capture_output=True, text=True, timeout=10)
1738
+ if result.returncode == 0:
1739
+ print_success(" SSH connection successful!")
1740
+ else:
1741
+ print_warning(f" SSH connection failed: {result.stderr.strip()}")
1742
+ print_info(" Check your SSH key and host settings.")
1743
+
1744
+ # Sync terminal backend to .env so terminal_tool picks it up directly.
1745
+ # config.yaml is the source of truth, but terminal_tool reads TERMINAL_ENV.
1746
+ save_env_value("TERMINAL_ENV", selected_backend)
1747
+ if selected_backend == "modal":
1748
+ save_env_value("TERMINAL_MODAL_MODE", config["terminal"].get("modal_mode", "auto"))
1749
+ if selected_backend == "vercel_sandbox":
1750
+ save_env_value("TERMINAL_VERCEL_RUNTIME", config["terminal"].get("vercel_runtime", "node24"))
1751
+ save_config(config)
1752
+ print()
1753
+ print_success(f"Terminal backend set to: {selected_backend}")
1754
+
1755
+
1756
+ # =============================================================================
1757
+ # Section 3: Agent Settings
1758
+ # =============================================================================
1759
+
1760
+
1761
+ def _apply_default_agent_settings(config: dict):
1762
+ """Apply recommended defaults for all agent settings without prompting."""
1763
+ config.setdefault("agent", {})["max_turns"] = 90
1764
+ # config.yaml is the authoritative source for max_turns; the gateway
1765
+ # bridges it into HERMES_MAX_ITERATIONS at startup. We no longer write
1766
+ # to .env to avoid the dual-source inconsistency that caused the
1767
+ # 60-vs-500 bug (stale .env entry silently shadowing config.yaml).
1768
+ remove_env_value("HERMES_MAX_ITERATIONS")
1769
+
1770
+ config.setdefault("display", {})["tool_progress"] = "all"
1771
+
1772
+ config.setdefault("compression", {})["enabled"] = True
1773
+ config["compression"]["threshold"] = 0.50
1774
+
1775
+ config.setdefault("session_reset", {}).update({
1776
+ "mode": "both",
1777
+ "idle_minutes": 1440,
1778
+ "at_hour": 4,
1779
+ })
1780
+
1781
+ save_config(config)
1782
+ print_success("Applied recommended defaults:")
1783
+ print_info(" Max iterations: 90")
1784
+ print_info(" Tool progress: all")
1785
+ print_info(" Compression threshold: 0.50")
1786
+ print_info(" Session reset: inactivity (1440 min) + daily (4:00)")
1787
+ print_info(" Run `hermes setup agent` later to customize.")
1788
+
1789
+
1790
+ def setup_agent_settings(config: dict):
1791
+ """Configure agent behavior: iterations, progress display, compression, session reset."""
1792
+
1793
+ print_header("Agent Settings")
1794
+ print_info(f" Guide: {_DOCS_BASE}/user-guide/configuration")
1795
+ print()
1796
+
1797
+ # ── Max Iterations ──
1798
+ # config.yaml is authoritative; read from there. If a legacy .env
1799
+ # entry is still around (from pre-PR#18413 setups), prefer the
1800
+ # config value so we don't surface a stale number to the user.
1801
+ current_max = str(cfg_get(config, "agent", "max_turns", default=90))
1802
+ print_info("Maximum tool-calling iterations per conversation.")
1803
+ print_info("Higher = more complex tasks, but costs more tokens.")
1804
+ print_info(
1805
+ f"Press Enter to keep {current_max}. Use 90 for most tasks or 150+ for open exploration."
1806
+ )
1807
+
1808
+ max_iter_str = prompt("Max iterations", current_max)
1809
+ try:
1810
+ max_iter = int(max_iter_str)
1811
+ if max_iter > 0:
1812
+ # Write to config.yaml (authoritative) only. Also clean up any
1813
+ # stale .env entry from earlier setup runs — the gateway's
1814
+ # bridge in gateway/run.py now unconditionally derives
1815
+ # HERMES_MAX_ITERATIONS from agent.max_turns at startup.
1816
+ config.setdefault("agent", {})["max_turns"] = max_iter
1817
+ config.pop("max_turns", None)
1818
+ remove_env_value("HERMES_MAX_ITERATIONS")
1819
+ print_success(f"Max iterations set to {max_iter}")
1820
+ except ValueError:
1821
+ print_warning("Invalid number, keeping current value")
1822
+
1823
+ # ── Tool Progress Display ──
1824
+ print_info("")
1825
+ print_info("Tool Progress Display")
1826
+ print_info("Controls how much tool activity is shown (CLI and messaging).")
1827
+ print_info(" off — Silent, just the final response")
1828
+ print_info(" new — Show tool name only when it changes (less noise)")
1829
+ print_info(" all — Show every tool call with a short preview")
1830
+ print_info(" verbose — Full args, results, and debug logs")
1831
+
1832
+ current_mode = cfg_get(config, "display", "tool_progress", default="all")
1833
+ mode = prompt("Tool progress mode", current_mode)
1834
+ if mode.lower() in {"off", "new", "all", "verbose"}:
1835
+ if "display" not in config:
1836
+ config["display"] = {}
1837
+ config["display"]["tool_progress"] = mode.lower()
1838
+ save_config(config)
1839
+ print_success(f"Tool progress set to: {mode.lower()}")
1840
+ else:
1841
+ print_warning(f"Unknown mode '{mode}', keeping '{current_mode}'")
1842
+
1843
+ # ── Context Compression ──
1844
+ print_header("Context Compression")
1845
+ print_info("Automatically summarizes old messages when context gets too long.")
1846
+ print_info(
1847
+ "Higher threshold = compress later (use more context). Lower = compress sooner."
1848
+ )
1849
+
1850
+ config.setdefault("compression", {})["enabled"] = True
1851
+
1852
+ current_threshold = cfg_get(config, "compression", "threshold", default=0.50)
1853
+ threshold_str = prompt("Compression threshold (0.5-0.95)", str(current_threshold))
1854
+ try:
1855
+ threshold = float(threshold_str)
1856
+ if 0.5 <= threshold <= 0.95:
1857
+ config["compression"]["threshold"] = threshold
1858
+ except ValueError:
1859
+ pass
1860
+
1861
+ print_success(
1862
+ f"Context compression threshold set to {config['compression'].get('threshold', 0.50)}"
1863
+ )
1864
+
1865
+ # ── Session Reset Policy ──
1866
+ print_header("Session Reset Policy")
1867
+ print_info(
1868
+ "Messaging sessions (Telegram, Discord, etc.) accumulate context over time."
1869
+ )
1870
+ print_info(
1871
+ "Each message adds to the conversation history, which means growing API costs."
1872
+ )
1873
+ print_info("")
1874
+ print_info(
1875
+ "To manage this, sessions can automatically reset after a period of inactivity"
1876
+ )
1877
+ print_info(
1878
+ "or at a fixed time each day. When a reset happens, the agent saves important"
1879
+ )
1880
+ print_info(
1881
+ "things to its persistent memory first — but the conversation context is cleared."
1882
+ )
1883
+ print_info("")
1884
+ print_info("You can also manually reset anytime by typing /reset in chat.")
1885
+ print_info("")
1886
+
1887
+ reset_choices = [
1888
+ "Inactivity + daily reset (recommended - reset whichever comes first)",
1889
+ "Inactivity only (reset after N minutes of no messages)",
1890
+ "Daily only (reset at a fixed hour each day)",
1891
+ "Never auto-reset (context lives until /reset or context compression)",
1892
+ "Keep current settings",
1893
+ ]
1894
+
1895
+ current_policy = config.get("session_reset", {})
1896
+ current_mode = current_policy.get("mode", "both")
1897
+ current_idle = current_policy.get("idle_minutes", 1440)
1898
+ current_hour = current_policy.get("at_hour", 4)
1899
+
1900
+ default_reset = {"both": 0, "idle": 1, "daily": 2, "none": 3}.get(current_mode, 0)
1901
+
1902
+ reset_idx = prompt_choice("Session reset mode:", reset_choices, default_reset)
1903
+
1904
+ config.setdefault("session_reset", {})
1905
+
1906
+ if reset_idx == 0: # Both
1907
+ config["session_reset"]["mode"] = "both"
1908
+ idle_str = prompt(" Inactivity timeout (minutes)", str(current_idle))
1909
+ try:
1910
+ idle_val = int(idle_str)
1911
+ if idle_val > 0:
1912
+ config["session_reset"]["idle_minutes"] = idle_val
1913
+ except ValueError:
1914
+ pass
1915
+ hour_str = prompt(" Daily reset hour (0-23, local time)", str(current_hour))
1916
+ try:
1917
+ hour_val = int(hour_str)
1918
+ if 0 <= hour_val <= 23:
1919
+ config["session_reset"]["at_hour"] = hour_val
1920
+ except ValueError:
1921
+ pass
1922
+ print_success(
1923
+ f"Sessions reset after {config['session_reset'].get('idle_minutes', 1440)} min idle or daily at {config['session_reset'].get('at_hour', 4)}:00"
1924
+ )
1925
+ elif reset_idx == 1: # Idle only
1926
+ config["session_reset"]["mode"] = "idle"
1927
+ idle_str = prompt(" Inactivity timeout (minutes)", str(current_idle))
1928
+ try:
1929
+ idle_val = int(idle_str)
1930
+ if idle_val > 0:
1931
+ config["session_reset"]["idle_minutes"] = idle_val
1932
+ except ValueError:
1933
+ pass
1934
+ print_success(
1935
+ f"Sessions reset after {config['session_reset'].get('idle_minutes', 1440)} min of inactivity"
1936
+ )
1937
+ elif reset_idx == 2: # Daily only
1938
+ config["session_reset"]["mode"] = "daily"
1939
+ hour_str = prompt(" Daily reset hour (0-23, local time)", str(current_hour))
1940
+ try:
1941
+ hour_val = int(hour_str)
1942
+ if 0 <= hour_val <= 23:
1943
+ config["session_reset"]["at_hour"] = hour_val
1944
+ except ValueError:
1945
+ pass
1946
+ print_success(
1947
+ f"Sessions reset daily at {config['session_reset'].get('at_hour', 4)}:00"
1948
+ )
1949
+ elif reset_idx == 3: # None
1950
+ config["session_reset"]["mode"] = "none"
1951
+ print_info(
1952
+ "Sessions will never auto-reset. Context is managed only by compression."
1953
+ )
1954
+ print_warning(
1955
+ "Long conversations will grow in cost. Use /reset manually when needed."
1956
+ )
1957
+ # else: keep current (idx == 4)
1958
+
1959
+ save_config(config)
1960
+
1961
+
1962
+ # =============================================================================
1963
+ # Section 4: Messaging Platforms (Gateway)
1964
+ # =============================================================================
1965
+
1966
+
1967
+ def _setup_telegram():
1968
+ """Configure Telegram bot credentials and allowlist."""
1969
+ print_header("Telegram")
1970
+ existing = get_env_value("TELEGRAM_BOT_TOKEN")
1971
+ if existing:
1972
+ print_info("Telegram: already configured")
1973
+ if not prompt_yes_no("Reconfigure Telegram?", False):
1974
+ # Check missing allowlist on existing config
1975
+ if not get_env_value("TELEGRAM_ALLOWED_USERS"):
1976
+ print_info("⚠️ Telegram has no user allowlist - anyone can use your bot!")
1977
+ if prompt_yes_no("Add allowed users now?", True):
1978
+ print_info(" To find your Telegram user ID: message @userinfobot")
1979
+ allowed_users = prompt("Allowed user IDs (comma-separated)")
1980
+ if allowed_users:
1981
+ save_env_value("TELEGRAM_ALLOWED_USERS", allowed_users.replace(" ", ""))
1982
+ print_success("Telegram allowlist configured")
1983
+ return
1984
+
1985
+ print_info("Create a bot via @BotFather on Telegram")
1986
+ import re
1987
+
1988
+ while True:
1989
+ token = prompt("Telegram bot token", password=True)
1990
+ if not token:
1991
+ return
1992
+ if not re.match(r"^\d+:[A-Za-z0-9_-]{30,}$", token):
1993
+ print_error(
1994
+ "Invalid token format. Expected: <numeric_id>:<alphanumeric_hash> "
1995
+ "(e.g., 123456789:ABCdefGHI-jklMNOpqrSTUvwxYZ)"
1996
+ )
1997
+ continue
1998
+ break
1999
+ save_env_value("TELEGRAM_BOT_TOKEN", token)
2000
+ print_success("Telegram token saved")
2001
+
2002
+ print()
2003
+ print_info("🔒 Security: Restrict who can use your bot")
2004
+ print_info(" To find your Telegram user ID:")
2005
+ print_info(" 1. Message @userinfobot on Telegram")
2006
+ print_info(" 2. It will reply with your numeric ID (e.g., 123456789)")
2007
+ print()
2008
+ allowed_users = prompt(
2009
+ "Allowed user IDs (comma-separated, leave empty for open access)"
2010
+ )
2011
+ if allowed_users:
2012
+ save_env_value("TELEGRAM_ALLOWED_USERS", allowed_users.replace(" ", ""))
2013
+ print_success("Telegram allowlist configured - only listed users can use the bot")
2014
+ else:
2015
+ print_info("⚠️ No allowlist set - anyone who finds your bot can use it!")
2016
+
2017
+ print()
2018
+ print_info("📬 Home Channel: where Hermes delivers cron job results,")
2019
+ print_info(" cross-platform messages, and notifications.")
2020
+ print_info(" For Telegram DMs, this is your user ID (same as above).")
2021
+
2022
+ first_user_id = allowed_users.split(",")[0].strip() if allowed_users else ""
2023
+ if first_user_id:
2024
+ if prompt_yes_no(f"Use your user ID ({first_user_id}) as the home channel?", True):
2025
+ save_env_value("TELEGRAM_HOME_CHANNEL", first_user_id)
2026
+ print_success(f"Telegram home channel set to {first_user_id}")
2027
+ else:
2028
+ home_channel = prompt("Home channel ID (or leave empty to set later with /set-home in Telegram)")
2029
+ if home_channel:
2030
+ save_env_value("TELEGRAM_HOME_CHANNEL", home_channel)
2031
+ else:
2032
+ print_info(" You can also set this later by typing /set-home in your Telegram chat.")
2033
+ home_channel = prompt("Home channel ID (leave empty to set later)")
2034
+ if home_channel:
2035
+ save_env_value("TELEGRAM_HOME_CHANNEL", home_channel)
2036
+
2037
+
2038
+ def _setup_discord():
2039
+ """Configure Discord bot credentials and allowlist."""
2040
+ print_header("Discord")
2041
+ existing = get_env_value("DISCORD_BOT_TOKEN")
2042
+ if existing:
2043
+ print_info("Discord: already configured")
2044
+ if not prompt_yes_no("Reconfigure Discord?", False):
2045
+ if not get_env_value("DISCORD_ALLOWED_USERS"):
2046
+ print_info("⚠️ Discord has no user allowlist - anyone can use your bot!")
2047
+ if prompt_yes_no("Add allowed users now?", True):
2048
+ print_info(" To find Discord ID: Enable Developer Mode, right-click name → Copy ID")
2049
+ allowed_users = prompt("Allowed user IDs (comma-separated)")
2050
+ if allowed_users:
2051
+ cleaned_ids = _clean_discord_user_ids(allowed_users)
2052
+ save_env_value("DISCORD_ALLOWED_USERS", ",".join(cleaned_ids))
2053
+ print_success("Discord allowlist configured")
2054
+ return
2055
+
2056
+ print_info("Create a bot at https://discord.com/developers/applications")
2057
+ token = prompt("Discord bot token", password=True)
2058
+ if not token:
2059
+ return
2060
+ save_env_value("DISCORD_BOT_TOKEN", token)
2061
+ print_success("Discord token saved")
2062
+
2063
+ print()
2064
+ print_info("🔒 Security: Restrict who can use your bot")
2065
+ print_info(" To find your Discord user ID:")
2066
+ print_info(" 1. Enable Developer Mode in Discord settings")
2067
+ print_info(" 2. Right-click your name → Copy ID")
2068
+ print()
2069
+ print_info(" You can also use Discord usernames (resolved on gateway start).")
2070
+ print()
2071
+ allowed_users = prompt(
2072
+ "Allowed user IDs or usernames (comma-separated, leave empty for open access)"
2073
+ )
2074
+ if allowed_users:
2075
+ cleaned_ids = _clean_discord_user_ids(allowed_users)
2076
+ save_env_value("DISCORD_ALLOWED_USERS", ",".join(cleaned_ids))
2077
+ print_success("Discord allowlist configured")
2078
+ else:
2079
+ print_info("⚠️ No allowlist set - anyone in servers with your bot can use it!")
2080
+
2081
+ print()
2082
+ print_info("📬 Home Channel: where Hermes delivers cron job results,")
2083
+ print_info(" cross-platform messages, and notifications.")
2084
+ print_info(" To get a channel ID: right-click a channel → Copy Channel ID")
2085
+ print_info(" (requires Developer Mode in Discord settings)")
2086
+ print_info(" You can also set this later by typing /set-home in a Discord channel.")
2087
+ home_channel = prompt("Home channel ID (leave empty to set later with /set-home)")
2088
+ if home_channel:
2089
+ save_env_value("DISCORD_HOME_CHANNEL", home_channel)
2090
+
2091
+
2092
+ def _clean_discord_user_ids(raw: str) -> list:
2093
+ """Strip common Discord mention prefixes from a comma-separated ID string."""
2094
+ cleaned = []
2095
+ for uid in raw.replace(" ", "").split(","):
2096
+ uid = uid.strip()
2097
+ if uid.startswith("<@") and uid.endswith(">"):
2098
+ uid = uid.lstrip("<@!").rstrip(">")
2099
+ if uid.lower().startswith("user:"):
2100
+ uid = uid[5:]
2101
+ if uid:
2102
+ cleaned.append(uid)
2103
+ return cleaned
2104
+
2105
+
2106
+ def _setup_slack():
2107
+ """Configure Slack bot credentials."""
2108
+ print_header("Slack")
2109
+ existing = get_env_value("SLACK_BOT_TOKEN")
2110
+ if existing:
2111
+ print_info("Slack: already configured")
2112
+ if not prompt_yes_no("Reconfigure Slack?", False):
2113
+ # Even without reconfiguring, offer to refresh the manifest so
2114
+ # new commands (e.g. /btw, /stop, ...) get registered in Slack.
2115
+ if prompt_yes_no(
2116
+ "Regenerate the Slack app manifest with the latest command "
2117
+ "list? (recommended after `hermes update`)",
2118
+ True,
2119
+ ):
2120
+ _write_slack_manifest_and_instruct()
2121
+ return
2122
+
2123
+ print_info("Steps to create a Slack app:")
2124
+ print_info(" 1. Go to https://api.slack.com/apps → Create New App")
2125
+ print_info(" Pick 'From an app manifest' — we'll generate one for you below.")
2126
+ print_info(" 2. Enable Socket Mode: Settings → Socket Mode → Enable")
2127
+ print_info(" • Create an App-Level Token with 'connections:write' scope")
2128
+ print_info(" 3. Install to Workspace: Settings → Install App")
2129
+ print_info(" 4. After installing, invite the bot to channels: /invite @YourBot")
2130
+ print()
2131
+ print_info(" Full guide: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/slack/")
2132
+ print()
2133
+
2134
+ # Generate and write manifest up-front so the user can paste it into
2135
+ # the "Create from manifest" flow instead of clicking through scopes /
2136
+ # events / slash commands one at a time.
2137
+ _write_slack_manifest_and_instruct()
2138
+
2139
+ print()
2140
+ bot_token = prompt("Slack Bot Token (xoxb-...)", password=True)
2141
+ if not bot_token:
2142
+ return
2143
+ save_env_value("SLACK_BOT_TOKEN", bot_token)
2144
+ app_token = prompt("Slack App Token (xapp-...)", password=True)
2145
+ if app_token:
2146
+ save_env_value("SLACK_APP_TOKEN", app_token)
2147
+ print_success("Slack tokens saved")
2148
+
2149
+ print()
2150
+ print_info("🔒 Security: Restrict who can use your bot")
2151
+ print_info(" To find a Member ID: click a user's name → View full profile → ⋮ → Copy member ID")
2152
+ print()
2153
+ allowed_users = prompt(
2154
+ "Allowed user IDs (comma-separated, leave empty to deny everyone except paired users)"
2155
+ )
2156
+ if allowed_users:
2157
+ save_env_value("SLACK_ALLOWED_USERS", allowed_users.replace(" ", ""))
2158
+ print_success("Slack allowlist configured")
2159
+ else:
2160
+ print_warning("⚠️ No Slack allowlist set - unpaired users will be denied by default.")
2161
+ print_info(" Set SLACK_ALLOW_ALL_USERS=true or GATEWAY_ALLOW_ALL_USERS=true only if you intentionally want open workspace access.")
2162
+
2163
+ print()
2164
+ print_info("📬 Home Channel: where Hermes delivers cron job results,")
2165
+ print_info(" cross-platform messages, and notifications.")
2166
+ print_info(" To get a channel ID: open the channel in Slack, then right-click")
2167
+ print_info(" the channel name → Copy link — the ID starts with C (e.g. C01ABC2DE3F).")
2168
+ print_info(" You can also set this later by typing /set-home in a Slack channel.")
2169
+ home_channel = prompt("Home channel ID (leave empty to set later with /set-home)")
2170
+ if home_channel:
2171
+ save_env_value("SLACK_HOME_CHANNEL", home_channel.strip())
2172
+
2173
+
2174
+ def _write_slack_manifest_and_instruct():
2175
+ """Generate the Slack manifest, write it under HERMES_HOME, and print
2176
+ paste-into-Slack instructions.
2177
+
2178
+ Exposed as its own helper so both the initial setup flow and the
2179
+ "reconfigure? → no" branch can refresh the manifest without the user
2180
+ re-entering tokens. Failures are non-fatal — if the manifest write
2181
+ fails for any reason, we print a warning and skip rather than abort
2182
+ the whole Slack setup.
2183
+ """
2184
+ try:
2185
+ from hermes_cli.slack_cli import _build_full_manifest
2186
+ from calvyn_constants import get_hermes_home
2187
+
2188
+ manifest = _build_full_manifest(
2189
+ bot_name="Hermes",
2190
+ bot_description="Your Hermes agent on Slack",
2191
+ )
2192
+ target = Path(get_hermes_home()) / "slack-manifest.json"
2193
+ target.parent.mkdir(parents=True, exist_ok=True)
2194
+ import json as _json
2195
+ target.write_text(
2196
+ _json.dumps(manifest, indent=2, ensure_ascii=False) + "\n",
2197
+ encoding="utf-8",
2198
+ )
2199
+ print_success(f"Slack app manifest written to: {target}")
2200
+ print_info(
2201
+ " Paste it into https://api.slack.com/apps → your app → Features "
2202
+ "→ App Manifest → Edit, then Save. Slack will prompt to "
2203
+ "reinstall if scopes or slash commands changed."
2204
+ )
2205
+ print_info(
2206
+ " Re-run `hermes slack manifest --write` anytime to refresh after "
2207
+ "Hermes adds new commands."
2208
+ )
2209
+ except Exception as exc: # pragma: no cover - best-effort UX helper
2210
+ print_warning(f"Couldn't write Slack manifest: {exc}")
2211
+ print_info(
2212
+ " You can generate it manually later with: "
2213
+ "hermes slack manifest --write"
2214
+ )
2215
+
2216
+
2217
+ def _setup_matrix():
2218
+ """Configure Matrix credentials."""
2219
+ print_header("Matrix")
2220
+ existing = get_env_value("MATRIX_ACCESS_TOKEN") or get_env_value("MATRIX_PASSWORD")
2221
+ if existing:
2222
+ print_info("Matrix: already configured")
2223
+ if not prompt_yes_no("Reconfigure Matrix?", False):
2224
+ return
2225
+
2226
+ print_info("Works with any Matrix homeserver (Synapse, Conduit, Dendrite, or matrix.org).")
2227
+ print_info(" 1. Create a bot user on your homeserver, or use your own account")
2228
+ print_info(" 2. Get an access token from Element, or provide user ID + password")
2229
+ print()
2230
+ homeserver = prompt("Homeserver URL (e.g. https://matrix.example.org)")
2231
+ if homeserver:
2232
+ save_env_value("MATRIX_HOMESERVER", homeserver.rstrip("/"))
2233
+
2234
+ print()
2235
+ print_info("Auth: provide an access token (recommended), or user ID + password.")
2236
+ token = prompt("Access token (leave empty for password login)", password=True)
2237
+ if token:
2238
+ save_env_value("MATRIX_ACCESS_TOKEN", token)
2239
+ user_id = prompt("User ID (@bot:server — optional, will be auto-detected)")
2240
+ if user_id:
2241
+ save_env_value("MATRIX_USER_ID", user_id)
2242
+ print_success("Matrix access token saved")
2243
+ else:
2244
+ user_id = prompt("User ID (@bot:server)")
2245
+ if user_id:
2246
+ save_env_value("MATRIX_USER_ID", user_id)
2247
+ password = prompt("Password", password=True)
2248
+ if password:
2249
+ save_env_value("MATRIX_PASSWORD", password)
2250
+ print_success("Matrix credentials saved")
2251
+
2252
+ if token or get_env_value("MATRIX_PASSWORD"):
2253
+ print()
2254
+ want_e2ee = prompt_yes_no("Enable end-to-end encryption (E2EE)?", False)
2255
+ if want_e2ee:
2256
+ save_env_value("MATRIX_ENCRYPTION", "true")
2257
+ print_success("E2EE enabled")
2258
+
2259
+ matrix_pkg = "mautrix[encryption]" if want_e2ee else "mautrix"
2260
+ try:
2261
+ __import__("mautrix")
2262
+ except ImportError:
2263
+ print_info(f"Installing {matrix_pkg}...")
2264
+ import subprocess
2265
+ uv_bin = shutil.which("uv")
2266
+ if uv_bin:
2267
+ result = subprocess.run(
2268
+ [uv_bin, "pip", "install", "--python", sys.executable, matrix_pkg],
2269
+ capture_output=True, text=True,
2270
+ )
2271
+ else:
2272
+ result = subprocess.run(
2273
+ [sys.executable, "-m", "pip", "install", matrix_pkg],
2274
+ capture_output=True, text=True,
2275
+ )
2276
+ if result.returncode == 0:
2277
+ print_success(f"{matrix_pkg} installed")
2278
+ else:
2279
+ print_warning(f"Install failed — run manually: pip install '{matrix_pkg}'")
2280
+ if result.stderr:
2281
+ print_info(f" Error: {result.stderr.strip().splitlines()[-1]}")
2282
+
2283
+ print()
2284
+ print_info("🔒 Security: Restrict who can use your bot")
2285
+ print_info(" Matrix user IDs look like @username:server")
2286
+ print()
2287
+ allowed_users = prompt("Allowed user IDs (comma-separated, leave empty for open access)")
2288
+ if allowed_users:
2289
+ save_env_value("MATRIX_ALLOWED_USERS", allowed_users.replace(" ", ""))
2290
+ print_success("Matrix allowlist configured")
2291
+ else:
2292
+ print_info("⚠️ No allowlist set - anyone who can message the bot can use it!")
2293
+
2294
+ print()
2295
+ print_info("📬 Home Room: where Hermes delivers cron job results and notifications.")
2296
+ print_info(" Room IDs look like !abc123:server (shown in Element room settings)")
2297
+ print_info(" You can also set this later by typing /set-home in a Matrix room.")
2298
+ home_room = prompt("Home room ID (leave empty to set later with /set-home)")
2299
+ if home_room:
2300
+ save_env_value("MATRIX_HOME_ROOM", home_room)
2301
+
2302
+
2303
+ def _setup_mattermost():
2304
+ """Configure Mattermost bot credentials."""
2305
+ print_header("Mattermost")
2306
+ existing = get_env_value("MATTERMOST_TOKEN")
2307
+ if existing:
2308
+ print_info("Mattermost: already configured")
2309
+ if not prompt_yes_no("Reconfigure Mattermost?", False):
2310
+ return
2311
+
2312
+ print_info("Works with any self-hosted Mattermost instance.")
2313
+ print_info(" 1. In Mattermost: Integrations → Bot Accounts → Add Bot Account")
2314
+ print_info(" 2. Copy the bot token")
2315
+ print()
2316
+ mm_url = prompt("Mattermost server URL (e.g. https://mm.example.com)")
2317
+ if mm_url:
2318
+ save_env_value("MATTERMOST_URL", mm_url.rstrip("/"))
2319
+ token = prompt("Bot token", password=True)
2320
+ if not token:
2321
+ return
2322
+ save_env_value("MATTERMOST_TOKEN", token)
2323
+ print_success("Mattermost token saved")
2324
+
2325
+ print()
2326
+ print_info("🔒 Security: Restrict who can use your bot")
2327
+ print_info(" To find your user ID: click your avatar → Profile")
2328
+ print_info(" or use the API: GET /api/v4/users/me")
2329
+ print()
2330
+ allowed_users = prompt("Allowed user IDs (comma-separated, leave empty for open access)")
2331
+ if allowed_users:
2332
+ save_env_value("MATTERMOST_ALLOWED_USERS", allowed_users.replace(" ", ""))
2333
+ print_success("Mattermost allowlist configured")
2334
+ else:
2335
+ print_info("⚠️ No allowlist set - anyone who can message the bot can use it!")
2336
+
2337
+ print()
2338
+ print_info("📬 Home Channel: where Hermes delivers cron job results and notifications.")
2339
+ print_info(" To get a channel ID: click channel name → View Info → copy the ID")
2340
+ print_info(" You can also set this later by typing /set-home in a Mattermost channel.")
2341
+ home_channel = prompt("Home channel ID (leave empty to set later with /set-home)")
2342
+ if home_channel:
2343
+ save_env_value("MATTERMOST_HOME_CHANNEL", home_channel)
2344
+ print_info(" Open config in your editor: hermes config edit")
2345
+
2346
+
2347
+ def _setup_bluebubbles():
2348
+ """Configure BlueBubbles iMessage gateway."""
2349
+ print_header("BlueBubbles (iMessage)")
2350
+ existing = get_env_value("BLUEBUBBLES_SERVER_URL")
2351
+ if existing:
2352
+ print_info("BlueBubbles: already configured")
2353
+ if not prompt_yes_no("Reconfigure BlueBubbles?", False):
2354
+ return
2355
+
2356
+ print_info("Connects Hermes to iMessage via BlueBubbles — a free, open-source")
2357
+ print_info("macOS server that bridges iMessage to any device.")
2358
+ print_info(" Requires a Mac running BlueBubbles Server v1.0.0+")
2359
+ print_info(" Download: https://bluebubbles.app/")
2360
+ print()
2361
+ print_info("In BlueBubbles Server → Settings → API, note your Server URL and Password.")
2362
+ print()
2363
+
2364
+ server_url = prompt("BlueBubbles server URL (e.g. http://192.168.1.10:1234)")
2365
+ if not server_url:
2366
+ print_warning("Server URL is required — skipping BlueBubbles setup")
2367
+ return
2368
+ save_env_value("BLUEBUBBLES_SERVER_URL", server_url.rstrip("/"))
2369
+
2370
+ password = prompt("BlueBubbles server password", password=True)
2371
+ if not password:
2372
+ print_warning("Password is required — skipping BlueBubbles setup")
2373
+ return
2374
+ save_env_value("BLUEBUBBLES_PASSWORD", password)
2375
+ print_success("BlueBubbles credentials saved")
2376
+
2377
+ print()
2378
+ print_info("🔒 Security: Restrict who can message your bot")
2379
+ print_info(" Use iMessage addresses: email (user@icloud.com) or phone (+15551234567)")
2380
+ print()
2381
+ allowed_users = prompt("Allowed iMessage addresses (comma-separated, leave empty for open access)")
2382
+ if allowed_users:
2383
+ save_env_value("BLUEBUBBLES_ALLOWED_USERS", allowed_users.replace(" ", ""))
2384
+ print_success("BlueBubbles allowlist configured")
2385
+ else:
2386
+ print_info("⚠️ No allowlist set — anyone who can iMessage you can use the bot!")
2387
+
2388
+ print()
2389
+ print_info("📬 Home Channel: phone or email for cron job delivery and notifications.")
2390
+ print_info(" You can also set this later with /set-home in your iMessage chat.")
2391
+ home_channel = prompt("Home channel address (leave empty to set later)")
2392
+ if home_channel:
2393
+ save_env_value("BLUEBUBBLES_HOME_CHANNEL", home_channel)
2394
+
2395
+ print()
2396
+ print_info("Advanced settings (defaults are fine for most setups):")
2397
+ if prompt_yes_no("Configure webhook listener settings?", False):
2398
+ webhook_port = prompt("Webhook listener port (default: 8645)")
2399
+ if webhook_port:
2400
+ try:
2401
+ save_env_value("BLUEBUBBLES_WEBHOOK_PORT", str(int(webhook_port)))
2402
+ print_success(f"Webhook port set to {webhook_port}")
2403
+ except ValueError:
2404
+ print_warning("Invalid port number, using default 8645")
2405
+
2406
+ print()
2407
+ print_info("Requires the BlueBubbles Private API helper for typing indicators,")
2408
+ print_info("read receipts, and tapback reactions. Basic messaging works without it.")
2409
+ print_info(" Install: https://docs.bluebubbles.app/helper-bundle/installation")
2410
+
2411
+
2412
+ def _setup_qqbot():
2413
+ """Configure QQ Bot (Official API v2) via gateway setup."""
2414
+ from hermes_cli.gateway import _setup_qqbot as _gateway_setup_qqbot
2415
+ _gateway_setup_qqbot()
2416
+
2417
+
2418
+ def _setup_webhooks():
2419
+ """Configure webhook integration."""
2420
+ print_header("Webhooks")
2421
+ existing = get_env_value("WEBHOOK_ENABLED")
2422
+ if existing:
2423
+ print_info("Webhooks: already configured")
2424
+ if not prompt_yes_no("Reconfigure webhooks?", False):
2425
+ return
2426
+
2427
+ print()
2428
+ print_warning("⚠ Webhook and SMS platforms require exposing gateway ports to the")
2429
+ print_warning(" internet. For security, run the gateway in a sandboxed environment")
2430
+ print_warning(" (Docker, VM, etc.) to limit blast radius from prompt injection.")
2431
+ print()
2432
+ print_info(" Full guide: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/webhooks/")
2433
+ print()
2434
+
2435
+ port = prompt("Webhook port (default 8644)")
2436
+ if port:
2437
+ try:
2438
+ save_env_value("WEBHOOK_PORT", str(int(port)))
2439
+ print_success(f"Webhook port set to {port}")
2440
+ except ValueError:
2441
+ print_warning("Invalid port number, using default 8644")
2442
+
2443
+ secret = prompt("Global HMAC secret (shared across all routes)", password=True)
2444
+ if secret:
2445
+ save_env_value("WEBHOOK_SECRET", secret)
2446
+ print_success("Webhook secret saved")
2447
+ else:
2448
+ print_warning("No secret set — you must configure per-route secrets in config.yaml")
2449
+
2450
+ save_env_value("WEBHOOK_ENABLED", "true")
2451
+ print()
2452
+ print_success("Webhooks enabled! Next steps:")
2453
+ from calvyn_constants import display_hermes_home as _dhh
2454
+ print_info(f" 1. Define webhook routes in {_dhh()}/config.yaml")
2455
+ print_info(" 2. Point your service (GitHub, GitLab, etc.) at:")
2456
+ print_info(" http://your-server:8644/webhooks/<route-name>")
2457
+ print()
2458
+ print_info(" Route configuration guide:")
2459
+ print_info(" https://hermes-agent.nousresearch.com/docs/user-guide/messaging/webhooks/#configuring-routes")
2460
+ print()
2461
+ print_info(" Open config in your editor: hermes config edit")
2462
+ print_info(" Open config in your editor: hermes config edit")
2463
+
2464
+
2465
+ def setup_gateway(config: dict):
2466
+ """Configure messaging platform integrations."""
2467
+ from hermes_cli.gateway import _all_platforms, _platform_status, _configure_platform
2468
+
2469
+ print_header("Messaging Platforms")
2470
+ print_info("Connect to messaging platforms to chat with Hermes from anywhere.")
2471
+ print_info("Toggle with Space, confirm with Enter.")
2472
+ print()
2473
+
2474
+ platforms = _all_platforms()
2475
+
2476
+ # Build checklist, pre-selecting already-configured platforms.
2477
+ items = []
2478
+ pre_selected = []
2479
+ for i, plat in enumerate(platforms):
2480
+ status = _platform_status(plat)
2481
+ items.append(f"{plat['emoji']} {plat['label']} ({status})")
2482
+ if status == "configured":
2483
+ pre_selected.append(i)
2484
+
2485
+ selected = prompt_checklist("Select platforms to configure:", items, pre_selected)
2486
+
2487
+ if not selected:
2488
+ print_info("No platforms selected. Run 'hermes setup gateway' later to configure.")
2489
+ return
2490
+
2491
+ for idx in selected:
2492
+ _configure_platform(platforms[idx])
2493
+
2494
+ # ── Gateway Service Setup ──
2495
+ # Count any platform (built-in or plugin) the user configured during this
2496
+ # setup pass — reuses ``_platform_status`` so plugin platforms like IRC
2497
+ # are picked up without another hard-coded env-var list.
2498
+ def _is_progress(status: str) -> bool:
2499
+ s = status.lower()
2500
+ return not (
2501
+ s == "not configured"
2502
+ or s.startswith("partially")
2503
+ or s.startswith("plugin disabled")
2504
+ )
2505
+
2506
+ any_messaging = any(
2507
+ _is_progress(_platform_status(p)) for p in _all_platforms()
2508
+ )
2509
+ if any_messaging:
2510
+ print()
2511
+ print_info("━" * 50)
2512
+ print_success("Messaging platforms configured!")
2513
+
2514
+ # Check if any home channels are missing
2515
+ missing_home = []
2516
+ if get_env_value("TELEGRAM_BOT_TOKEN") and not get_env_value(
2517
+ "TELEGRAM_HOME_CHANNEL"
2518
+ ):
2519
+ missing_home.append("Telegram")
2520
+ if get_env_value("DISCORD_BOT_TOKEN") and not get_env_value(
2521
+ "DISCORD_HOME_CHANNEL"
2522
+ ):
2523
+ missing_home.append("Discord")
2524
+ if get_env_value("SLACK_BOT_TOKEN") and not get_env_value("SLACK_HOME_CHANNEL"):
2525
+ missing_home.append("Slack")
2526
+ if get_env_value("BLUEBUBBLES_SERVER_URL") and not get_env_value("BLUEBUBBLES_HOME_CHANNEL"):
2527
+ missing_home.append("BlueBubbles")
2528
+ if get_env_value("QQ_APP_ID") and not (
2529
+ get_env_value("QQBOT_HOME_CHANNEL") or get_env_value("QQ_HOME_CHANNEL")
2530
+ ):
2531
+ missing_home.append("QQBot")
2532
+
2533
+ if missing_home:
2534
+ print()
2535
+ print_warning(f"No home channel set for: {', '.join(missing_home)}")
2536
+ print_info(" Without a home channel, cron jobs and cross-platform")
2537
+ print_info(" messages can't be delivered to those platforms.")
2538
+ print_info(" Set one later with /set-home in your chat, or:")
2539
+ for plat in missing_home:
2540
+ print_info(
2541
+ f" hermes config set {plat.upper()}_HOME_CHANNEL <channel_id>"
2542
+ )
2543
+
2544
+ # Offer to install the gateway as a system service
2545
+ import platform as _platform
2546
+
2547
+ _is_linux = _platform.system() == "Linux"
2548
+ _is_macos = _platform.system() == "Darwin"
2549
+ _is_windows = _platform.system() == "Windows"
2550
+
2551
+ from hermes_cli.gateway import (
2552
+ _is_service_installed,
2553
+ _is_service_running,
2554
+ supports_systemd_services,
2555
+ has_conflicting_systemd_units,
2556
+ has_legacy_hermes_units,
2557
+ install_linux_gateway_from_setup,
2558
+ print_systemd_scope_conflict_warning,
2559
+ print_legacy_unit_warning,
2560
+ systemd_start,
2561
+ systemd_restart,
2562
+ launchd_install,
2563
+ launchd_start,
2564
+ launchd_restart,
2565
+ UserSystemdUnavailableError,
2566
+ SystemScopeRequiresRootError,
2567
+ _system_scope_wizard_would_need_root,
2568
+ _print_system_scope_remediation,
2569
+ )
2570
+
2571
+ service_installed = _is_service_installed()
2572
+ service_running = _is_service_running()
2573
+ supports_systemd = supports_systemd_services()
2574
+ supports_service_manager = supports_systemd or _is_macos or _is_windows
2575
+
2576
+ print()
2577
+ if supports_systemd and has_conflicting_systemd_units():
2578
+ print_systemd_scope_conflict_warning()
2579
+ print()
2580
+
2581
+ if supports_systemd and has_legacy_hermes_units():
2582
+ print_legacy_unit_warning()
2583
+ print()
2584
+
2585
+ if service_running:
2586
+ if supports_systemd and _system_scope_wizard_would_need_root():
2587
+ _print_system_scope_remediation("restart")
2588
+ elif prompt_yes_no(" Restart the gateway to pick up changes?", True):
2589
+ try:
2590
+ if supports_systemd:
2591
+ systemd_restart()
2592
+ elif _is_macos:
2593
+ launchd_restart()
2594
+ elif _is_windows:
2595
+ from hermes_cli import gateway_windows
2596
+ gateway_windows.restart()
2597
+ except UserSystemdUnavailableError as e:
2598
+ print_error(" Restart failed — user systemd not reachable:")
2599
+ for line in str(e).splitlines():
2600
+ print(f" {line}")
2601
+ except SystemScopeRequiresRootError as e:
2602
+ # Defense in depth: the pre-check above should have
2603
+ # caught this, but a race (unit file appearing mid-run)
2604
+ # could still land here. Previously this exited the
2605
+ # whole wizard via sys.exit(1).
2606
+ print_error(f" Restart failed: {e}")
2607
+ _print_system_scope_remediation("restart")
2608
+ except Exception as e:
2609
+ print_error(f" Restart failed: {e}")
2610
+ elif service_installed:
2611
+ if supports_systemd and _system_scope_wizard_would_need_root():
2612
+ _print_system_scope_remediation("start")
2613
+ elif prompt_yes_no(" Start the gateway service?", True):
2614
+ try:
2615
+ if supports_systemd:
2616
+ systemd_start()
2617
+ elif _is_macos:
2618
+ launchd_start()
2619
+ elif _is_windows:
2620
+ from hermes_cli import gateway_windows
2621
+ gateway_windows.start()
2622
+ except UserSystemdUnavailableError as e:
2623
+ print_error(" Start failed — user systemd not reachable:")
2624
+ for line in str(e).splitlines():
2625
+ print(f" {line}")
2626
+ except SystemScopeRequiresRootError as e:
2627
+ print_error(f" Start failed: {e}")
2628
+ _print_system_scope_remediation("start")
2629
+ except Exception as e:
2630
+ print_error(f" Start failed: {e}")
2631
+ elif supports_service_manager:
2632
+ if supports_systemd:
2633
+ svc_name = "systemd"
2634
+ elif _is_macos:
2635
+ svc_name = "launchd"
2636
+ else:
2637
+ svc_name = "Scheduled Task"
2638
+ if prompt_yes_no(
2639
+ f" Install the gateway as a {svc_name} service? (runs in background, starts on boot)",
2640
+ True,
2641
+ ):
2642
+ try:
2643
+ installed_scope = None
2644
+ did_install = False
2645
+ started_inline = False
2646
+ if supports_systemd:
2647
+ installed_scope, did_install = install_linux_gateway_from_setup(force=False)
2648
+ elif _is_macos:
2649
+ launchd_install(force=False)
2650
+ did_install = True
2651
+ else:
2652
+ # gateway_windows.install() registers the Scheduled
2653
+ # Task AND starts it immediately (via schtasks /Run
2654
+ # or a direct spawn fallback), so no separate start
2655
+ # prompt is needed here.
2656
+ from hermes_cli import gateway_windows
2657
+ gateway_windows.install(force=False)
2658
+ did_install = True
2659
+ started_inline = True
2660
+ print()
2661
+ if did_install and not started_inline and prompt_yes_no(" Start the service now?", True):
2662
+ try:
2663
+ if supports_systemd:
2664
+ systemd_start(system=installed_scope == "system")
2665
+ elif _is_macos:
2666
+ launchd_start()
2667
+ except UserSystemdUnavailableError as e:
2668
+ print_error(" Start failed — user systemd not reachable:")
2669
+ for line in str(e).splitlines():
2670
+ print(f" {line}")
2671
+ except SystemScopeRequiresRootError as e:
2672
+ print_error(f" Start failed: {e}")
2673
+ _print_system_scope_remediation("start")
2674
+ except Exception as e:
2675
+ print_error(f" Start failed: {e}")
2676
+ except Exception as e:
2677
+ print_error(f" Install failed: {e}")
2678
+ print_info(" You can try manually: hermes gateway install")
2679
+ else:
2680
+ print_info(" You can install later: hermes gateway install")
2681
+ if supports_systemd:
2682
+ print_info(" Or as a boot-time service: sudo hermes gateway install --system")
2683
+ print_info(" Or run in foreground: hermes gateway")
2684
+ else:
2685
+ from calvyn_constants import is_container
2686
+ if is_container():
2687
+ print_info("Start the gateway to bring your bots online:")
2688
+ print_info(" hermes gateway run # Run as container main process")
2689
+ print_info("")
2690
+ print_info("For automatic restarts, use a Docker restart policy:")
2691
+ print_info(" docker run --restart unless-stopped ...")
2692
+ print_info(" docker restart <container> # Manual restart")
2693
+ else:
2694
+ print_info("Start the gateway to bring your bots online:")
2695
+ print_info(" hermes gateway # Run in foreground")
2696
+
2697
+ print_info("━" * 50)
2698
+
2699
+
2700
+ # =============================================================================
2701
+ # Section 5: Tool Configuration (delegates to unified tools_config.py)
2702
+ # =============================================================================
2703
+
2704
+
2705
+ def setup_tools(config: dict, first_install: bool = False):
2706
+ """Configure tools — delegates to the unified tools_command() in tools_config.py.
2707
+
2708
+ Both `hermes setup tools` and `hermes tools` use the same flow:
2709
+ platform selection → toolset toggles → provider/API key configuration.
2710
+
2711
+ Args:
2712
+ first_install: When True, uses the simplified first-install flow
2713
+ (no platform menu, prompts for all unconfigured API keys).
2714
+ """
2715
+ from hermes_cli.tools_config import tools_command
2716
+
2717
+ tools_command(first_install=first_install, config=config)
2718
+
2719
+
2720
+ # =============================================================================
2721
+ # Post-Migration Section Skip Logic
2722
+ # =============================================================================
2723
+
2724
+
2725
+ def _model_section_has_credentials(config: dict) -> bool:
2726
+ """Return True when any known inference provider has usable credentials.
2727
+
2728
+ Sources of truth:
2729
+ * ``PROVIDER_REGISTRY`` in ``hermes_cli.auth`` — lists every supported
2730
+ provider along with its ``api_key_env_vars``.
2731
+ * ``active_provider`` in the auth store — covers OAuth device-code /
2732
+ external-OAuth providers (Nous, Codex, Qwen, Gemini CLI, ...).
2733
+ * The legacy OpenRouter aggregator env vars, which route generic
2734
+ ``OPENAI_API_KEY`` / ``OPENROUTER_API_KEY`` values through OpenRouter.
2735
+ """
2736
+ try:
2737
+ from hermes_cli.auth import get_active_provider
2738
+ if get_active_provider():
2739
+ return True
2740
+ except Exception:
2741
+ pass
2742
+
2743
+ try:
2744
+ from hermes_cli.auth import PROVIDER_REGISTRY
2745
+ except Exception:
2746
+ PROVIDER_REGISTRY = {} # type: ignore[assignment]
2747
+
2748
+ def _has_key(pconfig) -> bool:
2749
+ for env_var in pconfig.api_key_env_vars:
2750
+ # CLAUDE_CODE_OAUTH_TOKEN is set by Claude Code itself, not by
2751
+ # the user — mirrors is_provider_explicitly_configured in auth.py.
2752
+ if env_var == "CLAUDE_CODE_OAUTH_TOKEN":
2753
+ continue
2754
+ if get_env_value(env_var):
2755
+ return True
2756
+ return False
2757
+
2758
+ # Prefer the provider declared in config.yaml, avoids false positives
2759
+ # from stray env vars (GH_TOKEN, etc.) when the user has already picked
2760
+ # a different provider.
2761
+ model_cfg = config.get("model") if isinstance(config, dict) else None
2762
+ if isinstance(model_cfg, dict):
2763
+ provider_id = (model_cfg.get("provider") or "").strip().lower()
2764
+ if provider_id in PROVIDER_REGISTRY:
2765
+ if _has_key(PROVIDER_REGISTRY[provider_id]):
2766
+ return True
2767
+ if provider_id == "openrouter":
2768
+ for env_var in ("OPENROUTER_API_KEY", "OPENAI_API_KEY"):
2769
+ if get_env_value(env_var):
2770
+ return True
2771
+
2772
+ # OpenRouter aggregator fallback (no provider declared in config).
2773
+ for env_var in ("OPENROUTER_API_KEY", "OPENAI_API_KEY"):
2774
+ if get_env_value(env_var):
2775
+ return True
2776
+
2777
+ for pid, pconfig in PROVIDER_REGISTRY.items():
2778
+ # Skip copilot in auto-detect: GH_TOKEN / GITHUB_TOKEN are
2779
+ # commonly set for git tooling. Mirrors resolve_provider in auth.py.
2780
+ if pid == "copilot":
2781
+ continue
2782
+ if _has_key(pconfig):
2783
+ return True
2784
+ return False
2785
+
2786
+
2787
+ def _gateway_platform_short_label(label: str) -> str:
2788
+ """Strip trailing parenthetical qualifiers from a gateway platform label."""
2789
+ base = label.split("(", 1)[0].strip()
2790
+ return base or label
2791
+
2792
+
2793
+ def _get_section_config_summary(config: dict, section_key: str) -> Optional[str]:
2794
+ """Return a short summary if a setup section is already configured, else None.
2795
+
2796
+ Used after OpenClaw migration to detect which sections can be skipped.
2797
+ ``get_env_value`` is the module-level import from hermes_cli.config
2798
+ so that test patches on ``setup_mod.get_env_value`` take effect.
2799
+ """
2800
+ if section_key == "model":
2801
+ if not _model_section_has_credentials(config):
2802
+ return None
2803
+ model = config.get("model")
2804
+ if isinstance(model, str) and model.strip():
2805
+ return model.strip()
2806
+ if isinstance(model, dict):
2807
+ return str(model.get("default") or model.get("model") or "configured")
2808
+ return "configured"
2809
+
2810
+ elif section_key == "terminal":
2811
+ backend = cfg_get(config, "terminal", "backend", default="local")
2812
+ return f"backend: {backend}"
2813
+
2814
+ elif section_key == "agent":
2815
+ max_turns = cfg_get(config, "agent", "max_turns", default=90)
2816
+ return f"max turns: {max_turns}"
2817
+
2818
+ elif section_key == "gateway":
2819
+ from hermes_cli.gateway import _all_platforms, _platform_status
2820
+ # Count any non-empty status other than the "not configured" sentinel —
2821
+ # platforms like WhatsApp ("enabled, not paired"), Matrix ("configured
2822
+ # + E2EE"), and Signal ("partially configured") all indicate the user
2823
+ # has already started setup and we shouldn't force the section to rerun.
2824
+ configured = [
2825
+ _gateway_platform_short_label(plat["label"])
2826
+ for plat in _all_platforms()
2827
+ if _platform_status(plat) and _platform_status(plat) != "not configured"
2828
+ ]
2829
+ if configured:
2830
+ return ", ".join(configured)
2831
+ return None # No platforms configured — section must run
2832
+
2833
+ elif section_key == "tools":
2834
+ tools = []
2835
+ if get_env_value("ELEVENLABS_API_KEY"):
2836
+ tools.append("TTS/ElevenLabs")
2837
+ if get_env_value("BROWSERBASE_API_KEY"):
2838
+ tools.append("Browser")
2839
+ if get_env_value("FIRECRAWL_API_KEY"):
2840
+ tools.append("Firecrawl")
2841
+ if tools:
2842
+ return ", ".join(tools)
2843
+ return None
2844
+
2845
+ return None
2846
+
2847
+
2848
+ def _skip_configured_section(
2849
+ config: dict, section_key: str, label: str
2850
+ ) -> bool:
2851
+ """Show an already-configured section summary and offer to skip.
2852
+
2853
+ Returns True if the user chose to skip, False if the section should run.
2854
+ """
2855
+ summary = _get_section_config_summary(config, section_key)
2856
+ if not summary:
2857
+ return False
2858
+ print()
2859
+ print_success(f" {label}: {summary}")
2860
+ return not prompt_yes_no(f" Reconfigure {label.lower()}?", default=False)
2861
+
2862
+
2863
+ # =============================================================================
2864
+ # OpenClaw Migration
2865
+ # =============================================================================
2866
+
2867
+
2868
+ _OPENCLAW_SCRIPT = (
2869
+ get_optional_skills_dir(PROJECT_ROOT / "optional-skills")
2870
+ / "migration"
2871
+ / "openclaw-migration"
2872
+ / "scripts"
2873
+ / "openclaw_to_hermes.py"
2874
+ )
2875
+
2876
+
2877
+ def _load_openclaw_migration_module():
2878
+ """Load the openclaw_to_hermes migration script as a module.
2879
+
2880
+ Returns the loaded module, or None if the script can't be loaded.
2881
+ """
2882
+ if not _OPENCLAW_SCRIPT.exists():
2883
+ return None
2884
+
2885
+ spec = importlib.util.spec_from_file_location(
2886
+ "openclaw_to_hermes", _OPENCLAW_SCRIPT
2887
+ )
2888
+ if spec is None or spec.loader is None:
2889
+ return None
2890
+
2891
+ mod = importlib.util.module_from_spec(spec)
2892
+ # Register in sys.modules so @dataclass can resolve the module
2893
+ # (Python 3.11+ requires this for dynamically loaded modules)
2894
+ import sys as _sys
2895
+ _sys.modules[spec.name] = mod
2896
+ try:
2897
+ spec.loader.exec_module(mod)
2898
+ except Exception:
2899
+ _sys.modules.pop(spec.name, None)
2900
+ raise
2901
+ return mod
2902
+
2903
+
2904
+ # Item kinds that represent high-impact changes warranting explicit warnings.
2905
+ # Gateway tokens/channels can hijack messaging platforms from the old agent.
2906
+ # Config values may have different semantics between OpenClaw and Hermes.
2907
+ # Instruction/context files (.md) can contain incompatible setup procedures.
2908
+ _HIGH_IMPACT_KIND_KEYWORDS = {
2909
+ "gateway": "⚠ Gateway/messaging — this will configure Hermes to use your OpenClaw messaging channels",
2910
+ "telegram": "⚠ Telegram — this will point Hermes at your OpenClaw Telegram bot",
2911
+ "slack": "⚠ Slack — this will point Hermes at your OpenClaw Slack workspace",
2912
+ "discord": "⚠ Discord — this will point Hermes at your OpenClaw Discord bot",
2913
+ "whatsapp": "⚠ WhatsApp — this will point Hermes at your OpenClaw WhatsApp connection",
2914
+ "config": "⚠ Config values — OpenClaw settings may not map 1:1 to Hermes equivalents",
2915
+ "soul": "⚠ Instruction file — may contain OpenClaw-specific setup/restart procedures",
2916
+ "memory": "⚠ Memory/context file — may reference OpenClaw-specific infrastructure",
2917
+ "context": "⚠ Context file — may contain OpenClaw-specific instructions",
2918
+ }
2919
+
2920
+
2921
+ def _print_migration_preview(report: dict):
2922
+ """Print a detailed dry-run preview of what migration would do.
2923
+
2924
+ Groups items by category and adds explicit warnings for high-impact
2925
+ changes like gateway token takeover and config value differences.
2926
+ """
2927
+ items = report.get("items", [])
2928
+ if not items:
2929
+ print_info("Nothing to migrate.")
2930
+ return
2931
+
2932
+ migrated_items = [i for i in items if i.get("status") == "migrated"]
2933
+ conflict_items = [i for i in items if i.get("status") == "conflict"]
2934
+ skipped_items = [i for i in items if i.get("status") == "skipped"]
2935
+
2936
+ warnings_shown = set()
2937
+
2938
+ if migrated_items:
2939
+ print(color(" Would import:", Colors.GREEN))
2940
+ for item in migrated_items:
2941
+ kind = item.get("kind", "unknown")
2942
+ dest = item.get("destination", "")
2943
+ if dest:
2944
+ dest_short = str(dest).replace(str(Path.home()), "~")
2945
+ print(f" {kind:<22s} → {dest_short}")
2946
+ else:
2947
+ print(f" {kind}")
2948
+
2949
+ # Check for high-impact items and collect warnings
2950
+ kind_lower = kind.lower()
2951
+ dest_lower = str(dest).lower()
2952
+ for keyword, warning in _HIGH_IMPACT_KIND_KEYWORDS.items():
2953
+ if keyword in kind_lower or keyword in dest_lower:
2954
+ warnings_shown.add(warning)
2955
+ print()
2956
+
2957
+ if conflict_items:
2958
+ print(color(" Would overwrite (conflicts with existing Hermes config):", Colors.YELLOW))
2959
+ for item in conflict_items:
2960
+ kind = item.get("kind", "unknown")
2961
+ reason = item.get("reason", "already exists")
2962
+ print(f" {kind:<22s} {reason}")
2963
+ print()
2964
+
2965
+ if skipped_items:
2966
+ print(color(" Would skip:", Colors.DIM))
2967
+ for item in skipped_items:
2968
+ kind = item.get("kind", "unknown")
2969
+ reason = item.get("reason", "")
2970
+ print(f" {kind:<22s} {reason}")
2971
+ print()
2972
+
2973
+ # Print collected warnings
2974
+ if warnings_shown:
2975
+ print(color(" ── Warnings ──", Colors.YELLOW))
2976
+ for warning in sorted(warnings_shown):
2977
+ print(color(f" {warning}", Colors.YELLOW))
2978
+ print()
2979
+ print(color(" Note: OpenClaw config values may have different semantics in Hermes.", Colors.YELLOW))
2980
+ print(color(" For example, OpenClaw's tool_call_execution: \"auto\" ≠ Hermes's yolo mode.", Colors.YELLOW))
2981
+ print(color(" Instruction files (.md) from OpenClaw may contain incompatible procedures.", Colors.YELLOW))
2982
+ print()
2983
+
2984
+
2985
+ def _offer_openclaw_migration(hermes_home: Path) -> bool:
2986
+ """Detect ~/.openclaw and offer to migrate during first-time setup.
2987
+
2988
+ Runs a dry-run first to show the user exactly what would be imported,
2989
+ overwritten, or taken over. Only executes after explicit confirmation.
2990
+
2991
+ Returns True if migration ran successfully, False otherwise.
2992
+ """
2993
+ openclaw_dir = Path.home() / ".openclaw"
2994
+ if not openclaw_dir.is_dir():
2995
+ return False
2996
+
2997
+ if not _OPENCLAW_SCRIPT.exists():
2998
+ return False
2999
+
3000
+ print()
3001
+ print_header("OpenClaw Installation Detected")
3002
+ print_info(f"Found OpenClaw data at {openclaw_dir}")
3003
+ print_info("Hermes can preview what would be imported before making any changes.")
3004
+ print()
3005
+
3006
+ if not prompt_yes_no("Would you like to see what can be imported?", default=True):
3007
+ print_info(
3008
+ "Skipping migration. You can run it later with: hermes claw migrate --dry-run"
3009
+ )
3010
+ return False
3011
+
3012
+ # Ensure config.yaml exists before migration tries to read it
3013
+ config_path = get_config_path()
3014
+ if not config_path.exists():
3015
+ save_config(load_config())
3016
+
3017
+ # Load the migration module
3018
+ try:
3019
+ mod = _load_openclaw_migration_module()
3020
+ if mod is None:
3021
+ print_warning("Could not load migration script.")
3022
+ return False
3023
+ except Exception as e:
3024
+ print_warning(f"Could not load migration script: {e}")
3025
+ logger.debug("OpenClaw migration module load error", exc_info=True)
3026
+ return False
3027
+
3028
+ # ── Phase 1: Dry-run preview ──
3029
+ try:
3030
+ selected = mod.resolve_selected_options(None, None, preset="full")
3031
+ dry_migrator = mod.Migrator(
3032
+ source_root=openclaw_dir.resolve(),
3033
+ target_root=hermes_home.resolve(),
3034
+ execute=False, # dry-run — no files modified
3035
+ workspace_target=None,
3036
+ overwrite=True, # show everything including conflicts
3037
+ migrate_secrets=True,
3038
+ output_dir=None,
3039
+ selected_options=selected,
3040
+ preset_name="full",
3041
+ )
3042
+ preview_report = dry_migrator.migrate()
3043
+ except Exception as e:
3044
+ print_warning(f"Migration preview failed: {e}")
3045
+ logger.debug("OpenClaw migration preview error", exc_info=True)
3046
+ return False
3047
+
3048
+ # Display the full preview
3049
+ preview_summary = preview_report.get("summary", {})
3050
+ preview_count = preview_summary.get("migrated", 0)
3051
+
3052
+ if preview_count == 0:
3053
+ print()
3054
+ print_info("Nothing to import from OpenClaw.")
3055
+ return False
3056
+
3057
+ print()
3058
+ print_header(f"Migration Preview — {preview_count} item(s) would be imported")
3059
+ print_info("No changes have been made yet. Review the list below:")
3060
+ print()
3061
+ _print_migration_preview(preview_report)
3062
+
3063
+ # ── Phase 2: Confirm and execute ──
3064
+ if not prompt_yes_no("Proceed with migration?", default=False):
3065
+ print_info(
3066
+ "Migration cancelled. You can run it later with: hermes claw migrate"
3067
+ )
3068
+ print_info(
3069
+ "Use --dry-run to preview again, or --preset minimal for a lighter import."
3070
+ )
3071
+ return False
3072
+
3073
+ # Execute the migration — overwrite=False so existing Hermes configs are
3074
+ # preserved. The user saw the preview; conflicts are skipped by default.
3075
+ try:
3076
+ migrator = mod.Migrator(
3077
+ source_root=openclaw_dir.resolve(),
3078
+ target_root=hermes_home.resolve(),
3079
+ execute=True,
3080
+ workspace_target=None,
3081
+ overwrite=False, # preserve existing Hermes config
3082
+ migrate_secrets=True,
3083
+ output_dir=None,
3084
+ selected_options=selected,
3085
+ preset_name="full",
3086
+ )
3087
+ report = migrator.migrate()
3088
+ except Exception as e:
3089
+ print_warning(f"Migration failed: {e}")
3090
+ logger.debug("OpenClaw migration error", exc_info=True)
3091
+ return False
3092
+
3093
+ # Print final summary
3094
+ summary = report.get("summary", {})
3095
+ migrated = summary.get("migrated", 0)
3096
+ skipped = summary.get("skipped", 0)
3097
+ conflicts = summary.get("conflict", 0)
3098
+ errors = summary.get("error", 0)
3099
+
3100
+ print()
3101
+ if migrated:
3102
+ print_success(f"Imported {migrated} item(s) from OpenClaw.")
3103
+ if conflicts:
3104
+ print_info(f"Skipped {conflicts} item(s) that already exist in Hermes (use hermes claw migrate --overwrite to force).")
3105
+ if skipped:
3106
+ print_info(f"Skipped {skipped} item(s) (not found or unchanged).")
3107
+ if errors:
3108
+ print_warning(f"{errors} item(s) had errors — check the migration report.")
3109
+
3110
+ output_dir = report.get("output_dir")
3111
+ if output_dir:
3112
+ print_info(f"Full report saved to: {output_dir}")
3113
+
3114
+ print_success("Migration complete! Continuing with setup...")
3115
+ return True
3116
+
3117
+
3118
+ # =============================================================================
3119
+ # Main Wizard Orchestrator
3120
+ # =============================================================================
3121
+
3122
+ SETUP_SECTIONS = [
3123
+ ("model", "Model & Provider", setup_model_provider),
3124
+ ("tts", "Text-to-Speech", setup_tts),
3125
+ ("terminal", "Terminal Backend", setup_terminal_backend),
3126
+ ("gateway", "Messaging Platforms (Gateway)", setup_gateway),
3127
+ ("tools", "Tools", setup_tools),
3128
+ ("agent", "Agent Settings", setup_agent_settings),
3129
+ ]
3130
+
3131
+
3132
+ def run_setup_wizard(args):
3133
+ """Run the interactive setup wizard.
3134
+
3135
+ Supports full, quick, and section-specific setup:
3136
+ hermes setup — full or quick (auto-detected)
3137
+ hermes setup model — just model/provider
3138
+ hermes setup tts — just text-to-speech
3139
+ hermes setup terminal — just terminal backend
3140
+ hermes setup gateway — just messaging platforms
3141
+ hermes setup tools — just tool configuration
3142
+ hermes setup agent — just agent settings
3143
+ """
3144
+ from hermes_cli.config import is_managed, managed_error
3145
+ if is_managed():
3146
+ managed_error("run setup wizard")
3147
+ return
3148
+ ensure_hermes_home()
3149
+
3150
+ reset_requested = bool(getattr(args, "reset", False))
3151
+ if reset_requested:
3152
+ save_config(copy.deepcopy(DEFAULT_CONFIG))
3153
+ print_success("Configuration reset to defaults.")
3154
+
3155
+ reconfigure_requested = bool(getattr(args, "reconfigure", False))
3156
+ quick_requested = bool(getattr(args, "quick", False))
3157
+
3158
+ config = load_config()
3159
+ hermes_home = get_hermes_home()
3160
+
3161
+ # Back up existing config before setup modifies it (#3522)
3162
+ config_path = get_config_path()
3163
+ if config_path.exists():
3164
+ from datetime import datetime as _dt
3165
+ _backup_path = config_path.with_suffix(
3166
+ f".yaml.bak.{_dt.now().strftime('%Y%m%d_%H%M%S')}"
3167
+ )
3168
+ try:
3169
+ import shutil
3170
+ shutil.copy2(config_path, _backup_path)
3171
+ except Exception:
3172
+ _backup_path = None
3173
+ else:
3174
+ _backup_path = None
3175
+
3176
+ # Detect non-interactive environments (headless SSH, Docker, CI/CD)
3177
+ non_interactive = getattr(args, 'non_interactive', False)
3178
+ if not non_interactive and not is_interactive_stdin():
3179
+ non_interactive = True
3180
+
3181
+ if non_interactive:
3182
+ print_noninteractive_setup_guidance(
3183
+ "Running in a non-interactive environment (no TTY detected)."
3184
+ )
3185
+ return
3186
+
3187
+ # Check if a specific section was requested
3188
+ section = getattr(args, "section", None)
3189
+ if section:
3190
+ for key, label, func in SETUP_SECTIONS:
3191
+ if key == section:
3192
+ print()
3193
+ print(
3194
+ color(
3195
+ "┌─────────────────────────────────────────────────────────┐",
3196
+ Colors.MAGENTA,
3197
+ )
3198
+ )
3199
+ print(color(f"│ ✦ Calvyn Code Setup — {label:<30s} │", Colors.MAGENTA))
3200
+ print(
3201
+ color(
3202
+ "└─────────────────────────────────────────────────────────┘",
3203
+ Colors.MAGENTA,
3204
+ )
3205
+ )
3206
+ func(config)
3207
+ save_config(config)
3208
+ print()
3209
+ print_success(f"{label} configuration complete!")
3210
+ return
3211
+
3212
+ print_error(f"Unknown setup section: {section}")
3213
+ print_info(f"Available sections: {', '.join(k for k, _, _ in SETUP_SECTIONS)}")
3214
+ return
3215
+
3216
+ # Check if this is an existing installation with a provider configured
3217
+ from hermes_cli.auth import get_active_provider
3218
+
3219
+ active_provider = get_active_provider()
3220
+ is_existing = (
3221
+ bool(get_env_value("OPENROUTER_API_KEY"))
3222
+ or bool(get_env_value("OPENAI_BASE_URL"))
3223
+ or active_provider is not None
3224
+ )
3225
+
3226
+ print()
3227
+ print(
3228
+ color(
3229
+ "┌─────────────────────────────────────────────────────────┐",
3230
+ Colors.MAGENTA,
3231
+ )
3232
+ )
3233
+ print(
3234
+ color(
3235
+ "│ ✦ Calvyn Code Setup Wizard │", Colors.MAGENTA
3236
+ )
3237
+ )
3238
+ print(
3239
+ color(
3240
+ "├─────────────────────────────────────────────────────────┤",
3241
+ Colors.MAGENTA,
3242
+ )
3243
+ )
3244
+ print(
3245
+ color(
3246
+ "│ Let's configure your Calvyn Code installation. │", Colors.MAGENTA
3247
+ )
3248
+ )
3249
+ print(
3250
+ color(
3251
+ "│ Press Ctrl+C at any time to exit. │", Colors.MAGENTA
3252
+ )
3253
+ )
3254
+ print(
3255
+ color(
3256
+ "└─────────────────────────────────────────────────────────┘",
3257
+ Colors.MAGENTA,
3258
+ )
3259
+ )
3260
+
3261
+ migration_ran = False
3262
+
3263
+ if is_existing:
3264
+ # Existing install — default is the full-wizard reconfigure flow.
3265
+ # Every prompt shows the current value as its default, so pressing
3266
+ # Enter keeps it. Opt into `--quick` for the narrow "just fill in
3267
+ # missing items" flow (useful after a partial OpenClaw migration
3268
+ # or when a required API key got cleared).
3269
+ if quick_requested:
3270
+ _run_quick_setup(config, hermes_home)
3271
+ return
3272
+
3273
+ print()
3274
+ print_header("Reconfigure")
3275
+ print_success("You already have Hermes configured.")
3276
+ print_info("Running the full wizard — each prompt shows your current value.")
3277
+ print_info("Press Enter to keep it, or type a new value to change it.")
3278
+ print_info("")
3279
+ print_info("Tip: jump straight to a section with 'hermes setup model|terminal|")
3280
+ print_info(" gateway|tools|agent', or fill only missing items with --quick.")
3281
+ # Fall through to the "Full Setup — run all sections" block below.
3282
+ # --reconfigure is now the default on existing installs; the flag
3283
+ # is preserved for backwards compatibility but is a no-op here.
3284
+ else:
3285
+ # ── First-Time Setup ──
3286
+ print()
3287
+
3288
+ # --reconfigure / --quick on a fresh install are meaningless — fall
3289
+ # through to the normal first-time flow.
3290
+ if reconfigure_requested or quick_requested:
3291
+ print_info("No existing configuration found — running first-time setup.")
3292
+ print()
3293
+
3294
+ # Offer OpenClaw migration before configuration begins
3295
+ migration_ran = _offer_openclaw_migration(hermes_home)
3296
+ if migration_ran:
3297
+ config = load_config()
3298
+
3299
+ setup_mode = prompt_choice("How would you like to set up Hermes?", [
3300
+ "Quick setup — provider, model & messaging (recommended)",
3301
+ "Full setup — configure everything",
3302
+ ], 0)
3303
+
3304
+ if setup_mode == 0:
3305
+ _run_first_time_quick_setup(config, hermes_home, is_existing)
3306
+ return
3307
+
3308
+ # ── Full Setup — run all sections ──
3309
+ print_header("Configuration Location")
3310
+ print_info(f"Config file: {get_config_path()}")
3311
+ print_info(f"Secrets file: {get_env_path()}")
3312
+ print_info(f"Data folder: {hermes_home}")
3313
+ print_info(f"Install dir: {PROJECT_ROOT}")
3314
+ print()
3315
+ print_info("You can edit these files directly or use 'hermes config edit'")
3316
+
3317
+ if migration_ran:
3318
+ print()
3319
+ print_info("Settings were imported from OpenClaw.")
3320
+ print_info("Each section below will show what was imported — press Enter to keep,")
3321
+ print_info("or choose to reconfigure if needed.")
3322
+
3323
+ # Section 1: Model & Provider
3324
+ if not (migration_ran and _skip_configured_section(config, "model", "Model & Provider")):
3325
+ setup_model_provider(config)
3326
+
3327
+ # Section 2: Terminal Backend
3328
+ if not (migration_ran and _skip_configured_section(config, "terminal", "Terminal Backend")):
3329
+ setup_terminal_backend(config)
3330
+
3331
+ # Section 3: Agent Settings
3332
+ if not (migration_ran and _skip_configured_section(config, "agent", "Agent Settings")):
3333
+ setup_agent_settings(config)
3334
+
3335
+ # Section 4: Messaging Platforms
3336
+ if not (migration_ran and _skip_configured_section(config, "gateway", "Messaging Platforms")):
3337
+ setup_gateway(config)
3338
+
3339
+ # Section 5: Tools
3340
+ if not (migration_ran and _skip_configured_section(config, "tools", "Tools")):
3341
+ setup_tools(config, first_install=not is_existing)
3342
+
3343
+ # Save and show summary
3344
+ save_config(config)
3345
+ if _backup_path and _backup_path.exists():
3346
+ print_info(f"Previous config backed up to: {_backup_path}")
3347
+ print_info("If setup changed a value you customized, restore it with:")
3348
+ print_info(f" cp {_backup_path} {config_path}")
3349
+ _print_setup_summary(config, hermes_home)
3350
+
3351
+
3352
+ def _run_first_time_quick_setup(config: dict, hermes_home, is_existing: bool):
3353
+ """Streamlined first-time setup: provider, model, terminal & messaging.
3354
+
3355
+ Applies sensible defaults for TTS (Edge), agent settings, and tools —
3356
+ the user can customize later via ``hermes setup <section>``.
3357
+ """
3358
+ # Step 1: Model & Provider (essential — skips rotation/vision/TTS)
3359
+ setup_model_provider(config, quick=True)
3360
+
3361
+ # Step 2: Terminal Backend — where commands run is a core decision
3362
+ setup_terminal_backend(config)
3363
+
3364
+ # Step 3: Apply defaults for everything else
3365
+ _apply_default_agent_settings(config)
3366
+
3367
+ save_config(config)
3368
+
3369
+ # Step 4: Offer messaging gateway setup
3370
+ print()
3371
+ gateway_choice = prompt_choice(
3372
+ "Connect a messaging platform? (Telegram, Discord, etc.)",
3373
+ [
3374
+ "Set up messaging now (recommended)",
3375
+ "Skip — set up later with 'hermes setup gateway'",
3376
+ ],
3377
+ 0,
3378
+ )
3379
+
3380
+ if gateway_choice == 0:
3381
+ setup_gateway(config)
3382
+ save_config(config)
3383
+
3384
+ print()
3385
+ print_success("Setup complete! You're ready to go.")
3386
+ print()
3387
+ print_info(" Configure all settings: hermes setup")
3388
+ if gateway_choice != 0:
3389
+ print_info(" Connect Telegram/Discord: hermes setup gateway")
3390
+ print()
3391
+
3392
+ _print_setup_summary(config, hermes_home)
3393
+
3394
+
3395
+ def _run_quick_setup(config: dict, hermes_home):
3396
+ """Quick setup — only configure items that are missing."""
3397
+ from hermes_cli.config import (
3398
+ get_missing_env_vars,
3399
+ get_missing_config_fields,
3400
+ check_config_version,
3401
+ )
3402
+
3403
+ print()
3404
+ print_header("Quick Setup — Missing Items Only")
3405
+
3406
+ # Check what's missing
3407
+ missing_required = [
3408
+ v for v in get_missing_env_vars(required_only=False) if v.get("is_required")
3409
+ ]
3410
+ missing_optional = [
3411
+ v for v in get_missing_env_vars(required_only=False) if not v.get("is_required")
3412
+ ]
3413
+ missing_config = get_missing_config_fields()
3414
+ current_ver, latest_ver = check_config_version()
3415
+
3416
+ has_anything_missing = (
3417
+ missing_required
3418
+ or missing_optional
3419
+ or missing_config
3420
+ or current_ver < latest_ver
3421
+ )
3422
+
3423
+ if not has_anything_missing:
3424
+ print_success("Everything is configured! Nothing to do.")
3425
+ print()
3426
+ print_info("Run 'hermes setup' and choose 'Full Setup' to reconfigure,")
3427
+ print_info("or pick a specific section from the menu.")
3428
+ return
3429
+
3430
+ # Handle missing required env vars
3431
+ if missing_required:
3432
+ print()
3433
+ print_info(f"{len(missing_required)} required setting(s) missing:")
3434
+ for var in missing_required:
3435
+ print(f" • {var['name']}")
3436
+ print()
3437
+
3438
+ for var in missing_required:
3439
+ print()
3440
+ print(color(f" {var['name']}", Colors.CYAN))
3441
+ print_info(f" {var.get('description', '')}")
3442
+ if var.get("url"):
3443
+ print_info(f" Get key at: {var['url']}")
3444
+
3445
+ if var.get("password"):
3446
+ value = prompt(f" {var.get('prompt', var['name'])}", password=True)
3447
+ else:
3448
+ value = prompt(f" {var.get('prompt', var['name'])}")
3449
+
3450
+ if value:
3451
+ save_env_value(var["name"], value)
3452
+ print_success(f" Saved {var['name']}")
3453
+ else:
3454
+ print_warning(f" Skipped {var['name']}")
3455
+
3456
+ # Split missing optional vars by category
3457
+ missing_tools = [v for v in missing_optional if v.get("category") == "tool"]
3458
+ missing_messaging = [
3459
+ v
3460
+ for v in missing_optional
3461
+ if v.get("category") == "messaging" and not v.get("advanced")
3462
+ ]
3463
+
3464
+ # ── Tool API keys (checklist) ──
3465
+ if missing_tools:
3466
+ print()
3467
+ print_header("Tool API Keys")
3468
+
3469
+ checklist_labels = []
3470
+ for var in missing_tools:
3471
+ tools = var.get("tools", [])
3472
+ tools_str = f" → {', '.join(tools[:2])}" if tools else ""
3473
+ checklist_labels.append(f"{var.get('description', var['name'])}{tools_str}")
3474
+
3475
+ selected_indices = prompt_checklist(
3476
+ "Which tools would you like to configure?",
3477
+ checklist_labels,
3478
+ )
3479
+
3480
+ for idx in selected_indices:
3481
+ var = missing_tools[idx]
3482
+ _prompt_api_key(var)
3483
+
3484
+ # ── Messaging platforms (checklist then prompt for selected) ──
3485
+ if missing_messaging:
3486
+ print()
3487
+ print_header("Messaging Platforms")
3488
+ print_info("Connect Hermes to messaging apps to chat from anywhere.")
3489
+ print_info("You can configure these later with 'hermes setup gateway'.")
3490
+
3491
+ # Group by platform (preserving order)
3492
+ platform_order = []
3493
+ platforms = {}
3494
+ for var in missing_messaging:
3495
+ name = var["name"]
3496
+ if "TELEGRAM" in name:
3497
+ plat = "Telegram"
3498
+ elif "DISCORD" in name:
3499
+ plat = "Discord"
3500
+ elif "SLACK" in name:
3501
+ plat = "Slack"
3502
+ else:
3503
+ continue
3504
+ if plat not in platforms:
3505
+ platform_order.append(plat)
3506
+ platforms.setdefault(plat, []).append(var)
3507
+
3508
+ platform_labels = [
3509
+ {
3510
+ "Telegram": "📱 Telegram",
3511
+ "Discord": "💬 Discord",
3512
+ "Slack": "💼 Slack",
3513
+ }.get(p, p)
3514
+ for p in platform_order
3515
+ ]
3516
+
3517
+ selected_indices = prompt_checklist(
3518
+ "Which platforms would you like to set up?",
3519
+ platform_labels,
3520
+ )
3521
+
3522
+ for idx in selected_indices:
3523
+ plat = platform_order[idx]
3524
+ vars_list = platforms[plat]
3525
+ emoji = {"Telegram": "📱", "Discord": "💬", "Slack": "💼"}.get(plat, "")
3526
+ print()
3527
+ print(color(f" ─── {emoji} {plat} ───", Colors.CYAN))
3528
+ print()
3529
+ for var in vars_list:
3530
+ print_info(f" {var.get('description', '')}")
3531
+ if var.get("url"):
3532
+ print_info(f" {var['url']}")
3533
+ if var.get("password"):
3534
+ value = prompt(f" {var.get('prompt', var['name'])}", password=True)
3535
+ else:
3536
+ value = prompt(f" {var.get('prompt', var['name'])}")
3537
+ if value:
3538
+ save_env_value(var["name"], value)
3539
+ print_success(" ✓ Saved")
3540
+ else:
3541
+ print_warning(" Skipped")
3542
+ print()
3543
+
3544
+ # Handle missing config fields
3545
+ if missing_config:
3546
+ print()
3547
+ print_info(
3548
+ f"Adding {len(missing_config)} new config option(s) with defaults..."
3549
+ )
3550
+ for field in missing_config:
3551
+ print_success(f" Added {field['key']} = {field['default']}")
3552
+
3553
+ # Update config version
3554
+ config["_config_version"] = latest_ver
3555
+ save_config(config)
3556
+
3557
+ # Jump to summary
3558
+ _print_setup_summary(config, hermes_home)
3559
+