( plugin: LoadedPlugin, )
| 288 | * `McpbUserConfigurationOption` field-for-field. |
| 289 | */ |
| 290 | export function getUnconfiguredChannels( |
| 291 | plugin: LoadedPlugin, |
| 292 | ): UnconfiguredChannel[] { |
| 293 | const channels = plugin.manifest.channels |
| 294 | if (!channels || channels.length === 0) { |
| 295 | return [] |
| 296 | } |
| 297 | |
| 298 | // plugin.repository is already in "plugin@marketplace" format — same key |
| 299 | // loadMcpServerUserConfig / saveMcpServerUserConfig use. |
| 300 | const pluginId = plugin.repository |
| 301 | |
| 302 | const unconfigured: UnconfiguredChannel[] = [] |
| 303 | for (const channel of channels) { |
| 304 | if (!channel.userConfig || Object.keys(channel.userConfig).length === 0) { |
| 305 | continue |
| 306 | } |
| 307 | const saved = loadMcpServerUserConfig(pluginId, channel.server) ?? {} |
| 308 | const validation = validateUserConfig(saved, channel.userConfig) |
| 309 | if (!validation.valid) { |
| 310 | unconfigured.push({ |
| 311 | server: channel.server, |
| 312 | displayName: channel.displayName ?? channel.server, |
| 313 | configSchema: channel.userConfig, |
| 314 | }) |
| 315 | } |
| 316 | } |
| 317 | return unconfigured |
| 318 | } |
| 319 | |
| 320 | /** |
| 321 | * Look up saved user config for a server, if this server is declared as a |
no test coverage detected