Files
openclaw/extensions/kilocode/index.ts
Sebastien Tardif abe99230df fix(kilocode): normalize string stop param to array in stream wrapper (#86461)
* fix(kilocode): normalize string stop param to array in stream wrapper

* fix: move kilocode stop normalization into extension

* fix: keep kilocode stream wrapper plugin-local

* fix: normalize kilocode stop after extra body

* fix(qa-lab): preserve WhatsApp RTT source literal

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-25 16:40:07 +01:00

44 lines
1.6 KiB
TypeScript

import { readConfiguredProviderCatalogEntries } from "openclaw/plugin-sdk/provider-catalog-shared";
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
import { PASSTHROUGH_GEMINI_REPLAY_HOOKS } from "openclaw/plugin-sdk/provider-model-shared";
import { applyKilocodeConfig, KILOCODE_DEFAULT_MODEL_REF } from "./onboard.js";
import { buildKilocodeProvider, buildKilocodeProviderWithDiscovery } from "./provider-catalog.js";
import { wrapKilocodeProviderStream } from "./stream.js";
const PROVIDER_ID = "kilocode";
export default defineSingleProviderPluginEntry({
id: PROVIDER_ID,
name: "Kilo Gateway Provider",
description: "Bundled Kilo Gateway provider plugin",
provider: {
label: "Kilo Gateway",
docsPath: "/providers/kilocode",
auth: [
{
methodId: "api-key",
label: "Kilo Gateway API key",
hint: "API key (OpenRouter-compatible)",
optionKey: "kilocodeApiKey",
flagName: "--kilocode-api-key",
envVar: "KILOCODE_API_KEY",
promptMessage: "Enter Kilo Gateway API key",
defaultModel: KILOCODE_DEFAULT_MODEL_REF,
applyConfig: (cfg) => applyKilocodeConfig(cfg),
},
],
catalog: {
buildProvider: buildKilocodeProviderWithDiscovery,
buildStaticProvider: buildKilocodeProvider,
},
augmentModelCatalog: ({ config }) =>
readConfiguredProviderCatalogEntries({
config,
providerId: PROVIDER_ID,
}),
...PASSTHROUGH_GEMINI_REPLAY_HOOKS,
wrapStreamFn: wrapKilocodeProviderStream,
isCacheTtlEligible: (ctx) => ctx.modelId.startsWith("anthropic/"),
},
});