Skip to content

Python API

from long_running_agent import Client, Settings

Client

Client(settings: Settings | None=None, *, runner: Runner=run, home: Path | None=None, sleeper: Callable[[float], None]=time.sleep, clock: Callable[[], float]=time.monotonic, master_launcher: Callable[[Sequence[str]], int]=launch_master)
packages/long-running-agent/src/long_running_agent/client/controller.py

ssh

ssh(arguments: Sequence[str], *, timeout: float | None=None, capture_output: bool=False, check: bool=True, input_text: str | None=None) -> Completed

wake

wake() -> None

sleep

sleep() -> None

stop

stop() -> None

ensure_connection

ensure_connection() -> None

remote

remote(command: str, *, tty: bool=False, check: bool=True, capture_output: bool=False, timeout: float | None=None, input_text: str | None=None) -> Completed

health

health() -> None

summary

summary(reconnect: Sequence[str]=('vm',)) -> str

browser

browser(*, no_open: bool=False, url: str | None=None) -> int

shell

shell(command: Sequence[str], *, tty: bool=False, reconnect: Sequence[str]=('vm', 'ssh')) -> int

terminal

terminal(session: str='sarj-home', *, host_bridge: bool=True) -> int

codex

codex(action: Literal['status', 'switch']) -> int

configure_ssh

configure_ssh() -> Path

setup

setup() -> None

Settings

Settings(*, project: CloudIdentifier = 'example-project', instance: CloudIdentifier = 'agent-vm', zone: CloudIdentifier = 'us-central1-a', account: str | None = None, ssh_alias: str = 'sarj-codex', ssh_key: Path = <factory>, gcloud_binary: str = 'gcloud')

Connection coordinates and personal identity; this contains no credentials.

packages/long-running-agent/src/long_running_agent/config.py

validate_account

validate_account(value: str | None) -> str | None

validate_ssh_alias

validate_ssh_alias(value: str) -> str

expand_ssh_key

expand_ssh_key(value: Path) -> Path