BareGit
#pragma once

#include <string>
#include <string_view>
#include <vector>

namespace agent_smith::internal
{

/// Incrementally extracts SSE data payloads from arbitrary byte chunks.
class SseFrameParser
{
public:
    /// Consume a chunk and return every complete non-terminal data payload.
    std::vector<std::string> feed(std::string_view bytes);

    /// Return whether the terminal SSE payload `[DONE]` has been received.
    bool finished() const noexcept;

private:
    std::string buffer_;
    bool finished_ = false;
};

} // namespace agent_smith::internal