Interface CommunicationChannelPayload

Communication channel payload for custom inter-agent messaging. Channels handle message transport between agents (e.g., Redis pub/sub, WebSocket).

interface CommunicationChannelPayload {
    name: string;
    description: string;
    distributed: boolean;
    initialize: ((config) => Promise<void>);
    send: ((targetId, message) => Promise<void>);
    subscribe: ((targetId, handler) => (() => void));
    broadcast?: ((groupId, message) => Promise<void>);
    shutdown?: (() => Promise<void>);
}

Properties

name: string

Channel name (e.g., 'redis-pubsub', 'websocket', 'in-memory')

description: string

Channel description

distributed: boolean

Whether this channel supports distributed communication

initialize: ((config) => Promise<void>)

Initialize the channel

Type declaration

    • (config): Promise<void>
    • Parameters

      • config: Record<string, unknown>

      Returns Promise<void>

send: ((targetId, message) => Promise<void>)

Send a message

Type declaration

    • (targetId, message): Promise<void>
    • Parameters

      • targetId: string
      • message: unknown

      Returns Promise<void>

subscribe: ((targetId, handler) => (() => void))

Subscribe to messages

Type declaration

    • (targetId, handler): (() => void)
    • Parameters

      • targetId: string
      • handler: ((message) => void)
          • (message): void
          • Parameters

            • message: unknown

            Returns void

      Returns (() => void)

        • (): void
        • Returns void

broadcast?: ((groupId, message) => Promise<void>)

Broadcast to a group

Type declaration

    • (groupId, message): Promise<void>
    • Parameters

      • groupId: string
      • message: unknown

      Returns Promise<void>

shutdown?: (() => Promise<void>)

Cleanup/shutdown

Type declaration

    • (): Promise<void>
    • Returns Promise<void>