@openclaw/kimi-provider 2026.7.2-beta.1 → 2026.7.2-beta.2

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { buildKimiCodingProvider, normalizeKimiCodingModelId } from "./provider-catalog.js";
1
+ import { buildKimiCodingProvider, isKimiK3ModelId, normalizeKimiCodingModelId } from "./provider-catalog.js";
2
2
  import { KIMI_CODING_MODEL_REF, applyKimiCodeConfig } from "./onboard.js";
3
3
  import { KIMI_REPLAY_POLICY } from "./replay-policy.js";
4
4
  import { wrapKimiProviderStream } from "./stream.js";
@@ -80,7 +80,14 @@ var kimi_coding_default = definePluginEntry({
80
80
  id: normalizedId
81
81
  };
82
82
  },
83
- resolveThinkingProfile: () => ({
83
+ resolveThinkingProfile: ({ modelId }) => isKimiK3ModelId(modelId) ? {
84
+ levels: [{
85
+ id: "max",
86
+ label: "max"
87
+ }],
88
+ defaultLevel: "max",
89
+ preserveWhenCatalogReasoningFalse: true
90
+ } : {
84
91
  levels: [{
85
92
  id: "off",
86
93
  label: "off"
@@ -89,7 +96,8 @@ var kimi_coding_default = definePluginEntry({
89
96
  label: "on"
90
97
  }],
91
98
  defaultLevel: "off"
92
- }),
99
+ },
100
+ wrapSimpleCompletionStreamFn: (ctx) => isKimiK3ModelId(ctx.modelId) ? wrapKimiProviderStream(ctx) : ctx.streamFn,
93
101
  wrapStreamFn: wrapKimiProviderStream
94
102
  });
95
103
  }
@@ -2,6 +2,7 @@
2
2
  const KIMI_BASE_URL = "https://api.kimi.com/coding/";
3
3
  const KIMI_CODING_USER_AGENT = "claude-code/0.1.0";
4
4
  const KIMI_DEFAULT_MODEL_ID = "kimi-for-coding";
5
+ const KIMI_K3_MODEL_IDS = ["k3", "k3[1m]"];
5
6
  const KIMI_LEGACY_MODEL_IDS = ["kimi-code", "k2p5"];
6
7
  const KIMI_CODING_DEFAULT_CONTEXT_WINDOW = 262144;
7
8
  const KIMI_CODING_DEFAULT_MAX_TOKENS = 32768;
@@ -17,30 +18,54 @@ function buildKimiCodingProvider() {
17
18
  baseUrl: KIMI_BASE_URL,
18
19
  api: "anthropic-messages",
19
20
  headers: { "User-Agent": KIMI_CODING_USER_AGENT },
20
- models: [{
21
- id: KIMI_DEFAULT_MODEL_ID,
22
- name: "Kimi Code",
23
- reasoning: true,
24
- input: [...KIMI_CODING_INPUT],
25
- cost: KIMI_CODING_DEFAULT_COST,
26
- contextWindow: KIMI_CODING_DEFAULT_CONTEXT_WINDOW,
27
- maxTokens: KIMI_CODING_DEFAULT_MAX_TOKENS
28
- }, ...KIMI_LEGACY_MODEL_IDS.map((id) => ({
29
- id,
30
- name: `Kimi Code (legacy ${id})`,
31
- reasoning: true,
32
- input: [...KIMI_CODING_INPUT],
33
- cost: KIMI_CODING_DEFAULT_COST,
34
- contextWindow: KIMI_CODING_DEFAULT_CONTEXT_WINDOW,
35
- maxTokens: KIMI_CODING_DEFAULT_MAX_TOKENS
36
- }))]
21
+ models: [
22
+ {
23
+ id: KIMI_DEFAULT_MODEL_ID,
24
+ name: "Kimi Code",
25
+ reasoning: true,
26
+ input: [...KIMI_CODING_INPUT],
27
+ cost: KIMI_CODING_DEFAULT_COST,
28
+ contextWindow: KIMI_CODING_DEFAULT_CONTEXT_WINDOW,
29
+ maxTokens: KIMI_CODING_DEFAULT_MAX_TOKENS
30
+ },
31
+ ...KIMI_K3_MODEL_IDS.map((id) => ({
32
+ id,
33
+ name: id === "k3" ? "Kimi K3" : "Kimi K3 (1M)",
34
+ reasoning: true,
35
+ thinkingLevelMap: {
36
+ off: null,
37
+ minimal: null,
38
+ low: null,
39
+ medium: null,
40
+ high: null,
41
+ xhigh: "max",
42
+ max: "max"
43
+ },
44
+ input: [...KIMI_CODING_INPUT],
45
+ cost: KIMI_CODING_DEFAULT_COST,
46
+ contextWindow: id === "k3" ? KIMI_CODING_DEFAULT_CONTEXT_WINDOW : 1048576,
47
+ maxTokens: KIMI_CODING_DEFAULT_MAX_TOKENS
48
+ })),
49
+ ...KIMI_LEGACY_MODEL_IDS.map((id) => ({
50
+ id,
51
+ name: `Kimi Code (legacy ${id})`,
52
+ reasoning: true,
53
+ input: [...KIMI_CODING_INPUT],
54
+ cost: KIMI_CODING_DEFAULT_COST,
55
+ contextWindow: KIMI_CODING_DEFAULT_CONTEXT_WINDOW,
56
+ maxTokens: KIMI_CODING_DEFAULT_MAX_TOKENS
57
+ }))
58
+ ]
37
59
  };
