mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-17 21:10:54 +00:00
32 lines
956 B
TypeScript
32 lines
956 B
TypeScript
import { OPENCODE_ZEN_DEFAULT_MODEL_REF } from "../../src/agents/opencode-zen-models.js";
|
|
import { applyAgentDefaultModelPrimary } from "../../src/commands/onboard-auth.config-shared.js";
|
|
import type { OpenClawConfig } from "../../src/config/config.js";
|
|
|
|
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,
|
|
);
|
|
}
|