Use reactive daemon state for surface commands

This commit is contained in:
Meta Vens 2026-06-28 10:33:09 +01:00
commit dd68efd9cd
2 changed files with 12 additions and 6 deletions

View file

@ -3265,8 +3265,8 @@ static void RequireEveRuntimeBootstrap(string root)
"EveSurfaceCommandRequest request",
"request.ProviderId, \"aetheria.daemon\"",
"AetheriaClient",
"AetheriaRuntimeObservedDaemonState",
".ReadAsync(client.State)",
"client.State.ReactiveObservedDaemon()",
"observedState.TryCurrent(out var current)",
"new AetheriaRuntimeDaemonOperationClient(",
"AetheriaRuntimeDaemonSurfaceCommandCatalog.TrySubmitArgumentless(",
"AetheriaRuntimeDaemonSurfaceCommandCatalog.CommandPrefix"
@ -3287,6 +3287,12 @@ static void RequireEveRuntimeBootstrap(string root)
"Daemon Eve surface command routing still reads observed daemon state through the runtime file reader instead of the Verse client.");
}
if (daemonSurfaceCommands.Contains(".ReadAsync(client.State)", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"Daemon Eve surface command routing still samples observed daemon state through a one-shot compatibility helper instead of a managed reactive document.");
}
if (daemonSurfaceCommands.Contains("ObserveAsync()", StringComparison.Ordinal))
{
throw new InvalidOperationException(

View file

@ -21,10 +21,10 @@ namespace GameCult.Aetheria.State.Verse
return false;
}
var observed = AetheriaRuntimeObservedDaemonState
.ReadAsync(client.State)
.GetAwaiter()
.GetResult();
using var observedState = client.State.ReactiveObservedDaemon();
var observed = observedState.TryCurrent(out var current)
? current
: null;
var operationClient = new AetheriaRuntimeDaemonOperationClient(
client.StatePath,
string.IsNullOrWhiteSpace(request.ClientId) ? AetheriaRuntimeDaemonOperationClient.DefaultClientId : request.ClientId,