(aiDataDir: string, store: AIConfigStore)
| 93 | const MAX_CONFIG_COUNT = 99 |
| 94 | |
| 95 | function saveLlmConfig(aiDataDir: string, store: AIConfigStore): void { |
| 96 | const configPath = path.join(aiDataDir, 'llm-config.json') |
| 97 | const toSave = { |
| 98 | ...store, |
| 99 | configs: store.configs.map((c) => { |
| 100 | const { apiKey: _k, ...rest } = c |
| 101 | return rest |
| 102 | }), |
| 103 | schemaVersion: 3, |
| 104 | } |
| 105 | fs.writeFileSync(configPath, JSON.stringify(toSave, null, 2), 'utf-8') |
| 106 | } |
| 107 | |
| 108 | export function addLlmConfig( |
| 109 | aiDataDir: string, |
no outgoing calls
no test coverage detected