(data: Record<string, unknown>, filePath: string)
| 280 | } |
| 281 | |
| 282 | function parseConfigData(data: Record<string, unknown>, filePath: string): KimiConfig { |
| 283 | const raw = cloneRecord(data); |
| 284 | const transformed = transformTomlData(data); |
| 285 | transformed['raw'] = raw; |
| 286 | |
| 287 | try { |
| 288 | return KimiConfigSchema.parse(transformed); |
| 289 | } catch (error) { |
| 290 | throw new KimiError(ErrorCodes.CONFIG_INVALID, `Invalid configuration in ${filePath}: ${formatConfigValidationError(error)}`, { |
| 291 | cause: error, |
| 292 | }); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | export function transformTomlData(data: Record<string, unknown>): Record<string, unknown> { |
| 297 | const result: Record<string, unknown> = {}; |
no test coverage detected