Expand description
Native Plugin System for VT Code Skills
This module provides support for loading native code plugins as skills using libloading. Native plugins offer high-performance, pre-compiled skill logic that can be discovered and loaded dynamically at runtime.
§Safety
Loading native code plugins requires careful security considerations:
- Plugins are loaded from canonicalized trusted locations only
- Plugin signatures can be verified (future enhancement)
- Plugin execution is sandboxed where possible
- VT Code serializes plugin FFI calls for ABI v1
- All plugin operations go through VT Code’s tool system
§Plugin Structure
A native plugin skill consists of:
plugin.json- Metadata (name, description, version, author)lib<name>.dylib(macOS) orlib<name>.so(Linux) or<name>.dll(Windows)- Optional:
README.md,scripts/,templates/
§Plugin ABI
Plugins must export the following C-compatible symbols:
vtcode_plugin_version()- Returns ABI versionvtcode_plugin_metadata()- Returns plugin metadata JSONvtcode_plugin_execute()- Main execution entry point
§Example
use vtcode_core::skills::native_plugin::{NativePlugin, PluginLoader};
let mut loader = PluginLoader::new();
let plugin = loader.load_plugin("/path/to/plugin").unwrap();
let result = plugin.execute(&input).unwrap();Structs§
- Native
Plugin - A loaded native plugin
- Plugin
Context - Plugin execution context passed to plugin functions
- Plugin
Loader - Plugin loader responsible for discovering and loading native plugins
- Plugin
Metadata - Plugin metadata structure
- Plugin
MetadataFFI - C-compatible plugin metadata for FFI
- Plugin
Result - Plugin execution result
- Plugin
ResultFFI - C-compatible plugin result for FFI
Constants§
- PLUGIN_
ABI_ VERSION - Current plugin ABI version Increment this when breaking changes are made to the plugin interface
Traits§
- Native
Plugin Trait - Native plugin trait for type-erased plugin operations
Functions§
- validate_
plugin_ structure - Validate a plugin directory structure