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
inputand returned output objects (Node); - generated
manifest.jsonduringliatir build; - Liatir UI forms and pipeline ports after import.
Import
In Node,
field.*is the normal builder set andoutput.file(...)types returned file values correctly. Python, R and Rust use CLI-managed SDK files supplied byliatir initand refreshed byliatir build(no separate SDK install).
Input field types
Inputs support:
| Builder | JSON value | Notes |
|---|---|---|
field.string(...) | string | Text input. |
field.number(...) | number | Numeric input. |
field.boolean(...) | boolean | Toggle input. |
field.file(...) | string | Local 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:
| Builder | JSON value | Notes |
|---|---|---|
field.string(...) | string | Text output. |
field.number(...) | number | Numeric output. |
field.boolean(...) | boolean | Boolean output. |
output.file(...) (Node), field.file(...) (Python), field$file(...) (R), field::file() (Rust) | file value | Existing path or content to save. |
field.json(...) | JSON value | Structured JSON output. |
field.stats(...) | object | Structured Liatir result output. |
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"}).
| Option | Rust 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.