Open Agent Loops
API Reference

ChannelSource

@open-agent-loops/core


Defined in: channels/channel-source.types.ts:55

A live channel transport. Implementations: SlackSource, DiscordSource, …; InMemoryChannelSource is the test/example fake.

Methods

send()

send(target, text): void | Promise<void>;

Defined in: channels/channel-source.types.ts:72

Post reply text back to a channel/thread.

Parameters

ParameterTypeDescription
targetOutboundTargetWhere the reply goes.
textstringThe reply text.

Returns

void | Promise<void>


start()

start(onMessage): void | Promise<void>;

Defined in: channels/channel-source.types.ts:64

Begin receiving. onMessage is invoked for every normalized inbound message — the source must drain and ack its transport continuously and never stop reading just because a run is in flight (that is what the bounded queue downstream is for). Owns its own reconnect/heartbeat internally.

Parameters

ParameterTypeDescription
onMessage(message) => voidCalled per normalized inbound message.

Returns

void | Promise<void>


stop()

stop(): void | Promise<void>;

Defined in: channels/channel-source.types.ts:75

Stop receiving and release the transport.

Returns

void | Promise<void>

On this page