Async Execution Environment Protocol (environment/base.py)

LongHorizon-Harness · eval/TB-harness/Harness/src/environment/base.py · python · MIT
infra, automation, testing, lang:python, tag:protocol, tag:environment, tag:execution

Defines an async protocol for executing remote commands, screenshots, and file transfers. Reuse when building harness evaluation environments.

# Source: https://github.com/AMAP-ML/LongHorizon-Harness | License: MIT | Copyright 2026 LongHorizon-Harness contributors
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

from typing import Protocol, runtime_checkable

from harness_types import ExecResult


@runtime_checkable
class Environment(Protocol):
    async def exec(self, command: str, timeout: int = 30) -> ExecResult: ...

    async def screenshot(self) -> bytes: ...

    async def upload(self, local_path: str, remote_path: str) -> None: ...

    async def download(self, remote_path: str, local_path: str) -> None: ...

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key