fix(kimi): support API-key setup for Kimi Code

This commit is contained in:
Hunter Bown
2026-05-25 23:39:34 -05:00
parent 2f3750b850
commit ab38635f78
11 changed files with 248 additions and 36 deletions
+4
View File
@@ -11,6 +11,10 @@ interface KVNamespace {
}
async function getKv(): Promise<KVNamespace | undefined> {
if (process.env.NEXT_PHASE === "phase-production-build") {
return undefined;
}
try {
const mod = await import("@opennextjs/cloudflare");
const ctx = await mod.getCloudflareContext({ async: true });
+16 -8
View File
@@ -23,20 +23,28 @@ interface CloudflareEnv {
GITHUB_REPO?: string;
}
function envFromProcess(): CloudflareEnv {
return {
DEEPSEEK_API_KEY: process.env.DEEPSEEK_API_KEY,
DEEPSEEK_BASE_URL: process.env.DEEPSEEK_BASE_URL,
DEEPSEEK_MODEL: process.env.DEEPSEEK_MODEL,
GITHUB_TOKEN: process.env.GITHUB_TOKEN,
CRON_SECRET: process.env.CRON_SECRET,
GITHUB_REPO: process.env.GITHUB_REPO,
};
}
export async function getEnv(): Promise<CloudflareEnv> {
if (process.env.NEXT_PHASE === "phase-production-build") {
return envFromProcess();
}
try {
const mod = await import("@opennextjs/cloudflare");
const ctx = await mod.getCloudflareContext({ async: true });
return ctx.env as CloudflareEnv;
} catch {
return {
DEEPSEEK_API_KEY: process.env.DEEPSEEK_API_KEY,
DEEPSEEK_BASE_URL: process.env.DEEPSEEK_BASE_URL,
DEEPSEEK_MODEL: process.env.DEEPSEEK_MODEL,
GITHUB_TOKEN: process.env.GITHUB_TOKEN,
CRON_SECRET: process.env.CRON_SECRET,
GITHUB_REPO: process.env.GITHUB_REPO,
};
return envFromProcess();
}
}
+1 -1
View File
@@ -58,7 +58,7 @@ interface GhIssue { number: number; title: string; html_url: string; body: strin
const FALLBACK_SHIPPED: RoadmapItem[] = [
{
title: "v0.8.45",
note: "Moonshot/Kimi OAuth, provider-surface sync, and current Windows install/runtime guidance",
note: "Moonshot/Kimi provider support, API-key setup guidance, provider-surface sync, and current Windows install/runtime guidance",
href: "https://github.com/Hmbown/CodeWhale/releases/tag/v0.8.45",
},
];