(text: string)
| 85 | // Parse channel names from slack_search_channels text output. |
| 86 | // The Slack MCP server returns markdown with "Name: #channel-name" lines. |
| 87 | function parseChannels(text: string): string[] { |
| 88 | const channels: string[] = [] |
| 89 | const seen = new Set<string>() |
| 90 | |
| 91 | for (const line of text.split('\n')) { |
| 92 | const m = line.match(/^Name:\s*#?([a-z0-9][a-z0-9_-]{0,79})\s*$/) |
| 93 | if (m && !seen.has(m[1]!)) { |
| 94 | seen.add(m[1]!) |
| 95 | channels.push(m[1]!) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | return channels |
| 100 | } |
| 101 | |
| 102 | export function hasSlackMcpServer(clients: MCPServerConnection[]): boolean { |
| 103 | return findSlackClient(clients) !== undefined |
no test coverage detected