@openclaw/kilocode-provider 2026.10.10-beta.5 → 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-models-0P0ezPsI.mjs → provider-models-BMrrUkX_.mjs} +43 -57
- package/dist/.source-module-urls/02f78d08466e0e51c8047a20d3d34fa150c883abd60dff7b8a96dbcb6e1c38bf.json +1 -0
- package/dist/api.js +1 -1
- package/dist/index.js +36 -6
- package/dist/onboard.js +2 -3
- package/dist/provider-catalog.js +2 -3
- package/dist/provider-models.js +1 -1
- package/package.json +4 -4
- package/dist/.source-module-urls/aa8e6c6b3120724511951b641428edf02711dda035446f2050f060e7b755d32c.json +0 -1
- package/dist/stream.js +0 -41
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
+
import { asPositiveSafeInteger, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
3
|
import { buildLiveModelProviderConfig, readLiveModelCatalogStringField } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
3
4
|
import { ssrfPolicyFromHttpBaseUrlAllowedHostname } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
4
|
-
|
|
5
|
-
//#region extensions/kilocode/openclaw.plugin.json
|
|
5
|
+
// extensions/kilocode/openclaw.plugin.json
|
|
6
6
|
var openclaw_plugin_default = {
|
|
7
7
|
id: "kilocode",
|
|
8
8
|
categories: ["models"],
|
|
@@ -66,8 +66,7 @@ var openclaw_plugin_default = {
|
|
|
66
66
|
"discovery": { "kilocode": "refreshable" }
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
|
|
70
|
-
//#region extensions/kilocode/provider-models.ts
|
|
69
|
+
// extensions/kilocode/provider-models.ts
|
|
71
70
|
const KILOCODE_MANIFEST_CATALOG = openclaw_plugin_default.modelCatalog.providers.kilocode;
|
|
72
71
|
const KILOCODE_DEFAULT_MODEL = buildManifestModelProviderConfig({
|
|
73
72
|
providerId: "kilocode",
|
|
@@ -102,33 +101,11 @@ function parseReasoning(entry) {
|
|
|
102
101
|
if (!Array.isArray(params)) return false;
|
|
103
102
|
return params.includes("reasoning") || params.includes("include_reasoning");
|
|
104
103
|
}
|
|
105
|
-
function toModelDefinition(entry) {
|
|
106
|
-
const fallbackCost = entry.id === KILOCODE_DEFAULT_MODEL_ID ? KILOCODE_DEFAULT_COST : void 0;
|
|
107
|
-
return {
|
|
108
|
-
id: entry.id,
|
|
109
|
-
name: entry.name || entry.id,
|
|
110
|
-
reasoning: parseReasoning(entry),
|
|
111
|
-
input: parseModality(entry),
|
|
112
|
-
cost: {
|
|
113
|
-
input: toPricePerMillion(entry.pricing.prompt, fallbackCost?.input),
|
|
114
|
-
output: toPricePerMillion(entry.pricing.completion, fallbackCost?.output),
|
|
115
|
-
cacheRead: toPricePerMillion(entry.pricing.input_cache_read),
|
|
116
|
-
cacheWrite: toPricePerMillion(entry.pricing.input_cache_write)
|
|
117
|
-
},
|
|
118
|
-
contextWindow: asPositiveSafeInteger(entry.top_provider?.context_length) ?? asPositiveSafeInteger(entry.context_length) ?? KILOCODE_DEFAULT_CONTEXT_WINDOW,
|
|
119
|
-
maxTokens: asPositiveSafeInteger(entry.top_provider?.max_completion_tokens) ?? KILOCODE_DEFAULT_MAX_TOKENS
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
104
|
function buildStaticCatalog() {
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
input: model.input,
|
|
128
|
-
cost: KILOCODE_DEFAULT_COST,
|
|
129
|
-
contextWindow: model.contextWindow ?? KILOCODE_DEFAULT_CONTEXT_WINDOW,
|
|
130
|
-
maxTokens: model.maxTokens ?? KILOCODE_DEFAULT_MAX_TOKENS
|
|
131
|
-
}));
|
|
105
|
+
return buildManifestModelProviderConfig({
|
|
106
|
+
providerId: "kilocode",
|
|
107
|
+
catalog: KILOCODE_MANIFEST_CATALOG
|
|
108
|
+
}).models;
|
|
132
109
|
}
|
|
133
110
|
function asGatewayModelEntry(value) {
|
|
134
111
|
if (!isRecord(value)) throw new Error("Kilocode model list: malformed JSON response");
|
|
@@ -136,26 +113,6 @@ function asGatewayModelEntry(value) {
|
|
|
136
113
|
if (typeof entry.id !== "string" || !isRecord(entry.pricing)) throw new Error("Kilocode model list: malformed JSON response");
|
|
137
114
|
return entry;
|
|
138
115
|
}
|
|
139
|
-
function readGatewayModelRows(body) {
|
|
140
|
-
const data = body?.data;
|
|
141
|
-
if (!Array.isArray(data)) throw new Error("Kilocode model list: malformed JSON response");
|
|
142
|
-
return data;
|
|
143
|
-
}
|
|
144
|
-
function projectKilocodeModels(rows) {
|
|
145
|
-
const models = [];
|
|
146
|
-
const discoveredIds = /* @__PURE__ */ new Set();
|
|
147
|
-
for (const rawEntry of rows) {
|
|
148
|
-
const id = readLiveModelCatalogStringField(rawEntry, "id");
|
|
149
|
-
try {
|
|
150
|
-
const entry = asGatewayModelEntry(rawEntry);
|
|
151
|
-
if (!id || discoveredIds.has(id) || entry.architecture?.output_modalities?.includes("image")) continue;
|
|
152
|
-
models.push(toModelDefinition(entry));
|
|
153
|
-
discoveredIds.add(id);
|
|
154
|
-
} catch {}
|
|
155
|
-
}
|
|
156
|
-
for (const staticModel of models.length > 0 ? buildStaticCatalog() : []) if (!discoveredIds.has(staticModel.id)) models.unshift(staticModel);
|
|
157
|
-
return models;
|
|
158
|
-
}
|
|
159
116
|
async function discoverKilocodeModels(options = {}) {
|
|
160
117
|
return (await buildLiveModelProviderConfig({
|
|
161
118
|
...options,
|
|
@@ -168,17 +125,46 @@ async function discoverKilocodeModels(options = {}) {
|
|
|
168
125
|
models: buildStaticCatalog(),
|
|
169
126
|
timeoutMs: DISCOVERY_TIMEOUT_MS,
|
|
170
127
|
ttlMs: 0,
|
|
171
|
-
readRows
|
|
128
|
+
readRows(body) {
|
|
129
|
+
const data = body?.data;
|
|
130
|
+
if (!Array.isArray(data)) throw new Error("Kilocode model list: malformed JSON response");
|
|
131
|
+
return data;
|
|
132
|
+
},
|
|
172
133
|
policy: ssrfPolicyFromHttpBaseUrlAllowedHostname(KILOCODE_BASE_URL),
|
|
173
134
|
auditContext: "kilocode.model_discovery",
|
|
174
|
-
projectRows
|
|
135
|
+
projectRows(rows) {
|
|
136
|
+
const models = [];
|
|
137
|
+
const discoveredIds = /* @__PURE__ */ new Set();
|
|
138
|
+
for (const rawEntry of rows) {
|
|
139
|
+
const id = readLiveModelCatalogStringField(rawEntry, "id");
|
|
140
|
+
try {
|
|
141
|
+
const entry = asGatewayModelEntry(rawEntry);
|
|
142
|
+
if (!id || discoveredIds.has(id) || entry.architecture?.output_modalities?.includes("image")) continue;
|
|
143
|
+
const fallbackCost = entry.id === KILOCODE_DEFAULT_MODEL_ID ? KILOCODE_DEFAULT_COST : void 0;
|
|
144
|
+
models.push({
|
|
145
|
+
id: entry.id,
|
|
146
|
+
name: entry.name || entry.id,
|
|
147
|
+
reasoning: parseReasoning(entry),
|
|
148
|
+
input: parseModality(entry),
|
|
149
|
+
...Array.isArray(entry.supported_parameters) ? { compat: { supportsTools: entry.supported_parameters.includes("tools") } } : {},
|
|
150
|
+
cost: {
|
|
151
|
+
input: toPricePerMillion(entry.pricing.prompt, fallbackCost?.input),
|
|
152
|
+
output: toPricePerMillion(entry.pricing.completion, fallbackCost?.output),
|
|
153
|
+
cacheRead: toPricePerMillion(entry.pricing.input_cache_read),
|
|
154
|
+
cacheWrite: toPricePerMillion(entry.pricing.input_cache_write)
|
|
155
|
+
},
|
|
156
|
+
contextWindow: asPositiveSafeInteger(entry.top_provider?.context_length) ?? asPositiveSafeInteger(entry.context_length) ?? KILOCODE_DEFAULT_CONTEXT_WINDOW,
|
|
157
|
+
maxTokens: asPositiveSafeInteger(entry.top_provider?.max_completion_tokens) ?? KILOCODE_DEFAULT_MAX_TOKENS
|
|
158
|
+
});
|
|
159
|
+
discoveredIds.add(id);
|
|
160
|
+
} catch {}
|
|
161
|
+
}
|
|
162
|
+
for (const staticModel of models.length > 0 ? buildStaticCatalog() : []) if (!discoveredIds.has(staticModel.id)) models.unshift(staticModel);
|
|
163
|
+
return models;
|
|
164
|
+
}
|
|
175
165
|
})).models;
|
|
176
166
|
}
|
|
177
167
|
function buildKilocodeModelDefinition() {
|
|
178
|
-
return
|
|
179
|
-
...KILOCODE_DEFAULT_MODEL,
|
|
180
|
-
input: [...KILOCODE_DEFAULT_MODEL.input]
|
|
181
|
-
};
|
|
168
|
+
return KILOCODE_DEFAULT_MODEL;
|
|
182
169
|
}
|
|
183
|
-
//#endregion
|
|
184
170
|
export { KILOCODE_DEFAULT_MODEL_ID as a, KILOCODE_MODELS_URL as c, discoverKilocodeModels as d, openclaw_plugin_default as f, KILOCODE_DEFAULT_MAX_TOKENS as i, KILOCODE_MODEL_CATALOG as l, KILOCODE_DEFAULT_CONTEXT_WINDOW as n, KILOCODE_DEFAULT_MODEL_NAME as o, KILOCODE_DEFAULT_COST as r, KILOCODE_DEFAULT_MODEL_REF as s, KILOCODE_BASE_URL as t, buildKilocodeModelDefinition as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"entries":[{"output":"api.js","source":"extensions/kilocode/api.ts"},{"output":"index.js","source":"extensions/kilocode/index.ts"},{"output":"onboard.js","source":"extensions/kilocode/onboard.ts"},{"output":"provider-catalog.js","source":"extensions/kilocode/provider-catalog.ts"},{"output":"provider-models.js","source":"extensions/kilocode/provider-models.ts"}],"chunks":[{"output":".setup/provider-models-BMrrUkX_.mjs","sha256":"a85530959da83172ce9c05018e7480a39a50946da68c8a88c0fdc89da16a4889","facadeSource":null,"sources":["extensions/kilocode/openclaw.plugin.json","extensions/kilocode/provider-models.ts"]},{"output":"api.js","sha256":"7abcaa0013cc84f469cb52fba8351f444b115af20f71b1f58b4910b0ef48b14a","facadeSource":"extensions/kilocode/api.ts","sources":[]},{"output":"index.js","sha256":"3266909aa3ad68c22bfbc41eeb4bde30b1ef58e3da5d215c5f37b9c81d9e0cbe","facadeSource":"extensions/kilocode/index.ts","sources":["extensions/kilocode/index.ts"]},{"output":"onboard.js","sha256":"73f0273db6e8a9d86bb0334262a321c028465cf3bfdc2db7699e2c27c7781d77","facadeSource":"extensions/kilocode/onboard.ts","sources":["extensions/kilocode/onboard.ts"]},{"output":"provider-catalog.js","sha256":"74b1efa50878aa01cbbbbd39581423929cd5af624d649c9e085dddf31f0bd7f4","facadeSource":"extensions/kilocode/provider-catalog.ts","sources":["extensions/kilocode/provider-catalog.ts"]},{"output":"provider-models.js","sha256":"e8f5c14f7155543e21b63fe9ba8b68d763b68e1960bfbed68aea0e81e6d57825","facadeSource":"extensions/kilocode/provider-models.ts","sources":[]}],"unrenderedSources":["extensions/kilocode/api.ts"]}
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as KILOCODE_DEFAULT_MODEL_ID, c as KILOCODE_MODELS_URL, d as discoverKilocodeModels, i as KILOCODE_DEFAULT_MAX_TOKENS, l as KILOCODE_MODEL_CATALOG, n as KILOCODE_DEFAULT_CONTEXT_WINDOW, o as KILOCODE_DEFAULT_MODEL_NAME, r as KILOCODE_DEFAULT_COST, s as KILOCODE_DEFAULT_MODEL_REF, t as KILOCODE_BASE_URL, u as buildKilocodeModelDefinition } from "./.setup/provider-models-
|
|
1
|
+
import { a as KILOCODE_DEFAULT_MODEL_ID, c as KILOCODE_MODELS_URL, d as discoverKilocodeModels, i as KILOCODE_DEFAULT_MAX_TOKENS, l as KILOCODE_MODEL_CATALOG, n as KILOCODE_DEFAULT_CONTEXT_WINDOW, o as KILOCODE_DEFAULT_MODEL_NAME, r as KILOCODE_DEFAULT_COST, s as KILOCODE_DEFAULT_MODEL_REF, t as KILOCODE_BASE_URL, u as buildKilocodeModelDefinition } from "./.setup/provider-models-BMrrUkX_.mjs";
|
|
2
2
|
import { buildKilocodeProvider, buildKilocodeProviderWithDiscovery } from "./provider-catalog.js";
|
|
3
3
|
export { KILOCODE_BASE_URL, KILOCODE_DEFAULT_CONTEXT_WINDOW, KILOCODE_DEFAULT_COST, KILOCODE_DEFAULT_MAX_TOKENS, KILOCODE_DEFAULT_MODEL_ID, KILOCODE_DEFAULT_MODEL_NAME, KILOCODE_DEFAULT_MODEL_REF, KILOCODE_MODELS_URL, KILOCODE_MODEL_CATALOG, buildKilocodeModelDefinition, buildKilocodeProvider, buildKilocodeProviderWithDiscovery, discoverKilocodeModels };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { f as openclaw_plugin_default, s as KILOCODE_DEFAULT_MODEL_REF } from "./.setup/provider-models-
|
|
1
|
+
import { f as openclaw_plugin_default, s as KILOCODE_DEFAULT_MODEL_REF } from "./.setup/provider-models-BMrrUkX_.mjs";
|
|
2
2
|
import { buildKilocodeProvider, buildKilocodeProviderWithDiscovery } from "./provider-catalog.js";
|
|
3
3
|
import { applyKilocodeConfig } from "./onboard.js";
|
|
4
|
-
import { wrapKilocodeProviderStream } from "./stream.js";
|
|
5
4
|
import { readConfiguredProviderCatalogEntries } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
6
5
|
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { resolveProviderRequestHeaders } from "openclaw/plugin-sdk/provider-http";
|
|
7
|
+
import { buildProviderReplayFamilyHooks, isProxyReasoningUnsupportedModelHint } from "openclaw/plugin-sdk/provider-model-shared";
|
|
8
|
+
import { normalizeOpenAICompatibleReasoningPayload, wrapProviderPayloadHook } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
9
|
+
import { asOptionalRecord, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
|
+
// extensions/kilocode/index.ts
|
|
9
11
|
const PROVIDER_ID = "kilocode";
|
|
12
|
+
function normalizeKilocodeStopAfterCaller(value, fallbackPayload) {
|
|
13
|
+
const payload = asOptionalRecord(value) ?? fallbackPayload;
|
|
14
|
+
if (typeof payload?.stop === "string") payload.stop = [payload.stop];
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
10
17
|
var kilocode_default = defineSingleProviderPluginEntry({
|
|
11
18
|
id: PROVIDER_ID,
|
|
12
19
|
name: "Kilo Gateway Provider",
|
|
@@ -29,9 +36,32 @@ var kilocode_default = defineSingleProviderPluginEntry({
|
|
|
29
36
|
providerId: PROVIDER_ID
|
|
30
37
|
}),
|
|
31
38
|
...buildProviderReplayFamilyHooks({ family: "passthrough-gemini" }),
|
|
32
|
-
wrapStreamFn
|
|
39
|
+
wrapStreamFn(ctx) {
|
|
40
|
+
if (normalizeOptionalLowercaseString(ctx.provider) !== "kilocode" || !ctx.streamFn) return;
|
|
41
|
+
const underlying = ctx.streamFn;
|
|
42
|
+
const thinkingLevel = ctx.modelId === "kilo-auto/balanced" || isProxyReasoningUnsupportedModelHint(ctx.modelId) ? void 0 : ctx.thinkingLevel;
|
|
43
|
+
return (model, context, options) => {
|
|
44
|
+
const headers = resolveProviderRequestHeaders({
|
|
45
|
+
provider: model.provider,
|
|
46
|
+
api: model.api,
|
|
47
|
+
baseUrl: model.baseUrl,
|
|
48
|
+
capability: "llm",
|
|
49
|
+
transport: "stream",
|
|
50
|
+
callerHeaders: options?.headers,
|
|
51
|
+
defaultHeaders: { "X-KILOCODE-FEATURE": process.env.KILOCODE_FEATURE?.trim() || "openclaw" },
|
|
52
|
+
precedence: "defaults-win"
|
|
53
|
+
});
|
|
54
|
+
return underlying(model, context, {
|
|
55
|
+
...options,
|
|
56
|
+
headers,
|
|
57
|
+
onPayload: wrapProviderPayloadHook(options?.onPayload, (payload, result) => normalizeKilocodeStopAfterCaller(result, asOptionalRecord(payload)), (payload) => {
|
|
58
|
+
const payloadObj = asOptionalRecord(payload);
|
|
59
|
+
if (payloadObj) normalizeOpenAICompatibleReasoningPayload(payloadObj, thinkingLevel);
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
},
|
|
33
64
|
isCacheTtlEligible: (ctx) => ctx.modelId.startsWith("anthropic/")
|
|
34
65
|
}
|
|
35
66
|
});
|
|
36
|
-
//#endregion
|
|
37
67
|
export { kilocode_default as default };
|
package/dist/onboard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as KILOCODE_DEFAULT_MODEL_REF, t as KILOCODE_BASE_URL } from "./.setup/provider-models-
|
|
1
|
+
import { s as KILOCODE_DEFAULT_MODEL_REF, t as KILOCODE_BASE_URL } from "./.setup/provider-models-BMrrUkX_.mjs";
|
|
2
2
|
import { buildKilocodeProvider } from "./provider-catalog.js";
|
|
3
3
|
import { createProviderConnectionPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
4
|
-
|
|
4
|
+
// extensions/kilocode/onboard.ts
|
|
5
5
|
const { applyConfig: applyKilocodeConfig } = createProviderConnectionPresetAppliers({
|
|
6
6
|
primaryModelRef: KILOCODE_DEFAULT_MODEL_REF,
|
|
7
7
|
resolveParams: () => ({
|
|
@@ -15,5 +15,4 @@ const { applyConfig: applyKilocodeConfig } = createProviderConnectionPresetAppli
|
|
|
15
15
|
}]
|
|
16
16
|
})
|
|
17
17
|
});
|
|
18
|
-
//#endregion
|
|
19
18
|
export { KILOCODE_DEFAULT_MODEL_REF, applyKilocodeConfig };
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as discoverKilocodeModels, f as openclaw_plugin_default, t as KILOCODE_BASE_URL } from "./.setup/provider-models-
|
|
1
|
+
import { d as discoverKilocodeModels, f as openclaw_plugin_default, t as KILOCODE_BASE_URL } from "./.setup/provider-models-BMrrUkX_.mjs";
|
|
2
2
|
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
3
|
-
|
|
3
|
+
// extensions/kilocode/provider-catalog.ts
|
|
4
4
|
function buildKilocodeProvider() {
|
|
5
5
|
return buildManifestModelProviderConfig({
|
|
6
6
|
providerId: "kilocode",
|
|
@@ -14,5 +14,4 @@ async function buildKilocodeProviderWithDiscovery(options = {}) {
|
|
|
14
14
|
models: await discoverKilocodeModels(options)
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { buildKilocodeProvider, buildKilocodeProviderWithDiscovery };
|
package/dist/provider-models.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as KILOCODE_BASE_URL, n as KILOCODE_DEFAULT_CONTEXT_WINDOW, r as KILOCODE_DEFAULT_COST, i as KILOCODE_DEFAULT_MAX_TOKENS, a as KILOCODE_DEFAULT_MODEL_ID, o as KILOCODE_DEFAULT_MODEL_NAME, s as KILOCODE_DEFAULT_MODEL_REF, c as KILOCODE_MODELS_URL, l as KILOCODE_MODEL_CATALOG, u as buildKilocodeModelDefinition, d as discoverKilocodeModels } from "./.setup/provider-models-
|
|
1
|
+
export { t as KILOCODE_BASE_URL, n as KILOCODE_DEFAULT_CONTEXT_WINDOW, r as KILOCODE_DEFAULT_COST, i as KILOCODE_DEFAULT_MAX_TOKENS, a as KILOCODE_DEFAULT_MODEL_ID, o as KILOCODE_DEFAULT_MODEL_NAME, s as KILOCODE_DEFAULT_MODEL_REF, c as KILOCODE_MODELS_URL, l as KILOCODE_MODEL_CATALOG, u as buildKilocodeModelDefinition, d as discoverKilocodeModels } from "./.setup/provider-models-BMrrUkX_.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/kilocode-provider",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.5-beta.1",
|
|
4
4
|
"description": "OpenClaw Kilo Gateway 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": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/kilocode/api.ts"},{"output":"index.js","source":"extensions/kilocode/index.ts"},{"output":"onboard.js","source":"extensions/kilocode/onboard.ts"},{"output":"provider-catalog.js","source":"extensions/kilocode/provider-catalog.ts"},{"output":"provider-models.js","source":"extensions/kilocode/provider-models.ts"},{"output":"stream.js","source":"extensions/kilocode/stream.ts"}],"chunks":[{"output":".setup/provider-models-0P0ezPsI.mjs","sha256":"7fa24a5cd06c8921a6c587f61df87b317bacad11d37c896f93766e233c52a793","facadeSource":null,"sources":["extensions/kilocode/openclaw.plugin.json","extensions/kilocode/provider-models.ts"]},{"output":"api.js","sha256":"7868628a0111a25b924c75537953aa80132b2846334a99de6afffa884f4a7326","facadeSource":"extensions/kilocode/api.ts","sources":[]},{"output":"index.js","sha256":"58cd2fde79767c709deb1e0f441a6a26629f82b6dfb3e27122f96abea95c1155","facadeSource":"extensions/kilocode/index.ts","sources":["extensions/kilocode/index.ts"]},{"output":"onboard.js","sha256":"6bbd3b829852e24f59b65c60a5b78c3e54e6d09d203df21b04dcec35fc5a7c8a","facadeSource":"extensions/kilocode/onboard.ts","sources":["extensions/kilocode/onboard.ts"]},{"output":"provider-catalog.js","sha256":"dc10a08a9f283b24f7ab83d2a4ae4550e4ed91c207c1a8e0564a606716f536ea","facadeSource":"extensions/kilocode/provider-catalog.ts","sources":["extensions/kilocode/provider-catalog.ts"]},{"output":"provider-models.js","sha256":"0c4eef7e922683a7926cf7a0ca41d1cf035a6ec3865ee4195cfff537ee71d011","facadeSource":"extensions/kilocode/provider-models.ts","sources":[]},{"output":"stream.js","sha256":"5e1bfce48b3976bc94ce2d0e1b0ea449e8483057bc56ec040709f8fe384256d3","facadeSource":"extensions/kilocode/stream.ts","sources":["extensions/kilocode/stream.ts"]}],"unrenderedSources":["extensions/kilocode/api.ts"]}
|
package/dist/stream.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { isProxyReasoningUnsupportedModelHint } from "openclaw/plugin-sdk/provider-model-shared";
|
|
2
|
-
import { asOptionalRecord, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
import { resolveProviderRequestHeaders } from "openclaw/plugin-sdk/provider-http";
|
|
4
|
-
import { normalizeOpenAICompatibleReasoningPayload } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
5
|
-
//#region extensions/kilocode/stream.ts
|
|
6
|
-
function normalizeKilocodeStopAfterCaller(value, fallbackPayload) {
|
|
7
|
-
const payload = asOptionalRecord(value) ?? fallbackPayload;
|
|
8
|
-
if (typeof payload?.stop === "string") payload.stop = [payload.stop];
|
|
9
|
-
return value;
|
|
10
|
-
}
|
|
11
|
-
function wrapKilocodeProviderStream(ctx) {
|
|
12
|
-
if (normalizeOptionalLowercaseString(ctx.provider) !== "kilocode" || !ctx.streamFn) return;
|
|
13
|
-
const underlying = ctx.streamFn;
|
|
14
|
-
const thinkingLevel = ctx.modelId === "kilo-auto/balanced" || isProxyReasoningUnsupportedModelHint(ctx.modelId) ? void 0 : ctx.thinkingLevel;
|
|
15
|
-
return (model, context, options) => {
|
|
16
|
-
const originalOnPayload = options?.onPayload;
|
|
17
|
-
const headers = resolveProviderRequestHeaders({
|
|
18
|
-
provider: typeof model.provider === "string" ? model.provider : "kilocode",
|
|
19
|
-
api: model.api,
|
|
20
|
-
baseUrl: typeof model.baseUrl === "string" ? model.baseUrl : void 0,
|
|
21
|
-
capability: "llm",
|
|
22
|
-
transport: "stream",
|
|
23
|
-
callerHeaders: options?.headers,
|
|
24
|
-
defaultHeaders: { "X-KILOCODE-FEATURE": process.env.KILOCODE_FEATURE?.trim() || "openclaw" },
|
|
25
|
-
precedence: "defaults-win"
|
|
26
|
-
});
|
|
27
|
-
return underlying(model, context, {
|
|
28
|
-
...options,
|
|
29
|
-
headers,
|
|
30
|
-
onPayload(payload, payloadModel) {
|
|
31
|
-
const payloadObj = asOptionalRecord(payload);
|
|
32
|
-
if (payloadObj) normalizeOpenAICompatibleReasoningPayload(payloadObj, thinkingLevel);
|
|
33
|
-
const result = originalOnPayload?.(payload, payloadModel);
|
|
34
|
-
if (result && typeof result.then === "function") return Promise.resolve(result).then((resolved) => normalizeKilocodeStopAfterCaller(resolved, payloadObj));
|
|
35
|
-
return normalizeKilocodeStopAfterCaller(result, payloadObj);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { wrapKilocodeProviderStream };
|