Skip to main content

Module tool

Module tool 

Source
Expand description

How the orchestrator drives a neuro-kitchen tool without its window. A tool (lucem, dspk, neuro-convert, garnish, any tool from kitchen-template) is a plugin program (crate::plugin: JSON lines over stdin and stdout, large data as files) that answers three more requests:

RequestAnswer
describeToolDescription: its operations, what each reads and writes (the contract’s type and format), its recipe’s JSON Schema
validatewhether a recipe is one an operation can run, and if not, why
runruns an operation on input results into an output folder: RunReport

The orchestrator knows nothing else about a tool. It connects tools by the types and formats they declare, so a new tool joins the soup by answering these three requests.

Re-exports§

pub use client::ToolClient;
pub use client::check_inputs;
pub use description::InputPort;
pub use description::Operation;
pub use description::OutputPort;
pub use description::Resources;
pub use description::ToolDescription;
pub use protocol::RunInput;
pub use protocol::RunRequest;
pub use protocol::TOOL_PROTOCOL;
pub use protocol::ToolRef;
pub use protocol::ToolRequest;
pub use protocol::Validation;
pub use report::ReviewFlag;
pub use report::RunOutput;
pub use report::RunReport;
pub use serve::HeadlessTool;
pub use serve::plugin_info;
pub use serve::serve_stdio;

Modules§

client
The orchestrator’s side: a tool program started once and asked many times. Blocking: the orchestrator’s worker calls it from a thread of its own.
description
What a tool offers: its operations, what each reads and writes, how its recipe looks.
protocol
The requests a tool answers beside the plugin protocol’s own (info, install, remove, quit). Each is one JSON line with a "request" tag; the answer is the plugin protocol’s progress events, then one done (its result as below) or error.
report
What a run produced.
serve
The tool’s side: implement HeadlessTool, then answer requests with serve_stdio (a tool’s tool serve subcommand: dspk tool serve, lucem tool serve).