MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / normalizeTuiConfig

Function normalizeTuiConfig

apps/kimi-code/src/tui/config.ts:134–149  ·  view source on GitHub ↗
(config: TuiConfigFileShape)

Source from the content-addressed store, hash-verified

132}
133
134export 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
151export function renderTuiConfig(config: TuiConfig): string {
152 return `# ~/.kimi-code/tui.toml

Callers 1

parseTuiConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected