()
| 490 | * and legacy fallback paths |
| 491 | */ |
| 492 | export function getAllSocketPaths(): string[] { |
| 493 | // Windows uses named pipes, not Unix sockets |
| 494 | if (platform() === 'win32') { |
| 495 | return [`\\\\.\\pipe\\${getSocketName()}`] |
| 496 | } |
| 497 | |
| 498 | const paths: string[] = [] |
| 499 | const socketDir = getSocketDir() |
| 500 | |
| 501 | // Scan for *.sock files in the socket directory |
| 502 | try { |
| 503 | // eslint-disable-next-line custom-rules/no-sync-fs -- ClaudeForChromeContext.getSocketPaths (external @ant/claude-for-chrome-mcp) requires a sync () => string[] callback |
| 504 | const files = readdirSync(socketDir) |
| 505 | for (const file of files) { |
| 506 | if (file.endsWith('.sock')) { |
| 507 | paths.push(join(socketDir, file)) |
| 508 | } |
| 509 | } |
| 510 | } catch { |
| 511 | // Directory may not exist yet |
| 512 | } |
| 513 | |
| 514 | // Legacy fallback paths |
| 515 | const legacyName = `claude-mcp-browser-bridge-${getUsername()}` |
| 516 | const legacyTmpdir = join(tmpdir(), legacyName) |
| 517 | const legacyTmp = `/tmp/${legacyName}` |
| 518 | |
| 519 | if (!paths.includes(legacyTmpdir)) { |
| 520 | paths.push(legacyTmpdir) |
| 521 | } |
| 522 | if (legacyTmpdir !== legacyTmp && !paths.includes(legacyTmp)) { |
| 523 | paths.push(legacyTmp) |
| 524 | } |
| 525 | |
| 526 | return paths |
| 527 | } |
| 528 | |
| 529 | function getSocketName(): string { |
| 530 | // NOTE: This must match the one used in the Claude in Chrome MCP |
nothing calls this directly
no test coverage detected