Basic Usage
Signature
Function Builder
Configuration Options
Required Properties
| Property | Type | Description |
|---|---|---|
name | string | Unique channel identifier. Becomes the source attribute in notifications. |
source | ChannelSourceConfig | Event source configuration (see Source Types below). |
Optional Properties
| Property | Type | Default | Description |
|---|---|---|---|
description | string | — | Human-readable description. Included in server instructions for Claude. |
twoWay | boolean | false | Enable reply support. Auto-registers channel-reply tool when true. |
meta | Record<string, string> | — | Static metadata appended to every notification from this channel. |
tools | ToolType[] | — | Tools contributed by this channel. Auto-registered in the scope’s tool registry. |
replay | { enabled: boolean; maxEvents?: number } | — | Buffer events for replay when sessions connect later. |
tags | string[] | — | Tags for categorization and filtering. |
availableWhen | EntryAvailability | — | Environment constraints (platform, runtime, env). |
Source Types
Webhook
| Field | Type | Description |
|---|---|---|
type | 'webhook' | Source discriminator |
path | string | HTTP POST endpoint path |
App Event
| Field | Type | Description |
|---|---|---|
type | 'app-event' | Source discriminator |
event | string | Event name to subscribe to on ChannelEventBus |
Agent Completion
| Field | Type | Description |
|---|---|---|
type | 'agent-completion' | Source discriminator |
agentIds | string[] | Optional filter — only these agent IDs trigger the channel |
Job Completion
| Field | Type | Description |
|---|---|---|
type | 'job-completion' | Source discriminator |
jobNames | string[] | Optional filter — only these job names trigger the channel |
Service
| Field | Type | Description |
|---|---|---|
type | 'service' | Source discriminator |
service | string | Human-readable service identifier |
service source use onConnect() / onDisconnect() lifecycle hooks and pushIncoming() for feeding incoming events.
File Watcher
| Field | Type | Description |
|---|---|---|
type | 'file-watcher' | Source discriminator |
paths | string[] | Glob patterns or file paths to watch |
events | Array<'change' | 'create' | 'delete' | 'rename'> | Optional file system events to watch |
Manual
scope.channelNotifications.send().
ChannelNotification Type
The return type ofonEvent():
Two-Way Channels
WhentwoWay: true, implement onReply() to handle responses from Claude:
channel-reply tool is auto-registered with this input schema:
| Field | Type | Required | Description |
|---|---|---|---|
channel_name | string | Yes | Target channel name |
text | string | Yes | Reply text |
meta | Record<string, string> | No | Metadata passed to onReply() |
Server Configuration
Enable channels at the server level:| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable the channel system |
defaultMeta | Record<string, string> | — | Metadata appended to all channel notifications |
Related
- Channels Guide — full documentation with all source types
- ChannelContext — context class reference
- ChannelRegistry — registry API