Provider-agnostic handle for long-lived raw subprocess sessions.
ExternalRuntimeTransport.Transport owns the subprocess lifecycle itself. This
module provides a higher-level contract for consumers that need a stable raw
session handle, exact-byte stdin/stdout defaults, optional PTY startup, and
normalized result collection without re-implementing lifecycle rules in
provider repos.
Summary
Functions
Closes stdin for EOF-driven subprocesses.
Collects session output until the subprocess exits.
Returns stable mailbox-delivery metadata for the raw session.
Forces the subprocess down immediately.
Returns the latest raw session metadata snapshot.
Interrupts the subprocess according to the configured transport contract.
Sends exact input bytes through the session transport.
Starts an unlinked raw subprocess session from a prebuilt invocation.
Starts an unlinked raw subprocess session from either an executable and argv list or a prebuilt invocation plus options.
Starts a linked raw subprocess session from a prebuilt invocation.
Starts a linked raw subprocess session from either an executable and argv list or a prebuilt invocation plus options.
Returns the transport status for the raw session.
Returns the stderr tail retained by the underlying transport.
Stops the subprocess transport.
Types
@type info_t() :: %{ delivery: CliSubprocessCore.RawSession.Delivery.t(), invocation: CliSubprocessCore.Command.t(), receiver: pid(), transport_ref: reference(), event_tag: atom(), stdout_mode: :line | :raw, stdin_mode: :line | :raw, interrupt_mode: :signal | {:stdin, binary()}, pty?: boolean(), stdin?: boolean(), transport: term() }
@type t() :: %CliSubprocessCore.RawSession{ event_tag: atom(), interrupt_mode: :signal | {:stdin, binary()}, invocation: CliSubprocessCore.Command.t(), pty?: boolean(), receiver: pid(), stdin?: boolean(), stdin_mode: :line | :raw, stdout_mode: :line | :raw, transport: pid(), transport_api: module(), transport_ref: reference() }
Functions
Closes stdin for EOF-driven subprocesses.
Pipe-backed sessions send :eof; PTY-backed sessions send the terminal EOF
byte (Ctrl-D).
@spec collect(t(), timeout()) :: {:ok, ExternalRuntimeTransport.Transport.RunResult.t()} | {:error, term()}
Collects session output until the subprocess exits.
The configured receiver must be the calling process so the core can consume its own transport events deterministically.
@spec delivery_info(t()) :: CliSubprocessCore.RawSession.Delivery.t()
Returns stable mailbox-delivery metadata for the raw session.
Forces the subprocess down immediately.
Returns the latest raw session metadata snapshot.
Interrupts the subprocess according to the configured transport contract.
Sends exact input bytes through the session transport.
@spec start(CliSubprocessCore.Command.t()) :: {:ok, t()} | {:error, term()}
Starts an unlinked raw subprocess session from a prebuilt invocation.
@spec start(String.t(), [String.t()]) :: {:ok, t()} | {:error, term()}
@spec start( CliSubprocessCore.Command.t(), keyword() ) :: {:ok, t()} | {:error, term()}
Starts an unlinked raw subprocess session from either an executable and argv list or a prebuilt invocation plus options.
@spec start_link(CliSubprocessCore.Command.t()) :: {:ok, t()} | {:error, term()}
Starts a linked raw subprocess session from a prebuilt invocation.
@spec start_link(String.t(), [String.t()]) :: {:ok, t()} | {:error, term()}
@spec start_link( CliSubprocessCore.Command.t(), keyword() ) :: {:ok, t()} | {:error, term()}
Starts a linked raw subprocess session from either an executable and argv list or a prebuilt invocation plus options.
@spec status(t()) :: :connected | :disconnected | :error
Returns the transport status for the raw session.
Returns the stderr tail retained by the underlying transport.
@spec stop(t()) :: :ok
Stops the subprocess transport.