Expand description
Foundation for Bamboo’s local plugin system.
A plugin is a locally-installed bundle that can provide any of:
skills, MCP servers, prompt presets, workflows, supervised services, and
declarative ToolEvent sinks. It is
installed to ~/.bamboo/plugins/<id>/ (see
bamboo_config::paths::plugin_dir), keeping the plugin’s own files
together (manifest, skills, prompts, workflows, optional per-platform
binaries), then REGISTERED into Bamboo’s existing capability locations:
| Capability | Registered into | Discovery model |
|---|---|---|
| MCP servers | config.json (Config.mcp) + mcp_manager.start_server | copied into shared config |
| Skills | N/A — discovered in place | ~/.bamboo/plugins/*/skills is an additional SkillDiscoveryDir (see bamboo-skills) |
| Prompt presets | prompt-presets.json | copied into shared store |
| Legacy workflows | N/A — discovered in place | ~/.bamboo/plugins/*/workflows/*.md is a read-only Skill adapter source |
| Services | ServiceManager | supervised process owned by exact plugin provenance |
| Event sinks | installed.json + pure reconciliation plan | bamboo-server activates the plan through its AppState-owned ToolEventRouter |
This crate defines the shared skeleton three things build on:
manifest::PluginManifest— theplugin.jsonschema, with validation and the${plugin_dir}/${platform_bin}token-substitution contract for MCP stdio commands (see themanifestmodule docs for the full contract).registry::InstalledPlugins— the~/.bamboo/plugins/installed.jsonprovenance registry (load/save/add/remove), recording exactly what each plugin registered so uninstall/upgrade is precise.installer::PluginInstaller— the trait later agents implement to actually wire capability registration (that wiring needsAppState, which thisinfra-layer crate intentionally does not depend on).
See the repo-root PLUGIN_PLAN.md (temporary, deleted before final merge)
for how the remaining work is split across parallel agents, and
examples/hello-plugin/ for a minimal end-to-end reference plugin
(one skill + one prompt preset, no binary, no MCP server).
Re-exports§
pub use error::PluginError;pub use error::PluginResult;pub use installer::load_previous_for_disposition;pub use installer::on_disk_skill_dirs;pub use installer::preflight_install;pub use installer::InstallDisposition;pub use installer::LocalPluginInstaller;pub use installer::PluginInstaller;pub use manifest::platform_bin_path;pub use manifest::EventSinkCapabilityState;pub use manifest::EventSinkDeliveryLimits;pub use manifest::EventSinkInactiveReason;pub use manifest::EventSinkManifestEntry;pub use manifest::EventSinkProtocolManifest;pub use manifest::EventSinkSubscriptionManifest;pub use manifest::GracefulShutdown;pub use manifest::HealthCheckKind;pub use manifest::HealthCheckSpec;pub use manifest::McpServerManifestEntry;pub use manifest::McpTransportManifest;pub use manifest::ObservationPermissionId;pub use manifest::Platform;pub use manifest::PluginArtifact;pub use manifest::PluginManifest;pub use manifest::PluginPromptPreset;pub use manifest::PluginProvides;pub use manifest::ResolvedServiceEntry;pub use manifest::ServiceInputProtocol;pub use manifest::ServiceManifestEntry;pub use manifest::ShutdownSignal;pub use manifest::DEFAULT_EVENT_SINK_QUEUE_CAPACITY;pub use manifest::MAX_EVENT_SINKS_PER_PLUGIN;pub use manifest::MAX_EVENT_SINK_EVENT_BYTES;pub use manifest::MAX_EVENT_SINK_EXTENSION_FIELDS;pub use manifest::MAX_EVENT_SINK_EXTENSION_KEY_BYTES;pub use manifest::MAX_EVENT_SINK_EXTENSION_VALUE_BYTES;pub use manifest::MAX_EVENT_SINK_ID_BYTES;pub use manifest::MAX_EVENT_SINK_MANIFEST_BUFFER_BYTES;pub use manifest::MAX_EVENT_SINK_PERMISSIONS;pub use manifest::MAX_EVENT_SINK_PERMISSION_ID_BYTES;pub use manifest::MAX_EVENT_SINK_QUEUE_CAPACITY;pub use manifest::MAX_EVENT_SINK_SERVICE_ID_BYTES;pub use manifest::MAX_EVENT_SINK_SUBSCRIPTIONS;pub use manifest::MAX_EVENT_SINK_TOOL_NAMES;pub use manifest::OBSERVE_CONTENT_PERMISSION;pub use manifest::OBSERVE_DIFF_PERMISSION;pub use manifest::OBSERVE_METADATA_PERMISSION;pub use manifest::OBSERVE_PATHS_PERMISSION;pub use manifest::OBSERVE_TOOL_NAME_PERMISSION;pub use manifest::PLATFORM_BIN_TOKEN;pub use registry::classify_ownership;pub use registry::reconcile_event_sinks;pub use registry::reconcile_exclusive;pub use registry::reconcile_plugin_boot;pub use registry::EventSinkPermissionGrants;pub use registry::EventSinkReconciliation;pub use registry::EventSinkRemovalOrder;pub use registry::ExclusiveReconciliation;pub use registry::InstalledPlugin;pub use registry::InstalledPlugins;pub use registry::Ownership;pub use registry::PluginBootCandidate;pub use registry::PluginBootIssue;pub use registry::PluginBootReconciliation;pub use registry::PluginInstallStatus;pub use registry::PluginSource;pub use registry::ReconciledEventSink;pub use registry::RegisteredCapabilities;
Modules§
- error
- Error type shared by manifest validation, provenance I/O, and the installer trait.
- installer
- The
PluginInstallertrait — the method surface later agents implement. - manifest
plugin.jsonmanifest schema.- registry
- Provenance registry:
~/.bamboo/plugins/installed.json.
Structs§
- Tool
Event Subscription Id - Forward-compatible subscription identifier used by plugin manifests.