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
typeof AgentPoller
Methods

onMessage()

Register a message handler.
(handler: MessageHandler) => void

start()

Start the polling loop.
() => void

stop()

Stop the polling loop.
() => void

status()

Get poller status.
() => { running: boolean; seenCount: number; }

pollCycle()

Single poll cycle — peek + group conversations.
() => Promise<void>

peekMessages()

Peek for messages mentioning this agent. Delegates to transport when available.
() => Promise<ConduitMessage[]>

pollGroupConversation()

Poll a group conversation for recent messages that this agent. This is the fix for the group blind spot.
(conversationId: string) => Promise<ConduitMessage[]>

headers()

Build auth headers.
() => Record<string, string>

HeartbeatService

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

start()

Start sending heartbeats at the configured interval.
() => void

stop()

Stop sending heartbeats.
() => void

status()

Get heartbeat service status.
() => { running: boolean; consecutiveFailures: number; }

sendHeartbeat()

Send a single heartbeat to the cloud API.
() => Promise<void>

KeyRotationService

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

start()

Start monitoring key age at the configured interval.
() => void

stop()

Stop monitoring.
() => void

status()

Get rotation service status.
() => { running: boolean; lastRotationAt: string | null; }

checkAndRotate()

Check credential age and rotate if needed.
() => Promise<void>

SseConnectionService

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

onMessage()

Register a message handler for incoming messages.
(handler: SseMessageHandler) => void

start()

Start the SSE connection.
() => Promise<void>

stop()

Stop the connection and clean up.
() => Promise<void>

status()

Get connection service status.
() => { running: boolean; transportName: string; }

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
(registry: AgentRegistryAPI, config?: RuntimeConfig) => Promise<RuntimeHandle>
Parameters
NameTypeDescription
registryAgentRegistryAPIAgentRegistryAPI instance for credential lookup.
config: RuntimeConfigOptional runtime configuration overrides.
Returns — A RuntimeHandle with the poller, agentId, and stop function.