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