Files
neoirc/schema
clawbot 909da3cc99 feat: add IRC-style message protocol JSON schemas (draft 2020-12)
Add JSON Schema definitions for all message types:
- Base message envelope (message.schema.json)
- C2S: PRIVMSG, NOTICE, JOIN, PART, QUIT, NICK, MODE, TOPIC, KICK, PING, PUBKEY
- S2C: named commands + numeric reply codes (001, 002, 322, 353, 366, 372, 375, 376, 401, 403, 433)
- S2S: RELAY, LINK, UNLINK, SYNC, PING, PONG
- Schema index (schema/README.md)

All messages use IRC command names and numeric codes from RFC 1459/2812.
Bodies are always objects or arrays (never raw strings) to support
deterministic canonicalization (RFC 8785 JCS) and message signing.
2026-02-10 10:26:32 -08:00
..

Message Schema Index

JSON Schema (draft 2020-12) definitions for the IRC-style message protocol.

All messages share a common envelope defined in message.schema.json.

Base Envelope

Field Type Required Description
command string ✓ IRC command name or numeric reply code
from string Sender nick or server name
to string Destination channel or nick
params array<string> Additional IRC-style parameters
body array | object varies Message body (never a raw string)
meta object Extensible metadata (signatures, etc.)
id string (uuid) Server-assigned message ID
ts string (date-time) Server-assigned timestamp

Client-to-Server (C2S)

Command Schema Description
PRIVMSG c2s/privmsg.schema.json Send message to channel or user
NOTICE c2s/notice.schema.json Send a notice
JOIN c2s/join.schema.json Join a channel
PART c2s/part.schema.json Leave a channel
QUIT c2s/quit.schema.json Disconnect
NICK c2s/nick.schema.json Change nick
MODE c2s/mode.schema.json Set/query modes
TOPIC c2s/topic.schema.json Set/query topic
KICK c2s/kick.schema.json Kick user
PING c2s/ping.schema.json Client keepalive
PUBKEY c2s/pubkey.schema.json Announce public key

Server-to-Client (S2C)

Named Commands

Command Schema Description
PRIVMSG s2c/privmsg.schema.json Relayed message
NOTICE s2c/notice.schema.json Server or user notice
JOIN s2c/join.schema.json User joined channel
PART s2c/part.schema.json User left channel
QUIT s2c/quit.schema.json User disconnected
NICK s2c/nick.schema.json Nick change
MODE s2c/mode.schema.json Mode change
TOPIC s2c/topic.schema.json Topic change
KICK s2c/kick.schema.json User kicked
PONG s2c/pong.schema.json Server pong
PUBKEY s2c/pubkey.schema.json Relayed public key
ERROR s2c/error.schema.json Server error

Numeric Replies

Code Name Schema Description
001 RPL_WELCOME s2c/001.schema.json Welcome after registration
002 RPL_YOURHOST s2c/002.schema.json Server host info
322 RPL_LIST s2c/322.schema.json Channel list entry
353 RPL_NAMREPLY s2c/353.schema.json Names list
366 RPL_ENDOFNAMES s2c/366.schema.json End of names list
372 RPL_MOTD s2c/372.schema.json MOTD line
375 RPL_MOTDSTART s2c/375.schema.json Start of MOTD
376 RPL_ENDOFMOTD s2c/376.schema.json End of MOTD
401 ERR_NOSUCHNICK s2c/401.schema.json No such nick/channel
403 ERR_NOSUCHCHANNEL s2c/403.schema.json No such channel
433 ERR_NICKNAMEINUSE s2c/433.schema.json Nick in use

Server-to-Server (S2S)

Command Schema Description
RELAY s2s/relay.schema.json Relay message to linked server
LINK s2s/link.schema.json Establish server link
UNLINK s2s/unlink.schema.json Tear down link
SYNC s2s/sync.schema.json Synchronize state
PING s2s/ping.schema.json Server ping
PONG s2s/pong.schema.json Server pong