kimi-plugin-cc 2.7.3 → 3.1.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 (317) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +3 -16
  3. package/README.md +428 -515
  4. package/assets/logo.svg +6 -0
  5. package/cordis.patch.yml +18 -0
  6. package/dist/background-spawn.js +14 -19
  7. package/dist/cli-client.js +163 -105
  8. package/dist/commands/ask.js +44 -96
  9. package/dist/commands/cancel.js +11 -59
  10. package/dist/commands/cli-helpers.js +102 -1
  11. package/dist/commands/models.js +2 -3
  12. package/dist/commands/pursue.js +8 -21
  13. package/dist/commands/registry.js +7 -26
  14. package/dist/commands/repair-sessions.js +121 -12
  15. package/dist/commands/replay.js +4 -3
  16. package/dist/commands/rescue.js +29 -87
  17. package/dist/commands/result.js +7 -1
  18. package/dist/commands/review.js +28 -18
  19. package/dist/commands/setup.js +813 -462
  20. package/dist/commands/status.js +2 -2
  21. package/dist/commands/swarm.js +112 -125
  22. package/dist/commands/worker.js +1 -2
  23. package/dist/companion.js +145 -19
  24. package/dist/git.js +1 -9
  25. package/dist/help.js +13 -9
  26. package/dist/hook-escape.js +7 -16
  27. package/dist/hooks/approval-hook.js +1766 -87
  28. package/dist/hooks/approval-policy.js +86 -19
  29. package/dist/hooks/config-safety.js +31 -64
  30. package/dist/hooks/hook-timing.js +48 -0
  31. package/dist/hooks/install-paths.js +179 -107
  32. package/dist/hooks/install.js +126 -53
  33. package/dist/hooks/managed-block.js +121 -127
  34. package/dist/job-store.js +206 -166
  35. package/dist/jobs.js +66 -19
  36. package/dist/kimi-command.js +74 -1
  37. package/dist/kimi-engine.js +198 -127
  38. package/dist/kimi-errors.js +15 -70
  39. package/dist/kimi-home.js +6 -0
  40. package/dist/kimi-journal.js +42 -0
  41. package/dist/kimi-releases.js +123 -0
  42. package/dist/kimi-timeouts.js +2 -16
  43. package/dist/kimi-version-probe.js +24 -108
  44. package/dist/logging.js +12 -7
  45. package/dist/mcp/binding.js +13 -4
  46. package/dist/mcp/job-control.js +390 -95
  47. package/dist/mcp/launcher.js +13 -7
  48. package/dist/mcp/operations.js +405 -179
  49. package/dist/mcp/protocol.js +124 -33
  50. package/dist/mcp/skills.js +130 -0
  51. package/dist/mcp/stdio.js +18 -4
  52. package/dist/model-command.js +5 -3
  53. package/dist/native-v2-preflight.js +243 -80
  54. package/dist/parsing.js +211 -243
  55. package/dist/paths.js +28 -10
  56. package/dist/plugin-data.js +28 -83
  57. package/dist/process-tree.js +35 -24
  58. package/dist/read-scope.js +435 -0
  59. package/dist/render.js +58 -46
  60. package/dist/rescue-approval.js +461 -84
  61. package/dist/session-references.js +216 -0
  62. package/dist/session-title.js +26 -6
  63. package/dist/stream-json.js +1 -3
  64. package/dist/surface-routing.js +108 -0
  65. package/dist/swarm-activation.js +74 -188
  66. package/dist/swarm-policy.js +2 -1
  67. package/dist/swarm-recovery.js +2 -1
  68. package/dist/util.js +28 -0
  69. package/dist/version.js +1 -1
  70. package/docs/migration.md +45 -206
  71. package/docs/models.md +24 -66
  72. package/docs/safety.md +198 -353
  73. package/docs/session-visibility.md +25 -13
  74. package/docs/swarm-recovery.md +26 -20
  75. package/dsh/index.json +54 -0
  76. package/mcp_config.json +10 -0
  77. package/package.json +23 -82
  78. package/plugin.json +19 -0
  79. package/plugins/kimi-codex/.codex-plugin/plugin.json +7 -7
  80. package/plugins/kimi-codex/.mcp.json +3 -3
  81. package/plugins/kimi-codex/dist/background-spawn.js +14 -19
  82. package/plugins/kimi-codex/dist/cli-client.js +163 -105
  83. package/plugins/kimi-codex/dist/commands/ask.js +44 -96
  84. package/plugins/kimi-codex/dist/commands/cancel.js +11 -59
  85. package/plugins/kimi-codex/dist/commands/cli-helpers.js +102 -1
  86. package/plugins/kimi-codex/dist/commands/models.js +2 -3
  87. package/plugins/kimi-codex/dist/commands/pursue.js +8 -21
  88. package/plugins/kimi-codex/dist/commands/registry.js +7 -26
  89. package/plugins/kimi-codex/dist/commands/repair-sessions.js +121 -12
  90. package/plugins/kimi-codex/dist/commands/replay.js +4 -3
  91. package/plugins/kimi-codex/dist/commands/rescue.js +29 -87
  92. package/plugins/kimi-codex/dist/commands/result.js +7 -1
  93. package/plugins/kimi-codex/dist/commands/review.js +28 -18
  94. package/plugins/kimi-codex/dist/commands/setup.js +813 -462
  95. package/plugins/kimi-codex/dist/commands/status.js +2 -2
  96. package/plugins/kimi-codex/dist/commands/swarm.js +112 -125
  97. package/plugins/kimi-codex/dist/commands/worker.js +1 -2
  98. package/plugins/kimi-codex/dist/companion.js +145 -19
  99. package/plugins/kimi-codex/dist/git.js +1 -9
  100. package/plugins/kimi-codex/dist/help.js +13 -9
  101. package/plugins/kimi-codex/dist/hook-escape.js +7 -16
  102. package/plugins/kimi-codex/dist/hooks/approval-hook.js +1766 -87
  103. package/plugins/kimi-codex/dist/hooks/approval-policy.js +86 -19
  104. package/plugins/kimi-codex/dist/hooks/config-safety.js +31 -64
  105. package/plugins/kimi-codex/dist/hooks/hook-timing.js +48 -0
  106. package/plugins/kimi-codex/dist/hooks/install-paths.js +179 -107
  107. package/plugins/kimi-codex/dist/hooks/install.js +126 -53
  108. package/plugins/kimi-codex/dist/hooks/managed-block.js +121 -127
  109. package/plugins/kimi-codex/dist/job-store.js +206 -166
  110. package/plugins/kimi-codex/dist/jobs.js +66 -19
  111. package/plugins/kimi-codex/dist/kimi-command.js +74 -1
  112. package/plugins/kimi-codex/dist/kimi-engine.js +198 -127
  113. package/plugins/kimi-codex/dist/kimi-errors.js +15 -70
  114. package/plugins/kimi-codex/dist/kimi-home.js +6 -0
  115. package/plugins/kimi-codex/dist/kimi-journal.js +42 -0
  116. package/plugins/kimi-codex/dist/kimi-releases.js +123 -0
  117. package/plugins/kimi-codex/dist/kimi-timeouts.js +2 -16
  118. package/plugins/kimi-codex/dist/kimi-version-probe.js +24 -108
  119. package/plugins/kimi-codex/dist/logging.js +12 -7
  120. package/plugins/kimi-codex/dist/mcp/binding.js +13 -4
  121. package/plugins/kimi-codex/dist/mcp/job-control.js +390 -95
  122. package/plugins/kimi-codex/dist/mcp/launcher.js +13 -7
  123. package/plugins/kimi-codex/dist/mcp/operations.js +405 -179
  124. package/plugins/kimi-codex/dist/mcp/protocol.js +124 -33
  125. package/plugins/kimi-codex/dist/mcp/skills.js +130 -0
  126. package/plugins/kimi-codex/dist/mcp/stdio.js +18 -4
  127. package/plugins/kimi-codex/dist/model-command.js +5 -3
  128. package/plugins/kimi-codex/dist/native-v2-preflight.js +243 -80
  129. package/plugins/kimi-codex/dist/parsing.js +211 -243
  130. package/plugins/kimi-codex/dist/paths.js +28 -10
  131. package/plugins/kimi-codex/dist/plugin-data.js +28 -83
  132. package/plugins/kimi-codex/dist/process-tree.js +35 -24
  133. package/plugins/kimi-codex/dist/read-scope.js +435 -0
  134. package/plugins/kimi-codex/dist/render.js +58 -46
  135. package/plugins/kimi-codex/dist/rescue-approval.js +461 -84
  136. package/plugins/kimi-codex/dist/session-references.js +216 -0
  137. package/plugins/kimi-codex/dist/session-title.js +26 -6
  138. package/plugins/kimi-codex/dist/stream-json.js +1 -3
  139. package/plugins/kimi-codex/dist/surface-routing.js +108 -0
  140. package/plugins/kimi-codex/dist/swarm-activation.js +74 -188
  141. package/plugins/kimi-codex/dist/swarm-policy.js +2 -1
  142. package/plugins/kimi-codex/dist/swarm-recovery.js +2 -1
  143. package/plugins/kimi-codex/dist/util.js +28 -0
  144. package/plugins/kimi-codex/dist/version.js +1 -1
  145. package/plugins/kimi-codex/scripts/companion.sh +4 -15
  146. package/plugins/kimi-codex/skills/kimi/SKILL.md +77 -0
  147. package/plugins/kimi-codex/skills/kimi/agents/openai.yaml +6 -0
  148. package/scripts/companion.sh +4 -15
  149. package/skills/kimi/SKILL.md +77 -0
  150. package/skills/kimi/agents/openai.yaml +6 -0
  151. package/CHANGELOG.md +0 -1333
  152. package/agents/kimi-ask.md +0 -89
  153. package/agents/kimi-challenge.md +0 -86
  154. package/agents/kimi-pursue.md +0 -93
  155. package/agents/kimi-rescue.md +0 -92
  156. package/agents/kimi-review.md +0 -86
  157. package/agents/kimi-swarm-write.md +0 -96
  158. package/agents/kimi-swarm.md +0 -86
  159. package/commands/README.md +0 -16
  160. package/commands/ask.md +0 -38
  161. package/commands/cancel.md +0 -17
  162. package/commands/challenge.md +0 -35
  163. package/commands/pursue.md +0 -41
  164. package/commands/replay.md +0 -13
  165. package/commands/rescue.md +0 -38
  166. package/commands/result.md +0 -13
  167. package/commands/review.md +0 -35
  168. package/commands/setup.md +0 -23
  169. package/commands/status.md +0 -13
  170. package/commands/swarm.md +0 -44
  171. package/dist/commands/not-implemented.js +0 -4
  172. package/dist/commands/review-gate.js +0 -390
  173. package/dist/config.js +0 -22
  174. package/dist/dsh/companion.js +0 -177
  175. package/dist/dsh/index.js +0 -169
  176. package/dist/hooks/review-gate-stop.js +0 -19
  177. package/dist/schemas/review-gate-output.js +0 -43
  178. package/docs/registry-releases.md +0 -228
  179. package/docs/upstream-2.4.1-certification.md +0 -54
  180. package/docs/upstream-2.5.0-certification.md +0 -52
  181. package/docs/upstream-2.5.1-certification.md +0 -47
  182. package/docs/upstream-2.5.2-certification.md +0 -40
  183. package/docs/upstream-2.5.3-certification.md +0 -73
  184. package/docs/upstream-2.6.0-certification.md +0 -65
  185. package/docs/upstream-2.6.2-certification.md +0 -144
  186. package/docs/upstream-2.6.3-certification.md +0 -100
  187. package/docs/upstream-2.7.2-certification.md +0 -113
  188. package/docs/upstream-2.7.3-certification.md +0 -83
  189. package/docs/windows-validation.md +0 -39
  190. package/hooks/README.md +0 -9
  191. package/hooks/hooks.json +0 -16
  192. package/plugins/kimi-codex/dist/commands/not-implemented.js +0 -4
  193. package/plugins/kimi-codex/dist/commands/review-gate.js +0 -390
  194. package/plugins/kimi-codex/dist/config.js +0 -22
  195. package/plugins/kimi-codex/dist/dsh/companion.js +0 -177
  196. package/plugins/kimi-codex/dist/dsh/index.js +0 -169
  197. package/plugins/kimi-codex/dist/hooks/review-gate-stop.js +0 -19
  198. package/plugins/kimi-codex/dist/schemas/review-gate-output.js +0 -43
  199. package/plugins/kimi-codex/scripts/review-gate-hook.sh +0 -32
  200. package/plugins/kimi-codex/skills/kimi-ask/SKILL.md +0 -35
  201. package/plugins/kimi-codex/skills/kimi-ask/agents/openai.yaml +0 -6
  202. package/plugins/kimi-codex/skills/kimi-cancel/SKILL.md +0 -25
  203. package/plugins/kimi-codex/skills/kimi-cancel/agents/openai.yaml +0 -6
  204. package/plugins/kimi-codex/skills/kimi-challenge/SKILL.md +0 -34
  205. package/plugins/kimi-codex/skills/kimi-challenge/agents/openai.yaml +0 -6
  206. package/plugins/kimi-codex/skills/kimi-pursue/SKILL.md +0 -32
  207. package/plugins/kimi-codex/skills/kimi-pursue/agents/openai.yaml +0 -6
  208. package/plugins/kimi-codex/skills/kimi-replay/SKILL.md +0 -25
  209. package/plugins/kimi-codex/skills/kimi-replay/agents/openai.yaml +0 -6
  210. package/plugins/kimi-codex/skills/kimi-rescue/SKILL.md +0 -34
  211. package/plugins/kimi-codex/skills/kimi-rescue/agents/openai.yaml +0 -6
  212. package/plugins/kimi-codex/skills/kimi-result/SKILL.md +0 -25
  213. package/plugins/kimi-codex/skills/kimi-result/agents/openai.yaml +0 -6
  214. package/plugins/kimi-codex/skills/kimi-review/SKILL.md +0 -34
  215. package/plugins/kimi-codex/skills/kimi-review/agents/openai.yaml +0 -6
  216. package/plugins/kimi-codex/skills/kimi-setup/SKILL.md +0 -34
  217. package/plugins/kimi-codex/skills/kimi-setup/agents/openai.yaml +0 -6
  218. package/plugins/kimi-codex/skills/kimi-status/SKILL.md +0 -25
  219. package/plugins/kimi-codex/skills/kimi-status/agents/openai.yaml +0 -6
  220. package/plugins/kimi-codex/skills/kimi-swarm/SKILL.md +0 -35
  221. package/plugins/kimi-codex/skills/kimi-swarm/agents/openai.yaml +0 -6
  222. package/plugins/kimi-codex/skills/kimi-swarm-write/SKILL.md +0 -36
  223. package/plugins/kimi-codex/skills/kimi-swarm-write/agents/openai.yaml +0 -6
  224. package/plugins/kimi-dsh/LICENSE +0 -201
  225. package/plugins/kimi-dsh/README.md +0 -83
  226. package/plugins/kimi-dsh/cordis.patch.yml +0 -45
  227. package/plugins/kimi-dsh/dist/background-spawn.js +0 -216
  228. package/plugins/kimi-dsh/dist/cli-cancellation.js +0 -43
  229. package/plugins/kimi-dsh/dist/cli-client.js +0 -1078
  230. package/plugins/kimi-dsh/dist/commands/ask.js +0 -336
  231. package/plugins/kimi-dsh/dist/commands/cancel.js +0 -216
  232. package/plugins/kimi-dsh/dist/commands/cli-helpers.js +0 -201
  233. package/plugins/kimi-dsh/dist/commands/models.js +0 -140
  234. package/plugins/kimi-dsh/dist/commands/not-implemented.js +0 -4
  235. package/plugins/kimi-dsh/dist/commands/pursue.js +0 -307
  236. package/plugins/kimi-dsh/dist/commands/recover-swarm.js +0 -140
  237. package/plugins/kimi-dsh/dist/commands/registry.js +0 -74
  238. package/plugins/kimi-dsh/dist/commands/repair-sessions.js +0 -160
  239. package/plugins/kimi-dsh/dist/commands/replay.js +0 -124
  240. package/plugins/kimi-dsh/dist/commands/rescue.js +0 -347
  241. package/plugins/kimi-dsh/dist/commands/result.js +0 -66
  242. package/plugins/kimi-dsh/dist/commands/review-gate.js +0 -390
  243. package/plugins/kimi-dsh/dist/commands/review.js +0 -220
  244. package/plugins/kimi-dsh/dist/commands/setup.js +0 -1129
  245. package/plugins/kimi-dsh/dist/commands/status.js +0 -27
  246. package/plugins/kimi-dsh/dist/commands/swarm.js +0 -849
  247. package/plugins/kimi-dsh/dist/commands/worker.js +0 -25
  248. package/plugins/kimi-dsh/dist/companion.js +0 -97
  249. package/plugins/kimi-dsh/dist/config.js +0 -22
  250. package/plugins/kimi-dsh/dist/dsh/companion.js +0 -177
  251. package/plugins/kimi-dsh/dist/dsh/index.js +0 -169
  252. package/plugins/kimi-dsh/dist/errors.js +0 -40
  253. package/plugins/kimi-dsh/dist/git.js +0 -224
  254. package/plugins/kimi-dsh/dist/help.js +0 -43
  255. package/plugins/kimi-dsh/dist/hook-escape.js +0 -71
  256. package/plugins/kimi-dsh/dist/hooks/approval-hook.js +0 -104
  257. package/plugins/kimi-dsh/dist/hooks/approval-policy.js +0 -233
  258. package/plugins/kimi-dsh/dist/hooks/config-safety.js +0 -665
  259. package/plugins/kimi-dsh/dist/hooks/install-paths.js +0 -428
  260. package/plugins/kimi-dsh/dist/hooks/install.js +0 -210
  261. package/plugins/kimi-dsh/dist/hooks/managed-block.js +0 -684
  262. package/plugins/kimi-dsh/dist/hooks/review-gate-stop.js +0 -19
  263. package/plugins/kimi-dsh/dist/job-id.js +0 -12
  264. package/plugins/kimi-dsh/dist/job-store.js +0 -659
  265. package/plugins/kimi-dsh/dist/jobs.js +0 -217
  266. package/plugins/kimi-dsh/dist/kimi-command.js +0 -71
  267. package/plugins/kimi-dsh/dist/kimi-engine.js +0 -675
  268. package/plugins/kimi-dsh/dist/kimi-errors.js +0 -260
  269. package/plugins/kimi-dsh/dist/kimi-home.js +0 -9
  270. package/plugins/kimi-dsh/dist/kimi-timeouts.js +0 -52
  271. package/plugins/kimi-dsh/dist/kimi-version-probe.js +0 -234
  272. package/plugins/kimi-dsh/dist/logging.js +0 -22
  273. package/plugins/kimi-dsh/dist/mcp/binding.js +0 -58
  274. package/plugins/kimi-dsh/dist/mcp/job-control.js +0 -345
  275. package/plugins/kimi-dsh/dist/mcp/launcher.js +0 -257
  276. package/plugins/kimi-dsh/dist/mcp/operations.js +0 -301
  277. package/plugins/kimi-dsh/dist/mcp/protocol.js +0 -275
  278. package/plugins/kimi-dsh/dist/mcp/server.js +0 -8
  279. package/plugins/kimi-dsh/dist/mcp/stdio.js +0 -78
  280. package/plugins/kimi-dsh/dist/mcp/supervised-child.js +0 -15
  281. package/plugins/kimi-dsh/dist/mcp/tool-result.js +0 -7
  282. package/plugins/kimi-dsh/dist/mcp/workspace.js +0 -34
  283. package/plugins/kimi-dsh/dist/model-command.js +0 -32
  284. package/plugins/kimi-dsh/dist/native-v2-preflight.js +0 -525
  285. package/plugins/kimi-dsh/dist/package.json +0 -1
  286. package/plugins/kimi-dsh/dist/parsing.js +0 -620
  287. package/plugins/kimi-dsh/dist/paths.js +0 -27
  288. package/plugins/kimi-dsh/dist/plugin-data.js +0 -98
  289. package/plugins/kimi-dsh/dist/process-tree.js +0 -586
  290. package/plugins/kimi-dsh/dist/prompt-size.js +0 -18
  291. package/plugins/kimi-dsh/dist/render.js +0 -177
  292. package/plugins/kimi-dsh/dist/rescue-approval.js +0 -865
  293. package/plugins/kimi-dsh/dist/schemas/review-gate-output.js +0 -43
  294. package/plugins/kimi-dsh/dist/session-recovery.js +0 -202
  295. package/plugins/kimi-dsh/dist/session-title.js +0 -293
  296. package/plugins/kimi-dsh/dist/stream-json.js +0 -346
  297. package/plugins/kimi-dsh/dist/swarm-activation.js +0 -1197
  298. package/plugins/kimi-dsh/dist/swarm-policy.js +0 -73
  299. package/plugins/kimi-dsh/dist/swarm-recovery.js +0 -165
  300. package/plugins/kimi-dsh/dist/swarm-tool-policy.js +0 -146
  301. package/plugins/kimi-dsh/dist/types.js +0 -1
  302. package/plugins/kimi-dsh/dist/vendor/shell-quote/LICENSE +0 -24
  303. package/plugins/kimi-dsh/dist/vendor/shell-quote/index.js +0 -1
  304. package/plugins/kimi-dsh/dist/vendor/shell-quote/parse.js +0 -229
  305. package/plugins/kimi-dsh/dist/vendor/smol-toml/LICENSE +0 -24
  306. package/plugins/kimi-dsh/dist/vendor/smol-toml/date.js +0 -156
  307. package/plugins/kimi-dsh/dist/vendor/smol-toml/error.js +0 -67
  308. package/plugins/kimi-dsh/dist/vendor/smol-toml/extract.js +0 -293
  309. package/plugins/kimi-dsh/dist/vendor/smol-toml/parse.js +0 -164
  310. package/plugins/kimi-dsh/dist/vendor/smol-toml/primitive.js +0 -151
  311. package/plugins/kimi-dsh/dist/vendor/smol-toml/struct.js +0 -156
  312. package/plugins/kimi-dsh/dist/vendor/smol-toml/util.js +0 -57
  313. package/plugins/kimi-dsh/dist/version.js +0 -7
  314. package/plugins/kimi-dsh/package.json +0 -78
  315. package/plugins/kimi-dsh/scripts/companion.sh +0 -37
  316. package/plugins/kimi-dsh/scripts/review-gate-hook.sh +0 -32
  317. package/scripts/review-gate-hook.sh +0 -32
