Expand description
Terminal contracts used by AI6’s supervisor and AgentHandlers, as Guatiao kinds.
A Terminal provider starts a program on a terminal and hands back a
TerminalRun the caller owns. A provider is a guatiao library in any
language; the supervisor finds it on a search path and drives it through
these tables. Slot order is the ABI: append, never reorder.
Re-exports§
pub use guatiao;
Structs§
- Exit
Info - How a program ended, or that it has not. At most one of
codeandsignalis set, and neither whilerunning. - Json
Lines - Splits a terminal’s output into the JSON values a harness wrote one per line.
- Spec
- What to start. Crosses as a value:
{"argv": [..], "cwd": .., "env": {..}, "rows": .., "cols": ..}. - Terminal
Bridge - Wraps an AI6-discovered terminal provider in the object handle passed to AgentHandlers.
- Terminal
Offer - An available terminal provider, as
choose_terminalweighs it.
Enums§
- Harness
Stdio - How the harness an AgentHandler starts talks over its standard input and output, as the handler declares it; the Station picks a terminal provider that suits it.
- Stream
Line - One line of a harness’s output, as
JsonLinessplits it. - Terminal
Refusal - Why no terminal provider suits a harness.
Constants§
- DEFAULT_
PIPE - The terminal provider preferred for a harness that speaks JSON over standard input and output.
- DEFAULT_
TERMINAL - The terminal provider preferred for a harness that may want a terminal.
- READ_
TIMED_ OUT readanswers this when nothing arrived within the timeout.- STREAM_
COLS - The widest terminal every provider accepts: ConPTY takes its size as signed 16-bit
numbers. A handler whose harness writes one JSON value per line asks for it, so that few
lines wrap;
JsonLinesrejoins the ones that still do.
Traits§
- Agent
Terminal - The object handle AgentHandlers use to ask AI6’s selected terminal provider to spawn.
- Terminal
- Starts programs on terminals.
- Terminal
Run - One running program on one terminal. Every slot takes
&self, so a caller may write, resize or kill from one thread while another blocks inread.
Functions§
- choose_
terminal - The terminal provider for a harness that talks over
stdio, among the availableoffers. - exit_
code_ text - An
ExitInfo::codeas a person reads it: the number, followed for a negative one by its 32-bit value in hex, which is how Windows names an NTSTATUS (-1073741510 (0xC000013A)). - strip_
controls byteswithout terminal control sequences: CSI (ESC [ ... final), OSC (ESC ] ..., ended by BEL,ESC \or a line break) and two-byte escapes. Other bytes, line breaks included, are kept. A CSI with more thancsi_bytesparameter and intermediate bytes is not a sequence, and only itsESC [is dropped.