Liatir Plugin API
This is the API you need to use in order to develop a .lia plugin that can run inside the Liatir local environment. The Liatir Plugin API allows you to define the plugin, providing the entry point and the context where you can implement your logic and use the API bridge.
Runtimes
- Node declares it with
definePlugin({...})from@liatir/api. - Python declares it with
define_plugin(...)from the CLI-managedliatirmodule scaffolded next to the entry point. - R uses the CLI-managed
liatir.Rmodule. - Native uses a compiled executable and the shared contract protocol.
- WASM runs isolated WASI Preview 1 modules using the supplied Rust or C++ library.
Authoring
Every .lia plugin declares its inputs and outputs once, in code, and attaches the implementation to that contract. liatir build reads the contract back and generates manifest.json from it — there is no schema to write or keep in sync by hand.
This is the same API shape in all five runtimes:
Node —
definePlugin({ inputs, outputs }).main(handler)from@liatir/api.Python —
define_plugin(inputs=..., outputs=...)+@plugin.mainfrom the CLI-managedliatirmodule.R —
define_plugin(inputs=..., outputs=...)+plugin$main(handler).Native/WASM — Rust or C++ using the supplied Liatir libraries. Rust uses
define_plugin().input(...).output(...).main(handler)from the managed SDK; C++ uses the same builders fromliatir.hpp. See the Rust and C++ examples. Only Native has app bridge access.
API bridge
Node, Python, R and Native can all use Liatir Jobs, dependency checks, storage, app information, logging, progress, paths and raw command invocation. WASM has no bridge.
| Runtime | Handler access | Calling convention |
|---|---|---|
| Node | Liatir | Async methods, for example await Liatir.jobs.list(). |
| Python | ctx.liatir | Synchronous, snake_case methods. |
| R | ctx$liatir | Synchronous, snake_case methods accessed with $. |
| Native Rust | ctx.liatir | Namespace methods, for example ctx.liatir.jobs().list()?. |
See the bridge reference for language conventions, response types, all available areas and development-session isolation.