style: apply oxfmt

This commit is contained in:
Peter Steinberger
2026-01-17 17:44:54 +00:00
parent bc6928525d
commit 7876679c5d
7 changed files with 17 additions and 19 deletions

View File

@@ -210,9 +210,9 @@ function buildKimiCodeProvider(): ProviderConfig {
contextWindow: KIMI_CODE_CONTEXT_WINDOW,
maxTokens: KIMI_CODE_MAX_TOKENS,
headers: KIMI_CODE_HEADERS,
compat: KIMI_CODE_COMPAT
}
]
compat: KIMI_CODE_COMPAT,
},
],
};
}
@@ -224,9 +224,7 @@ function buildSyntheticProvider(): ProviderConfig {
};
}
export function resolveImplicitProviders(params: {
agentDir: string;
}): ModelsConfig["providers"] {
export function resolveImplicitProviders(params: { agentDir: string }): ModelsConfig["providers"] {
const providers: Record<string, ProviderConfig> = {};
const authStore = ensureAuthProfileStore(params.agentDir, {
allowKeychainPrompt: false,

View File

@@ -189,7 +189,7 @@ describe("cli program (smoke)", () => {
"--auth-choice",
"kimi-code-api-key",
"--kimi-code-api-key",
"sk-kimi-code-test"
"sk-kimi-code-test",
],
{ from: "user" },
);
@@ -197,7 +197,7 @@ describe("cli program (smoke)", () => {
expect.objectContaining({
nonInteractive: true,
authChoice: "kimi-code-api-key",
kimiCodeApiKey: "sk-kimi-code-test"
kimiCodeApiKey: "sk-kimi-code-test",
}),
runtime,
);

View File

@@ -216,7 +216,7 @@ export async function applyAuthChoiceApiProviders(
await params.prompter.note(
[
"Kimi Code uses a dedicated endpoint and API key.",
"Get your API key at: https://www.kimi.com/code/en"
"Get your API key at: https://www.kimi.com/code/en",
].join("\n"),
"Kimi Code",
);
@@ -242,7 +242,7 @@ export async function applyAuthChoiceApiProviders(
nextConfig = applyAuthProfileConfig(nextConfig, {
profileId: "kimi-code:default",
provider: "kimi-code",
mode: "api_key"
mode: "api_key",
});
{
const applied = await applyDefaultModelChoice({
@@ -253,7 +253,7 @@ export async function applyAuthChoiceApiProviders(
applyProviderConfig: applyKimiCodeProviderConfig,
noteDefault: KIMI_CODE_MODEL_REF,
noteAgentModel,
prompter: params.prompter
prompter: params.prompter,
});
nextConfig = applied.config;
agentModelOverride = applied.agentModelOverride ?? agentModelOverride;

View File

@@ -200,7 +200,7 @@ export function applyKimiCodeProviderConfig(cfg: ClawdbotConfig): ClawdbotConfig
const models = { ...cfg.agents?.defaults?.models };
models[KIMI_CODE_MODEL_REF] = {
...models[KIMI_CODE_MODEL_REF],
alias: models[KIMI_CODE_MODEL_REF]?.alias ?? "Kimi Code"
alias: models[KIMI_CODE_MODEL_REF]?.alias ?? "Kimi Code",
};
const providers = { ...cfg.models?.providers };
@@ -220,7 +220,7 @@ export function applyKimiCodeProviderConfig(cfg: ClawdbotConfig): ClawdbotConfig
baseUrl: KIMI_CODE_BASE_URL,
api: "openai-completions",
...(normalizedApiKey ? { apiKey: normalizedApiKey } : {}),
models: mergedModels.length > 0 ? mergedModels : [defaultModel]
models: mergedModels.length > 0 ? mergedModels : [defaultModel],
};
return {
@@ -254,7 +254,7 @@ export function applyKimiCodeConfig(cfg: ClawdbotConfig): ClawdbotConfig {
fallbacks: (existingModel as { fallbacks?: string[] }).fallbacks,
}
: undefined),
primary: KIMI_CODE_MODEL_REF
primary: KIMI_CODE_MODEL_REF,
},
},
},

View File

@@ -80,7 +80,7 @@ export async function setKimiCodeApiKey(key: string, agentDir?: string) {
credential: {
type: "api_key",
provider: "kimi-code",
key
key,
},
agentDir: resolveAuthAgentDir(agentDir),
});

View File

@@ -49,7 +49,7 @@ export const KIMI_CODE_DEFAULT_COST = {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0
cacheWrite: 0,
};
const MINIMAX_MODEL_CATALOG = {
@@ -113,6 +113,6 @@ export function buildKimiCodeModelDefinition(): ModelDefinitionConfig {
contextWindow: KIMI_CODE_CONTEXT_WINDOW,
maxTokens: KIMI_CODE_MAX_TOKENS,
headers: KIMI_CODE_HEADERS,
compat: KIMI_CODE_COMPAT
compat: KIMI_CODE_COMPAT,
};
}

View File

@@ -240,14 +240,14 @@ export async function applyNonInteractiveAuthChoice(params: {
flagValue: opts.kimiCodeApiKey,
flagName: "--kimi-code-api-key",
envVar: "KIMICODE_API_KEY",
runtime
runtime,
});
if (!resolved) return null;
if (resolved.source !== "profile") await setKimiCodeApiKey(resolved.key);
nextConfig = applyAuthProfileConfig(nextConfig, {
profileId: "kimi-code:default",
provider: "kimi-code",
mode: "api_key"
mode: "api_key",
});
return applyKimiCodeConfig(nextConfig);
}