VNOX-Client/protocol/lnex.proto
loki5512344 f04691c3cd
chore(client): checkpoint deployed features and unfinished server management
User requested a checkpoint and stopped all agents. Deployed artifacts remain the last verified releases; unfinished settings/categories/forums are preserved as WIP. See TODO/roadmap for verification and remaining release/updater work.
2026-11-01 15:31:21 +01:00

526 lines
16 KiB
Protocol Buffer

syntax = "proto3";
package lnex;
// ─── HANDSHAKE ──────────────────────────────────────────────────────────────
message Hello {
string lnex_version = 1;
bytes server_pubkey = 2;
bytes challenge_nonce = 3;
string node_name = 4;
// LNEx v3: the ephemeral X25519 exchange was replaced by TLS 1.3.
reserved 5;
reserved "server_eph_pubkey";
bool private_mode = 6;
// Ed25519 over "VNOX-LNEx-v4-server-hello\0" || tls_exporter || Hello(signature empty).
bytes server_signature = 7;
}
message Auth {
bytes client_pubkey = 1;
string nickname = 2;
string lnex_version = 3;
// Ed25519 over the client-auth transcript bound to the TLS exporter (see docs/02-protocol/tls.md).
bytes signature = 4;
reserved 5;
reserved "client_eph_pubkey";
// Mandatory Central account proof, bound to client_pubkey (LNEx v4).
bytes account_proof = 6;
}
message Session {
string session_id = 1;
string token = 2;
int64 expires_at = 3;
bool node_admin = 4;
// Live ProfileUpdate/ProfileUpdated support. Absent on legacy v4 gateways.
bool live_profiles = 5;
bool node_settings = 6;
bool channel_structure = 7;
bool forums = 8;
}
// ─── KEEPALIVE ──────────────────────────────────────────────────────────────
message Ping { int64 timestamp = 1; }
message Pong { int64 timestamp = 1; }
// ─── ERROR / DISCONNECT ─────────────────────────────────────────────────────
message Error { uint32 code = 1; string message = 2; }
message Disconnect { string reason = 1; }
// ─── CHANNELS ───────────────────────────────────────────────────────────────
message JoinChannel { string channel_id = 1; }
message LeaveChannel { string channel_id = 1; }
message ChannelState {
string channel_id = 1;
string channel_name = 2;
string kind = 3;
repeated MemberInfo members = 4;
string voice_endpoint = 5;
optional string guild_id = 6;
optional string parent_id = 7;
int32 position = 8;
}
message MemberInfo {
string user_id = 1;
string nickname = 2;
bool in_voice = 3;
string account_id = 4;
string avatar_url = 5;
}
message ChannelCreate {
string channel_id = 1;
string channel_name = 2;
string kind = 3;
optional string guild_id = 4;
optional string parent_id = 5;
int32 position = 6;
}
message ChannelDelete { string channel_id = 1; }
message ChannelEdit {
string channel_id = 1;
string channel_name = 2;
optional string parent_id = 3;
optional int32 position = 4;
}
message ChannelList {
repeated ChannelListItem channels = 1;
optional string guild_id = 2;
}
message ChannelListItem {
string channel_id = 1;
string channel_name = 2;
string kind = 3;
optional string guild_id = 4;
optional string parent_id = 5;
int32 position = 6;
}
message UserJoin { string channel_id = 1; string user_id = 2; string nickname = 3; string account_id = 4; string avatar_url = 5; }
message UserLeave { string channel_id = 1; string user_id = 2; }
// ─── CHAT ────────────────────────────────────────────────────────────────────
message ChatMessage {
string message_id = 1;
string channel_id = 2;
string sender_id = 3;
string content = 4;
int64 timestamp = 5;
bool edited = 6;
optional string reply_to = 7;
}
message ChatHistory {
string channel_id = 1;
repeated ChatMessage messages = 2;
}
message ReactionPayload {
string message_id = 1;
string channel_id = 2;
string emoji = 3;
string user_id = 4;
}
message MessageEdit {
string message_id = 1;
string channel_id = 2;
string content = 3;
}
message MessageDelete {
string message_id = 1;
string channel_id = 2;
}
// ─── VOICE ──────────────────────────────────────────────────────────────────
message VoiceState {
string user_id = 1;
string channel_id = 2;
string state = 3;
}
// ─── GUILDS ─────────────────────────────────────────────────────────────────
message GuildCreate { string name = 1; }
message GuildInfo {
string id = 1;
string owner_id = 2;
string name = 3;
int64 member_count = 4;
int64 created_at = 5;
}
message GuildDelete { string guild_id = 1; }
message GuildList { repeated GuildInfo guilds = 1; }
message GuildMemberJoin { string guild_id = 1; }
message GuildMemberLeave { string guild_id = 1; string user_id = 2; }
message GuildMemberKick { string guild_id = 1; string user_id = 2; }
message RoleCreate {
string guild_id = 1;
string name = 2;
optional string color = 3;
optional uint64 permissions = 4;
string id = 5;
}
message RoleDelete {
string guild_id = 1;
string role_id = 2;
}
message InviteCreate {
string guild_id = 1;
optional int64 max_uses = 2;
optional int64 expires_in_seconds = 3;
}
message InviteInfo {
string id = 1;
string guild_id = 2;
string guild_name = 3;
string code = 4;
string creator_id = 5;
optional int64 max_uses = 6;
int64 uses = 7;
optional int64 expires_at = 8;
int64 created_at = 9;
}
message InviteAccept {
string code = 1;
string guild_id = 2;
string guild_name = 3;
}
message InviteDelete {
string guild_id = 1;
string invite_id = 2;
}
message GuildAuditLogFetch {
string guild_id = 1;
int64 limit = 2;
}
message AuditLogEntry {
string id = 1;
string guild_id = 2;
string actor_id = 3;
string action = 4;
optional string target_id = 5;
optional string target_type = 6;
optional string reason = 7;
int64 created_at = 8;
}
message GuildAuditLog {
string guild_id = 1;
repeated AuditLogEntry entries = 2;
}
message GuildMemberListFetch { string guild_id = 1; }
message GuildMemberInfo {
string user_id = 1;
string nickname = 2;
int64 joined_at = 3;
string role_color = 4;
string role_name = 5;
bool is_owner = 6;
}
message GuildMemberList {
string guild_id = 1;
repeated GuildMemberInfo members = 2;
}
message RoleAssign {
string guild_id = 1;
string user_id = 2;
string role_id = 3;
}
message GuildRoleListFetch { string guild_id = 1; }
message GuildRoleInfo {
string id = 1;
string guild_id = 2;
string name = 3;
string color = 4;
uint64 permissions = 5;
int32 position = 6;
}
message GuildRoleList {
string guild_id = 1;
repeated GuildRoleInfo roles = 2;
}
// ─── DIRECT MESSAGES ────────────────────────────────────────────────────────
message DmStart {
string target_user_id = 1;
}
message DmStartResponse {
string dm_id = 1;
string other_user_id = 2;
string other_nickname = 3;
repeated DmMessage messages = 4;
uint32 unread_count = 5;
}
message DmMessage {
string dm_id = 1;
string sender_id = 2;
string content = 3;
int64 timestamp = 4;
}
message DmHistory {
string dm_id = 1;
repeated DmMessage messages = 2;
optional string search_query = 3;
optional int64 limit = 4;
}
message DmReadAck {
string dm_id = 1;
}
// ─── FRIENDS ────────────────────────────────────────────────────────────────
message FriendRequest { string to_user_id = 1; }
message FriendAccept { string from_user_id = 1; }
message FriendDecline { string from_user_id = 1; }
message FriendRemove { string user_id = 1; }
message FriendInfo {
string user_id = 1;
string nickname = 2;
string status = 3;
int64 since = 4;
}
message FriendList { repeated FriendInfo friends = 1; }
message BlockUser { string user_id = 1; }
message UnblockUser { string user_id = 1; }
message BlockList { repeated string blocked = 1; }
message FriendEvent {
string event = 1;
string user_id = 2;
optional string nickname = 3;
}
// ─── PRESENCE ──────────────────────────────────────────────────────────────
message PresenceUpdate {
string status = 1;
optional string activity_type = 2;
optional string activity_text = 3;
}
message PresenceInfo {
string user_id = 1;
string nickname = 2;
string status = 3;
optional string activity_type = 4;
optional string activity_text = 5;
}
message PresenceSync { repeated PresenceInfo presences = 1; }
message PresenceEvent {
string user_id = 1;
string nickname = 2;
string status = 3;
optional string activity_type = 4;
optional string activity_text = 5;
}
// ─── READ RECEIPT & TYPING ─────────────────────────────────────────────────
message ReadReceipt {
string channel_id = 1;
string last_read_message_id = 2;
string user_id = 3;
}
message TypingStart {
string channel_id = 1;
}
// ─── AD-HOC RESPONSE / BROADCAST TYPES ──────────────────────────────────────
message ReadReceiptBroadcast {
string channel_id = 1;
string user_id = 2;
string last_read_message_id = 3;
}
message UserRoleUpdate {
string user_id = 1;
string guild_id = 2;
string color = 3;
}
message TypingBroadcast {
string user_id = 1;
string nickname = 2;
string channel_id = 3;
}
message SimpleResponse {
bool ok = 1;
optional string user_id = 2;
optional string role_id = 3;
}
// ─── E2EE for Direct Messages ────────────────────────────────────────────────
message E2eeDmKeyExchange {
string dm_id = 1;
bytes e2ee_public_key = 2;
}
message E2eeDmKeyExchangeAck {
string dm_id = 1;
}
message E2eeDmMessage {
string dm_id = 1;
string sender_id = 2;
bytes ciphertext = 3;
int64 timestamp = 4;
}
message E2eeDmHistory {
string dm_id = 1;
repeated E2eeDmMessage messages = 2;
optional int64 limit = 3;
}
// Channel-scoped webhook management: authenticated LNEx only. Secrets returned once.
message WebhookRequest {
string id = 1;
string channel_id = 2;
string name = 3;
string direction = 4; // incoming | outgoing
string provider = 5; // generic | github (incoming only)
string endpoint = 6; // outgoing HTTPS URL
string request_id = 7;
}
message WebhookInfo {
string id = 1;
string channel_id = 2;
string name = 3;
string direction = 4;
string provider = 5;
string endpoint = 6;
int64 created_at = 7;
bool revoked = 8;
string suspended_reason = 9;
}
message WebhookResult { WebhookInfo hook = 1; string secret = 2; string request_id = 3; }
message WebhookListResult { repeated WebhookInfo hooks = 1; string request_id = 2; }
message WebhookErrorResult { string request_id = 1; uint32 code = 2; string message = 3; }
// Authenticated signalling only; media uses DTLS/SRTP peer connections.
message MediaControl {
uint32 action = 1; // START1 STOP2 WATCH3 UNWATCH4 OFFER5 ANSWER6 ICE7
string channel_id = 2;
string share_id = 3;
string target_session_id = 4;
string body = 5;
uint32 mline_index = 6;
bool application_audio = 7;
bool microphone = 8;
}
message MediaEvent {
uint32 action = 1;
string channel_id = 2;
string share_id = 3;
string target_session_id = 4;
string body = 5;
uint32 mline_index = 6;
bool application_audio = 7;
bool microphone = 8;
string sender_session_id = 9;
string publisher_user_id = 10;
}
// Fresh credentials delivered only over the authenticated encrypted control session.
message VoiceSession {
bytes route_id = 1;
bytes c2s_key = 2;
bytes s2c_key = 3;
string channel_id = 4;
}
message VoiceFrame {
uint32 voice_seq = 1;
uint32 timestamp = 2;
string channel_id = 3;
string sender_session_id = 4;
bytes opus = 5;
string sender_user_id = 6;
}
// Additive channel image attachment extension; see docs/02-protocol/chat-attachments.md.
message AttachmentUpload { string request_id = 1; string channel_id = 2; bytes data = 3; }
message AttachmentFetch { string request_id = 1; string channel_id = 2; string attachment_id = 3; }
message AttachmentResult { string request_id = 1; string channel_id = 2; string attachment_id = 3; string mime = 4; bytes data = 5; string error = 6; }
// Additive live Central profile metadata, LNEx v4. Authorization is unchanged.
message ProfileUpdate { bytes account_proof = 1; }
message ProfileUpdated {
string user_id = 1;
string account_id = 2;
string nickname = 3;
string avatar_url = 4;
int64 issued_at = 5;
}
// Optional post-SESSION feature report; no AUTH transcript extension.
message ClientFeatures { bool node_settings = 1; bool channel_structure = 2; bool forums = 3; }
message NodeSettingsRequest { string request_id = 1; bool update = 2; string display_name = 3; string description = 4; }
message NodeSettingsResult { string request_id = 1; string display_name = 2; string description = 3; uint32 error_code = 4; string error = 5; }
enum ForumOperation {
FORUM_OPERATION_UNSPECIFIED = 0;
FORUM_OPERATION_LIST = 1;
FORUM_OPERATION_CREATE = 2;
FORUM_OPERATION_OPEN = 3;
FORUM_OPERATION_REPLY = 4;
}
message ForumRequest {
string request_id = 1;
ForumOperation operation = 2;
string channel_id = 3;
string topic_id = 4;
string title = 5;
string content = 6;
uint32 offset = 7;
uint32 limit = 8;
string message_id = 9;
}
message ForumTopic { string topic_id = 1; string channel_id = 2; string title = 3; MemberInfo author = 4; int64 created_at = 5; int64 updated_at = 6; uint32 reply_count = 7; }
message ForumPost { ChatMessage message = 1; MemberInfo author = 2; string topic_id = 3; uint64 ordinal = 4; }
message ForumResult { string request_id = 1; ForumOperation operation = 2; string channel_id = 3; string topic_id = 4; repeated ForumTopic topics = 5; repeated ForumPost posts = 6; bool has_more = 7; uint32 error_code = 8; string error = 9; }
message ForumChanged { string channel_id = 1; ForumTopic topic = 2; ForumPost post = 3; }