Skip to main content

Module terminal

Module terminal 

Source
Expand description

The terminal family: the seat’s own terminal, driven by bytes and keys.

The agent drives it like a human. There is no agent mode, no automation flag and no wrapper around the shell: text is typed as bytes, Enter is its own key, Ctrl-C is 0x03, and the shell sees an ordinary xterm-256color terminal. Nothing the terminal adds says an agent is behind the keys.

The family is any-caller and it is always on. The terminal is one per seat on the machine, not a scope like reviews or crons, so every session may drive its own. No approval gate: Bash through the CLI already reaches the shell here. The one thing gated is the person’s input, through a hand-off or their own take-control of the raised surface.

Re-exportsΒ§

use std::sync::Arc; πŸ”’
use forge_primitives::SessionSlot; πŸ”’
use forge_primitives::browser::HandOffEnding; πŸ”’
use forge_sdk::mcp::server::McpServerBuilder; πŸ”’
use forge_sdk::mcp::tool::Tool; πŸ”’
use forge_sdk::mcp::tool::ToolInput; πŸ”’
use forge_sdk::mcp::tool::ToolOutput; πŸ”’
use forge_sdk::mcp::tool::ToolOutputBlock; πŸ”’
use forge_terminal::Key; πŸ”’
use serde_json::Value; πŸ”’
use crate::mcp::terminal::facade::OpenRequest; πŸ”’
use crate::mcp::terminal::facade::TerminalFacade; πŸ”’
use crate::mcp::terminal::facade::WaitUntil; πŸ”’

ModulesΒ§

facade
The narrow surface the terminal tools call: the seat’s terminal, driven by bytes and keys and read as text.

StructsΒ§

Registered πŸ”’
One registered tool, plus the caller it acts for.

EnumsΒ§

TerminalTool πŸ”’
One tool of the family.

ConstantsΒ§

DEFAULT_MAX_BYTES πŸ”’
DEFAULT_MAX_LINES πŸ”’
The most lines and bytes one read returns unless the caller asks for less.
DEFAULT_TIMEOUT_MS πŸ”’
The longest a wait or a run may hold before it answers unmatched.

FunctionsΒ§

add_tools πŸ”’
Attach the terminal tools to an existing builder.
optional_string πŸ”’
optional_u16 πŸ”’
optional_u64 πŸ”’
optional_usize πŸ”’
parse_keys πŸ”’
parse_until πŸ”’
required_u16 πŸ”’