MCPcopy Create free account
hub / github.com/Noumena-Network/code / sendIdleNotification

Function sendIdleNotification

src/utils/swarm/inProcessRunner.ts:570–590  ·  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

568 * Uses agentName (not agentId) for consistency with process-based teammates.
569 */
570async 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.

Callers 1

runInProcessTeammateFunction · 0.85

Calls 3

createIdleNotificationFunction · 0.85
sendMessageToLeaderFunction · 0.85
jsonStringifyFunction · 0.85

Tested by

no test coverage detected