Share Eve surface contract through Verse client
This commit is contained in:
parent
083cfc3ae3
commit
54aea11b5b
5 changed files with 125 additions and 10 deletions
|
|
@ -803,6 +803,7 @@ static void RequirePackageSerializerBoundary(string root)
|
|||
"AetheriaRuntimeVerseClient.cs",
|
||||
"AetheriaRuntimeSnapshotDocuments.cs",
|
||||
"AetheriaRuntimeEveCommandDocument.cs",
|
||||
"AetheriaRuntimeEveSurfaceState.cs",
|
||||
"AetheriaRuntimeDaemonDocuments.cs",
|
||||
"AetheriaRuntimeDaemonSoaDocuments.cs"
|
||||
};
|
||||
|
|
@ -8048,10 +8049,12 @@ static void RequireDaemonVersePublication(string root)
|
|||
static void RequireAetheriaRuntimeVerseClientContract(string root)
|
||||
{
|
||||
var clientPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeVerseClient.cs");
|
||||
var surfaceStatePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeEveSurfaceState.cs");
|
||||
var oldSurfaceStatePath = Path.Combine(root, "Aetheria.State", "Documents", "EveSurfaceState.cs");
|
||||
var commandPortPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeCommandPort.cs");
|
||||
var docPath = Path.Combine(root, "docs", "aetheria-verse-client-contract.md");
|
||||
|
||||
var requiredFiles = new[] { clientPath, commandPortPath, docPath };
|
||||
var requiredFiles = new[] { clientPath, surfaceStatePath, commandPortPath, docPath };
|
||||
var missingFiles = requiredFiles
|
||||
.Where(path => !File.Exists(path))
|
||||
.Select(path => Path.GetRelativePath(root, path))
|
||||
|
|
@ -8064,9 +8067,16 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
}
|
||||
|
||||
var client = File.ReadAllText(clientPath);
|
||||
var surfaceState = File.ReadAllText(surfaceStatePath);
|
||||
var commandPort = File.ReadAllText(commandPortPath);
|
||||
var doc = File.ReadAllText(docPath);
|
||||
|
||||
if (File.Exists(oldSurfaceStatePath))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"EveSurfaceState must live in the shared runtime package so every CultMesh client can watch daemon UI surfaces.");
|
||||
}
|
||||
|
||||
var requiredClientSymbols = new[]
|
||||
{
|
||||
"public sealed class AetheriaRuntimeVerseClient",
|
||||
|
|
@ -8079,6 +8089,12 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
"WatchRecord<AetheriaRuntimeDaemonFrameDocument>",
|
||||
"WatchRecord<AetheriaRuntimeDaemonSoaViewDocument>",
|
||||
"AetheriaRuntimeVerseDocument<AetheriaRuntimeDaemonFrameDocument>",
|
||||
"CultNetDocumentBinding.ForDocument<EveSurfaceState>(registry)",
|
||||
"GetDaemonGameTuiSurfaceAsync()",
|
||||
"GetDaemonEditorTuiSurfaceAsync()",
|
||||
"WatchDaemonGameTuiSurfaces()",
|
||||
"WatchDaemonEditorTuiSurfaces()",
|
||||
"AetheriaRuntimeVerseDocument<EveSurfaceState>",
|
||||
"SubmitDaemonCommandAsync(",
|
||||
"AetheriaRuntimeVerseRecordKeys.DaemonCommand(command.CommandId)",
|
||||
"DaemonGameTuiSurface { get; }",
|
||||
|
|
@ -8094,6 +8110,25 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
string.Join(", ", missingClientSymbols));
|
||||
}
|
||||
|
||||
var requiredSurfaceSymbols = new[]
|
||||
{
|
||||
"namespace Aetheria.State.Documents",
|
||||
"[CultDocument(\"gamecult.eve.surface\", \"gamecult.eve.surface.v1\")]",
|
||||
"public sealed class EveSurfaceState",
|
||||
"public sealed class EveSurface",
|
||||
"public sealed class EveSurfaceComponent",
|
||||
"public sealed class EveCommandTemplate"
|
||||
};
|
||||
var missingSurfaceSymbols = requiredSurfaceSymbols
|
||||
.Where(symbol => !surfaceState.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
if (missingSurfaceSymbols.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Shared runtime Eve surface document contract is incomplete: " +
|
||||
string.Join(", ", missingSurfaceSymbols));
|
||||
}
|
||||
|
||||
if (!commandPort.Contains("AetheriaRuntimeVerseContractRegistry.CreateCultCacheRegistry()", StringComparison.Ordinal) ||
|
||||
!commandPort.Contains("AetheriaRuntimeVerseContractRegistry.CreateCultNetRegistry(registry)", StringComparison.Ordinal) ||
|
||||
!commandPort.Contains("AetheriaRuntimeVerseRecordKeys.DaemonCommand(commandId)", StringComparison.Ordinal) ||
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@
|
|||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeStatRecipes.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeClientTargetCommands.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeEveCommandDocument.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeEveSurfaceState.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeVerseReplicaBridge.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeDaemonFrameStore.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeDaemonPublicationStore.cs" />
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using GameCult.Caching;
|
||||
using MessagePack;
|
||||
|
||||
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Aetheria.State.Documents;
|
||||
using GameCult.Caching;
|
||||
using GameCult.Caching.MessagePack;
|
||||
using GameCult.Mesh;
|
||||
|
|
@ -76,7 +77,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
typeof(AetheriaRuntimeDaemonFrameDocument),
|
||||
typeof(AetheriaRuntimeDaemonSoaViewDocument),
|
||||
typeof(AetheriaRuntimeDaemonCommandDocument),
|
||||
typeof(AetheriaRuntimeEveCommandDocument)
|
||||
typeof(AetheriaRuntimeEveCommandDocument),
|
||||
typeof(EveSurfaceState)
|
||||
};
|
||||
|
||||
public static CultDocumentRegistry CreateCultCacheRegistry()
|
||||
|
|
@ -103,7 +105,8 @@ namespace GameCult.Aetheria.State.Verse
|
|||
CultNetDocumentBinding.ForDocument<AetheriaRuntimeDaemonFrameDocument>(registry),
|
||||
CultNetDocumentBinding.ForDocument<AetheriaRuntimeDaemonSoaViewDocument>(registry),
|
||||
CultNetDocumentBinding.ForDocument<AetheriaRuntimeDaemonCommandDocument>(registry),
|
||||
CultNetDocumentBinding.ForDocument<AetheriaRuntimeEveCommandDocument>(registry)
|
||||
CultNetDocumentBinding.ForDocument<AetheriaRuntimeEveCommandDocument>(registry),
|
||||
CultNetDocumentBinding.ForDocument<EveSurfaceState>(registry)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -240,6 +243,30 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest);
|
||||
}
|
||||
|
||||
public Task<EveSurfaceState?> GetDaemonGameSurfaceAsync()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Database.GetAsync<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface);
|
||||
}
|
||||
|
||||
public Task<EveSurfaceState?> GetDaemonGameTuiSurfaceAsync()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Database.GetAsync<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface);
|
||||
}
|
||||
|
||||
public Task<EveSurfaceState?> GetDaemonEditorSurfaceAsync()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Database.GetAsync<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface);
|
||||
}
|
||||
|
||||
public Task<EveSurfaceState?> GetDaemonEditorTuiSurfaceAsync()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Database.GetAsync<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeVerseDocument<AetheriaRuntimeDaemonProviderAdvertisementDocument> ProviderAdvertisement()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
|
@ -275,6 +302,30 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeVerseDocument<EveSurfaceState> DaemonGameSurface()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Document<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeVerseDocument<EveSurfaceState> DaemonGameTuiSurface()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Document<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeVerseDocument<EveSurfaceState> DaemonEditorSurface()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Document<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeVerseDocument<EveSurfaceState> DaemonEditorTuiSurface()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Document<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface);
|
||||
}
|
||||
|
||||
public Observable<CultNetDatabaseChange<AetheriaRuntimeDaemonProviderAdvertisementDocument>>
|
||||
WatchProviderAdvertisements()
|
||||
{
|
||||
|
|
@ -312,6 +363,30 @@ namespace GameCult.Aetheria.State.Verse
|
|||
AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest);
|
||||
}
|
||||
|
||||
public Observable<CultNetDatabaseChange<EveSurfaceState>> WatchDaemonGameSurfaces()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Database.WatchRecord<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface);
|
||||
}
|
||||
|
||||
public Observable<CultNetDatabaseChange<EveSurfaceState>> WatchDaemonGameTuiSurfaces()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Database.WatchRecord<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface);
|
||||
}
|
||||
|
||||
public Observable<CultNetDatabaseChange<EveSurfaceState>> WatchDaemonEditorSurfaces()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Database.WatchRecord<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface);
|
||||
}
|
||||
|
||||
public Observable<CultNetDatabaseChange<EveSurfaceState>> WatchDaemonEditorTuiSurfaces()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return Database.WatchRecord<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface);
|
||||
}
|
||||
|
||||
public async Task<AetheriaRuntimeDaemonCommandEnvelope> SubmitDaemonCommandAsync(
|
||||
AetheriaRuntimeDaemonCommandDocument command,
|
||||
bool flush = true)
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ package. It opens a local `CultMeshNode` with the runtime-only Aetheria contract
|
|||
registry and exposes:
|
||||
|
||||
- current typed reads for provider advertisement, health, command boundary,
|
||||
latest daemon frame, and latest SoA view;
|
||||
latest daemon frame, latest SoA view, and daemon game/editor Eve surfaces;
|
||||
- reactive watches via `WatchRecord<T>()`, including `WatchLatestFrames()` and
|
||||
`WatchLatestSoaViews()`;
|
||||
`WatchLatestSoaViews()`, plus daemon GUI/TUI surface watches;
|
||||
- `AetheriaRuntimeVerseDocument<T>` handles for transparent reactive POCO
|
||||
presentation;
|
||||
- typed daemon and Eve command submission through the same command record keys
|
||||
|
|
@ -68,8 +68,11 @@ The daemon already publishes game and editor Eve surface records at these keys:
|
|||
- `eve:surface:aetheria.daemon.editor`
|
||||
- `eve:surface:aetheria.daemon.editor.tui`
|
||||
|
||||
`AetheriaRuntimeVerseRecordKeys` exposes those keys now. The remaining cleanup is
|
||||
to move the `EveSurfaceState` document contract into the shared runtime package
|
||||
so `AetheriaRuntimeVerseClient` can expose typed surface watches too. Until then,
|
||||
surface resolution stays in the existing Eve Unity runtime host, which already
|
||||
resolves Aetheria state refs automatically.
|
||||
`AetheriaRuntimeVerseRecordKeys` exposes those keys and
|
||||
`AetheriaRuntimeVerseClient` exposes typed reads, document handles, and
|
||||
`WatchRecord<EveSurfaceState>()` subscriptions for all four. The
|
||||
`EveSurfaceState` document contract lives in the shared runtime package so a
|
||||
Unity client, terminal client, daemon inspector, or later non-C# runtime binding
|
||||
can lower the same published UI surface. The existing Eve Unity runtime host can
|
||||
keep resolving Aetheria state refs automatically; it should consume those refs as
|
||||
part of lowering the shared surface, not as a separate authority path.
|
||||
|
|
|
|||
Loading…
Reference in a new issue