Plugin Trait Contracts

🏔️ Plugin Trait Contracts

Objective

Bastion's plugin model is compiled-in Rust crates, not dynamic loading. The
contract is therefore a set of Rust traits in a shared crate (bastion-plugin-api)
plus a host-API struct that plugins call to register themselves at startup.
This Milestone defines those traits and the workspace structure but does not
yet refactor any built-in pane — that's M5. After M4, writing a new plugin
should be a matter of:

  1. Add a new crate to the workspace
  2. Implement the relevant traits
  3. Call register_* in the plugin's init function
  4. Add the plugin to bastion's init list

Success Criteria

  • bastion-plugin-api crate exists in the workspace
  • Five core traits defined with documented contracts:
    • PanelPlugin — owns a Rect, renders into it, handles events when focused
    • ResourceViewer — registers for file extensions, renders selected resources
    • CommandHandler — handler fn signature, context predicate
    • FileAction — surface action on file entries (Op
No due date
0% Completed
#6 opened 2026-05-18 08:27:18 -04:00 by n8k99 0 / 16