| 132 | } |
| 133 | |
| 134 | export function normalizeTuiConfig(config: TuiConfigFileShape): TuiConfig { |
| 135 | const command = config.editor?.command?.trim(); |
| 136 | return TuiConfigSchema.parse({ |
| 137 | theme: config.theme ?? DEFAULT_TUI_CONFIG.theme, |
| 138 | disablePasteBurst: config.disable_paste_burst ?? DEFAULT_TUI_CONFIG.disablePasteBurst, |
| 139 | editorCommand: command === undefined || command.length === 0 ? null : command, |
| 140 | notifications: { |
| 141 | enabled: config.notifications?.enabled ?? DEFAULT_NOTIFICATIONS_CONFIG.enabled, |
| 142 | condition: |
| 143 | config.notifications?.notification_condition ?? DEFAULT_NOTIFICATIONS_CONFIG.condition, |
| 144 | }, |
| 145 | upgrade: { |
| 146 | autoInstall: config.upgrade?.auto_install ?? DEFAULT_UPGRADE_PREFERENCES.autoInstall, |
| 147 | }, |
| 148 | }); |
| 149 | } |
| 150 | |
| 151 | export function renderTuiConfig(config: TuiConfig): string { |
| 152 | return `# ~/.kimi-code/tui.toml |