Skip to main content

shape_runtime/plugins/
mod.rs

1//! Plugin System for Shape
2//!
3//! Provides dynamic loading of data source and output sink plugins using
4//! the stable C ABI defined in `shape-abi-v1`.
5//!
6//! # Overview
7//!
8//! Plugins are dynamically loaded shared libraries (.so/.dll/.dylib) that
9//! implement the Shape plugin interface. This enables:
10//!
11//! - Runtime extension without recompilation
12//! - Third-party data source integrations
13//! - Custom alert/output sinks
14//!
15//! # Security Note
16//!
17//! Plugin loading executes arbitrary code. Only load plugins from trusted sources.
18
19mod data_source;
20pub mod language_runtime;
21mod loader;
22mod module_capability;
23mod output_sink;
24
25pub use data_source::{
26    ParsedOutputField, ParsedOutputSchema, ParsedQueryParam, ParsedQuerySchema, PluginDataSource,
27};
28pub use language_runtime::{CompiledForeignFunction, PluginLanguageRuntime, RuntimeLspConfig};
29pub use loader::{
30    ClaimedSection, LoadedPlugin, PluginCapability, PluginLoader, parse_sections_manifest,
31};
32pub use module_capability::{
33    ParsedModuleArtifact, ParsedModuleFunction, ParsedModuleSchema, PluginModule,
34};
35pub use output_sink::PluginOutputSink;
36
37// Re-export ABI types for convenience
38pub use shape_abi_v1::{
39    ABI_VERSION, AlertSeverity, CapabilityKind, DataSourceVTable, OutputField, OutputSchema,
40    OutputSinkVTable, ParamType, PluginError, PluginInfo, PluginType, QueryParam, QuerySchema,
41    SectionClaim, SectionsManifest,
42};