Skip to main content

Crate ai6_terminal_pipe

Crate ai6_terminal_pipe 

Source
Expand description

ai6-terminal-pipe: the pipe terminal provider. The program gets plain pipes for its standard input and output, and no terminal, so a harness that checks whether its input is a terminal (Claude Code’s -p) reads what is written to it, and its output arrives exactly as written. What differs per platform (starting the child alone, owning its process tree, finding the program) is in unix.rs and windows.rs behind one os interface.

Output is read on a thread into a channel, so read can time out. The output ends when the program has exited and its output pipe is closed, or, when a process it left behind holds the pipe open, once the program has exited and nothing has arrived for 200 ms.

§ai6-terminal-pipe

Version Rust version License: MPL-2.0 Docs CI

The pipe terminal provider for AI6: a program on plain pipes, with no terminal. Its standard input is a pipe, and its standard output is the output stream, byte for byte, followed by the last lines of its standard error. A Station gives it to harnesses whose handler speaks JSON over standard input and output (Claude Code, Codex), which a terminal would render or refuse. See the API header.

§Features

  • Output exactly as the program wrote it: no line-break translation, no control sequences.
  • Input of any length reaches the program whole; nothing is echoed.
  • Standard error on a pipe of its own, its last 8 KiB following the output once it has ended (the default), merged into the output, or dropped.
  • The program inherits only its standard streams.
  • Kills the whole process tree: a process group and the processes found by parent from it on Unix, a Job Object on Windows.
  • Builds as both a Rust library and the Guatiao provider library a Station loads.
  • Its read size, waits and process-tree scans are config keys ([providers.pipe]), listed in the API header.

§Installation

Part of the AI6 workspace; built with it:

cargo build -p ai6 --features cli -p ai6-terminal-pipe

§Quick start

cargo run -p ai6 --features cli -- serve --plugin-path target/debug

§Development

cargo test -p ai6-terminal-pipe
cargo clippy -p ai6-terminal-pipe --all-targets -- -D warnings

§License

MPL-2.0. See LICENSE.

Structs§

Pipe
Starts programs on plain pipes, with no terminal.
PipeConfig
pipe provider configuration; every field has a default.

Enums§

StderrMode
What becomes of the program’s standard error.

Statics§

guatiao_declares
What this library declares, read by a scanner as data.

Functions§

guatiao_library_entry⚠
The symbol a guatiao host loads this library by.