/** * Configuration Types / 配置类型定义 * TypeScript interfaces for the opespro-opencode.jsonc configuration * 定义 opespro-opencode.jsonc 配置的 TypeScript 接口 */ /** Short alias mapping to a full provider/model ID / 短别名到完整 provider/model ID 的映射 */ export interface ModelAlias { model: string; temperature?: number; family?: string; } /** Per-agent model configuration / 单个 agent 的模型配置 */ export interface AgentModelConfig { model?: string; temperature?: number; fallback?: string[]; maxSteps?: number; } /** Model preset that overrides specific agents / 覆盖特定 agent 的模型预设 */ export interface ModelPreset { description?: string; overrides?: Record>; } /** Category-level model configuration (for fine-grained control) / 分类级模型配置(用于细粒度控制) */ export interface CategoryModelConfig { model?: string; temperature?: number; fallback?: string[]; } /** A discovered provider from OpenCode's model cache / 从 OpenCode 模型缓存中发现的 provider */ export interface DiscoveredProvider { id: string; name: string; models: Record; } /** A discovered model within a provider / provider 中发现的单个模型 */ export interface DiscoveredModel { id: string; name: string; family?: string; } /** Root configuration object / 根配置对象 */ export interface OpesproOpenCodeConfig { $schema?: string; default_provider?: string; model_aliases?: Record; agents?: Record; categories?: Record; presets?: Record; active_preset?: string; /** Filled at runtime by provider discovery — not in user config file / 由 provider 发现运行时填充 — 不在用户配置文件中 */ _discovered_providers?: Record; } /** Final resolved model for an agent (after alias + agent + preset chain) / agent 的最终解析模型(经过别名 + agent + preset 链) */ export interface ResolvedAgentModel { model: string; temperature?: number; maxSteps?: number; fallback_models?: string[]; }