( serverName: string, channels: readonly ChannelEntry[], )
| 159 | * kind — that's the user's trust declaration, not inferred from runtime shape. |
| 160 | */ |
| 161 | export function findChannelEntry( |
| 162 | serverName: string, |
| 163 | channels: readonly ChannelEntry[], |
| 164 | ): ChannelEntry | undefined { |
| 165 | // split unconditionally — for a bare name like 'slack', parts is ['slack'] |
| 166 | // and the plugin-kind branch correctly never matches (parts[0] !== 'plugin'). |
| 167 | const parts = serverName.split(':') |
| 168 | return channels.find(c => |
| 169 | c.kind === 'server' |
| 170 | ? serverName === c.name |
| 171 | : parts[0] === 'plugin' && parts[1] === c.name, |
| 172 | ) |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Gate an MCP server's channel-notification path. Caller checks |
no outgoing calls
no test coverage detected