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

Function setMemberActive

src/utils/swarm/teamHelpers.ts:454–485  ·  view source on GitHub ↗
(
  teamName: string,
  memberName: string,
  isActive: boolean,
)

Source from the content-addressed store, hash-verified

452 * @param isActive - Whether the member is active (true) or idle (false)
453 */
454export async function setMemberActive(
455 teamName: string,
456 memberName: string,
457 isActive: boolean,
458): Promise<void> {
459 const teamFile = await readTeamFileAsync(teamName)
460 if (!teamFile) {
461 logForDebugging(
462 `[TeammateTool] Cannot set member active: team ${teamName} not found`,
463 )
464 return
465 }
466
467 const member = teamFile.members.find(m => m.name === memberName)
468 if (!member) {
469 logForDebugging(
470 `[TeammateTool] Cannot set member active: member ${memberName} not found in team ${teamName}`,
471 )
472 return
473 }
474
475 // Only write if the value is actually changing
476 if (member.isActive === isActive) {
477 return
478 }
479
480 member.isActive = isActive
481 await writeTeamFileAsync(teamName, teamFile)
482 logForDebugging(
483 `[TeammateTool] Set member ${memberName} in team ${teamName} to ${isActive ? 'active' : 'idle'}`,
484 )
485}
486
487/**
488 * Destroys a git worktree at the given path.

Callers 2

initializeTeammateHooksFunction · 0.85
REPLFunction · 0.85

Calls 3

readTeamFileAsyncFunction · 0.85
logForDebuggingFunction · 0.85
writeTeamFileAsyncFunction · 0.85

Tested by

no test coverage detected