zaun-community-protocol 0.4.1
Generated from rustdoc for zaun_community_protocol 0.4.1. Browse the full rustdoc HTML.
Zaun community protocol (docs/community-protocol/specification.md).
Pure data and functions: identifiers, canonical encoding, RFC 10073 composite post-quantum
signatures, signed objects, permissions, envelopes, commands, events and limits. No I/O, no
clock (time is always a parameter), no dependency on simplex-client (ADR-0001, ADR-0012).
Constants
Section titled “Constants”| Item | Summary |
|---|---|
limits::ACK_CHANNELS |
sync.ack channels. |
client::ACK_LINGER_MS |
How long a due sync.ack waits for a command to go with. A SimpleX connection sends one message at a time, so a command sent right after a lone ack would wait a relay round trip b |
limits::ACTIVITY_MAX |
Presence activity, maximum scalars. |
permissions::ALL |
ALL means every known bit, never u64::MAX (permissions the protocol). |
limits::APP_CHOICE_TEXT |
Choice name and string value, scalars. |
limits::APP_COMMAND_DESCRIPTION |
Command and option description (CHAT_INPUT), scalars. |
limits::APP_COMMAND_NAME |
Command and option name, scalars. |
limits::APP_COMMAND_OPTIONS |
Options per command or subcommand, and choices per option. |
limits::APP_COMMAND_TEXT_TOTAL |
All names, descriptions, choice names and values of one command, scalars. |
limits::APP_COMMANDS |
Application commands per bot: CHAT_INPUT, USER, MESSAGE. |
signed::APP_ID_MAX |
Bytes of app_id (3–64). |
limits::APP_LOCALIZATIONS |
Localized names per field. |
limits::APP_OPTION_LENGTH_MAX |
String option min_length / max_length bound. |
limits::ATTACHMENT_MIME_MAX |
Attachment media type, bytes. |
limits::ATTACHMENT_NAME |
Attachment file name, scalars. |
limits::ATTACHMENT_SIZE_MAX |
Largest attachment the protocol allows, in bytes (XFTP’s 1 GiB); hosts set lower limits. |
limits::ATTACHMENTS_PER_MESSAGE |
Attachments per message. |
command::object::AUDIT_ACTIONS |
Every audit action of the protocol, expanded from its a.b|c notation. |
limits::AUTOCOMPLETE_CHOICES |
Autocomplete choices. |
limits::BAN_DELETE_WINDOW_MAX_MS |
Ban message-deletion window upper bound in milliseconds (7 days). |
crypto::voice::BASE_KEY_LEN |
An SFrame base key: 32 bytes. |
limits::BOT_COMPONENT_MAX |
The WebAssembly component inside a bot package, bytes. |
limits::BOT_CONFIG_KEYS |
Settings a bot may declare (config). |
limits::BOT_CONFIG_VALUE_MAX |
A setting’s value or default, bytes. |
limits::BOT_DESCRIPTION_MAX |
A bot’s description, scalars. |
limits::BOT_HEADER_MAX |
Bot package header, manifest and component sizes, bytes. |
limits::BOT_LOCAL_NETWORK |
local_network addresses a bot may ask for. |
limits::BOT_MANIFEST_MAX |
The manifest JSON inside a bot package, bytes. |
limits::BOT_NETWORK_HOSTS |
Network hosts a bot may ask for. |
limits::BOT_STORAGE_MAX |
A bot’s key-value storage quota, bytes. |
limits::BOTS_PER_COMMUNITY |
Bots per community. |
limits::BULK_DELETE_MAX |
Most message ids in one messages.bulk_deleted event. |
limits::BUTTON_LABEL_MAX |
Button label, scalars. |
limits::CAPABILITIES |
session.hello capabilities: count and bytes each. |
command::attachment::CAPTION_PREFIX |
What every Zaun file transfer’s caption starts with; the attachment id follows. |
limits::CHANNEL_NAME |
Channel name length. |
limits::CHANNEL_TOPIC_MAX |
Channel topic, maximum scalars. |
limits::CHANNELS_PER_COMMUNITY |
Channels per community, including categories. |
limits::CHECKBOX_OPTIONS |
Checkbox group options. |
client::CLIENT_CAPABILITIES |
Capabilities this client offers in session.hello: fragment reassembly. |
signed::CLOCK_SKEW_MS |
Clock-skew allowance on delegation validity windows (rule 4), in milliseconds. |
limits::COLOR_MAX |
Largest role colour, 0xFFFFFF. |
limits::COMMUNITY_DESCRIPTION_MAX |
Community description, maximum scalars. |
limits::COMMUNITY_NAME |
Community name length (scalars). |
limits::COMPONENT_CUSTOM_ID |
Component custom_id, bytes. |
limits::COMPONENT_ROW_BUTTONS |
Buttons per action row. |
limits::COMPONENT_ROWS |
Top-level action rows of a message without IS_COMPONENTS_V2. |
limits::COMPONENTS_TOTAL |
Components in one message, counting nested ones. |
framing::app_data::DATA_TAG |
The content type of a frame message (MsgContent type). |
limits::DAY_MS |
One day in milliseconds. |
client::DEFAULT_TEXT_BUDGET |
Default per-message text budget in UTF-8 bytes. The real value is fixed by the transport adapter from simplex_client::limits; this crate never depends on it. |
limits::DISPLAY_NAME |
Member display name length. |
permissions::DM_GRANTS |
What both participants of a dm channel may always do. |
permissions::DM_IF_GRANTED |
What a participant may do in a dm channel only when its roles grant it in the community. |
limits::DM_OPENS_PER_MINUTE |
New DMs one bot may open per minute. |
limits::DM_UNANSWERED_PER_HOUR |
Messages a bot may write into a DM per hour while the member has never written in it. |
keys::ED25519_PK_LEN |
Ed25519 public key length. |
keys::ED25519_SIG_LEN |
Ed25519 signature length. |
limits::EMBED_AUTHOR_NAME |
Embed author.name, scalars. |
limits::EMBED_DESCRIPTION |
Embed description, scalars. |
limits::EMBED_FIELD_NAME |
Embed field name, scalars. |
limits::EMBED_FIELD_VALUE |
Embed field value, scalars. |
limits::EMBED_FIELDS |
Fields per embed. |
limits::EMBED_FOOTER_TEXT |
Embed footer.text, scalars. |
limits::EMBED_TEXT_TOTAL |
The text of all of a message’s embeds together (titles, descriptions, field names and values, author names, footer texts), scalars. |
limits::EMBED_TITLE |
Embed title, scalars. |
limits::EMBED_URL_MAX |
Embed url and author.url, maximum bytes. |
limits::EMBEDS_PER_MESSAGE |
Embeds per message. |
limits::EMOJI_MAX_BYTES |
Emoji, maximum bytes. |
signed::ENTRY_NAME_MAX |
Bytes per chunk name. |
command::object::flags::EPHEMERAL |
Only the invoker sees it; never stored. |
client::EVENTS_BATCH_TYPE |
type of the coalesced event batch envelope. |
envelope::EVENTS_TYPE |
The type of a batch envelope: a frame type, not an event type. |
permissions::EXPENSIVE_HISTORY_DEPTH |
restrict_expensive: a restricted member reads only the newest this-many sequences of a channel, sequence > head − EXPENSIVE_HISTORY_DEPTH. One full message.history page. |
permissions::EXPENSIVE_MEMBER_PAGE |
restrict_expensive: the most members one member.list page returns to a restricted member, who gets only the first page. |
signed::EXPORT_FORMAT |
The bundle format this manifest describes. |
framing::app_data::FALLBACK_TEXT |
What an app that does not know DATA_TAG shows. Fixed: it never carries frame content. |
limits::FILE_UPLOAD_MAX |
Files in one file upload. |
signed::FORMAT_V1 |
The format byte of every v1 signed object. |
framing::FRAG_ID_CHARS |
Length of an encoded FragId (8 bytes, base64url without padding). |
framing::FRAGMENT_PREFIX |
Prefix of a fragment message. |
limits::FRAGMENT_TIMEOUT_MS |
Milliseconds from the first to the last fragment before a reassembly is discarded. |
framing::app_data::FRAME_KEY |
The data key holding the frame message text. |
crypto::voice::FRAMES_PER_KEY |
Frames one base key may seal before the sender must rekey (2^32: far beyond a session’s length at 50 frames a second, and well inside AES-GCM’s limits for distinct nonces). |
command::object::bot_events::GROUPS |
The groups a manifest may name, with their event types. |
crypto::voice::HEADER_MAX |
Longest header: config byte, 8-byte KID, 8-byte CTR. |
limits::ICE_FIELD_MAX |
Longest ICE server URL, username or credential, in bytes. |
limits::ICE_SERVERS_MAX |
Most ICE servers a host lists in voice.join. |
limits::ICON_MAX |
Descriptor icon, maximum bytes (PNG or WebP). |
limits::IDEMPOTENCY_RETENTION_MS |
Idempotency record retention lower bound in milliseconds. |
limits::IN_FLIGHT_DEFAULT |
Default in-flight window in SMP messages per member. |
limits::IN_FLIGHT_MAX |
Highest configurable in-flight window (half the 128-message SMP queue stays free). |
limits::IN_FLIGHT_MIN |
Lowest configurable in-flight window (the largest frame must fit). |
limits::INTERACTION_ANSWER_MS |
Interaction answer deadline, ms. |
limits::INTERACTION_FOLLOWUPS |
Follow-ups per interaction. |
limits::INTERACTION_LIFETIME_MS |
Follow-ups, edits and modal submits are accepted this long after the interaction, ms. |
limits::INVITE_EXPIRY_MAX_MS |
Invite expiry upper bound in milliseconds (30 days). |
client::member::INVITE_LINK_PREFIX |
The link scheme and path. |
limits::INVITE_MAX_USES |
Invite max_uses upper bound (0 means unlimited). |
command::object::flags::IS_COMPONENTS_V2 |
The message is laid out by components only. |
crypto::voice::KEM_CIPHERTEXT_LEN |
X-Wing ciphertext (HPKE enc) length. |
crypto::voice::KEM_PUBLIC_LEN |
X-Wing encapsulation (public) key length. |
crypto::voice::KEY_PACKAGE_BYTES_LEN |
Canonical bytes of a key package (all fields are fixed width): 1 306 bytes. |
crypto::voice::KEY_PACKAGE_WIRE_LEN |
A key package on the wire: canonical bytes ‖ composite signature, 4 680 bytes. |
crypto::LABEL |
RFC 10073 Label for id-MLDSA65-Ed25519-SHA512 (ASCII, 30 bytes); the ML-DSA context. |
limits::LABEL_TEXT |
Label label and description, scalars. |
limits::LAST_N |
last_n history bounds. |
command::object::flags::LOADING |
A deferred reply still loading; set only by the host. |
permissions::LOCK_MASK |
Bits the channel locked flag removes (step 7d). |
limits::LOCKDOWN_MS |
Lockdown duration bounds in milliseconds per enable (60 s – 7 days). |
signed::MANIFEST_ENTRIES_MAX |
At most this many chunks. |
command::bot::MASKED |
How a secret value is shown. |
limits::MAX_CANONICAL_FIELD |
Unlisted variable-length fields in canonical encodings. |
limits::MAX_COMMAND |
Maximum command envelope, except community.create and community.descriptor.publish. |
limits::MAX_FRAGMENTS |
Fragments per frame. |
limits::MAX_FRAME |
Maximum reassembled envelope in bytes. |
envelope::MAX_JSON_INTEGER |
Largest integer a JSON number may carry here (2^53 − 1, the protocol). |
limits::MAX_OPEN_REASSEMBLIES |
Open reassemblies per connection; a further one discards the oldest. |
crypto::voice::MAX_RECIPIENTS |
Most recipients one sender-keys message names (a mesh of 32 participants). |
limits::MEDIA_DESCRIPTION_MAX |
Media description, scalars. |
limits::MEDIA_GALLERY_ITEMS |
Media gallery items. |
limits::MENTION_MEMBERS |
Member mentions per message. |
limits::MENTION_ROLES |
Role mentions per message. |
limits::MESSAGE_CONTENT |
Message content length. The content may be empty when the message has an attachment or an embed. |
limits::MESSAGE_JSON_MAX |
A message’s content and embeds together, as JSON bytes the host writes them (message_json_len), so that every message, message event and report fits a page. One `message.send |
framing::MIN_BUDGET |
The smallest accepted per-message budget: a fragment header plus one character at its largest escaped (six bytes, escaped_len). |
keys::MLDSA65_PK_LEN |
ML-DSA-65 public key length. |
keys::MLDSA65_SIG_LEN |
ML-DSA-65 signature length. |
limits::MODAL_ITEMS |
Top-level modal items. |
limits::MODAL_TITLE |
Modal title, scalars. |
permissions::safety::NEWCOMER_FORBIDDEN |
Bits newcomer_restrictions must never contain: newcomers always see and read. |
limits::NEWCOMER_WINDOW_MAX_S |
Largest lockdown newcomer_window_s: 30 days, in seconds. |
command::lockdown::NEWCOMER_WINDOW_MAX_S |
Largest newcomer_window_s: 30 days. |
limits::OVERRIDES_PER_CHANNEL |
Overrides per channel. |
signed::PACKAGE_FORMAT |
The package format this header describes. |
signed::PACKAGE_MAGIC |
The file’s first four bytes. |
signed::PACKAGE_VERSION |
The container version byte after the magic. |
limits::PAGE_BYTES |
The items of one paged response (message.history messages, sync.events events, report.list reports; for sync.resume, the whole body), as JSON bytes: below MAX_FRAME by en |
limits::PAGE_LARGE |
Page size: member.list, sync.events. |
limits::PAGE_SMALL |
Page size: message.history, audit.list, invite.list, invite.uses, member.bans, membership.pending, report.list. |
permissions::PENDING_ALLOWED |
Commands a Pending member may issue. verification.* (P2, reserved) is not listed. |
limits::PENDING_EXPIRY_MAX_MS |
Pending expiry upper bound in milliseconds (30 days); default 7 days. |
limits::PENDING_PER_COMMUNITY |
Pending members per community. |
crypto::PREFIX |
RFC 10073 Prefix (ASCII, 32 bytes). |
framing::PROTOCOL_PREFIX |
Prefix shared by every protocol message; text without it is not a protocol message. |
limits::PROTOCOL_VERSION |
Protocol version defined by this crate. |
keys::PUBLIC_KEY_LEN |
Encoded PublicKey length. |
limits::RADIO_OPTIONS |
Radio group options. |
limits::REACTIONS_PER_MESSAGE |
Distinct reaction emoji per message. |
limits::REASON_MAX |
Moderation reason, maximum scalars. |
crypto::voice::RECIPIENT_ENTRY_LEN |
One recipient entry: member id ‖ voice session ‖ SHA3-256 of the wrapped key. |
crypto::voice::REPLAY_WINDOW |
Counters a receiver accepts behind the highest one seen (out-of-order delivery). |
limits::REPORT_DESCRIPTION_MAX |
Report description, maximum scalars. |
limits::REPORT_EVIDENCE_MAX |
Report evidence, maximum messages. |
limits::REPORT_NOTE_MAX |
Report resolution note, maximum scalars. |
limits::REPORT_SNAPSHOT_BYTES |
The evidence snapshots (content and embeds as JSON) one rendered report carries; the first snapshot always goes, and evidence_next names where the rest continue. |
limits::REQUEST_NOTE_MAX |
Membership request note, maximum scalars. |
command::RESERVED_COMMANDS |
The reserved governance commands of the protocol: answered with UNSUPPORTED_FEATURE. |
command::RESERVED_NAMESPACES |
Reserved type namespaces of the protocol (prefixes including the dot): answered with UNSUPPORTED_COMMAND; v1 clients ignore events in them. |
envelope::RESPONSE_TYPE |
The type of every response envelope. |
limits::RESUME_CHANNELS |
sync.resume: channels per request. |
limits::RESUME_EVENTS_PER_STREAM |
sync.resume: events per stream. |
limits::ROLE_NAME |
Role name length. |
limits::ROLES_PER_COMMUNITY |
Roles per community, including @everyone. |
limits::ROLES_PER_MEMBER |
Roles per member. |
limits::ROTATIONS_PAGE |
Page size: community.rotations. |
crypto::SECRET_KEY_LEN |
Length of SecretKey: mldsaSeed (32) ‖ edSK (32). |
limits::SECTION_TEXTS |
Section text displays. |
limits::SELECT_OPTION_TEXT |
Select option label, value, description, scalars. |
limits::SELECT_OPTIONS |
Select options. |
limits::SELECT_PLACEHOLDER_MAX |
Select placeholder, scalars. |
crypto::voice::SENDER_KEYS_BYTES_MAX |
Largest canonical sender-keys message: 2 090 bytes. |
crypto::voice::SENDER_KEYS_FIXED_LEN |
Canonical bytes of a sender-keys message without its recipients. |
crypto::voice::SENDER_KEYS_WIRE_MAX |
Largest sender-keys message on the wire: u32 length ‖ bytes ‖ signature, 5 468 bytes. |
command::object::flags::SETTABLE |
What a sender may set. |
crypto::voice::SFRAME_CIPHER_SUITE |
The SFrame cipher suite: AES_256_GCM_SHA512_128. |
crypto::voice::SFRAME_OVERHEAD_MAX |
Most bytes SFrame adds to a frame: the longest header and the tag. |
limits::SIGNAL_INTERVAL_MS |
Minimum interval between signals per member per channel, in milliseconds. |
keys::SIGNATURE_LEN |
Encoded Signature length. |
limits::SLOWMODE_MAX_S |
Slowmode upper bound in seconds. |
limits::SNAPSHOT_PAGE |
sync.snapshot page. |
crypto::voice::SUITE_V1 |
The voice suite of protocol version 1: X-Wing KEM, HPKE (HKDF-SHA256, AES-256-GCM), SFrame AES_256_GCM_SHA512_128. Unknown suites are rejected (ADR-0011 agility rules). |
signed::SUPPORTED_WORLDS |
The zaun:bot worlds a host built from this crate runs; a package for any other is refused at install and update (it could never load). Kept equal to the bot runtime’s list. |
command::object::flags::SUPPRESS_EMBEDS |
Embeds are not shown. |
command::object::flags::SUPPRESS_NOTIFICATIONS |
Mentions do not notify. |
permissions::SUSPENDED_ALLOWED |
Commands a Suspended member may issue: the same as Pending. |
limits::SUSPENSION_MAX_MS |
Suspension upper bound in milliseconds (90 days), or until restored. |
permissions::TABLE |
Every command of the table with its requirement, in specification order. |
crypto::voice::TAG_LEN |
AES-256-GCM tag length (HPKE and SFrame). |
limits::TEXT_DISPLAY_TOTAL |
All text displays of one message or modal together, scalars. |
limits::TEXT_INPUT_MAX |
Text input value and length bounds, scalars. |
limits::TEXT_INPUT_PLACEHOLDER_MAX |
Text input placeholder, scalars. |
permissions::TIMEOUT_KEEP |
Bits a timed-out member keeps (step 7a). |
limits::TIMEOUT_MAX_MS |
Timeout upper bound in milliseconds (28 days). |
limits::TYPING_COUNT_CAP |
The largest count of an anonymous signal.typing: 3 means “three or more”, so a larger channel never learns exactly how many are typing. |
permissions::UNBOUND_ALLOWED |
Commands an unbound (negotiated) connection may send: community.rotations too, naming the community in the envelope’s community_id (the chain is public and signed; a client nee |
limits::UNBOUND_DEADLINE_MS |
Unbound connection deadline (default) in milliseconds. |
permissions::UNBOUND_ONLY |
Commands that only make sense unbound; a bound connection gets CONFLICT. |
signed::VERSION_MAX |
Bytes of version. |
limits::VOICE_KEY_PACKAGE_MAX |
Largest key_package of voice.join, decoded bytes (opaque to the host; the media layer’s packages are 4 680 bytes). |
limits::VOICE_MESH_MAX |
The most participants a voice channel can have on any host (mesh_max ≤ this). Every participant’s key package is in the voice.join response, which must fit in MAX_FRAME (9 ba |
limits::VOICE_SENDER_KEYS_MAX |
Largest sender_keys of voice.keys, decoded bytes: the sender’s signed message for one epoch, the same for every recipient (the media layer’s are at most 5 468 bytes). |
limits::VOICE_SIGNAL_MAX |
Largest data of voice.signal (WebRTC SDP or ICE), decoded bytes. |
limits::VOICE_USER_LIMIT |
user_limit of a voice channel. |
limits::VOICE_WRAPPED_KEY_MAX |
Largest wrapped key of one voice.keys entry, decoded bytes (the media layer’s are 1 168 bytes). |
permissions::WAITING_MASK |
Bits the admission policy’s waiting period withholds: posting, reacting and creating invitations. |
framing::WHOLE_PREFIX |
Prefix of a whole-envelope message. |
signed::WORLD_MAX |
Bytes of world. |
crypto::voice::WRAPPED_KEY_LEN |
A wrapped sender key: enc ‖ AES-256-GCM(base key) ‖ tag, 1 168 bytes. |
| Item | Summary |
|---|---|
permissions::Access |
Who may send the command at all, before any bit is checked. |
command::object::ActivityType |
What the member is doing. |
signed::AdmissionMode |
AdmissionSummary.mode. |
command::object::AdmissionVia |
admission.via. SPEC: a plain string ("invite" | "request"), not {t}. |
command::object::Availability |
availability. SPEC: a plain string, as written in the spec. |
envelope::BatchError |
A batch that breaks the rules of the protocol Indices count from 0 in body.events. |
command::BodyError |
A body that cannot be accepted. Each variant maps to one error code of the protocol; the envelope layer adds request_id, the message text and the extra fields. |
command::object::BotKind |
kind of a bot. |
command::object::BotState |
state of an installed bot. |
client::BuildError |
An owner or member object (descriptor, delegation, registration, body) could not be built. |
command::object::ButtonStyle |
Button style: 1 primary, 2 secondary, 3 success, 4 danger, 5 link. |
model::ChannelKind |
The kind of a channel (permissions the protocol, the protocol). |
command::object::ChoiceValue |
A choice value: a string or a number. |
client::ClientError |
A command could not be prepared or the session refuses to send it. |
client::ClientEvent |
One outcome for the application. |
command::Command |
A decoded command body: one variant per command of the protocol |
command::object::CommandType |
type of a command: 1 CHAT_INPUT (a slash command), 2 USER, 3 MESSAGE (context menus). |
command::object::Component |
One component. The variant is the wire type number. |
permissions::ConflictReason |
Why a state transition does not apply (CONFLICT). |
crypto::Context |
An RFC 10073 ctx value of this protocol. The verifier always supplies the context of the object type it expects; it is never read from the input. |
crypto::ContextStatus |
Whether a context is part of v1 conformance. |
command::interaction::CreateData |
interaction.create data, by type. |
encoding::DecodeError |
The input is not a canonical encoding. |
command::object::DefaultValueKind |
default_values entry kind of an entity select. |
permissions::DenialReason |
Why a permission check failed, when a specific rule caused it (permissions the protocol). |
framing::DiscardReason |
Why a reassembly (or a fragment that would start one) was discarded. A discard produces no response; the sender’s retry repairs it. |
signed::Discovery |
discovery (field 17). |
model::DistributionMode |
How accepted channel-stream events travel (ADR-0009, the protocol, Appendix A). |
encoding::EncodeError |
A value cannot be encoded canonically: it would not decode. |
framing::EncodeError |
Why an envelope cannot be framed. |
event::EphemeralOp |
op of interaction.message. |
error_code::ErrorCode |
A response error code. Clients branch on this, never on the message text. |
event::Event |
A decoded event body: one variant per event of the the protocol catalogue. |
envelope::EventError |
An event envelope that breaks the rules of the protocol |
client::ExpectedHost |
The host the client expects to reach. The welcome’s host key must match. |
event::FailReason |
Why an interaction failed. |
permissions::GateDenial |
Why the gate refused a command. |
model::HistoryAccess |
How much channel history a member may read (ADR-0014, the protocol). Stamped on each message at send time. |
command::object::IcePolicy |
Which ICE candidates clients may use. |
envelope::IdempotencyKey |
The key an idempotency record is stored under. C is the host’s opaque connection id, used only for unbound connections. |
framing::Inbound |
What an inbound transport text is. |
command::object::InteractionData |
data of an interaction, by type. |
command::object::InteractionType |
type of an interaction (Discord’s numbers; PING is not used). |
permissions::Invalid |
A malformed request (BAD_REQUEST). |
permissions::invites::InviteCreation |
The admission policy’s invite_creation rule. |
command::object::InviteCreation |
invite_creation. |
keys::KeyEncodingError |
The encoding is not a known suite or has the wrong length. |
client::member::LinkError |
A link that is not a valid invitation. Carries no part of the input. |
command::object::LockdownView |
A lockdown as the viewer may see it. The full form is tried first. On disable or expiry, moderation.lockdown.updated carries the inactive public form to every member, `MANAGE_SAF |
model::MembershipState |
A member’s lifecycle state. Independent of roles. |
command::signal::NoResponse |
A signal has no response. Uninhabited. |
command::object::OptionType |
type of an option (Discord’s numbers 1–11). |
command::object::OptionValueKind |
An option value as the invoker gave it: a string, number, boolean or id. |
command::object::Outcome |
outcome. |
envelope::Outcome |
The result carried by a response. |
permissions::overrides::OverrideSubject |
The target of an override as the hierarchy sees it. |
permissions::OverrideTarget |
Whom an override applies to (permissions the protocol). |
command::object::OverrideTarget |
The subject of an override: {"t":"role","c":RoleId} or {"t":"member","c":MemberId}. |
permissions::overrides::OverrideWrite |
What the host does with a validated override. |
signed::PackageError |
A .zbot file that does not verify. |
event::Parsed |
The result of decoding an event: known, or an unknown type that the client ignores while still advancing the stream’s cursor by its sequence. Events in reserved namespaces are |
json::Patch |
A field that distinguishes “absent” from “null” in update commands (channel.update with "topic": null clears the topic; no topic leaves it). |
command::object::PolicyLevel |
level. |
command::object::PolicyView |
The full policy or the public summary, by the viewer’s permissions (admission.policy.updated body, the protocol). The full form is tried first. |
command::signal::PresenceStatus |
Presence status, in the the protocol tagged form. A client sends online, idle, dnd or invisible (offline from a client means invisible); others only ever see online, |
client::ProtocolError |
Input ignored safely. |
signed::Purpose |
Why a member key is registered (field 2). Other values are reserved and rejected. |
framing::Pushed |
The result of pushing one fragment. |
envelope::RateCategory |
RATE_LIMITED category. |
envelope::RateScope |
RATE_LIMITED scope. |
envelope::Reason |
FORBIDDEN and CONFLICT reasons. |
permissions::Refusal |
Every way a pure check can refuse a command. |
signed::RegistrationError |
A MemberKeyRegistration is not acceptable to the host. |
event::RemovalReason |
reason: {t: "kicked" | "banned" | "left" | "rejected" | "expired"}. |
envelope::Replay |
What to do with a command whose key matches a stored record. |
command::object::ReportCategory |
category. |
command::object::ReportStatus |
status: a plain string, exactly "open"|"reviewing"|"resolved". |
command::object::ReportTarget |
target: {t: "member"|"message", c}. |
command::interaction::ResponseData |
Response data, by type. |
command::interaction::ResponseType |
Interaction response types (Discord’s callback numbers). |
command::object::Restriction |
One lockdown restriction. |
signed::RotationError |
The rotation chain does not verify. index is 1-based. |
permissions::Scope |
Where the required bits are evaluated. |
signed::SessionProofError |
A HostSessionProof is not acceptable to the client. |
client::SessionState |
Where the session is in its lifecycle. |
signed::SignedError |
Signing, verifying, encoding or decoding one signed object failed. |
crypto::SignError |
Signing failed. |
command::sync::SnapshotItem |
One snapshot item; the variant follows the requested part. |
command::sync::SnapshotPart |
part. SPEC: a plain string, as in the the protocol request. |
command::object::Stream |
An event stream. SPEC: a plain string, as in the the protocol stream field and the the protocol example ("stream": "channel"), not {t}. |
envelope::Stream |
An event stream; also the stream of RESYNC_REQUIRED. |
keys::Suite |
A signature suite. 0x00 and 0x02–0xFF are rejected. |
command::object::TextInputStyle |
Text input style: 1 short, 2 paragraph. |
permissions::Top |
A member’s top position. The owner is above every role. |
command::TypeClass |
What a command type string is to a v1 host. |
model::TypingMode |
Who sees that someone is typing in a channel (typing, the protocol). A plain JSON string, as the specification writes it. |
command::object::UploadFailure |
failure of an upload: why the host does not hold it. |
signed::ValidityError |
A (descriptor, delegation) pair is not valid. |
signed::VerificationLevel |
AdmissionSummary.level: verification level None … Highest (governance.md). |
crypto::VerifyError |
Verification failed. Callers map every variant to INVALID_SIGNATURE; the variants exist for tests and diagnostics only. |
event::VisibilityReason |
A visibility change. SPEC: a plain string ("access_gained"), as written. |
crypto::voice::VoiceError |
A voice key or frame operation failed. |
event::VoiceLeftReason |
Why a participant left a voice channel. |
client::WelcomeError |
Why a session.welcome was rejected. |
Functions
Section titled “Functions”| Item | Summary |
|---|---|
permissions::act_on |
H1 then H2, with H2 skipped when the actor targets themself and self_ok is set. |
permissions::safety::admission_policy_update |
admission.policy.update of newcomer_restrictions: valid, and H3 on the bits added or removed (old XOR new ⊆ cp; only the owner exempt, see h3_owner_only). |
permissions::overrides::adopt_parent |
Setting sync_with_parent = true: checked as an override edit from the channel’s own overrides to the parent’s, for every target in either. subject maps a target to its hierarch |
permissions::all_in |
The grants of an owner or administrator in a channel. |
command::object::bot_events::allowed |
Whether the capabilities allow events of kind: member events need members, presence needs presence, DM events need dms; everything else is visible to any member anyway. |
permissions::applicable |
The channel bits that apply to a channel kind. |
permissions::members::approve |
membership.approve. A Pending target has no roles, so no H2; but the approver must be able to assign every default role applied at approval. Ending a Probation early needs H1 |
permissions::base |
base(m) for a non-owner (steps 1–2): @everyone OR the member’s roles; ALL with ADMINISTRATOR; otherwise masked by KNOWN. |
permissions::roles::can_assign |
Whether actor could assign role right now: the check behind invitation default roles and approval (permissions the protocol, the protocol). cp must hold MANAGE_ROLES unless |
permissions::roles::can_grant |
Hierarchy over a role being granted, without MANAGE_ROLES: not @everyone, H4, and its known bits held (H3). Used by membership.approve. |
command::attachment::caption |
The caption of the SimpleX file that carries attachment id, either way. |
permissions::channel_grants |
grants(m, ch) (steps 3–6) for a non-administrator whose base is base. |
command::object::check_commands |
Every command’s rules, the per-type counts and unique names; at most 8 000 scalars of text per command. |
command::object::check_embeds |
The state-free rules of a message’s embeds: at most 10, each valid and showing something, at most 6 000 scalars of text in all. With attachments, every picture an embed shows mus |
command::object::check_message_components |
A message’s components: at most five action rows without IS_COMPONENTS_V2, the V2 layout kinds with it; at most 40 in all, unique ids and custom_ids. |
command::object::check_modal |
A modal (MODAL response): custom_id, title 1–45 and 1–5 labels or text displays. |
command::object::check_pictures |
Every picture an embed shows (image, thumbnail, author.icon, footer.icon) is one of the message’s attachments, so it travels the attachment path like any file and nobody |
envelope::check_version |
Checks an inbound envelope’s v against the connection’s negotiated version. |
command::bot::chosen |
Full grants from a choice and the manifest’s request. |
signed::claimed_genesis |
The claimed genesis key: the first rotation’s old_root, or the descriptor’s root_public_key when the chain is empty. |
command::classify |
Classifies a command type. Exact, case-sensitive matching. |
framing::classify |
Classifies one inbound text message. The zaun:1f: prefix is tested before zaun:1: (they differ at the 7th byte, so the order is only for clarity). |
envelope::command_limit |
The size limit of a command envelope of type kind: MAX_COMMAND, except community.create and community.descriptor.publish, which may use the whole max_frame. |
permissions::commands |
Every command name of the table. |
permissions::community_dependencies |
Implicit dependencies at community level: no attachment, embed or mass mention without SEND_MESSAGES, no voice bit without CONNECT. There is no VIEW_CHANNEL gate here: whethe |
crypto::community_id |
CommunityId = SHA3-256("zaun/community-id/v1" ‖ 0x00 ‖ genesis root key), over the 1 985-byte encoding including the suite byte. Always the genesis key. |
signed::compare_versions |
Semantic Versioning precedence of two versions; None when either is invalid. An update must be Ordering::Greater than the installed version. |
command::object::component_attachments |
Every attachment the components show (thumbnails, gallery pictures, files), with the field naming it; each must be an attachment of the same message. |
command::object::config_key_ok |
A config key: a-za-z0-9_{0,63}. |
crypto::content_hash |
SHA3-256(bytes): how signed objects are identified, deduplicated and chained (never by signature bytes, the protocol), for example a delegation_hash. |
client::owner::create_body |
The community.create body: the genesis pair, the owner’s member key and its registration (purpose 1) for the host’s current host_challenge (from the welcome). |
framing::app_data::data |
The application data that carries the frame message frame. |
b64::decode |
Decodes canonical base64url without padding. |
b64::decode_array |
Decodes exactly N bytes. |
client::decode_response |
Decodes a successful response body as the response type of command B. |
client::owner::delegate |
Signs a delegation of every v1 scope to host, valid from now_ms. |
permissions::dependencies |
Implicit dependencies (step 6) at channel level: no channel bit without VIEW_CHANNEL, then community_dependencies. |
crypto::voice::derive_key_salt |
RFC 9605 the protocol derive_key_salt for suite 0x0005. |
b64::bytes::deserialize |
Deserializes strict base64url. |
json::u64_decimal::deserialize |
Deserializes a canonical decimal string. |
b64::encode |
Encodes bytes as base64url without padding. |
framing::encode |
Frames the compact envelope JSON json. |
b64::encoded_len |
The length of the unpadded encoding of n bytes. |
framing::escaped_len |
The bytes text takes written inside a JSON string, as a frame message travels in its application data: " and \ take two, the control characters JSON writes as \b, \t, `\n |
ids::fill_random |
Fills buf from the operating system CSPRNG. |
command::object::find_interactive |
The enabled interactive component (button with a custom_id, or a select) with custom_id among a message’s components: what a MESSAGE_COMPONENT interaction may name. |
framing::app_data::frame |
The frame message text in application data of content type tag, or None when it is not a Zaun frame. Keys other than FRAME_KEY are ignored, for later additions. |
encoding::from_bytes |
Decodes a top-level value, rejecting trailing bytes. |
permissions::gate |
The gate for a connection bound to a member in state. Probation and Active pass every bound command, which is then subject to its permissions. |
permissions::gate_unbound |
The gate for an unbound connection. |
client::member::generate_member_key |
Generates a fresh member key. Use one per community. |
client::owner::generate_root_key |
Generates a fresh root key: the community’s identity. Store it sealed; it cannot be recovered (ADR-0011). |
client::owner::genesis |
Builds and signs the genesis pair: delegation epoch 1 to host (no expiry, ADR-0005), descriptor revision 1 naming it, with owner_member_key as the owner binding. |
command::object::bot_events::group_of |
The group an event type belongs to, if any. |
permissions::h1 |
H1: nobody acts on the owner, except the owner on themself. |
permissions::h2 |
H2: acting on another member requires top(T) < top(A); equal positions block and ADMINISTRATOR does not lift it. The owner passes. |
permissions::h3 |
H3: every changed bit must be held (changed ⊆ held, held being cp or chp). |
permissions::h3_owner_only |
H3 where only the owner is exempt: restriction masks (newcomer_restrictions, a lockdown’s mask), for which permissions.md the protocol says “owner exempt” and the specification i |
permissions::h4 |
H4: a role is manageable only strictly below the actor’s top; the owner is exempt. |
crypto::host_id |
HostId = SHA3-256("zaun/host-id/v1" ‖ 0x00 ‖ host public key). |
command::object::host_pattern_ok |
A DNS name, optionally with one leading *. label: letters, digits and -, at least two labels, ≤ 253 bytes, lower case. |
permissions::invites::invite_create |
invite.create beyond CREATE_INVITE itself (checked by the table in the right scope): the invite_creation rule, default roles the actor could assign, stricter-only admission o |
envelope::is_mutating |
Whether a command type is mutating, hence idempotent and recorded: every command except session.hello, *.get, *.list, message.history, audit.list, member.bans, `membe |
envelope::is_recorded |
Whether response is stored in the idempotency record; see ResponseEnvelope::is_recorded. |
json::is_zero_u32 |
skip_serializing_if for a u32 that is absent when 0 (message flags, the protocol). |
permissions::members::kick_or_ban |
member.kick and member.ban: not self (use community.leave); H1; H2. |
crypto::voice::kid_for |
The KID of a sender’s epoch: the first 3 bytes of SHA3-256("zaun/v1/voice-kid" ‖ session) above the 32-bit epoch. |
command::object::bot_events::known |
Whether name is something a manifest’s events may list. |
command::object::local_address_ok |
A local_network entry: host:port exactly, where host is localhost, an IPv4 literal, a bracketed IPv6 literal or a lowercase DNS name, and port 1-65535 without a leading zero. |
permissions::safety::lockdown_disable |
moderation.lockdown.disable: top(A) ≥ the enabling actor’s recorded top (owner exempt), so a lower moderator cannot lift a higher one’s lockdown, and H3 on the bits the lockdow |
permissions::safety::lockdown_enable |
moderation.lockdown.enable (also renewal and replacement): duration within 60 s – 7 days and H3 on the new lockdown’s mask (only the owner exempt). Enabling while one is active r |
command::max_envelope |
The largest command envelope for type_ in bytes: max_frame for community.create and community.descriptor.publish, else 65 536. |
permissions::roles::member_role_change |
member.roles.update for one role role on target: H1; H2 unless self; H4 on the role; when assigning, role.permissions ⊆ cp (H3). @everyone is never listed. |
command::object::message_json_len |
The bytes of a message’s content and embeds as JSON, counted against MESSAGE_JSON_MAX. |
command::object::message_json_len_with |
message_json_len plus the message’s components, which count against the same MESSAGE_JSON_MAX. |
crypto::message_prime |
M' = Prefix ‖ Label ‖ len(ctx) u8 ‖ ctx ‖ SHA-512(M), or None when ctx exceeds 255 bytes. |
command::object::modal_inputs |
The input components of a modal (everything inside its labels), in order. |
permissions::members::moderate_content |
Deleting another member’s message or removing their reaction: H1 only, no H2. |
client::member::moved |
Checks a community.descriptor_updated event against the client’s stored state and says whether the community moved to another host. chain is the rotation chain the client holds |
envelope::negotiate |
Chooses the highest version in both ranges (session.hello, the protocol). |
client::owner::next_revision |
A copy of current with the next revision and issued_at = now_ms, for the owner to edit and pass to publish_body. |
permissions::members::nickname |
member.update of a nickname: one’s own needs only CHANGE_NICKNAME (table); another’s needs H1 and H2. |
permissions::no_new_unknown |
the protocol: a command may not set an unknown bit that old did not already hold. |
permissions::overrides::override_edit |
One override edit in channel.permissions.update (or channel.create with initial overrides). chp is the actor’s effective permissions in that channel; old/new are `(allow, |
json::u64_decimal::parse |
Parses a canonical decimal. |
command::attachment::parse_caption |
The attachment a caption names, when it is a Zaun caption. |
envelope::parse_command |
Parses a whole or reassembled command envelope text. |
signed::parse_package |
Splits a .zbot file into its parts, checking every limit and that nothing trails. |
client::owner::publish_body |
Signs descriptor with root (its current root key) and builds the community.descriptor.publish body. A given delegation is referenced by the descriptor (epoch and hash) and |
crypto::publisher_id |
PublisherId = SHA3-256("zaun/publisher-id/v1" ‖ 0x00 ‖ publisher key). |
client::member::reauth_body |
The migration.reauth body: a MemberReauth signed with the member’s existing key. Send it with target.community_id as the envelope community_id. |
client::member::redeem_body |
The invite.redeem body: the link’s secret, the member key and its registration (purpose 2) for the link’s community and host. Send it with the link’s community as the envelope `c |
permissions::invites::redeemable_roles |
At redemption, the default roles the issuer could still assign now; the rest are dropped, never granted (permissions the protocol, the protocol). A deleted role is simply absent fr |
client::member::registration |
Signs a MemberKeyRegistration with the member key itself. |
permissions::members::reject |
membership.reject: the target is Pending. |
envelope::replay |
Compares a retried command with the stored record for its key. |
client::member::request_body |
The membership.request body with a purpose-3 registration. Send it with target.community_id as the envelope community_id. |
permissions::required |
The requirement of a command by wire name; None for a name the table does not know (the engine answers UNSUPPORTED_COMMAND). |
client::owner::resign_delegation |
Re-signs an existing delegation under a new root key. The bytes, hence the delegation_hash and epoch, are unchanged. |
permissions::members::restore |
membership.restore: not self; H1; H2; the target is Suspended. |
permissions::roles::role_create |
role.create: H3 on the new role’s bits. Returns the new role’s position; the engine shifts every role at or above it up by one. |
permissions::roles::role_delete |
role.delete: not @everyone; H4. |
permissions::roles::role_reorder |
role.reorder: roles is the community’s role table, moves the request’s (role_id, new_position) pairs. Every role whose position changes must be below the actor before and a |
permissions::roles::role_update |
role.update: H4 on the role, H3 on old XOR new. @everyone may change only its permissions (other_fields is true when the body changes anything else). |
client::owner::rotate_root |
Signs the rotation from the current root old to new: rotation_seq follows the descriptor’s latest rotation, and both keys sign. |
client::owner::rotated_revision |
The next revision after rotation: the new root key and rotations = rotation. Sign it with the new key via publish_body, together with resign_delegation: the delegation is |
b64::bytes::serialize |
Serializes as base64url. |
json::u64_decimal::serialize |
Serializes as a decimal string. |
crypto::sign |
Signs message (the canonical bytes B) with context ctx, hedged: ML-DSA draws 32 fresh bytes from the OS CSPRNG (FIPS 204 Algorithm 2 with the context prefix built here). |
crypto::sign_deterministic |
Deterministic signing (FIPS 204 deterministic variant). Golden test vectors only; real signatures use sign. |
permissions::members::suspend |
membership.suspend: not self; H1; H2; the target is Probation or Active. |
limits::text_within |
Whether text has between min and max Unicode scalar values and at most 4× max bytes. |
permissions::members::timeout |
member.timeout (set or clear): H1; H2; never the owner; never a target holding ADMINISTRATOR; until ≤ now + 28 days. |
encoding::to_bytes |
Encodes a top-level value. |
signed::valid_app_id |
Lowercase reverse-DNS: a-z0-9-+(\.a-z0-9-+)+, 3–64 bytes. |
signed::valid_version |
Semantic Versioning 2.0.0 without build metadata, ≤ 64 bytes. |
signed::valid_world |
zaun:bot/bot@<semver>, ≤ 64 bytes. |
signed::validate_descriptor |
Rule 1 and the descriptor parts of rule 5: chain is the full rotation chain from the genesis key (community.rotations), accepted the verifier’s stored state, if any. |
permissions::safety::validate_newcomer_restrictions |
Validates a new newcomer_restrictions mask: no VIEW_CHANNEL or READ_MESSAGE_HISTORY, no newly set unknown bit. |
permissions::overrides::validate_override |
Validates a new override value against the stored one (old, if any): allow & deny == 0; no known bit outside CHANNEL_SCOPED; no unknown bit that old did not already hold. U |
signed::validate_pair |
Whether a (descriptor, delegation) pair is valid at now_ms. chain is the full rotation chain from the genesis key; accepted is the verifier’s stored state for the community, |
crypto::verify |
Verifies sig over message with context ctx against pk. |
signed::verify_chain |
Verifies a rotation chain from the genesis key: genesis must derive community_id; for rotation i (1-based, list order) sig_old verifies under Kᵢ₋₁ before decoding, th |
signed::verify_package |
Verifies the signature under the header’s publisher key (min_suite 1) before anything else, then both hashes and the manifest’s app_id and version. An all-zero signature is a |
crypto::verify_raw |
RFC 10073 id-MLDSA65-Ed25519-SHA512 verification over raw components (no suite byte): pk = mldsaPK ‖ edPK (1 984 B), sig = mldsaSig ‖ edSig (3 373 B), any ctx ≤ 255 B. Both |
command::object::bot_events::wants |
Whether a bot subscribed to events (and holding caps) gets events of kind. |
permissions::with_dependants |
Every bit that dependencies would also drop once mask is removed: used to attribute a lost dependant to the restriction that removed its prerequisite. |
signed::write_package |
Writes a .zbot file from a signed header and its parts. The caller computed the header’s hashes from these exact manifest and component bytes. |
signed::write_unsigned_package |
Writes an unsigned development .zbot file (all-zero signature, the protocol). |
Structs
Section titled “Structs”| Item | Summary |
|---|---|
signed::AcceptedState |
What a verifier stores per community for anti-rollback (rule 5). |
command::sync::Ack |
sync.ack: the highest contiguous sequence applied per stream. Not idempotency-recorded; lower values are ignored by the host. |
command::object::ActionRow |
Type 1. |
permissions::ActiveLockdown |
The lockdown currently in force, as lockdown management sees it. |
command::object::Activity |
An activity. |
command::object::Admission |
How a member was admitted. |
command::object::AdmissionOverrides |
invite.create.admission_overrides: stricter-only admission settings. |
command::object::AdmissionPolicy |
The full admission policy. Visible to MANAGE_SAFETY holders. |
signed::AdmissionSummary |
AdmissionSummary = mode u8 ‖ level u8: the owner’s public claim; the host’s policy is authoritative for enforcement. |
command::invite::Admitted |
invite.redeem and membership.request response. |
command::object::ApplicationCommand |
An application command. |
command::membership::Approve |
membership.approve. |
command::object::Attachment |
An attachment record: what a message carries, and what attachment.download and attachment.updated answer. |
ids::AttachmentId |
An attachment. |
command::object::AuditChange |
changes: {field, old, new}. SPEC: value types are never given; raw JSON. |
command::object::AuditEntry |
An audit entry. |
ids::AuditId |
An audit-log entry. |
command::object::AuditTarget |
target: {t, c} of an audit entry. |
b64::B64Error |
The input is not canonical base64url without padding. |
command::object::Ban |
One entry of member.bans. |
ids::BanId |
A ban record. |
command::member::BanMember |
member.ban. |
command::member::Banned |
member.ban response. |
command::member::BanPage |
member.bans response. |
command::member::Bans |
member.bans. |
command::object::Binding |
session.welcome.binding. |
envelope::BodyHash |
SHA3-256 of a command’s body JSON text exactly as received: reformatting the same JSON gives a different hash, which is why retries must resend byte-identical bodies. |
command::object::BotCard |
The public description of an installed bot, visible to every member. |
ids::BotId |
An installed bot. |
signed::BotPackage |
The signed header of a bot package, signed by the publisher key inside it. |
event::BotRemoved |
bot.removed: {bot_id, member_id}. |
command::bot::Bots |
bot.list response. |
command::object::Button |
Type 2. |
command::object::Capabilities |
What a bot may do beyond its permission bits. Every field defaults to “no”. |
signed::ChainHead |
Every root key of a verified chain, K₀ (genesis) to Kₙ (current). Only super::verify_chain creates one. |
ids::Challenge |
A host-issued challenge that a signed proof must echo. |
permissions::Channel |
The channel context of a channel-level resolution. |
command::object::Channel |
A channel or category as members see it. |
command::object::ChannelAfter |
{channel_id, after} (sync.resume, the protocol). |
event::ChannelCreated |
channel.created: the channel object plus reason?: "access_gained". |
command::object::ChannelCursor |
{channel_id, seq} (sync.ack, the protocol). |
event::ChannelDeleted |
channel.deleted: {channel_id, reason?: "access_lost"}. |
command::sync::ChannelEvents |
One channel of sync.resume.channels. |
command::object::ChannelFloor |
{channel_id, floor} (sync.resume.floors, the protocol). |
command::object::ChannelHead |
{channel_id, head_seq, floor} (sync.resume.new, the protocol). |
ids::ChannelId |
A channel or category. |
command::object::ChannelPosition |
One entry of channel.reorder and channel.reordered. |
command::dm::Channels |
dm.list response: the actor’s open DMs. |
event::ChannelsReordered |
channel.reordered: positions (only channels the member can see). |
command::object::Checkbox |
Type 23. Never required; use a one-option checkbox group for that. |
command::object::CheckboxGroup |
Type 22. |
command::object::Choice |
A predefined choice of an option, or an autocomplete result. |
command::dm::Close |
dm.close: hides the DM for the actor. |
envelope::CommandEnvelope |
{ "v", "type", "request_id", "community_id", "channel_id"?, "body" }. |
ids::CommandId |
An application command of a bot. |
command::object::CommandOption |
An option of a command or subcommand. |
command::app::Commands |
Response of both: commands with ids (and bot_id in command.list). |
event::CommandsUpdated |
command.updated: one bot’s whole command list ([] while disabled or removed). |
signed::CommunityDescriptor |
The community’s public, owner-signed statement. Signed by the current root key. |
ids::CommunityId |
SHA3-256("zaun/community-id/v1" ‖ 0x00 ‖ genesis root public key). |
command::object::CommunityProfile |
The host-managed community profile. |
command::sync::CommunitySnapshot |
The single item of part: "community". |
command::object::ConfigKey |
One setting a bot declares in its manifest’s config table; the owner sets its value. |
command::bot::Configure |
bot.configure: the owner sets or clears values of the settings the bot’s manifest declares. With neither, it only reads them. |
command::bot::Configured |
bot.configure response: the values the owner set, secrets shown as "••••". |
command::object::Container |
Type 17. |
permissions::Context |
Community-wide inputs shared by every resolution in one request. |
command::channel::Create |
channel.create. |
command::community::Create |
community.create. The envelope’s community_id names the target. |
command::interaction::Create |
interaction.create. |
command::invite::Create |
invite.create. |
command::report::Create |
report.create. |
command::role::Create |
role.create. |
command::community::Created |
community.create response. |
command::interaction::Created |
interaction.create response. |
command::invite::Created |
invite.create response. link embeds the secret and is shown once. |
command::report::Created |
report.create response. |
client::Cursor |
One stream’s position: the highest contiguous sequence applied, and events held aside. |
command::object::Cursors |
The cursors a binding command returns (community.create, invite.redeem, membership.request). |
client::CursorTable |
The member cursor and one cursor per channel. |
command::object::DefaultValue |
A preselected entity of a user, role, mentionable or channel select. |
signed::DelegationRef |
DelegationRef = epoch u64 ‖ delegation_hash bytes32, where delegation_hash is SHA3-256 of the delegation’s canonical bytes (not its signature). |
command::channel::Delete |
channel.delete. |
command::message::Delete |
message.delete. |
command::role::Delete |
role.delete. |
permissions::Denial |
A failed permission or hierarchy check. |
client::owner::DescriptorContent |
The owner-editable, public fields of a descriptor. |
ids::DescriptorHash |
SHA3-256 of a signed descriptor’s bytes. The descriptor names its delegation’s hash, so this identifies the descriptor/delegation pair. |
command::community::DescriptorPublish |
community.descriptor.publish. Owner only; larger envelope limit. |
event::DescriptorUpdated |
community.descriptor_updated: signed descriptor and delegation. |
command::bot::Disable |
bot.disable. |
command::lockdown::Disable |
moderation.lockdown.disable ({}). |
event::DmClosed |
dm.closed: to the closer’s own stream. |
command::attachment::Download |
attachment.download: asks the host to send an attachment’s file. |
command::message::Edit |
message.edit. Author only. |
command::object::Embed |
An embed. Every text is optional, but an embed shows something: a title, a description, an author, a footer, a picture or a field (color, timestamp and url alone do not count |
command::object::EmbedAuthor |
author: {name, url?, icon?} of an embed. |
command::object::EmbedField |
fields: {name, value, inline} of an embed. |
command::object::EmbedFooter |
footer: {text, icon?} of an embed. |
command::object::Empty |
An empty body or response, {}. Unknown fields are ignored. |
command::bot::Enable |
bot.enable (distinct type so the command table can name it). |
command::lockdown::Enable |
moderation.lockdown.enable; responds with the full Lockdown. |
framing::EncodedFrame |
The transport messages of one frame, in sending order. |
command::object::EntitySelect |
Types 5–8. |
envelope::ErrorBody |
An error object: code, message, and the code’s extra fields placed next to code. Build it with the constructors (one per ErrorCode, see errors.rs); they use fixed message |
envelope::ErrorExtras |
The extra fields of the protocol Each applies to the codes named on it. |
envelope::EventEnvelope |
{ "v", "type", "community_id", "channel_id"?, "stream", "sequence"?, "timestamp", "actor_id", "body" }. Deserialisation validates with EventEnvelope::validate. |
command::sync::Events |
sync.events. |
envelope::EventsBatch |
A validated events batch. Its events are processed in order, exactly as individual events; the batch itself has no stream, sequence or timestamp. |
command::sync::EventsPage |
sync.events response, also the member part of sync.resume. |
command::object::Evidence |
One evidence item. |
signed::ExportManifest |
Signed by the exporting host’s key (and, in a later version, the root key when the owner exports). The key is inside the bytes: an importer trusts it only once it matches a host de |
command::object::FileComponent |
Type 13. |
command::object::FileUpload |
Type 19. |
command::interaction::Followup |
interaction.followup and interaction.original.edit. |
framing::FragId |
A fragment id: 8 random bytes, unique per sender per connection among open reassemblies. |
framing::Fragment |
One fragment message, borrowing its chunk from the received text. |
crypto::voice::FrameOpener |
Opens one sender’s frames for one KID, rejecting replays. |
crypto::voice::FrameSealer |
Seals this participant’s frames under one base key and KID. The counter starts at zero and never repeats; after FRAMES_PER_KEY frames it refuses and the sender rekeys. |
client::Gap |
A detected gap in a sequenced stream. |
client::owner::Genesis |
A signed genesis descriptor (revision 1) and the delegation it references (epoch 1). |
command::community::Get |
community.get ({}). |
command::lockdown::Get |
moderation.lockdown.get ({}). |
command::member::Get |
member.get. |
command::report::Get |
report.get. |
command::lockdown::GetResponse |
moderation.lockdown.get response: { "lockdown": object | null }, the full form for MANAGE_SAFETY holders, otherwise the public form; null when none is active. |
command::bot::Grant |
bot.grant: the new effective grants, replacing the old. |
command::bot::GrantChoice |
Optional grant choices of bot.install: absent means everything the manifest asks for, within the operator’s ceiling. |
command::object::Grants |
A bot’s grants: permission bits (its managed role) and capabilities. |
crypto::voice::GroupKeys |
A participant’s key state for one voice session. |
crypto::voice::Header |
An SFrame header (RFC 9605 the protocol). |
command::session::Hello |
session.hello. |
command::message::History |
message.history. |
command::message::HistoryPage |
message.history response. |
command::session::HostAttachments |
session.welcome.attachments. |
signed::HostDelegation |
The root key’s authorisation of one host to operate the community. |
ids::HostId |
SHA3-256("zaun/host-id/v1" ‖ 0x00 ‖ host public key). |
client::owner::HostInfo |
What an owner needs about a host to delegate to it. |
signed::HostSessionProof |
The host’s proof of key possession in session.welcome. Signed by the host key. |
command::object::IceServer |
One ICE server, in the shape of WebRTC’s RTCIceServer. |
command::community::Icon |
community.icon.get response; the client checks SHA3-256(icon) against the descriptor. |
command::community::IconGet |
community.icon.get ({}). |
command::community::Info |
community.get response. |
command::bot::Install |
bot.install. |
command::object::Interaction |
An interaction as delivered to its bot (interaction.created). |
event::InteractionAutocomplete |
interaction.autocomplete: suggestions, to the invoker only. |
event::InteractionFailed |
interaction.failed, to the invoker only. |
ids::InteractionId |
An interaction: one use of a command, component or modal. |
event::InteractionMessage |
interaction.message: an ephemeral message, to the invoker only. |
command::object::InteractionMetadata |
interaction_metadata of a message that answers an interaction. |
event::InteractionModal |
interaction.modal: open a modal, to the invoker only. |
ids::InviteId |
An invitation (public handle; the secret is InviteSecret). |
command::object::InviteLink |
A zaun://join/… link. It embeds the crate::ids::InviteSecret, so Debug is redacted; the text is reachable only through InviteLink::expose. |
client::member::InvitePayload |
The canonical InvitePayload. Unsigned: after connecting, the welcome must show a descriptor deriving community_id, a delegation naming host_id, and a host proof — which `Invi |
permissions::invites::InviteRequest |
The parts of an invite.create body the checks need. |
ids::InviteSecret |
An invitation secret: 32 random bytes, shown once. Never logged: Debug is redacted and it has no Display. Zeroized on drop. |
command::object::InviteSummary |
One entry of invite.list. Never carries the secret. |
command::object::InviteUse |
One entry of invite.uses. |
command::voice::Join |
voice.join: enter a voice channel (leaving any other one). |
command::voice::Joined |
The voice.join response. |
command::object::JoinRate |
join_rate: {per_hour}. |
command::voice::KeyFor |
One entry of voice.keys. |
crypto::voice::KeyPackage |
A participant’s voice key for one session in one voice channel. |
command::voice::Keys |
voice.keys: the sender’s media key for epoch, wrapped for each other participant. A whole mesh always fits in one command, so an epoch is never split. |
command::member::Kick |
member.kick. |
command::object::Label |
Type 18. |
command::community::Leave |
community.leave ({}). The owner cannot leave (engine: CONFLICT). |
command::voice::Leave |
voice.leave: leave the voice channel the member is in. |
command::app::List |
command.list. |
command::audit::List |
audit.list. |
command::bot::List |
bot.list. |
command::dm::List |
dm.list. |
command::invite::List |
invite.list. |
command::member::List |
member.list. |
command::presence::List |
presence.list: the presences of the community’s connected, visible members. |
command::report::List |
report.list. |
permissions::Lockdown |
The community’s lockdown row. |
command::object::Lockdown |
The full lockdown record, for MANAGE_SAFETY holders: { lockdown_id, restrictions, forced_slowmode_s?, newcomer_window_s?, expires_at, reason?, actor_id }. |
ids::LockdownId |
An emergency lockdown. |
command::object::LockdownPublic |
The public form, for members without MANAGE_SAFETY: {active, restrictions_affecting_you, expires_at}. With no active lockdown (disabled or expired) it is `{active: false, restr |
permissions::LockdownRestrictions |
The restrictions a lockdown names. |
command::object::Manifest |
The manifest inside a bot package. |
signed::ManifestEntry |
One chunk: what it is, its length and its SHA3-256. |
command::object::ManifestLimits |
Resource limits a manifest asks for; the host may lower them. |
command::object::MediaGallery |
Type 12. |
command::object::MediaItem |
One picture of a media gallery. |
command::object::Member |
A member as visible to the viewer. Optional fields depend on the viewer’s permissions; the host filters them. |
ids::MemberId |
A community-scoped member identity, host-assigned. |
signed::MemberKeyRegistration |
Proves that the client holds the private key of the member key it registers. Signed by that key. |
event::MemberLeft |
member.left: {member_id}. |
signed::MemberReauth |
Signed by the member key. Binds the challenge to the community, the new host and the delegation epoch it operates under, so a proof made for one host or epoch is useless at another |
event::MemberRemoved |
member.removed: {reason}, to the subject only; then the session ends. |
event::MemberRolesUpdated |
member.roles_updated: {member_id, role_ids}. |
event::MembershipUpdated |
membership.updated: {member_id, state, until?}. |
event::MemberTimedOut |
member.timed_out: {member_id, until}. |
command::object::Mentions |
mentions: {everyone, members, roles}. |
command::object::Message |
A stored message as returned by message.history. |
command::object::MessageBody |
Content, embeds, components, attachments, mentions and flags of a bot’s message. |
event::MessageCreated |
message.created. |
event::MessageDeleted |
message.deleted: {message_id}. |
ids::MessageId |
A message. |
event::MessagesBulkDeleted |
messages.bulk_deleted: {message_ids} (≤ 1 000). |
event::MessageUpdated |
message.updated: {message_id, content, embeds?, components?, flags?, mentions?, edited_at}. |
command::voice::Moderate |
voice.moderate: server mute or deafen, move or disconnect another member. |
client::member::Moved |
A verified move: the new pair (store its state) and how to reach the new host. |
command::object::NewProfile |
profile: {display_name} of a joining or creating member. |
ids::Nonce |
A single-use value in signed objects. |
command::object::Opaque |
Opaque bytes, base64url on the wire (key packages, wrapped keys, signalling data). |
command::dm::Open |
dm.open: the DM with member_id, created when there is none (idempotent per pair). |
command::object::OptionValue |
One option of an invoked command. |
command::interaction::OriginalDelete |
interaction.original.delete. |
command::interaction::OriginalEdit |
interaction.original.edit: absent fields stay unchanged. |
permissions::Override |
A permission override on one channel or category (permissions the protocol). |
command::object::Override |
A permission override on a channel or category (permissions the protocol). |
crypto::voice::PackageExpectation |
What a receiver expects of a peer’s key package. |
command::audit::Page |
audit.list response. |
command::invite::Page |
invite.list response. |
command::member::Page |
member.list response. |
command::report::Page |
report.list response: reports, next?. |
command::sync::PageCursor |
A snapshot page cursor: a 16-byte role or channel id. |
signed::ParsedPackage |
The parts of a .zbot file, not yet verified. |
permissions::Party |
An actor or target member as the hierarchy sees it. Build it with Resolver::party. |
command::membership::Pending |
membership.pending. |
command::membership::PendingPage |
membership.pending response. |
bits::Permissions |
A permission set. JSON: a canonical decimal string. SQLite: i64 by bit-cast. |
command::channel::PermissionsUpdate |
channel.permissions.update. |
command::membership::PolicyGet |
admission.policy.get ({}). |
command::membership::PolicyResponse |
admission.policy.get response: policy (full, MANAGE_SAFETY) or summary. |
command::object::PolicySummary |
The public summary: {level, requires_approval, invite_creation, open}. Hosts MUST send open. |
command::membership::PolicyUpdate |
admission.policy.update: any policy field. Every field is non-nullable. |
command::membership::PolicyUpdated |
admission.policy.update response. |
command::signal::Presence |
signal.presence: { status?, activity?, viewing? }, at least one of status and viewing. |
command::presence::Presences |
presence.list response: one entry per member not offline (members missing from the list are offline). |
event::PresenceSignal |
signal.presence live event. |
command::community::ProfileResponse |
community.update response. |
keys::PublicKey |
A composite public key, 1 985 bytes. |
command::community::Published |
community.descriptor.publish response. |
ids::PublisherId |
SHA3-256("zaun/publisher-id/v1" ‖ 0x00 ‖ publisher public key). |
command::object::RadioGroup |
Type 21. |
command::message::ReactionAdd |
reaction.add. |
event::ReactionChanged |
reaction.added and reaction.removed: {message_id, emoji, member_id}. |
command::object::ReactionCount |
reactions: {emoji, count, me}. |
command::message::ReactionRemove |
reaction.remove. |
encoding::Reader |
Reads canonical encodings from a byte slice. Lengths and counts are checked against the field’s limit and the remaining input before anything is allocated. |
framing::Reassembler |
Per-connection reassembly state machine. |
command::migration::Reauth |
migration.reauth: on an unbound connection to the host that took the community over, a member proves its existing member key and the connection binds to the same MemberId. Resp |
signed::ReauthExpectation |
What the host expects of a reauthentication: the envelope’s community, this host, the epoch it operates under and the connection’s current challenge. |
client::member::ReauthTarget |
Where a member re-authenticates: the community, the new host, the delegation epoch its verified welcome proved, and that welcome’s challenge. |
client::ReceivedEvent |
A received event: the envelope (sequence, timestamp, actor) and its decoded body. |
crypto::voice::RecipientEntry |
One recipient of a sender’s epoch key. |
command::invite::Redeem |
invite.redeem. Unbound; the envelope’s community_id names the target. |
command::bot::Register |
bot.register: mark an existing member as an external bot. |
signed::RegistrationExpectation |
What the host expects of a registration: the command’s fields and the connection’s current challenge. |
client::member::RegistrationTarget |
Where a registration is made: the community, the host and the welcome’s challenge. |
command::membership::Reject |
membership.reject. |
envelope::Rejection |
A command the host rejects before dispatch; send Rejection::into_response back. |
crypto::voice::Rekey |
What a rekey sends: one signed sender-keys message for everyone and one wrapped key each. |
crypto::voice::RekeyTarget |
One recipient’s share of a Rekey. |
command::bot::Remove |
bot.remove. |
command::channel::Reorder |
channel.reorder. |
command::role::Reorder |
role.reorder. |
command::interaction::Replied |
interaction.respond and interaction.followup response. |
command::object::Report |
A report. Only for MANAGE_REPORTS holders and, without other reporters’ data, the reporter. |
ids::ReportId |
A member report. |
command::membership::Request |
membership.request. Unbound; responds with super::invite::Admitted. The target community is the envelope’s community_id, as for invite.redeem. |
ids::RequestId |
Correlates a command with its response; client-assigned. |
permissions::Requirement |
What a command requires (permissions the protocol, the protocol). |
command::object::Resolution |
resolution: {outcome, note?, actor_id, at}. |
command::report::Resolve |
report.resolve: note? is ≤ 512 scalars. |
permissions::Resolved |
One resolved permission set (cp or chp). |
command::object::Resolved |
Objects an interaction refers to, resolved by the host. |
permissions::Resolver |
Per-member state computed once; then Resolver::community and Resolver::channel are cheap enough to call for every channel of a snapshot. |
command::interaction::Respond |
interaction.respond. |
client::Response |
A final response. Debug hides the body, which may embed a secret (an invitation link). |
envelope::ResponseEnvelope |
{ "v", "type": "response", "request_id", "ok", "body" | "error" }. |
command::membership::Restore |
membership.restore. |
command::sync::Resume |
sync.resume. |
command::sync::Resumed |
sync.resume response. |
command::object::Resync |
{stream, channel_id?} of sync.resume.resync and RESYNC_REQUIRED. |
command::object::Retention |
Message retention of a channel. |
client::RetryPolicy |
Exponential backoff: initial_ms, then ×factor, capped at cap_ms; give up once give_up_ms have passed since the first send. |
command::report::Review |
report.review: open → reviewing. |
command::invite::Revoke |
invite.revoke. |
ids::RngError |
The operating system’s CSPRNG failed. |
permissions::Role |
A role as the resolver sees it (permissions the protocol). |
command::object::Role |
A role. Visible to every member. |
event::RoleDeleted |
role.deleted: {role_id}. |
ids::RoleId |
A role. RoleId::EVERYONE is the reserved all-zero id. |
command::object::RolePosition |
One entry of role.reorder and role.reordered. |
event::RolesReordered |
role.reordered: positions. SPEC: the role.reorder entry is reused. |
command::member::RolesUpdate |
member.roles.update. |
signed::RootRotation |
The replacement of the community’s root key, signed by the old and the new key. |
command::community::RotationPage |
community.rotations response. |
command::community::Rotations |
community.rotations. |
signed::Scopes |
Delegation scopes (field 6). Unknown bits are kept for re-encoding, are ignored and grant nothing. |
crypto::SecretKey |
A suite-1 composite private key: mldsaSeed (FIPS 204 ξ, 32 B) ‖ edSK (32 B). |
command::object::Section |
Type 9. |
command::object::SelectOption |
One option of a string select, radio group or checkbox group. |
command::message::Send |
message.send. |
crypto::voice::SenderKey |
An SFrame base key (32 bytes). Zeroized on drop, never printed, never on the wire unwrapped. |
crypto::voice::SenderKeys |
The signed statement of one sender’s epoch (see the module table). |
crypto::voice::SenderKeysExpectation |
What a recipient expects of a sender-keys message. |
command::message::Sent |
message.send response. |
command::object::Separator |
Type 14. |
command::message::Sequenced |
message.edit and message.delete response: the event’s channel_seq. |
client::Session |
A sans-IO client session. See the module documentation. |
client::SessionConfig |
Everything a super::Session needs besides the transport. |
command::app::Set |
command.set: a bot replaces its whole command list. |
command::dm::Settings |
The member’s settings (member.settings.get / .update response). |
command::dm::SettingsGet |
member.settings.get. |
command::dm::SettingsUpdate |
member.settings.update: absent fields stay. |
crypto::Sha3Hasher |
An incremental content_hash, for attachment files read in pieces. |
command::voice::Signal |
voice.signal: WebRTC signalling for one other participant of the same channel. |
keys::Signature |
A composite signature, 3 374 bytes. |
signed::Signed |
A signed object whose signature has been made or verified, with its exact bytes. |
json::SignedJson |
A signed object as it travels in JSON: the canonical bytes B and the composite signature, both base64url. Receivers verify sig over bytes with the context of the object type |
crypto::voice::SignedKeyPackage |
A key package whose signature was made here or verified. |
signed::SignedRootRotation |
A rotation with both signatures, unverified (verify with super::verify_chain). |
command::object::SignedRotation |
A SignedRootRotation in JSON: {bytes, sig_old, sig_new}, all base64url. Kept undecoded, like crate::json::SignedJson; the signed module verifies it. |
crypto::voice::SignedSenderKeys |
A sender-keys message whose signature was made here or verified. |
command::sync::Snapshot |
sync.snapshot. |
command::sync::SnapshotPage |
sync.snapshot response. |
command::presence::StatusSet |
member.status.set: replaces the actor’s custom status. A body with neither text nor emoji clears it. |
permissions::Steps |
The masks each step 7 restriction removed, in application order. |
command::object::StringSelect |
Type 3. |
permissions::Subject |
The member whose permissions are resolved. |
command::object::SubmittedInput |
One submitted modal input. |
command::membership::Suspend |
membership.suspend. until is absolute; the 90-day bound is checked by Command::validate_at. |
command::bot::Target |
bot.enable, bot.disable, bot.get. |
command::object::TextDisplay |
Type 10. |
command::object::TextInput |
Type 4. |
command::object::Thumbnail |
Type 11. |
command::member::Timeout |
member.timeout. until is absolute; the 28-day bound needs the host clock, so it is checked by Command::validate_at. |
command::signal::Typing |
signal.typing { channel_id }. |
event::TypingSignal |
signal.typing live event: {channel_id, member_ids} in a named channel, {channel_id, count} in an anonymous one (who is typing is never sent there). |
command::member::Unban |
member.unban. |
command::bot::Update |
bot.update. |
command::channel::Update |
channel.update: any of the fields; null clears only topic and parent_id. |
command::community::Update |
community.update: host-managed profile fields only. |
command::member::Update |
member.update: a display-name change. |
command::role::Update |
role.update: any of the role.create fields. |
command::voice::Update |
voice.update: the member’s own mute and deafen. |
command::attachment::Upload |
attachment.upload: declares a file the member is about to send. |
command::attachment::Uploading |
attachment.upload response. |
command::invite::UsePage |
invite.uses response. |
command::invite::Uses |
invite.uses. Page size 1–100. |
signed::ValidDescriptor |
A descriptor that passed rule 1 and the descriptor parts of rule 5. |
signed::ValidPair |
A (descriptor, delegation) pair valid at the time it was checked, with the state to store. Only validate_pair creates one. |
signed::VerifiedPackage |
A package whose signature (unless unsigned was allowed), hashes and manifest ids were checked. |
client::VerifiedWelcome |
A welcome that passed every check. Everything in it comes from verified signed objects or was compared with them. |
envelope::VersionRange |
An inclusive protocol version range (session.hello.versions, UNSUPPORTED_VERSION). |
command::session::Versions |
{min, max} protocol versions. |
crypto::voice::VoiceIdentity |
A voice session’s X-Wing key pair. The secret is the 32-byte X-Wing seed, zeroized on drop and never printed. It lives only as long as the voice session; it is never stored. |
event::VoiceJoined |
voice.joined: a member entered a voice channel. Its key_package is present only for the channel’s other participants. |
event::VoiceKeys |
voice.keys: another participant’s media key for epoch: its signed sender-keys message and the key wrapped for this participant only (never another’s). |
event::VoiceLeft |
voice.left: a member left a voice channel. The member itself receives it too. |
command::object::VoiceParticipant |
One member in a voice channel. |
crypto::voice::VoicePublicKey |
An X-Wing encapsulation key (ML-KEM-768 ‖ X25519, 1 216 bytes), validated on parse. |
ids::VoiceSessionId |
One stay of a member in a voice channel, host-assigned at voice.join. |
crypto::voice::VoiceSessionId |
One participation in a voice channel. A member draws a fresh one on every join, so KIDs and epochs never repeat across joins. |
event::VoiceSignal |
voice.signal: WebRTC signalling from another participant, to this one only. |
event::VoiceUpdated |
voice.updated: a participant’s mute, deafen or can_speak changed. |
command::session::Welcome |
session.welcome. |
crypto::voice::WrapContext |
Who wraps, for which channel and epoch: bound into the HPKE info. |
crypto::voice::WrappedKey |
A base key wrapped to one recipient: X-Wing enc ‖ AES-256-GCM ciphertext ‖ tag. |
encoding::Writer |
Appends canonical encodings to a buffer. Variable fields take their limit and fail above it, mirroring super::Reader. |
Traits
Section titled “Traits”| Item | Summary |
|---|---|
command::Body |
A command body type: its wire name and response body type. |
command::BodyVisitor |
Something done with a command body of a type known only at run time (Command::visit). |
encoding::Decode |
A type with a canonical decoding. |
encoding::Encode |
A type with a canonical encoding (fixed-size or self-limiting). |
signed::SignedObject |
A signed object type: its canonical encoding (format byte first) and its context. |
command::Validate |
State-free checks of one body. |