#pragma once // Spec: shell.md "Sockets" (MessagesSocket protocol). Swift AsyncStream becomes an event handler // invoked on the UI thread. connect/disconnect are idempotent; send* are fire and forget (dropped when not open). #include #include #include #include "model/ChatSocketEvent.hpp" namespace dp { class MessagesSocket { public: using EventHandler = std::function; virtual ~MessagesSocket() = default; virtual void setEventHandler(EventHandler handler) = 0; virtual void connect() = 0; virtual void disconnect() = 0; virtual void send(const std::string& content, const std::vector& attachmentUids, const std::string& clientId) = 0; virtual void sendTyping() = 0; virtual void sendRead(const std::string& withUid) = 0; }; } // namespace dp