Skip to content

Documentation / @agentick/core / ChannelServiceInterface

Interface: ChannelServiceInterface ​

Defined in: kernel/src/channel.ts:317

Kernel-level interface for channel service access. This allows KernelContext to reference channels without creating a circular dependency between kernel and engine packages.

Engine's ChannelService implements this interface.

Methods ​

getChannel() ​

getChannel(ctx, channelName): Channel

Defined in: kernel/src/channel.ts:322

Get or create a channel within the current session. Session is determined from the provided context.

Parameters ​

ctx ​

KernelContext

channelName ​

string

Returns ​

Channel


publish() ​

publish(ctx, channelName, event): void

Defined in: kernel/src/channel.ts:327

Publish an event to a channel.

Parameters ​

ctx ​

KernelContext

channelName ​

string

event ​

Omit<ChannelEvent, "channel">

Returns ​

void


subscribe() ​

subscribe(ctx, channelName, handler): () => void

Defined in: kernel/src/channel.ts:333

Subscribe to events on a channel.

Parameters ​

ctx ​

KernelContext

channelName ​

string

handler ​

(event) => void

Returns ​

Unsubscribe function

(): void

Returns ​

void


waitForResponse() ​

waitForResponse(ctx, channelName, requestId, timeoutMs?): Promise<ChannelEvent>

Defined in: kernel/src/channel.ts:342

Wait for a response on a channel (for bidirectional communication).

Parameters ​

ctx ​

KernelContext

channelName ​

string

requestId ​

string

timeoutMs? ​

number

Returns ​

Promise<ChannelEvent>

Released under the ISC License.