feat: implement Pi Switch i18n UI and agent config switch

This commit is contained in:
KimiSwitch Dev
2026-07-08 08:53:26 +08:00
parent 7d69aac08f
commit af991a7bda
86 changed files with 4214 additions and 235 deletions
+57
View File
@@ -0,0 +1,57 @@
export type Agent = "kimi_code" | "pi";
export type ProviderType =
| "kimi"
| "anthropic"
| "openai"
| "openai_responses"
| "google-genai"
| "vertexai";
export interface Provider {
name: string;
provider_type: ProviderType;
base_url: string | null;
api_key: string | null;
env: Record<string, string>;
/** Optional note / remark for the provider. */
note?: string | null;
/** Optional official website URL. */
official_url?: string | null;
/** Managed/OAuth providers skip credential validation. */
managed?: boolean;
/** Whether the provider is enabled/activated. */
enabled?: boolean;
/** Extra agent-specific provider fields preserved across edits. */
raw_other?: unknown;
}
export interface Model {
alias: string;
provider: string;
model: string;
max_context_size: number;
display_name: string | null;
/** Optional model role, e.g. Sonnet/Opus/Fable/Haiku for Claude-style mapping. */
role?: string | null;
/** Whether the model declares extended context / thinking support. */
supports_1m?: boolean;
/** Agent-specific capability flags (e.g. Kimi Code `capabilities`). */
capabilities?: string[];
/** Extra agent-specific model fields preserved across edits. */
raw_other?: unknown;
}
export interface Config {
default_model: string | null;
providers: Record<string, Provider>;
models: Record<string, Model>;
raw_other?: unknown;
}
/** A model discovered from a provider's API endpoint. */
export interface DiscoveredModel {
id: string;
display_name: string | null;
max_context_size: number | null;
}