kimi-plugin-cc 2.2.1 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/CHANGELOG.md +22 -0
  4. package/README.md +5 -5
  5. package/agents/kimi-challenge.md +3 -3
  6. package/agents/kimi-pursue.md +1 -1
  7. package/agents/kimi-rescue.md +2 -2
  8. package/agents/kimi-review.md +3 -3
  9. package/commands/README.md +2 -2
  10. package/commands/challenge.md +1 -1
  11. package/commands/pursue.md +1 -1
  12. package/commands/review.md +1 -1
  13. package/dist/background-spawn.js +9 -17
  14. package/dist/cli-client.js +22 -62
  15. package/dist/commands/ask.js +24 -29
  16. package/dist/commands/cancel.js +7 -19
  17. package/dist/commands/cli-helpers.js +9 -17
  18. package/dist/commands/pursue.js +21 -31
  19. package/dist/commands/registry.js +6 -19
  20. package/dist/commands/rescue.js +20 -20
  21. package/dist/commands/review-gate.js +16 -24
  22. package/dist/commands/review.js +37 -43
  23. package/dist/commands/setup.js +85 -171
  24. package/dist/commands/swarm.js +103 -88
  25. package/dist/commands/worker.js +0 -6
  26. package/dist/git.js +14 -7
  27. package/dist/hooks/approval-hook.js +9 -20
  28. package/dist/hooks/approval-policy.js +36 -69
  29. package/dist/hooks/config-safety.js +7 -4
  30. package/dist/hooks/install-paths.js +62 -138
  31. package/dist/hooks/install.js +37 -108
  32. package/dist/hooks/managed-block.js +88 -214
  33. package/dist/job-store.js +6 -28
  34. package/dist/kimi-command.js +1 -3
  35. package/dist/kimi-engine.js +2 -1
  36. package/dist/kimi-timeouts.js +9 -21
  37. package/dist/kimi-version-probe.js +16 -1210
  38. package/dist/native-v2-preflight.js +1 -1
  39. package/dist/parsing.js +4 -18
  40. package/dist/rescue-approval.js +78 -164
  41. package/dist/session-recovery.js +7 -10
  42. package/dist/stream-json.js +22 -174
  43. package/dist/version.js +1 -1
  44. package/docs/migration.md +2 -6
  45. package/docs/registry-releases.md +25 -5
  46. package/docs/safety.md +16 -12
  47. package/package.json +2 -2
  48. package/plugins/kimi-codex/.codex-plugin/plugin.json +4 -4
  49. package/plugins/kimi-codex/dist/background-spawn.js +9 -17
  50. package/plugins/kimi-codex/dist/cli-client.js +22 -62
  51. package/plugins/kimi-codex/dist/commands/ask.js +24 -29
  52. package/plugins/kimi-codex/dist/commands/cancel.js +7 -19
  53. package/plugins/kimi-codex/dist/commands/cli-helpers.js +9 -17
  54. package/plugins/kimi-codex/dist/commands/pursue.js +21 -31
  55. package/plugins/kimi-codex/dist/commands/registry.js +6 -19
  56. package/plugins/kimi-codex/dist/commands/rescue.js +20 -20
  57. package/plugins/kimi-codex/dist/commands/review-gate.js +16 -24
  58. package/plugins/kimi-codex/dist/commands/review.js +37 -43
  59. package/plugins/kimi-codex/dist/commands/setup.js +85 -171
  60. package/plugins/kimi-codex/dist/commands/swarm.js +103 -88
  61. package/plugins/kimi-codex/dist/commands/worker.js +0 -6
  62. package/plugins/kimi-codex/dist/git.js +14 -7
  63. package/plugins/kimi-codex/dist/hooks/approval-hook.js +9 -20
  64. package/plugins/kimi-codex/dist/hooks/approval-policy.js +36 -69
  65. package/plugins/kimi-codex/dist/hooks/config-safety.js +7 -4
  66. package/plugins/kimi-codex/dist/hooks/install-paths.js +62 -138
  67. package/plugins/kimi-codex/dist/hooks/install.js +37 -108
  68. package/plugins/kimi-codex/dist/hooks/managed-block.js +88 -214
  69. package/plugins/kimi-codex/dist/job-store.js +6 -28
  70. package/plugins/kimi-codex/dist/kimi-command.js +1 -3
  71. package/plugins/kimi-codex/dist/kimi-engine.js +2 -1
  72. package/plugins/kimi-codex/dist/kimi-timeouts.js +9 -21
  73. package/plugins/kimi-codex/dist/kimi-version-probe.js +16 -1210
  74. package/plugins/kimi-codex/dist/native-v2-preflight.js +1 -1
  75. package/plugins/kimi-codex/dist/parsing.js +4 -18
  76. package/plugins/kimi-codex/dist/rescue-approval.js +78 -164
  77. package/plugins/kimi-codex/dist/session-recovery.js +7 -10
  78. package/plugins/kimi-codex/dist/stream-json.js +22 -174
  79. package/plugins/kimi-codex/dist/version.js +1 -1
  80. package/plugins/kimi-codex/skills/kimi-ask/SKILL.md +2 -2
  81. package/plugins/kimi-codex/skills/kimi-cancel/SKILL.md +1 -1
  82. package/plugins/kimi-codex/skills/kimi-challenge/SKILL.md +1 -1
  83. package/plugins/kimi-codex/skills/kimi-pursue/SKILL.md +1 -1
  84. package/plugins/kimi-codex/skills/kimi-replay/SKILL.md +1 -1
  85. package/plugins/kimi-codex/skills/kimi-rescue/SKILL.md +1 -1
  86. package/plugins/kimi-codex/skills/kimi-result/SKILL.md +1 -1
  87. package/plugins/kimi-codex/skills/kimi-review/SKILL.md +3 -3
  88. package/plugins/kimi-codex/skills/kimi-setup/SKILL.md +1 -1
  89. package/plugins/kimi-codex/skills/kimi-status/SKILL.md +1 -1
  90. package/plugins/kimi-codex/skills/kimi-swarm/SKILL.md +1 -1
  91. package/plugins/kimi-codex/skills/kimi-swarm-write/SKILL.md +1 -1
