Class: AgentCommunicationBus
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:93
Implementation of the Agent Communication Bus.
Features:
- Point-to-point messaging between agents
- Broadcast to agencies
- Request-response pattern
- Topic-based pub/sub
- Task handoff protocol
- Message persistence and history
- Delivery tracking and retries
Implements
Implements
Constructors
Constructor
new AgentCommunicationBus(
config?):AgentCommunicationBus
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:138
Creates a new AgentCommunicationBus instance.
Parameters
config?
AgentCommunicationBusConfig = {}
Bus configuration
Returns
AgentCommunicationBus
Methods
acknowledgeMessage()
acknowledgeMessage(
messageId,agentId):Promise<void>
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:519
Acknowledges receipt of a message.
Parameters
messageId
string
agentId
string
Returns
Promise<void>
Implementation of
IAgentCommunicationBus.acknowledgeMessage
broadcast()
broadcast(
agencyId,message):Promise<DeliveryStatus[]>
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:215
Broadcasts a message to all agents in an agency.
Parameters
agencyId
string
message
Omit<AgentMessage, "messageId" | "toAgentId" | "sentAt">
Returns
Promise<DeliveryStatus[]>
Implementation of
IAgentCommunicationBus.broadcast
broadcastToRoles()
broadcastToRoles(
agencyId,roleIds,message):Promise<DeliveryStatus[]>
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:240
Broadcasts to specific roles within an agency.
Parameters
agencyId
string
roleIds
string[]
message
Omit<AgentMessage, "messageId" | "sentAt">
Returns
Promise<DeliveryStatus[]>
Implementation of
IAgentCommunicationBus.broadcastToRoles
createTopic()
createTopic(
topic):Promise<MessageTopic>
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:427
Creates a message topic.
Parameters
topic
Omit<MessageTopic, "topicId">
Returns
Promise<MessageTopic>
Implementation of
IAgentCommunicationBus.createTopic
getDeliveryStatus()
getDeliveryStatus(
messageId):Promise<DeliveryStatus|null>
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:512
Gets the delivery status of a message.
Parameters
messageId
string
Returns
Promise<DeliveryStatus | null>
Implementation of
IAgentCommunicationBus.getDeliveryStatus
getMessageHistory()
getMessageHistory(
agentId,options?):Promise<AgentMessage[]>
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:572
Gets message history for an agent.
Parameters
agentId
string
options?
direction?
"both" | "sent" | "received"
limit?
number
since?
Date
types?
Returns
Promise<AgentMessage[]>
Implementation of
IAgentCommunicationBus.getMessageHistory
getStatistics()
getStatistics():
BusStatistics
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:565
Gets message bus statistics.
Returns
BusStatistics
Implementation of
IAgentCommunicationBus.getStatistics
handoff()
handoff(
fromAgentId,toAgentId,context):Promise<HandoffResult>
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:324
Initiates a structured handoff between agents.
Parameters
fromAgentId
string
toAgentId
string
context
Returns
Promise<HandoffResult>
Implementation of
IAgentCommunicationBus.handoff
publishToTopic()
publishToTopic(
topicId,message):Promise<DeliveryStatus[]>
Defined in: packages/agentos/src/core/agency/AgentCommunicationBus.ts:443
Publishes a message to a topic.
Parameters
topicId
string
message
Omit<AgentMessage, "messageId" | "sentAt">