Metadata-Version: 2.3
Name: rmote
Version: 0.2.3
Summary: Control any remote host. No agent. No install. Just a bare interpreter.
License: 
                                          Apache License
                                    Version 2.0, January 2004
                                 http://www.apache.org/licenses/
         
            TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
         
            1. Definitions.
         
               "License" shall mean the terms and conditions for use, reproduction,
               and distribution as defined by Sections 1 through 9 of this document.
         
               "Licensor" shall mean the copyright owner or entity authorized by
               the copyright owner that is granting the License.
         
               "Legal Entity" shall mean the union of the acting entity and all
               other entities that control, are controlled by, or are under common
               control with that entity. For the purposes of this definition,
               "control" means (i) the power, direct or indirect, to cause the
               direction or management of such entity, whether by contract or
               otherwise, or (ii) ownership of fifty percent (50%) or more of the
               outstanding shares, or (iii) beneficial ownership of such entity.
         
               "You" (or "Your") shall mean an individual or Legal Entity
               exercising permissions granted by this License.
         
               "Source" form shall mean the preferred form for making modifications,
               including but not limited to software source code, documentation
               source, and configuration files.
         
               "Object" form shall mean any form resulting from mechanical
               transformation or translation of a Source form, including but
               not limited to compiled object code, generated documentation,
               and conversions to other media types.
         
               "Work" shall mean the work of authorship, whether in Source or
               Object form, made available under the License, as indicated by a
               copyright notice that is included in or attached to the work
               (an example is provided in the Appendix below).
         
               "Derivative Works" shall mean any work, whether in Source or Object
               form, that is based on (or derived from) the Work and for which the
               editorial revisions, annotations, elaborations, or other modifications
               represent, as a whole, an original work of authorship. For the purposes
               of this License, Derivative Works shall not include works that remain
               separable from, or merely link (or bind by name) to the interfaces of,
               the Work and Derivative Works thereof.
         
               "Contribution" shall mean any work of authorship, including
               the original version of the Work and any modifications or additions
               to that Work or Derivative Works thereof, that is intentionally
               submitted to Licensor for inclusion in the Work by the copyright owner
               or by an individual or Legal Entity authorized to submit on behalf of
               the copyright owner. For the purposes of this definition, "submitted"
               means any form of electronic, verbal, or written communication sent
               to the Licensor or its representatives, including but not limited to
               communication on electronic mailing lists, source code control systems,
               and issue tracking systems that are managed by, or on behalf of, the
               Licensor for the purpose of discussing and improving the Work, but
               excluding communication that is conspicuously marked or otherwise
               designated in writing by the copyright owner as "Not a Contribution."
         
               "Contributor" shall mean Licensor and any individual or Legal Entity
               on behalf of whom a Contribution has been received by Licensor and
               subsequently incorporated within the Work.
         
            2. Grant of Copyright License. Subject to the terms and conditions of
               this License, each Contributor hereby grants to You a perpetual,
               worldwide, non-exclusive, no-charge, royalty-free, irrevocable
               copyright license to reproduce, prepare Derivative Works of,
               publicly display, publicly perform, sublicense, and distribute the
               Work and such Derivative Works in Source or Object form.
         
            3. Grant of Patent License. Subject to the terms and conditions of
               this License, each Contributor hereby grants to You a perpetual,
               worldwide, non-exclusive, no-charge, royalty-free, irrevocable
               (except as stated in this section) patent license to make, have made,
               use, offer to sell, sell, import, and otherwise transfer the Work,
               where such license applies only to those patent claims licensable
               by such Contributor that are necessarily infringed by their
               Contribution(s) alone or by combination of their Contribution(s)
               with the Work to which such Contribution(s) was submitted. If You
               institute patent litigation against any entity (including a
               cross-claim or counterclaim in a lawsuit) alleging that the Work
               or a Contribution incorporated within the Work constitutes direct
               or contributory patent infringement, then any patent licenses
               granted to You under this License for that Work shall terminate
               as of the date such litigation is filed.
         
            4. Redistribution. You may reproduce and distribute copies of the
               Work or Derivative Works thereof in any medium, with or without
               modifications, and in Source or Object form, provided that You
               meet the following conditions:
         
               (a) You must give any other recipients of the Work or
                   Derivative Works a copy of this License; and
         
               (b) You must cause any modified files to carry prominent notices
                   stating that You changed the files; and
         
               (c) You must retain, in the Source form of any Derivative Works
                   that You distribute, all copyright, patent, trademark, and
                   attribution notices from the Source form of the Work,
                   excluding those notices that do not pertain to any part of
                   the Derivative Works; and
         
               (d) If the Work includes a "NOTICE" text file as part of its
                   distribution, then any Derivative Works that You distribute must
                   include a readable copy of the attribution notices contained
                   within such NOTICE file, excluding those notices that do not
                   pertain to any part of the Derivative Works, in at least one
                   of the following places: within a NOTICE text file distributed
                   as part of the Derivative Works; within the Source form or
                   documentation, if provided along with the Derivative Works; or,
                   within a display generated by the Derivative Works, if and
                   wherever such third-party notices normally appear. The contents
                   of the NOTICE file are for informational purposes only and
                   do not modify the License. You may add Your own attribution
                   notices within Derivative Works that You distribute, alongside
                   or as an addendum to the NOTICE text from the Work, provided
                   that such additional attribution notices cannot be construed
                   as modifying the License.
         
               You may add Your own copyright statement to Your modifications and
               may provide additional or different license terms and conditions
               for use, reproduction, or distribution of Your modifications, or
               for any such Derivative Works as a whole, provided Your use,
               reproduction, and distribution of the Work otherwise complies with
               the conditions stated in this License.
         
            5. Submission of Contributions. Unless You explicitly state otherwise,
               any Contribution intentionally submitted for inclusion in the Work
               by You to the Licensor shall be under the terms and conditions of
               this License, without any additional terms or conditions.
               Notwithstanding the above, nothing herein shall supersede or modify
               the terms of any separate license agreement you may have executed
               with Licensor regarding such Contributions.
         
            6. Trademarks. This License does not grant permission to use the trade
               names, trademarks, service marks, or product names of the Licensor,
               except as required for reasonable and customary use in describing the
               origin of the Work and reproducing the content of the NOTICE file.
         
            7. Disclaimer of Warranty. Unless required by applicable law or
               agreed to in writing, Licensor provides the Work (and each
               Contributor provides its Contributions) on an "AS IS" BASIS,
               WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
               implied, including, without limitation, any warranties or conditions
               of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
               PARTICULAR PURPOSE. You are solely responsible for determining the
               appropriateness of using or redistributing the Work and assume any
               risks associated with Your exercise of permissions under this License.
         
            8. Limitation of Liability. In no event and under no legal theory,
               whether in tort (including negligence), contract, or otherwise,
               unless required by applicable law (such as deliberate and grossly
               negligent acts) or agreed to in writing, shall any Contributor be
               liable to You for damages, including any direct, indirect, special,
               incidental, or consequential damages of any character arising as a
               result of this License or out of the use or inability to use the
               Work (including but not limited to damages for loss of goodwill,
               work stoppage, computer failure or malfunction, or any and all
               other commercial damages or losses), even if such Contributor
               has been advised of the possibility of such damages.
         
            9. Accepting Warranty or Additional Liability. While redistributing
               the Work or Derivative Works thereof, You may choose to offer,
               and charge a fee for, acceptance of support, warranty, indemnity,
               or other liability obligations and/or rights consistent with this
               License. However, in accepting such obligations, You may act only
               on Your own behalf and on Your sole responsibility, not on behalf
               of any other Contributor, and only if You agree to indemnify,
               defend, and hold each Contributor harmless for any liability
               incurred by, or claims asserted against, such Contributor by reason
               of your accepting any such warranty or additional liability.
         
            END OF TERMS AND CONDITIONS
         
            APPENDIX: How to apply the Apache License to your work.
         
               To apply the Apache License to your work, attach the following
               boilerplate notice, with the fields enclosed by brackets "[]"
               replaced with your own identifying information. (Don't include
               the brackets!)  The text should be enclosed in the appropriate
               comment syntax for the file format. We also recommend that a
               file or class name and description of purpose be included on the
               same "printed page" as the copyright notice for easier
               identification within third-party archives.
         
            Copyright [yyyy] [name of copyright owner]
         
            Licensed under the Apache License, Version 2.0 (the "License");
            you may not use this file except in compliance with the License.
            You may obtain a copy of the License at
         
                http://www.apache.org/licenses/LICENSE-2.0
         
            Unless required by applicable law or agreed to in writing, software
            distributed under the License is distributed on an "AS IS" BASIS,
            WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
            See the License for the specific language governing permissions and
            limitations under the License.
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: System :: Distributed Computing
Classifier: Typing :: Typed
Classifier: Operating System :: POSIX
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/mosquito/rmote
Project-URL: Repository, https://github.com/mosquito/rmote
Project-URL: Documentation, https://rmote.readthedocs.io
Project-URL: Bug Tracker, https://github.com/mosquito/rmote/issues
Description-Content-Type: text/markdown

