from __future__ import annotations

from datetime import datetime, timezone


def build_heartbeat_payload(
    *,
    device_id: str,
    metadata: dict[str, str],
    protocol_version: str,
    nonce: str,
) -> dict[str, object]:
    return {
        "device_id": device_id,
        "metadata": metadata,
        "protocol_version": protocol_version,
        "nonce": nonce,
        "timestamp": datetime.now(tz=timezone.utc).isoformat(),
        "status": "passive_online",
    }
