mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 06:44:58 +00:00
Multi-language workflow plugin system following Python's structure: - Each plugin in its own directory with implementation + package.json - Category-level package.json manifests listing all plugins - Consistent interface: run(runtime, inputs) -> outputs Languages added: - Go: math, string, logic, list, dict, var, convert (25+ plugins) - Rust: math, string, logic, list, convert, var (50+ functions) - C++: header-only math, string, logic, var, convert (30+ plugins) - Mojo: math, string, list with systems programming features Python structure fixed: - Reorganized flat files into plugin subdirectories - Added package.json metadata to all 120+ plugins - Added missing backend category (15 plugins) - Category manifests with plugin lists Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
71 lines
1.7 KiB
Markdown
71 lines
1.7 KiB
Markdown
# Go Workflow Plugins
|
|
|
|
Go plugins for MetaBuilder workflow engine. Follows the same interface pattern as Python plugins.
|
|
|
|
## Plugin Interface
|
|
|
|
```go
|
|
// All plugins implement this signature
|
|
func Run(runtime *plugin.Runtime, inputs map[string]interface{}) (map[string]interface{}, error)
|
|
```
|
|
|
|
The `runtime` object provides:
|
|
- `Store` - Workflow state storage (persists between nodes)
|
|
- `Context` - Shared context (clients, configuration)
|
|
- `Logger` - Logging interface
|
|
|
|
## Categories
|
|
|
|
| Category | Plugins | Purpose |
|
|
|----------|---------|---------|
|
|
| convert | to_string, to_number, to_boolean, to_json, parse_json | Type conversion |
|
|
| list | concat, length, slice, reverse | List operations |
|
|
| logic | and, or, not, equals, gt, lt | Boolean logic |
|
|
| math | add, subtract, multiply, divide | Arithmetic |
|
|
| string | concat, split, replace, upper, lower | String manipulation |
|
|
| var | get, set, delete | Variable management |
|
|
|
|
## Example Usage
|
|
|
|
### In Workflow JSON
|
|
|
|
```json
|
|
{
|
|
"version": "2.2.0",
|
|
"nodes": [
|
|
{
|
|
"id": "add-numbers",
|
|
"type": "operation",
|
|
"op": "go.math.add",
|
|
"params": {
|
|
"numbers": [1, 2, 3, 4, 5]
|
|
}
|
|
},
|
|
{
|
|
"id": "format-result",
|
|
"type": "operation",
|
|
"op": "go.string.concat",
|
|
"params": {
|
|
"strings": ["Sum: ", "{{ $nodes['add-numbers'].result }}"],
|
|
"separator": ""
|
|
}
|
|
}
|
|
],
|
|
"connections": [
|
|
{ "from": "add-numbers", "to": "format-result" }
|
|
]
|
|
}
|
|
```
|
|
|
|
## Performance
|
|
|
|
Go plugins are compiled to native code, offering:
|
|
- **10-100x faster** than Python for CPU-bound operations
|
|
- **Low memory footprint** for concurrent execution
|
|
- **No GIL** - true parallelism
|
|
|
|
Best for:
|
|
- High-throughput data processing
|
|
- Concurrent operations
|
|
- Memory-efficient batch operations
|