feat(settings): claude_bin im Dateien-Tab setzbar, mit Auflösungs-Check
Bisher nur per Hand in worker.config.json. Neuer Abschnitt CLAUDE CLI mit eigenem Save-Button (die Datei gehoert dem Worker, nicht app_settings) und einer Zeile, wohin der Wert per ExecutableResolver tatsaechlich aufloest — 'nicht im PATH gefunden' war bisher erst am fehlgeschlagenen Run zu sehen. WorkerConfig ist DI-Singleton und ClaudeProcess loest pro Spawn auf, also greift die Aenderung ab dem naechsten Run ohne Neustart. SaveOnlineInbox/SaveClaudeBin teilen jetzt ein SaveKey(), damit beide dieselbe read-modify-write-Semantik haben (alle anderen Keys bleiben unberuehrt). Die zugehoerigen Locale-Keys sind im vorigen Commit mitgelaufen.
This commit is contained in:
@@ -96,6 +96,14 @@ public sealed class WorkerConfig
|
||||
/// Reads the existing JSON, replaces the <c>online_inbox</c> node, and writes back indented.
|
||||
/// </summary>
|
||||
public void SaveOnlineInbox(string? path = null)
|
||||
=> SaveKey("online_inbox", JsonSerializer.SerializeToNode(OnlineInbox, InboxSerializerOpts), path);
|
||||
|
||||
/// <summary>Persists ONLY <c>claude_bin</c>, same read-modify-write as
|
||||
/// <see cref="SaveOnlineInbox"/> — every other field in the file stays untouched.</summary>
|
||||
public void SaveClaudeBin(string? path = null)
|
||||
=> SaveKey("claude_bin", JsonValue.Create(ClaudeBin), path);
|
||||
|
||||
private static void SaveKey(string key, JsonNode? value, string? path)
|
||||
{
|
||||
path ??= DefaultConfigPath;
|
||||
|
||||
@@ -103,7 +111,7 @@ public sealed class WorkerConfig
|
||||
? JsonNode.Parse(File.ReadAllText(path)) as JsonObject ?? new JsonObject()
|
||||
: new JsonObject();
|
||||
|
||||
root["online_inbox"] = JsonSerializer.SerializeToNode(OnlineInbox, InboxSerializerOpts);
|
||||
root[key] = value;
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
|
||||
File.WriteAllText(path, root.ToJsonString(WriteOpts));
|
||||
|
||||
Reference in New Issue
Block a user