Plugin Development
Plugins are the heart of Julia. Whether you're building token logic, reinforcement agents, or zero-knowledge modules — everything runs as a pluggable component, fully isolated and API-addressable.
This guide walks you through the process of writing, compiling, and exposing your own plugin.
Plugin Structure
Each plugin lives inside the /Plugins/
directory. Example layout:
You can structure your plugins however you like — as long as the output is a .wasm
file.
Writing Your First Plugin
Julia plugins are typically written in Rust, thanks to its WASM support and memory safety.
Example:
The only requirement: expose an execute()
function that handles serialized inputs and returns serialized outputs.
Compiling to WASM
Use the Rust WASM target:
The result: ./target/wasm32-unknown-unknown/release/your_plugin.wasm
Copy it to /Plugins/{plugin_name}/
and Julia will load it on startup.
Registering the Plugin
No manual registration needed — just place the .wasm
in the correct folder and Julia will:
- Load the plugin
- Expose the endpoint
- Route HTTP calls to it
Each plugin will be available via POST /api/{plugin-name}
Passing Parameters
Parameters should be passed as JSON. Julia automatically deserializes the input and routes it to the plugin runtime.
Example request:
Plugin Metadata (optional)
Plugins can optionally export metadata:
This allows plugins to self-describe inside admin dashboards or marketplaces.
Tips for Building Plugins
- Use
wasm-bindgen
orwit-bindgen
for complex I/O. - Keep logic focused and isolated.
- Add logging internally; Julia can expose it.
- Use shared crates across plugins to avoid duplication.
Next Steps
Once you’ve built your plugin:
- Test it via Scalar UI
- Chain it with other plugins
- Register it into a larger protocol
Plugins are your programmable logic blocks — ship them fast, test in isolation, and evolve freely.