Skip to main content

Module shell

Module shell 

Source
Expand description

Shell execution backend abstraction.

ShellBackend is the trait boundary between the bash tool and the underlying process management. Two implementations:

  • defect_tools::shell::LocalShellBackend: spawns child processes directly
  • defect_acp::shell::AcpShellBackend: delegates to the client via ACP terminal/* reverse requests

Assembly is handled in the defect-acp session/new handler — it selects the backend based on the client’s ClientCapabilities::terminal negotiation result and injects it into crate::session::AgentCore::create_session.

Structs§

NoopShellBackend
A no-op shell backend for testing only. All methods return ShellError::NotPermitted, allowing test scenarios that require an Arc<dyn ShellBackend> (without actually running a shell tool) to skip setup.
ShellOutput
A snapshot result of ShellBackend::output.
TerminalExitStatus
Exit status of a terminal process.
TerminalId
A terminal handle. Internally, in the backend, it maps to a PID + monotonic counter (local) or an ACP schema’s TerminalId (acp).

Enums§

ShellError
Errors from the shell backend.

Traits§

ShellBackend
Shell backend trait.