From 503862d91a69da9015735e93bde1658ce343d2c2 Mon Sep 17 00:00:00 2001 From: Von Date: Sat, 25 Oct 2025 08:15:52 +0800 Subject: [PATCH] feat: support JSON5 configuration parsing in model selector - Add JSON5 dependency for enhanced configuration file support - Update modelSelector.ts to use JSON5.parse instead of JSON.parse - Allows configuration files to include comments and other JSON5 features --- src/utils/modelSelector.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/modelSelector.ts b/src/utils/modelSelector.ts index 7c857423..d7f7d1ed 100644 --- a/src/utils/modelSelector.ts +++ b/src/utils/modelSelector.ts @@ -1,6 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; import { select, input, confirm } from '@inquirer/prompts'; +import JSON5 from 'json5'; // ANSI color codes const RESET = "\x1B[0m"; @@ -80,7 +81,7 @@ function getConfigPath(): string { function loadConfig(): Config { const configPath = getConfigPath(); - return JSON.parse(fs.readFileSync(configPath, 'utf-8')); + return JSON5.parse(fs.readFileSync(configPath, 'utf-8')); } function saveConfig(config: Config): void {