Skip to main content

Crate byob_plugins

Crate byob_plugins 

Source
Expand description

Plugins: a folder with a byob-plugin.json that adds any mix of

Typical use by the agent:

  1. [discover] the plugin folders; show errors and each plugin’s problems.
  2. Reserve the built-in tool names in a ToolNames, then add each active plugin’s python_tools and, per mcpServers entry, connector_tools.
  3. Add UseSkillTool over Discovery::skills and put skills_prompt and Discovery::prompt in the system prompt.

Re-exports§

pub use agents::AgentDef;
pub use agents::load_agents_dir;
pub use agents::merge_agents;
pub use agents::parse_agent;
pub use commands::Command;
pub use commands::load_commands_dir;
pub use commands::split_slash;
pub use connectors::Connector;
pub use connectors::ConnectorContent;
pub use connectors::ConnectorDraft;
pub use connectors::ConnectorResult;
pub use connectors::ConnectorTool;
pub use connectors::ConnectorToolAdapter;
pub use connectors::connector_tools;
pub use connectors::connector_tools_from;
pub use connectors::parse_connector;
pub use discover::Discovery;
pub use discover::Plugin;
pub use discover::PluginSources;
pub use discover::discover;
pub use discover::load_plugin;
pub use manifest::MANIFEST;
pub use manifest::Manifest;
pub use manifest::ManifestError;
pub use manifest::McpServerConfig;
pub use manifest::OLD_MANIFEST;
pub use manifest::parse_manifest;
pub use names::ToolNames;
pub use python::PythonTool;
pub use python::default_python;
pub use python::python_tools;
pub use python::python_tools_in;
pub use python::run_script_sandboxed;
pub use python::run_script_unsandboxed;
pub use skills::SaveSkillTool;
pub use skills::Skill;
pub use skills::UseSkillTool;
pub use skills::load_skills_dir;
pub use skills::skills_prompt;

Modules§

agents
Subagent definitions: Markdown files with YAML frontmatter, compatible with Claude Code’s .claude/agents/*.md. The frontmatter has name, description, optional tools (a comma list or a YAML list) and optional model; the body is the subagent’s system prompt. Unknown keys (color, permissionMode, …) are kept in AgentDef::meta and otherwise ignored, so files written for Claude Code load unchanged.
authoring
Helpers for writing plugins from inside byob (the model’s make_tool, edit_plugin, …):
commands
Slash commands: a plugin’s commands/<name>.md, in Claude Code’s format. The file’s body is a prompt template; the user types /<name> some arguments and the model gets the template with $ARGUMENTS (all of them) and $1…$9 (split on whitespace) filled in. Optional frontmatter: description (shown in the / menu) and argument-hint. Other keys (allowed-tools, model) are kept but not used.
connectors
Connectors: MCP servers a plugin declares (or the user pastes), adapted into byob_tools::Tools.
discover
Finding plugins on disk: folders with a byob-plugin.json, their skills/*/SKILL.md, agents/*.md and commands/*.md, and checks that declared scripts exist. Nothing here is fatal: a broken plugin becomes a LoadError and the rest still load.
manifest
byob-plugin.json: the plugin manifest.
mcp
Connector backed by the byob-mcp client: how plugin mcpServers become live tools.
names
Tool names every OpenAI-compatible server accepts: [a-zA-Z0-9_-]{1,64}, unique.
python
A plugin’s declared Python tools (tools[].run): the model’s arguments go to the script as JSON on stdin; what it prints (plain text, or {"text": …, "files": […]}) goes back. Settings arrive as environment variables, plus HOB_CHAT_DIR and HOB_PLUGIN_DIR (and BYOB_* aliases).
skills
Agent Skills (skills/<name>/SKILL.md): frontmatter + Markdown steps, as in hob, Claude and Codex. Only names and one-line descriptions go in the system prompt (skills_prompt); the model loads the full text with the UseSkillTool.

Structs§

LoadError
Something that couldn’t load, for the user (path: the plugin or skill folder).
PluginRef
What a plugin’s tools need to know about it.