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

Function sendIdleNotification

src/utils/swarm/inProcessRunner.ts:569–589  ·  view source on GitHub ↗

* Sends idle notification to the leader via file-based mailbox. * Uses agentName (not agentId) for consistency with process-based teammates.

(
  agentName: string,
  agentColor: string | undefined,
  teamName: string,
  options?: {
    idleReason?: 'available' | 'interrupted' | 'failed'
    summary?: string
    completedTaskId?: string
    completedStatus?: 'resolved' | 'blocked' | 'failed'
    failureReason?: string
  },
)

Source from the content-addressed store, hash-verified

567 * Uses agentName (not agentId) for consistency with process-based teammates.
568 */
569async function sendIdleNotification(
570 agentName: string,
571 agentColor: string | undefined,
572 teamName: string,
573 options?: {
574 idleReason?: 'available' | 'interrupted' | 'failed'
575 summary?: string
576 completedTaskId?: string
577 completedStatus?: 'resolved' | 'blocked' | 'failed'
578 failureReason?: string
579 },
580): Promise<void> {
581 const notification = createIdleNotification(agentName, options)
582
583 await sendMessageToLeader(
584 agentName,
585 jsonStringify(notification),
586 agentColor,
587 teamName,
588 )
589}
590
591/**
592 * Find an available task from the team's task list.

Callers 1

runInProcessTeammateFunction · 0.85

Calls 3

createIdleNotificationFunction · 0.85
sendMessageToLeaderFunction · 0.85
jsonStringifyFunction · 0.85

Tested by

no test coverage detected