MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / formatTeamsSection

Function formatTeamsSection

src/utils/autonomyStatus.ts:65–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65async function formatTeamsSection(): Promise<string> {
66 const teamNames = await listTeamNames()
67 if (teamNames.length === 0) {
68 return ['Teams: 0', ' none'].join('\n')
69 }
70
71 const lines = [`Teams: ${teamNames.length}`]
72 for (const teamName of teamNames) {
73 const teammates = getTeammateStatuses(teamName)
74 const tasks = await listTasks(teamName)
75 const openTasks = tasks.filter(t => t.status !== 'completed')
76 const running = teammates.filter(t => t.status === 'running').length
77 const idle = teammates.filter(t => t.status === 'idle').length
78 lines.push(
79 ` ${teamName}: teammates=${teammates.length} running=${running} idle=${idle} open_tasks=${openTasks.length}`,
80 )
81 for (const teammate of teammates.slice(0, 5)) {
82 const ownerTasks = openTasks.filter(
83 t => t.owner === teammate.name || t.owner === teammate.agentId,
84 )
85 lines.push(
86 ` @${teammate.name}: ${teammate.status} backend=${teammate.backendType ?? 'unknown'} mode=${teammate.mode ?? 'default'} tasks=${ownerTasks.length}`,
87 )
88 }
89 if (teammates.length > 5) {
90 lines.push(` ... ${teammates.length - 5} more teammate(s)`)
91 }
92 }
93 return lines.join('\n')
94}
95
96async function formatCronSection(nowMs: number): Promise<string> {
97 const jobs = await listAllCronTasks()

Callers 1

Calls 4

listTeamNamesFunction · 0.85
getTeammateStatusesFunction · 0.85
listTasksFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected