From b78e5d844f592110c9ba179460687a78a6a4e120 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 8 Sep 2026 22:17:46 +0200 Subject: [PATCH] InstanceDirectoryManager nach Core verschoben (Vorarbeit #528 Stufe 3) Reiner Umzug, keine Verhaltensaenderung. Der Instanzmanager braucht die Verzeichnisstruktur einer Instanz - anlegen, auflisten, Konfiguration lesen -, aber er darf ClawdDotNet.App nicht referenzieren: Dort haengen sechzehn Werkzeugprojekte dran (Telegram, Mail, FTP, Rocket.Chat, ...), und der Manager soll ausdruecklich keines davon kennen. Ein Projektverweis wuerde sie nicht ausfuehren, aber laden - und die Zusage "keine Werkzeuge im Manager" waere nur noch eine Absichtserklaerung statt einer Eigenschaft des Bauplans. Das Wissen selbst gehoert ohnehin nach Core: Es beschreibt, wie eine Instanz auf der Platte liegt, und InstanceConfig und AgentConfig liegen dort schon. Verschoben nach Core/Instances: InstanceDirectoryManager, InstanceInfo, TokenUsageRecord/TokenUsageFile, AgentListItem/AgentListFile. In ClawdDotNet.App/Models bleiben JobHistoryEntry und die Werkzeug-Ansichtsmodelle, die dort richtig liegen. Build ohne Warnungen, 717 Tests gruen. Co-Authored-By: Claude Opus 5 --- src/ClawdDotNet.App/AppHost.cs | 1 + src/ClawdDotNet.App/Services/AgentAdministration.cs | 1 + .../Models => ClawdDotNet.Core/Instances}/AgentListEntry.cs | 2 +- .../Instances}/InstanceDirectoryManager.cs | 3 +-- .../Models => ClawdDotNet.Core/Instances}/InstanceInfo.cs | 2 +- .../Models => ClawdDotNet.Core/Instances}/TokenUsageRecord.cs | 2 +- src/ClawdDotNet.Desktop/App.axaml.cs | 1 + src/ClawdDotNet.Desktop/ViewModels/InstancePickerViewModel.cs | 1 + .../Services/InstanceLogDirectoryMigrationTests.cs | 1 + tests/ClawdDotNet.App.Tests/Services/TestHost.cs | 1 + 10 files changed, 10 insertions(+), 5 deletions(-) rename src/{ClawdDotNet.App/Models => ClawdDotNet.Core/Instances}/AgentListEntry.cs (94%) rename src/{ClawdDotNet.App/Services => ClawdDotNet.Core/Instances}/InstanceDirectoryManager.cs (99%) rename src/{ClawdDotNet.App/Models => ClawdDotNet.Core/Instances}/InstanceInfo.cs (90%) rename src/{ClawdDotNet.App/Models => ClawdDotNet.Core/Instances}/TokenUsageRecord.cs (97%) diff --git a/src/ClawdDotNet.App/AppHost.cs b/src/ClawdDotNet.App/AppHost.cs index 7815d83..72416f6 100644 --- a/src/ClawdDotNet.App/AppHost.cs +++ b/src/ClawdDotNet.App/AppHost.cs @@ -29,6 +29,7 @@ using ClawdDotNet.Tools.TelegramClient; using ClawdDotNet.Tools.WebFetch; using ClawdDotNet.Tools.WebMonitor; using Microsoft.Extensions.Logging; +using ClawdDotNet.Core.Instances; namespace ClawdDotNet.App; diff --git a/src/ClawdDotNet.App/Services/AgentAdministration.cs b/src/ClawdDotNet.App/Services/AgentAdministration.cs index 71db086..70d2c61 100644 --- a/src/ClawdDotNet.App/Services/AgentAdministration.cs +++ b/src/ClawdDotNet.App/Services/AgentAdministration.cs @@ -1,4 +1,5 @@ using ClawdDotNet.Core.Config; +using ClawdDotNet.Core.Instances; namespace ClawdDotNet.App.Services; diff --git a/src/ClawdDotNet.App/Models/AgentListEntry.cs b/src/ClawdDotNet.Core/Instances/AgentListEntry.cs similarity index 94% rename from src/ClawdDotNet.App/Models/AgentListEntry.cs rename to src/ClawdDotNet.Core/Instances/AgentListEntry.cs index b510ce0..362ab08 100644 --- a/src/ClawdDotNet.App/Models/AgentListEntry.cs +++ b/src/ClawdDotNet.Core/Instances/AgentListEntry.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace ClawdDotNet.App.Models; +namespace ClawdDotNet.Core.Instances; /// /// Eintrag in der AgentList.json – Basisinformationen zu einem Agenten. diff --git a/src/ClawdDotNet.App/Services/InstanceDirectoryManager.cs b/src/ClawdDotNet.Core/Instances/InstanceDirectoryManager.cs similarity index 99% rename from src/ClawdDotNet.App/Services/InstanceDirectoryManager.cs rename to src/ClawdDotNet.Core/Instances/InstanceDirectoryManager.cs index eeb5f72..00e9c1f 100644 --- a/src/ClawdDotNet.App/Services/InstanceDirectoryManager.cs +++ b/src/ClawdDotNet.Core/Instances/InstanceDirectoryManager.cs @@ -2,9 +2,8 @@ using System.Text.Json; using ClawdDotNet.Core.Config; using ClawdDotNet.Core.Security; using ClawdDotNet.Core.Storage; -using ClawdDotNet.App.Models; -namespace ClawdDotNet.App.Services; +namespace ClawdDotNet.Core.Instances; /// /// Verwaltet die gesamte Verzeichnisstruktur für Instanzen und Agenten. diff --git a/src/ClawdDotNet.App/Models/InstanceInfo.cs b/src/ClawdDotNet.Core/Instances/InstanceInfo.cs similarity index 90% rename from src/ClawdDotNet.App/Models/InstanceInfo.cs rename to src/ClawdDotNet.Core/Instances/InstanceInfo.cs index c633427..4a0bdaa 100644 --- a/src/ClawdDotNet.App/Models/InstanceInfo.cs +++ b/src/ClawdDotNet.Core/Instances/InstanceInfo.cs @@ -1,4 +1,4 @@ -namespace ClawdDotNet.App.Models; +namespace ClawdDotNet.Core.Instances; /// /// Zusammenfassung einer Instanz für die Anzeige im InstanceManager. diff --git a/src/ClawdDotNet.App/Models/TokenUsageRecord.cs b/src/ClawdDotNet.Core/Instances/TokenUsageRecord.cs similarity index 97% rename from src/ClawdDotNet.App/Models/TokenUsageRecord.cs rename to src/ClawdDotNet.Core/Instances/TokenUsageRecord.cs index ace0d01..6ba76cb 100644 --- a/src/ClawdDotNet.App/Models/TokenUsageRecord.cs +++ b/src/ClawdDotNet.Core/Instances/TokenUsageRecord.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace ClawdDotNet.App.Models; +namespace ClawdDotNet.Core.Instances; public sealed class TokenUsageRecord { diff --git a/src/ClawdDotNet.Desktop/App.axaml.cs b/src/ClawdDotNet.Desktop/App.axaml.cs index dbd0750..4d362ef 100644 --- a/src/ClawdDotNet.Desktop/App.axaml.cs +++ b/src/ClawdDotNet.Desktop/App.axaml.cs @@ -11,6 +11,7 @@ using ClawdDotNet.Desktop.Services; using ClawdDotNet.Desktop.ViewModels; using ClawdDotNet.Desktop.Views; using ClawdDotNet.Web; +using ClawdDotNet.Core.Instances; namespace ClawdDotNet.Desktop; diff --git a/src/ClawdDotNet.Desktop/ViewModels/InstancePickerViewModel.cs b/src/ClawdDotNet.Desktop/ViewModels/InstancePickerViewModel.cs index 3ce59b3..349e58b 100644 --- a/src/ClawdDotNet.Desktop/ViewModels/InstancePickerViewModel.cs +++ b/src/ClawdDotNet.Desktop/ViewModels/InstancePickerViewModel.cs @@ -3,6 +3,7 @@ using ClawdDotNet.App.Models; using ClawdDotNet.App.Services; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; +using ClawdDotNet.Core.Instances; namespace ClawdDotNet.Desktop.ViewModels; diff --git a/tests/ClawdDotNet.App.Tests/Services/InstanceLogDirectoryMigrationTests.cs b/tests/ClawdDotNet.App.Tests/Services/InstanceLogDirectoryMigrationTests.cs index 8fdf4ab..1105702 100644 --- a/tests/ClawdDotNet.App.Tests/Services/InstanceLogDirectoryMigrationTests.cs +++ b/tests/ClawdDotNet.App.Tests/Services/InstanceLogDirectoryMigrationTests.cs @@ -2,6 +2,7 @@ using System.Text.Json; using ClawdDotNet.App.Services; using ClawdDotNet.Core.Config; using Shouldly; +using ClawdDotNet.Core.Instances; namespace ClawdDotNet.App.Tests.Services; diff --git a/tests/ClawdDotNet.App.Tests/Services/TestHost.cs b/tests/ClawdDotNet.App.Tests/Services/TestHost.cs index 811a020..68dde50 100644 --- a/tests/ClawdDotNet.App.Tests/Services/TestHost.cs +++ b/tests/ClawdDotNet.App.Tests/Services/TestHost.cs @@ -3,6 +3,7 @@ using ClawdDotNet.App.Settings; using ClawdDotNet.Core.Config; using ClawdDotNet.Core.Tools; using Microsoft.Extensions.Logging.Abstractions; +using ClawdDotNet.Core.Instances; namespace ClawdDotNet.App.Tests.Services;