In-VM cooperative remote execution agent GenServer (H.ExecutionEnv.Remote transport seam).
Owns a host-backed H.ExecutionEnv.t() (H.ExecutionEnv.Host) and an explicit
plain environment descriptor (%{id: id, kind: "remote", cwd: cwd}). Process state
lives in memory for the duration of the run and excludes credentials or auth secrets.
Future network transport
This module implements the local in-VM RPC endpoint proving fencing, lease-TTL heartbeats,
bounded execution output, and process-group reaping semantics. A future network
adapter (authenticated mTLS WebSocket/HTTPS or SSH subsystem) will replace the GenServer
call/message framing while preserving this protocol contract.
Summary
Functions
Aborts an active fenced execution and waits for its process group to be reaped.
Returns the list of currently active execution fences on this agent.
Remotely resolves path and verifies that it exists as a directory.
Remotely canonicalizes path by resolving symlinks on the target agent.
Returns a specification to start this module under a supervisor.
Returns the agent's canonical base working directory.
Returns the plain JSON-safe environment descriptor (id, kind: "remote", cwd).
Executes command on the remote agent under fence and optional lease semantics.
Lists a remote directory with sorting, pagination, hidden/dir filters, and markers.
Recursively discovers bounded files and directories on the remote agent.
Reads bounded raw bytes from a remote file.
Reads bounded UTF-8 lines from a remote file.
Renews the lease TTL (in milliseconds) for an active fenced execution.
Remotely resolves path using target OS POSIX path semantics.
Starts a H.RemoteAgent process.
Atomically writes content to a remote file, creating missing parent directories.
Types
Functions
Aborts an active fenced execution and waits for its process group to be reaped.
Returns the list of currently active execution fences on this agent.
Remotely resolves path and verifies that it exists as a directory.
Remotely canonicalizes path by resolving symlinks on the target agent.
Returns a specification to start this module under a supervisor.
See Supervisor.
Returns the agent's canonical base working directory.
@spec descriptor(server()) :: descriptor()
Returns the plain JSON-safe environment descriptor (id, kind: "remote", cwd).
@spec exec(server(), H.ExecutionEnv.command(), keyword()) :: {:ok, H.ExecutionEnv.exec_result()} | {:error, term()}
Executes command on the remote agent under fence and optional lease semantics.
Supports :session_id, :incarnation, :task_id, :attempt_id, :lease_ms, :cwd,
:timeout_ms, :window_bytes, :window_lines, :abort_ref, :on_output, and :env.
Rejects duplicate or older fences with {:error, :stale_fence}.
@spec list_dir(server(), String.t(), keyword()) :: {:ok, %{entries: [map()], next_cursor: nil | non_neg_integer()}} | {:error, term()}
Lists a remote directory with sorting, pagination, hidden/dir filters, and markers.
@spec list_files(server(), String.t(), keyword()) :: {:ok, %{entries: [map()], truncated: boolean()}} | {:error, term()}
Recursively discovers bounded files and directories on the remote agent.
Reads bounded raw bytes from a remote file.
Reads bounded UTF-8 lines from a remote file.
@spec renew_lease(server(), fence(), pos_integer()) :: :ok | {:error, :not_found | :invalid_lease_ms | {:agent_down, term()}}
Renews the lease TTL (in milliseconds) for an active fenced execution.
Remotely resolves path using target OS POSIX path semantics.
@spec start_link(keyword()) :: GenServer.on_start()
Starts a H.RemoteAgent process.
Options
:env(required) - baseH.ExecutionEnv.t()instance owned by the agent:id- non-empty environment identifier string (defaults toH.ExecutionEnv.env_id(env)):name- optional GenServer registration name
Atomically writes content to a remote file, creating missing parent directories.