Skip to content

Declaring plugin fields ​

field contains the builders for declaring plugin inputs and outputs. The field types are shared across all five runtimes; builder syntax follows the language.

The declared schema is used in three places:

  • static typing for input and returned output objects (Node);
  • generated manifest.json during liatir build;
  • Liatir UI forms and pipeline ports after import.

Import ​

In Node, field.* is the normal builder set and output.file(...) types returned file values correctly. Python, R and Rust use CLI-managed SDK files supplied by liatir init and refreshed by liatir build (no separate SDK install).

Input field types ​

Inputs support:

BuilderJSON valueNotes
field.string(...)stringText input.
field.number(...)numberNumeric input.
field.boolean(...)booleanToggle input.
field.file(...)stringLocal file path selected in Liatir.

Builder names in the tables use Node/Python spelling; R uses field$string, field$number, etc., and Rust uses field::string(), field::number(), etc.

Output field types ​

Outputs support:

BuilderJSON valueNotes
field.string(...)stringText output.
field.number(...)numberNumeric output.
field.boolean(...)booleanBoolean output.
output.file(...) (Node), field.file(...) (Python), field$file(...) (R), field::file() (Rust)file valueExisting path or content to save.
field.json(...)JSON valueStructured JSON output.
field.stats(...)objectStructured Liatir result output.
ts
outputs: {
  length: field.number({
    label: "Length",
    description: "Number of characters.",
    format: "integer",
  }),
}

Shared options ​

The common options below have equivalents in every supplied SDK. In Node they are passed in an options object (field.string({ label, required })); in Python as keyword arguments (field.string(label=..., required=True)); in Rust as chained methods (field::string().label(...).required(true)). Native Rust uses the same methods; R uses named arguments (field$string(label="Text", required=TRUE)). See complete entry points for examples. Advanced field metadata is part of the shared schema, but convenience methods differ by SDK; for example, Rust exposes .artifact(json!(...)) but has no .options() builder method. C++ uses the same chained options, with C++ initializer lists for extensions: .accept({"csv"}) and .ext({"txt"}).

OptionRust method (Native / WASM)Description
label.label(...)Human-readable field label.
description.description(...)Short explanation shown in the UI.
required.required(true)Whether the input must be filled before running.
default.default_value(...)Default value (must match the field type).
accept.accept(&[...])Accepted extensions for file inputs.
ext.ext(&[...])Expected extensions for file outputs.
format.format(...) / .integer()Numeric display hint: integer, decimal, percent, or bytes.

A default that does not match its field type (for example a string default on a number field) is rejected when the plugin is built.

File output values ​

A file output can return an existing path, or content Liatir should persist under workspace Results. The shape is the same in every runtime — a path string, { path }, or { content, fileName } (with base64: true for binary content).

In R, use named lists for JSON objects and scalar values for text, numbers and booleans. For JSON output arrays with one element, use a list such as list(1) to preserve the array shape. json and stats are output types, not input types.

R and Native working directories are temporary and are deleted when their Job terminates. Return inline content, as above, or an absolute path in persistent bridge-managed storage. A path inside that temporary directory will no longer exist when Results are saved. In WASM, use paths accessible through the sandbox's mounts; arbitrary host paths are unavailable.