Add Luna.Core server with SignalR hub, session management, and tool system
Implement the core application server as an ASP.NET web host with: - SignalR ChatHub for real-time client communication - Session management with token estimation for context windowing - Extensible tool system with attribute-based tool discovery - Chat stream update builder for streaming AI responses - App configuration with appsettings for development and production
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Luna.Shared;
|
||||
|
||||
namespace Luna.Core.Abstractions;
|
||||
|
||||
public interface IChatHubContext
|
||||
{
|
||||
Task SendResponseAsync(string connectionId, ChannelMessage message, CancellationToken cancellationToken = default);
|
||||
|
||||
Task SendStreamingResponseAsync(
|
||||
string connectionId,
|
||||
IAsyncEnumerable<ChatStreamUpdate> messageStream,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Luna.Shared;
|
||||
|
||||
namespace Luna.Core.Abstractions;
|
||||
|
||||
public interface ISessionManager
|
||||
{
|
||||
IAsyncEnumerable<ChatStreamUpdate> RouteMessagesAsync(string content,
|
||||
string conversationId,
|
||||
string connectionId,
|
||||
CancellationToken ct = default);
|
||||
Task ClientDisconnectedAsync(string connectionId);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Luna.Shared\Luna.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user