Files
Logan.Li b0d0e3a5f3 feat(i18n): add multi-language support (ja/ko/vi/ru/zh-TW) with system auto-detection
- Extend AppLanguage to 7 locales: zh-CN, zh-TW, en, ja, ko, vi, ru
- Auto-detect system language via navigator.languages; fallback to English
- Add BCP47 locale mapping for date formatting and sorting
- Create 50 translation JSON files (5 languages × 10 namespaces, 1137 keys each)
- Update language selector with native language names
- Extend locale key parity test to cover all 7 languages (70 assertions)
- Add VNC/RDP desktop, serial terminal, AI agent, port forwarding, and SFTP features
- Add credential encryption, host metrics, session backup crypto, and zmodem bridge
- Update Rust backend: desktop services, host metrics, SSH/SFTP enhancements
2026-08-12 00:07:48 +08:00

108 lines
2.6 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export type AiProtocol = 'openai-chat' | 'openai-responses' | 'anthropic'
export type AiAuthStyle = 'bearer' | 'x-api-key' | 'both' | 'none'
/** 计费/部署形态:按量 · Plan/套餐 · 本地私有化 */
export type AiBillingMode = 'payg' | 'plan' | 'local'
/**
* Provider 产品分组(UI / 预设分类):
* - openai_compatible:按量 OpenAI 兼容
* - standalone:Anthropic / Google Gemini
* - plan:套餐/Plan(GLM、MiniMax Token Plan、Kimi Code Plan)
* - local:Ollama / VLLM 私有化
* - custom:未收录供应商自填
*/
export type AiProviderFamily = 'openai_compatible' | 'standalone' | 'plan' | 'local' | 'custom'
export type AiModelCapability = 'chat' | 'reasoning' | 'plan'
export interface AiModelConfig {
/** Stable UI identity. Multiple routes may point at the same upstream model id. */
id: string
/** Exact model id sent to the provider. */
model: string
label: string
capability: AiModelCapability
billing: AiBillingMode
/** Optional per-model route overrides for subscription/plan endpoints. */
protocol?: AiProtocol
baseUrl?: string
}
export interface AiProviderConfig {
id: string
name: string
presetId?: string
/** Product family for UI grouping; optional on legacy rows. */
family?: AiProviderFamily
protocol: AiProtocol
authStyle: AiAuthStyle
baseUrl: string
allowInsecureHttp: boolean
models: AiModelConfig[]
defaultModelId: string
enabled: boolean
/** Runtime-only flag. The API key itself never leaves the Rust process after saving. */
hasApiKey?: boolean
}
export type AiAssistantAction = 'explain' | 'command' | 'diagnose' | 'execute'
export interface AiTerminalContext {
selection: string
viewport: string
}
export interface AiCompleteRequest {
provider: AiProviderConfig
model: AiModelConfig
action: AiAssistantAction
prompt: string
context: string
}
export interface AiCompleteResponse {
success: boolean
text?: string
model?: string
redactedCount?: number
error?: string
}
export interface AiModelListResponse {
success: boolean
models?: string[]
error?: string
}
/** Connection test credentials are transient and are never persisted by the test command. */
export interface AiProviderTestRequest {
provider: AiProviderConfig
model: AiModelConfig
apiKey?: string
}
export interface AiProviderTestResponse {
success: boolean
status?: number
model?: string
latencyMs?: number
answer?: string
error?: string
}
export interface AiCatalogDocument {
source: string
data: unknown
}
export interface AiCatalogFetchResponse {
success: boolean
documents?: AiCatalogDocument[]
errors?: string[]
error?: string
}