(arcticConfig: Config.Info, opencodeConfig: Config.Info, fields: string[])
| 242 | } |
| 243 | |
| 244 | function mergeConfigs(arcticConfig: Config.Info, opencodeConfig: Config.Info, fields: string[]): Config.Info { |
| 245 | const merged = { ...arcticConfig } |
| 246 | |
| 247 | for (const field of fields) { |
| 248 | const key = field as keyof Config.Info |
| 249 | let value = opencodeConfig[key] |
| 250 | |
| 251 | if (key === "theme" && typeof value === "string") { |
| 252 | const mappedTheme = mapThemeName(value) |
| 253 | if (mappedTheme) { |
| 254 | value = mappedTheme |
| 255 | log.info("mapped theme", { from: opencodeConfig[key], to: mappedTheme }) |
| 256 | } else { |
| 257 | log.warn("unknown theme, skipping", { theme: value }) |
| 258 | continue |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | ;(merged as any)[key] = mergeConfigField(arcticConfig[key], value) |
| 263 | } |
| 264 | |
| 265 | return merged |
| 266 | } |
| 267 | |
| 268 | async function promptForImport(fields: string[]): Promise<boolean> { |
| 269 | const fieldList = fields.join(", ") |
no test coverage detected