@@ -10,162 +10,13 @@
10
10
  // {"role":"tool","tool_call_id":"...","content":"..."}
11
11
  // {"role":"meta","type":"session.resume_hint","session_id":"session_<uuid>","command":"kimi -r session_<uuid>","content":"To resume this session: kimi -r session_<uuid>"}
12
12
  // {"role":"meta","type":"turn.step.retrying","failed_attempt":1,"next_attempt":2,"max_attempts":3,"delay_ms":300,"error_name":"APIProviderRateLimitError","error_message":"...","status_code":429}
13
- // {"role":"meta","type":"system.version","version":"0.24.2"} // experimental v2 only; modeled since v1.8.5 (SystemVersionRecord), filtered like other meta
13
+ // {"role":"meta","type":"system.version","version":"0.24.2"} // native-v2 marker; required first on native-v2 plans and filtered after capture
14
+ //
15
+ // {"type":"error","code":"session.occupied","message":"...","details":{...}} // 2.3.0; stdout-only refusal, exit 4
14
16
  //
15
17
  // Notes on what does and does not appear here:
16
- // - The session.resume_hint meta record is NEW in kimi-code 0.2.0
17
- // (introduced at run-prompt.ts:477-505 in 0.2.0; the writer region —
18
- // `PromptJsonResumeMetaMessage` / `writeResumeHint` / `PromptJsonWriter` —
19
- // sits at apps/kimi-code/src/cli/run-prompt.ts:567-696 as of 0.9.0 and is
20
- // verified compatible through 0.24.2. 2026-05-27 audit covered 0.4.0,
21
- // 2026-05-28 audit covered 0.5.0 (run-prompt.ts zero-byte diff across
22
- // both), 2026-05-31 audit covered 0.6.0, 2026-06-03 audit covered
23
- // 0.7.0/0.8.0/0.9.0 in one cumulative pass, 2026-06-09 audit covered
24
- // 0.10.0/0.11.0/0.12.0 in one cumulative 0.9.0→0.12.0 pass, 2026-06-12 audit
25
- // covered 0.12.1/0.13.0/0.13.1/0.14.0/0.14.1 in one cumulative 0.12.0→0.14.1
26
- // pass (records/ dir empty diff; the 0.13/0.14 packages/protocol/ REST+WS
27
- // control API is a separate transport — run-prompt.ts imports none of it,
28
- // `-p` stdout stays the direct PromptJsonWriter), 2026-06-13 audit covered
29
- // the 0.14.2 patch (records/ + the PromptJsonWriter/writeResumeHint region
30
- // both 0-byte; the patch is a repo-wide `.md`→`.md?raw` bundler-import
31
- // migration plus a Bash-tool stdout/stderr streaming callback, neither
32
- // touching the writer), and 2026-06-14 covered the 0.14.3 patch (all four
33
- // scoped diffs 0-byte; the entire patch is a TUI model-picker
34
- // provider-refresh change — PR #713 — off the `-p` path), and 2026-06-16
35
- // covered the 0.15.0 minor (permission/hooks/run-prompt/cli all 0-byte by
36
- // independent `git diff` byte-count; the only scoped change is records/ +
37
- // session/ persistence churn — PR #786 drops app_version/resumed from the
38
- // .records/ metadata artifact, a SessionSkillRegistry rename, a static
39
- // model-capability lookup — none of it on the `-p` stdout stream; plus an
40
- // additive `transport:'sse'` MCP config variant the plugin never writes),
41
- // and 2026-06-17 covered the 0.16.0 minor (permission/hooks/run-prompt all
42
- // 0-byte; the only argv change registers a new `kimi vis` subcommand off
43
- // the `-p` path, and the records/replay/compaction/logging churn is
44
- // internal — not on the stdout stream; GREEN smoke 7/0 on the 0.16.0
45
- // binary), 2026-06-19 covered the 0.16.0→0.18.0 jump (0.17.0/0.17.1/0.18.0;
46
- // 03-hooks.diff 0-byte, run-prompt.ts only a telemetry refactor outside the
47
- // writer, the sole permission change a NON-auto-mode GoalStartReviewAsk that
48
- // is dead on `-p`), and 2026-06-23 covered the 0.18.0→0.19.1 minor (the
49
- // writer + records/ 0-byte; the bumping feature #812 `--add-dir` touches
50
- // only an approve policy at the queue tail, structurally dead below the
51
- // `-p` auto-mode approve and still pre-empted by our index-0 hook even when
52
- // project-local `.kimi-code/local.toml` makes additionalDirs non-empty;
53
- // #963's new `turn.ended` reason:'filtered' is a failure REASON not a new
54
- // stdout record SHAPE;
55
- // GREEN smoke 9/0 on the operator's 0.19.1 binary —
56
- // .claude/kimi-code-research/reports/85-upstream-0191-surface.md), and
57
- // 2026-06-26 covered the 0.19.1→0.20.0 minor (run-prompt.ts + options.ts +
58
- // records/ all 0-byte; #1040's new `warning` agent event is swallowed on `-p`
59
- // at run-prompt.ts:495 `case 'warning': return;`, so it never reaches this
60
- // parser; #1062's tool-result budget adds a `truncated` flag to tool-result
61
- // CONTENT, not the record SHAPE; the new runShellCommand RPC + kimi server/web
62
- // stack are off the `-p` path — report 88. Smoke NOT run this cert: the 0.20.0
63
- // `bun run smoke:real` was quota-blocked, 403 usage-limit, records:[] — an
64
- // operator-billing false alarm, not a compat break; certified on source audit;
65
- // the later 0.20.2 smoke ran GREEN 9/0 on 2026-06-29), and 2026-07-01
66
- // covered the 0.20.3→0.21.1 minor+patch (report 93; agent/records/ 0-byte,
67
- // run-prompt.ts writer/resume_hint/goal.summary unchanged, #1204 plugin
68
- // slash commands off the `-p` path, #1233 cleanup timeout after the writer
69
- // flush; GREEN smoke 9/0 on the operator's 0.21.1 binary), and 2026-07-05
70
- // covered the 0.21.1→0.22.3 minor+patch (reports 94/95; hook engine
71
- // unchanged, policy order still hook-first, writer shape compatible; 0.22.3's
72
- // prompt-mode background-drain happens after assistant-output flush and is
73
- // bounded by plugin budgets; shell-output caps and session-owned
74
- // media-originals do not alter the NDJSON record schema; GREEN smoke 9/0 on
75
- // a temp-installed 0.22.3 binary), and 2026-07-07 covered the
76
- // 0.22.3→0.23.1 minor (report 96; hook engine unchanged, policy order still
77
- // hook-first, PromptJsonWriter-compatible scoped `run-prompt.ts` delta only
78
- // adds telemetry sessionId; `select_tools` is denied by our hook unless
79
- // deliberately allowlisted; observability records are persisted agent-log
80
- // records, not new stdout NDJSON shapes; GREEN smoke 9/0 on a temp-installed
81
- // 0.23.1 binary), and 2026-07-08 covered the 0.23.2 patch (daily checkup;
82
- // no writer/resume_hint/goal.summary drift, `02-permission.diff` and
83
- // `05-session-bootstrap.diff` 0-byte; the only scoped `run-prompt.ts`
84
- // change keeps the cleanup timeout ref'd so failed headless `-p` turns exit
85
- // non-zero reliably, and the only hook-engine-adjacent change adds
86
- // `windowsHide:true` to hook child-process spawn options on Windows; GREEN
87
- // smoke 9/0 on a temp-installed 0.23.2 binary), and 2026-07-09 covered the
88
- // 0.23.3/0.23.4 patches (daily checkup; permission + both hook-tree diffs
89
- // 0-byte; #1516 keeps prompt-mode goals alive across continuation turns
90
- // until terminal without changing PromptJsonWriter, session.resume_hint,
91
- // or goal.summary shapes; the wire/session delta is internal provider-auth
92
- // and media-projection plumbing, while the bootstrap delta adds `[image]`
93
- // limits without changing hook or permission construction; GREEN smoke 9/0
94
- // on a temp-installed 0.23.4 binary, including two-minute multi-turn goal
95
- // confinement and both write-swarm worktree-boundary assertions), and
96
- // 2026-07-11 covered the 0.23.5 patch at tag commit `352a4492`
97
- // (permission, both hook trees, and session bootstrap all 0-byte; the wire
98
- // diff only adds the internal `media-stripped` projection type). The one
99
- // live stdout change is this file's `turn.step.retrying` meta record: it is
100
- // modeled exactly and filtered from consumer records while malformed shapes
101
- // remain diagnostic. The post-change exact-binary smoke was GREEN 9/0 in
102
- // 229.56s, including the full goal budget and both write-swarm boundaries),
103
- // and 2026-07-12 covered the 0.23.6 patch at tag commit `b5c236d0`
104
- // (permission and both hook trees 0-byte; no new PromptJsonWriter record;
105
- // `run-prompt.ts` now keeps print mode alive across active goals, pending
106
- // cron fires, and opt-in background steering, all still bounded externally
107
- // by plugin budgets; subagent timeout config and the capability rename to
108
- // dynamically_loaded_tools do not alter stdout shape). Exact-binary smoke
109
- // was GREEN 9/0 in 274.55s, including the full goal budget and both
110
- // write-swarm boundaries), and 2026-07-15 covered the 0.23.6→0.24.2
111
- // minor (Phase-1 reports 97-100; permission and the live session/hooks
112
- // surfaces 0-byte; default-v1 writer/resume/retry/goal shapes compatible;
113
- // GREEN exact-binary v1 smoke 9/0, 39 assertions in 261.33s). A truthy
114
- // native v2 shares the writer shapes and terminal session.resume_hint but
115
- // prepends one new
116
- // role:"meta", type:"system.version" record. Unknown meta is intentionally
117
- // non-fatal: it becomes diagnostic-only, never enters records[]/onRecord,
118
- // and cannot affect prose or session pinning. A targeted exact-v2 review
119
- // smoke denied the forced write (1 pass / 8 skip / 0 fail).
120
- // 2026-07-16 covered 0.25.0 + 0.26.0 (the 0.25.0 step added only 943 B
121
- // of permission telemetry; all three primary safety surfaces were 0-byte
122
- // on the 0.26.0 step; no new PromptJsonWriter record on either),
123
- // 2026-07-18 covered 0.27.0, 2026-07-21 covered 0.28.1,
124
- // 2026-07-23/24 covered 0.29.0 + 0.29.1, and 2026-07-27 covered 0.29.2
125
- // (permission/hooks stayed 0-byte across every step; the 0.29.x
126
- // wire/bootstrap changes did not alter PromptJsonWriter output; GREEN
127
- // exact-binary smoke 10/0, 43 assertions, on each of exact 0.27.0,
128
- // 0.28.1, 0.29.0, 0.29.1, and 0.29.2; the 0.29.1 veto-event refactor
129
- // and 0.29.2 automatic scope-activation refactor preserved the modeled
130
- // system.version signal and terminal session pinning), 2026-07-29 covered
131
- // 0.30.0, 2026-07-31 covered 0.31.0, 2026-08-01 covered 0.31.1, and
132
- // 2026-08-08 covered 0.32.0 through 0.34.0, 2026-08-12 covered 0.35.0,
133
- // 2026-08-13 covered 0.36.0, 2026-08-24 covered 0.37.0 through
134
- // 0.38.0, 2026-08-27 covered 0.39.0 (prompt-render.ts byte-identical;
135
- // the MCP structured-content and error-code changes shift only prose
136
- // inside opaque tool content strings), and 2026-09-02 covered 0.40.0
137
- // (wire/session scope 0 bytes; run-prompt.ts absent from the diff). The
138
- // 2026-09-06 covered 0.41.0 (v1 core, prompt-render.ts, goal-prompt.ts,
139
- // and prompt-session.ts unchanged; exact-binary smoke 12/0, 55 assertions).
140
- // The legacy-v1 writer remains compatible through 0.41.0;
141
- // custom profiles can change content/tools but
142
- // not the NDJSON envelope. In 0.33.0 native v2 became the unflagged default,
143
- // so v1.9.6 forces KIMI_CODE_LEGACY_FLAG=1 in every accepted child while
144
- // retaining the old experimental-selector refusal. This parser continues
145
- // to model v2's system.version record for diagnostics and a future safe
146
- // re-enable; absence of that record is now a legacy-pin smoke assertion.
147
- // NB: from 0.6.0 run-prompt.ts
148
- // is no longer a whole-file zero-byte diff — at 0.6.0 it gained a
149
- // resume-session workDir guard, and at 0.8.0 it gained headless goal
150
- // mode (`runHeadlessGoal`) — but both changes are OUTSIDE the
151
- // stream-json writer, which every audit confirmed byte-identical by
152
- // content/blob SHA. Goal mode also writes a `{"type":"goal.summary",...}`
153
- // line (no `role` field) before the resume hint when the prompt is
154
- // `/goal`-prefixed (on 0.8–0.11 the `goal-command` experimental flag must
155
- // also be on; 0.12.0 removed that gate — PR #569 — so the `/goal` prefix
156
- // alone triggers it). Read-only commands never trigger it (their trimmed
157
- // prompt never starts with `/goal`); the v1.1 /kimi:pursue command is
158
- // the intentional consumer — it is recognized as a first-class record on
159
- // the dedicated `StreamJsonOutcome.goalSummary` channel (see
160
- // GoalSummaryRecord below), NOT routed to the malformed channel. See
161
- // reports 47-65, 72-76).
162
- // The hint is emitted once per prompt run at session END
163
- // (after runPromptTurn settles), not at session start. In 0.1.x the
164
- // resume hint went to stderr only; 0.2.0+ emits a structured
165
- // stream-json record on stdout when `--output-format stream-json` is
166
- // selected (text-output mode still writes the stderr line). Our
167
- // cli-client consumes the meta record's `session_id` for resume/replay
168
- // routing.
18
+ // - session.resume_hint is emitted once at session end. Legacy 0.1.x sent
19
+ // the resume hint to stderr; stream-json uses this stdout meta record.
169
20
  // - hook.result events arrive as role:"assistant" with the block rendered as
170
21
  // plain text (see formatHookResultPlain in run-prompt.ts). Our
171
22
  // PreToolUse hook's deny reason therefore surfaces in the assistant
@@ -183,10 +34,8 @@ export const MAX_STREAM_JSON_LINE_BYTES = 1_048_576;
183
34
  * Lifecycle:
184
35
  * - `push(chunk)` — consume bytes; returns outcomes for any complete lines
185
36
  * that finished within this chunk.
186
- * - `flush()` — at end of stream, force-parse the trailing buffer if any.
187
- * Stream-json emits a newline after every record (run-prompt.ts:573), so
188
- * a non-empty flush remainder indicates an unfinished record (likely an
189
- * interrupted spawn).
37
+ * - `flush()` — at end of stream, parse a valid trailing JSON record even
38
+ * without a final newline; malformed trailing input becomes diagnostic.
190
39
  *
191
40
  * Outcomes are non-throwing — malformed lines surface via `malformedLine` /
192
41
  * `malformedReason` so callers can route them to a diagnostics log without
@@ -223,8 +72,6 @@ export class StreamJsonParser {
223
72
  while (newlineIndex !== -1) {
224
73
  const line = this.buffer.slice(0, newlineIndex);
225
74
  this.buffer = this.buffer.slice(newlineIndex + 1);
226
- // Skip blank lines (the writer doesn't emit them, but tolerate
227
- // CRLF-doubled or trailing whitespace defensively).
228
75
  if (line.replace(/\r/g, "").length > 0) {
229
76
  out.push(parseLine(line));
230
77
  }
@@ -258,21 +105,26 @@ function parseLine(line) {
258
105
  if (role === "meta") {
259
106
  return validateMeta(parsed, line);
260
107
  }
261
- // Role-less goal-mode summary (kimi-code 0.8.0+). Keyed by `type`, not
262
- // `role`, so it's surfaced on the dedicated goalSummary outcome channel.
263
108
  if (role === undefined && parsed["type"] === "goal.summary") {
264
109
  return validateGoalSummary(parsed, line);
265
110
  }
266
- // H3 forward-compat: a non-empty string role we don't model (a role a future
267
- // kimi-code adds). Surface it out-of-band on the unknownRecord channel —
268
- // tolerated, not malformed — so the parser keeps working and the diagnostic
269
- // log distinguishes "new upstream role" from a genuinely broken line. It
270
- // never enters records[] (see UnknownRoleRecord + the consumer sweep).
111
+ if (role === undefined && parsed["type"] === "error") {
112
+ if (typeof parsed["code"] !== "string" || parsed["code"].length === 0 ||
113
+ typeof parsed["message"] !== "string" || parsed["message"].length === 0 ||
114
+ (parsed["details"] !== undefined && !isRecord(parsed["details"]))) {
115
+ return { malformedLine: line, malformedReason: "error record field has unexpected type" };
116
+ }
117
+ // Keep bounded diagnostic fields only; holder metadata is not needed and
118
+ // must not become a session-id source or be copied into persisted errors.
119
+ return { cliError: {
120
+ type: "error",
121
+ code: parsed["code"].slice(0, 200),
122
+ message: parsed["message"].slice(0, 4000),
123
+ } };
124
+ }
271
125
  if (typeof role === "string" && role.length > 0) {
272
126
  return { unknownRecord: { role, raw: parsed } };
273
127
  }
274
- // Genuinely malformed: no `role` at all (and not a recognized role-less typed
275
- // record like goal.summary), or a non-string role. Surface as malformed.
276
128
  return {
277
129
  malformedLine: line,
278
130
  malformedReason: `unknown role: ${JSON.stringify(role)}`,
@@ -384,9 +236,7 @@ function validateMeta(parsed, line) {
384
236
  };
385
237
  return { record };
386
238
  }
387
- // Unknown meta types are forward-compatible — surface them via the
388
- // malformed channel for diagnostics, but don't crash. kimi-code may add
389
- // new meta types in 0.3.x and our wrapper should keep working.
239
+ // Unknown meta types are diagnostic-only and nonfatal.
390
240
  return {
391
241
  malformedLine: line,
392
242
  malformedReason: `unknown meta.type: ${JSON.stringify(type)}`,
@@ -487,8 +337,6 @@ export function extractSessionIdFromStderr(stderr) {
487
337
  // hostile stderr line could pin `session_--------` (8 dashes) or any
488
338
  // 8+ char hex-dash token as the captured session id, weakening the
489
339
  // "anchored full-UUID regex" safety invariant documented in AGENTS.md.
490
- // Review-smoke (kimi 0.2.0 on the alpha.5 candidate) flagged the loose
491
- // form; this is the post-review tightening.
492
340
  const uuid = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
493
341
  const pattern = new RegExp(`^To resume this session:\\s+kimi\\s+-r\\s+(session_${uuid}|${uuid})\\s*$`, "im");
494
342
  return stderr.match(pattern)?.[1];
@@ -4,4 +4,4 @@
4
4
  // and AGENTS.md on every release. A future improvement would read this from
5
5
  // package.json at build time, but that adds a build-step dependency we
6
6
  // don't want yet.
7
- export const KIMI_PLUGIN_CC_VERSION = "2.2.1";
7
+ export const KIMI_PLUGIN_CC_VERSION = "2.3.1";
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: kimi-ask
3
- description: "Ask Kimi a read-only free-form question about the current repository. Use for prose explanations, flow tracing, module comparisons, or conceptual reasoning where Codex should delegate the answer to local kimi-code rather than perform implementation."
3
+ description: "Ask Kimi a read-only free-form question about the current repository. Use for prose explanations, flow tracing, module comparisons, or conceptual reasoning when the user wants an independent Kimi answer rather than implementation."
4
4
  ---
5
5
 
6
6
  # Kimi Ask
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Cancel an active plugin-managed Kimi job for the current repositor
5
5
 
6
6
  # Kimi Cancel
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Run a read-only adversarial Kimi challenge review that questions a
5
5
 
6
6
  # Kimi Challenge
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Run Kimi's autonomous goal mode for an explicitly requested hands-
5
5
 
6
6
  # Kimi Pursue
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Re-render a stored event log for a completed plugin-managed Kimi j
5
5
 
6
6
  # Kimi Replay
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Delegate a bounded write-capable investigation or implementation t
5
5
 
6
6
  # Kimi Rescue
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Return the stored rendered result for the latest or selected termi
5
5
 
6
6
  # Kimi Result
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: kimi-review
3
- description: "Run an independent read-only Kimi review over the current working tree or a branch diff. Use when the user wants a second reviewer for defects, regressions, or implementation risks, not edits."
3
+ description: "Run an independent read-only Kimi review over the current working tree, including untracked files, or a branch diff. Use when the user wants a second reviewer for defects, regressions, or implementation risks, not edits."
4
4
  ---
5
5
 
6
6
  # Kimi Review
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -29,6 +29,6 @@ Pass through: `[--budget <30m|1h|90s>] [--base <ref>] [-m <model>] [--thinking <
29
29
  - For subscription auth, guide native Kimi `/login`; for API keys or other providers, guide native `/provider` and have the user enter secrets there. Only an explicit saved-default request calls for native `/model`. Re-list after setup; use `setup --check` for hook readiness. Swarm `-m` selects the coordinator; `[secondary_model]` can select different child models.
30
30
  - Preserve `--budget <dur>` (30m|1h|90s or bare minutes, maximum 24h); default 30m for ask/review/challenge, 45m for rescue. Backgrounding does not extend the budget. On timeout the job stays failed and `result <jobId> [--json]` returns an artifact with partial output labeled NOT a final answer. A session ID is kept if Kimi announced it or, on a native-v2 budget timeout, recovered from the session store when exactly one session matching this spawn exists; `result --json` identifies the source in `kimi_session_id_source`. Cancellation does not capture partial output. Ask/rescue resume inherits the parent budget unless explicitly overridden. Inherited budgets are printed to stderr at launch; status and `result --json` expose `budget_source` (`explicit`, `inherited`, or `default`; old non-null budgets report `unknown`).
31
31
  - Forward `--base <ref>`, `-m`/`--model <name>`, `--budget <dur>`, and any trailing focus text only.
32
- - Do not invent file/path flags; review's payload is the git diff plus optional focus text.
32
+ - Do not invent file/path flags; working-tree review supplies Git status and diff context, with untracked files read from the workspace, plus optional focus text. `--base` keeps the branch diff as its scope.
33
33
  - If the companion reports REVIEW_HOOK_NOT_INSTALLED, tell the user to run Claude Code /kimi:setup or Codex $kimi-setup, then retry; do not suggest the skip env.
34
34
  - Return companion stdout verbatim and leave any fixes to a separate user request.
@@ -5,7 +5,7 @@ description: "List configured models, guide provider setup, verify local Kimi co
5
5
 
6
6
  # Kimi Setup
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Show the latest or selected plugin-managed Kimi job for the curren
5
5
 
6
6
  # Kimi Status
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Run a read-only parallel Kimi review fan-out across many independe
5
5
 
6
6
  # Kimi Swarm
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -5,7 +5,7 @@ description: "Run a write-capable Kimi swarm that edits many disjoint targets in
5
5
 
6
6
  # Kimi Swarm Write
7
7
 
8
- Forward this request to the local kimi-code companion runtime by shell. Do not use MCP for this skill.
8
+ Forward this request to the local Kimi Code companion runtime by shell. Do not use MCP for this skill.
9
9
 
10
10
  ## Invocation
11
11