Skip to content

Commit 563ca6b

Browse files
committed
refactor: add "sealed" keyword to core classes
- additionally removed some unused usings Closes #106
1 parent ae5f947 commit 563ca6b

File tree

11 files changed

+11
-18
lines changed

11 files changed

+11
-18
lines changed

src/MaIN.Core/Hub/AiHub.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class AIHub
1313
private static IHttpClientFactory _httpClientFactory = null!;
1414

1515
internal static void Initialize(IAIHubServices services,
16-
MaINSettings settings,
16+
MaINSettings settings,
1717
IHttpClientFactory httpClientFactory)
1818
{
1919
_services = services;
@@ -38,7 +38,7 @@ public static void DisableLLamaLogs()
3838
{
3939
NativeLogConfig.llama_log_set((_,_) => {});
4040
}
41-
41+
4242
public static void DisableNotificationsLogs()
4343
{
4444
INotificationService.Disable = true;

src/MaIN.Core/Hub/Contexts/AgentContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace MaIN.Core.Hub.Contexts;
1414

15-
public class AgentContext
15+
public sealed class AgentContext
1616
{
1717
private readonly IAgentService _agentService;
1818
private InferenceParams? _inferenceParams;

src/MaIN.Core/Hub/Contexts/ChatContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace MaIN.Core.Hub.Contexts;
1212

13-
public class ChatContext
13+
public sealed class ChatContext
1414
{
1515
private readonly IChatService _chatService;
1616
private bool _preProcess;

src/MaIN.Core/Hub/Contexts/FlowContext.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
using MaIN.Domain.Entities;
55
using MaIN.Domain.Entities.Agents;
66
using MaIN.Domain.Entities.Agents.AgentSource;
7-
using MaIN.Services.Dtos;
8-
using MaIN.Services.Mappers;
97
using MaIN.Services.Services.Abstract;
108
using MaIN.Services.Services.Models;
119

1210
namespace MaIN.Core.Hub.Contexts;
1311

14-
public class FlowContext
12+
public sealed class FlowContext
1513
{
1614
private readonly IAgentFlowService _flowService;
1715
private readonly IAgentService _agentService;

src/MaIN.Core/Hub/Contexts/McpContext.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
21
using MaIN.Domain.Configuration;
32
using MaIN.Domain.Entities;
43
using MaIN.Services.Constants;
5-
using MaIN.Services.Services;
64
using MaIN.Services.Services.Abstract;
75
using MaIN.Services.Services.Models;
86

97
namespace MaIN.Core.Hub.Contexts;
108

11-
public class McpContext
9+
public sealed class McpContext
1210
{
1311
private readonly IMcpService _mcpService;
1412
private Mcp? _mcpConfig;

src/MaIN.Core/Hub/Contexts/ModelContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace MaIN.Core.Hub.Contexts;
99

10-
public class ModelContext
10+
public sealed class ModelContext
1111
{
1212
private readonly MaINSettings _settings;
1313
private readonly IHttpClientFactory _httpClientFactory;

src/MaIN.Core/Hub/Utils/KnowledgeBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace MaIN.Core.Hub.Utils;
77

8-
public class KnowledgeBuilder
8+
public sealed class KnowledgeBuilder
99
{
1010
private Agent? _agent;
1111
private KnowledgeIndex? _index;

src/MaIN.Core/Hub/Utils/StepBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace MaIN.Core.Hub.Utils;
55

6-
public class StepBuilder
6+
public sealed class StepBuilder
77
{
88
private readonly List<string> Steps = new();
99
public static StepBuilder Instance => new();

src/MaIN.Core/Hub/Utils/ToolConfigurationBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace MaIN.Core.Hub.Utils;
55
//TODO try to share logic of adding tool to the list across methods https://github.com/wisedev-code/MaIN.NET/pull/98#discussion_r2454997846
6-
public class ToolsConfigurationBuilder
6+
public sealed class ToolsConfigurationBuilder
77
{
88
private readonly ToolsConfiguration _config = new() { Tools = [] };
99

src/MaIN.Core/Interfaces/IAIHubService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using MaIN.Services.Services;
21
using MaIN.Services.Services.Abstract;
32

43
namespace MaIN.Core.Interfaces;

0 commit comments

Comments
 (0)