using Luna.Shared;
namespace Luna.Channels.Abstractions;
public delegate Task ChannelMessageReceivedEventHandler(object? sender, ChannelMessageReceivedEventArgs args);
public delegate Task ChannelConnectionChangedEventHandler(object? sender, ChannelConnectionEventArgs args);
///
/// Represents a communication channel for the Luna AI Assistant.
/// Channels handle sending and receiving messages via different platforms
/// (e.g., CLI, Telegram, Discord, Email).
///
public interface IChannel : IDisposable
{
///
/// Unique identifier for this channel instance
///
string ChannelId { get; }
///
/// Type of channel (e.g., "cli", "telegram", "discord")
///
string ChannelType { get; }
///
/// Display name for the channel
///
string DisplayName { get; }
///
/// Indicates whether the channel is currently connected and ready
///
bool IsConnected { get; }
///
/// Event raised when a message is received from the channel
///
event ChannelMessageReceivedEventHandler? MessageReceived;
///
/// Event raised when the channel connection state changes
///
event ChannelConnectionChangedEventHandler? ConnectionStateChanged;
///
/// Send a message to the channel
///
/// The message to send
/// Cancellation token
/// Task representing the send operation
Task SendMessageAsync(ChannelMessage message, CancellationToken cancellationToken = default);
///
/// Send a streaming response to the channel
///
/// Async enumerable of response updates
/// Cancellation token
/// Task representing the send operation
Task SendStreamingMessageAsync(IAsyncEnumerable messageStream, CancellationToken cancellationToken = default);
}