Skip to main content

max / goingson

1.6 KB · 51 lines History Blame Raw
1 //! Rhai Plugin Runtime for GoingsOn.
2 //!
3 //! This crate provides a sandboxed plugin execution environment using the Rhai
4 //! scripting language. Plugins can extend GoingsOn with:
5 //!
6 //! - **Import Adapters**: Transform external data formats (CSV, JSON, etc.) into GoingsOn entities
7 //! - **Export Adapters**: Export GoingsOn data to external formats
8 //! - **Custom Commands**: Add new functionality to the app
9 //! - **Lifecycle Hooks**: React to app events (on_task_created, etc.)
10 //!
11 //! # Safety
12 //!
13 //! Plugins run in a sandboxed Rhai engine with configurable limits:
14 //! - Maximum operations (computation time)
15 //! - Maximum call stack depth (recursion)
16 //! - Maximum string/array sizes (memory)
17 //! - Disabled dangerous operations (eval, system access)
18 //!
19 //! # Example
20 //!
21 //! ```rust,ignore
22 //! use goingson_plugin_runtime::{PluginLoader, PluginEngine};
23 //!
24 //! let loader = PluginLoader::new("~/.config/goingson/plugins")?;
25 //! let plugins = loader.discover_plugins()?;
26 //!
27 //! for plugin in plugins {
28 //! println!("Found plugin: {} v{}", plugin.name, plugin.version);
29 //! }
30 //! ```
31
32 mod api;
33 mod engine;
34 mod error;
35 mod loader;
36 mod manifest;
37 mod registry;
38
39 pub use api::PluginApi;
40 pub use engine::{PluginEngine, SafetyLimits};
41 pub use error::{PluginError, Result};
42 pub use loader::PluginLoader;
43 pub use manifest::PluginManifest;
44 pub use registry::PluginRegistry;
45
46 // Re-export core types for convenience
47 pub use goingson_core::{
48 ImportEntityType, ImportExecuteResult, ImportItem, ImportItemData, ImportOptions,
49 ImportParseResult, PluginCapabilities, PluginMeta, PluginType,
50 };
51