Skip to content

Plugins

UGENT channel plugins run as separate OS processes communicating via JSON-RPC over Unix domain sockets. Each channel is isolated — crashes don't cascade.

Plugin Setup

Interactive (REPL)

/plugin setup

The wizard lets you select which plugins to enable, configure swarm nodes, and writes instance-scoped config.

Auto (TUI)

/plugin setup

Non-interactive — generates instance-scoped config from global settings.

Migrate

/plugin migrate

Regenerates instance-scoped config from global config.

Plugin Registration

Plugins are registered in plugins.toml:

toml
schema_version = 1

[[plugins]]
id = "telegram-main"
kind = "channel-telegram"
enabled = true
command = "./target/release/channel-telegram-worker"
args = ["--mode", "polling"]
env_refs = ["TELEGRAM_BOT_TOKEN"]

[plugins.limits]
max_in_flight = 64
max_retries = 5
heartbeat_secs = 30

[plugins.routing]
workspace = "/path/to/workspace"
allowed_senders = ["telegram:123456789"]

Building Plugins

Use the public plugin template:

bash
cargo install cargo-generate
cargo generate --git https://github.com/unizhu/ugent-plugin-template

The template includes:

  • Full lifecycle: heartbeat, inbound listener, outbound polling, graceful shutdown
  • Crash-recovery outbox for in-flight messages
  • Integration test with MockBridge
  • CI workflow (fmt + clippy + test)

What You Implement

  1. Channel API connection — connect to your channel (WebSocket, HTTP, webhook)
  2. Inbound normalization — map channel messages to UGENT's inbound format
  3. Outbound delivery — send responses back to the channel API
  4. Media handling — download/upload attachments (optional)

Process Supervision

The plugin supervisor manages:

  • Kill on drop — dropped handles don't leak processes
  • Process groups — group-targeted termination (Unix)
  • Parent-death signaling — reduces orphan risk (Linux)
  • Two-phase shutdown — graceful terminate, then force-kill
  • Circuit breaker — 3 consecutive cooldown rounds auto-disable a plugin
  • Stale worker cleanup — reaps workers from previous crashed sessions

13 Channels

ChannelKindNotes
Telegramchannel-telegramPolling or webhook mode
Slackchannel-slackSocket Mode or webhook
Discordchannel-discordGateway WebSocket
LINEchannel-lineMessaging API + webhook
WeChatchannel-wechatPersonal account bridge
WeComchannel-wecomEnterprise WeChat
Weixinchannel-weixinWeChat Official Account
Emailchannel-emailGmail push or IMAP
DingTalkchannel-dingtalkRobot webhook
WhatsAppchannel-whatsappCloud API or proxy
Salesforcechannel-salesforce-eventPlatform Events
Webchannel-webHTTP API + SSE streaming
Translationchannel-translateDocument/text translation pipeline

Web Channel API

The web channel provides an OpenAI-compatible API plus native UGENT streaming:

EndpointPurpose
POST /v1/chat/completionsOpenAI-compatible chat (stream + non-stream)
GET /v1/modelsList available models
POST /v1/filesUpload files
GET /v1/files/{id}Download files
GET /v1/ugent/eventsSSE event stream
POST /v1/ugent/commandsSlash command execution
GET /v1/ugent/snapshotSession bootstrap
POST /v1/ugent/stopCancel in-flight turn (per conversation)
GET /v1/ws/voiceVoice WebSocket transport

Released under the Private Beta License.