Skip to main content

Module plugins

Module plugins 

Source
Expand description

Plugins as clients see them: what a chat can use, where each plugin comes from, whether it is on, which settings it still needs, and what went wrong loading it.

A plugin is a folder with a byob-plugin.json (tools, skills, subagents, MCP servers, settings). It lives in one of three scopes; the same id resolves chat > workspace > global, and the less specific copy is listed with PluginInfo::shadowed_by:

  • chat (scratch): <data>/chats/<chat>/plugins/<id>; what the model made in this chat with make_tool and friends. Never asked about; gone with the chat.
  • workspace: <workspace>/.byob/plugins/<id>, committed with the repo.
  • global: <config>/plugins/<id> (plus settings.json plugin_dirs and --plugin).

The engine sends ServerMsg::Extensions for the chat a client looks at after ServerMsg::ChatOpened, and again whenever something changes (a reload, a switch, a setting, a server connecting). Setting values never leave the engine: clients only learn whether each one is set.

Extensions::slash lists what a message may start with (/name args): the engine expands it when the turn starts (see SlashKind).

Structs§

Extensions
Every plugin the chat in view can see (also the new chat a client is about to start).
PluginCard
A “plugin card” on a step that changed a plugin (crate::Step::plugin).
PluginInfo
One plugin a chat can see.
PluginLoadError
A plugin folder that couldn’t load at all (bad manifest, duplicate id).
PluginSetting
A value a plugin asks the user for (an API key, a folder). The value itself never reaches clients.
PluginTest
The result of running a tool once with test arguments (make_tool’s try_args).
ServerInfo
One of a plugin’s MCP servers.
SlashItem
One entry of the / menu.

Enums§

PluginAction
What a step did to a plugin.
PluginOrigin
Who wrote a plugin.
PluginScope
Where a plugin lives (see the module docs).
ServerState
The state of one of a plugin’s MCP servers.
SlashKind
What a /name at the start of a message is.

Constants§

MAX_SETTING_VALUE_CHARS
Most characters of a plugin setting’s value.
MAX_TRUSTED_AT_ONCE
Most plugins one crate::ClientMsg::TrustPlugins may name.