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

Function getTeammateStatuses

src/utils/teamDiscovery.ts:39–79  ·  view source on GitHub ↗
(teamName: string)

Source from the content-addressed store, hash-verified

37 * Reads isActive from config to determine status
38 */
39export function getTeammateStatuses(teamName: string): TeammateStatus[] {
40 const teamFile = readTeamFile(teamName)
41 if (!teamFile) {
42 return []
43 }
44
45 const hiddenPaneIds = new Set(teamFile.hiddenPaneIds ?? [])
46 const statuses: TeammateStatus[] = []
47
48 for (const member of teamFile.members) {
49 // Exclude team-lead from the list
50 if (member.name === 'team-lead') {
51 continue
52 }
53
54 // Read isActive from config, defaulting to true (active) if undefined
55 const isActive = member.isActive !== false
56 const status: 'running' | 'idle' = isActive ? 'running' : 'idle'
57
58 statuses.push({
59 name: member.name,
60 agentId: member.agentId,
61 agentType: member.agentType,
62 model: member.model,
63 prompt: member.prompt,
64 status,
65 color: member.color,
66 tmuxPaneId: member.tmuxPaneId,
67 cwd: member.cwd,
68 worktreePath: member.worktreePath,
69 isHidden: hiddenPaneIds.has(member.tmuxPaneId),
70 backendType:
71 member.backendType && isPaneBackend(member.backendType)
72 ? member.backendType
73 : undefined,
74 mode: member.mode,
75 })
76 }
77
78 return statuses
79}
80
81// Note: For time formatting, use formatRelativeTimeAgo from '../utils/format.js'
82

Callers 1

TeamsDialogFunction · 0.85

Calls 4

readTeamFileFunction · 0.85
isPaneBackendFunction · 0.85
pushMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected