Files
ClawdDotNet/src/ClawdDotNet.Core/Config/ServiceConfig.cs
T

87 lines
2.4 KiB
C#

using System.Text.Json.Serialization;
namespace ClawdDotNet.Core.Config;
public sealed class ServiceConfig
{
[JsonPropertyName("serviceId")]
public string ServiceId { get; set; } = Guid.NewGuid().ToString("N")[..8];
[JsonPropertyName("name")]
public string Name { get; set; } = "";
[JsonPropertyName("type")]
public string Type { get; set; } = "";
[JsonPropertyName("port")]
public int Port { get; set; }
[JsonPropertyName("enabled")]
public bool Enabled { get; set; } = true;
[JsonPropertyName("autoStart")]
public bool AutoStart { get; set; }
[JsonPropertyName("description")]
public string Description { get; set; } = "";
[JsonPropertyName("builtIn")]
public bool BuiltIn { get; set; }
}
public static class BuiltInServices
{
public const string AgentChatWebUI = "AgentChatWebUI";
public const string AgentWebsite = "AgentWebsite";
public const string ClawdDotNetApi = "ClawdDotNetApi";
public const string InstanceWatchdog = "InstanceWatchdog";
public static List<ServiceConfig> CreateDefaults() =>
[
new()
{
ServiceId = "svc_chat",
Name = "Agent Chat WebUI",
Type = AgentChatWebUI,
Port = 5080,
Enabled = true,
AutoStart = true,
BuiltIn = true,
Description = "WebUI für den Agenten-Chat (WebView2)"
},
new()
{
ServiceId = "svc_web",
Name = "Agent Website",
Type = AgentWebsite,
Port = 5081,
Enabled = false,
AutoStart = false,
BuiltIn = true,
Description = "Von Agenten entwickelte und betreute Website"
},
new()
{
ServiceId = "svc_api",
Name = "ClawdDotNet API",
Type = ClawdDotNetApi,
Port = 5082,
Enabled = true,
AutoStart = true,
BuiltIn = true,
Description = "REST-API für die Kommunikation mit der WebApp"
},
new()
{
ServiceId = "svc_watchdog",
Name = "Instanz-Watchdog",
Type = InstanceWatchdog,
Port = 0,
Enabled = false,
AutoStart = true,
BuiltIn = true,
Description = "Sendet Heartbeats ans Deploymentcenter (URL/Token in den Anwendungseinstellungen)"
}
];
}