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

Function readTeamMembers

src/utils/tasks.ts:724–753  ·  view source on GitHub ↗

* Reads team members from the team file

(
  teamName: string,
)

Source from the content-addressed store, hash-verified

722 * Reads team members from the team file
723 */
724async function readTeamMembers(
725 teamName: string,
726): Promise<{ leadAgentId: string; members: TeamMember[] } | null> {
727 const teamsDir = getTeamsDir()
728 const teamFilePath = join(teamsDir, sanitizeName(teamName), 'config.json')
729 try {
730 const content = await readFile(teamFilePath, 'utf-8')
731 const teamFile = jsonParse(content) as {
732 leadAgentId: string
733 members: TeamMember[]
734 }
735 return {
736 leadAgentId: teamFile.leadAgentId,
737 members: teamFile.members.map(m => ({
738 agentId: m.agentId,
739 name: m.name,
740 agentType: m.agentType,
741 })),
742 }
743 } catch (e) {
744 const code = getErrnoCode(e)
745 if (code === 'ENOENT') {
746 return null
747 }
748 logForDebugging(
749 `[Tasks] Failed to read team file for ${teamName}: ${errorMessage(e)}`,
750 )
751 return null
752 }
753}
754
755/**
756 * Gets the status of all agents in a team based on task ownership.

Callers 1

getAgentStatusesFunction · 0.85

Calls 7

getTeamsDirFunction · 0.85
readFileFunction · 0.85
jsonParseFunction · 0.85
getErrnoCodeFunction · 0.85
logForDebuggingFunction · 0.85
sanitizeNameFunction · 0.70
errorMessageFunction · 0.70

Tested by

no test coverage detected