kimi-plugin-cc 2.7.3 → 3.0.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +3 -5
- package/CHANGELOG.md +69 -0
- package/README.md +505 -448
- package/agents/kimi-pursue.md +6 -6
- package/agents/kimi-review.md +22 -22
- package/agents/kimi-swarm.md +25 -23
- package/agents/{kimi-ask.md → kimi-task.md} +34 -30
- package/commands/README.md +4 -6
- package/commands/pursue.md +1 -1
- package/commands/review.md +8 -3
- package/commands/setup.md +4 -2
- package/commands/swarm.md +3 -2
- package/commands/{rescue.md → task.md} +13 -11
- package/dist/background-spawn.js +10 -17
- package/dist/cli-client.js +65 -46
- package/dist/commands/ask.js +22 -89
- package/dist/commands/cancel.js +7 -46
- package/dist/commands/cli-helpers.js +102 -1
- package/dist/commands/models.js +2 -3
- package/dist/commands/pursue.js +5 -19
- package/dist/commands/repair-sessions.js +118 -12
- package/dist/commands/rescue.js +12 -82
- package/dist/commands/result.js +7 -1
- package/dist/commands/review-gate.js +1 -0
- package/dist/commands/review.js +12 -15
- package/dist/commands/setup.js +606 -270
- package/dist/commands/status.js +2 -2
- package/dist/commands/swarm.js +93 -119
- package/dist/commands/worker.js +1 -2
- package/dist/companion.js +3 -1
- package/dist/dsh/index.js +15 -17
- package/dist/git.js +1 -9
- package/dist/help.js +3 -3
- package/dist/hooks/approval-hook.js +41 -0
- package/dist/hooks/approval-policy.js +72 -10
- package/dist/hooks/config-safety.js +19 -43
- package/dist/hooks/hook-timing.js +48 -0
- package/dist/hooks/install.js +206 -11
- package/dist/hooks/managed-block.js +78 -33
- package/dist/job-store.js +100 -128
- package/dist/jobs.js +14 -19
- package/dist/kimi-command.js +74 -1
- package/dist/kimi-engine.js +170 -75
- package/dist/kimi-errors.js +14 -69
- package/dist/kimi-home.js +6 -0
- package/dist/kimi-journal.js +41 -0
- package/dist/kimi-releases.js +144 -0
- package/dist/kimi-timeouts.js +1 -1
- package/dist/kimi-version-probe.js +12 -48
- package/dist/mcp/job-control.js +4 -6
- package/dist/mcp/launcher.js +12 -6
- package/dist/mcp/operations.js +50 -18
- package/dist/mcp/protocol.js +16 -14
- package/dist/mcp/stdio.js +3 -2
- package/dist/model-command.js +5 -3
- package/dist/native-v2-preflight.js +139 -68
- package/dist/parsing.js +171 -237
- package/dist/paths.js +8 -0
- package/dist/process-tree.js +35 -24
- package/dist/read-scope.js +435 -0
- package/dist/render.js +46 -9
- package/dist/rescue-approval.js +461 -84
- package/dist/schemas/review-gate-output.js +3 -5
- package/dist/session-title.js +25 -5
- package/dist/stream-json.js +1 -3
- package/dist/surface-routing.js +21 -0
- package/dist/swarm-activation.js +72 -75
- package/dist/swarm-policy.js +2 -1
- package/dist/swarm-recovery.js +2 -1
- package/dist/util.js +28 -0
- package/dist/version.js +1 -1
- package/docs/migration.md +24 -3
- package/docs/models.md +2 -2
- package/docs/registry-releases.md +1 -1
- package/docs/safety.md +120 -70
- package/docs/session-visibility.md +5 -3
- package/docs/swarm-recovery.md +1 -1
- package/docs/upstream-2.7.3-certification.md +14 -2
- package/package.json +1 -1
- package/plugins/kimi-codex/.codex-plugin/plugin.json +3 -3
- package/plugins/kimi-codex/.mcp.json +1 -0
- package/plugins/kimi-codex/dist/background-spawn.js +10 -17
- package/plugins/kimi-codex/dist/cli-client.js +65 -46
- package/plugins/kimi-codex/dist/commands/ask.js +22 -89
- package/plugins/kimi-codex/dist/commands/cancel.js +7 -46
- package/plugins/kimi-codex/dist/commands/cli-helpers.js +102 -1
- package/plugins/kimi-codex/dist/commands/models.js +2 -3
- package/plugins/kimi-codex/dist/commands/pursue.js +5 -19
- package/plugins/kimi-codex/dist/commands/repair-sessions.js +118 -12
- package/plugins/kimi-codex/dist/commands/rescue.js +12 -82
- package/plugins/kimi-codex/dist/commands/result.js +7 -1
- package/plugins/kimi-codex/dist/commands/review-gate.js +1 -0
- package/plugins/kimi-codex/dist/commands/review.js +12 -15
- package/plugins/kimi-codex/dist/commands/setup.js +606 -270
- package/plugins/kimi-codex/dist/commands/status.js +2 -2
- package/plugins/kimi-codex/dist/commands/swarm.js +93 -119
- package/plugins/kimi-codex/dist/commands/worker.js +1 -2
- package/plugins/kimi-codex/dist/companion.js +3 -1
- package/plugins/kimi-codex/dist/dsh/index.js +15 -17
- package/plugins/kimi-codex/dist/git.js +1 -9
- package/plugins/kimi-codex/dist/help.js +3 -3
- package/plugins/kimi-codex/dist/hooks/approval-hook.js +41 -0
- package/plugins/kimi-codex/dist/hooks/approval-policy.js +72 -10
- package/plugins/kimi-codex/dist/hooks/config-safety.js +19 -43
- package/plugins/kimi-codex/dist/hooks/hook-timing.js +48 -0
- package/plugins/kimi-codex/dist/hooks/install.js +206 -11
- package/plugins/kimi-codex/dist/hooks/managed-block.js +78 -33
- package/plugins/kimi-codex/dist/job-store.js +100 -128
- package/plugins/kimi-codex/dist/jobs.js +14 -19
- package/plugins/kimi-codex/dist/kimi-command.js +74 -1
- package/plugins/kimi-codex/dist/kimi-engine.js +170 -75
- package/plugins/kimi-codex/dist/kimi-errors.js +14 -69
- package/plugins/kimi-codex/dist/kimi-home.js +6 -0
- package/plugins/kimi-codex/dist/kimi-journal.js +41 -0
- package/plugins/kimi-codex/dist/kimi-releases.js +144 -0
- package/plugins/kimi-codex/dist/kimi-timeouts.js +1 -1
- package/plugins/kimi-codex/dist/kimi-version-probe.js +12 -48
- package/plugins/kimi-codex/dist/mcp/job-control.js +4 -6
- package/plugins/kimi-codex/dist/mcp/launcher.js +12 -6
- package/plugins/kimi-codex/dist/mcp/operations.js +50 -18
- package/plugins/kimi-codex/dist/mcp/protocol.js +16 -14
- package/plugins/kimi-codex/dist/mcp/stdio.js +3 -2
- package/plugins/kimi-codex/dist/model-command.js +5 -3
- package/plugins/kimi-codex/dist/native-v2-preflight.js +139 -68
- package/plugins/kimi-codex/dist/parsing.js +171 -237
- package/plugins/kimi-codex/dist/paths.js +8 -0
- package/plugins/kimi-codex/dist/process-tree.js +35 -24
- package/plugins/kimi-codex/dist/read-scope.js +435 -0
- package/plugins/kimi-codex/dist/render.js +46 -9
- package/plugins/kimi-codex/dist/rescue-approval.js +461 -84
- package/plugins/kimi-codex/dist/schemas/review-gate-output.js +3 -5
- package/plugins/kimi-codex/dist/session-title.js +25 -5
- package/plugins/kimi-codex/dist/stream-json.js +1 -3
- package/plugins/kimi-codex/dist/surface-routing.js +21 -0
- package/plugins/kimi-codex/dist/swarm-activation.js +72 -75
- package/plugins/kimi-codex/dist/swarm-policy.js +2 -1
- package/plugins/kimi-codex/dist/swarm-recovery.js +2 -1
- package/plugins/kimi-codex/dist/util.js +28 -0
- package/plugins/kimi-codex/dist/version.js +1 -1
- package/plugins/kimi-codex/skills/kimi-pursue/SKILL.md +1 -1
- package/plugins/kimi-codex/skills/kimi-review/SKILL.md +8 -7
- package/plugins/kimi-codex/skills/kimi-review/agents/openai.yaml +1 -1
- package/plugins/kimi-codex/skills/kimi-setup/SKILL.md +2 -1
- package/plugins/kimi-codex/skills/kimi-swarm/SKILL.md +8 -6
- package/plugins/kimi-codex/skills/kimi-swarm/agents/openai.yaml +1 -1
- package/plugins/kimi-codex/skills/{kimi-ask → kimi-task}/SKILL.md +11 -9
- package/plugins/kimi-codex/skills/kimi-task/agents/openai.yaml +6 -0
- package/plugins/kimi-dsh/README.md +3 -2
- package/plugins/kimi-dsh/dist/background-spawn.js +10 -17
- package/plugins/kimi-dsh/dist/cli-client.js +65 -46
- package/plugins/kimi-dsh/dist/commands/ask.js +22 -89
- package/plugins/kimi-dsh/dist/commands/cancel.js +7 -46
- package/plugins/kimi-dsh/dist/commands/cli-helpers.js +102 -1
- package/plugins/kimi-dsh/dist/commands/models.js +2 -3
- package/plugins/kimi-dsh/dist/commands/pursue.js +5 -19
- package/plugins/kimi-dsh/dist/commands/repair-sessions.js +118 -12
- package/plugins/kimi-dsh/dist/commands/rescue.js +12 -82
- package/plugins/kimi-dsh/dist/commands/result.js +7 -1
- package/plugins/kimi-dsh/dist/commands/review-gate.js +1 -0
- package/plugins/kimi-dsh/dist/commands/review.js +12 -15
- package/plugins/kimi-dsh/dist/commands/setup.js +606 -270
- package/plugins/kimi-dsh/dist/commands/status.js +2 -2
- package/plugins/kimi-dsh/dist/commands/swarm.js +93 -119
- package/plugins/kimi-dsh/dist/commands/worker.js +1 -2
- package/plugins/kimi-dsh/dist/companion.js +3 -1
- package/plugins/kimi-dsh/dist/dsh/index.js +15 -17
- package/plugins/kimi-dsh/dist/git.js +1 -9
- package/plugins/kimi-dsh/dist/help.js +3 -3
- package/plugins/kimi-dsh/dist/hooks/approval-hook.js +41 -0
- package/plugins/kimi-dsh/dist/hooks/approval-policy.js +72 -10
- package/plugins/kimi-dsh/dist/hooks/config-safety.js +19 -43
- package/plugins/kimi-dsh/dist/hooks/hook-timing.js +48 -0
- package/plugins/kimi-dsh/dist/hooks/install.js +206 -11
- package/plugins/kimi-dsh/dist/hooks/managed-block.js +78 -33
- package/plugins/kimi-dsh/dist/job-store.js +100 -128
- package/plugins/kimi-dsh/dist/jobs.js +14 -19
- package/plugins/kimi-dsh/dist/kimi-command.js +74 -1
- package/plugins/kimi-dsh/dist/kimi-engine.js +170 -75
- package/plugins/kimi-dsh/dist/kimi-errors.js +14 -69
- package/plugins/kimi-dsh/dist/kimi-home.js +6 -0
- package/plugins/kimi-dsh/dist/kimi-journal.js +41 -0
- package/plugins/kimi-dsh/dist/kimi-releases.js +144 -0
- package/plugins/kimi-dsh/dist/kimi-timeouts.js +1 -1
- package/plugins/kimi-dsh/dist/kimi-version-probe.js +12 -48
- package/plugins/kimi-dsh/dist/mcp/job-control.js +4 -6
- package/plugins/kimi-dsh/dist/mcp/launcher.js +12 -6
- package/plugins/kimi-dsh/dist/mcp/operations.js +50 -18
- package/plugins/kimi-dsh/dist/mcp/protocol.js +16 -14
- package/plugins/kimi-dsh/dist/mcp/stdio.js +3 -2
- package/plugins/kimi-dsh/dist/model-command.js +5 -3
- package/plugins/kimi-dsh/dist/native-v2-preflight.js +139 -68
- package/plugins/kimi-dsh/dist/parsing.js +171 -237
- package/plugins/kimi-dsh/dist/paths.js +8 -0
- package/plugins/kimi-dsh/dist/process-tree.js +35 -24
- package/plugins/kimi-dsh/dist/read-scope.js +435 -0
- package/plugins/kimi-dsh/dist/render.js +46 -9
- package/plugins/kimi-dsh/dist/rescue-approval.js +461 -84
- package/plugins/kimi-dsh/dist/schemas/review-gate-output.js +3 -5
- package/plugins/kimi-dsh/dist/session-title.js +25 -5
- package/plugins/kimi-dsh/dist/stream-json.js +1 -3
- package/plugins/kimi-dsh/dist/surface-routing.js +21 -0
- package/plugins/kimi-dsh/dist/swarm-activation.js +72 -75
- package/plugins/kimi-dsh/dist/swarm-policy.js +2 -1
- package/plugins/kimi-dsh/dist/swarm-recovery.js +2 -1
- package/plugins/kimi-dsh/dist/util.js +28 -0
- package/plugins/kimi-dsh/dist/version.js +1 -1
- package/plugins/kimi-dsh/package.json +1 -1
- package/agents/kimi-challenge.md +0 -86
- package/agents/kimi-rescue.md +0 -92
- package/agents/kimi-swarm-write.md +0 -96
- package/commands/ask.md +0 -38
- package/commands/challenge.md +0 -35
- package/dist/commands/not-implemented.js +0 -4
- package/plugins/kimi-codex/dist/commands/not-implemented.js +0 -4
- package/plugins/kimi-codex/skills/kimi-ask/agents/openai.yaml +0 -6
- package/plugins/kimi-codex/skills/kimi-challenge/SKILL.md +0 -34
- package/plugins/kimi-codex/skills/kimi-challenge/agents/openai.yaml +0 -6
- package/plugins/kimi-codex/skills/kimi-rescue/SKILL.md +0 -34
- package/plugins/kimi-codex/skills/kimi-rescue/agents/openai.yaml +0 -6
- package/plugins/kimi-codex/skills/kimi-swarm-write/SKILL.md +0 -36
- package/plugins/kimi-codex/skills/kimi-swarm-write/agents/openai.yaml +0 -6
- package/plugins/kimi-dsh/dist/commands/not-implemented.js +0 -4
package/dist/render.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { parseJobWarnings } from "./job-store.js";
|
|
4
|
+
import { describeReadScope, parseJobReadScope } from "./read-scope.js";
|
|
3
5
|
import { getManagedCommandConfig } from "./commands/registry.js";
|
|
4
6
|
import { RuntimeError } from "./errors.js";
|
|
5
7
|
import { parseReviewGateOutput } from "./schemas/review-gate-output.js";
|
|
@@ -12,7 +14,35 @@ export async function writeArtifact(paths, job, markdown) {
|
|
|
12
14
|
export async function readArtifact(artifactPath) {
|
|
13
15
|
return readFile(artifactPath, "utf8");
|
|
14
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Prefix a "Warnings:" block when the job carries launch warnings. Wrapper
|
|
19
|
+
* models read stdout and artifacts, never stderr, so this is the load-bearing
|
|
20
|
+
* copy. Without warnings the text is returned unchanged, byte for byte.
|
|
21
|
+
*/
|
|
22
|
+
export function withWarningsBlock(job, text) {
|
|
23
|
+
const warnings = parseJobWarnings(job.warnings);
|
|
24
|
+
if (warnings.length === 0)
|
|
25
|
+
return text;
|
|
26
|
+
return `Warnings:\n${warnings.map((warning) => `- ${warning}`).join("\n")}\n\n${text}`;
|
|
27
|
+
}
|
|
28
|
+
/** Prefix the non-default read scope so callers see what they asked for; unchanged otherwise. */
|
|
29
|
+
export function withScopeLine(job, text) {
|
|
30
|
+
const line = describeReadScope(parseJobReadScope(job.read_scope));
|
|
31
|
+
return line === undefined ? text : `${line}\n\n${text}`;
|
|
32
|
+
}
|
|
15
33
|
export function renderManagedJobOutput(job, finalText) {
|
|
34
|
+
const rendered = renderManagedJobOutputBody(job, finalText);
|
|
35
|
+
if (parseJobWarnings(job.warnings).length === 0 && !job.read_scope)
|
|
36
|
+
return rendered;
|
|
37
|
+
const decorate = (text) => withWarningsBlock(job, withScopeLine(job, text));
|
|
38
|
+
return {
|
|
39
|
+
...rendered,
|
|
40
|
+
// review_gate's output is the parsed decision object; its warnings live in the artifact only.
|
|
41
|
+
output: typeof rendered.output === "string" ? decorate(rendered.output) : rendered.output,
|
|
42
|
+
rendered: decorate(rendered.rendered),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function renderManagedJobOutputBody(job, finalText) {
|
|
16
46
|
assertOutputModeConsistency(job.command_type, finalText);
|
|
17
47
|
switch (job.command_type) {
|
|
18
48
|
case "ask": {
|
|
@@ -22,9 +52,8 @@ export function renderManagedJobOutput(job, finalText) {
|
|
|
22
52
|
}
|
|
23
53
|
return {
|
|
24
54
|
output: trimmed,
|
|
25
|
-
rendered:
|
|
55
|
+
rendered: trimmed,
|
|
26
56
|
summary: trimmed.slice(0, 160),
|
|
27
|
-
error: null,
|
|
28
57
|
};
|
|
29
58
|
}
|
|
30
59
|
case "review":
|
|
@@ -37,7 +66,6 @@ export function renderManagedJobOutput(job, finalText) {
|
|
|
37
66
|
output: trimmed,
|
|
38
67
|
rendered: renderReviewArtifact(job, trimmed),
|
|
39
68
|
summary: firstMeaningfulLine(trimmed),
|
|
40
|
-
error: null,
|
|
41
69
|
};
|
|
42
70
|
}
|
|
43
71
|
case "review_gate": {
|
|
@@ -46,7 +74,6 @@ export function renderManagedJobOutput(job, finalText) {
|
|
|
46
74
|
output,
|
|
47
75
|
rendered: renderReviewGateArtifact(job, output),
|
|
48
76
|
summary: output.summary,
|
|
49
|
-
error: null,
|
|
50
77
|
};
|
|
51
78
|
}
|
|
52
79
|
case "rescue": {
|
|
@@ -58,7 +85,6 @@ export function renderManagedJobOutput(job, finalText) {
|
|
|
58
85
|
output: finalText,
|
|
59
86
|
rendered: renderRescueArtifact(finalText),
|
|
60
87
|
summary: firstMeaningfulLine(finalText),
|
|
61
|
-
error: null,
|
|
62
88
|
};
|
|
63
89
|
}
|
|
64
90
|
default:
|
|
@@ -82,9 +108,6 @@ export function assertOutputModeConsistency(commandType, finalText) {
|
|
|
82
108
|
return assertNever(outputMode);
|
|
83
109
|
}
|
|
84
110
|
}
|
|
85
|
-
export function renderAskArtifact(output) {
|
|
86
|
-
return output.trim();
|
|
87
|
-
}
|
|
88
111
|
export function renderReviewArtifact(job, output) {
|
|
89
112
|
const header = [
|
|
90
113
|
`# ${job.command_type === "challenge" ? "Challenge" : "Review"} Result`,
|
|
@@ -144,7 +167,12 @@ export function renderTerminalJobArtifact(job, partialOutput) {
|
|
|
144
167
|
`- Status: ${job.status}`,
|
|
145
168
|
`- Summary: ${job.summary}`,
|
|
146
169
|
...(job.kimi_session_id ? [`- Kimi session: ${job.kimi_session_id}`] : []),
|
|
170
|
+
...terminalScopeLine(job),
|
|
147
171
|
];
|
|
172
|
+
const warnings = parseJobWarnings(job.warnings);
|
|
173
|
+
if (warnings.length > 0) {
|
|
174
|
+
lines.push("", "Warnings:", ...warnings.map((warning) => `- ${warning}`));
|
|
175
|
+
}
|
|
148
176
|
if (job.error) {
|
|
149
177
|
lines.push("", "## Error", `- Code: ${job.error.code}`, `- Stage: ${job.error.stage}`, job.error.message);
|
|
150
178
|
// Structured context (e.g. `drift_axis` / `retryable_after_setup`) so a
|
|
@@ -169,7 +197,16 @@ export function renderTerminalJobArtifact(job, partialOutput) {
|
|
|
169
197
|
}
|
|
170
198
|
return lines.join("\n");
|
|
171
199
|
}
|
|
172
|
-
function
|
|
200
|
+
function terminalScopeLine(job) {
|
|
201
|
+
try {
|
|
202
|
+
const line = describeReadScope(parseJobReadScope(job.read_scope));
|
|
203
|
+
return line === undefined ? [] : [`- ${line}`];
|
|
204
|
+
}
|
|
205
|
+
catch {
|
|
206
|
+
return ["- Scope: unreadable stored scope"];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
export function capitalize(value) {
|
|
173
210
|
return value.slice(0, 1).toUpperCase() + value.slice(1);
|
|
174
211
|
}
|
|
175
212
|
function assertNever(value) {
|