38
60
  }
39
61
  function normalizeKimiCodingModelId(modelId) {
40
62
  return KIMI_LEGACY_MODEL_IDS.includes(modelId) ? KIMI_DEFAULT_MODEL_ID : modelId;
41
63
  }
64
+ function isKimiK3ModelId(modelId) {
65
+ return KIMI_K3_MODEL_IDS.includes(modelId);
66
+ }
42
67
  const KIMI_CODING_BASE_URL = KIMI_BASE_URL;
43
68
  const KIMI_CODING_DEFAULT_MODEL_ID = KIMI_DEFAULT_MODEL_ID;
44
69
  const KIMI_CODING_LEGACY_MODEL_IDS = KIMI_LEGACY_MODEL_IDS;
45
70
  //#endregion
46
- export { KIMI_CODING_BASE_URL, KIMI_CODING_DEFAULT_MODEL_ID, KIMI_CODING_LEGACY_MODEL_IDS, buildKimiCodingProvider, normalizeKimiCodingModelId };
71
+ export { KIMI_CODING_BASE_URL, KIMI_CODING_DEFAULT_MODEL_ID, KIMI_CODING_LEGACY_MODEL_IDS, buildKimiCodingProvider, isKimiK3ModelId, normalizeKimiCodingModelId };
package/dist/stream.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { isKimiK3ModelId } from "./provider-catalog.js";
1
2
  import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
2
3
  import { streamSimple } from "openclaw/plugin-sdk/llm";
3
4
  import { streamWithPayloadPatch } from "openclaw/plugin-sdk/provider-stream-shared";
@@ -100,9 +101,6 @@ function resolveKimiThinkingConfig(params) {
100
101
  budget_tokens: levelBudgetTokens
101
102
  };
102
103
  }
103
- function resolveKimiThinkingType(params) {
104
- return resolveKimiThinkingConfig(params).type;
105
- }
106
104
  function stripTaggedToolCallCounter(value) {
107
105
  return value.trim().replace(/:\d+$/, "");
108
106
  }
@@ -221,6 +219,19 @@ function createKimiToolCallMarkupWrapper(baseStreamFn) {
221
219
  function createKimiThinkingWrapper(baseStreamFn, thinkingConfig) {
222
220
  const underlying = baseStreamFn ?? streamSimple;
223
221
  return (model, context, options) => streamWithPayloadPatch(underlying, model, context, options, (payloadObj) => {
222
+ if (model.api === "anthropic-messages" && isKimiK3ModelId(model.id)) {
223
+ payloadObj.thinking = { type: "adaptive" };
224
+ const outputConfig = payloadObj.output_config;
225
+ payloadObj.output_config = outputConfig && typeof outputConfig === "object" && !Array.isArray(outputConfig) ? {
226
+ ...outputConfig,
227
+ effort: "max"
228
+ } : { effort: "max" };
229
+ delete payloadObj.reasoning;
230
+ delete payloadObj.reasoning_effort;
231
+ delete payloadObj.reasoningEffort;
232
+ stripAnthropicCacheControlMarkers(payloadObj);
233
+ return;
234
+ }
224
235
  const normalized = typeof thinkingConfig === "string" ? { type: thinkingConfig } : thinkingConfig;
225
236
  payloadObj.thinking = model.api === "anthropic-messages" ? { ...normalized } : { type: normalized.type };
226
237
  if (model.api === "anthropic-messages") ensureKimiAnthropicMaxTokens(payloadObj, normalized);
@@ -258,4 +269,4 @@ function wrapKimiProviderStream(ctx) {
258
269
  return createKimiToolCallMarkupWrapper(createKimiThinkingWrapper(ctx.streamFn, thinkingConfig));
259
270
  }
260
271
  //#endregion
261
- export { createKimiThinkingWrapper, createKimiToolCallMarkupWrapper, resolveKimiThinkingType, wrapKimiProviderStream };
272
+ export { wrapKimiProviderStream };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/kimi-provider",
3
- "version": "2026.7.2-beta.1",
3
+ "version": "2026.7.2-beta.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/kimi-provider",
9
- "version": "2026.7.2-beta.1"
9
+ "version": "2026.7.2-beta.2"
10
10
  }
11
11
  }
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/kimi-provider",
3
- "version": "2026.7.2-beta.1",
3
+ "version": "2026.7.2-beta.2",
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.7.2-beta.1"
21
+ "pluginApi": ">=2026.7.2-beta.2"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.7.2-beta.1",
24
+ "openclawVersion": "2026.7.2-beta.2",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -39,7 +39,7 @@
39
39
  "README.md"
40
40
  ],
41
41
  "peerDependencies": {
42
- "openclaw": ">=2026.7.2-beta.1"
42
+ "openclaw": ">=2026.7.2-beta.2"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "openclaw": {