Skip to main content

Module plugin

Module plugin 

Source
Expand description

Plugin framework types for the room chat system.

This module defines the traits and types needed to implement a room plugin. External crates can depend on room-protocol alone to implement Plugin — no dependency on room-cli or broker internals is required.

Structs§

CommandContext
Context passed to a plugin’s handle method.
CommandInfo
Describes a single command for /help and autocomplete.
ParamSchema
Schema for a single command parameter — drives validation, /help output, and TUI argument autocomplete.
RoomMetadata
Frozen snapshot of room state for plugin consumption.
UserInfo
A user’s online presence.

Enums§

ParamType
The kind of value a parameter accepts.
PluginResult
What the broker should do after a plugin handles a command.

Constants§

PLUGIN_API_VERSION
Current Plugin API version. Increment when the Plugin trait changes in a way that requires plugin authors to update their code (new required methods, changed signatures, removed defaults).
PROTOCOL_VERSION
The room-protocol crate version, derived from Cargo.toml at compile time. Used by the broker to reject plugins that require a newer protocol than the one currently running.

Traits§

HistoryAccess
Async read-only access to a room’s chat history.
MessageWriter
Async message dispatch for plugins. Abstracts over the broker’s broadcast and persistence machinery so plugins never touch broker internals.
Plugin
A plugin that handles one or more / commands and/or reacts to room lifecycle events.
TeamAccess
Read-only access to daemon-level team membership.

Type Aliases§

BoxFuture
Boxed future type used by Plugin::handle for dyn compatibility.