mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 14:25:02 +00:00
- Python: class extending NodeExecutor + factory.py (80+ plugins) - TypeScript: class implements NodeExecutor + factory.ts (7 groups, 116 classes) - Go: struct with methods + factory.go (36 plugins) - Rust: struct impl NodeExecutor trait + factory.rs (54 plugins) - Mojo: struct + factory.mojo (11 plugins) All package.json files now include: - files array listing source files - metadata.class/struct field - metadata.entrypoint field This enables a unified plugin loading system across all languages with no import side effects (Spring-style DI pattern). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rust Workflow Plugins
High-performance Rust plugins for MetaBuilder workflow engine.
Plugin Interface
// All plugins implement this signature
pub fn run(runtime: &mut Runtime, inputs: &HashMap<String, Value>) -> PluginResult;
The runtime object provides:
store- Workflow state storage (persists between nodes)context- Shared context (clients, configuration)
Categories
| Category | Plugins | Purpose |
|---|---|---|
| convert | to_string, to_number, to_boolean, to_json, parse_json, to_list, to_object | Type conversion |
| list | concat, length, slice, reverse, first, last, at, contains, index_of, unique | List operations |
| logic | and, or, not, xor, equals, gt, gte, lt, lte, is_in | Boolean logic |
| math | add, subtract, multiply, divide, modulo, power, abs, round | Arithmetic |
| string | concat, split, replace, upper, lower, trim, length, contains, starts_with, ends_with | String manipulation |
| var | get, set, delete, exists, keys, clear | Variable management |
Building
cd workflow/plugins/rust
cargo build --release
Example Usage
In Workflow JSON
{
"version": "2.2.0",
"nodes": [
{
"id": "process-data",
"type": "operation",
"op": "rust.list.unique",
"params": {
"list": [1, 2, 2, 3, 3, 3, 4]
}
}
]
}
Performance
Rust plugins offer:
- 100-1000x faster than Python for CPU-bound operations
- Zero-cost abstractions - no runtime overhead
- Memory safety - guaranteed by compiler
- Native FFI - can be called from any language
Best for:
- High-performance data processing
- Memory-intensive operations
- Bulk transformations (1M+ items)
- Security-critical operations