From dcdd77b5ae386053d5e224311a4ef5ba29d583d0 Mon Sep 17 00:00:00 2001 From: Erik Simon Date: Sat, 4 Apr 2026 04:09:42 +0200 Subject: [PATCH] Add Luna.Shared library with shared DTOs and models Introduce ChannelMessage and ChatStreamUpdate types used across the solution for inter-project communication between channels, core, and the web interface. --- Luna.Shared/ChannelMessage.cs | 10 ++++++++++ Luna.Shared/ChatStreamUpdate.cs | 19 +++++++++++++++++++ Luna.Shared/Luna.Shared.csproj | 10 ++++++++++ 3 files changed, 39 insertions(+) create mode 100644 Luna.Shared/ChannelMessage.cs create mode 100644 Luna.Shared/ChatStreamUpdate.cs create mode 100644 Luna.Shared/Luna.Shared.csproj diff --git a/Luna.Shared/ChannelMessage.cs b/Luna.Shared/ChannelMessage.cs new file mode 100644 index 0000000..45d111b --- /dev/null +++ b/Luna.Shared/ChannelMessage.cs @@ -0,0 +1,10 @@ +namespace Luna.Shared; + +public record ChannelMessage( + string MessageId, + string ConversationId, + string SenderId, + string SenderName, + string Content, + DateTimeOffset Timestamp, + Dictionary? Metadata = null); diff --git a/Luna.Shared/ChatStreamUpdate.cs b/Luna.Shared/ChatStreamUpdate.cs new file mode 100644 index 0000000..2afa9d2 --- /dev/null +++ b/Luna.Shared/ChatStreamUpdate.cs @@ -0,0 +1,19 @@ +namespace Luna.Shared; + +public enum ChatStreamUpdateType +{ + Thinking, + Text, + ToolCall, + ToolResult, + Usage, + Complete +} + +public record ChatStreamUpdate( + ChatStreamUpdateType Type, + string? Content, + string? Role, + bool IsComplete, + string? MessageId = null +); diff --git a/Luna.Shared/Luna.Shared.csproj b/Luna.Shared/Luna.Shared.csproj new file mode 100644 index 0000000..a036bb6 --- /dev/null +++ b/Luna.Shared/Luna.Shared.csproj @@ -0,0 +1,10 @@ + + + + net10.0 + enable + enable + true + + +