Skip to main content

Module version

Module version 

Source
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 a crate::ServerMsg it 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::ArchiveChat and fills crate::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 as global (their origin already says bundled).
CAP_LIBRARY
Cap (17+): the engine answers crate::ClientMsg::ListLibrary with 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::NewUnattachedChat and crate::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 to MAX_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.