/** * ============================================================ * src/ui/theme.ts —— TUI 语义色板(单一出处) * ------------------------------------------------------------ * 借鉴 Claude Code 的语义化主题键思想(utils/theme.ts),按 minimal-agent * 减法原则收敛为 7 个键:组件里写"这段文字是什么角色"(theme.subtle), * 不写"这段文字是什么颜色"('gray')——改配色只动这一个文件。 * * 值是 Ink 的合法取值;undefined = 终端默认前景色。 * 事实调色板(与重构前完全一致,机械替换零行为变化): * - 层次靠三级区分:subtle+dimColor(次要:思维链/工具/进度) * ↔ answer 默认亮色(主角:最终答案)↔ user/plugin bold(状态行)。 * ============================================================ */ export const theme = { /** 用户输入 / banner / 状态行 spinner / 输入框边框 */ user: 'cyan', /** 最终答案正文 —— undefined = 终端默认亮色(答案是主角,不染色) */ answer: undefined, /** ⏺ 答案锚点(配 bold) */ anchor: 'green', /** 次要信息:思维链 / 工具结果 / turn 横线 / live 过程区(配 dimColor) */ subtle: 'gray', /** 暂态提示 / tool_calls 摘要 / 中断提示 */ warning: 'yellow', /** 永久错误 */ error: 'red', /** 健康/正常状态(StatusLine 用量比率等) */ ok: 'green', /** compacting 状态 / 插件进度 / reverse-search */ plugin: 'magenta', } as const; export type ThemeColor = (typeof theme)[keyof typeof theme];