package/docs/migration.md CHANGED
@@ -1,231 +1,70 @@
1
1
  # Compatibility and upgrades
2
2
 
3
- The runtime certifies exact CLI releases per operation. Plugin 2.6.2 adds bounded swarm on exact stock CLI 2.6.2; see the [certification receipt](upstream-2.6.2-certification.md) for validation status. Plugin 2.6.3 additionally certifies exact CLI 2.6.3 with a separate [release receipt](upstream-2.6.3-certification.md); the immutable GitHub/npm release and fresh registry verification are complete. Plugin 2.7.2 certifies exact CLI 2.7.2 with separate [certification evidence](upstream-2.7.2-certification.md). Plugin 2.7.3 adds exact CLI 2.7.3 under the same construction with a separate [certification record](upstream-2.7.3-certification.md); publication does not change the compatibility matrix. Exact 2.6.0 remains non-swarm-only. Older full-operation rows through 2.5.3 keep their inherited recovery limitation. `NATIVE_V2_CERTIFIED_VERSIONS` is the all-operation export, and `NATIVE_V2_ANY_OPERATION_VERSIONS` is the scoped union. Other versions, including 2.6.1, 2.6.4, 2.7.0, 2.7.1 and 2.7.4, are not accepted automatically. The npm channel does not change the compatibility matrix.
3
+ Plugin 3.1.0 certifies exact Kimi Code CLI `2.8.0` for all 7 model operations: `ask`, `review`, `challenge`, `rescue`, `pursue`, `swarm`, and `swarm-write`. It introduces a rolling compatibility window starting at `2.8.0`. You can review the test evidence in [the 2.8.0 certification record](upstream-2.8.0-certification.md).
4
4
 
