graph TB
    subgraph "ACP 协议栈"
        EXT[外部 ACP 客户端<br/>stdin/stdout]
        CONN[AgentSideConnection<br/>ndJSON 流]
        AGENT[AcpGatewayAgent<br/>协议翻译器]
        CLIENT[GatewayClient<br/>WebSocket]
        MGR[AcpSessionManager<br/>会话管理单例]
    end

    subgraph "运行时缓存"
        CACHE[RuntimeCache<br/>sessionKey → Handle]
        QUEUE[ActorQueue<br/>每会话串行化]
        EVICT[空闲驱逐<br/>TTL 超时清理]
    end

    EXT --> CONN --> AGENT --> CLIENT
    AGENT --> MGR
    MGR --> CACHE & QUEUE
    CACHE --> EVICT