Skip to main content

Module tools

Module tools 

Source
Expand description

The tools a runner lives in: terminal multiplexers and agent runtimes. A tool opens a pane the person can watch and hands the runner a line, and its alive verb says whether the pane is still there.

[[tool]] tables in harnesses.toml declare them beside the runners. herdr and tmux ship as shapes (SHIPPED_TOOLS); a table of the same name replaces a shipped one. Every verb is an argv with {placeholders}. A tool the seat has never heard of is one table. A tool that refuses is named with its own words and the next one is tried, so a shape gone stale against its tool shows in what hand returns.

Structs§

Ran
What a tool printed when it ran a verb.
Tool
One tool, as harnesses.toml declares it.
Vars
What fills a verb’s placeholders.

Constants§

SHIPPED_TOOLS
The shapes the seat ships, in the order they are tried: herdr’s agent API when its server answers, else tmux.

Functions§

answers
Whether a verb that answers by its exit status says yes. An empty verb says no.
available
The tools that answer here, in the order they would be tried. A named tool (LJOS_PANE_TOOL) narrows the list to that one.
doctor_state
The doctor’s row on panes: which tool would open a persona’s pane, and which others answer.
fill
argv with every {key} replaced from vars. A placeholder with no value is left as written, so a typo reaches the tool and its refusal names it.
open
Open a pane with tool: the first open that exits 0, then run when the pane starts as a shell. Returns the pane the tool named, or the empty string for a tool whose verbs name the pane themselves.
ordered
The tools in the order they are tried: the file’s own, then each shipped shape the file did not replace.
pane_from
The pane open named, read through pointer from its JSON output.
run
Run one filled argv. A refusal carries the tool’s first stderr line, or its first stdout line when stderr is empty, and the argv’s verb words.
send
Hand the runner one line: prompt, and type_line when prompt is refused or absent.
sh_quote
A word quoted for sh.
shipped
The shipped shapes, parsed.
wait_ready
Wait until a fresh runner takes input: ready retried each second until ready_s runs out, or a plain sleep of ready_s for a tool with no ready.