import { useState } from "react"; import { IconAlertTriangle, IconArrowLeft, IconCheck, IconCopy, IconFileSettings, IconFolderOpen, IconLoader2, IconRefresh, IconTerminal2, } from "@tabler/icons-react"; import { bridge } from "@/services"; import { Button } from "@/components/ui/button"; import { KimiMascot } from "./KimiMascot"; interface Props { type: "loading" | "runtime-error" | "no-models" | "no-workspace"; errorMessage?: string | null; onRefresh?: () => void; onBackToLogin?: () => void; } function ErrorDetails({ message }: { message?: string | null }) { const [copied, setCopied] = useState(false); if (!message) return null; const copyError = async () => { await navigator.clipboard.writeText(message); setCopied(true); window.setTimeout(() => setCopied(false), 2_000); }; return (
Error details
{message}
); } function NoModelsContent({ onRefresh, onBackToLogin }: Pick) { return ( <>
Model setup required

Sign in with a Kimi account, or configure a provider and model in your shared Kimi Code config.toml.

Shared Kimi Code configuration

VS Code and the terminal UI use the same Kimi Code home, configuration, credentials, and sessions.

{onBackToLogin && ( )} {onRefresh && ( )}
); } export function ConfigErrorScreen({ type, errorMessage, onRefresh, onBackToLogin }: Props) { if (type === "loading") { return (
Starting Kimi Code…
); } if (type === "no-workspace") { return (
No workspace open

Open a folder to start using Kimi Code.

); } if (type === "no-models") { return (
); } return (
Kimi Code could not start

Check the error below. Full diagnostics are available in the Kimi Code output channel.

{onRefresh && ( )}
); }