(to: string)
| 6 | |
| 7 | /** Parse a URI-style address into scheme + target. */ |
| 8 | export function parseAddress(to: string): { |
| 9 | scheme: 'uds' | 'bridge' | 'other' |
| 10 | target: string |
| 11 | } { |
| 12 | if (to.startsWith('uds:')) return { scheme: 'uds', target: to.slice(4) } |
| 13 | if (to.startsWith('bridge:')) return { scheme: 'bridge', target: to.slice(7) } |
| 14 | // Legacy: old-code UDS senders emit bare socket paths in from=; route them |
| 15 | // through the UDS branch so replies aren't silently dropped into teammate |
| 16 | // routing. (No bare-session-ID fallback — bridge messaging is new enough |
| 17 | // that no old senders exist, and the prefix would hijack teammate names |
| 18 | // like session_manager.) |
| 19 | if (to.startsWith('/')) return { scheme: 'uds', target: to } |
| 20 | return { scheme: 'other', target: to } |
| 21 | } |
| 22 |
no outgoing calls
no test coverage detected