06 — Extend

Chat channels

Channels are the front doors users hand tasks to the Manager through. Official channels resolve to their GitHub repos automatically.

# Browser-based chat UI (no bot token — just pick a login)
costaff channel add webchat

# Telegram bot — prompts for TELEGRAM_BOT_TOKEN
costaff channel add telegram

Official channels

These four names auto-resolve to their GitHub repos — no URL needed:

NameWhat you need
webchatNo third-party service. The CLI prompts for a login email + password (and a JWT secret) at deploy time; then open the channel's port in a browser and chat.
telegramA TELEGRAM_BOT_TOKEN from @BotFather.
discordA DISCORD_BOT_TOKEN from the Discord developer portal.
lineA LINE_CHANNEL_ACCESS_TOKEN + LINE_CHANNEL_SECRET.

Host ports are auto-assigned from 1809018099 in the order channels are added — costaff channel list shows each channel's port and health. If WebChat is your first channel, it lands on http://localhost:18090.

Step-by-step: setting up each channel

WebChat (easiest — fully local)

  1. costaff channel add webchat
  2. When prompted, choose a login email + password (these are your credentials for the chat page — any values you like) and a JWT secret (any long random string).
  3. Open the port from costaff channel list in a browser, log in, chat. No third-party account, works offline from the internet's point of view.

Telegram (≈ 5 min — works on a laptop, no public IP needed)

  1. In Telegram, open @BotFather and send /newbot.
  2. Give the bot a display name, then a username ending in bot (e.g. my_costaff_bot).
  3. BotFather replies with a token like 123456789:AAH… — copy it.
  4. costaff channel add telegram and paste the token when prompted.
  5. Open your bot in Telegram, send /start and then any message. The first message creates a pending identity — see the approval note below.

Telegram uses long polling (your machine calls Telegram, not the other way around), so it works behind home routers and firewalls with zero network setup.

Discord (≈ 10 min)

  1. Go to the Discord Developer PortalNew Application.
  2. Under Bot: click Reset Token and copy it.
  3. Still under Bot, scroll to Privileged Gateway Intents and enable Message Content Intent — without it the bot connects but never sees your messages. This is the #1 Discord gotcha.
  4. Under OAuth2 → URL Generator: tick the bot scope, give it Send Messages + Read Message History permissions, open the generated URL, and invite the bot to your server.
  5. costaff channel add discord and paste the token.

LINE (⚠ requires a public HTTPS URL)

Unlike Telegram, LINE delivers messages by webhook — LINE's servers must be able to reach your machine over public HTTPS at /callback. On a laptop behind a home router that means a tunnel (e.g. Cloudflare Tunnel or ngrok) or a reverse proxy with TLS. If you're just trying CoStaff out locally, use WebChat or Telegram instead and come back to LINE when you have a server.

  1. In the LINE Developers Console, create a Provider and a Messaging API channel.
  2. Copy the Channel access token and Channel secret.
  3. costaff channel add line and paste both.
  4. In the LINE console, set the webhook URL to https://<your-public-domain>/callback (pointing at this channel's port) and enable webhooks.
First message → approval required

By default, the first message from any new chat account creates a pending identity and the assistant replies that the account "has not been approved". Approve yourself: costaff dashboardUsers → approve the new row, then message again. This gate is what stops a stranger who stumbles onto your bot from using your AI — keep it on.

Custom channels

Same flags as agents. Slack, for example, is a first-party repo added by URL:

# Slack bot (Socket Mode — needs SLACK_BOT_TOKEN + SLACK_APP_TOKEN)
costaff channel add slack --github https://github.com/costaff-ai/costaff-channel-slack

costaff channel add my-channel --github https://github.com/you/my-channel
costaff channel add my-channel --local /path/to/my-channel

Manage channels

CommandWhat it does
costaff channel listRegistered channels + port + health.
costaff channel rebuild <name>Rebuild image and restart.
costaff channel remove <name>Stop, remove, unregister.
costaff channel tags <name>List release tags available in the channel's repo (for pinning).

Pin to a version

Channels accept the same --tag / --no-pull flags as agents. Pin a channel on production and the next rebuild stays on the pinned ref.

costaff channel add telegram --tag v0.1.0
costaff channel rebuild telegram --tag v0.2.0

See CLI → Version pinning for details.

Same agents, multiple chat apps

You can run several channels at once. A Telegram message and a WebChat message both go to the same Manager Agent and the same specialist agents — the user identity is normalized across channels.