5
- Plugin 2.5.1 also adds DeepSeek Harness as a third host with all seven operations and a DSH-specific bundle, data root, and managed hook id. Existing Claude Code and Codex certification, job stores, and host-scoped hooks are unchanged; no migration is required for those hosts. New DSH installations follow the [README DSH section](../README.md#install-in-deepseek-harness), including `/kimi-setup` on that host.
5
+ Unlisted plain `2.y.z` releases above `2.8.0` run read-only operations (`ask`, `review`, and `challenge`) with a warning and borrow only `--environment local`. The plugin refuses write and swarm operations, `--network`, pre-release or build suffixes, and other major versions before spawn (`KIMI_CAPABILITY_NOT_CERTIFIED`). Setting `KIMI_PLUGIN_CC_STRICT_VERSIONS=1` also refuses all unlisted versions before spawn.
6
6
 
7
- Explicitly pinned legacy-v1 binaries remain supported within `KIMI_TESTED_MINORS`, through 0.41.x, subject to each operation's minimum version. The [runtime table](../runtime/kimi-engine.ts) is the authority.
7
+ Plugin 3.1.0 removes Kimi Code releases below `2.8.0` and the `legacy-v1` engine (`0.1` to `0.41`). Those versions refuse before spawn. You can still read historical `legacy-v1` job rows through `job status`, `job result`, and `job replay`, but you cannot resume them. The [runtime release table](../runtime/kimi-releases.ts) is the single source of truth for certified versions.
8
8
 
9
- Use the [README installation and update steps](../README.md) for Claude Code or Codex. Model and provider choices are covered in the [model setup guide](./models.md). Do not change your host application's authentication to configure Kimi.
9
+ See the [README](../README.md) for installation steps across Claude Code, Codex, Antigravity, DeepSeek Harness (DSH), and Magpie. See the [model setup guide](./models.md) for model aliases and provider login. Never alter your host application login to configure Kimi.
10
10
 
11
- ## Plugin versions and upgrades
11
+ ## Plugin versions and compatibility
12
12
 
13
- Plugin versions advance independently using ordinary SemVer and may deliberately align with a certified CLI release. Nearby version numbers do not imply compatibility or operation scope; the exact per-operation matrix is authoritative. Published versions and tags are never reused. Every upstream patch requires its own certification. The native-v2 no-plan profile, plugin/marketplace IDs and existing job store are preserved.
13
+ Plugin versions advance independently using semantic versioning and may match a certified CLI release number. Similar version numbers do not imply compatibility, so check the per-operation table in `runtime/kimi-releases.ts`. Published versions and Git tags never change.
14
14
 
15
- ## Plugin 2.6.2 swarm behavior on exact CLI 2.6.2
15
+ ## Upgrading from 3.0 to 3.1
16
16
 
17
- Concurrency 1 uses one direct worker without native swarm activation or delegation. The default for write mode remains 1; its edits still produce an unapplied patch from a temporary worktree. Read mode defaults to 4 and uses guarded waves. At concurrency 2 or more, new and resumed entries share the wave limit; a model must divide larger tasks into successive waves. Fresh-only waves require at least two entries, so group odd target counts into disjoint entries or resume an own-session child for remaining work. `--cap` remains an advisory lifetime-total count.
17
+ Plugin 3.1.0 consolidates all 5 host integrations onto one shared architecture. Every host now uses 4 MCP tools, one `kimi` skill (`skill://kimi/SKILL.md`), 5 primary CLI subcommands, one shared data directory, and one PreToolUse hook block.
18
18
 
19
- The plugin overrides native swarm-child timeout, so a stuck child holds its wave until completion or finite whole-job stop. It disables native Bash backgrounding in owned parallel sessions and denies explicit background Bash. Both normal exit and cancellation settle verified owned processes before artifacts or patches are captured. Concurrency counts Kimi child-agent turns, not subprocesses started by allowed repository tests; individual Bash timeout does not prove those descendants stop between waves. No user timeout configuration change or patched CLI installation is needed. Older exact CLI versions keep their prior behavior. Update the active host plugin and run its setup/check so its canonical hook contains the new policy; re-pinning an older runtime does not add that policy.
19
+ ### Surface and packaging changes
20
20
 
21
- Parallel Bash commands use the native 60-second default foreground timeout, with a 300-second maximum, and are killed on expiry. Use concurrency 1 for longer tests: automatic timeout-to-background remains available there, root-agent turns stay sequential, and result capture still waits for whole-job settlement. The parallel session's native TaskStop policy remains after deactivation; external interactive resume is outside the managed-job guarantee.
21
+ | Area | Plugin 3.0.x | Plugin 3.1.0 |
22
+ | --- | --- | --- |
23
+ | Minimum Kimi Code CLI | Exact rows from `0.42.0` to `2.7.3` plus pinned `legacy-v1` (`<= 0.41.x`) | Rolling floor `>= 2.8.0`, exact `2.8.0` certified for all 7 operations, `< 2.8.0` and `legacy-v1` removed |
24
+ | MCP tools | 9 tools (`kimi_ask`, `kimi_review`, `kimi_rescue`, `kimi_pursue`, `kimi_swarm`, `kimi_swarm_write`, `kimi_job_status`, `kimi_job_result`, `kimi_job_cancel`) | 4 tools (`kimi_read`, `kimi_write`, `kimi_job`, `kimi_setup`) plus `SEP-2640` (`skills/list`, `skills/get`, `resources/list`, `resources/read` for `skill://kimi/SKILL.md` and `agents/openai.yaml`) |
25
+ | Standard MCP `tools/call` | Returned a running handle unless already settled | Defaults to `wait: true` with a 50-second `wait_timeout_ms` (up to `86400000` ms), stops polling on disconnect without canceling the job, and returns a launch handle when `wait: false` |
26
+ | Claude Code commands, agents, and Stop hook | 9 slash commands (`/kimi:*`), 4 agents (`kimi-*`), optional `review_gate` Stop hook (`--enable-review-gate`) | Removed in favor of the 4 MCP tools and `skills/kimi/SKILL.md` |
27
+ | Codex skills | 9 shell-backed skills (`$kimi-task`, `$kimi-review`, `$kimi-setup`, and others) | One `$kimi` skill (`skills/kimi/SKILL.md` and `agents/openai.yaml`) plus the 4 MCP tools |
28
+ | DeepSeek Harness (DSH) | Custom `plugins/kimi-dsh/` bundle with `runtime/dsh/` and 7 custom providers | Root `cordis.patch.yml` mounting `@deepseek-ai/dsh-mcp-client` and `@deepseek-ai/dsh-skill-filesystem` |
29
+ | Supported hosts | Claude Code, Codex, DSH | 5 hosts: Claude Code, Codex, Antigravity (`plugin.json`, `mcp_config.json`, `assets/logo.svg`), DSH, and Magpie (`magpie library mcp add`) |
30
+ | Primary CLI subcommands | `ask`, `review`, `task`, `status`, `result`, `cancel`, `replay`, `setup`, `recover-swarm`, `repair-sessions`, `mcp` | 5 primary subcommands: `read`, `write`, `job`, `setup`, `mcp` (older names remain as compatibility aliases) |
31
+ | Plugin data directory | Per-host `CLAUDE_PLUGIN_DATA`, `PLUGIN_DATA`, or `$DSH_HOME/plugin-data/kimi-plugin-cc` | One shared root: `~/.local/share/kimi-plugin-cc` (or `$XDG_DATA_HOME/kimi-plugin-cc`) on macOS and Linux, `%LOCALAPPDATA%\kimi-plugin-cc` on Windows, or `$KIMI_PLUGIN_CC_DATA/kimi-plugin-cc` |
32
+ | Managed PreToolUse hook | Per-host `:<host-id>` blocks pointing at version-stamped `dist/hooks/approval-hook.js` paths and `--uninstall --all` | One bundled ESM `<pluginRoot>/hook/approval-hook.js` published by `setup` and one `# === BEGIN kimi-plugin-cc-managed (v3.1.0) ===` block |
22
33
 
23
- ## Native parallel swarm activation
34
+ ### Runtime behavior changes
24
35
 
25
- Upstream 2.3.2 removes model self-activation of `AgentSwarm` in fresh print sessions. On exact 2.3.2, 2.3.3, 2.4.0, 2.4.1 and 2.5.0/2.5.1/2.5.2/2.5.3, plus the exact-2.6.2/2.6.3/2.7.2/2.7.3 parallel paths, swarm commands and MCP calls use the same `runSwarm` lifecycle. The direct single-worker path skips it:
36
+ Plugin 3.1.0 includes 5 runtime behavior updates:
26
37
 
27
- 1. A short-lived `web --no-open --host 127.0.0.1 --port 0 --log-level error` process uses authenticated loopback routes to verify the exact v2 server, choose the explicit or configured default model, create a session, bind the model and auto permission, enable and verify `swarm_mode`, and shut down. Exact 2.7.2/2.7.3 instead uses `web --json` with an in-memory ephemeral token, a validated loopback origin and `/api/v1/ws`, and KAP 1.0.0/WebSocket meta proof without a legacy backend field. On exact 2.5.0/2.5.1/2.5.2/2.5.3 and the bounded 2.6.2/2.6.3/2.7.2/2.7.3 paths, creation explicitly selects the local environment and an authenticated `/environment` read proves its cwd before profile mutation; state verification uses protocol-v2 or direct-subscription WebSocket main-agent frames because `/status` was removed. The child environment sets `KIMI_CODE_SESSION_IDLE_RECLAIM_MS=0` to disable ambient idle-session reclamation.
28
- 2. One ordinary `kimi -p -r` prompt runner resumes that session. Its recorded session-id source is `preactivated`, and the returned print session must match it.
29
- 3. A second short-lived web lifecycle rechecks the local binding on 2.5.0/2.5.1/2.5.2/2.5.3/2.6.2/2.6.3/2.7.2/2.7.3, disables swarm mode, verifies the version-appropriate state proof and the `swarm_mode.exit` journal record, and shuts down.
38
+ - session references allow `--reference-session <job-id|session-id>` and MCP `referenced_sessions` (up to 8) to attach earlier session paths without reading log content
39
+ - tower-mode resume checks refuse sessions left in tower mode with `KIMI_SESSION_TOWER_ACTIVE` until you turn `/tower` off or start a new session
40
+ - uncertified release checks warn on enabled `[experimental]` settings for unlisted `2.y.z > 2.8.0` builds while still forcing tower and subagent fork off
41
+ - tool allowlists permit Kimi's `WaitFor` tool across every operation label so `pursue` and background tests avoid wasted denials
42
+ - journal scans accept Kimi's 3 durable MCP bookkeeping records (`mcp.tools_discovered`, `mcp.server_failed`, `mcp.server_failure_resolved`) inside a canceled create-time plan-mode pair
30
43
 
31
- Activation is inside the job's finite budget. Graceful process close has a bounded 15-second allowance. `runSwarm` solely owns deactivation: normal cleanup uses the remaining budget, while failure recovery has a separate two-second cancellation-aware bound and is never retried. Print/session failures stay primary. The ready token stays in memory and out of logs, and success cannot complete if cleanup fails. Post-mutation identity or process/group uncertainty preserves diagnostics and, for write-swarm, the recovery worktree. Process groups are rechecked after teardown; unknown survivors are unverified and unproven groups are not signalled. Older certified versions still launch swarm directly with `kimi -p`. This narrow lifecycle is not a full RPC transport or a model-driven activation workaround; the managed hook and workspace boundaries still govern every tool call.
44
+ ### Upgrade steps
32
45
 
33
- After updating the plugin, run Claude Code `/kimi:setup` or Codex `$kimi-setup`
34
- from that host's active install to re-pin its version-stamped hook path, then
35
- run setup with `--check`. This fixes path drift, not policy omissions in an older installed plugin. Older coexisting hooks still veto pursue goal-status tools; update each host only when authorized. Keep `default_plan_mode` absent or false. Upgrades
36
- from pre-1.10 releases must also follow the historical native-v2 migration section below.
46
+ 1. Update Kimi Code CLI to `2.8.0` or newer, or let the plugin install a dedicated copy in step 4.
47
+ 2. Update the plugin in each host you use. If you installed `plugins/kimi-dsh` in DSH, remove it and add the root package with `dsh plugin --profile web add kimi-plugin-cc`.
48
+ 3. Run setup once from any host with `kimi_setup({ action: "install" })` or `./scripts/companion.sh setup`. Setup rejects symlinks under `pluginRoot` and `hook/`, probes the staged hook before activating `<pluginRoot>/hook/approval-hook.js`, and merges legacy `:<host-id>` blocks in `~/.kimi-code/config.toml`. If 2 hosts use different Node binaries, set `KIMI_PLUGIN_CC_NODE_BIN` to the same absolute Node `22.5` or newer path in both hosts.
49
+ 4. Run `kimi_setup({ action: "install_kimi" })` or `./scripts/companion.sh setup --install-kimi` if you want a plugin-owned certified `2.8.0` binary shared across all hosts.
50
+ 5. Run `kimi_setup({ action: "check" })` or `./scripts/companion.sh setup --check` and confirm that the output shows `Probe: ok`.
37
51
 
38
- ## Historical migration instructions
52
+ ### Previous job databases
39
53
 
40
- <details>
41
- <summary>Earlier migrations from the Python CLI and legacy engine</summary>
54
+ Plugin 3.1.0 does not move or delete your 3.0 per-host job databases (`plugins/data/.../kimi-plugin-cc/state.db` or `$DSH_HOME/plugin-data/kimi-plugin-cc/state.db`). New jobs write to the shared canonical data directory (`~/.local/share/kimi-plugin-cc` on POSIX, or `%LOCALAPPDATA%\kimi-plugin-cc` on Windows). To inspect or reuse a 3.0 database, set `KIMI_PLUGIN_CC_DATA` to the parent directory that contains `kimi-plugin-cc/`.
42
55
 
43
- These sections record earlier upgrades. Old tags, paths, and installation commands are historical examples, not the current installation procedure. Follow the current guidance above for the current release.
56
+ ## Parallel swarm behavior
44
57
 
45
- ## Migrating from v0.4 to v1.0
58
+ The `--max-concurrency` flag defaults to `4` for read-only swarms and `1` for write swarms (`swarm_patch`). On exact `2.8.0`, concurrency `1` runs one direct worker in print mode without swarm activation or subagent delegation. Write mode at concurrency `1` still uses a temporary Git worktree and captures an unapplied patch.
46
59
 
47
- v1.0 of kimi-plugin-cc targets the **kimi-code** Node.js binary (Moonshot's successor to Kimi CLI). The v0.4.x line targeted the Python **Kimi CLI** over its Wire JSON-RPC transport. kimi-code dropped the Wire transport from its first release, so v1.0 is a hard cut rather than a backwards-compatible upgrade.
60
+ At concurrency `2` or higher, `runSwarm` uses bounded waves and short-lived `kimi web --json` activation with a short-lived in-memory token.
48
61
 
49
- If you're already running v0.4.x with the Python Kimi CLI, you have a choice:
62
+ 1. Activation starts `kimi web --json` and validates the loopback origin, `/api/v1/ws`, exact server version, and KAP `1.0.0` metadata. It creates a session in the canonical execution root with `environment_id: "local"`, `permission_mode: "auto"`, and `swarm_mode: true`. It verifies the WebSocket subscription state, stops within 15 seconds, confirms `swarm_mode.enter`, and disables native `TaskStop` before print starts.
63
+ 2. One `kimi -p -r` runner executes the prompt with `kimi_session_id_source: "preactivated"`. Every coordinator and subagent tool call passes the PreToolUse hook, which enforces wave limits across `items` and `resume_agent_ids`. The hook also denies forks, fresh singleton waves, and explicit background Bash commands. Setting `KIMI_CODE_SWARM_TIMEOUT_MS=2147483647` keeps slow children active until they finish or hit the finite job budget.
64
+ 3. Deactivation runs a second bounded `kimi web --json` lifecycle to recheck the local binding, set `swarm_mode: false`, verify `swarm_mode.exit`, and shut down. Both normal exit and cancellation wait for verified process quiescence before capturing artifacts or patches.
50
65
 
51
- - **Stay on v0.4** if you depend on `kimi --wire`. The [`v0.4.0`](https://github.com/linxule/kimi-plugin-cc/releases/tag/v0.4.0) tag is the stable reference point; a `v0.4-maintenance` branch is cut from that tag for ongoing fixes (once published, pin to it via `linxule/kimi-plugin-cc@v0.4-maintenance`).
52
- - **Upgrade to v1.0** if you've installed (or are willing to install) kimi-code. v1.0 gets the new safety story (PreToolUse hook), kimi-code's vis-server integration for free, and a leaner subprocess transport.
66
+ Parallel Bash commands use Kimi's 60-second default and 300-second maximum foreground timeout. Use concurrency `1` for longer test runs, and see [swarm recovery](./swarm-recovery.md) to clean up interrupted runs.
53
67
 
54
- ## What changes between v0.4 and v1.0
68
+ ## Earlier upgrades
55
69
 
56
- | | v0.4 | v1.0 |
57
- |---|---|---|
58
- | Backing CLI | Python [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) | [kimi-code](https://kimi.com/code/docs) (Node.js) |
59
- | Transport | `kimi --wire` (JSON-RPC over stdio) | `kimi -p --output-format stream-json` (subprocess + NDJSON) |
60
- | Per-command safety | YAML agent profiles (`exclude_tools`) shipped in the plugin | PreToolUse hook installed in `~/.kimi-code/config.toml` |
61
- | Session id | Client-assigned UUID, passed via `--session` | Server-minted, captured from kimi's stream-json `session.resume_hint` record (stderr announce fallback) |
62
- | Web UI integration | `kimi web` + PATCH `/api/sessions/{id}` for pre-run human-readable titles | Shared Desktop/Web session store, repaired prompt previews and replaceable fallback titles for native-v2 sessions |
63
- | Replay log format | Wire JSON-RPC events (`{direction, message}`) | cli-client NDJSON (`{event, record}`) |
64
- | Marketplace name | `kimi-marketplace` (plugin: `kimi`) — unchanged | same `kimi-marketplace` / `kimi` (v1 upgrades in place) |
65
- | Rescue allowlist | In-band approval policy on the Wire client | Out-of-band via the PreToolUse hook (same allowlist code) |
66
-
67
- The marketplace + plugin IDs are unchanged from v0.4, so an existing install can update in place — but only after kimi-code is installed locally. Without kimi-code the new transport has nothing to spawn, so the order matters: install kimi-code first, then update the plugin.
68
-
69
- ## Upgrade procedure
70
-
71
- ### 1. Install kimi-code
72
-
73
- Follow Moonshot's install steps at [kimi.com/code/docs](https://kimi.com/code/docs). Verify it works on its own:
74
-
75
- ```
76
- kimi --version
77
- kimi -p "Reply READY"
78
- ```
79
-
80
- ### 2. Audit your kimi-plugin-cc env block
81
-
82
- If you set any of these env vars for v0.4, review them before continuing — v1.0 reads the same vars but with different effective semantics:
83
-
84
- | Env var | Notes |
85
- |---|---|
86
- | `KIMI_PLUGIN_CC_KIMI_BIN` | Path to the kimi binary. Was the Python `kimi` in v0.4; should now point at the kimi-code binary (typically `~/.kimi-code/bin/kimi`). Unset to use the kimi-code on `PATH`. |
87
- | `KIMI_PLUGIN_CC_KIMI_PREFIX_ARGS` | JSON array of args prepended to every kimi spawn. Was a Wire-mode flag carrier in v0.4; in v1 it's still honored but the v0.4 contents (`--wire`, `--session`, `--agent-file`) are gone. Unset unless you have a specific override reason. |
88
- | `KIMI_PLUGIN_CC_NODE_BIN` | Absolute path to the Node binary used to run the companion AND the hook script. v1 setup hard-requires absolute. |
89
- | `KIMI_PLUGIN_CC_HOOK_SCRIPT` | Override for the hook script path written into `~/.kimi-code/config.toml`. Tests / advanced users only. |
90
- | `KIMI_CODE_HOME` | Override for the kimi-code config directory (default `~/.kimi-code`). New in v1.0 — recognized by setup, install verifier, and the hook itself. |
91
- | `KIMI_PLUGIN_CC_SKIP_HOOK_CHECK` | Bypasses every hook-verification refusal gate (and the review-gate skip), restoring un-enforced `permission: auto` execution. Only set for tests or deliberate diagnostics. |
92
- | `CLAUDE_PLUGIN_DATA` | Plugin data root. Unchanged from v0.4. |
93
-
94
- ### 3. Update the plugin in place
95
-
96
- From an existing v0.4 install:
97
-
98
- ```
99
- /plugin marketplace update linxule
100
- # then in the /plugin UI: select kimi → "Update now"
101
- ```
102
-
103
- Or fresh install on a machine that doesn't have v0.4:
104
-
105
- ```
106
- /plugin marketplace add linxule/kimi-plugin-cc
107
- /plugin install kimi@kimi-marketplace
108
- ```
109
-
110
- (v0.4 ALPHA NOTE: v1.0.0-alpha.1 was briefly tagged with renamed IDs `kimi-v1` / `kimi-marketplace-v1`. The rename was rolled back in v1.0.0-alpha.2. If you happened to install alpha.1 by those names, uninstall first: `/plugin uninstall kimi-v1`, `/plugin marketplace remove kimi-marketplace-v1`, then follow the procedure above.)
111
-
112
- ### 4. Run setup
113
-
114
- ```
115
- /kimi:setup
116
- ```
117
-
118
- This writes the PreToolUse hook to `~/.kimi-code/config.toml` and runs a two-layer probe (direct + via `/bin/sh -c`) to verify the hook fires and denies as expected. If setup fails, look at the `Probe:` line in the output. Common failure codes (the runtime emits these as `SETUP_*` errors):
119
-
120
- - **Bad `KIMI_PLUGIN_CC_NODE_BIN` override** — v1 setup requires the override to be an absolute path; relative paths (`node`) are rejected with `SETUP_NODE_BIN_NOT_ABSOLUTE`.
121
- - **Orphan markers in `~/.kimi-code/config.toml`** from a manual edit or aborted earlier setup. Run `/kimi:setup --uninstall` to clean up, then `/kimi:setup` again. Code: `SETUP_ORPHAN_MARKERS`.
122
- - **Duplicate managed blocks** from two setup runs racing. Same fix: `/kimi:setup --uninstall` + `/kimi:setup`. Code: `SETUP_DUPLICATE_BLOCKS`.
123
- - **Hook script path contains characters TOML can't represent** (quotes, control chars). Reinstall to a path without these, or set `KIMI_PLUGIN_CC_HOOK_SCRIPT` to a safe path. Code: `SETUP_HOOK_PATH_UNSAFE`.
124
- - **Probe timed out** (5s budget). Usually means kimi-code or the Node binary is wedged on cold start. Re-run; if persistent, file an issue with `/kimi:setup --check` output.
125
- - **Hook script not found** — `dist/hooks/approval-hook.js` is missing. Reinstall the plugin or run `bun run build` if you're on a local clone. Code: `SETUP_HOOK_SCRIPT_MISSING`.
126
-
127
- ### 5. Verify
128
-
129
- ```
130
- /kimi:setup --check
131
- ```
132
-
133
- Reports the install state without writing. Run `/kimi:review` against a small diff to confirm the round-trip works end-to-end.
134
-
135
- ### Local-clone install upgrade
136
-
137
- If you're running the plugin via `claude --plugin-dir ~/kimi-plugin-cc` rather than the marketplace:
138
-
139
- ```bash
140
- cd ~/kimi-plugin-cc
141
- git fetch --tags origin
142
- git checkout v1.0.0-alpha.2
143
- # Verify dist/ is in sync; if you previously deleted it locally, rebuild:
144
- ls dist/hooks/approval-hook.js >/dev/null || bun run build
145
- # Restart Claude Code so the new agents/ and dist/ register
146
- ```
147
-
148
- Then run `/kimi:setup` in your Claude Code session. The local clone uses the same managed-block installer; no marketplace operations needed.
149
-
150
- ### Using both Claude Code and Codex (v1.7.0+)
151
-
152
- Claude Code and Codex install the plugin to **different, version-stamped paths**
153
- but share one `~/.kimi-code/config.toml`. As of **v1.7.0** each host manages its
154
- **own** host-scoped PreToolUse block (`# === BEGIN kimi-plugin-cc-managed:claude-code …`
155
- vs `:codex`), so:
156
-
157
- - Run **`/kimi:setup` in Claude Code AND `$kimi-setup` in Codex** — once each.
158
- They no longer clobber each other; both blocks coexist and each host verifies
159
- its own. (Before v1.7.0 a single shared block was overwritten every time you
160
- switched hosts, which is why setup seemed to "need redoing.")
161
- - **One-time cleanup on upgrade to v1.7.0:** update the plugin in *both* hosts,
162
- then run setup in each. The first setup adopts your old un-suffixed block and
163
- prunes orphaned hook entries left by earlier installs.
164
- - `/kimi:setup --uninstall` removes only the current host's block. Use
165
- `/kimi:setup --uninstall --all` to remove *every* host's block from the shared
166
- config (a deliberate full nuke — it clears blocks for **all** hosts, not just
167
- this one).
168
-
169
- > **⚠️ Upgrade both hosts before re-running setup.** During the window where one
170
- > host is on v1.7.0+ and the other is still on ≤1.6.5, running setup on the OLD
171
- > host writes an un-suffixed block that can overwrite the block the new host just
172
- > migrated, re-creating the clobber (or leaving a duplicate the new host rejects
173
- > with `SETUP_DUPLICATE_BLOCKS`). Update **both** Claude Code and Codex to v1.7.0+
174
- > first, then run setup in each. If the config ever looks tangled, the clean-slate
175
- > escape hatch is `/kimi:setup --uninstall --all` followed by setup in each host.
176
-
177
- ## Data and session continuity
178
-
179
- - **SQLite job rows** from v0.4 remain in `${CLAUDE_PLUGIN_DATA}/kimi-plugin-cc/state.db`. They're still visible to `/kimi:status` and `/kimi:result`, but `/kimi:replay` will report `REPLAY_LOG_UNREADABLE` on the v0.4 wire logs — v1.0's replay parser doesn't understand the Wire JSON-RPC shape. Archive or delete the database if you don't need v0.4 history.
180
- - **Kimi CLI sessions** under `~/.kimi/sessions/` are independent of kimi-code's `~/.kimi-code/sessions/`. v1.0's `--resume` will not see v0.4 sessions.
181
- - **Plugin config** (`${CLAUDE_PLUGIN_DATA}/kimi-plugin-cc/config.json` — only `reviewGateEnabled` lives here) carries over unchanged.
182
-
183
- ## Rollback
184
-
185
- If something is wrong, the v0.4 install is one step away:
186
-
187
- ```
188
- /kimi:setup --uninstall # removes the v1.0 PreToolUse hook
189
- /plugin uninstall kimi
190
- /plugin marketplace remove kimi-marketplace
191
- # If the v0.4-maintenance branch is published:
192
- /plugin marketplace add linxule/kimi-plugin-cc@v0.4-maintenance
193
- # Otherwise, pin to the v0.4.0 tag:
194
- /plugin marketplace add linxule/kimi-plugin-cc@v0.4.0
195
- /plugin install kimi@kimi-marketplace
196
- ```
197
-
198
- Claude Code's marketplace tooling uses `@ref` to pin a GitHub shorthand to a branch or tag. Your Python Kimi CLI install is untouched — v1.0 only edits `~/.kimi-code/config.toml`, never `~/.kimi/*`.
199
-
200
- ## What's gone
201
-
202
- - The `--wire`, `--session`, and `--agent-file` invocation shape. v1.0 uses `kimi -p` only.
203
- - The YAML agent profiles in `runtime/agents/`. The plugin doesn't ship Kimi-side profiles in v1.0; per-command safety is enforced exclusively by the PreToolUse hook.
204
- - The Wire-protocol replay path. The runtime no longer parses JSON-RPC turn events.
205
- - The v0.4 pre-run `Kimi Task: ...` title assignment path through Kimi CLI / `kimi web`. v1 uses `kimi -p`, whose session id is minted only after the run, so the plugin cannot name the session before spawn. Instead, after Kimi announces the session id and the run settles, the runtime syncs a fallback title such as `Kimi Ask: ...`, repairs missing native-v2 prompt previews, and notifies the Desktop/Web index. Native-v2 fallback titles remain eligible for native generation; manual and already-generated titles are preserved. Internal `review_gate` Stop-hook sessions are intentionally excluded. See [session visibility and native titles](session-visibility.md) for generation limits and repair of older plugin sessions.
206
-
207
- ## What's new
208
-
209
- - A two-layer setup probe that catches `node`-not-on-PATH failure modes before they become silent fail-opens.
210
- - Workspace-bound rescue safety enforced by a hook that the plugin sets `KIMI_PLUGIN_CC_CMD=rescue` for. The hook only enforces the allowlist when that env var is set — kimi-code invocations from outside the plugin (e.g., direct user `kimi -p` calls) keep kimi-code's default permission posture, unrestricted by the plugin. The allowlist's job is to scope plugin-driven rescue, not to police all uses of kimi-code on the system.
211
- - `/kimi:setup --check` and `/kimi:setup --uninstall` for state inspection and cleanup.
212
- - Stream-json logs are easier to grep than Wire JSON-RPC dumps when you need to debug a job after the fact.
213
-
214
- If you hit problems, file an issue with the output of `/kimi:setup --check` and the contents of the managed block in `~/.kimi-code/config.toml` (the block is between the BEGIN and END markers — don't paste the rest of your kimi-code config).
215
-
216
- ## Upgrading to 1.10 (native agent-core-v2, kimi-code 0.42.0)
217
-
218
- This release changes behaviour that earlier 1.x users may depend on. Strictly by semver it is a major; it ships as 1.10.0 because the plugin is upgraded in place through the marketplace and its 1.x line has always advanced compat by minor releases.
219
-
220
- - **Certification is now per EXACT kimi-code version, not per minor.** Native v2 is certified at `0.42.0` only (v1.10.0; v1.10.3 adds `0.43.0` and `0.43.1`). When kimi-code publishes a newer version, every model-spawning command refuses with `KIMI_CAPABILITY_NOT_CERTIFIED` until a plugin release certifies it — before 1.10, a patch release inside a tested minor kept working. kimi-code self-upgrades in the background, so expect this on the next upstream patch; pin `KIMI_PLUGIN_CC_KIMI_BIN` to a certified binary if you need continuity, and watch for the next plugin release.
221
- - **Sessions created before 1.10 cannot be resumed on 0.42.0.** `ask --resume`, `ask -r`, `rescue --resume` and rescue's implicit latest-session reuse refuse (`KIMI_SESSION_LINEAGE_UNKNOWN` / `KIMI_SESSION_ENGINE_MISMATCH`) — the v1 engine no longer exists in the binary, so nothing could replay those sessions. Nothing is deleted; `/kimi:status`, `/kimi:result` and `/kimi:replay` still work on the old jobs. Start fresh sessions.
222
- - **`default_plan_mode = true` (any spelling) in `~/.kimi-code/config.toml` now blocks every command** (`CLI_V2_PLAN_MODE_CONFIGURED`). On the old forced-v1 path that setting was harmless; on native v2 it would arm the one code path that bypasses the safety hook. Set it to `false` or remove it. `/kimi:setup` cannot fix this one.
223
- - **`KIMI_PLUGIN_CC_KIMI_PREFIX_ARGS` may no longer contain kimi flags** (`-r`, `-c`/`-C`, `-S`, `-p`, `-m`, `--plan`, `--yolo`, `--agent`, `--add-dir`, …) — `INVALID_ENV`. The prefix is a launcher shim only (e.g. `["--import","tsx",…]`).
224
- - **`[experimental] tower` / `subagent_fork` and `KIMI_CODE_EXPERIMENTAL_FLAG` refuse before spawn** (`CLI_V2_EXPERIMENTAL_UNSAFE` / `CLI_V2_HOOK_ORDER_UNSAFE`). Unset them for plugin-managed runs.
225
- - **Still on kimi-code ≤ 0.41.x?** Nothing changes for you: those versions route to the legacy-v1 engine exactly as before. But the plugin certifies them only for an explicitly pinned binary — kimi-code's auto-update will move you to 0.42.x, at which point the notes above apply.
226
-
227
- No action for the job store (one additive nullable column, migrated automatically) or the hook policy (unchanged allowlists). As with every release, run `/kimi:setup` (or `$kimi-setup`) after updating so the hook is re-pinned to the new install path — a `kimi login` also strips the managed-block markers, and setup restores them.
228
-
229
- None of these refusals is repaired by `/kimi:setup`; all of them carry `retryable_after_setup: false` explicitly from 1.10.1 (an absent field must still be treated as `false`). They are catalogued with remedies in [docs/safety.md § Refusal codes](./safety.md#refusal-codes-of-the-native-v2-contract-v1100).
230
-
231
- </details>
70
+ Plugin 3.0.0 merged 7 Claude Code commands into 4, folded `kimi_challenge` into `kimi_review`, and added `--read-root`, `--network`, `setup --install-kimi`, and launch warnings. Plugin 3.1.0 replaces those host-specific command and skill layouts with the 4 MCP tools and one `kimi` skill described above. For upgrades from versions earlier than `3.0.0`, see [GitHub Releases](https://github.com/linxule/kimi-plugin-cc/releases) and the archived [`v3.0.0` migration guide](https://github.com/linxule/kimi-plugin-cc/blob/v3.0.0/docs/migration.md).
package/docs/models.md CHANGED
@@ -1,96 +1,54 @@
1
1
  # Models and provider setup
2
2
 
3
- The plugin uses your configured Kimi model by default. You can ask for a different
4
- configured model for one task without changing that default.
3
+ The plugin uses your saved Kimi default model unless you request another alias for one run. Choosing a model for one run never changes your saved default.
5
4
 
6
- ## See configured models
5
+ ## List configured models
7
6
 
8
- In Claude Code, run `/kimi:setup --models`. In Codex, ask `$kimi-setup` to list
9
- models. In DSH, run `/kimi-setup --models` (or `--models --json`). The underlying command is:
7
+ Call `kimi_setup` with `action: "models"` from Claude Code, Codex, Antigravity, DeepSeek Harness (prefixed `mcp__kimi__kimi_setup`), or Magpie. You can also list models from your terminal:
10
8
 
11
9
  ```sh
12
10
  "<plugin-root>/scripts/companion.sh" setup --models
13
11
  "<plugin-root>/scripts/companion.sh" setup --models --json
14
12
  ```
15
13
 
16
- This lists local model aliases, provider IDs/types, the saved default, and any
17
- `KIMI_MODEL_NAME` default overlay inherited by the companion. It also reports
18
- whether secondary-model settings exist. It does not contact providers, read the
19
- OAuth store, write configuration, or test authentication. Configured entries
20
- are not a guarantee of working credentials, model access, or tool support.
21
- Provider catalogs refreshed by Kimi may add models not yet present locally.
14
+ This command lists local model aliases, provider IDs and types, your saved default, and any inherited `KIMI_MODEL_NAME` overlay. It also reports whether secondary-model settings exist in your config. It runs offline and never contacts providers, reads `~/.kimi-code/credentials/`, writes configuration, or tests authentication. Listed entries do not prove working credentials, model access, or tool support.
22
15
 
23
16
  ## Choose a model for a task
24
17
 
25
- Say “review this with my configured fast model” or pass its exact alias:
18
+ Pass `model` on `kimi_read` or `kimi_write` in any of the 5 supported hosts, or pass `-m` on the CLI:
26
19
 
27
- ```text
28
- /kimi:review -m 'my-provider/my-model' review this diff
29
- /kimi:ask -m 'my-provider/my-model' explain the cache
20
+ ```sh
21
+ "<plugin-root>/scripts/companion.sh" read --mode review -m 'my-provider/my-model' -- Review this diff.
22
+ "<plugin-root>/scripts/companion.sh" write -m 'my-provider/my-model' -- Fix the cache timeout test.
30
23
  ```
31
24
 
32
- The Claude agents and Codex skills list models when you request a model in
33
- natural language. They select a unique configured match, ask when there are
34
- several, and guide setup when there is none. They do not guess model IDs or
35
- silently substitute the default after an error. An explicit `-m` remains a
36
- pass-through alias, so upstream can resolve it or report an error.
37
-
38
- DSH activations are one-shot and do not expose per-call model fields. Set `model` in the bundle's `kimi-plugin-cc` profile row to use one exact configured alias for every delegation from that profile; omit it to use the native Kimi default. This does not change the saved default or add fallback selection.
25
+ When you ask for a model in plain language, your assistant calls `kimi_setup({ action: "models" })` first. The assistant picks an unambiguous configured alias, asks you to choose when several aliases match, or explains provider setup when none exists. Assistants never guess model IDs or fall back to the default model after an error. An explicit `model` or `-m` value passes straight to Kimi so Kimi can resolve or reject it.
39
26
 
40
- Omitting `-m` uses the default for a **fresh** session. A resumed session keeps
41
- its previous model unless you supply `-m`. The optional review gate also uses
42
- the default unless `KIMI_PLUGIN_CC_REVIEW_GATE_MODEL` explicitly selects an alias.
43
- Swarm `-m` selects the coordinator; upstream `[secondary_model]` settings can
44
- select different models for its children.
27
+ Omitting `model` or `-m` uses your saved default for a fresh session. Resumed sessions keep their previous model unless you pass an explicit override. On `swarm` and `swarm_patch`, `model` selects the coordinator model while Kimi's `[secondary_model]` setting can select subagent models.
45
28
 
46
29
  ## Add a provider or change the saved default
47
30
 
48
- Open native `kimi` using the same `KIMI_CODE_HOME` as the plugin:
49
-
50
- 1. For a Kimi subscription, use `/login`.
51
- 2. For an API key or another provider, use `/provider` and follow its native
52
- prompts. Enter credentials there, never in the host conversation. Provider
53
- setup may offer a default-model picker; select a new saved default only if
54
- you want that persistent change.
55
- 3. To explicitly change your saved default later, use native `/model`.
56
- 4. Return to the plugin, list models again, then run `setup --check` to verify
57
- hook readiness. If it requests re-pinning, run the host's setup command.
58
-
59
- Kimi supports its managed account, Anthropic, OpenAI-compatible services,
60
- OpenAI Responses, Google GenAI, and Vertex AI protocols. Available models and
61
- authentication requirements depend on the provider. See the upstream
62
- [provider setup guide](https://www.kimi.com/code/docs/en/kimi-code-cli/configuration/providers).
63
- The plugin does not switch Claude Code or Codex's own authentication.
31
+ Open native `kimi` in your terminal with the same `KIMI_CODE_HOME` that the plugin uses.
64
32
 
65
- For a one-off connection test, explicitly request a small task with the chosen
66
- alias. That makes a provider call under your account and the usual plugin
67
- safety gates. Listing alone is offline. An authentication or unsupported-model
68
- error is surfaced without retrying a different model.
33
+ 1. Run `/login` to connect a Kimi subscription.
34
+ 2. Run `/provider` to configure an API key or third-party provider, and enter credentials only in Kimi, never in chat.
35
+ 3. Run `/model` in native `kimi` whenever you want to change your saved default model.
36
+ 4. Run `kimi_setup({ action: "models" })` and `kimi_setup({ action: "check" })` (or `scripts/companion.sh setup --check`) in your host to confirm readiness.
69
37
 
70
- ## Implementation boundary
38
+ Kimi supports its managed account, Anthropic, OpenAI-compatible services, OpenAI Responses, Google GenAI, and Vertex AI protocols. See Kimi's [provider setup guide](https://www.kimi.com/code/docs/en/kimi-code-cli/configuration/providers) for protocol details. The plugin never changes your host application login.
71
39
 
72
- `setup --models [--json]` is mutually exclusive with hook setup flags. It parses
73
- the complete TOML in memory and emits an explicit field allowlist; it never
74
- serializes providers, keys, headers, environment maps, endpoints, OAuth
75
- references, or raw parse errors. Do not substitute `kimi provider list --json`:
76
- upstream 2.0.0 includes credential-bearing provider objects in that output.
77
- Names in the inventory are untrusted configuration data and must be passed as
78
- one correctly shell-quoted argument, never evaluated as shell instructions.
40
+ To test a provider connection, run a small read-only task (`kimi_read` with `mode: "ask"`) using that alias. Authentication and unsupported-model errors return directly without retrying another model.
79
41
 
80
- The model list is a routing aid, not a second implementation of Kimi's config
81
- validator. Every task still uses the existing exact-version, hook, workspace,
82
- and no-plan checks. Source review is against kimi-code 2.0.0 (`1b89e4b0`),
83
- including `kosongConfig/configSection.ts`, `envOverlay.ts`, and
84
- `cli/v2/run-v2-print.ts`.
42
+ ## Security boundary for model listing
85
43
 
86
- ## Requested thinking effort
44
+ The `setup --models [--json]` flag cannot run together with hook-install or hook-check flags. It parses `~/.kimi-code/config.toml` in memory and outputs only an explicit allowlist of non-sensitive fields. It never outputs provider objects, API keys, headers, environment maps, endpoints, OAuth references, or raw parse errors. Do not use `kimi provider list --json` in its place because upstream includes credential-bearing provider fields in that output. Treat model names from the inventory as untrusted text and pass them as single quoted arguments without shell evaluation.
87
45
 
88
- `--thinking <effort>` requests per-run effort through `KIMI_MODEL_THINKING_EFFORT`, never a CLI flag or saved-default change; omitted flags preserve the operator-owned ambient variable, and resume does not inherit a previous job's request. Providers that are not trait-driven silently ignore it, as does a base level already `off`; an `alwaysThinking` model receives `off` unnormalized. Stream-json carries no thinking deltas (`writeThinkingDelta() {}`), so the plugin cannot verify whether the request was honoured.
46
+ Every task that uses a custom model still enforces the `>= 2.8.0` version floor, PreToolUse hook verification, workspace confinement, and no-plan preflight.
89
47
 
90
- Use `--thinking off`, `--thinking high`, or `--thinking=<effort>` before the prompt. Values are lowercased and must match `/^[a-z][a-z0-9-]{0,31}$/` (a plugin-owned syntax bound; a future upstream token outside it is rejected before upstream sees it); upstream per-model `supportEfforts`, not a plugin enum, determines supported values. `--no-thinking` is an error: use `--thinking off`. In CLI 2.2.0 only the three Moonshot `kimi*` provider definitions are trait-driven. BYO providers ignore the request silently; an always-thinking model may remain thinking.
48
+ ## Request thinking effort
91
49
 
92
- DSH forwards the profile's `thinkingEffort` value as `--thinking <effort>` on every delegation. Omission preserves the ambient operator value; the same provider and observability limits apply.
50
+ Pass `thinking` on `kimi_read` or `kimi_write`, or `--thinking <effort>` on the CLI, to set `KIMI_MODEL_THINKING_EFFORT` for one run. Omitting the parameter preserves any ambient environment value, and resumed sessions do not inherit a prior run's request.
93
51
 
94
- Jobs persist nullable `thinking_effort`; status and `result --json` expose `thinking_effort_requested`, not observed effort. Detached ask/rescue workers replay the request. A resume without `--thinking` exports no new override (any ambient operator value remains). No config.toml write occurs.
52
+ Effort values convert to lowercase and must match `/^[a-z][a-z0-9-]{0,31}$/`, such as `off`, `low`, `medium`, or `high`. Upstream per-model `supportEfforts` rules decide which values a model accepts. The plugin rejects `--no-thinking`, so use `--thinking off` instead. Non-trait providers and models already set to `off` ignore the request, while `alwaysThinking` models may still reason. Because `stream-json` emits no thinking deltas, the plugin cannot verify whether Kimi applied the requested effort.
95
53
 
96
- The review gate requests `off` by default. `KIMI_PLUGIN_CC_REVIEW_GATE_THINKING=inherit` exports no override; another non-empty value is lowercased and must match the same regex. Unset or empty means `off`; an invalid value makes the gate skip visibly. The gate remains fail-open on its 8 s timeout: a BYO provider or always-thinking model can ignore the request, and even an honoured request does not guarantee completion within the budget.
54
+ Jobs store nullable `thinking_effort` in SQLite. Status and result views (`job status`, `job result --json`, and `kimi_job`) report `thinking_effort_requested` rather than observed effort. Detached `ask` and `rescue` workers replay the requested value without editing `config.toml`.