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/kimi-command.js
CHANGED
|
@@ -1,6 +1,79 @@
|
|
|
1
|
+
import { accessSync, constants as fsConstants, lstatSync, realpathSync, statSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
1
3
|
import { RuntimeError } from "./errors.js";
|
|
4
|
+
import { resolveKimiBinDir } from "./paths.js";
|
|
5
|
+
const EXACT_VERSION_DIR_RE = /^\d+\.\d+\.\d+$/;
|
|
6
|
+
/** Which binary jobs will use and why; setup reports this. */
|
|
7
|
+
export function selectKimiBinary(env) {
|
|
8
|
+
const pluginOwned = inspectPluginOwnedKimi(env);
|
|
9
|
+
if (env.KIMI_PLUGIN_CC_KIMI_BIN) {
|
|
10
|
+
return { command: env.KIMI_PLUGIN_CC_KIMI_BIN, source: "override", pluginOwned };
|
|
11
|
+
}
|
|
12
|
+
if (pluginOwned.status === "active") {
|
|
13
|
+
return { command: pluginOwned.target, source: "plugin-owned", pluginOwned };
|
|
14
|
+
}
|
|
15
|
+
return { command: "kimi", source: "path", pluginOwned };
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The plugin-owned binary is used only when `current` resolves to an
|
|
19
|
+
* executable regular file inside `<data root>/kimi-plugin-cc/kimi-bin/<x.y.z>/`. The resolved
|
|
20
|
+
* realpath is returned so the checked file is the one the plan records.
|
|
21
|
+
* Anything else falls back to PATH, as before this install existed.
|
|
22
|
+
*/
|
|
23
|
+
export function inspectPluginOwnedKimi(env) {
|
|
24
|
+
let binDir;
|
|
25
|
+
try {
|
|
26
|
+
binDir = resolveKimiBinDir(env);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return { binDir: null, status: "unavailable", reason: "plugin data root is not resolved" };
|
|
30
|
+
}
|
|
31
|
+
if (process.platform === "win32") {
|
|
32
|
+
return { binDir, status: "unavailable", reason: "plugin-owned kimi-code is not supported on Windows" };
|
|
33
|
+
}
|
|
34
|
+
const currentPath = path.join(binDir, "current");
|
|
35
|
+
try {
|
|
36
|
+
lstatSync(currentPath);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return { binDir, status: "absent" };
|
|
40
|
+
}
|
|
41
|
+
let realBinDir;
|
|
42
|
+
let target;
|
|
43
|
+
try {
|
|
44
|
+
realBinDir = realpathSync(binDir);
|
|
45
|
+
target = realpathSync(currentPath);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return { binDir, status: "rejected", reason: `${currentPath} does not resolve to an existing file` };
|
|
49
|
+
}
|
|
50
|
+
const relative = path.relative(realBinDir, target);
|
|
51
|
+
const versionDir = relative.split(path.sep)[0] ?? "";
|
|
52
|
+
if (relative === "" ||
|
|
53
|
+
path.isAbsolute(relative) ||
|
|
54
|
+
relative.startsWith(`..${path.sep}`) ||
|
|
55
|
+
relative === ".." ||
|
|
56
|
+
!EXACT_VERSION_DIR_RE.test(versionDir) ||
|
|
57
|
+
relative === versionDir) {
|
|
58
|
+
return {
|
|
59
|
+
binDir,
|
|
60
|
+
status: "rejected",
|
|
61
|
+
reason: `${currentPath} resolves to ${target}, outside ${path.join(realBinDir, "<version>")}${path.sep}`,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
if (!statSync(target).isFile()) {
|
|
66
|
+
return { binDir, status: "rejected", reason: `${target} is not a regular file` };
|
|
67
|
+
}
|
|
68
|
+
accessSync(target, fsConstants.X_OK);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return { binDir, status: "rejected", reason: `${target} is not executable` };
|
|
72
|
+
}
|
|
73
|
+
return { binDir, status: "active", target, version: versionDir };
|
|
74
|
+
}
|
|
2
75
|
export function resolveKimiCliCommand(env) {
|
|
3
|
-
const command = env.KIMI_PLUGIN_CC_KIMI_BIN ||
|
|
76
|
+
const command = env.KIMI_PLUGIN_CC_KIMI_BIN || selectKimiBinary(env).command;
|
|
4
77
|
const raw = env.KIMI_PLUGIN_CC_KIMI_PREFIX_ARGS;
|
|
5
78
|
if (!raw) {
|
|
6
79
|
return { command, prefixArgs: [] };
|
package/dist/kimi-engine.js
CHANGED
|
@@ -4,8 +4,46 @@ import path from "node:path";
|
|
|
4
4
|
import { RuntimeError } from "./errors.js";
|
|
5
5
|
import { resolveKimiCliCommand } from "./kimi-command.js";
|
|
6
6
|
import { resolveKimiHome } from "./kimi-home.js";
|
|
7
|
+
import { formatVersionChoice, kimiVersionsInScope, kimiVersionsWith, resolveKimiRelease } from "./kimi-releases.js";
|
|
8
|
+
import { hookGateRefusal, verifyHookInstalled } from "./hooks/install.js";
|
|
7
9
|
import { assertNativeV2Preflight } from "./native-v2-preflight.js";
|
|
8
10
|
import { isInTestedRange, parseVersionLine, probeKimiVersion, } from "./kimi-version-probe.js";
|
|
11
|
+
import { isRecord } from "./util.js";
|
|
12
|
+
/**
|
|
13
|
+
* The user-visible operation actually being performed. This is deliberately
|
|
14
|
+
* separate from JobRecord.command_type: pursue and swarm-write reuse the
|
|
15
|
+
* rescue job lineage, while read-only swarm reuses review.
|
|
16
|
+
*/
|
|
17
|
+
const NON_SWARM_OPERATION_KINDS = ["review", "challenge", "ask", "rescue", "review_gate", "pursue"];
|
|
18
|
+
const OPERATION_KINDS = [...NON_SWARM_OPERATION_KINDS, "swarm", "swarm-write"];
|
|
19
|
+
/** Operations that may run on an uncertified release. Every write or swarm operation stays exact. */
|
|
20
|
+
const UNCERTIFIED_READ_ONLY_OPERATIONS = new Set([
|
|
21
|
+
"ask",
|
|
22
|
+
"review",
|
|
23
|
+
"challenge",
|
|
24
|
+
"review_gate",
|
|
25
|
+
]);
|
|
26
|
+
/** Restores exact-version refusal for every operation. */
|
|
27
|
+
export const STRICT_VERSIONS_ENV = "KIMI_PLUGIN_CC_STRICT_VERSIONS";
|
|
28
|
+
function strictVersions(env) {
|
|
29
|
+
return env[STRICT_VERSIONS_ENV] === "1";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Native-v2 certification of an exact version for one operation: "certified"
|
|
33
|
+
* from the per-operation table, "uncertified" for a read-only operation on an
|
|
34
|
+
* unlisted plain 2.x that borrows a row's mechanics, otherwise null (refuse).
|
|
35
|
+
*/
|
|
36
|
+
export function resolveNativeV2Certification(operationKind, version, env) {
|
|
37
|
+
if (isNativeV2Certified(operationKind, version))
|
|
38
|
+
return "certified";
|
|
39
|
+
if (!UNCERTIFIED_READ_ONLY_OPERATIONS.has(operationKind) || strictVersions(env))
|
|
40
|
+
return null;
|
|
41
|
+
const normalized = parseVersionLine(version)?.raw;
|
|
42
|
+
if (normalized === undefined || isNativeV2CertifiedVersion(normalized))
|
|
43
|
+
return null;
|
|
44
|
+
const resolved = resolveKimiRelease(normalized);
|
|
45
|
+
return resolved !== null && !resolved.certified ? "uncertified" : null;
|
|
46
|
+
}
|
|
9
47
|
export const NATIVE_V2_SAFETY_PROFILE = "native-v2-no-plan/1";
|
|
10
48
|
/**
|
|
11
49
|
* Minimum legacy-v1 version that actually contains each operation. The upper
|
|
@@ -25,42 +63,19 @@ const LEGACY_V1_MINIMUMS = {
|
|
|
25
63
|
* Exact kimi-code releases certified for native v2 under
|
|
26
64
|
* NATIVE_V2_SAFETY_PROFILE. Exact, not minor-ranged: upstream ships
|
|
27
65
|
* behavioural changes in patch releases, and the no-plan construction must be
|
|
28
|
-
* re-proven (mechanized tag scan + real-binary smoke) per tag before a
|
|
29
|
-
*
|
|
30
|
-
*
|
|
66
|
+
* re-proven (mechanized tag scan + real-binary smoke) per tag before a row is
|
|
67
|
+
* added to KIMI_V2_RELEASES in kimi-releases.ts with scope "all". Each entry
|
|
68
|
+
* has its own row in tests/audit/v2-tag-scan.test.ts and a dated entry in
|
|
69
|
+
* ROADMAP-TO-GA.md § Post-GA audit log.
|
|
31
70
|
*/
|
|
32
|
-
export const NATIVE_V2_CERTIFIED_VERSIONS = Object.freeze([
|
|
33
|
-
"0.42.0",
|
|
34
|
-
"0.43.0",
|
|
35
|
-
"0.43.1",
|
|
36
|
-
"2.0.0",
|
|
37
|
-
"2.0.1",
|
|
38
|
-
"2.0.2",
|
|
39
|
-
"2.1.0",
|
|
40
|
-
"2.1.1",
|
|
41
|
-
"2.2.0",
|
|
42
|
-
"2.3.0",
|
|
43
|
-
"2.3.1",
|
|
44
|
-
"2.3.2",
|
|
45
|
-
"2.3.3",
|
|
46
|
-
"2.4.0",
|
|
47
|
-
"2.4.1",
|
|
48
|
-
"2.5.0",
|
|
49
|
-
"2.5.1",
|
|
50
|
-
"2.5.2",
|
|
51
|
-
"2.5.3",
|
|
52
|
-
"2.6.2",
|
|
53
|
-
"2.6.3",
|
|
54
|
-
"2.7.2",
|
|
55
|
-
"2.7.3",
|
|
56
|
-
]);
|
|
71
|
+
export const NATIVE_V2_CERTIFIED_VERSIONS = Object.freeze([...kimiVersionsInScope("all")]);
|
|
57
72
|
/**
|
|
58
73
|
* Exact releases certified only for review, challenge, ask, rescue, review_gate
|
|
59
74
|
* and pursue. Their upstream rate-limit recovery can exceed AgentSwarm's
|
|
60
75
|
* configured maximum, and these releases lack a certified plugin admission
|
|
61
76
|
* construction, so both swarm operations refuse before model spawn.
|
|
62
77
|
*/
|
|
63
|
-
export const NATIVE_V2_NON_SWARM_VERSIONS = Object.freeze(["
|
|
78
|
+
export const NATIVE_V2_NON_SWARM_VERSIONS = Object.freeze([...kimiVersionsInScope("non-swarm")]);
|
|
64
79
|
/**
|
|
65
80
|
* Any-operation union used by setup and engine selection. The older
|
|
66
81
|
* NATIVE_V2_CERTIFIED_VERSIONS export stays all-operation-only for consumers
|
|
@@ -100,25 +115,34 @@ export function isNativeV2CertifiedVersion(version) {
|
|
|
100
115
|
return NATIVE_V2_ANY_OPERATION_VERSIONS.includes(normalized);
|
|
101
116
|
}
|
|
102
117
|
/**
|
|
103
|
-
* Select native v2 for
|
|
104
|
-
*
|
|
105
|
-
*
|
|
118
|
+
* Select native v2 for a certified version, a test-only operation admission,
|
|
119
|
+
* or any major-2 release, then enforce scope in assertCertifiedCapability. A
|
|
120
|
+
* narrowed or uncertified 2.x never falls back to legacy-v1 (deleted upstream
|
|
121
|
+
* at 0.42.0), so its refusal names the native-v2 set.
|
|
106
122
|
*/
|
|
107
123
|
export function selectIntendedEngine(operationKind, probe) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
124
|
+
if (isNativeV2CertifiedVersion(probe.version) || isNativeV2Certified(operationKind, probe.version)) {
|
|
125
|
+
return "native-v2";
|
|
126
|
+
}
|
|
127
|
+
const parsed = parseVersionLine(probe.version);
|
|
128
|
+
return parsed !== undefined && parsed.major >= 2 ? "native-v2" : "legacy-v1";
|
|
111
129
|
}
|
|
112
130
|
const UNSAFE_EXPERIMENTAL_VALUES = new Set(["1", "true", "yes", "on"]);
|
|
113
131
|
/**
|
|
114
|
-
* Refuse the ambient experimental-feature selector
|
|
115
|
-
*
|
|
116
|
-
*
|
|
132
|
+
* Refuse the ambient experimental-feature selector for legacy-v1, uncertified
|
|
133
|
+
* and plan-less launches. A certified or test-bypass native-v2 plan is exempt:
|
|
134
|
+
* upstream reads the master flag only from the child's own environment
|
|
135
|
+
* (flagService via bootstrap.getEnv, 0.42.0-2.7.3), and buildKimiCliEnvironment
|
|
136
|
+
* deletes it from every native-v2 child. cli-client and swarm activation repeat
|
|
137
|
+
* this at the final spawn boundary in case the environment changed after plan
|
|
138
|
+
* creation.
|
|
117
139
|
*/
|
|
118
|
-
export function assertNoUnsafeExperimentalSelector(env, stage = "kimi-engine.plan") {
|
|
140
|
+
export function assertNoUnsafeExperimentalSelector(env, stage = "kimi-engine.plan", plan) {
|
|
119
141
|
const enabled = UNSAFE_EXPERIMENTAL_VALUES.has((env.KIMI_CODE_EXPERIMENTAL_FLAG ?? "").trim().toLowerCase());
|
|
120
142
|
if (!enabled)
|
|
121
143
|
return;
|
|
144
|
+
if (plan?.intendedEngine === "native-v2" && plan.certification !== "uncertified")
|
|
145
|
+
return;
|
|
122
146
|
throw new RuntimeError("CLI_V2_HOOK_ORDER_UNSAFE", "Refusing kimi-code experimental features: the master KIMI_CODE_EXPERIMENTAL_FLAG enables unreviewed agent-core-v2 features (tower, subagent fork) that kimi-plugin-cc has not certified under its no-plan safety profile. Unset KIMI_CODE_EXPERIMENTAL_FLAG and retry.", stage, {
|
|
123
147
|
details: {
|
|
124
148
|
refusal_kind: "v2-hook-order-unsafe",
|
|
@@ -134,33 +158,41 @@ export function assertNoUnsafeExperimentalSelector(env, stage = "kimi-engine.pla
|
|
|
134
158
|
* alternate route between dispatch and execution.
|
|
135
159
|
*/
|
|
136
160
|
export async function prepareKimiExecutionPlan(options) {
|
|
137
|
-
|
|
161
|
+
// An explicit legacy-v1 plan refuses before any subprocess; otherwise the
|
|
162
|
+
// engine and certification decide below, after the master-flag-free probe.
|
|
163
|
+
if (options.intendedEngine === "legacy-v1")
|
|
164
|
+
assertNoUnsafeExperimentalSelector(options.env);
|
|
138
165
|
if (options.intendedEngine === "native-v2" &&
|
|
139
166
|
!NATIVE_V2_CERTIFIED.has(options.operationKind)) {
|
|
140
167
|
throw nativeV2NotCertified(options.operationKind, null);
|
|
141
168
|
}
|
|
142
169
|
const kimi = resolveKimiCliCommand(options.env);
|
|
143
170
|
const exactCommand = await resolveExactExecutable(kimi.command, options.cwd, options.env);
|
|
144
|
-
const
|
|
171
|
+
const warnings = [];
|
|
172
|
+
const runPreflight = async (intendedEngine, release) => {
|
|
145
173
|
if (options.resumeSource) {
|
|
146
174
|
assertResumeEngineCompatible(options.resumeSource, intendedEngine, options.operationKind);
|
|
147
175
|
}
|
|
148
176
|
if (intendedEngine !== "native-v2")
|
|
149
177
|
return;
|
|
150
178
|
// Safety, not certification: runs for test-bypass plans too.
|
|
151
|
-
await assertNativeV2Preflight({
|
|
179
|
+
const preflight = await assertNativeV2Preflight({
|
|
152
180
|
kimiHome: resolveKimiHome(options.env, options.cwd),
|
|
153
181
|
env: options.env,
|
|
154
182
|
resumeSessionId: options.resumeSessionId,
|
|
155
183
|
expectedExecutionRoot: options.cwd,
|
|
156
184
|
stage: "kimi-engine.plan",
|
|
185
|
+
release: { operationKind: options.operationKind, ...release },
|
|
157
186
|
});
|
|
187
|
+
warnings.push(...preflight.warnings);
|
|
158
188
|
};
|
|
159
189
|
if (options.env.KIMI_PLUGIN_CC_SKIP_VERSION_PROBE === "1") {
|
|
160
190
|
const intendedEngine = options.intendedEngine ?? "legacy-v1";
|
|
161
191
|
const safetyProfile = intendedEngine === "native-v2" ? NATIVE_V2_SAFETY_PROFILE : null;
|
|
162
|
-
|
|
163
|
-
|
|
192
|
+
assertNoUnsafeExperimentalSelector(options.env, "kimi-engine.plan", { intendedEngine, certification: "test-bypass" });
|
|
193
|
+
await runPreflight(intendedEngine, { kimiVersion: null, certification: "test-bypass" });
|
|
194
|
+
warnings.push(...await planHookCheck(options.operationKind, options.env, options.stderr));
|
|
195
|
+
return finishPlan({
|
|
164
196
|
schemaVersion: 1,
|
|
165
197
|
operationKind: options.operationKind,
|
|
166
198
|
intendedEngine,
|
|
@@ -170,13 +202,13 @@ export async function prepareKimiExecutionPlan(options) {
|
|
|
170
202
|
certification: "test-bypass",
|
|
171
203
|
resumedFromJobId: options.resumedFromJobId ?? null,
|
|
172
204
|
safetyProfile,
|
|
173
|
-
});
|
|
205
|
+
}, warnings, options.stderr);
|
|
174
206
|
}
|
|
175
207
|
const probe = await probeKimiVersion({
|
|
176
208
|
kimiBin: exactCommand,
|
|
177
209
|
prefixArgs: kimi.prefixArgs,
|
|
178
210
|
cwd: options.cwd,
|
|
179
|
-
env: options.env,
|
|
211
|
+
env: withoutExperimentalMasterFlag(options.env),
|
|
180
212
|
});
|
|
181
213
|
if (probe.kind !== "ok") {
|
|
182
214
|
throw new RuntimeError("KIMI_EXECUTION_PLAN_UNRESOLVED", `Refusing to spawn kimi because the exact command/version plan could not be established: ${probe.reason}. Run Claude Code \`/kimi:setup\` or Codex \`$kimi-setup\` to verify the active binary, or correct KIMI_PLUGIN_CC_KIMI_BIN / KIMI_PLUGIN_CC_KIMI_PREFIX_ARGS and retry.`, "kimi-engine.plan", {
|
|
@@ -190,19 +222,71 @@ export async function prepareKimiExecutionPlan(options) {
|
|
|
190
222
|
}
|
|
191
223
|
const intendedEngine = options.intendedEngine ?? selectIntendedEngine(options.operationKind, probe);
|
|
192
224
|
const safetyProfile = intendedEngine === "native-v2" ? NATIVE_V2_SAFETY_PROFILE : null;
|
|
193
|
-
assertCertifiedCapability(intendedEngine, options.operationKind, probe);
|
|
194
|
-
|
|
195
|
-
|
|
225
|
+
const certification = assertCertifiedCapability(intendedEngine, options.operationKind, probe, options.env);
|
|
226
|
+
assertNoUnsafeExperimentalSelector(options.env, "kimi-engine.plan", { intendedEngine, certification });
|
|
227
|
+
if (certification === "uncertified") {
|
|
228
|
+
const borrowed = resolveKimiRelease(probe.version).release.version;
|
|
229
|
+
warnings.push(`kimi-code ${probe.version} is not certified by this plugin release; running ${options.operationKind} read-only with ${borrowed} mechanics.`);
|
|
230
|
+
}
|
|
231
|
+
await runPreflight(intendedEngine, { kimiVersion: probe.version, certification });
|
|
232
|
+
warnings.push(...await planHookCheck(options.operationKind, options.env, options.stderr, probe));
|
|
233
|
+
return finishPlan({
|
|
196
234
|
schemaVersion: 1,
|
|
197
235
|
operationKind: options.operationKind,
|
|
198
236
|
intendedEngine,
|
|
199
237
|
command: exactCommand,
|
|
200
238
|
prefixArgs: Object.freeze([...kimi.prefixArgs]),
|
|
201
239
|
kimiVersion: probe.version,
|
|
202
|
-
certification
|
|
240
|
+
certification,
|
|
203
241
|
resumedFromJobId: options.resumedFromJobId ?? null,
|
|
204
242
|
safetyProfile,
|
|
205
|
-
});
|
|
243
|
+
}, warnings, options.stderr);
|
|
244
|
+
}
|
|
245
|
+
function withoutExperimentalMasterFlag(env) {
|
|
246
|
+
const copy = { ...env };
|
|
247
|
+
delete copy.KIMI_CODE_EXPERIMENTAL_FLAG;
|
|
248
|
+
return copy;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Job-time hook check against the release this plan probed (`probe`, absent
|
|
252
|
+
* only on the test-bypass path). It refuses when the configured hooks array is
|
|
253
|
+
* invalid for that release, because kimi-code would then load no hook at all;
|
|
254
|
+
* the command gate's earlier check may have probed a different release.
|
|
255
|
+
* Any other definite negative (`installed === false`) refuses with the
|
|
256
|
+
* operation's command-gate error: the hook may have gone between that gate and
|
|
257
|
+
* this plan. KIMI_PLUGIN_CC_SKIP_HOOK_CHECK=1 makes verifyHookInstalled report
|
|
258
|
+
* installed, exactly as at the gates. Otherwise it returns warnings: marker
|
|
259
|
+
* repair (G6) and other hosts' older hooks that still apply their own rules to
|
|
260
|
+
* this job (H2). A thrown, unverifiable result adds nothing and never refuses.
|
|
261
|
+
*/
|
|
262
|
+
async function planHookCheck(operation, env, stderr, probe) {
|
|
263
|
+
let status;
|
|
264
|
+
try {
|
|
265
|
+
status = await verifyHookInstalled(env, { kimiVersion: probe });
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return [];
|
|
269
|
+
}
|
|
270
|
+
if (status.hookSetInvalid) {
|
|
271
|
+
throw new RuntimeError("KIMI_HOOK_SET_INVALID", `Refusing to spawn kimi: the configured kimi-code hooks are invalid for the release this job runs (${probe?.version ?? "version not probed"}): ${status.reason}. kimi-code drops the whole hooks array, so the managed PreToolUse hook would not run. Repair or remove that [[hooks]] entry in ${status.configPath} and retry.`, "kimi-engine.plan", {
|
|
272
|
+
details: {
|
|
273
|
+
config_path: status.configPath,
|
|
274
|
+
kimi_version: probe?.version ?? null,
|
|
275
|
+
retryable_after_setup: false,
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
if (status.installed)
|
|
280
|
+
return status.warnings ?? [];
|
|
281
|
+
throw hookGateRefusal(operation, status, env, stderr);
|
|
282
|
+
}
|
|
283
|
+
/** Freeze the plan; a nonempty warning list is attached and announced once on stderr. */
|
|
284
|
+
function finishPlan(plan, warnings, stderr = process.stderr) {
|
|
285
|
+
if (warnings.length === 0)
|
|
286
|
+
return Object.freeze(plan);
|
|
287
|
+
for (const warning of warnings)
|
|
288
|
+
stderr.write(`[kimi-plugin-cc] warning: ${warning}\n`);
|
|
289
|
+
return Object.freeze({ ...plan, warnings: Object.freeze([...warnings]) });
|
|
206
290
|
}
|
|
207
291
|
export function assertExecutionPlanMatchesSpawn(plan, command, prefixArgs, env = {}) {
|
|
208
292
|
assertExecutionPlanShape(plan);
|
|
@@ -232,6 +316,7 @@ export function persistedExecutionPlanFields(plan) {
|
|
|
232
316
|
plan_certification: plan.certification,
|
|
233
317
|
resumed_from_job_id: plan.resumedFromJobId,
|
|
234
318
|
safety_profile: plan.safetyProfile,
|
|
319
|
+
warnings: plan.warnings !== undefined && plan.warnings.length > 0 ? JSON.stringify(plan.warnings) : null,
|
|
235
320
|
};
|
|
236
321
|
}
|
|
237
322
|
export function observedExecutionFields(result) {
|
|
@@ -467,12 +552,12 @@ export function classifyHistoricalEngineProvenance(contents) {
|
|
|
467
552
|
conflict,
|
|
468
553
|
};
|
|
469
554
|
}
|
|
470
|
-
function assertCertifiedCapability(engine, operationKind, probe) {
|
|
555
|
+
function assertCertifiedCapability(engine, operationKind, probe, env) {
|
|
471
556
|
if (engine === "native-v2") {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
return;
|
|
557
|
+
const certification = resolveNativeV2Certification(operationKind, probe.version, env);
|
|
558
|
+
if (certification === null)
|
|
559
|
+
throw nativeV2NotCertified(operationKind, probe.version, env);
|
|
560
|
+
return certification;
|
|
476
561
|
}
|
|
477
562
|
const minimum = LEGACY_V1_MINIMUMS[operationKind];
|
|
478
563
|
const meetsMinimum = probe.major > minimum.major ||
|
|
@@ -493,6 +578,7 @@ function assertCertifiedCapability(engine, operationKind, probe) {
|
|
|
493
578
|
},
|
|
494
579
|
});
|
|
495
580
|
}
|
|
581
|
+
return "certified";
|
|
496
582
|
}
|
|
497
583
|
/**
|
|
498
584
|
* Revalidate the persisted certification at the final subprocess boundary.
|
|
@@ -518,20 +604,33 @@ function assertPlanCertification(plan, env) {
|
|
|
518
604
|
return;
|
|
519
605
|
}
|
|
520
606
|
if (plan.kimiVersion === null) {
|
|
521
|
-
throw invalidPersistedPlan(
|
|
607
|
+
throw invalidPersistedPlan(`${plan.certification} plans require kimi_version`);
|
|
522
608
|
}
|
|
523
609
|
const parsed = parseVersionLine(plan.kimiVersion);
|
|
524
610
|
if (parsed === undefined) {
|
|
525
611
|
throw invalidPersistedPlan("kimi_version is not a parseable semantic version");
|
|
526
612
|
}
|
|
527
|
-
|
|
613
|
+
if (plan.certification === "uncertified" && plan.intendedEngine !== "native-v2") {
|
|
614
|
+
throw invalidPersistedPlan("uncertified plans must use native-v2");
|
|
615
|
+
}
|
|
616
|
+
// Recompute from the release table and the current environment: a strict
|
|
617
|
+
// environment, a write operation, or a row that has since been added all
|
|
618
|
+
// refuse a plan whose recorded certification no longer matches.
|
|
619
|
+
const certification = assertCertifiedCapability(plan.intendedEngine, plan.operationKind, {
|
|
528
620
|
kind: "ok",
|
|
529
621
|
version: parsed.raw,
|
|
530
622
|
major: parsed.major,
|
|
531
623
|
minor: parsed.minor,
|
|
532
624
|
patch: parsed.patch,
|
|
533
625
|
inTestedRange: isInTestedRange(parsed.major, parsed.minor),
|
|
534
|
-
});
|
|
626
|
+
}, env);
|
|
627
|
+
if (certification !== plan.certification) {
|
|
628
|
+
// A plan claiming exact certification for an uncertified release keeps the
|
|
629
|
+
// historical capability refusal; any other mismatch is a stale/forged row.
|
|
630
|
+
if (plan.certification === "certified")
|
|
631
|
+
throw nativeV2NotCertified(plan.operationKind, parsed.raw, env);
|
|
632
|
+
throw invalidPersistedPlan(`plan_certification ${JSON.stringify(plan.certification)} does not match ${JSON.stringify(certification)} for kimi-code ${parsed.raw}`);
|
|
633
|
+
}
|
|
535
634
|
}
|
|
536
635
|
function assertExecutionPlanShape(plan) {
|
|
537
636
|
const candidate = plan;
|
|
@@ -566,13 +665,13 @@ function assertExecutionPlanShape(plan) {
|
|
|
566
665
|
throw invalidPersistedPlan("safetyProfile is invalid");
|
|
567
666
|
}
|
|
568
667
|
}
|
|
569
|
-
function nativeV2NotCertified(operationKind, version) {
|
|
668
|
+
function nativeV2NotCertified(operationKind, version, env = {}) {
|
|
570
669
|
const certified = NATIVE_V2_CERTIFIED.get(operationKind) ?? [];
|
|
571
670
|
const normalized = version === null ? undefined : parseVersionLine(version)?.raw;
|
|
572
671
|
if (normalized !== undefined &&
|
|
573
672
|
NATIVE_V2_NON_SWARM_VERSIONS.includes(normalized) &&
|
|
574
673
|
(operationKind === "swarm" || operationKind === "swarm-write")) {
|
|
575
|
-
return new RuntimeError("KIMI_CAPABILITY_NOT_CERTIFIED", `Refusing ${operationKind}: kimi-code ${normalized} is certified only for non-swarm operations (review, challenge, ask, rescue, review_gate, pursue). Its native rate-limit recovery can exceed AgentSwarm's configured maximum, so this exact release refuses swarm before model spawn. Select exact kimi-code
|
|
674
|
+
return new RuntimeError("KIMI_CAPABILITY_NOT_CERTIFIED", `Refusing ${operationKind}: kimi-code ${normalized} is certified only for non-swarm operations (review, challenge, ask, rescue, review_gate, pursue). Its native rate-limit recovery can exceed AgentSwarm's configured maximum, so this exact release refuses swarm before model spawn. Select exact kimi-code ${formatVersionChoice(kimiVersionsWith("bounded-swarm"))} for this plugin's certified bounded waves and single-worker path, or use a non-swarm operation on ${normalized}.`, "kimi-engine.capability", {
|
|
576
675
|
details: {
|
|
577
676
|
refusal_kind: "v2-swarm-not-certified",
|
|
578
677
|
certification_scope: "non-swarm",
|
|
@@ -581,12 +680,18 @@ function nativeV2NotCertified(operationKind, version) {
|
|
|
581
680
|
intended_engine: "native-v2",
|
|
582
681
|
kimi_version: normalized,
|
|
583
682
|
certified_versions: [...certified],
|
|
584
|
-
certified_operations: [
|
|
683
|
+
certified_operations: [...NON_SWARM_OPERATION_KINDS],
|
|
585
684
|
},
|
|
586
685
|
});
|
|
587
686
|
}
|
|
588
687
|
const observed = version === null ? "an unprobed version" : `kimi-code ${version}`;
|
|
589
|
-
|
|
688
|
+
const borrowable = normalized !== undefined && resolveKimiRelease(normalized)?.certified === false;
|
|
689
|
+
const readOnlyNote = !borrowable
|
|
690
|
+
? ""
|
|
691
|
+
: strictVersions(env)
|
|
692
|
+
? ` ${STRICT_VERSIONS_ENV}=1 is set, so read-only operations on this uncertified release also refuse.`
|
|
693
|
+
: " Read-only operations (ask, review, challenge, review gate) still run on this uncertified release with a warning; write and swarm operations need an exact certified release.";
|
|
694
|
+
return new RuntimeError("KIMI_CAPABILITY_NOT_CERTIFIED", `Refusing ${operationKind} on native v2: ${observed} is not in this operation's exactly certified set [${certified.join(", ")}].${readOnlyNote} Run setup --install-kimi to give the plugin its own copy of the newest certified kimi-code, update kimi-plugin-cc to a release that certifies this version, or point KIMI_PLUGIN_CC_KIMI_BIN at a certified binary. KIMI_PLUGIN_CC_SKIP_VERSION_PROBE is a test/smoke seam, not a production repair path.`, "kimi-engine.capability", {
|
|
590
695
|
details: {
|
|
591
696
|
refusal_kind: "v2-version-not-certified",
|
|
592
697
|
retryable_after_setup: false,
|
|
@@ -630,9 +735,6 @@ async function resolveExactExecutable(command, cwd, env) {
|
|
|
630
735
|
}
|
|
631
736
|
throw new RuntimeError("KIMI_EXECUTION_PLAN_UNRESOLVED", `Refusing to spawn kimi because executable ${JSON.stringify(command)} could not be resolved to an exact runnable path. Run Claude Code \`/kimi:setup\` or Codex \`$kimi-setup\` to verify the active binary, or correct KIMI_PLUGIN_CC_KIMI_BIN and retry.`, "kimi-engine.plan", { details: { command, cwd } });
|
|
632
737
|
}
|
|
633
|
-
function isRecord(value) {
|
|
634
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
635
|
-
}
|
|
636
738
|
function parseProtocolVersion(value) {
|
|
637
739
|
const match = value.match(/^(\d+)\.(\d+)(?:\.\d+)?$/);
|
|
638
740
|
if (match === null)
|
|
@@ -658,18 +760,11 @@ function operationKindFromLogEntry(entry) {
|
|
|
658
760
|
return isOperationKind(candidate) ? candidate : null;
|
|
659
761
|
}
|
|
660
762
|
function isOperationKind(value) {
|
|
661
|
-
return (value
|
|
662
|
-
value === "challenge" ||
|
|
663
|
-
value === "ask" ||
|
|
664
|
-
value === "rescue" ||
|
|
665
|
-
value === "review_gate" ||
|
|
666
|
-
value === "pursue" ||
|
|
667
|
-
value === "swarm" ||
|
|
668
|
-
value === "swarm-write");
|
|
763
|
+
return OPERATION_KINDS.includes(value);
|
|
669
764
|
}
|
|
670
765
|
function isKimiEngine(value) {
|
|
671
766
|
return value === "legacy-v1" || value === "native-v2";
|
|
672
767
|
}
|
|
673
768
|
function isPlanCertification(value) {
|
|
674
|
-
return value === "certified" || value === "test-bypass";
|
|
769
|
+
return value === "certified" || value === "uncertified" || value === "test-bypass";
|
|
675
770
|
}
|