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.
68 lines
1.7 KiB
JSON
68 lines
1.7 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://git.eeqj.de/sneak/chat/schema/message.schema.json",
|
|
"title": "Chat Message Envelope",
|
|
"description": "Base message envelope. Bodies MUST be objects or arrays (never raw strings) for deterministic canonicalization (RFC 8785 JCS) and signing.",
|
|
"type": "object",
|
|
"required": [
|
|
"command"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Server-assigned UUID"
|
|
},
|
|
"ts": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "Server-assigned timestamp (ISO 8601)"
|
|
},
|
|
"command": {
|
|
"type": "string",
|
|
"description": "IRC command name or numeric reply code"
|
|
},
|
|
"from": {
|
|
"type": "string",
|
|
"description": "Sender nick or server name"
|
|
},
|
|
"to": {
|
|
"type": "string",
|
|
"description": "Destination: channel (#foo) or nick"
|
|
},
|
|
"params": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "Additional IRC-style parameters"
|
|
},
|
|
"body": {
|
|
"oneOf": [
|
|
{
|
|
"type": "array"
|
|
},
|
|
{
|
|
"type": "object"
|
|
}
|
|
],
|
|
"description": "Message body (array or object, never raw string)"
|
|
},
|
|
"meta": {
|
|
"type": "object",
|
|
"description": "Extensible metadata",
|
|
"properties": {
|
|
"sig": {
|
|
"type": "string",
|
|
"description": "Cryptographic signature (base64)"
|
|
},
|
|
"alg": {
|
|
"type": "string",
|
|
"description": "Signature algorithm (e.g. ed25519)"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|