feat(plugins): add lightweight plugin system with discovery, registry, and injection#3699
feat(plugins): add lightweight plugin system with discovery, registry, and injection#3699pkeging wants to merge 4 commits into
Conversation
Add plugin manifest parsing, PluginRegistry with enable/disable, and global registry access functions.
Add plugin discovery system that scans built-in and user plugin directories. Includes the rust-toolkit sample plugin with cargo check skill. Built-in plugins are disabled by default.
Add plugin injection into system prompts, MCP server merging, and CLI commands (/plugin list/enable/disable/info). Plugin injection is disabled by default and requires explicit enable.
|
Thanks @pkeging for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
|
Thank you @pkeging - this is a substantial amount of work, and I appreciate the care in trying to make plugins concrete with a manifest, registry, discovery path, and example plugin. I am going to keep this out of the automatic 0.8.66 merge lane for now for two reasons:
The direction is useful, but for reviewability I think the safest path is to split this into smaller PRs: first a non-injecting manifest/discovery/registry slice with tests; then commands/UI; then MCP merging; and only then prompt injection after explicit trust-boundary review. That would make it much easier for us to land the good pieces with proper credit instead of holding the whole feature behind one broad red-check PR. Thanks again for pushing this forward - there is good material here. |
|
Thank you for the detailed and constructive feedback. I agree with the split approach. Closing this PR and will submit smaller, focused PRs per your suggestion. Starting with Stage 1: manifest, discovery, registry, and tests. |
|
Thank you for the constructive feedback @Hmbown. I agree with the split approach — this PR is too broad for safe review. |
Summary
This PR adds a lightweight plugin system to CodeWhale, enabling external skills and MCP servers to be bundled as self-contained plugins discovered from the filesystem.
Architecture
crates/tui/src/plugins/
├── mod.rs — Module entry + global OnceLock<Mutex>
├── manifest.rs — PluginManifest parsing (plugin.toml) + validation
├── registry.rs — PluginRegistry (register/enable/disable/list)
├── discovery.rs — Scan builtin + user plugin directories
├── injection.rs — System prompt injection (render enabled plugin blocks)
└── tests.rs — Integration tests
Features
plugin.toml): name, description, version, skills, MCP servers,[when]conditions (OS filter, required binaries)plugins/) and user (~/.config/codewhale/plugins/) directories/plugin list,/plugin enable <name>,/plugin disable <name>,/plugin info <name>rust-toolkitplugin with arust-checkskillIntegration Points
main.rsinit_registry()at startupmcp.rsmerge_plugin_mcp_servers()merges plugin MCP servicesprompts.rscommands/mod.rs/plugincommand groupNotes
main(v0.8.65) — no dependency downgrades, no test deletions, no unrelated refactoringChecklist
cargo checkpasses.cargo/audit.toml) preserved