Expand description
Version negotiation and capabilities.
A client opens with crate::ClientMsg::Hello carrying PROTOCOL_MAJOR,
PROTOCOL_MINOR and its client_caps; the engine answers with
crate::ServerMsg::Welcome (its own version and caps) before anything else.
Compatibility rules:
- Major must match. It is bumped only for changes an older peer can’t survive (a renamed or removed field, a changed meaning). A client with another major gets one error notice and nothing else.
- Minor is informational: everything a minor adds is optional on the wire (serde defaults, skipped when empty) or behind a cap.
- Caps are feature strings. A feature that needs both sides to understand it is used
only when both list its cap (
shared). Unknown caps are ignored. - Enums that grow decode unknown values into a fallback (
#[serde(other)]), and a client skips acrate::ServerMsgit doesn’t know (crate::ServerMsg::Unknown), so additions don’t need a major bump.
Structs§
- Welcome
- The engine’s side of the handshake (
crate::ServerMsg::Welcome).
Constants§
- CAP_
ARCHIVE - Cap (17+): the engine takes
crate::ClientMsg::ArchiveChatand fillscrate::ChatSummary::archived_at. - CAP_
ARTIFACT_ NETWORK - Cap: the engine takes
crate::ClientMsg::SetArtifactNetwork(and the client offers it). - CAP_
BUNDLED_ SCOPE - Cap: the client decodes
crate::PluginScope::Bundled. Clients without it get bundled plugins asglobal(their origin already saysbundled). - CAP_
LIBRARY - Cap (17+): the engine answers
crate::ClientMsg::ListLibrarywith every chat’s artifacts. - CAP_
PLUGIN_ CHANNEL - Cap: the peer handles
crate::ClientMsg::Plugin/crate::ServerMsg::Plugin. - CAP_
PLUGIN_ LOGOS - Cap (17+): plugins say when they have a logo, and the engine serves it
(
crate::ClientMsg::GetPluginLogo). - CAP_
PROJECT_ FOLDERS - Cap: the engine keeps projects’ other folders (
crate::ClientMsg::SetWorkspaceFolders,CreateWorkspace::folders), and the client offers them. - CAP_
REWIND - Cap: the engine takes
crate::ClientMsg::Rewind(and the client offers it). - CAP_
UNATTACHED - Cap: the engine takes
crate::ClientMsg::NewUnattachedChatandcrate::ClientMsg::ChatToProject(and the client offers them). - CAP_
VIEWS - Cap: the peer understands
crate::Views on steps (renders known kinds, shows the fallback of the others). Part of major 13, listed so later view sites can be negotiated the same way. - MAX_
CAPS - Most caps one side may list.
- MAX_
CAP_ CHARS - Longest cap.
- MAX_
PLUGIN_ MSG_ BYTES - Largest plugin channel message (its JSON).
- PROTOCOL_
MAJOR - Bumped on a change an older peer can’t survive (see the module docs).
- PROTOCOL_
MINOR - Bumped on additive changes; peers with the same major but another minor still talk.
Functions§
- cap_ok
- A cap is ASCII lowercase letters, digits,
_,.,-(e.g.plugin_channel,view.byob.plugin_card). - check_
caps - Check a peer’s caps list.
- check_
plugin_ msg - A plugin channel message (
crate::ClientMsg::Plugin/crate::ServerMsg::Plugin): plugin ids are plugin ids ([a-z0-9-]), the message any JSON up toMAX_PLUGIN_MSG_BYTES. - client_
caps - The caps this build’s clients announce.
- engine_
caps - The caps this build’s engine announces.
- shared
- Both sides list
cap.