Metadata-Version: 2.4
Name: rtlinux
Version: 0.1.0
Summary: MeshPOP Runtime Linux — L0 node OS for AI infrastructure mesh
Author-email: MeshPOP <meshpop@proton.me>
License: Apache-2.0
Project-URL: Homepage, https://mpop.dev
Project-URL: Repository, https://github.com/meshpop/rtlinux
Project-URL: Documentation, https://mpop.dev/docs/
Project-URL: Issues, https://github.com/meshpop/rtlinux/issues
Keywords: meshpop,runtime,linux,buildroot,wireguard,mesh,infrastructure,ai,mcp,distributed,vssh,orchestration,node-os,l0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Operating System
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: System :: Clustering
Classifier: Topic :: System :: Networking
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# rtlinux — MeshPOP Runtime Linux

**Layer 0 of the MeshPOP stack.** A Buildroot-based minimal Linux distribution purpose-built for AI infrastructure mesh nodes.

```
L0  rtlinux   — Runtime OS (kernel + musl + busybox + MeshPOP)
L1  Wire      — WireGuard mesh VPN         (pip install meshpop-wire)
L2  vssh      — Secure remote execution    (pip install vssh)
L3  mpop      — Fleet orchestration        (pip install meshpop)
L4  MeshDB    — Distributed search         (pip install meshpop-db)
L5  Vault     — Secrets management         (pip install sv-vault)
```

## What It Does

Builds a minimal, network-hardened Linux OS with the full MeshPOP tool suite pre-installed. Boot a node → it auto-joins the Wire mesh → instantly manageable via `mpop exec`, `mpop deploy`, `mpop ask`.

**Like Talos Linux for Kubernetes, but for MeshPOP.**

## Install

```bash
pip install rtlinux
```

## Quick Start

```bash
# Build runtime image (Buildroot — from source, zero dependencies)
rtlinux build --method buildroot

# Deploy to a new node
rtlinux deploy g5 --image output/meshpoplinux-rootfs.tar.gz

# Verify all nodes
rtlinux verify --all

# Full CI/CD loop: build → deploy → verify → fix
rtlinux loop --nodes "g1 g2 g3 d1 d2"

# Fleet status
rtlinux status
```

## Build Methods

| Method | Dependencies | Time | Output |
|--------|-------------|------|--------|
| **Buildroot** (recommended) | None — kernel+BusyBox+musl from source | 20-60 min | bzImage + rootfs.cpio |
| Alpine | Docker | ~2 min | rootfs.tar.gz |
| Scratch | Linux host or Docker | ~1 min | rootfs.tar.gz |

## MCP Server

rtlinux includes an MCP server for AI-driven node management:

```json
{
  "mcpServers": {
    "rtlinux": {
      "command": "python3",
      "args": ["-m", "rtlinux.mcp.rtlinux_mcp_server"]
    }
  }
}
```

### MCP Tools

| Tool | Description |
|------|-------------|
| `rtlinux_build` | Build runtime image |
| `rtlinux_deploy` | Deploy to a node |
| `rtlinux_verify` | Health check (all 5 layers) |
| `rtlinux_fleet` | Fleet status overview |
| `rtlinux_fix` | Auto-fix degraded node |
| `rtlinux_cicd` | Full CI/CD loop |

## Python API

```python
import rtlinux

# Build
result = rtlinux.build(method="buildroot")

# Deploy
result = rtlinux.deploy("g5")

# Verify single node
health = rtlinux.verify("g1")
# → {"status": "healthy", "layers_ok": "5/5", ...}

# Verify fleet
fleet = rtlinux.verify_fleet(["g1", "g2", "d1", "d2"])
# → {"summary": "4/4 healthy", "fleet": {...}}
```

## Architecture

```
┌────────────────────────────────────────────────┐
│              rtlinux Node                       │
│                                                │
│  kernel (Buildroot-compiled)                   │
│  └─ WireGuard (mesh VPN, auto-peering)         │
│  └─ vssh daemon (remote execution)             │
│  └─ mpop agent (orchestration)                 │
│  └─ MeshDB indexer (file search)               │
│  └─ minimal userspace (BusyBox + musl)         │
│                                                │
│  No SSH. No package manager. No systemd.       │
│  Just MeshPOP.                                 │
└────────────────────────────────────────────────┘
```

## The MeshPOP Stack

| Layer | Package | PyPI |
|-------|---------|------|
| L0 | **rtlinux** | `pip install rtlinux` |
| L1 | Wire | `pip install meshpop-wire` |
| L2 | vssh | `pip install vssh` |
| L3 | mpop | `pip install meshpop` |
| L4 | MeshDB | `pip install meshpop-db` |
| L5 | Vault | `pip install sv-vault` |

## Links

- **Homepage**: [mpop.dev](https://mpop.dev)
- **GitHub**: [github.com/meshpop/rtlinux](https://github.com/meshpop/rtlinux)
- **All repos**: [github.com/meshpop](https://github.com/meshpop)

## License

Apache-2.0
