Templates aus externen Dateien laden, globale USER.md generieren

- Templates/IDENTITY.md, SOUL.md, USER.md als externe Template-Dateien
- gott.csproj: Templates werden beim Publish mitkopiert
- MemoryService: ReadTemplate() liest aus Templates-Ordner
- InitializeAgentFiles: nutzt Templates statt Inline-Strings
- InitializeUserFile: erstellt globale USER.md in data/
- AgentEndpoint: HandleUpdate initialisiert fehlende Files beim Speichern
This commit is contained in:
Meleki committed 2026-03-01 14:24:23 +01:00
1 parent 96af4a3421
commit d067517252
6 files changed
+93 -56

No files matched your search

+2 -1
View File
@@ -62,7 +62,7 @@ public static class AgentEndpoint
await ctx.Response.WriteAsJsonAsync(agent);
}
private static async Task HandleUpdate(HttpContext ctx, DatabaseService db, ImageService imageService)
private static async Task HandleUpdate(HttpContext ctx, DatabaseService db, ImageService imageService, MemoryService memoryService)
{
var agentId = ctx.Request.RouteValues["agentId"]?.ToString();
if (string.IsNullOrEmpty(agentId)) { ctx.Response.StatusCode = 400; return; }
@@ -82,6 +82,7 @@ public static class AgentEndpoint
if (body.TryGetProperty("autoCommit", out var ac)) agent.AutoCommit = ac.GetBoolean();
await db.UpdateAgent(agent);
memoryService.InitializeAgentFiles(agentId, agent.Name);
agent = await db.GetAgent(agentId);
await ctx.Response.WriteAsJsonAsync(agent);
}