MCPcopy Index your code
hub / github.com/codeaashu/claude-code / parseAddress

Function parseAddress

src/utils/peerAddress.ts:8–21  ·  view source on GitHub ↗
(to: string)

Source from the content-addressed store, hash-verified

6
7/** Parse a URI-style address into scheme + target. */
8export 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

Callers 3

checkPermissionsFunction · 0.85
validateInputFunction · 0.85
callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected