mirror of
https://github.com/musistudio/claude-code-router.git
synced 2026-06-16 21:03:54 +08:00
71 lines
1.5 KiB
TypeScript
71 lines
1.5 KiB
TypeScript
export interface ProviderTransformer {
|
|
use: (string | (string | Record<string, unknown> | { max_tokens: number })[])[];
|
|
[key: string]: any; // Allow for model-specific transformers
|
|
}
|
|
|
|
export interface Provider {
|
|
name: string;
|
|
api_base_url: string;
|
|
api_key: string;
|
|
models: string[];
|
|
transformer?: ProviderTransformer;
|
|
}
|
|
|
|
export interface RouterConfig {
|
|
default: string;
|
|
background: string;
|
|
think: string;
|
|
longContext: string;
|
|
longContextThreshold: number;
|
|
webSearch: string;
|
|
image: string;
|
|
custom?: any;
|
|
}
|
|
|
|
export interface Transformer {
|
|
name?: string;
|
|
path: string;
|
|
options?: Record<string, any>;
|
|
}
|
|
|
|
export interface StatusLineModuleConfig {
|
|
type: string;
|
|
icon?: string;
|
|
text: string;
|
|
color?: string;
|
|
background?: string;
|
|
scriptPath?: string; // 用于script类型的模块,指定要执行的Node.js脚本文件路径
|
|
}
|
|
|
|
export interface StatusLineThemeConfig {
|
|
modules: StatusLineModuleConfig[];
|
|
}
|
|
|
|
export interface StatusLineConfig {
|
|
enabled: boolean;
|
|
currentStyle: string;
|
|
default: StatusLineThemeConfig;
|
|
powerline: StatusLineThemeConfig;
|
|
fontFamily?: string;
|
|
}
|
|
|
|
export interface Config {
|
|
Providers: Provider[];
|
|
Router: RouterConfig;
|
|
transformers: Transformer[];
|
|
StatusLine?: StatusLineConfig;
|
|
forceUseImageAgent?: boolean;
|
|
// Top-level settings
|
|
LOG: boolean;
|
|
LOG_LEVEL: string;
|
|
CLAUDE_PATH: string;
|
|
HOST: string;
|
|
PORT: number;
|
|
APIKEY: string;
|
|
API_TIMEOUT_MS: string;
|
|
PROXY_URL: string;
|
|
CUSTOM_ROUTER_PATH?: string;
|
|
}
|
|
|
|
export type AccessLevel = 'restricted' | 'full';
|