mirror of https://github.com/openclaw/openclaw.git
34 lines
900 B
TypeScript
34 lines
900 B
TypeScript
import { OPENCODE_ZEN_DEFAULT_MODEL_REF } from "openclaw/plugin-sdk/provider-models";
|
|
import {
|
|
applyAgentDefaultModelPrimary,
|
|
type OpenClawConfig,
|
|
} from "openclaw/plugin-sdk/provider-onboard";
|
|
|
|
export { OPENCODE_ZEN_DEFAULT_MODEL_REF };
|
|
|
|
export function applyOpencodeZenProviderConfig(cfg: OpenClawConfig): OpenClawConfig {
|
|
const models = { ...cfg.agents?.defaults?.models };
|
|
models[OPENCODE_ZEN_DEFAULT_MODEL_REF] = {
|
|
...models[OPENCODE_ZEN_DEFAULT_MODEL_REF],
|
|
alias: models[OPENCODE_ZEN_DEFAULT_MODEL_REF]?.alias ?? "Opus",
|
|
};
|
|
|
|
return {
|
|
...cfg,
|
|
agents: {
|
|
...cfg.agents,
|
|
defaults: {
|
|
...cfg.agents?.defaults,
|
|
models,
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
export function applyOpencodeZenConfig(cfg: OpenClawConfig): OpenClawConfig {
|
|
return applyAgentDefaultModelPrimary(
|
|
applyOpencodeZenProviderConfig(cfg),
|
|
OPENCODE_ZEN_DEFAULT_MODEL_REF,
|
|
);
|
|
}
|