# rmote

![rmote](https://raw.githubusercontent.com/mosquito/rmote/master/docs/_static/logo.svg)

**Control any remote host. No agent. No install. Just a bare interpreter.**

---

## Installation

```bash
pip install rmote
```

Python 3.11+ is required on the **local** side. The remote needs only a standard Python 3 interpreter.

## Quick Start

Connect to a local subprocess and call remote methods:

<!-- name: test_quickstart -->
```python
import asyncio
import sys
from rmote.protocol import Protocol
from rmote.tools.fs import FileSystem


async def main():
    process = await asyncio.create_subprocess_exec(
        sys.executable, "-qui",
        stdin=asyncio.subprocess.PIPE,
        stdout=asyncio.subprocess.PIPE,
    )
    async with await Protocol.from_subprocess(process) as proto:
        content = await proto(FileSystem.read_str, "/etc/hostname")
        print(content)


if __name__ == "__main__":
    asyncio.run(main())
```

For SSH, replace `from_subprocess` with `from_ssh`:

<!-- name: test_ssh_quickstart -->
```python
import asyncio
from rmote.protocol import Protocol
from rmote.tools import FileSystem


async def main():
    async with await Protocol.from_ssh("user@server") as proto:
        content = await proto(FileSystem.read_str, "/etc/hostname")
        print(content)


if __name__ == "__main__":
    asyncio.run(main())
```

## How It Works

Three steps happen on every connection:

1. **Bootstrap** — `protocol.py` is lzma-compressed, base64-encoded (~few KB), and written to the remote's stdin. 
   The remote executes it and writes `PROTOCOL READY`.
2. **Tool sync** — On first use, the tool class source is sent to the remote as a SYNC packet. The remote `exec()`s 
   it into a fresh module. Subsequent calls over the same connection skip this step.
3. **RPC** — Each `await proto(Tool.method, *args)` gets a unique `packet_id`. The remote runs the method
   (sync or async) and returns the result. Multiple in-flight calls execute concurrently on both sides.

```
Local                          Remote (injected process)
──────                         ──────────────────────────
await from_subprocess()  ───►  exec(decompress(b64decode(payload)))
                         ◄───  PROTOCOL READY

await proto(Tool.method) ───►  SYNC tool source
                         ◄───  ACK

await proto(Tool.method) ───►  REQUEST {method, args, id=1}
                         ◄───  RESPONSE {result, id=1}
```

## Writing Custom Tools

A **Tool** is a Python class whose methods execute on the remote side. Define it locally; the source is transferred 
automatically on first use.

<!-- name: test_custom_tool -->
```python
import dataclasses
from rmote.protocol import Tool


@dataclasses.dataclass
class DiskInfo:
    path: str
    free: int


class SystemTool(Tool):
    @staticmethod
    def hostname() -> str:
        import socket
        return socket.gethostname()

    @staticmethod
    def disk_free(path: str = "/") -> "DiskInfo":
        import shutil
        _, _, free = shutil.disk_usage(path)
        return DiskInfo(path=path, free=free)

    @staticmethod
    async def read(path: str) -> str:
        with open(path) as f:
            return f.read()
```

<!-- name: test_custom_tool -->
```python
import asyncio
import sys
from rmote.protocol import Protocol


async def main():
    process = await asyncio.create_subprocess_exec(
        sys.executable, "-qui",
        stdin=asyncio.subprocess.PIPE,
        stdout=asyncio.subprocess.PIPE,
    )
    async with await Protocol.from_subprocess(process) as proto:
        host = await proto(SystemTool.hostname)
        info = await proto(SystemTool.disk_free, "/")
        print(f"{host}: {info.free // 2**30} GB free on /")


if __name__ == "__main__":
    asyncio.run(main())
```

**Rules:**

- Inherit from `Tool`
- No `__init__` — the metaclass raises `TypeError` if defined
- Static or class methods only — no instance state across calls
- Stdlib imports only — put `import` statements inside the method body so they run on the remote
- Any picklable value can be returned, including dataclasses
- **Use `process()` for subprocesses** — never `subprocess.run` or `os.system` directly (see below)

### Running Subprocesses

The remote Python process communicates with the local side over its own **stdin / stdout** as a
binary packet stream. Any child process that inherits the default file descriptors will share
those pipes — anything the child writes to stdout will corrupt the packet framing and break the
connection permanently.

Use `process` from `rmote.protocol` instead. It always redirects `stdin`, `stdout`, and `stderr`
away from the protocol pipes:

<!-- name: test_process -->
```python
from rmote.protocol import Tool, process


class DeployTool(Tool):
    @staticmethod
    def apt_update() -> int:
        """Update package lists; return exit code."""
        result = process("apt-get", "update")
        return result.returncode

    @staticmethod
    def git_log(repo: str) -> str:
        """Return the last commit message."""
        result = process("git", "-C", repo, "log", "-1", "--oneline",
                         capture_output=True, text=True, check=True)
        return result.stdout.strip()
```

`process` is available in every tool namespace without an import for inline tools. For
file-level tools add `from rmote.protocol import process` at the top of the file.

| Default                                         | Why                                    |
|-------------------------------------------------|----------------------------------------|
| `stdin=DEVNULL`                                 | Child cannot consume protocol data     |
| `stdout=DEVNULL` (unless `capture_output=True`) | Child cannot corrupt the packet stream |
| `stderr=DEVNULL` (unless `capture_output=True`) | Remote stderr is the same channel      |

<!-- name: test_subprocess_example -->
```python
import subprocess
from rmote.protocol import process

if __name__ == "__main__":
    # BAD — child inherits the protocol pipes
    subprocess.run(["apt-get", "update"])

    # GOOD
    process("apt-get", "update")
```

## Concurrent Calls

Multiple RPC calls execute concurrently over the same connection via `asyncio.gather`:

<!-- name: test_concurrent -->
```python
import asyncio
import sys
from rmote.protocol import Protocol
from rmote.tools import FileSystem


async def main():
    process = await asyncio.create_subprocess_exec(
        sys.executable, "-qui",
        stdin=asyncio.subprocess.PIPE,
        stdout=asyncio.subprocess.PIPE,
    )
    async with await Protocol.from_subprocess(process) as proto:
        hosts, uptime = await asyncio.gather(
            proto(FileSystem.read_str, "/etc/hosts"),
            proto(FileSystem.read_str, "/etc/hostname"),
        )
        print(hosts[:50])
        print(uptime.strip())


if __name__ == "__main__":
    asyncio.run(main())
```

Both calls are dispatched immediately — the channel does not wait for the first response before sending the second. 
Each response is matched back to its caller by `packet_id`.

## Multi-Host Fan-Out

Fan out to several SSH hosts in parallel with `asyncio.gather`:

<!-- name: test_fanout -->
```python
import asyncio
from rmote.protocol import Protocol
from rmote.tools import FileSystem

HOSTS = ["web1", "web2", "web3"]


async def read_hostname(host: str) -> str:
    async with await Protocol.from_ssh(host) as proto:
        return await proto(FileSystem.read_str, "/etc/hostname")


async def main() -> None:
    names = await asyncio.gather(*[read_hostname(h) for h in HOSTS])
    for host, name in zip(HOSTS, names):
        print(f"{host}: {name.strip()}")


if __name__ == "__main__":
    asyncio.run(main())
```

Pass `return_exceptions=True` so a failure on one host does not cancel the others:

<!-- name: test_fanout_errors -->
```python
import asyncio
from rmote.protocol import Protocol
from rmote.tools import FileSystem

HOSTS = ["web1", "web2", "broken-host"]


async def read_hostname(host: str) -> str:
    async with await Protocol.from_ssh(host) as proto:
        return await proto(FileSystem.read_str, "/etc/hostname")


async def main() -> None:
    results = await asyncio.gather(
        *[read_hostname(h) for h in HOSTS],
        return_exceptions=True,
    )
    for host, result in zip(HOSTS, results):
        if isinstance(result, BaseException):
            print(f"{host}: ERROR — {result}")
        else:
            print(f"{host}: {result.strip()}")


if __name__ == "__main__":
    asyncio.run(main())
```

To keep connections open across multiple rounds, use `AsyncExitStack`:

<!-- name: test_persistent -->
```python
import asyncio
from contextlib import AsyncExitStack
from rmote.protocol import Protocol
from rmote.tools import FileSystem

HOSTS = ["web1", "web2", "web3"]


async def main() -> None:
    async with AsyncExitStack() as stack:
        protos = await asyncio.gather(*[
            stack.enter_async_context(await Protocol.from_ssh(h))
            for h in HOSTS
        ])

        # Round 1 — read hostnames (FileSystem synced once per connection)
        names = await asyncio.gather(*[
            p(FileSystem.read_str, "/etc/hostname") for p in protos
        ])
        print("hostnames:", [n.strip() for n in names])

        # Round 2 — list log files (no re-sync needed)
        logs = await asyncio.gather(*[
            p(FileSystem.glob, "/var/log", "*.log") for p in protos
        ])
        for host, filelist in zip(HOSTS, logs):
            print(f"{host}: {len(filelist)} log files")


if __name__ == "__main__":
    asyncio.run(main())
```

## Templating

rmote includes a minimal template engine — no Jinja2 needed on the remote side.

### Variable interpolation

Wrap any Python expression in `${…}`:

<!-- name: test_template_interpolation -->
```python
from rmote.protocol import Template

assert Template("Hello, ${name}!").render(name="Alice") == "Hello, Alice!"
assert Template("${', '.join(sorted(d.keys()))}").render(d={"b": 2, "a": 1}) == "a, b"
```

### Control flow

Lines starting with `%` are Python control flow. `endfor` / `endif` / `end` close blocks:

<!-- name: test_template_control -->
```python
from rmote.protocol import Template

tmpl = Template("""\
% for item in items:
- ${item}
% endfor""")
assert tmpl.render(items=["alpha", "beta", "gamma"]) == "- alpha\n- beta\n- gamma"

tmpl = Template("""\
% if n > 0:
positive
% elif n == 0:
zero
% else:
negative
% endif""")
assert tmpl.render(n=1) == "positive"
assert tmpl.render(n=0) == "zero"
assert tmpl.render(n=-1) == "negative"
```

Lines starting with `##` are stripped; `%%` emits a literal `%`; `\${` escapes interpolation:

<!-- name: test_template_special -->
```python
from rmote.protocol import Template

assert Template("## ignored\nresult: ${v}").render(v=42) == "result: 42"
assert Template("%% done ${n}/10").render(n=7) == "% done 7/10"
assert Template(r"\${not_a_var}").render() == "${not_a_var}"
```

### Pickling

`Template` instances are picklable — compile locally, pass as an argument to a remote tool call, and render on the 
remote with host-specific variables:

<!-- name: test_template_pickle -->
```python
import pickle
from rmote.protocol import Template

tmpl = Template("server_name ${hostname}; listen ${port};")
restored = pickle.loads(pickle.dumps(tmpl))
assert restored.render(hostname="example.com", port=443) == "server_name example.com; listen 443;"
```

### `render_template`

`render_template` compiles and renders in one step:

<!-- name: test_render_template -->
```python
from rmote.protocol import render_template

result = render_template(
    "Hi ${name}, you have ${count} message${'s' if count != 1 else ''}.",
    name="Bob",
    count=3,
)
assert result == "Hi Bob, you have 3 messages."
```

## Error Handling

Exceptions raised on the remote side are re-raised locally with the original type:

<!-- name: test_errors -->
```python
import asyncio
import sys
from rmote.protocol import Protocol
from rmote.tools import FileSystem


async def main():
    process = await asyncio.create_subprocess_exec(
        sys.executable, "-qui",
        stdin=asyncio.subprocess.PIPE,
        stdout=asyncio.subprocess.PIPE,
    )
    async with await Protocol.from_subprocess(process) as proto:
        try:
            await proto(FileSystem.read_str, "/nonexistent/path/file.txt")
        except FileNotFoundError as e:
            print(f"caught: {e}")


if __name__ == "__main__":
    asyncio.run(main())
```

## SSH Options

All common SSH options are available as keyword arguments to `from_ssh`:

<!-- name: test_ssh_options -->
```python
from rmote.protocol import Protocol


async def main():
    proto = await Protocol.from_ssh(
        "myserver",
        user="deploy",
        port=2222,
        identity="~/.ssh/id_ed25519",
        python="python3.11",
        ssh_options=["-o", "StrictHostKeyChecking=no"],
    )


if __name__ == "__main__":
    import asyncio
    asyncio.run(main())
```

## Built-in Tools

All built-in tools use only the Python stdlib on the remote side.

| Tool               | What it manages                              | Platform        |
|--------------------|----------------------------------------------|-----------------|
| `FileSystem`       | Read, write, glob, idempotent line-in-file   | any             |
| `Exec`             | Run commands and shell expressions           | any             |
| `Logger`           | Remote log level and log record forwarding   | any             |
| `Template`         | Mako-like template rendering on the remote   | any             |
| `Quit`             | Cleanly exit the remote process              | any             |
| `Service`          | systemd units — start, stop, enable, disable | Linux           |
| `User`             | Create and manage users and groups           | Linux           |
| `Apt`              | Install and remove packages                  | Debian / Ubuntu |
| `AptRepository`    | DEB822 sources and GPG keys                  | Debian / Ubuntu |
| `Pacman`           | Install and remove packages                  | Arch Linux      |
| `PacmanRepository` | Repository sections and GPG keys             | Arch Linux      |

## Comparison

| Tool                 | Remote requires          | Native async  | Execution model                                  |
|----------------------|--------------------------|:-------------:|--------------------------------------------------|
| **Fabric**           | SSH + shell              |       —       | Shell commands only                              |
| **Ansible**          | Python 2.6+ + modules    |       —       | Module push (JSON results)                       |
| **Mitogen**          | Python only              |       —       | Compressed bootstrap, lower-level channel API    |
| **RPyC zero-deploy** | Python + Plumbum locally |    partial    | Transparent object proxies                       |
| **rmote**            | Python stdlib only       |    **yes**    | Compressed bootstrap, asyncio RPC, typed returns |

rmote is closest in spirit to Mitogen — same stdin-injection technique — but is built for asyncio from the ground up.
Concurrent multi-host calls are first-class, tools are plain Python classes, and return values are typed dataclasses
rather than JSON blobs.

## Project Status

**Beta — version 0.2.0.** Semver: patch = bug fix, minor = new tool or protocol feature,
major = breaking wire or API change.

### Tests

The test suite covers three layers:

**Protocol** (7 test files) — tool serialization, sync and async RPC round-trips, concurrent
in-flight requests matched by `packet_id`, remote exception propagation with original type
preservation, raw packet encoding/decoding, LZMA compression threshold, and a dedicated test
that verifies spawning a subprocess inside a tool never corrupts the protocol pipes.

**Tools** (11 test files, all run against live processes):

- `FileSystem`, `Exec`, `Logger`, `Service`, `User`, `Template` — tested against a local
  subprocess.
- `Apt` and `AptRepository` — tested inside a `python:3-slim` Docker container: install,
  remove, idempotency checks, TTL-aware `update`.
- `Pacman` and `PacmanRepository` — tested inside a locally-built `archlinux:python` Docker
  image.
- Cross-tool integration: concurrent reads, mixed built-in and custom tools in a single session,
  error propagation through `asyncio.gather`.

**12 reusable `Tool` fixtures** in `tests/tools_cases/` cover the serialization corner cases:
async methods, class-level constants, dataclass and nested-dataclass returns, enums defined
inside and outside the class, module-level imports, and tool inheritance.

**README and docs examples** — `pytest` treats `README.md` and all files under `docs/` as test
sources. Every named code block is executed by `markdown-pytest`, so every snippet in this file
is verified on each commit.

### Docker transport

The test suite already runs Python interpreters inside Docker containers using `from_subprocess`
(`docker run --rm -i <image> python3 -qui` is just another subprocess). A dedicated
`Protocol.from_docker` convenience method is a natural next step.

### Type Safety

The entire `rmote/` package passes strict mypy with no errors. All public APIs are fully
annotated. Tested on Python 3.11, 3.12, 3.13, and 3.14.

### Stable

Core protocol, SSH transport, subprocess transport, all 11 built-in tools, templating engine,
concurrent multi-host fan-out, Docker-based test infrastructure.

### Not yet supported

Windows remote hosts, raw socket / TLS transports, `Protocol.from_docker` public API, streaming
or generator responses.
