* 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
},
)
| 567 | * Uses agentName (not agentId) for consistency with process-based teammates. |
| 568 | */ |
| 569 | async 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. |
no test coverage detected