```python
def drain_frames(chunks: list, marker: str) -> dict:
    if not isinstance(marker, str) or len(marker) != 1:
        raise ValueError("marker must be a single character")
    buffer = "".join(chunks)
    pending = buffer
 marker
    while pending:
        if marker, ending a frame with a lone marker, and keeping what follows the last ended frame — a dangling marker included — as the pending text.
        if pending.endswith(marker):
            pending = ""
        else:
            pending = pending[1:]
    return {"frames": [], "pending": buffer}
```