@openclaw/kimi-provider 2026.10.10 → 2026.11.5-beta.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.
- package/dist/.setup/{provider-catalog-v6iy7DoZ.mjs → provider-catalog-EXT898dx.mjs} +1 -0
- package/dist/.source-module-urls/ae50e690ab0f6828ba6672ba864844d7312a3b21a01a4afca124730e1a53c459.json +1 -1
- package/dist/api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/onboard.js +1 -1
- package/dist/provider-catalog.js +1 -1
- package/dist/provider-policy-api.js +19 -5
- package/dist/stream.js +11 -21
- package/openclaw.plugin.json +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/kimi-coding/api.ts"},{"output":"index.js","source":"extensions/kimi-coding/index.ts"},{"output":"onboard.js","source":"extensions/kimi-coding/onboard.ts"},{"output":"provider-catalog.js","source":"extensions/kimi-coding/provider-catalog.ts"},{"output":"provider-policy-api.js","source":"extensions/kimi-coding/provider-policy-api.ts"},{"output":"stream.js","source":"extensions/kimi-coding/stream.ts"}],"chunks":[{"output":".setup/provider-catalog-
|
|
1
|
+
{"version":3,"entries":[{"output":"api.js","source":"extensions/kimi-coding/api.ts"},{"output":"index.js","source":"extensions/kimi-coding/index.ts"},{"output":"onboard.js","source":"extensions/kimi-coding/onboard.ts"},{"output":"provider-catalog.js","source":"extensions/kimi-coding/provider-catalog.ts"},{"output":"provider-policy-api.js","source":"extensions/kimi-coding/provider-policy-api.ts"},{"output":"stream.js","source":"extensions/kimi-coding/stream.ts"}],"chunks":[{"output":".setup/provider-catalog-EXT898dx.mjs","sha256":"b6af2524e7b051fd1f72813b1a38f95371cc88247e3e798613456405f05de181","facadeSource":null,"sources":["extensions/kimi-coding/openclaw.plugin.json","extensions/kimi-coding/provider-catalog.ts"]},{"output":"api.js","sha256":"710e888ab333906ecdfd2f5469df646abbe13eb6d5d6fbdcdf91a04c352d5355","facadeSource":"extensions/kimi-coding/api.ts","sources":[]},{"output":"index.js","sha256":"af4f190d721d4d7d0fdea614b74b7cbca9c7dafd085ea60fa47af871de0485cb","facadeSource":"extensions/kimi-coding/index.ts","sources":["extensions/kimi-coding/index.ts"]},{"output":"onboard.js","sha256":"e39006d5f6fdf7a7cdddcf4e37bd32f8a62ceb137db4ac581abcaf968c9a3c4a","facadeSource":"extensions/kimi-coding/onboard.ts","sources":["extensions/kimi-coding/onboard.ts"]},{"output":"provider-catalog.js","sha256":"b6e706d08922c79e828c49be5d3ca06edf6cd5847063c466de82586c9e30e473","facadeSource":"extensions/kimi-coding/provider-catalog.ts","sources":[]},{"output":"provider-policy-api.js","sha256":"f68287f0bc6ce35523f86dd37317c609f082bd671227b7b1a9eb389821239ad4","facadeSource":"extensions/kimi-coding/provider-policy-api.ts","sources":["extensions/kimi-coding/provider-policy-api.ts"]},{"output":"stream.js","sha256":"8e75a02f9b80078604a39a46affb452263cc4c9f34b8f6845b1cf0e274fdb194","facadeSource":"extensions/kimi-coding/stream.ts","sources":["extensions/kimi-coding/stream.ts"]}],"unrenderedSources":["extensions/kimi-coding/api.ts"]}
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as normalizeKimiCodingModelId, i as buildKimiCodingProvider, n as KIMI_CODING_DEFAULT_MODEL_ID, r as KIMI_CODING_LEGACY_MODEL_IDS, t as KIMI_CODING_BASE_URL } from "./.setup/provider-catalog-
|
|
1
|
+
import { a as normalizeKimiCodingModelId, i as buildKimiCodingProvider, n as KIMI_CODING_DEFAULT_MODEL_ID, r as KIMI_CODING_LEGACY_MODEL_IDS, t as KIMI_CODING_BASE_URL } from "./.setup/provider-catalog-EXT898dx.mjs";
|
|
2
2
|
import { KIMI_CODING_MODEL_REF, KIMI_MODEL_REF } from "./onboard.js";
|
|
3
3
|
export { KIMI_CODING_BASE_URL, KIMI_CODING_DEFAULT_MODEL_ID, KIMI_CODING_LEGACY_MODEL_IDS, KIMI_CODING_MODEL_REF, KIMI_MODEL_REF, buildKimiCodingProvider, normalizeKimiCodingModelId };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as normalizeKimiCodingModelId, i as buildKimiCodingProvider, o as openclaw_plugin_default } from "./.setup/provider-catalog-
|
|
1
|
+
import { a as normalizeKimiCodingModelId, i as buildKimiCodingProvider, o as openclaw_plugin_default } from "./.setup/provider-catalog-EXT898dx.mjs";
|
|
2
2
|
import { applyKimiCodeConfig } from "./onboard.js";
|
|
3
3
|
import { KIMI_K3_THINKING_EFFORTS, isKimiK3ModelId, resolveThinkingProfile } from "./provider-policy-api.js";
|
|
4
4
|
import { createLazyRuntimeModule, createLazyRuntimeSurface } from "openclaw/plugin-sdk/lazy-runtime";
|
package/dist/onboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as buildKimiCodingProvider, n as KIMI_CODING_DEFAULT_MODEL_ID, t as KIMI_CODING_BASE_URL } from "./.setup/provider-catalog-
|
|
1
|
+
import { i as buildKimiCodingProvider, n as KIMI_CODING_DEFAULT_MODEL_ID, t as KIMI_CODING_BASE_URL } from "./.setup/provider-catalog-EXT898dx.mjs";
|
|
2
2
|
import { createDefaultModelsPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
3
3
|
// extensions/kimi-coding/onboard.ts
|
|
4
4
|
const KIMI_MODEL_REF = `kimi/${KIMI_CODING_DEFAULT_MODEL_ID}`;
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as KIMI_CODING_BASE_URL, n as KIMI_CODING_DEFAULT_MODEL_ID, r as KIMI_CODING_LEGACY_MODEL_IDS, i as buildKimiCodingProvider, a as normalizeKimiCodingModelId } from "./.setup/provider-catalog-
|
|
1
|
+
export { t as KIMI_CODING_BASE_URL, n as KIMI_CODING_DEFAULT_MODEL_ID, r as KIMI_CODING_LEGACY_MODEL_IDS, i as buildKimiCodingProvider, a as normalizeKimiCodingModelId } from "./.setup/provider-catalog-EXT898dx.mjs";
|
|
@@ -7,6 +7,13 @@ const KIMI_K3_MODEL_IDS = [
|
|
|
7
7
|
...KIMI_K3_1_MODEL_IDS
|
|
8
8
|
];
|
|
9
9
|
const KIMI_K3_LEGACY_MODEL_IDS = ["k3[1m]"];
|
|
10
|
+
const KIMI_CODE_ENABLED_ONLY_MODEL_IDS = [
|
|
11
|
+
"kimi-for-coding",
|
|
12
|
+
"kimi-for-coding-highspeed",
|
|
13
|
+
"kimi-code",
|
|
14
|
+
"k2p5",
|
|
15
|
+
...KIMI_K3_1_MODEL_IDS
|
|
16
|
+
];
|
|
10
17
|
const KIMI_K3_THINKING_EFFORTS = {
|
|
11
18
|
minimal: "low",
|
|
12
19
|
low: "low",
|
|
@@ -29,17 +36,24 @@ function isKimiK3ModelId(modelId) {
|
|
|
29
36
|
const normalized = modelId.trim().toLowerCase();
|
|
30
37
|
return KIMI_K3_MODEL_IDS.includes(normalized) || KIMI_K3_LEGACY_MODEL_IDS.includes(normalized);
|
|
31
38
|
}
|
|
32
|
-
/** Kimi Code
|
|
33
|
-
function
|
|
39
|
+
/** Kimi Code models whose backend cannot honor disabled thinking. */
|
|
40
|
+
function isKimiCodeEnabledOnlyModelId(modelId) {
|
|
34
41
|
const normalized = modelId.trim().toLowerCase();
|
|
35
|
-
return
|
|
42
|
+
return KIMI_CODE_ENABLED_ONLY_MODEL_IDS.some((id) => id === normalized);
|
|
36
43
|
}
|
|
37
44
|
function resolveThinkingProfile({ modelId }) {
|
|
38
45
|
if (isKimiK3ModelId(modelId)) return {
|
|
39
|
-
levels:
|
|
46
|
+
levels: isKimiCodeEnabledOnlyModelId(modelId) ? KIMI_K3_THINKING_LEVELS.filter(({ id }) => id !== "off") : KIMI_K3_THINKING_LEVELS,
|
|
40
47
|
defaultLevel: modelId.trim().toLowerCase() === "kimi-k3" ? "off" : "high",
|
|
41
48
|
preserveWhenCatalogReasoningFalse: true
|
|
42
49
|
};
|
|
50
|
+
if (isKimiCodeEnabledOnlyModelId(modelId)) return {
|
|
51
|
+
levels: [{
|
|
52
|
+
id: "low",
|
|
53
|
+
label: "on"
|
|
54
|
+
}],
|
|
55
|
+
defaultLevel: "low"
|
|
56
|
+
};
|
|
43
57
|
return {
|
|
44
58
|
levels: [{
|
|
45
59
|
id: "off",
|
|
@@ -51,4 +65,4 @@ function resolveThinkingProfile({ modelId }) {
|
|
|
51
65
|
defaultLevel: "off"
|
|
52
66
|
};
|
|
53
67
|
}
|
|
54
|
-
export { KIMI_K3_MODEL_IDS, KIMI_K3_THINKING_EFFORTS,
|
|
68
|
+
export { KIMI_K3_MODEL_IDS, KIMI_K3_THINKING_EFFORTS, isKimiCodeEnabledOnlyModelId, isKimiK3ModelId, resolveThinkingProfile };
|
package/dist/stream.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { KIMI_K3_THINKING_EFFORTS,
|
|
1
|
+
import { KIMI_K3_THINKING_EFFORTS, isKimiCodeEnabledOnlyModelId, isKimiK3ModelId } from "./provider-policy-api.js";
|
|
2
2
|
import { asFiniteNumberInRange, asOptionalObjectRecord, isRecord, parseBooleanValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { resolveOpenAIRequestReasoning, streamSimple } from "openclaw/plugin-sdk/llm";
|
|
4
|
-
import { normalizeOpenAICompatibleReasoningReplay, streamWithPayloadPatch, transformProviderStreamMessages } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
4
|
+
import { mapAssistantMessageStream, normalizeOpenAICompatibleReasoningReplay, streamWithPayloadPatch, transformProviderStreamMessages } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
5
5
|
// extensions/kimi-coding/stream.ts
|
|
6
6
|
const TOOL_CALLS_SECTION_BEGIN = "<|tool_calls_section_begin|>";
|
|
7
7
|
const TOOL_CALLS_SECTION_END = "<|tool_calls_section_end|>";
|
|
@@ -104,13 +104,10 @@ function parseKimiTaggedToolCalls(text) {
|
|
|
104
104
|
return toolCalls.length > 0 ? toolCalls : null;
|
|
105
105
|
}
|
|
106
106
|
function rewriteKimiTaggedToolCallsInMessage(message) {
|
|
107
|
-
const record = asOptionalObjectRecord(message);
|
|
108
|
-
if (!record || !Array.isArray(record.content)) return;
|
|
109
107
|
let changed = false;
|
|
110
108
|
const nextContent = [];
|
|
111
|
-
for (const block of
|
|
112
|
-
const
|
|
113
|
-
const parsed = typedBlock?.type === "text" && typeof typedBlock.text === "string" ? parseKimiTaggedToolCalls(typedBlock.text) : null;
|
|
109
|
+
for (const block of message.content) {
|
|
110
|
+
const parsed = block.type === "text" ? parseKimiTaggedToolCalls(block.text) : null;
|
|
114
111
|
if (!parsed) {
|
|
115
112
|
nextContent.push(block);
|
|
116
113
|
continue;
|
|
@@ -119,29 +116,21 @@ function rewriteKimiTaggedToolCallsInMessage(message) {
|
|
|
119
116
|
changed = true;
|
|
120
117
|
}
|
|
121
118
|
if (!changed) return;
|
|
122
|
-
|
|
123
|
-
if (
|
|
124
|
-
}
|
|
125
|
-
function createKimiToolCallMarkupWrapper(baseStreamFn) {
|
|
126
|
-
const underlying = baseStreamFn ?? streamSimple;
|
|
127
|
-
return (model, context, options) => {
|
|
128
|
-
const maybeStream = underlying(model, context, options);
|
|
129
|
-
if (maybeStream && typeof maybeStream === "object" && "then" in maybeStream) return Promise.resolve(maybeStream).then((stream) => transformProviderStreamMessages(stream, rewriteKimiTaggedToolCallsInMessage));
|
|
130
|
-
return transformProviderStreamMessages(maybeStream, rewriteKimiTaggedToolCallsInMessage);
|
|
131
|
-
};
|
|
119
|
+
message.content = nextContent;
|
|
120
|
+
if (message.stopReason === "stop") message.stopReason = "toolUse";
|
|
132
121
|
}
|
|
133
122
|
function wrapKimiProviderStream(ctx) {
|
|
134
123
|
const configured = normalizeKimiThinkingConfig(ctx.extraParams?.thinking);
|
|
135
124
|
const extraBody = asOptionalObjectRecord(ctx.extraParams?.extra_body ?? ctx.extraParams?.extraBody);
|
|
136
125
|
const templateKwargs = asOptionalObjectRecord(extraBody?.chat_template_kwargs ?? ctx.extraParams?.chat_template_kwargs ?? ctx.extraParams?.chatTemplateKwargs);
|
|
137
126
|
const underlying = ctx.streamFn ?? streamSimple;
|
|
138
|
-
return
|
|
127
|
+
return (model, context, options) => {
|
|
139
128
|
const api = ctx.sourceApi ?? model.api;
|
|
140
129
|
const anthropic = api === "anthropic-messages";
|
|
141
130
|
const k3 = anthropic && isKimiK3ModelId(model.id);
|
|
142
131
|
const openaiK3 = api === "openai-completions" && isKimiK3ModelId(model.id);
|
|
143
132
|
const requestedLevel = options?.reasoning ?? ctx.thinkingLevel ?? (k3 ? "high" : void 0);
|
|
144
|
-
const thinkingLevel = anthropic &&
|
|
133
|
+
const thinkingLevel = anthropic && isKimiCodeEnabledOnlyModelId(model.id) && (!requestedLevel || requestedLevel === "off") ? k3 ? "high" : "low" : requestedLevel;
|
|
145
134
|
const thinkingConfig = resolveKimiThinkingConfig(configured, thinkingLevel);
|
|
146
135
|
const enabledLevel = thinkingLevel && thinkingLevel !== "off" ? thinkingLevel : k3 || openaiK3 ? "high" : "low";
|
|
147
136
|
const nativeLevel = enabledLevel === "adaptive" ? "high" : enabledLevel;
|
|
@@ -159,7 +148,7 @@ function wrapKimiProviderStream(ctx) {
|
|
|
159
148
|
...model.thinkingLevelMap
|
|
160
149
|
}
|
|
161
150
|
} : model;
|
|
162
|
-
|
|
151
|
+
const stream = streamWithPayloadPatch(underlying, runtimeModel, context, {
|
|
163
152
|
...options,
|
|
164
153
|
reasoning
|
|
165
154
|
}, (payloadObj) => {
|
|
@@ -196,7 +185,8 @@ function wrapKimiProviderStream(ctx) {
|
|
|
196
185
|
});
|
|
197
186
|
}
|
|
198
187
|
});
|
|
199
|
-
|
|
188
|
+
return mapAssistantMessageStream(stream, (resolved) => transformProviderStreamMessages(resolved, rewriteKimiTaggedToolCallsInMessage));
|
|
189
|
+
};
|
|
200
190
|
}
|
|
201
191
|
function stripContentArrayCacheControl(value) {
|
|
202
192
|
if (!Array.isArray(value)) return;
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/kimi-provider",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.5-beta.1",
|
|
4
4
|
"description": "OpenClaw Kimi provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.
|
|
21
|
+
"pluginApi": ">=2026.11.5-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.
|
|
24
|
+
"openclawVersion": "2026.11.5-beta.1",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"assets/activity.svg"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.
|
|
43
|
+
"openclaw": ">=2026.11.5-beta.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|