Skip to content

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-managed liatir module scaffolded next to the entry point.
  • R uses the CLI-managed liatir.R module.
  • 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.main from the CLI-managed liatir module.

  • 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 from liatir.hpp. See the Rust and C++ examples. Only Native has app bridge access.

  • Plugin context

  • Defining plugin

  • Declaring I/O fields

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.

RuntimeHandler accessCalling convention
NodeLiatirAsync methods, for example await Liatir.jobs.list().
Pythonctx.liatirSynchronous, snake_case methods.
Rctx$liatirSynchronous, snake_case methods accessed with $.
Native Rustctx.liatirNamespace methods, for example ctx.liatir.jobs().list()?.

See the bridge reference for language conventions, response types, all available areas and development-session isolation.