malbox_plugin_sdk/plugin.rs
1//! Core plugin traits.
2//!
3//! Every plugin implements [`Plugin`] (health checks). From there, the
4//! two deployment models each have their own trait:
5//!
6//! - [`HostPlugin`] - runs on the daemon host, receives tasks and events
7//! over IPC.
8//! - [`GuestPlugin`] - runs inside an analysis VM, follows a linear
9//! start/execute/stop lifecycle over gRPC.
10
11pub mod guest;
12pub mod host;
13
14pub use guest::{GuestPlugin, LaunchResult, default_launch};
15pub use host::HostPlugin;
16
17use crate::health::HealthStatus;
18
19/// Base trait shared by all Malbox plugins (host and guest).
20///
21/// The only method is [`health_check`](Plugin::health_check), which
22/// defaults to reporting ready. Override it if your plugin needs warm-up
23/// time or depends on an external resource.
24pub trait Plugin: Send + Sync + 'static {
25 /// Return the plugin's current health status. Defaults to ready.
26 fn health_check(&self) -> HealthStatus {
27 HealthStatus::ready()
28 }
29}