mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 03:10:22 +00:00
build(plugins): add bundled provider plugin packages
This commit is contained in:
53
extensions/kilocode/index.ts
Normal file
53
extensions/kilocode/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
||||
import { buildKilocodeProviderWithDiscovery } from "../../src/agents/models-config.providers.discovery.js";
|
||||
import {
|
||||
createKilocodeWrapper,
|
||||
isProxyReasoningUnsupported,
|
||||
} from "../../src/agents/pi-embedded-runner/proxy-stream-wrappers.js";
|
||||
|
||||
const PROVIDER_ID = "kilocode";
|
||||
|
||||
const kilocodePlugin = {
|
||||
id: PROVIDER_ID,
|
||||
name: "Kilo Gateway Provider",
|
||||
description: "Bundled Kilo Gateway provider plugin",
|
||||
configSchema: emptyPluginConfigSchema(),
|
||||
register(api: OpenClawPluginApi) {
|
||||
api.registerProvider({
|
||||
id: PROVIDER_ID,
|
||||
label: "Kilo Gateway",
|
||||
docsPath: "/providers/kilocode",
|
||||
envVars: ["KILOCODE_API_KEY"],
|
||||
auth: [],
|
||||
catalog: {
|
||||
order: "simple",
|
||||
run: async (ctx) => {
|
||||
const apiKey = ctx.resolveProviderApiKey(PROVIDER_ID).apiKey;
|
||||
if (!apiKey) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
provider: {
|
||||
...(await buildKilocodeProviderWithDiscovery()),
|
||||
apiKey,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
capabilities: {
|
||||
geminiThoughtSignatureSanitization: true,
|
||||
geminiThoughtSignatureModelHints: ["gemini"],
|
||||
},
|
||||
wrapStreamFn: (ctx) => {
|
||||
const thinkingLevel =
|
||||
ctx.modelId === "kilo/auto" || isProxyReasoningUnsupported(ctx.modelId)
|
||||
? undefined
|
||||
: ctx.thinkingLevel;
|
||||
return createKilocodeWrapper(ctx.streamFn, thinkingLevel);
|
||||
},
|
||||
isCacheTtlEligible: (ctx) => ctx.modelId.startsWith("anthropic/"),
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default kilocodePlugin;
|
||||
9
extensions/kilocode/openclaw.plugin.json
Normal file
9
extensions/kilocode/openclaw.plugin.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "kilocode",
|
||||
"providers": ["kilocode"],
|
||||
"configSchema": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {}
|
||||
}
|
||||
}
|
||||
12
extensions/kilocode/package.json
Normal file
12
extensions/kilocode/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@openclaw/kilocode-provider",
|
||||
"version": "2026.3.14",
|
||||
"private": true,
|
||||
"description": "OpenClaw Kilo Gateway provider plugin",
|
||||
"type": "module",
|
||||
"openclaw": {
|
||||
"extensions": [
|
||||
"./index.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user