Metadata-Version: 2.4
Name: fleet-framework
Version: 1.2.0
Summary: Distributed automation framework: a self-healing master/worker control plane with cross-automation output streams, pluggable Redis/SQLite backends, a built-in anti-bot browser pool (fingerprinting, per-flow proxy routing, Cloudflare Turnstile), scoped auth, a live dashboard, and Prometheus/OpenTelemetry observability.
Author: Sarper AVCI
License: MIT
Project-URL: Homepage, https://github.com/sarperavci/fleet
Project-URL: Repository, https://github.com/sarperavci/fleet
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.115.0
Requires-Dist: uvicorn[standard]>=0.30.0
Requires-Dist: pydantic>=2.7.0
Requires-Dist: websockets>=12.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: redis>=5.0.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: click>=8.1.0
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: lxml>=5.1.0
Requires-Dist: cryptography>=42.0.0
Requires-Dist: cloakbrowser>=0.3
Requires-Dist: mitmproxy>=11.0
Requires-Dist: curl_cffi>=0.7
Requires-Dist: pyvirtualdisplay>=3.0
Requires-Dist: uaforger>=0.1.5
Requires-Dist: opentelemetry-api>=1.27.0
Requires-Dist: opentelemetry-sdk>=1.27.0
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27.0
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.23; extra == "test"
Dynamic: license-file

<h1 align="center">Fleet</h1>

<p align="center">
  <strong>Write a Python automation once. Run it across a fleet of machines —<br>self-healing, observable, and wired together end to end.</strong>
</p>

<p align="center">
  <img alt="Python" src="https://img.shields.io/badge/python-3.11%2B-blue.svg">
  <img alt="License" src="https://img.shields.io/badge/license-MIT-green.svg">
  <img alt="Status" src="https://img.shields.io/badge/status-battle--tested-brightgreen.svg">
</p>

---

Fleet is a distributed automation framework. You write the work as a small Python class; Fleet distributes it to your workers, keeps them alive, restarts the ones that fall over, and streams their output wherever it needs to go — including into other automations, across hosts, with zero glue code.

> **Proven in production** as the engine behind a Cloudflare Turnstile-solving farm — 8 hosts, 42 workers, 200+ operations per minute.

## Why Fleet

- **One control plane, many workers.** The master is the single source of truth for configuration. Change it in one place and every worker reconciles to match — no redeploys, no manual restarts.
- **Self-healing by design.** A crashed slot is respawned on the next tick. A worker that drops off reconnects and resumes. A task that fails is retried with exponential backoff and dead-lettered after its attempt budget.
- **Automations compose across machines.** One workload's output stream is another's input — cross-host, type-checked, and durable. You wire pipelines, not plumbing.
- **A browser pool that beats anti-bot.** A built-in headed-Chromium pool ships in the box: statistically-weighted fingerprinting, per-flow proxy routing with a real Chrome TLS signature, and Cloudflare Turnstile solving.
- **Backends that fit the deployment.** Redis for horizontal scale, SQLite for a single VPS, in-memory for tests — one `Backend` interface, identical semantics, swap by URL.
- **Operable from day one.** Scoped auth tokens, a live dashboard, a Prometheus `/metrics` endpoint, and OpenTelemetry tracing are all wired up. REST and WebSocket APIs, plus a full CLI.
- **Extend by installing a package.** Automations, proxy providers, and anti-bot solvers are discovered via entry-points. Ship one as a pip package and Fleet finds it automatically.

## How it works

One **master** runs on one host — where you set what to do and read what got done. Many **workers**, one per machine, check in, pull their config, and do the work. The work itself is a small Python class you write, ship as a pip package, and install on the machines; Fleet discovers it on its own and hands it out.

## Quickstart

```bash
pip install fleet-framework
```

A complete automation is about 30 lines:

```python
import asyncio
import httpx
from fleet.core import BaseConfig, ContinuousAutomation, register

class PingerConfig(BaseConfig):
    url: str
    interval_seconds: float = 5.0

@register("pinger")
class Pinger(ContinuousAutomation[PingerConfig]):
    Config = PingerConfig

    async def run_slot(self, ctx):
        async with httpx.AsyncClient(proxy=ctx.proxy) as client:
            while not ctx.shutdown.is_set():
                r = await client.get(ctx.config.url)
                await ctx.emit({"status": r.status_code})
                await asyncio.sleep(ctx.config.interval_seconds)
```

Full walkthrough — master, worker, config, output — at **<http://fleet.hackmap.win/getting-started/quickstart>**.

## Documentation

Full docs live at **<http://fleet.hackmap.win/>**.

- [Introduction](http://fleet.hackmap.win/)
- [Installation](http://fleet.hackmap.win/getting-started/installation) · [Quickstart](http://fleet.hackmap.win/getting-started/quickstart) · [Your first automation](http://fleet.hackmap.win/getting-started/first-automation)
- [Architecture](http://fleet.hackmap.win/concepts/architecture) · [Automations](http://fleet.hackmap.win/concepts/automations) · [Primitives](http://fleet.hackmap.win/concepts/primitives)
- [Continuous automations](http://fleet.hackmap.win/guides/continuous-automation) · [Batch automations](http://fleet.hackmap.win/guides/batch-automation) · [Inter-automation comms](http://fleet.hackmap.win/guides/inter-automation)
- [Browser-based automations](http://fleet.hackmap.win/guides/browser-automations) · [Deployment](http://fleet.hackmap.win/guides/deployment)
- [REST API](http://fleet.hackmap.win/reference/rest-api) · [WebSocket protocol](http://fleet.hackmap.win/reference/ws-protocol) · [CLI](http://fleet.hackmap.win/reference/cli)
- [Auth](http://fleet.hackmap.win/operations/auth) · [Observability](http://fleet.hackmap.win/operations/observability) · [Troubleshooting](http://fleet.hackmap.win/operations/troubleshooting)

## License

MIT. See [LICENSE](LICENSE).
