MCPcopy
hub / github.com/codeaashu/claude-code / getLeaderName

Function getLeaderName

src/utils/swarm/permissionSync.ts:651–667  ·  view source on GitHub ↗
(teamName?: string)

Source from the content-addressed store, hash-verified

649 * This is needed to send permission requests to the leader's mailbox
650 */
651export async function getLeaderName(teamName?: string): Promise<string | null> {
652 const team = teamName || getTeamName()
653 if (!team) {
654 return null
655 }
656
657 const teamFile = await readTeamFileAsync(team)
658 if (!teamFile) {
659 logForDebugging(`[PermissionSync] Team file not found for team: ${team}`)
660 return null
661 }
662
663 const leadMember = teamFile.members.find(
664 m => m.agentId === teamFile.leadAgentId,
665 )
666 return leadMember?.name || 'team-lead'
667}
668
669/**
670 * Send a permission request to the leader via mailbox.

Calls 3

getTeamNameFunction · 0.85
readTeamFileAsyncFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected