"""Deterministic offline adapter — proves the round-trip with zero network and zero key.

Used by the test suite and by demo mode (`python3 run.py --stub`): the plumbing is
identical to a real engine (route -> session -> adapter -> reply); only the brain is
an echo. A real round-trip with a real key is Zaid's acceptance run.
"""
from .base import BaseAdapter


class StubAdapter(BaseAdapter):
    NAME = "stub"

    @property
    def api_key(self) -> str:
        return "not-a-real-key-stub-adapter"

    def chat(self, messages: list[dict]) -> str:
        last = messages[-1]["content"] if messages else ""
        return f"[stub] You said: {last}"
