bhu-cli 1.46.0__tar.gz

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 (257) hide show
  1. bhu_cli-1.46.0/PKG-INFO +210 -0
  2. bhu_cli-1.46.0/README.md +174 -0
  3. bhu_cli-1.46.0/pyproject.toml +124 -0
  4. bhu_cli-1.46.0/src/kimi_cli/CHANGELOG.md +1281 -0
  5. bhu_cli-1.46.0/src/kimi_cli/__init__.py +29 -0
  6. bhu_cli-1.46.0/src/kimi_cli/__main__.py +43 -0
  7. bhu_cli-1.46.0/src/kimi_cli/_build_info.py +1 -0
  8. bhu_cli-1.46.0/src/kimi_cli/acp/AGENTS.md +92 -0
  9. bhu_cli-1.46.0/src/kimi_cli/acp/__init__.py +13 -0
  10. bhu_cli-1.46.0/src/kimi_cli/acp/convert.py +128 -0
  11. bhu_cli-1.46.0/src/kimi_cli/acp/kaos.py +291 -0
  12. bhu_cli-1.46.0/src/kimi_cli/acp/mcp.py +46 -0
  13. bhu_cli-1.46.0/src/kimi_cli/acp/server.py +468 -0
  14. bhu_cli-1.46.0/src/kimi_cli/acp/session.py +499 -0
  15. bhu_cli-1.46.0/src/kimi_cli/acp/tools.py +167 -0
  16. bhu_cli-1.46.0/src/kimi_cli/acp/types.py +13 -0
  17. bhu_cli-1.46.0/src/kimi_cli/acp/version.py +45 -0
  18. bhu_cli-1.46.0/src/kimi_cli/agents/default/agent.yaml +36 -0
  19. bhu_cli-1.46.0/src/kimi_cli/agents/default/coder.yaml +25 -0
  20. bhu_cli-1.46.0/src/kimi_cli/agents/default/explore.yaml +46 -0
  21. bhu_cli-1.46.0/src/kimi_cli/agents/default/plan.yaml +30 -0
  22. bhu_cli-1.46.0/src/kimi_cli/agents/default/system.md +160 -0
  23. bhu_cli-1.46.0/src/kimi_cli/agents/okabe/agent.yaml +22 -0
  24. bhu_cli-1.46.0/src/kimi_cli/agentspec.py +160 -0
  25. bhu_cli-1.46.0/src/kimi_cli/app.py +807 -0
  26. bhu_cli-1.46.0/src/kimi_cli/approval_runtime/__init__.py +29 -0
  27. bhu_cli-1.46.0/src/kimi_cli/approval_runtime/models.py +42 -0
  28. bhu_cli-1.46.0/src/kimi_cli/approval_runtime/runtime.py +235 -0
  29. bhu_cli-1.46.0/src/kimi_cli/auth/__init__.py +5 -0
  30. bhu_cli-1.46.0/src/kimi_cli/auth/oauth.py +1092 -0
  31. bhu_cli-1.46.0/src/kimi_cli/auth/platforms.py +374 -0
  32. bhu_cli-1.46.0/src/kimi_cli/background/__init__.py +36 -0
  33. bhu_cli-1.46.0/src/kimi_cli/background/agent_runner.py +231 -0
  34. bhu_cli-1.46.0/src/kimi_cli/background/ids.py +19 -0
  35. bhu_cli-1.46.0/src/kimi_cli/background/manager.py +725 -0
  36. bhu_cli-1.46.0/src/kimi_cli/background/models.py +105 -0
  37. bhu_cli-1.46.0/src/kimi_cli/background/store.py +237 -0
  38. bhu_cli-1.46.0/src/kimi_cli/background/summary.py +66 -0
  39. bhu_cli-1.46.0/src/kimi_cli/background/worker.py +209 -0
  40. bhu_cli-1.46.0/src/kimi_cli/cli/__init__.py +1081 -0
  41. bhu_cli-1.46.0/src/kimi_cli/cli/__main__.py +34 -0
  42. bhu_cli-1.46.0/src/kimi_cli/cli/_lazy_group.py +238 -0
  43. bhu_cli-1.46.0/src/kimi_cli/cli/export.py +322 -0
  44. bhu_cli-1.46.0/src/kimi_cli/cli/info.py +62 -0
  45. bhu_cli-1.46.0/src/kimi_cli/cli/mcp.py +353 -0
  46. bhu_cli-1.46.0/src/kimi_cli/cli/plugin.py +347 -0
  47. bhu_cli-1.46.0/src/kimi_cli/cli/toad.py +73 -0
  48. bhu_cli-1.46.0/src/kimi_cli/cli/vis.py +38 -0
  49. bhu_cli-1.46.0/src/kimi_cli/cli/web.py +80 -0
  50. bhu_cli-1.46.0/src/kimi_cli/config.py +429 -0
  51. bhu_cli-1.46.0/src/kimi_cli/constant.py +116 -0
  52. bhu_cli-1.46.0/src/kimi_cli/exception.py +43 -0
  53. bhu_cli-1.46.0/src/kimi_cli/hooks/__init__.py +24 -0
  54. bhu_cli-1.46.0/src/kimi_cli/hooks/config.py +34 -0
  55. bhu_cli-1.46.0/src/kimi_cli/hooks/defaults/rtk.py +48 -0
  56. bhu_cli-1.46.0/src/kimi_cli/hooks/engine.py +394 -0
  57. bhu_cli-1.46.0/src/kimi_cli/hooks/events.py +190 -0
  58. bhu_cli-1.46.0/src/kimi_cli/hooks/runner.py +103 -0
  59. bhu_cli-1.46.0/src/kimi_cli/llm.py +333 -0
  60. bhu_cli-1.46.0/src/kimi_cli/mcp_oauth.py +72 -0
  61. bhu_cli-1.46.0/src/kimi_cli/metadata.py +79 -0
  62. bhu_cli-1.46.0/src/kimi_cli/notifications/__init__.py +33 -0
  63. bhu_cli-1.46.0/src/kimi_cli/notifications/llm.py +77 -0
  64. bhu_cli-1.46.0/src/kimi_cli/notifications/manager.py +145 -0
  65. bhu_cli-1.46.0/src/kimi_cli/notifications/models.py +50 -0
  66. bhu_cli-1.46.0/src/kimi_cli/notifications/notifier.py +41 -0
  67. bhu_cli-1.46.0/src/kimi_cli/notifications/store.py +118 -0
  68. bhu_cli-1.46.0/src/kimi_cli/notifications/wire.py +21 -0
  69. bhu_cli-1.46.0/src/kimi_cli/plugin/__init__.py +124 -0
  70. bhu_cli-1.46.0/src/kimi_cli/plugin/manager.py +153 -0
  71. bhu_cli-1.46.0/src/kimi_cli/plugin/tool.py +173 -0
  72. bhu_cli-1.46.0/src/kimi_cli/prompts/__init__.py +6 -0
  73. bhu_cli-1.46.0/src/kimi_cli/prompts/compact.md +73 -0
  74. bhu_cli-1.46.0/src/kimi_cli/prompts/init.md +21 -0
  75. bhu_cli-1.46.0/src/kimi_cli/py.typed +0 -0
  76. bhu_cli-1.46.0/src/kimi_cli/session.py +319 -0
  77. bhu_cli-1.46.0/src/kimi_cli/session_fork.py +325 -0
  78. bhu_cli-1.46.0/src/kimi_cli/session_state.py +132 -0
  79. bhu_cli-1.46.0/src/kimi_cli/share.py +14 -0
  80. bhu_cli-1.46.0/src/kimi_cli/skill/__init__.py +727 -0
  81. bhu_cli-1.46.0/src/kimi_cli/skill/flow/__init__.py +99 -0
  82. bhu_cli-1.46.0/src/kimi_cli/skill/flow/d2.py +482 -0
  83. bhu_cli-1.46.0/src/kimi_cli/skill/flow/mermaid.py +266 -0
  84. bhu_cli-1.46.0/src/kimi_cli/skills/kimi-cli-help/SKILL.md +55 -0
  85. bhu_cli-1.46.0/src/kimi_cli/skills/skill-creator/SKILL.md +367 -0
  86. bhu_cli-1.46.0/src/kimi_cli/soul/__init__.py +304 -0
  87. bhu_cli-1.46.0/src/kimi_cli/soul/agent.py +519 -0
  88. bhu_cli-1.46.0/src/kimi_cli/soul/approval.py +267 -0
  89. bhu_cli-1.46.0/src/kimi_cli/soul/btw.py +237 -0
  90. bhu_cli-1.46.0/src/kimi_cli/soul/compaction.py +189 -0
  91. bhu_cli-1.46.0/src/kimi_cli/soul/context.py +339 -0
  92. bhu_cli-1.46.0/src/kimi_cli/soul/denwarenji.py +39 -0
  93. bhu_cli-1.46.0/src/kimi_cli/soul/dynamic_injection.py +84 -0
  94. bhu_cli-1.46.0/src/kimi_cli/soul/dynamic_injections/__init__.py +0 -0
  95. bhu_cli-1.46.0/src/kimi_cli/soul/dynamic_injections/afk_mode.py +74 -0
  96. bhu_cli-1.46.0/src/kimi_cli/soul/dynamic_injections/plan_mode.py +245 -0
  97. bhu_cli-1.46.0/src/kimi_cli/soul/kimisoul.py +1710 -0
  98. bhu_cli-1.46.0/src/kimi_cli/soul/message.py +92 -0
  99. bhu_cli-1.46.0/src/kimi_cli/soul/slash.py +341 -0
  100. bhu_cli-1.46.0/src/kimi_cli/soul/toolset.py +891 -0
  101. bhu_cli-1.46.0/src/kimi_cli/subagents/__init__.py +21 -0
  102. bhu_cli-1.46.0/src/kimi_cli/subagents/builder.py +42 -0
  103. bhu_cli-1.46.0/src/kimi_cli/subagents/core.py +86 -0
  104. bhu_cli-1.46.0/src/kimi_cli/subagents/git_context.py +170 -0
  105. bhu_cli-1.46.0/src/kimi_cli/subagents/models.py +54 -0
  106. bhu_cli-1.46.0/src/kimi_cli/subagents/output.py +71 -0
  107. bhu_cli-1.46.0/src/kimi_cli/subagents/registry.py +28 -0
  108. bhu_cli-1.46.0/src/kimi_cli/subagents/runner.py +428 -0
  109. bhu_cli-1.46.0/src/kimi_cli/subagents/store.py +196 -0
  110. bhu_cli-1.46.0/src/kimi_cli/telemetry/__init__.py +197 -0
  111. bhu_cli-1.46.0/src/kimi_cli/telemetry/crash.py +149 -0
  112. bhu_cli-1.46.0/src/kimi_cli/telemetry/sink.py +143 -0
  113. bhu_cli-1.46.0/src/kimi_cli/telemetry/transport.py +318 -0
  114. bhu_cli-1.46.0/src/kimi_cli/tools/AGENTS.md +5 -0
  115. bhu_cli-1.46.0/src/kimi_cli/tools/__init__.py +105 -0
  116. bhu_cli-1.46.0/src/kimi_cli/tools/agent/__init__.py +277 -0
  117. bhu_cli-1.46.0/src/kimi_cli/tools/agent/description.md +41 -0
  118. bhu_cli-1.46.0/src/kimi_cli/tools/ask_user/__init__.py +154 -0
  119. bhu_cli-1.46.0/src/kimi_cli/tools/ask_user/description.md +19 -0
  120. bhu_cli-1.46.0/src/kimi_cli/tools/background/__init__.py +318 -0
  121. bhu_cli-1.46.0/src/kimi_cli/tools/background/list.md +10 -0
  122. bhu_cli-1.46.0/src/kimi_cli/tools/background/output.md +11 -0
  123. bhu_cli-1.46.0/src/kimi_cli/tools/background/stop.md +8 -0
  124. bhu_cli-1.46.0/src/kimi_cli/tools/display.py +46 -0
  125. bhu_cli-1.46.0/src/kimi_cli/tools/dmail/__init__.py +38 -0
  126. bhu_cli-1.46.0/src/kimi_cli/tools/dmail/dmail.md +17 -0
  127. bhu_cli-1.46.0/src/kimi_cli/tools/file/__init__.py +30 -0
  128. bhu_cli-1.46.0/src/kimi_cli/tools/file/glob.md +21 -0
  129. bhu_cli-1.46.0/src/kimi_cli/tools/file/glob.py +178 -0
  130. bhu_cli-1.46.0/src/kimi_cli/tools/file/grep.md +6 -0
  131. bhu_cli-1.46.0/src/kimi_cli/tools/file/grep_local.py +590 -0
  132. bhu_cli-1.46.0/src/kimi_cli/tools/file/plan_mode.py +45 -0
  133. bhu_cli-1.46.0/src/kimi_cli/tools/file/read.md +16 -0
  134. bhu_cli-1.46.0/src/kimi_cli/tools/file/read.py +300 -0
  135. bhu_cli-1.46.0/src/kimi_cli/tools/file/read_media.md +24 -0
  136. bhu_cli-1.46.0/src/kimi_cli/tools/file/read_media.py +217 -0
  137. bhu_cli-1.46.0/src/kimi_cli/tools/file/replace.md +7 -0
  138. bhu_cli-1.46.0/src/kimi_cli/tools/file/replace.py +195 -0
  139. bhu_cli-1.46.0/src/kimi_cli/tools/file/utils.py +257 -0
  140. bhu_cli-1.46.0/src/kimi_cli/tools/file/write.md +5 -0
  141. bhu_cli-1.46.0/src/kimi_cli/tools/file/write.py +177 -0
  142. bhu_cli-1.46.0/src/kimi_cli/tools/plan/__init__.py +339 -0
  143. bhu_cli-1.46.0/src/kimi_cli/tools/plan/description.md +29 -0
  144. bhu_cli-1.46.0/src/kimi_cli/tools/plan/enter.py +197 -0
  145. bhu_cli-1.46.0/src/kimi_cli/tools/plan/enter_description.md +35 -0
  146. bhu_cli-1.46.0/src/kimi_cli/tools/plan/heroes.py +277 -0
  147. bhu_cli-1.46.0/src/kimi_cli/tools/shell/__init__.py +260 -0
  148. bhu_cli-1.46.0/src/kimi_cli/tools/shell/bash.md +35 -0
  149. bhu_cli-1.46.0/src/kimi_cli/tools/test.py +55 -0
  150. bhu_cli-1.46.0/src/kimi_cli/tools/think/__init__.py +21 -0
  151. bhu_cli-1.46.0/src/kimi_cli/tools/think/think.md +1 -0
  152. bhu_cli-1.46.0/src/kimi_cli/tools/todo/__init__.py +168 -0
  153. bhu_cli-1.46.0/src/kimi_cli/tools/todo/set_todo_list.md +23 -0
  154. bhu_cli-1.46.0/src/kimi_cli/tools/utils.py +199 -0
  155. bhu_cli-1.46.0/src/kimi_cli/tools/web/__init__.py +4 -0
  156. bhu_cli-1.46.0/src/kimi_cli/tools/web/fetch.md +1 -0
  157. bhu_cli-1.46.0/src/kimi_cli/tools/web/fetch.py +189 -0
  158. bhu_cli-1.46.0/src/kimi_cli/tools/web/search.md +1 -0
  159. bhu_cli-1.46.0/src/kimi_cli/tools/web/search.py +163 -0
  160. bhu_cli-1.46.0/src/kimi_cli/ui/__init__.py +0 -0
  161. bhu_cli-1.46.0/src/kimi_cli/ui/acp/__init__.py +99 -0
  162. bhu_cli-1.46.0/src/kimi_cli/ui/print/__init__.py +474 -0
  163. bhu_cli-1.46.0/src/kimi_cli/ui/print/visualize.py +194 -0
  164. bhu_cli-1.46.0/src/kimi_cli/ui/shell/__init__.py +1540 -0
  165. bhu_cli-1.46.0/src/kimi_cli/ui/shell/console.py +109 -0
  166. bhu_cli-1.46.0/src/kimi_cli/ui/shell/debug.py +190 -0
  167. bhu_cli-1.46.0/src/kimi_cli/ui/shell/echo.py +17 -0
  168. bhu_cli-1.46.0/src/kimi_cli/ui/shell/export_import.py +117 -0
  169. bhu_cli-1.46.0/src/kimi_cli/ui/shell/keyboard.py +300 -0
  170. bhu_cli-1.46.0/src/kimi_cli/ui/shell/mcp_status.py +111 -0
  171. bhu_cli-1.46.0/src/kimi_cli/ui/shell/oauth.py +149 -0
  172. bhu_cli-1.46.0/src/kimi_cli/ui/shell/placeholders.py +531 -0
  173. bhu_cli-1.46.0/src/kimi_cli/ui/shell/prompt.py +2259 -0
  174. bhu_cli-1.46.0/src/kimi_cli/ui/shell/replay.py +215 -0
  175. bhu_cli-1.46.0/src/kimi_cli/ui/shell/session_picker.py +227 -0
  176. bhu_cli-1.46.0/src/kimi_cli/ui/shell/setup.py +212 -0
  177. bhu_cli-1.46.0/src/kimi_cli/ui/shell/slash.py +893 -0
  178. bhu_cli-1.46.0/src/kimi_cli/ui/shell/startup.py +32 -0
  179. bhu_cli-1.46.0/src/kimi_cli/ui/shell/task_browser.py +486 -0
  180. bhu_cli-1.46.0/src/kimi_cli/ui/shell/update.py +349 -0
  181. bhu_cli-1.46.0/src/kimi_cli/ui/shell/usage.py +295 -0
  182. bhu_cli-1.46.0/src/kimi_cli/ui/shell/visualize/__init__.py +165 -0
  183. bhu_cli-1.46.0/src/kimi_cli/ui/shell/visualize/_approval_panel.py +505 -0
  184. bhu_cli-1.46.0/src/kimi_cli/ui/shell/visualize/_blocks.py +640 -0
  185. bhu_cli-1.46.0/src/kimi_cli/ui/shell/visualize/_btw_panel.py +224 -0
  186. bhu_cli-1.46.0/src/kimi_cli/ui/shell/visualize/_input_router.py +48 -0
  187. bhu_cli-1.46.0/src/kimi_cli/ui/shell/visualize/_interactive.py +524 -0
  188. bhu_cli-1.46.0/src/kimi_cli/ui/shell/visualize/_live_view.py +902 -0
  189. bhu_cli-1.46.0/src/kimi_cli/ui/shell/visualize/_question_panel.py +586 -0
  190. bhu_cli-1.46.0/src/kimi_cli/ui/theme.py +241 -0
  191. bhu_cli-1.46.0/src/kimi_cli/utils/__init__.py +0 -0
  192. bhu_cli-1.46.0/src/kimi_cli/utils/aiohttp.py +24 -0
  193. bhu_cli-1.46.0/src/kimi_cli/utils/aioqueue.py +72 -0
  194. bhu_cli-1.46.0/src/kimi_cli/utils/broadcast.py +37 -0
  195. bhu_cli-1.46.0/src/kimi_cli/utils/changelog.py +108 -0
  196. bhu_cli-1.46.0/src/kimi_cli/utils/clipboard.py +246 -0
  197. bhu_cli-1.46.0/src/kimi_cli/utils/datetime.py +64 -0
  198. bhu_cli-1.46.0/src/kimi_cli/utils/diff.py +135 -0
  199. bhu_cli-1.46.0/src/kimi_cli/utils/editor.py +91 -0
  200. bhu_cli-1.46.0/src/kimi_cli/utils/environment.py +225 -0
  201. bhu_cli-1.46.0/src/kimi_cli/utils/envvar.py +22 -0
  202. bhu_cli-1.46.0/src/kimi_cli/utils/export.py +696 -0
  203. bhu_cli-1.46.0/src/kimi_cli/utils/file_filter.py +367 -0
  204. bhu_cli-1.46.0/src/kimi_cli/utils/frontmatter.py +70 -0
  205. bhu_cli-1.46.0/src/kimi_cli/utils/io.py +27 -0
  206. bhu_cli-1.46.0/src/kimi_cli/utils/logging.py +124 -0
  207. bhu_cli-1.46.0/src/kimi_cli/utils/media_tags.py +29 -0
  208. bhu_cli-1.46.0/src/kimi_cli/utils/message.py +24 -0
  209. bhu_cli-1.46.0/src/kimi_cli/utils/path.py +245 -0
  210. bhu_cli-1.46.0/src/kimi_cli/utils/proctitle.py +33 -0
  211. bhu_cli-1.46.0/src/kimi_cli/utils/proxy.py +31 -0
  212. bhu_cli-1.46.0/src/kimi_cli/utils/pyinstaller.py +43 -0
  213. bhu_cli-1.46.0/src/kimi_cli/utils/rich/__init__.py +33 -0
  214. bhu_cli-1.46.0/src/kimi_cli/utils/rich/columns.py +99 -0
  215. bhu_cli-1.46.0/src/kimi_cli/utils/rich/diff_render.py +481 -0
  216. bhu_cli-1.46.0/src/kimi_cli/utils/rich/markdown.py +898 -0
  217. bhu_cli-1.46.0/src/kimi_cli/utils/rich/markdown_sample.md +108 -0
  218. bhu_cli-1.46.0/src/kimi_cli/utils/rich/markdown_sample_short.md +2 -0
  219. bhu_cli-1.46.0/src/kimi_cli/utils/rich/syntax.py +114 -0
  220. bhu_cli-1.46.0/src/kimi_cli/utils/sensitive.py +54 -0
  221. bhu_cli-1.46.0/src/kimi_cli/utils/server.py +121 -0
  222. bhu_cli-1.46.0/src/kimi_cli/utils/shell_quoting.py +38 -0
  223. bhu_cli-1.46.0/src/kimi_cli/utils/signals.py +43 -0
  224. bhu_cli-1.46.0/src/kimi_cli/utils/slashcmd.py +145 -0
  225. bhu_cli-1.46.0/src/kimi_cli/utils/string.py +41 -0
  226. bhu_cli-1.46.0/src/kimi_cli/utils/subprocess_env.py +73 -0
  227. bhu_cli-1.46.0/src/kimi_cli/utils/term.py +168 -0
  228. bhu_cli-1.46.0/src/kimi_cli/utils/typing.py +20 -0
  229. bhu_cli-1.46.0/src/kimi_cli/utils/windows_paths.py +48 -0
  230. bhu_cli-1.46.0/src/kimi_cli/vis/__init__.py +0 -0
  231. bhu_cli-1.46.0/src/kimi_cli/vis/api/__init__.py +5 -0
  232. bhu_cli-1.46.0/src/kimi_cli/vis/api/sessions.py +687 -0
  233. bhu_cli-1.46.0/src/kimi_cli/vis/api/statistics.py +209 -0
  234. bhu_cli-1.46.0/src/kimi_cli/vis/api/system.py +19 -0
  235. bhu_cli-1.46.0/src/kimi_cli/vis/app.py +175 -0
  236. bhu_cli-1.46.0/src/kimi_cli/web/__init__.py +5 -0
  237. bhu_cli-1.46.0/src/kimi_cli/web/api/__init__.py +15 -0
  238. bhu_cli-1.46.0/src/kimi_cli/web/api/config.py +208 -0
  239. bhu_cli-1.46.0/src/kimi_cli/web/api/open_in.py +197 -0
  240. bhu_cli-1.46.0/src/kimi_cli/web/api/sessions.py +1223 -0
  241. bhu_cli-1.46.0/src/kimi_cli/web/app.py +451 -0
  242. bhu_cli-1.46.0/src/kimi_cli/web/auth.py +191 -0
  243. bhu_cli-1.46.0/src/kimi_cli/web/models.py +98 -0
  244. bhu_cli-1.46.0/src/kimi_cli/web/runner/__init__.py +5 -0
  245. bhu_cli-1.46.0/src/kimi_cli/web/runner/messages.py +57 -0
  246. bhu_cli-1.46.0/src/kimi_cli/web/runner/process.py +754 -0
  247. bhu_cli-1.46.0/src/kimi_cli/web/runner/worker.py +95 -0
  248. bhu_cli-1.46.0/src/kimi_cli/web/store/__init__.py +1 -0
  249. bhu_cli-1.46.0/src/kimi_cli/web/store/sessions.py +432 -0
  250. bhu_cli-1.46.0/src/kimi_cli/wire/__init__.py +148 -0
  251. bhu_cli-1.46.0/src/kimi_cli/wire/file.py +151 -0
  252. bhu_cli-1.46.0/src/kimi_cli/wire/jsonrpc.py +263 -0
  253. bhu_cli-1.46.0/src/kimi_cli/wire/protocol.py +2 -0
  254. bhu_cli-1.46.0/src/kimi_cli/wire/root_hub.py +27 -0
  255. bhu_cli-1.46.0/src/kimi_cli/wire/serde.py +26 -0
  256. bhu_cli-1.46.0/src/kimi_cli/wire/server.py +1060 -0
  257. bhu_cli-1.46.0/src/kimi_cli/wire/types.py +717 -0
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.3
2
+ Name: bhu-cli
3
+ Version: 1.46.0
4
+ Summary: Kimi Code CLI is your next CLI agent.
5
+ Requires-Dist: agent-client-protocol==0.8.0
6
+ Requires-Dist: aiofiles>=24.0,<26.0
7
+ Requires-Dist: aiohttp==3.13.3
8
+ Requires-Dist: typer==0.21.1
9
+ Requires-Dist: kosong[contrib]==0.53.0
10
+ Requires-Dist: loguru>=0.6.0,<0.8
11
+ Requires-Dist: prompt-toolkit==3.0.52
12
+ Requires-Dist: pillow==12.2.0
13
+ Requires-Dist: pyyaml==6.0.3
14
+ Requires-Dist: rich==14.2.0
15
+ Requires-Dist: ripgrepy==2.2.0
16
+ Requires-Dist: streamingjson==0.0.5
17
+ Requires-Dist: trafilatura==2.0.0
18
+ Requires-Dist: lxml==6.0.2
19
+ Requires-Dist: tenacity==9.1.2
20
+ Requires-Dist: fastmcp==3.2.4
21
+ Requires-Dist: pydantic==2.12.5
22
+ Requires-Dist: httpx[socks]==0.28.1
23
+ Requires-Dist: pykaos==0.9.0
24
+ Requires-Dist: batrachian-toad==0.5.23 ; python_full_version >= '3.14'
25
+ Requires-Dist: tomlkit==0.14.0
26
+ Requires-Dist: jinja2==3.1.6
27
+ Requires-Dist: pyobjc-framework-cocoa>=12.1 ; sys_platform == 'darwin'
28
+ Requires-Dist: fastapi>=0.115.0
29
+ Requires-Dist: uvicorn[standard]>=0.32.0
30
+ Requires-Dist: scalar-fastapi>=1.5.0
31
+ Requires-Dist: websockets>=14.0
32
+ Requires-Dist: keyring>=25.7.0
33
+ Requires-Dist: setproctitle>=1.3.0
34
+ Requires-Python: >=3.12
35
+ Description-Content-Type: text/markdown
36
+
37
+ # Kimi Code CLI
38
+
39
+ [![Commit Activity](https://img.shields.io/github/commit-activity/w/MoonshotAI/kimi-cli)](https://github.com/MoonshotAI/kimi-cli/graphs/commit-activity)
40
+ [![Checks](https://img.shields.io/github/check-runs/MoonshotAI/kimi-cli/main)](https://github.com/MoonshotAI/kimi-cli/actions)
41
+ [![Version](https://img.shields.io/pypi/v/kimi-cli)](https://pypi.org/project/kimi-cli/)
42
+ [![Downloads](https://img.shields.io/pypi/dw/kimi-cli)](https://pypistats.org/packages/kimi-cli)
43
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/MoonshotAI/kimi-cli)
44
+
45
+ [Kimi Code](https://www.kimi.com/code/) | [Documentation](https://moonshotai.github.io/kimi-cli/en/) | [文档](https://moonshotai.github.io/kimi-cli/zh/)
46
+
47
+ Kimi Code CLI is an AI agent that runs in the terminal, helping you complete software development tasks and terminal operations. It can read and edit code, execute shell commands, search and fetch web pages, and autonomously plan and adjust actions during execution.
48
+
49
+ ## Getting Started
50
+
51
+ See [Getting Started](https://moonshotai.github.io/kimi-cli/en/guides/getting-started.html) for how to install and start using Kimi Code CLI.
52
+
53
+ ## Key Features
54
+
55
+ ### Shell command mode
56
+
57
+ Kimi Code CLI is not only a coding agent, but also a shell. You can switch the shell command mode by pressing `Ctrl-X`. In this mode, you can directly run shell commands without leaving Kimi Code CLI.
58
+
59
+ ![](./docs/media/shell-mode.gif)
60
+
61
+ > [!NOTE]
62
+ > Built-in shell commands like `cd` are not supported yet.
63
+
64
+ ### VS Code extension
65
+
66
+ Kimi Code CLI can be integrated with [Visual Studio Code](https://code.visualstudio.com/) via the [Kimi Code VS Code Extension](https://marketplace.visualstudio.com/items?itemName=moonshot-ai.kimi-code).
67
+
68
+ ![VS Code Extension](./docs/media/vscode.png)
69
+
70
+ ### IDE integration via ACP
71
+
72
+ Kimi Code CLI supports [Agent Client Protocol] out of the box. You can use it together with any ACP-compatible editor or IDE.
73
+
74
+ [Agent Client Protocol]: https://github.com/agentclientprotocol/agent-client-protocol
75
+
76
+ To use Kimi Code CLI with ACP clients, make sure to run Kimi Code CLI in the terminal and send `/login` to complete the login first. Then, you can configure your ACP client to start Kimi Code CLI as an ACP agent server with command `kimi acp`.
77
+
78
+ For example, to use Kimi Code CLI with [Zed](https://zed.dev/) or [JetBrains](https://blog.jetbrains.com/ai/2025/12/bring-your-own-ai-agent-to-jetbrains-ides/), add the following configuration to your `~/.config/zed/settings.json` or `~/.jetbrains/acp.json` file:
79
+
80
+ ```json
81
+ {
82
+ "agent_servers": {
83
+ "Kimi Code CLI": {
84
+ "type": "custom",
85
+ "command": "kimi",
86
+ "args": ["acp"],
87
+ "env": {}
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ Then you can create Kimi Code CLI threads in IDE's agent panel.
94
+
95
+ ![](./docs/media/acp-integration.gif)
96
+
97
+ ### Zsh integration
98
+
99
+ You can use Kimi Code CLI together with Zsh, to empower your shell experience with AI agent capabilities.
100
+
101
+ Install the [zsh-kimi-cli](https://github.com/MoonshotAI/zsh-kimi-cli) plugin via:
102
+
103
+ ```sh
104
+ git clone https://github.com/MoonshotAI/zsh-kimi-cli.git \
105
+ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/kimi-cli
106
+ ```
107
+
108
+ > [!NOTE]
109
+ > If you are using a plugin manager other than Oh My Zsh, you may need to refer to the plugin's README for installation instructions.
110
+
111
+ Then add `kimi-cli` to your Zsh plugin list in `~/.zshrc`:
112
+
113
+ ```sh
114
+ plugins=(... kimi-cli)
115
+ ```
116
+
117
+ After restarting Zsh, you can switch to agent mode by pressing `Ctrl-X`.
118
+
119
+ ### MCP support
120
+
121
+ Kimi Code CLI supports MCP (Model Context Protocol) tools.
122
+
123
+ **`kimi mcp` sub-command group**
124
+
125
+ You can manage MCP servers with `kimi mcp` sub-command group. For example:
126
+
127
+ ```sh
128
+ # Add streamable HTTP server:
129
+ kimi mcp add --transport http context7 https://mcp.context7.com/mcp --header "CONTEXT7_API_KEY: ctx7sk-your-key"
130
+
131
+ # Add streamable HTTP server with OAuth authorization:
132
+ kimi mcp add --transport http --auth oauth linear https://mcp.linear.app/mcp
133
+
134
+ # Add stdio server:
135
+ kimi mcp add --transport stdio chrome-devtools -- npx chrome-devtools-mcp@latest
136
+
137
+ # List added MCP servers:
138
+ kimi mcp list
139
+
140
+ # Remove an MCP server:
141
+ kimi mcp remove chrome-devtools
142
+
143
+ # Authorize an MCP server:
144
+ kimi mcp auth linear
145
+ ```
146
+
147
+ **Ad-hoc MCP configuration**
148
+
149
+ Kimi Code CLI also supports ad-hoc MCP server configuration via CLI option.
150
+
151
+ Given an MCP config file in the well-known MCP config format like the following:
152
+
153
+ ```json
154
+ {
155
+ "mcpServers": {
156
+ "context7": {
157
+ "url": "https://mcp.context7.com/mcp",
158
+ "headers": {
159
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
160
+ }
161
+ },
162
+ "chrome-devtools": {
163
+ "command": "npx",
164
+ "args": ["-y", "chrome-devtools-mcp@latest"]
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ Run `kimi` with `--mcp-config-file` option to connect to the specified MCP servers:
171
+
172
+ ```sh
173
+ kimi --mcp-config-file /path/to/mcp.json
174
+ ```
175
+
176
+ ### More
177
+
178
+ See more features in the [Documentation](https://moonshotai.github.io/kimi-cli/en/).
179
+
180
+ ## Development
181
+
182
+ To develop Kimi Code CLI, run:
183
+
184
+ ```sh
185
+ git clone https://github.com/MoonshotAI/kimi-cli.git
186
+ cd kimi-cli
187
+
188
+ make prepare # prepare the development environment
189
+ ```
190
+
191
+ Then you can start working on Kimi Code CLI.
192
+
193
+ Refer to the following commands after you make changes:
194
+
195
+ ```sh
196
+ uv run kimi # run Kimi Code CLI
197
+
198
+ make format # format code
199
+ make check # run linting and type checking
200
+ make test # run tests
201
+ make test-kimi-cli # run Kimi Code CLI tests only
202
+ make test-kosong # run kosong tests only
203
+ make test-pykaos # run pykaos tests only
204
+ make build-web # build the web UI and sync it into the package (requires Node.js/npm)
205
+ make build # build python packages
206
+ make build-bin # build standalone binary
207
+ make help # show all make targets
208
+ ```
209
+
210
+ Note: `make build` and `make build-bin` automatically run `make build-web` to embed the web UI.
@@ -0,0 +1,174 @@
1
+ # Kimi Code CLI
2
+
3
+ [![Commit Activity](https://img.shields.io/github/commit-activity/w/MoonshotAI/kimi-cli)](https://github.com/MoonshotAI/kimi-cli/graphs/commit-activity)
4
+ [![Checks](https://img.shields.io/github/check-runs/MoonshotAI/kimi-cli/main)](https://github.com/MoonshotAI/kimi-cli/actions)
5
+ [![Version](https://img.shields.io/pypi/v/kimi-cli)](https://pypi.org/project/kimi-cli/)
6
+ [![Downloads](https://img.shields.io/pypi/dw/kimi-cli)](https://pypistats.org/packages/kimi-cli)
7
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/MoonshotAI/kimi-cli)
8
+
9
+ [Kimi Code](https://www.kimi.com/code/) | [Documentation](https://moonshotai.github.io/kimi-cli/en/) | [文档](https://moonshotai.github.io/kimi-cli/zh/)
10
+
11
+ Kimi Code CLI is an AI agent that runs in the terminal, helping you complete software development tasks and terminal operations. It can read and edit code, execute shell commands, search and fetch web pages, and autonomously plan and adjust actions during execution.
12
+
13
+ ## Getting Started
14
+
15
+ See [Getting Started](https://moonshotai.github.io/kimi-cli/en/guides/getting-started.html) for how to install and start using Kimi Code CLI.
16
+
17
+ ## Key Features
18
+
19
+ ### Shell command mode
20
+
21
+ Kimi Code CLI is not only a coding agent, but also a shell. You can switch the shell command mode by pressing `Ctrl-X`. In this mode, you can directly run shell commands without leaving Kimi Code CLI.
22
+
23
+ ![](./docs/media/shell-mode.gif)
24
+
25
+ > [!NOTE]
26
+ > Built-in shell commands like `cd` are not supported yet.
27
+
28
+ ### VS Code extension
29
+
30
+ Kimi Code CLI can be integrated with [Visual Studio Code](https://code.visualstudio.com/) via the [Kimi Code VS Code Extension](https://marketplace.visualstudio.com/items?itemName=moonshot-ai.kimi-code).
31
+
32
+ ![VS Code Extension](./docs/media/vscode.png)
33
+
34
+ ### IDE integration via ACP
35
+
36
+ Kimi Code CLI supports [Agent Client Protocol] out of the box. You can use it together with any ACP-compatible editor or IDE.
37
+
38
+ [Agent Client Protocol]: https://github.com/agentclientprotocol/agent-client-protocol
39
+
40
+ To use Kimi Code CLI with ACP clients, make sure to run Kimi Code CLI in the terminal and send `/login` to complete the login first. Then, you can configure your ACP client to start Kimi Code CLI as an ACP agent server with command `kimi acp`.
41
+
42
+ For example, to use Kimi Code CLI with [Zed](https://zed.dev/) or [JetBrains](https://blog.jetbrains.com/ai/2025/12/bring-your-own-ai-agent-to-jetbrains-ides/), add the following configuration to your `~/.config/zed/settings.json` or `~/.jetbrains/acp.json` file:
43
+
44
+ ```json
45
+ {
46
+ "agent_servers": {
47
+ "Kimi Code CLI": {
48
+ "type": "custom",
49
+ "command": "kimi",
50
+ "args": ["acp"],
51
+ "env": {}
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ Then you can create Kimi Code CLI threads in IDE's agent panel.
58
+
59
+ ![](./docs/media/acp-integration.gif)
60
+
61
+ ### Zsh integration
62
+
63
+ You can use Kimi Code CLI together with Zsh, to empower your shell experience with AI agent capabilities.
64
+
65
+ Install the [zsh-kimi-cli](https://github.com/MoonshotAI/zsh-kimi-cli) plugin via:
66
+
67
+ ```sh
68
+ git clone https://github.com/MoonshotAI/zsh-kimi-cli.git \
69
+ ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/kimi-cli
70
+ ```
71
+
72
+ > [!NOTE]
73
+ > If you are using a plugin manager other than Oh My Zsh, you may need to refer to the plugin's README for installation instructions.
74
+
75
+ Then add `kimi-cli` to your Zsh plugin list in `~/.zshrc`:
76
+
77
+ ```sh
78
+ plugins=(... kimi-cli)
79
+ ```
80
+
81
+ After restarting Zsh, you can switch to agent mode by pressing `Ctrl-X`.
82
+
83
+ ### MCP support
84
+
85
+ Kimi Code CLI supports MCP (Model Context Protocol) tools.
86
+
87
+ **`kimi mcp` sub-command group**
88
+
89
+ You can manage MCP servers with `kimi mcp` sub-command group. For example:
90
+
91
+ ```sh
92
+ # Add streamable HTTP server:
93
+ kimi mcp add --transport http context7 https://mcp.context7.com/mcp --header "CONTEXT7_API_KEY: ctx7sk-your-key"
94
+
95
+ # Add streamable HTTP server with OAuth authorization:
96
+ kimi mcp add --transport http --auth oauth linear https://mcp.linear.app/mcp
97
+
98
+ # Add stdio server:
99
+ kimi mcp add --transport stdio chrome-devtools -- npx chrome-devtools-mcp@latest
100
+
101
+ # List added MCP servers:
102
+ kimi mcp list
103
+
104
+ # Remove an MCP server:
105
+ kimi mcp remove chrome-devtools
106
+
107
+ # Authorize an MCP server:
108
+ kimi mcp auth linear
109
+ ```
110
+
111
+ **Ad-hoc MCP configuration**
112
+
113
+ Kimi Code CLI also supports ad-hoc MCP server configuration via CLI option.
114
+
115
+ Given an MCP config file in the well-known MCP config format like the following:
116
+
117
+ ```json
118
+ {
119
+ "mcpServers": {
120
+ "context7": {
121
+ "url": "https://mcp.context7.com/mcp",
122
+ "headers": {
123
+ "CONTEXT7_API_KEY": "YOUR_API_KEY"
124
+ }
125
+ },
126
+ "chrome-devtools": {
127
+ "command": "npx",
128
+ "args": ["-y", "chrome-devtools-mcp@latest"]
129
+ }
130
+ }
131
+ }
132
+ ```
133
+
134
+ Run `kimi` with `--mcp-config-file` option to connect to the specified MCP servers:
135
+
136
+ ```sh
137
+ kimi --mcp-config-file /path/to/mcp.json
138
+ ```
139
+
140
+ ### More
141
+
142
+ See more features in the [Documentation](https://moonshotai.github.io/kimi-cli/en/).
143
+
144
+ ## Development
145
+
146
+ To develop Kimi Code CLI, run:
147
+
148
+ ```sh
149
+ git clone https://github.com/MoonshotAI/kimi-cli.git
150
+ cd kimi-cli
151
+
152
+ make prepare # prepare the development environment
153
+ ```
154
+
155
+ Then you can start working on Kimi Code CLI.
156
+
157
+ Refer to the following commands after you make changes:
158
+
159
+ ```sh
160
+ uv run kimi # run Kimi Code CLI
161
+
162
+ make format # format code
163
+ make check # run linting and type checking
164
+ make test # run tests
165
+ make test-kimi-cli # run Kimi Code CLI tests only
166
+ make test-kosong # run kosong tests only
167
+ make test-pykaos # run pykaos tests only
168
+ make build-web # build the web UI and sync it into the package (requires Node.js/npm)
169
+ make build # build python packages
170
+ make build-bin # build standalone binary
171
+ make help # show all make targets
172
+ ```
173
+
174
+ Note: `make build` and `make build-bin` automatically run `make build-web` to embed the web UI.
@@ -0,0 +1,124 @@
1
+ [project]
2
+ name = "bhu-cli"
3
+ version = "1.46.0"
4
+ description = "Kimi Code CLI is your next CLI agent."
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = [
8
+ "agent-client-protocol==0.8.0",
9
+ "aiofiles>=24.0,<26.0",
10
+ "aiohttp==3.13.3",
11
+ "typer==0.21.1",
12
+ "kosong[contrib]==0.53.0",
13
+ # loguru stays >=0.6.0 because notify-py (via batrachian-toad) caps it at <=0.6.0 on 3.14+.
14
+ "loguru>=0.6.0,<0.8",
15
+ "prompt-toolkit==3.0.52",
16
+ "pillow==12.2.0",
17
+ "pyyaml==6.0.3",
18
+ "rich==14.2.0",
19
+ "ripgrepy==2.2.0",
20
+ "streamingjson==0.0.5",
21
+ "trafilatura==2.0.0",
22
+ # lxml is used by trafilatura/htmldate/justext; keep pinned for binary wheels.
23
+ "lxml==6.0.2",
24
+ "tenacity==9.1.2",
25
+ "fastmcp==3.2.4",
26
+ "pydantic==2.12.5",
27
+ "httpx[socks]==0.28.1",
28
+ "pykaos==0.9.0",
29
+ "batrachian-toad==0.5.23; python_version >= \"3.14\"",
30
+ "tomlkit==0.14.0",
31
+ "jinja2==3.1.6",
32
+ "pyobjc-framework-cocoa>=12.1 ; sys_platform == 'darwin'",
33
+ "fastapi>=0.115.0",
34
+ "uvicorn[standard]>=0.32.0",
35
+ "scalar-fastapi>=1.5.0",
36
+ "websockets>=14.0",
37
+ "keyring>=25.7.0",
38
+ "setproctitle>=1.3.0",
39
+ ]
40
+
41
+ [dependency-groups]
42
+ dev = [
43
+ "pyinstaller==6.18.0",
44
+ "inline-snapshot[black]>=0.31.1",
45
+ "pyright>=1.1.407",
46
+ "ty>=0.0.9",
47
+ "pytest>=9.0.2",
48
+ "pytest-asyncio>=1.3.0",
49
+ "ruff>=0.14.10",
50
+ ]
51
+
52
+ [build-system]
53
+ requires = ["uv_build>=0.8.5,<0.10.0"]
54
+ build-backend = "uv_build"
55
+
56
+ [tool.uv.build-backend]
57
+ module-name = ["kimi_cli"]
58
+ source-exclude = ["examples/**/*", "tests/**/*", "src/kimi_cli/deps/**/*"]
59
+
60
+ [tool.uv.workspace]
61
+ members = [
62
+ "packages/kosong",
63
+ "packages/kaos",
64
+ "packages/kimi-code",
65
+ "sdks/kimi-sdk",
66
+ ]
67
+
68
+ [tool.uv.sources]
69
+ kosong = { workspace = true }
70
+ pykaos = { workspace = true }
71
+ bhu-cli = { workspace = true }
72
+
73
+ [project.scripts]
74
+ kimi = "kimi_cli.__main__:main"
75
+ kimi-cli = "kimi_cli.__main__:main"
76
+
77
+ [tool.ruff]
78
+ line-length = 100
79
+
80
+ [tool.ruff.lint]
81
+ select = [
82
+ "E", # pycodestyle
83
+ "F", # Pyflakes
84
+ "UP", # pyupgrade
85
+ "B", # flake8-bugbear
86
+ "SIM", # flake8-simplify
87
+ "I", # isort
88
+ ]
89
+
90
+ [tool.ruff.lint.per-file-ignores]
91
+ "tests/**/*.py" = ["E501"]
92
+ "tests_e2e/**/*.py" = ["E501"]
93
+ "src/kimi_cli/web/api/**/*.py" = ["B008"] # FastAPI Depends() is standard usage
94
+
95
+ [tool.pyright]
96
+ typeCheckingMode = "standard"
97
+ pythonVersion = "3.14"
98
+ include = [
99
+ "src/**/*.py",
100
+ "tests/**/*.py",
101
+ "tests_ai/scripts/**/*.py",
102
+ "tests_e2e/**/*.py",
103
+ ]
104
+ strict = ["src/kimi_cli/**/*.py"]
105
+
106
+ [tool.ty.environment]
107
+ python-version = "3.14"
108
+
109
+ [tool.ty.src]
110
+ include = [
111
+ "src/**/*.py",
112
+ "tests/**/*.py",
113
+ "tests_ai/scripts/**/*.py",
114
+ "tests_e2e/**/*.py",
115
+ ]
116
+
117
+ [tool.typos.files]
118
+ extend-exclude = ["kimi.spec", "pyinstaller.py"]
119
+
120
+ [tool.typos.default.extend-words]
121
+ datas = "datas"
122
+ Seeked = "Seeked"
123
+ seeked = "seeked"
124
+ iterm = "iterm"