Skip to main content
Functions and classes exported by this package.

AgentPoller

AgentPoller service — polls peek endpoint AND group conversations. Deduplicates messages by ID across both sources. Signature
Methods

onMessage()

Register a message handler.

start()

Start the polling loop.

stop()

Stop the polling loop.

status()

Get poller status.

pollCycle()

Single poll cycle — peek + group conversations.

peekMessages()

Peek for messages mentioning this agent. Delegates to transport when available.

pollGroupConversation()

Poll a group conversation for recent messages that this agent. This is the fix for the group blind spot.

headers()

Build auth headers.

HeartbeatService

HeartbeatService sends periodic online status to the cloud API. Signature
Methods

start()

Start sending heartbeats at the configured interval.

stop()

Stop sending heartbeats.

status()

Get heartbeat service status.

sendHeartbeat()

Send a single heartbeat to the cloud API.

KeyRotationService

KeyRotationService monitors credential age and auto-rotates when threshold is exceeded. Signature
Methods

start()

Start monitoring key age at the configured interval.

stop()

Stop monitoring.

status()

Get rotation service status.

checkAndRotate()

Check credential age and rotate if needed.

SseConnectionService

SseConnectionService manages a persistent transport with subscribe() support. Signature
Methods

onMessage()

Register a message handler for incoming messages.

start()

Start the SSE connection.

stop()

Stop the connection and clean up.

status()

Get connection service status.

createRuntime(registry, config)

Create and start a runtime from the agent registry. Resolves the agent credential, configures the poller, and starts polling. Returns a handle to register message handlers and stop the runtime. Signature
Parameters Returns — A RuntimeHandle with the poller, agentId, and stop function.